import"./jwt-decode.esm-CX61wVx3.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},r=new Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="6c2d1f9e-7168-4524-a5c6-fda99b28a449",e._sentryDebugIdIdentifier="sentry-dbid-6c2d1f9e-7168-4524-a5c6-fda99b28a449")}catch{}})();function a(){return`<script>
(function() {
  window.abstra = window.abstra || {};
  window.abstra.login = function() {
    window.parent.postMessage({ type: 'abstra-login' }, window.origin);
  };
  window.abstra.logout = function() {
    window.parent.postMessage({ type: 'abstra-logout' }, window.origin);
  };
  window.abstra.logged = function() {
    return !!document.querySelector('meta[name="abstra-auth-token"]');
  };
})();
<\/script>`}function o(e,r){const n=window.location.origin;return`<script>
(function() {
  var __logBuffer = [];
  var __flushTimer = null;
  var __execId = ${JSON.stringify(e)};
  var __stageId = ${JSON.stringify(r)};
  var __origin = ${JSON.stringify(n)};

  function __flushLogs() {
    if (__logBuffer.length === 0) return;
    var batch = __logBuffer.splice(0);
    try {
      fetch(__origin + "/_logs/" + __execId, {
        method: "POST",
        headers: { "Content-Type": "application/json" },
        body: JSON.stringify({ logs: batch, stageId: __stageId })
      }).catch(function() {});
    } catch(e) {}
  }

  function __scheduleFlush() {
    if (__flushTimer) return;
    __flushTimer = setTimeout(function() {
      __flushTimer = null;
      __flushLogs();
    }, 500);
  }

  function __capture(level, origFn) {
    return function() {
      var args = Array.prototype.slice.call(arguments);
      var msg = args.map(function(a) {
        if (typeof a === "string") return a;
        try { return JSON.stringify(a); } catch(e) { return String(a); }
      }).join(" ");
      __logBuffer.push({ level: level, message: msg });
      __scheduleFlush();
      return origFn.apply(console, arguments);
    };
  }

  console.log = __capture("log", console.log);
  console.error = __capture("error", console.error);
  console.warn = __capture("warn", console.warn);
  console.info = __capture("info", console.info);

  window.addEventListener("error", function(e) {
    __logBuffer.push({ level: "error", message: e.message + " at " + e.filename + ":" + e.lineno });
    __scheduleFlush();
  });

  window.addEventListener("unhandledrejection", function(e) {
    __logBuffer.push({ level: "error", message: "Unhandled rejection: " + (e.reason && e.reason.message || e.reason || "unknown") });
    __scheduleFlush();
  });

  window.addEventListener("beforeunload", function() { __flushLogs(); });
})();
<\/script>`}function i(){return`<script>
(function() {
  var meta = document.querySelector('meta[name="abstra-page-endpoint"]');
  var rpcPrefix = meta && meta.content;
  if (!rpcPrefix) return;
  // The meta content carries the page's current query string too (the RPC
  // contract: function-call POSTs inherit it), so reduce it to a pathname
  // before comparing against link pathnames below.
  var rpcPath;
  try { rpcPath = new URL(rpcPrefix, window.origin).pathname; } catch (err) { return; }
  document.addEventListener('click', function(e) {
    var a = e.target && e.target.closest && e.target.closest('a');
    if (!a) return;
    // <base target="_top"> applies when target is "" or "_top". Anything
    // else (_self, _blank, _parent, framename) keeps default behavior.
    if (a.target !== '' && a.target !== '_top') return;
    var url;
    try { url = new URL(a.href); } catch (err) { return; }
    if (url.origin !== window.origin) return;
    if (url.pathname !== rpcPath) return;
    e.preventDefault();
    window.parent.postMessage(
      { type: 'abstra-page-navigate', search: url.search, hash: url.hash },
      window.origin
    );
  }, true);
})();
<\/script>`}export{a,i as b,o as c};
//# sourceMappingURL=linkInterceptor-DeEo1UFM.js.map
