@telepath-computer/television 1.4.28 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- import{j as a,m as o,n as d}from"./artifact-bridge-BEUWXKq7.js";a(window,{reportNavigation:!1});window.addEventListener("message",t=>{t.source===window.parent&&o(t.data)&&l(t.data.url)});window.parent.postMessage({type:d},"*");function l(t,n=document){const e=f(n);if(p(e),t===null){e.targetBlock.hidden=!0,e.desktopApp.hidden=!1;return}const r=g(t);if(e.targetBlock.hidden=!1,e.desktopApp.hidden=!1,e.addressLabel.textContent="This is the URL you're trying to visit:",r){e.targetLink.textContent=t,e.targetLink.href=r.href,e.targetLink.hidden=!1;return}e.plainAddress.textContent=t,e.plainAddress.hidden=!1}function p(t){t.targetLink.removeAttribute("href"),t.targetLink.textContent="",t.targetLink.hidden=!0,t.addressLabel.textContent="",t.plainAddress.textContent="",t.plainAddress.hidden=!0}function g(t){try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}catch{return null}}function f(t){const n=t.getElementById("target-block"),e=t.getElementById("address-label"),r=t.getElementById("target-link"),s=t.getElementById("plain-address"),i=t.getElementById("desktop-app");if(!(n instanceof HTMLElement))throw new Error("Missing #target-block");if(!(e instanceof HTMLElement))throw new Error("Missing #address-label");if(!(r instanceof HTMLAnchorElement))throw new Error("Missing #target-link");if(!(s instanceof HTMLElement))throw new Error("Missing #plain-address");if(!(i instanceof HTMLElement))throw new Error("Missing #desktop-app");return{targetBlock:n,addressLabel:e,targetLink:r,plainAddress:s,desktopApp:i}}
1
+ import{j as a,m as o,n as d}from"./artifact-bridge-DTPacxDw.js";a(window,{reportNavigation:!1});window.addEventListener("message",t=>{t.source===window.parent&&o(t.data)&&l(t.data.url)});window.parent.postMessage({type:d},"*");function l(t,n=document){const e=f(n);if(p(e),t===null){e.targetBlock.hidden=!0,e.desktopApp.hidden=!1;return}const r=g(t);if(e.targetBlock.hidden=!1,e.desktopApp.hidden=!1,e.addressLabel.textContent="This is the URL you're trying to visit:",r){e.targetLink.textContent=t,e.targetLink.href=r.href,e.targetLink.hidden=!1;return}e.plainAddress.textContent=t,e.plainAddress.hidden=!1}function p(t){t.targetLink.removeAttribute("href"),t.targetLink.textContent="",t.targetLink.hidden=!0,t.addressLabel.textContent="",t.plainAddress.textContent="",t.plainAddress.hidden=!0}function g(t){try{const n=new URL(t);return n.protocol!=="http:"&&n.protocol!=="https:"?null:n}catch{return null}}function f(t){const n=t.getElementById("target-block"),e=t.getElementById("address-label"),r=t.getElementById("target-link"),s=t.getElementById("plain-address"),i=t.getElementById("desktop-app");if(!(n instanceof HTMLElement))throw new Error("Missing #target-block");if(!(e instanceof HTMLElement))throw new Error("Missing #address-label");if(!(r instanceof HTMLAnchorElement))throw new Error("Missing #target-link");if(!(s instanceof HTMLElement))throw new Error("Missing #plain-address");if(!(i instanceof HTMLElement))throw new Error("Missing #desktop-app");return{targetBlock:n,addressLabel:e,targetLink:r,plainAddress:s,desktopApp:i}}
@@ -40,8 +40,8 @@
40
40
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
41
41
  <link rel="icon" type="image/svg+xml" href="./assets/favicon-DaYMFRha.svg" />
42
42
  <title>Television</title>
43
- <script type="module" crossorigin src="./assets/main-B1UYVUiH.js"></script>
44
- <link rel="modulepreload" crossorigin href="./assets/artifact-bridge-BEUWXKq7.js">
43
+ <script type="module" crossorigin src="./assets/main-CN1VG1TI.js"></script>
44
+ <link rel="modulepreload" crossorigin href="./assets/artifact-bridge-DTPacxDw.js">
45
45
  <link rel="modulepreload" crossorigin href="./assets/missing-artifact-page-DVzJ41AE.js">
46
46
  <link rel="stylesheet" crossorigin href="./assets/main-CunC2_Nx.css">
47
47
  <link rel="preload" as="font" crossorigin="" href="/canonical/v2/fonts/Hind-Variable.933e9900.woff2">
@@ -0,0 +1 @@
1
+ (function(){const A=document.createElement("link").relList;if(A&&A.supports&&A.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))M(f);new MutationObserver(f=>{for(const y of f)if(y.type==="childList")for(const S of y.addedNodes)S.tagName==="LINK"&&S.rel==="modulepreload"&&M(S)}).observe(document,{childList:!0,subtree:!0});function R(f){const y={};return f.integrity&&(y.integrity=f.integrity),f.referrerPolicy&&(y.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?y.credentials="include":f.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function M(f){if(f.ep)return;f.ep=!0;const y=R(f);fetch(f.href,y)}})();const k="url-target-request",G="url-target",K="artifact-missing-request",Y="artifact-missing",q="proxy-content-changed",F="bridge-ready",B="leaving",X="artifact-pointer";function v(t,A){return!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown")||t.isComposing||t.metaKey||t.shiftKey?!1:A==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(A)?t.altKey&&!t.ctrlKey:t.ctrlKey&&!t.altKey}function h(t){return typeof t=="object"&&t!==null}function V(t){return!h(t)||t.type!==k?!1:!("id"in t)}function W(t){return!h(t)||t.type!==G||typeof t.url!="string"&&t.url!==null?!1:!("id"in t)}function $(t){return!h(t)||t.type!==K?!1:!("id"in t)}function j(t){return!h(t)||t.type!==Y||typeof t.title!="string"||typeof t.path!="string"?!1:!("id"in t)}function w(t){return!h(t)||t.type!==q?!1:!("id"in t)}function H(t){return!h(t)||t.type!==F||typeof t.guid!="string"?!1:!("id"in t)}function Q(t){return!h(t)||t.type!==B||typeof t.guid!="string"?!1:!("id"in t)}function z(t){return!h(t)||t.type!=="navigation-request"||typeof t.url!="string"||"replace"in t&&typeof t.replace!="boolean"||"sameDocument"in t&&typeof t.sameDocument!="boolean"||"native"in t&&typeof t.native!="boolean"?!1:!("id"in t)}function Z(t){return!h(t)||t.type!=="navigation-key"||t.key!=="ArrowLeft"&&t.key!=="ArrowRight"&&t.key!=="ArrowUp"&&t.key!=="ArrowDown"?!1:!("id"in t)}function J(t){return!h(t)||t.type!==X||t.eventType!=="pointermove"&&t.eventType!=="pointerdown"&&t.eventType!=="pointerup"&&t.eventType!=="pointercancel"&&t.eventType!=="click"||typeof t.clientX!="number"||!Number.isFinite(t.clientX)||typeof t.clientY!="number"||!Number.isFinite(t.clientY)||typeof t.button!="number"||!Number.isFinite(t.button)||typeof t.buttons!="number"||!Number.isFinite(t.buttons)?!1:!("id"in t)}function tt(t=window,A={}){const R=t;if(t.parent===t||R.__televisionArtifactBridgeInstalled===!0)return;R.__televisionArtifactBridgeInstalled=!0;const f=(()=>{const c=Date.now().toString(36);try{const g=t.crypto;if(g&&typeof g.getRandomValues=="function"){const u=new Uint32Array(4);return g.getRandomValues(u),`tvb-${c}-${Array.from(u,L=>L.toString(36)).join("-")}`}}catch{}return`tvb-${c}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`})(),y=()=>{t.parent.postMessage({type:"bridge-ready",guid:f},"*")};t.addEventListener("pagehide",()=>{t.parent.postMessage({type:"leaving",guid:f},"*")}),t.addEventListener("pageshow",m=>{m.persisted===!0&&y()}),t.addEventListener("keydown",m=>{const a=m,c=a.key==="ArrowLeft"||a.key==="ArrowRight"||a.key==="ArrowUp"||a.key==="ArrowDown",g=t.navigator.platform,L=g==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(g)?a.altKey&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey:a.ctrlKey&&!a.altKey&&!a.metaKey&&!a.shiftKey;!c||a.isComposing||!L||(a.preventDefault(),t.parent.postMessage({type:"navigation-key",key:a.key},"*"))},!0);const S=["pointermove","pointerdown","pointerup","pointercancel","click"];for(const m of S)t.addEventListener(m,a=>{const c=a;c.isTrusted&&t.parent.postMessage({type:"artifact-pointer",eventType:m,clientX:c.clientX,clientY:c.clientY,button:c.button,buttons:c.buttons},"*")},!0);const O=t.location.href;if((m=>{try{const a=new URL(m);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(a.pathname)}catch{return!1}})(O)&&typeof t.fetch=="function"){const c=A.pollCadence,g=c!==void 0&&Number.isFinite(c.normalMs)&&c.normalMs>0&&Number.isFinite(c.slowMs)&&c.slowMs>=c.normalMs?c:null,u=(g==null?void 0:g.normalMs)??5e3,L=(g==null?void 0:g.slowMs)??15e3;let o=null,l=u,s=0,i=!1,e=null,r=null;const d=()=>{i&&(i=!1,s+=1,e!==null&&(t.clearTimeout(e),e=null),r==null||r.abort(),r=null)},p=()=>{if(i)return;i=!0;const n=++s,E=()=>{if(!i||n!==s)return;e=null;const T=t.AbortController,_=typeof T=="function"?new T:null;r=_,(async()=>{try{const D=await t.fetch(O,{method:"HEAD",..._?{signal:_.signal}:{}});if(!i||n!==s)return;if(!D.ok)throw new Error("Artifact poll failed");const b=D.headers.get("ETag");if(!b)throw new Error("Artifact poll missing ETag");l=u,o===null?o=b:b!==o&&(o=b,t.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{i&&n===s&&(l=Math.min(L,l*2))}finally{r===_&&(r=null),i&&n===s&&(e=t.setTimeout(E,l))}})()};E()};t.addEventListener("pagehide",d),t.addEventListener("pageshow",n=>{n.persisted===!0&&p()}),p()}if(A.reportNavigation!==!1){const m=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]),a=(o,l)=>{try{const s=new URL(o,l);return s.protocol==="http:"||s.protocol==="https:"||m.has(s.protocol)?null:s}catch{return null}},c=(o,l)=>{try{const s=new URL(o,l);return s.protocol==="http:"||s.protocol==="https:"?s:null}catch{return null}},g=o=>{var n;const l=o.type==="click"&&o.button===0,s=o.type==="auxclick"&&o.button===1;if(!l&&!s)return;const i=(n=t.document.defaultView)==null?void 0:n.Element;if(!i||!(o.target instanceof i))return;const e=o.target.closest("a[href]");if(!e)return;const r=a(e.href,t.document.baseURI);if(!r)return;const d=e.target.toLowerCase();!(s||o.metaKey||o.ctrlKey||o.shiftKey||o.altKey||d!==""&&d!=="_self")&&!e.hasAttribute("download")||(o.preventDefault(),t.location.href=r.href)};t.document.addEventListener("click",g,!0),t.document.addEventListener("auxclick",g,!0);const u=o=>{t.parent.postMessage({type:"navigation-request",...o},"*")};u({url:t.location.href});const L=t.navigation;if(L&&L.currentEntry!==null)L.addEventListener("navigate",o=>{var p,n;const l=o,s=(p=l.destination)==null?void 0:p.url;if(typeof s!="string")return;const i=c(s,t.location.href);if(!i)return;const e=((n=l.destination)==null?void 0:n.sameDocument)===!0,r={url:s,...l.navigationType==="replace"?{replace:!0}:{},...e?{sameDocument:!0}:{}};if(e){u(r);return}if(i.origin===t.location.origin){u({...r,native:!0});return}l.canIntercept!==!1&&l.preventDefault(),u(r)});else{const o=(i,e)=>{let r=null;t.addEventListener(i,d=>{r&&t.removeEventListener(i,r);const p=n=>{n===d&&(t.removeEventListener(i,p),r=null,n.defaultPrevented||e(n))};r=p,t.addEventListener(i,p)},!0)};o("click",i=>{var E;const e=i;if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const r=(E=t.document.defaultView)==null?void 0:E.Element;if(!r||!(e.target instanceof r))return;const d=e.target.closest("a[href]");if(!d||d.target&&d.target.toLowerCase()!=="_self"||d.hasAttribute("download")||!d.getAttribute("href"))return;const n=c(d.href,t.document.baseURI);if(n){if(n.origin===t.location.origin&&n.pathname===t.location.pathname&&n.search===t.location.search&&n.hash!==""){u({url:n.href,sameDocument:!0});return}e.preventDefault(),u({url:n.href})}});const l=t.history.pushState.bind(t.history),s=t.history.replaceState.bind(t.history);t.history.pushState=function(...e){l(...e),u({url:t.location.href,sameDocument:!0})},t.history.replaceState=function(...e){s(...e),u({url:t.location.href,replace:!0,sameDocument:!0})},t.addEventListener("popstate",()=>{u({url:t.location.href,sameDocument:!0})}),t.addEventListener("hashchange",()=>{u({url:t.location.href,sameDocument:!0})}),o("submit",i=>{var U,I,C;const e=i,r=e.target,d=(U=t.document.defaultView)==null?void 0:U.HTMLFormElement;if(!d||!(r instanceof d))return;const p=e.submitter??null,n=N=>p!=null&&p.hasAttribute(N)?p.getAttribute(N)??"":null,E=n("formtarget")??r.getAttribute("target");if(E&&E.toLowerCase()!=="_self")return;const T=(I=n("formmethod")??r.getAttribute("method"))==null?void 0:I.toLowerCase();if(T==="post"||T==="dialog")return;const _=c((n("formaction")??r.getAttribute("action"))||t.location.href,t.document.baseURI);if(!_)return;const D=(C=t.document.defaultView)==null?void 0:C.FormData;if(!D)return;const b=new URLSearchParams;for(const[N,P]of new D(r,p))b.append(N,typeof P=="string"?P:P.name);_.search=b.toString(),e.preventDefault(),u({url:_.href})})}}y()}export{Y as A,G as U,J as a,Q as b,H as c,Z as d,z as e,w as f,V as g,v as h,$ as i,tt as j,j as k,K as l,W as m,k as n};
@@ -0,0 +1 @@
1
+ import{j as d,k as m,l as p}from"./artifact-bridge-DTPacxDw.js";import{m as l,a as E,b as f}from"./missing-artifact-page-DVzJ41AE.js";d(window,{reportNavigation:!1});document.getElementById("missing-title")!==null&&i(null);window.addEventListener("message",t=>{t.source===window.parent&&m(t.data)&&i(t.data)});var a;(a=window.__televisionContentBridge)==null||a.onHostMessage(t=>{m(t)&&i(t)});const c={type:p};window.parent.postMessage(c,"*");var g;(g=window.__televisionContentBridge)==null||g.postToHost(c);function i(t,n=document){const e=w(n);if(e.title.textContent=l(),e.description.textContent=E(),e.recovery.textContent=f(),n.title=(t==null?void 0:t.title)||l(),t===null){e.path.textContent="",e.pathBlock.hidden=!0;return}e.path.textContent=t.path,e.pathBlock.hidden=!1}function w(t){const n=t.getElementById("missing-title"),e=t.getElementById("missing-description"),s=t.getElementById("path-block"),o=t.getElementById("missing-path"),r=t.getElementById("missing-recovery");if(!(n instanceof HTMLElement))throw new Error("Missing #missing-title");if(!(e instanceof HTMLElement))throw new Error("Missing #missing-description");if(!(s instanceof HTMLElement))throw new Error("Missing #path-block");if(!(o instanceof HTMLElement))throw new Error("Missing #missing-path");if(!(r instanceof HTMLElement))throw new Error("Missing #missing-recovery");return{title:n,description:e,pathBlock:s,path:o,recovery:r}}
@@ -0,0 +1 @@
1
+ function t(){return"Artifact file not found"}function i(){return"This artifact is still registered, but the file or directory it points at is missing."}function e(){return"Recreate the file at this path, update the artifact path, or remove the artifact."}export{i as a,e as b,t as m};
@@ -95,9 +95,9 @@
95
95
  display: none !important;
96
96
  }
97
97
  </style>
98
- <script type="module" crossorigin src="../../assets/artifactMissing-CUs1ZwDx.js"></script>
99
- <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-BEUWXKq7.js">
100
- <link rel="modulepreload" crossorigin href="../../assets/missing-artifact-page-DVzJ41AE.js">
98
+ <script type="module" crossorigin src="../../views/artifact-missing/assets/artifactMissing-CpOfWSs9.js"></script>
99
+ <link rel="modulepreload" crossorigin href="../../views/artifact-missing/assets/artifact-bridge-DTPacxDw.js">
100
+ <link rel="modulepreload" crossorigin href="../../views/artifact-missing/assets/missing-artifact-page-DVzJ41AE.js">
101
101
  </head>
102
102
  <body>
103
103
  <main class="artifact-error">
@@ -95,8 +95,8 @@
95
95
  display: none !important;
96
96
  }
97
97
  </style>
98
- <script type="module" crossorigin src="../../assets/urlUnsupported-powR79PT.js"></script>
99
- <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-BEUWXKq7.js">
98
+ <script type="module" crossorigin src="../../assets/urlUnsupported-DKrVAwIf.js"></script>
99
+ <link rel="modulepreload" crossorigin href="../../assets/artifact-bridge-DTPacxDw.js">
100
100
  </head>
101
101
  <body>
102
102
  <main class="artifact-error">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telepath-computer/television",
3
- "version": "1.4.28",
3
+ "version": "1.5.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- (function(){const L=document.createElement("link").relList;if(L&&L.supports&&L.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))D(c);new MutationObserver(c=>{for(const y of c)if(y.type==="childList")for(const b of y.addedNodes)b.tagName==="LINK"&&b.rel==="modulepreload"&&D(b)}).observe(document,{childList:!0,subtree:!0});function R(c){const y={};return c.integrity&&(y.integrity=c.integrity),c.referrerPolicy&&(y.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?y.credentials="include":c.crossOrigin==="anonymous"?y.credentials="omit":y.credentials="same-origin",y}function D(c){if(c.ep)return;c.ep=!0;const y=R(c);fetch(c.href,y)}})();const O="url-target-request",P="url-target",U="artifact-missing-request",I="artifact-missing",C="proxy-content-changed",k="bridge-ready",G="leaving",K="artifact-pointer";function q(t,L){return!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown")||t.isComposing||t.metaKey||t.shiftKey?!1:L==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(L)?t.altKey&&!t.ctrlKey:t.ctrlKey&&!t.altKey}function h(t){return typeof t=="object"&&t!==null}function F(t){return!h(t)||t.type!==O?!1:!("id"in t)}function B(t){return!h(t)||t.type!==P||typeof t.url!="string"&&t.url!==null?!1:!("id"in t)}function X(t){return!h(t)||t.type!==U?!1:!("id"in t)}function x(t){return!h(t)||t.type!==I||typeof t.title!="string"||typeof t.path!="string"?!1:!("id"in t)}function V(t){return!h(t)||t.type!==C?!1:!("id"in t)}function w(t){return!h(t)||t.type!==k||typeof t.guid!="string"?!1:!("id"in t)}function W(t){return!h(t)||t.type!==G||typeof t.guid!="string"?!1:!("id"in t)}function $(t){return!h(t)||t.type!=="navigation-request"||typeof t.url!="string"||"replace"in t&&typeof t.replace!="boolean"||"sameDocument"in t&&typeof t.sameDocument!="boolean"||"native"in t&&typeof t.native!="boolean"?!1:!("id"in t)}function j(t){return!h(t)||t.type!=="navigation-key"||t.key!=="ArrowLeft"&&t.key!=="ArrowRight"&&t.key!=="ArrowUp"&&t.key!=="ArrowDown"?!1:!("id"in t)}function v(t){return!h(t)||t.type!==K||t.eventType!=="pointermove"&&t.eventType!=="pointerdown"&&t.eventType!=="pointerup"&&t.eventType!=="pointercancel"&&t.eventType!=="click"||typeof t.clientX!="number"||!Number.isFinite(t.clientX)||typeof t.clientY!="number"||!Number.isFinite(t.clientY)||typeof t.button!="number"||!Number.isFinite(t.button)||typeof t.buttons!="number"||!Number.isFinite(t.buttons)?!1:!("id"in t)}function H(t=window,L={}){const R=t;if(t.parent===t||R.__televisionArtifactBridgeInstalled===!0)return;R.__televisionArtifactBridgeInstalled=!0;const c=(()=>{const a=Date.now().toString(36);try{const p=t.crypto;if(p&&typeof p.getRandomValues=="function"){const f=new Uint32Array(4);return p.getRandomValues(f),`tvb-${a}-${Array.from(f,A=>A.toString(36)).join("-")}`}}catch{}return`tvb-${a}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`})(),y=()=>{t.parent.postMessage({type:"bridge-ready",guid:c},"*")};t.addEventListener("pagehide",()=>{t.parent.postMessage({type:"leaving",guid:c},"*")}),t.addEventListener("pageshow",m=>{m.persisted===!0&&y()}),t.addEventListener("keydown",m=>{const i=m,a=i.key==="ArrowLeft"||i.key==="ArrowRight"||i.key==="ArrowUp"||i.key==="ArrowDown",p=t.navigator.platform,A=p==="darwin"||/^(Mac|iPhone|iPad|iPod)/i.test(p)?i.altKey&&!i.ctrlKey&&!i.metaKey&&!i.shiftKey:i.ctrlKey&&!i.altKey&&!i.metaKey&&!i.shiftKey;!a||i.isComposing||!A||(i.preventDefault(),t.parent.postMessage({type:"navigation-key",key:i.key},"*"))},!0);const b=["pointermove","pointerdown","pointerup","pointercancel","click"];for(const m of b)t.addEventListener(m,i=>{const a=i;a.isTrusted&&t.parent.postMessage({type:"artifact-pointer",eventType:m,clientX:a.clientX,clientY:a.clientY,button:a.button,buttons:a.buttons},"*")},!0);const N=t.location.href;if((m=>{try{const i=new URL(m);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(i.pathname)}catch{return!1}})(N)&&typeof t.fetch=="function"){const a=L.pollCadence,p=a!==void 0&&Number.isFinite(a.normalMs)&&a.normalMs>0&&Number.isFinite(a.slowMs)&&a.slowMs>=a.normalMs?a:null,f=(p==null?void 0:p.normalMs)??5e3,A=(p==null?void 0:p.slowMs)??15e3;let n=null,u=f,r=0,e=!1,s=null,o=null;const g=()=>{e&&(e=!1,r+=1,s!==null&&(t.clearTimeout(s),s=null),o==null||o.abort(),o=null)},d=()=>{if(e)return;e=!0;const l=++r,S=()=>{if(!e||l!==r)return;s=null;const T=t.AbortController,E=typeof T=="function"?new T:null;o=E,(async()=>{try{const M=await t.fetch(N,{method:"HEAD",...E?{signal:E.signal}:{}});if(!e||l!==r)return;if(!M.ok)throw new Error("Artifact poll failed");const _=M.headers.get("ETag");if(!_)throw new Error("Artifact poll missing ETag");u=f,n===null?n=_:_!==n&&(n=_,t.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{e&&l===r&&(u=Math.min(A,u*2))}finally{o===E&&(o=null),e&&l===r&&(s=t.setTimeout(S,u))}})()};S()};t.addEventListener("pagehide",g),t.addEventListener("pageshow",l=>{l.persisted===!0&&d()}),d()}if(L.reportNavigation!==!1){const m=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]),i=(n,u)=>{try{const r=new URL(n,u);return r.protocol==="http:"||r.protocol==="https:"||m.has(r.protocol)?null:r}catch{return null}},a=(n,u)=>{try{const r=new URL(n,u);return r.protocol==="http:"||r.protocol==="https:"?r:null}catch{return null}},p=n=>{var l;const u=n.type==="click"&&n.button===0,r=n.type==="auxclick"&&n.button===1;if(!u&&!r)return;const e=(l=t.document.defaultView)==null?void 0:l.Element;if(!e||!(n.target instanceof e))return;const s=n.target.closest("a[href]");if(!s)return;const o=i(s.href,t.document.baseURI);if(!o)return;const g=s.target.toLowerCase();!(r||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||g!==""&&g!=="_self")&&!s.hasAttribute("download")||(n.preventDefault(),t.location.href=o.href)};t.document.addEventListener("click",p,!0),t.document.addEventListener("auxclick",p,!0);const f=n=>{t.parent.postMessage({type:"navigation-request",...n},"*")};f({url:t.location.href});const A=t.navigation;if(A)A.addEventListener("navigate",n=>{var d,l;const u=n,r=(d=u.destination)==null?void 0:d.url;if(typeof r!="string")return;const e=a(r,t.location.href);if(!e)return;const s=((l=u.destination)==null?void 0:l.sameDocument)===!0,o={url:r,...u.navigationType==="replace"?{replace:!0}:{},...s?{sameDocument:!0}:{}};if(s){f(o);return}if(e.origin===t.location.origin){f({...o,native:!0});return}u.canIntercept!==!1&&u.preventDefault(),f(o)});else{t.document.addEventListener("click",r=>{var l;const e=r;if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;const s=(l=t.document.defaultView)==null?void 0:l.Element;if(!s||!(e.target instanceof s))return;const o=e.target.closest("a[href]");if(!o||o.target&&o.target.toLowerCase()!=="_self"||o.hasAttribute("download")||!o.getAttribute("href"))return;const d=a(o.href,t.document.baseURI);if(d){if(d.origin===t.location.origin&&d.pathname===t.location.pathname&&d.search===t.location.search&&d.hash!==""){f({url:d.href,sameDocument:!0});return}e.preventDefault(),f({url:d.href})}},!0);const n=t.history.pushState.bind(t.history),u=t.history.replaceState.bind(t.history);t.history.pushState=function(...e){n(...e),f({url:t.location.href,sameDocument:!0})},t.history.replaceState=function(...e){u(...e),f({url:t.location.href,replace:!0,sameDocument:!0})},t.addEventListener("popstate",()=>{f({url:t.location.href,sameDocument:!0})}),t.addEventListener("hashchange",()=>{f({url:t.location.href,sameDocument:!0})}),t.document.addEventListener("submit",r=>{var l,S;const e=r,s=e.target,o=(l=t.document.defaultView)==null?void 0:l.HTMLFormElement;if(!o||!(s instanceof o)||s.target&&s.target.toLowerCase()!=="_self")return;const g=a(s.action||t.location.href,t.document.baseURI);if(!g)return;if(e.preventDefault(),s.method.toLowerCase()==="get"){const T=(S=t.document.defaultView)==null?void 0:S.FormData;if(!T)return;const E=new URLSearchParams;for(const[M,_]of new T(s))typeof _=="string"&&E.append(M,_);g.search=E.toString()}f({url:g.href})},!0)}}y()}export{I as A,P as U,v as a,W as b,w as c,j as d,$ as e,V as f,F as g,q as h,X as i,H as j,x as k,U as l,B as m,O as n};