1var rt=Object.defineProperty;var V=e=>{throw TypeError(e)};var at=(e,i,t)=>i in e?rt(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t;var C=(e,i,t)=>at(e,typeof i!="symbol"?i+"":i,t),q=(e,i,t)=>i.has(e)||V("Cannot "+t);var n=(e,i,t)=>(q(e,i,"read from private field"),t?t.call(e):i.get(e)),h=(e,i,t)=>i.has(e)?V("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(e):i.set(e,t),l=(e,i,t,s)=>(q(e,i,"write to private field"),s?s.call(e,t):i.set(e,t),t),T=(e,i,t)=>(q(e,i,"access private method"),t);import{R as lt}from"./chunk-QMGIS6GS-WxoVEX50.js";const Y="https://player.twitch.tv",ut=/(?:www\.|go\.)?twitch\.tv\/(?:videos?\/|\?video=)(\d+)($|\?)/,ct=/(?:www\.|go\.)?twitch\.tv\/([a-zA-Z0-9_]+)($|\?)/,Z={IDLE:"Idle",ENDED:"Ended"},O={PAUSE:2,PLAY:3,SEEK:4,SET_MUTED:10,SET_VOLUME:11};function G(e,i={}){const t={src:st(e,i),frameborder:"0",width:"100%",height:"100%",allow:"accelerometer; fullscreen; autoplay; encrypted-media; picture-in-picture;",sandbox:"allow-modals allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",scrolling:"no"};return i.config&&(t["data-config"]=JSON.stringify(i.config)),` 2 <style> 3 :host { 4 display: inline-block; 5 min-width: 300px; 6 min-height: 150px; 7 position: relative; 8 } 9 iframe { 10 position: absolute; 11 top: 0; 12 left: 0; 13 width: 100%; 14 height: 100%; 15 } 16 :host(:not([controls])) { 17 pointer-events: none; 18 } 19 </style> 20 <iframe${dt(t)}></iframe> 21 `}function st(e,i){var t;if(!e.src)return;const s=e.src.match(ut),u=e.src.match(ct),d={parent:(t=globalThis.location)==null?void 0:t.hostname,controls:e.controls===""?null:!1,autoplay:e.autoplay===""?null:!1,muted:e.muted,preload:e.preload,...i.config};if(s){const v=s[1];return`${Y}/?video=v${v}&${X(d)}`}else if(u){const v=u[1];return`${Y}/?channel=${v}&${X(d)}`}return""}var L,P,w,o,$,N,k,R,A,S,H,I,p,_,nt;class D extends(globalThis.HTMLElement??class{}){constructor(){super();h(this,p);C(this,"loadComplete",new tt);h(this,L);h(this,P);h(this,w);h(this,o,{});h(this,$,0);h(this,N,!1);h(this,k,1);h(this,R,!this.autoplay);h(this,A,!1);h(this,S,0);h(this,H,null);h(this,I,async t=>{var s,u,d,v;if(!n(this,w).contentWindow)return;const{data:f,source:W}=t;if(W===n(this,w).contentWindow){if(f.namespace==="twitch-embed")await new Promise(M=>setTimeout(M,10)),f.eventName==="ready"?(this.dispatchEvent(new Event("loadcomplete")),this.loadComplete.resolve(),l(this,S,1),this.dispatchEvent(new Event("loadedmetadata"))):f.eventName==="seek"?(l(this,A,!0),this.dispatchEvent(new Event("seeking"))):f.eventName==="playing"?(n(this,A)&&(l(this,A,!1),this.dispatchEvent(new Event("seeked"))),l(this,S,3),this.dispatchEvent(new Event("playing"))):this.dispatchEvent(new Event(f.eventName));else if(f.namespace==="twitch-embed-player-proxy"&&f.eventName==="UPDATE_STATE"){const M=n(this,o).duration,E=n(this,o).currentTime,x=n(this,o).volume,U=n(this,o).muted,m=(u=(s=n(this,o).stats)==null?void 0:s.videoStats)==null?void 0:u.bufferSize;l(this,o,{...n(this,o),...f.params}),M!==n(this,o).duration&&this.dispatchEvent(new Event("durationchange")),E!==n(this,o).currentTime&&this.dispatchEvent(new Event("timeupdate")),(x!==n(this,o).volume||U!==n(this,o).muted)&&(n(this,o).volume!==void 0&&l(this,k,n(this,o).volume),n(this,o).muted!==void 0&&l(this,N,n(this,o).muted),this.dispatchEvent(new Event("volumechange"))),m!==((v=(d=n(this,o).stats)==null?void 0:d.videoStats)==null?void 0:v.bufferSize)&&this.dispatchEvent(new Event("progress"))}}});T(this,p,nt).call(this,"config")}get config(){return n(this,H)}set config(t){l(this,H,t)}async load(){if(n(this,L))return;this.shadowRoot||this.attachShadow({mode:"open"});const t=!n(this,P);if(n(this,P)&&(this.loadComplete=new tt),l(this,P,!0),await l(this,L,Promise.resolve()),l(this,L,null),l(this,S,0),this.dispatchEvent(new Event("emptied")),!this.src){this.shadowRoot.innerHTML="",globalThis.removeEventListener("message",n(this,I));return}this.dispatchEvent(new Event("loadstart"));let s=this.shadowRoot.querySelector("iframe");const u=ht(this.attributes);t&&s&&l(this,H,JSON.parse(s.getAttribute("data-config")||"{}")),(!(s!=null&&s.src)||s.src!==st(u,this))&&(this.shadowRoot.innerHTML=G(u,this),s=this.shadowRoot.querySelector("iframe")),l(this,w,s),globalThis.addEventListener("message",n(this,I))}attributeChangedCallback(t,s,u){if(s!==u)switch(t){case"src":case"controls":{this.load();break}}}getVideoPlaybackQuality(){return n(this,o).stats.videoStats}get src(){return this.getAttribute("src")}set src(t){this.setAttribute("src",t)}get readyState(){return n(this,S)}get seeking(){return n(this,A)}get buffered(){var t,s;return mt(0,((s=(t=n(this,o).stats)==null?void 0:t.videoStats)==null?void 0:s.bufferSize)??0)}get paused(){return n(this,o).playback?n(this,o).playback===Z.IDLE:n(this,R)}get ended(){return n(this,o).playback?n(this,o).playback===Z.ENDED:!1}get duration(){return n(this,o).duration??NaN}get autoplay(){return this.hasAttribute("autoplay")}set autoplay(t){this.autoplay!=t&&this.toggleAttribute("autoplay",!!t)}get controls(){return this.hasAttribute("controls")}set controls(t){this.controls!=t&&this.toggleAttribute("controls",!!t)}get currentTime(){return n(this,o).currentTime?n(this,o).currentTime:n(this,$)}set currentTime(t){l(this,$,t),this.loadComplete.then(()=>{T(this,p,_).call(this,O.SEEK,t)})}get defaultMuted(){return this.hasAttribute("muted")}set defaultMuted(t){this.toggleAttribute("muted",!!t)}get loop(){return this.hasAttribute("loop")}set loop(t){this.toggleAttribute("loop",!!t)}get muted(){return n(this,N)}set muted(t){l(this,N,t),this.loadComplete.then(()=>{T(this,p,_).call(this,O.SET_MUTED,t)})}get volume(){return n(this,k)}set volume(t){l(this,k,t),this.loadComplete.then(()=>{T(this,p,_).call(this,O.SET_VOLUME,t)})}
21get playsInline(){return this.hasAttribute("playsinline")}set playsInline(t){this.toggleAttribute("playsinline",!!t)}play(){l(this,R,!1),T(this,p,_).call(this,O.PLAY)}pause(){l(this,R,!0),T(this,p,_).call(this,O.PAUSE)}}L=new WeakMap,P=new WeakMap,w=new WeakMap,o=new WeakMap,$=new WeakMap,N=new WeakMap,k=new WeakMap,R=new WeakMap,A=new WeakMap,S=new WeakMap,H=new WeakMap,I=new WeakMap,p=new WeakSet,_=function(t,s){if(!n(this,w).contentWindow)return;const u={eventName:t,params:s,namespace:"twitch-embed-player-proxy"};n(this,w).contentWindow.postMessage(u,Y)},nt=function(t){if(Object.prototype.hasOwnProperty.call(this,t)){const s=this[t];delete this[t],this[t]=s}},C(D,"getTemplateHTML",G),C(D,"shadowRootOptions",{mode:"open"}),C(D,"observedAttributes",["autoplay","controls","loop","muted","playsinline","preload","src"]);function ht(e){let i={};for(let t of e)i[t.name]=t.value;return i}function dt(e){let i="";for(const t in e){const s=e[t];s===""?i+=` ${J(t)}`:i+=` ${J(t)}="${J(`${s}`)}"`}return i}function J(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/`/g,"`")}function X(e){return String(new URLSearchParams(ft(e)))}function ft(e){let i={};for(let t in e){let s=e[t];s===!0||s===""?i[t]=!0:s===!1?i[t]=!1:s!=null&&(i[t]=s)}return i}class tt extends Promise{constructor(i=()=>{}){let t,s;super((u,d)=>{i(u,d),t=u,s=d}),this.resolve=t,this.reject=s}}function mt(e,i){return Array.isArray(e)?K(e):i==null||i===0?K([[0,0]]):K([[e,i]])}function K(e){return Object.defineProperties(e,{start:{value:i=>e[i][0]},end:{value:i=>e[i][1]}}),e}globalThis.customElements&&!globalThis.customElements.get("twitch-video")&&globalThis.customElements.define("twitch-video",D);var pt=D,vt=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),gt={className:"class",htmlFor:"for"};function ot(e){return e.toLowerCase()}function et(e){if(typeof e=="boolean")return e?"":void 0;if(typeof e!="function"&&!(typeof e=="object"&&e!==null))return e}function yt({react:e,tagName:i,elementClass:t,events:s,displayName:u,defaultProps:d,toAttributeName:v=ot,toAttributeValue:f=et}){const W=Number.parseInt(e.version)>=19,B=e.forwardRef((M,E)=>{var x,U;const m=e.useRef(null),z=e.useRef(new Map),F={},Q={},g={},j={};for(const[r,a]of Object.entries(M)){if(vt.has(r)){g[r]=a;continue}const c=v(gt[r]??r);if(t.prototype&&r in t.prototype&&!(r in(((x=globalThis.HTMLElement)==null?void 0:x.prototype)??{}))&&!((U=t.observedAttributes)!=null&&U.some(b=>b===c))){j[r]=a;continue}if(r.startsWith("on")){F[r]=a;continue}const y=f(a);if(c&&y!=null&&(Q[c]=String(y),W||(g[c]=y)),c&&W){const b=et(a);y!==b?g[c]=y:g[c]=a}}if(typeof window<"u"){for(const r in F){const a=F[r],c=r.endsWith("Capture"),y=((s==null?void 0:s[r])??r.slice(2).toLowerCase()).slice(0,c?-7:void 0);e.useLayoutEffect(()=>{const b=m==null?void 0:m.current;if(!(!b||typeof a!="function"))return b.addEventListener(y,a,c),()=>{b.removeEventListener(y,a,c)}},[m==null?void 0:m.current,a])}e.useLayoutEffect(()=>{if(m.current===null)return;const r=new Map;for(const a in j)it(m.current,a,j[a]),z.current.delete(a),r.set(a,j[a]);for(const[a,c]of z.current)it(m.current,a,void 0);z.current=r})}if(typeof window>"u"&&(t!=null&&t.getTemplateHTML)&&(t!=null&&t.shadowRootOptions)){const{mode:r,delegatesFocus:a}=t.shadowRootOptions,c=e.createElement("template",{shadowrootmode:r,shadowrootdelegatesfocus:a,dangerouslySetInnerHTML:{__html:t.getTemplateHTML(Q,M)},key:"ce-la-react-ssr-template-shadow-root"});g.children=[c,g.children]}return e.createElement(i,{...d,...g,ref:e.useCallback(r=>{m.current=r,typeof E=="function"?E(r):E!==null&&(E.current=r)},[E])},g.children)});return B.displayName=u??t.name,B}function it(e,i,t){var s;e[i]=t,t==null&&i in(((s=globalThis.HTMLElement)==null?void 0:s.prototype)??{})&&e.removeAttribute(i)}var bt=yt({react:lt,tagName:"twitch-video",elementClass:pt,toAttributeName(e){return e==="muted"?"":e==="defaultMuted"?"muted":ot(e)}});/*! Bundled license information: 22 23ce-la-react/dist/ce-la-react.js: 24 (** 25 * @license 26 * Copyright 2018 Google LLC 27 * SPDX-License-Identifier: BSD-3-Clause 28 * 29 * Modified version of `@lit/react` for vanilla custom elements with support for SSR. 30 *) 31*/export{bt as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.