import { X as it } from "./index-6wLGsgHc.js";
function rt(z, u) {
  for (var p = 0; p < u.length; p++) {
    const S = u[p];
    if (typeof S != "string" && !Array.isArray(S)) {
      for (const O in S) if (O !== "default" && !(O in z)) {
        const M = Object.getOwnPropertyDescriptor(S, O);
        M && Object.defineProperty(z, O, M.get ? M : {
          enumerable: !0,
          get: () => S[O]
        });
      }
    }
  }
  return Object.freeze(Object.defineProperty(z, Symbol.toStringTag, {
    value: "Module"
  }));
}
var ke = {
  exports: {}
}, Le;
function at() {
  return Le || (Le = 1, (function(z) {
    (function(u) {
      if (typeof window > "u") return;
      var p = !0, S = 10, O = "", M = 0, j = "", J = null, ie = "", D = !1, Pe = {
        resize: 1,
        click: 1
      }, U = 128, re = !0, R = 1, X = "bodyOffset", h = X, ae = !0, ce = "", k = {}, I = 32, ue = null, _ = !1, V = !1, q = "[iFrameSizer]", se = q.length, H = "", le = {
        max: 1,
        min: 1,
        bodyScroll: 1,
        documentElementScroll: 1
      }, Y = "child", fe = window.parent, L = "*", K = 0, W = !1, de = null, F = 16, P = 1, me = "scroll", v = me, je = window, Q = function() {
        T("onMessage function not defined");
      }, $ = function() {
      }, G = function() {
      }, Z = {
        height: function() {
          return T("Custom height calculation function not defined"), document.documentElement.offsetHeight;
        },
        width: function() {
          return T("Custom width calculation function not defined"), document.body.scrollWidth;
        }
      }, ee = {}, ge = !1;
      function he() {
      }
      try {
        var pe = Object.create({}, {
          passive: {
            // eslint-disable-next-line getter-return
            get: function() {
              ge = !0;
            }
          }
        });
        window.addEventListener("test", he, pe), window.removeEventListener("test", he, pe);
      } catch {
      }
      function C(e, t, n, o) {
        e.addEventListener(t, n, ge ? o || {} : !1);
      }
      function De(e, t, n) {
        e.removeEventListener(t, n, !1);
      }
      function ve(e) {
        return e.charAt(0).toUpperCase() + e.slice(1);
      }
      function qe(e) {
        var t, n, o, a = null, l = 0, m = function() {
          l = Date.now(), a = null, o = e.apply(t, n), a || (t = n = null);
        };
        return function() {
          var d = Date.now();
          l || (l = d);
          var c = F - (d - l);
          return t = this, n = arguments, c <= 0 || c > F ? (a && (clearTimeout(a), a = null), l = d, o = e.apply(t, n), a || (t = n = null)) : a || (a = setTimeout(m, c)), o;
        };
      }
      function ye(e) {
        return q + "[" + H + "] " + e;
      }
      function i(e) {
        _ && typeof window.console == "object" && console.log(ye(e));
      }
      function T(e) {
        typeof window.console == "object" && console.warn(ye(e));
      }
      function He() {
        We(), i("Initialising iFrame (" + window.location.href + ")"), Je(), Xe(), te("background", O), te("padding", ie), Ke(), Te(), Ee(), _e(), Ge(), $e(), Oe(), k = Qe(), A("init", "Init message from host page"), $();
      }
      function We() {
        function e(n) {
          return n === "true";
        }
        var t = ce.slice(se).split(":");
        H = t[0], M = u === t[1] ? M : Number(t[1]), D = u === t[2] ? D : e(t[2]), _ = u === t[3] ? _ : e(t[3]), I = u === t[4] ? I : Number(t[4]), p = u === t[6] ? p : e(t[6]), j = t[7], h = u === t[8] ? h : t[8], O = t[9], ie = t[10], K = u === t[11] ? K : Number(t[11]), k.enable = u === t[12] ? !1 : e(t[12]), Y = u === t[13] ? Y : t[13], v = u === t[14] ? v : t[14], V = u === t[15] ? V : e(t[15]);
      }
      function Be(e) {
        var t = e.split("Callback");
        if (t.length === 2) {
          var n = "on" + t[0].charAt(0).toUpperCase() + t[0].slice(1);
          this[n] = this[e], delete this[e], T("Deprecated: '" + e + "' has been renamed '" + n + "'. The old method will be removed in the next major version.");
        }
      }
      function Je() {
        function e() {
          var n = window.iFrameResizer;
          i("Reading data from page: " + JSON.stringify(n)), Object.keys(n).forEach(Be, n), Q = "onMessage" in n ? n.onMessage : Q, $ = "onReady" in n ? n.onReady : $, L = "targetOrigin" in n ? n.targetOrigin : L, h = "heightCalculationMethod" in n ? n.heightCalculationMethod : h, v = "widthCalculationMethod" in n ? n.widthCalculationMethod : v;
        }
        function t(n, o) {
          return typeof n == "function" && (i("Setup custom " + o + "CalcMethod"), Z[o] = n, n = "custom"), n;
        }
        "iFrameResizer" in window && Object === window.iFrameResizer.constructor && (e(), h = t(h, "height"), v = t(v, "width")), i("TargetOrigin for parent set to: " + L);
      }
      function Ue(e, t) {
        return t.indexOf("-") !== -1 && (T("Negative CSS value ignored for " + e), t = ""), t;
      }
      function te(e, t) {
        u !== t && t !== "" && t !== "null" && (document.body.style[e] = t, i("Body " + e + ' set to "' + t + '"'));
      }
      function Xe() {
        u === j && (j = M + "px"), te("margin", Ue("margin", j));
      }
      function _e() {
        document.documentElement.style.height = "", document.body.style.height = "", i('HTML & body height set to "auto"');
      }
      function g(e) {
        var t = {
          add: function(n) {
            function o() {
              A(e.eventName, e.eventType);
            }
            ee[n] = o, C(window, n, o, {
              passive: !0
            });
          },
          remove: function(n) {
            var o = ee[n];
            delete ee[n], De(window, n, o);
          }
        };
        e.eventNames && Array.prototype.map ? (e.eventName = e.eventNames[0], e.eventNames.map(t[e.method])) : t[e.method](e.eventName), i(ve(e.method) + " event listener: " + e.eventType);
      }
      function we(e) {
        g({
          method: e,
          eventType: "Animation Start",
          eventNames: ["animationstart", "webkitAnimationStart"]
        }), g({
          method: e,
          eventType: "Animation Iteration",
          eventNames: ["animationiteration", "webkitAnimationIteration"]
        }), g({
          method: e,
          eventType: "Animation End",
          eventNames: ["animationend", "webkitAnimationEnd"]
        }), g({
          method: e,
          eventType: "Input",
          eventName: "input"
        }), g({
          method: e,
          eventType: "Mouse Up",
          eventName: "mouseup"
        }), g({
          method: e,
          eventType: "Mouse Down",
          eventName: "mousedown"
        }), g({
          method: e,
          eventType: "Orientation Change",
          eventName: "orientationchange"
        }), g({
          method: e,
          eventType: "Print",
          eventNames: ["afterprint", "beforeprint"]
        }), g({
          method: e,
          eventType: "Ready State Change",
          eventName: "readystatechange"
        }), g({
          method: e,
          eventType: "Touch Start",
          eventName: "touchstart"
        }), g({
          method: e,
          eventType: "Touch End",
          eventName: "touchend"
        }), g({
          method: e,
          eventType: "Touch Cancel",
          eventName: "touchcancel"
        }), g({
          method: e,
          eventType: "Transition Start",
          eventNames: ["transitionstart", "webkitTransitionStart", "MSTransitionStart", "oTransitionStart", "otransitionstart"]
        }), g({
          method: e,
          eventType: "Transition Iteration",
          eventNames: ["transitioniteration", "webkitTransitionIteration", "MSTransitionIteration", "oTransitionIteration", "otransitioniteration"]
        }), g({
          method: e,
          eventType: "Transition End",
          eventNames: ["transitionend", "webkitTransitionEnd", "MSTransitionEnd", "oTransitionEnd", "otransitionend"]
        }), Y === "child" && g({
          method: e,
          eventType: "IFrame Resized",
          eventName: "resize"
        });
      }
      function be(e, t, n, o) {
        return t !== e && (e in n || (T(e + " is not a valid option for " + o + "CalculationMethod."), e = t), i(o + ' calculation method set to "' + e + '"')), e;
      }
      function Te() {
        h = be(h, X, E, "height");
      }
      function Ee() {
        v = be(v, me, N, "width");
      }
      function Oe() {
        p === !0 ? (we("add"), et()) : i("Auto Resize disabled");
      }
      function Ve() {
        J !== null && J.disconnect();
      }
      function Ye() {
        we("remove"), Ve(), clearInterval(ue);
      }
      function Ke() {
        var e = document.createElement("div");
        e.style.clear = "both", e.style.display = "block", e.style.height = "0", document.body.appendChild(e);
      }
      function Qe() {
        function e() {
          return {
            x: window.pageXOffset === u ? document.documentElement.scrollLeft : window.pageXOffset,
            y: window.pageYOffset === u ? document.documentElement.scrollTop : window.pageYOffset
          };
        }
        function t(c) {
          var s = c.getBoundingClientRect(), f = e();
          return {
            x: parseInt(s.left, 10) + parseInt(f.x, 10),
            y: parseInt(s.top, 10) + parseInt(f.y, 10)
          };
        }
        function n(c) {
          function s(b) {
            var x = t(b);
            i("Moving to in page link (#" + f + ") at x: " + x.x + " y: " + x.y), y(x.y, x.x, "scrollToOffset");
          }
          var f = c.split("#")[1] || c, r = decodeURIComponent(f), w = document.getElementById(r) || document.getElementsByName(r)[0];
          u === w ? (i("In page link (#" + f + ") not found in iFrame, so sending to parent"), y(0, 0, "inPageLink", "#" + f)) : s(w);
        }
        function o() {
          var c = window.location.hash, s = window.location.href;
          c !== "" && c !== "#" && n(s);
        }
        function a() {
          function c(s) {
            function f(r) {
              r.preventDefault(), n(this.getAttribute("href"));
            }
            s.getAttribute("href") !== "#" && C(s, "click", f);
          }
          Array.prototype.forEach.call(document.querySelectorAll('a[href^="#"]'), c);
        }
        function l() {
          C(window, "hashchange", o);
        }
        function m() {
          setTimeout(o, U);
        }
        function d() {
          Array.prototype.forEach && document.querySelectorAll ? (i("Setting up location.hash handlers"), a(), l(), m()) : T("In page linking not fully supported in this browser! (See README.md for IE8 workaround)");
        }
        return k.enable ? d() : i("In page linking not enabled"), {
          findTarget: n
        };
      }
      function $e() {
        if (V !== !0) return;
        function e(n) {
          y(0, 0, n.type, n.screenY + ":" + n.screenX);
        }
        function t(n, o) {
          i("Add event listener: " + o), C(window.document, n, e);
        }
        t("mouseenter", "Mouse Enter"), t("mouseleave", "Mouse Leave");
      }
      function Ge() {
        i("Enable public methods"), je.parentIFrame = {
          autoResize: function(e) {
            return e === !0 && p === !1 ? (p = !0, Oe()) : e === !1 && p === !0 && (p = !1, Ye()), y(0, 0, "autoResize", JSON.stringify(p)), p;
          },
          close: function() {
            y(0, 0, "close");
          },
          getId: function() {
            return H;
          },
          getPageInfo: function(e) {
            typeof e == "function" ? (G = e, y(0, 0, "pageInfo")) : (G = function() {
            }, y(0, 0, "pageInfoStop"));
          },
          moveToAnchor: function(e) {
            k.findTarget(e);
          },
          reset: function() {
            xe("parentIFrame.reset");
          },
          scrollTo: function(e, t) {
            y(t, e, "scrollTo");
          },
          scrollToOffset: function(e, t) {
            y(t, e, "scrollToOffset");
          },
          sendMessage: function(e, t) {
            y(0, 0, "message", JSON.stringify(e), t);
          },
          setHeightCalculationMethod: function(e) {
            h = e, Te();
          },
          setWidthCalculationMethod: function(e) {
            v = e, Ee();
          },
          setTargetOrigin: function(e) {
            i("Set targetOrigin: " + e), L = e;
          },
          size: function(e, t) {
            var n = "" + (e || "") + (t ? "," + t : "");
            A("size", "parentIFrame.size(" + n + ")", e, t);
          }
        };
      }
      function Se() {
        I !== 0 && (i("setInterval: " + I + "ms"), ue = setInterval(function() {
          A("interval", "setInterval: " + I);
        }, Math.abs(I)));
      }
      function Ze() {
        function e(r) {
          function w(b) {
            b.complete === !1 && (i("Attach listeners to " + b.src), b.addEventListener("load", a, !1), b.addEventListener("error", l, !1), c.push(b));
          }
          r.type === "attributes" && r.attributeName === "src" ? w(r.target) : r.type === "childList" && Array.prototype.forEach.call(r.target.querySelectorAll("img"), w);
        }
        function t(r) {
          c.splice(c.indexOf(r), 1);
        }
        function n(r) {
          i("Remove listeners from " + r.src), r.removeEventListener("load", a, !1), r.removeEventListener("error", l, !1), t(r);
        }
        function o(r, w, b) {
          n(r.target), A(w, b + ": " + r.target.src);
        }
        function a(r) {
          o(r, "imageLoad", "Image loaded");
        }
        function l(r) {
          o(r, "imageLoadFailed", "Image load failed");
        }
        function m(r) {
          A("mutationObserver", "mutationObserver: " + r[0].target + " " + r[0].type), r.forEach(e);
        }
        function d() {
          var r = document.querySelector("body"), w = {
            attributes: !0,
            attributeOldValue: !1,
            characterData: !0,
            characterDataOldValue: !1,
            childList: !0,
            subtree: !0
          };
          return f = new s(m), i("Create body MutationObserver"), f.observe(r, w), f;
        }
        var c = [], s = window.MutationObserver || window.WebKitMutationObserver, f = d();
        return {
          disconnect: function() {
            "disconnect" in f && (i("Disconnect body MutationObserver"), f.disconnect(), c.forEach(n));
          }
        };
      }
      function et() {
        var e = 0 > I;
        window.MutationObserver || window.WebKitMutationObserver ? e ? Se() : J = Ze() : (i("MutationObserver not supported in this browser!"), Se());
      }
      function ne(e, t) {
        var n = 0;
        return t = t || document.body, n = document.defaultView.getComputedStyle(t, null), n = n === null ? 0 : n[e], parseInt(n, S);
      }
      function tt(e) {
        e > F / 2 && (F = 2 * e, i("Event throttle increased to " + F + "ms"));
      }
      function oe(e, t) {
        for (var n = t.length, o = 0, a = 0, l = ve(e), m = Date.now(), d = 0; d < n; d++) o = t[d].getBoundingClientRect()[e] + ne("margin" + l, t[d]), o > a && (a = o);
        return m = Date.now() - m, i("Parsed " + n + " HTML elements"), i("Element position calculated in " + m + "ms"), tt(m), a;
      }
      function B(e) {
        return [e.bodyOffset(), e.bodyScroll(), e.documentElementOffset(), e.documentElementScroll()];
      }
      function Me(e, t) {
        function n() {
          return T("No tagged elements (" + t + ") found on page"), document.querySelectorAll("body *");
        }
        var o = document.querySelectorAll("[" + t + "]");
        return o.length === 0 && n(), oe(e, o);
      }
      function Ie() {
        return document.querySelectorAll("body *");
      }
      var E = {
        bodyOffset: function() {
          return document.body.offsetHeight + ne("marginTop") + ne("marginBottom");
        },
        offset: function() {
          return E.bodyOffset();
        },
        bodyScroll: function() {
          return document.body.scrollHeight;
        },
        custom: function() {
          return Z.height();
        },
        documentElementOffset: function() {
          return document.documentElement.offsetHeight;
        },
        documentElementScroll: function() {
          return document.documentElement.scrollHeight;
        },
        max: function() {
          return Math.max.apply(null, B(E));
        },
        min: function() {
          return Math.min.apply(null, B(E));
        },
        grow: function() {
          return E.max();
        },
        lowestElement: function() {
          return Math.max(E.bodyOffset() || E.documentElementOffset(), oe("bottom", Ie()));
        },
        taggedElement: function() {
          return Me("bottom", "data-iframe-height");
        }
      }, N = {
        bodyScroll: function() {
          return document.body.scrollWidth;
        },
        bodyOffset: function() {
          return document.body.offsetWidth;
        },
        custom: function() {
          return Z.width();
        },
        documentElementScroll: function() {
          return document.documentElement.scrollWidth;
        },
        documentElementOffset: function() {
          return document.documentElement.offsetWidth;
        },
        scroll: function() {
          return Math.max(N.bodyScroll(), N.documentElementScroll());
        },
        max: function() {
          return Math.max.apply(null, B(N));
        },
        min: function() {
          return Math.min.apply(null, B(N));
        },
        rightMostElement: function() {
          return oe("right", Ie());
        },
        taggedElement: function() {
          return Me("right", "data-iframe-width");
        }
      };
      function Ne(e, t, n, o) {
        function a() {
          R = f, P = r, y(R, P, e);
        }
        function l() {
          function w(b, x) {
            var ot = Math.abs(b - x) <= K;
            return !ot;
          }
          return f = u === n ? E[h]() : n, r = u === o ? N[v]() : o, w(R, f) || D && w(P, r);
        }
        function m() {
          return !(e in {
            init: 1,
            interval: 1,
            size: 1
          });
        }
        function d() {
          return h in le || D && v in le;
        }
        function c() {
          i("No change in size detected");
        }
        function s() {
          m() && d() ? xe(t) : e in {
            interval: 1
          } || c();
        }
        var f, r;
        l() || e === "init" ? (Ae(), a()) : s();
      }
      var nt = qe(Ne);
      function A(e, t, n, o) {
        function a() {
          e in {
            reset: 1,
            resetPage: 1,
            init: 1
          } || i("Trigger event: " + t);
        }
        function l() {
          return W && e in Pe;
        }
        l() ? i("Trigger event cancelled: " + e) : (a(), e === "init" ? Ne(e, t, n, o) : nt(e, t, n, o));
      }
      function Ae() {
        W || (W = !0, i("Trigger event lock on")), clearTimeout(de), de = setTimeout(function() {
          W = !1, i("Trigger event lock off"), i("--");
        }, U);
      }
      function Ce(e) {
        R = E[h](), P = N[v](), y(R, P, e);
      }
      function xe(e) {
        var t = h;
        h = X, i("Reset trigger event: " + e), Ae(), Ce("reset"), h = t;
      }
      function y(e, t, n, o, a) {
        function l() {
          u === a ? a = L : i("Message targetOrigin: " + a);
        }
        function m() {
          var d = e + ":" + t, c = H + ":" + d + ":" + n + (u === o ? "" : ":" + o);
          i("Sending message to host page (" + c + ")"), fe.postMessage(q + c, a);
        }
        l(), m();
      }
      function ze(e) {
        var t = {
          init: function() {
            ce = e.data, fe = e.source, He(), re = !1, setTimeout(function() {
              ae = !1;
            }, U);
          },
          reset: function() {
            ae ? i("Page reset ignored by init") : (i("Page size reset by host page"), Ce("resetPage"));
          },
          resize: function() {
            A("resizeParent", "Parent window requested size check");
          },
          moveToAnchor: function() {
            k.findTarget(a());
          },
          inPageLink: function() {
            this.moveToAnchor();
          },
          // Backward compatibility
          pageInfo: function() {
            var s = a();
            i("PageInfoFromParent called from parent: " + s), G(JSON.parse(s)), i(" --");
          },
          message: function() {
            var s = a();
            i("onMessage called from parent: " + s), Q(JSON.parse(s)), i(" --");
          }
        };
        function n() {
          return q === ("" + e.data).slice(0, se);
        }
        function o() {
          return e.data.split("]")[1].split(":")[0];
        }
        function a() {
          return e.data.slice(e.data.indexOf(":") + 1);
        }
        function l() {
          return !z.exports && "iFrameResize" in window || window.jQuery !== u && "iFrameResize" in window.jQuery.prototype;
        }
        function m() {
          return e.data.split(":")[2] in {
            true: 1,
            false: 1
          };
        }
        function d() {
          var s = o();
          s in t ? t[s]() : !l() && !m() && T("Unexpected message (" + e.data + ")");
        }
        function c() {
          re === !1 ? d() : m() ? t.init() : i('Ignored message of type "' + o() + '". Received before initialization.');
        }
        n() && c();
      }
      function Re() {
        document.readyState !== "loading" && window.parent.postMessage("[iFrameResizerChild]Ready", "*");
      }
      "iframeResizer" in window || (window.iframeChildListener = function(e) {
        ze({
          data: e
        });
      }, C(window, "message", ze), C(window, "readystatechange", Re), Re());
    })();
  })(ke)), ke.exports;
}
var Fe = at();
const ct = /* @__PURE__ */ it(Fe), st = /* @__PURE__ */ rt({
  __proto__: null,
  default: ct
}, [Fe]);
export {
  st as i
};
//# sourceMappingURL=iframeResizer.contentWindow-D_iySM1B-Dr8-T38v.js.map
