@telepath-computer/television 0.1.169 → 0.1.170

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.
@@ -0,0 +1 @@
1
+ (function(){const y=document.createElement("link").relList;if(y&&y.supports&&y.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))L(c);new MutationObserver(c=>{for(const u of c)if(u.type==="childList")for(const m of u.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&L(m)}).observe(document,{childList:!0,subtree:!0});function E(c){const u={};return c.integrity&&(u.integrity=c.integrity),c.referrerPolicy&&(u.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?u.credentials="include":c.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function L(c){if(c.ep)return;c.ep=!0;const u=E(c);fetch(c.href,u)}})();const X="url-target-request",v="url-target",O="artifact-missing-request",U="artifact-missing",G="proxy-content-changed",P="bridge-ready",C="leaving";function d(t){return typeof t=="object"&&t!==null}function B(t){return!d(t)||t.type!==X?!1:!("id"in t)}function K(t){return!d(t)||t.type!==v||typeof t.url!="string"&&t.url!==null?!1:!("id"in t)}function x(t){return!d(t)||t.type!==O?!1:!("id"in t)}function W(t){return!d(t)||t.type!==U||typeof t.title!="string"||typeof t.path!="string"?!1:!("id"in t)}function k(t){return!d(t)||t.type!==G?!1:!("id"in t)}function q(t){return!d(t)||t.type!==P||typeof t.url!="string"||"guid"in t&&typeof t.guid!="string"?!1:!("id"in t)}function V(t){return!d(t)||t.type!==C||typeof t.guid!="string"?!1:!("id"in t)}function F(t){return!d(t)||t.type!=="wheel"||typeof t.deltaX!="number"||typeof t.shiftKey!="boolean"?!1:!("id"in t)}function $(t){return!d(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!d(t)||t.type!=="filmstrip-key"||t.direction!==-1&&t.direction!==1?!1:!("id"in t)}function z(t){return!d(t)||t.type!=="swipe-move"||typeof t.deltaX!="number"?!1:!("id"in t)}function H(t){return!d(t)||t.type!=="swipe-end"||typeof t.velocityX!="number"?!1:!("id"in t)}function Q(t=window,y={}){const E=t;if(E.__televisionArtifactBridgeInstalled===!0||(E.__televisionArtifactBridgeInstalled=!0,t.parent===t))return;const c=(()=>{const r=Date.now().toString(36);try{const s=t.crypto;if(s&&typeof s.getRandomValues=="function"){const a=new Uint32Array(4);return s.getRandomValues(a),`tvb-${r}-${Array.from(a,n=>n.toString(36)).join("-")}`}}catch{}return`tvb-${r}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`})(),u=()=>{t.parent.postMessage({type:"bridge-ready",url:t.location.href,guid:c},"*")};t.addEventListener("pagehide",()=>{t.parent.postMessage({type:"leaving",guid:c},"*")}),t.addEventListener("pageshow",o=>{o.persisted===!0&&u()});const m=t.location.href;if((o=>{try{const e=new URL(o);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(e.pathname)}catch{return!1}})(m)&&typeof t.fetch=="function"){let r=null,s=5e3,a=!1;const n=()=>{(async()=>{try{const i=await t.fetch(m,{method:"HEAD"});if(!i.ok)throw new Error("Artifact poll failed");const f=i.headers.get("ETag");if(!f)throw new Error("Artifact poll missing ETag");s=5e3,r===null?r=f:f!==r&&(r=f,t.parent.postMessage({type:"proxy-content-changed"},"*"))}catch{s=Math.min(15e3,s*2)}finally{a||t.setTimeout(n,s)}})()};t.addEventListener("pagehide",()=>{a=!0}),n()}const _=()=>{t.document.documentElement&&(t.document.documentElement.style.touchAction="pan-y",t.document.documentElement.style.overscrollBehaviorX="contain",t.document.documentElement.style.overscrollBehaviorY="contain"),t.document.body&&(t.document.body.style.overscrollBehaviorX="contain",t.document.body.style.overscrollBehaviorY="contain")};if(_(),t.document.body||t.document.addEventListener("DOMContentLoaded",_,{once:!0}),y.reportNavigation!==!1){const o=r=>{t.parent.postMessage({type:"navigation-request",...r},"*")};o({url:t.location.href});const e=t.navigation;if(e)e.addEventListener("navigate",r=>{var p,l;const s=r,a=(p=s.destination)==null?void 0:p.url;if(typeof a!="string")return;const n=((l=s.destination)==null?void 0:l.sameDocument)===!0,i={url:a,...s.navigationType==="replace"?{replace:!0}:{},...n?{sameDocument:!0}:{}};if(n){o(i);return}try{if(new URL(a,t.location.href).origin===t.location.origin){o({...i,native:!0});return}}catch{}s.canIntercept!==!1&&s.preventDefault(),o(i)});else{t.document.addEventListener("click",a=>{var h;const n=a;if(n.metaKey||n.ctrlKey||n.shiftKey||n.altKey)return;const i=(h=t.document.defaultView)==null?void 0:h.Element;if(!i||!(n.target instanceof i))return;const f=n.target.closest("a[href]");if(!f||f.target&&f.target.toLowerCase()!=="_self"||f.hasAttribute("download"))return;const p=f.getAttribute("href");if(!p||p.startsWith("javascript:"))return;let l;try{l=new URL(f.href,t.document.baseURI)}catch{return}if(l.origin===t.location.origin&&l.pathname===t.location.pathname&&l.search===t.location.search&&l.hash!==""){o({url:l.href,sameDocument:!0});return}n.preventDefault(),o({url:l.href})},!0);const r=t.history.pushState.bind(t.history),s=t.history.replaceState.bind(t.history);t.history.pushState=function(...n){r(...n),o({url:t.location.href,sameDocument:!0})},t.history.replaceState=function(...n){s(...n),o({url:t.location.href,replace:!0,sameDocument:!0})},t.addEventListener("popstate",()=>{o({url:t.location.href,sameDocument:!0})}),t.addEventListener("hashchange",()=>{o({url:t.location.href,sameDocument:!0})}),t.document.addEventListener("submit",a=>{var h,b;const n=a,i=n.target,f=(h=t.document.defaultView)==null?void 0:h.HTMLFormElement;if(!f||!(i instanceof f)||i.target&&i.target.toLowerCase()!=="_self")return;n.preventDefault();const p=i.method.toLowerCase(),l=new URL(i.action||t.location.href,t.document.baseURI);if(p==="get"){const A=(b=t.document.defaultView)==null?void 0:b.FormData;if(!A)return;const R=new URLSearchParams;for(const[N,M]of new A(i))typeof M=="string"&&R.append(N,M);l.search=R.toString()}o({url:l.href})},!0)}}const D=o=>{var a,n;const e=(a=t.document.defaultView)==null?void 0:a.Element;if(!e||!(o instanceof e))return!1;const s=o.closest("input, textarea, select, [contenteditable], [role='textbox'], [role='searchbox'], [role='combobox'], [role='spinbutton'], [role='slider']");return s?s.hasAttribute("contenteditable")?((n=s.getAttribute("contenteditable"))==null?void 0:n.toLowerCase())!=="false":!0:!1};t.addEventListener("keydown",o=>{const e=o;e.key!=="ArrowLeft"&&e.key!=="ArrowRight"||e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||D(e.target)||(e.preventDefault(),t.parent.postMessage({type:"filmstrip-key",direction:e.key==="ArrowRight"?1:-1},"*"))},{capture:!0}),t.addEventListener("wheel",o=>{const e=o,r=e.shiftKey&&e.deltaX===0&&e.deltaY!==0,s=r?e.deltaY:e.deltaX,a=Math.abs(s),n=r?0:Math.abs(e.deltaY);a<=n||(e.preventDefault(),t.parent.postMessage({type:"wheel",deltaX:s,shiftKey:e.shiftKey},"*"))},{passive:!1});const S=8,I=100,T=1e3,g=new Map;t.addEventListener("pointerdown",o=>{const e=o;e.pointerType==="touch"&&g.set(e.pointerId,{startX:e.clientX,startY:e.clientY,lastX:e.clientX,offset:0,active:!1,discarded:!1,samples:[{time:e.timeStamp,offset:0}]})},{passive:!0}),t.addEventListener("pointermove",o=>{const e=o,r=g.get(e.pointerId);if(!r||r.discarded)return;if(!r.active){const i=e.clientX-r.startX,f=e.clientY-r.startY,p=Math.abs(i),l=Math.abs(f);if(p<S&&l<S)return;if(l>=p){r.discarded=!0;return}r.active=!0}const s=e.clientX-r.lastX;r.lastX=e.clientX,r.offset+=s,r.samples.push({time:e.timeStamp,offset:r.offset});const a=e.timeStamp-I;let n=0;for(let i=0;i<r.samples.length;i+=1){if(r.samples[i].time>=a){n=i;break}n=i+1}if(n>0){const i=Math.max(0,n-1);r.samples.splice(0,i)}t.parent.postMessage({type:"swipe-move",deltaX:s},"*"),e.preventDefault()},{passive:!1}),t.addEventListener("pointerup",o=>{const e=o,r=g.get(e.pointerId);if(!r||(g.delete(e.pointerId),!r.active))return;let s=0;if(r.samples.length>=2){const a=r.samples[0],n=r.samples[r.samples.length-1],i=n.time-a.time;i>0&&(s=(n.offset-a.offset)/i*T)}t.parent.postMessage({type:"swipe-end",velocityX:s},"*")}),t.addEventListener("pointercancel",o=>{const e=o,r=g.get(e.pointerId);r&&(g.delete(e.pointerId),r.active&&t.parent.postMessage({type:"swipe-end",velocityX:0},"*"))}),u()}export{U as A,v as U,$ as a,q as b,F as c,j as d,B as e,x as f,k as g,z as h,V as i,H as j,Q as k,W as l,O as m,K as n,X as o};
@@ -1 +1 @@
1
- import{h as d,j as m,k as p}from"./artifact-bridge-KdJfBNuH.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}}
1
+ import{k as d,l as g,m as p}from"./artifact-bridge-C0H5cXgO.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&&g(t.data)&&i(t.data)});var a;(a=window.__televisionContentBridge)==null||a.onHostMessage(t=>{g(t)&&i(t)});const c={type:p};window.parent.postMessage(c,"*");var m;(m=window.__televisionContentBridge)==null||m.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}}