{"version":3,"file":"runtime.mjs","names":[],"sources":["../../../../src/internal/clerk-js/runtime.ts"],"sourcesContent":["export function inBrowser() {\n return typeof globalThis.document !== 'undefined';\n}\n\nexport function inActiveBrowserTab() {\n return inBrowser() && globalThis.document.hasFocus();\n}\n\nexport function inIframe() {\n if (!inBrowser()) {\n return false;\n }\n\n try {\n // checks if the current window is an iframe\n return window.self !== window.top;\n } catch {\n // Cross-origin access denied - we're definitely in an iframe\n return true;\n }\n}\n\nexport function inCrossOriginIframe() {\n if (!inIframe()) {\n return false;\n }\n\n try {\n // Try to access top window's location to check if any ancestor is cross-origin\n // This will throw a SecurityError if any iframe in the chain is cross-origin\n // Handles nested iframes where immediate parent might be same-origin\n // but a higher-level ancestor is cross-origin\n void window.top?.location.href;\n return false;\n } catch {\n // SecurityError thrown - we're in a cross-origin iframe (at any level)\n return true;\n }\n}\n"],"mappings":";AAAA,SAAgB,YAAY;AAC1B,QAAO,OAAO,WAAW,aAAa;;AAGxC,SAAgB,qBAAqB;AACnC,QAAO,WAAW,IAAI,WAAW,SAAS,UAAU;;AAGtD,SAAgB,WAAW;AACzB,KAAI,CAAC,WAAW,CACd,QAAO;AAGT,KAAI;AAEF,SAAO,OAAO,SAAS,OAAO;SACxB;AAEN,SAAO;;;AAIX,SAAgB,sBAAsB;AACpC,KAAI,CAAC,UAAU,CACb,QAAO;AAGT,KAAI;AAKF,EAAK,OAAO,KAAK,SAAS;AAC1B,SAAO;SACD;AAEN,SAAO"}