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K,MAAM,IAC1B,EAAG,MAAM,KAAO,EAAG,EAAM,GAAQ,EAAO,OAAQ,IAChD,EAAS,KAAK,EAChB,CAGA,KAAO,EAAI,EAAI,OAAQ,IAAK,CAC1B,EAAK,GACD,EAAK,EAAI,GAAb,IACE,EAAQ,EAAS,MACnB,EAAG,MAAM,IAAM,EAAG,EAAO,GAAS,EAAO,MAAO,IAChD,EAAG,MAAM,KAAO,EAAG,EAAE,IACrB,EAAS,KAAK,EAChB,CAEA,EAAK,GACL,IAAI,EAAQ,EAAS,GACrB,EAAU,MAAM,OAAS,EAAG,EAAO,GAAS,EAAO,SAAU,IAG7D,IAAI,EAAiB,EAAM,GAC3B,SAAS,EAAO,GACV,EAAM,IAAc,IACtB,EAAE,OAAO,oBAAoB,EAAE,KAAM,GACrC,UAAU,GAEd,CAEI,OAAO,iBACT,OAAO,iBAAiB,SAAU,GAElC,SAAS,KAAK,SAAW,CAE7B","file":"/npm/anzhiyu-theme-static@1.1.10/waterfall/waterfall.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/anzhiyu-theme-static@1.1.10/waterfall/waterfall.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/*!\n--------------------------------\nWaterfall.js\n--------------------------------\n+ https://github.com/raphamorim/waterfall\n+ version 1.0.0\n+ Copyright 2015 Raphael Amorim\n+ Licensed under the MIT license\n+ Documentation: https://github.com/raphamorim/waterfall\n*/\nfunction waterfall(container) {\n  if (typeof container === \"string\") container = document.querySelector(container);\n\n  // Freeze the list of nodes\n  var els = [].map.call(container.children, function (el) {\n    el.style.position = \"absolute\";\n    return el;\n  });\n  container.style.position = \"relative\";\n\n  function margin(name, el) {\n    var style = window.getComputedStyle(el);\n    return parseFloat(style[\"margin\" + name]) || 0;\n  }\n  function px(n) {\n    return n + \"px\";\n  }\n  function y(el) {\n    return parseFloat(el.style.top);\n  }\n  function x(el) {\n    return parseFloat(el.style.left);\n  }\n  function width(el) {\n    return el.clientWidth;\n  }\n  function height(el) {\n    return el.clientHeight;\n  }\n  function bottom(el) {\n    return y(el) + height(el) + margin(\"Bottom\", el);\n  }\n  function right(el) {\n    return x(el) + width(el) + margin(\"Right\", el);\n  }\n\n  function sort(l) {\n    l = l.sort(function (a, b) {\n      if (bottom(a) === bottom(b)) {\n        return x(b) - x(a);\n      } else {\n        return bottom(b) - bottom(a);\n      }\n    });\n  }\n\n  var boundary = [];\n\n  // Deal with the first element.\n  if (els.length) {\n    els[0].style.top = \"0px\";\n    els[0].style.left = px(margin(\"Left\", els[0]));\n    boundary.push(els[0]);\n  }\n\n  // Deal with the first line.\n  for (var i = 1; i < els.length; i++) {\n    var prev = els[i - 1],\n      el = els[i],\n      thereIsSpace = right(prev) + width(el) <= width(container);\n    if (!thereIsSpace) break;\n    el.style.top = prev.style.top;\n    el.style.left = px(right(prev) + margin(\"Left\", el));\n    boundary.push(el);\n  }\n\n  // Place following elements at the bottom of the smallest column.\n  for (; i < els.length; i++) {\n    sort(boundary);\n    var el = els[i],\n      minEl = boundary.pop();\n    el.style.top = px(bottom(minEl) + margin(\"Top\", el));\n    el.style.left = px(x(minEl));\n    boundary.push(el);\n  }\n\n  sort(boundary);\n  var maxEl = boundary[0];\n  container.style.height = px(bottom(maxEl) + margin(\"Bottom\", maxEl));\n\n  // Responds to window resize\n  var containerWidth = width(container);\n  function resize(e) {\n    if (width(container) != containerWidth) {\n      e.target.removeEventListener(e.type, resize);\n      waterfall(container);\n    }\n  }\n\n  if (window.addEventListener) {\n    window.addEventListener(\"resize\", resize);\n  } else {\n    document.body.onresize = resize;\n  }\n}\n"]}