@banou/stub 0.0.53 → 0.0.54
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.
- package/README.md +1 -1
- package/build/assets/anime-index-CWT8EUVb.js +1 -0
- package/build/assets/anime-seasons-CoquI0pK.js +1 -0
- package/build/assets/dist-BhdcN4JK.js +1328 -0
- package/build/assets/embed-BXVON2cN.js +293 -0
- package/build/assets/embed-title-BD9cgqvV.js +1 -0
- package/build/assets/emotion-react-jsx-runtime.browser.esm-BQbalngd.js +1 -0
- package/build/assets/index-CKS-vpo7.js +2631 -0
- package/build/assets/{lib-account-D3OycIgO.js → lib-account-COp-RaN5.js} +1 -1
- package/build/assets/lib-account-CiFA5y4M.js +2 -0
- package/build/assets/lib-api-DIgTslNb-DP1_yG_t.js +374 -0
- package/build/assets/lib-api-Dqph3zoA.js +2 -0
- package/build/assets/{lib-api-DIgTslNb-Dy8pDGuW.js → lib-build-JdIfVZn7.js} +549 -918
- package/build/assets/lib-dist-DvqYL0NS.js +112 -0
- package/build/assets/lib-emotion-react-jsx-runtime.browser.esm-BXK3nCt6.js +2741 -0
- package/build/assets/lib-jassub-worker-CLcXAXXL.wasm +0 -0
- package/build/assets/lib-jassub-worker-modern-C7bYVPj4.wasm +0 -0
- package/build/assets/lib-remote-C1YHVUVa.js +2 -0
- package/build/assets/lib-remote-Cgazpbxo.js +416 -0
- package/build/assets/lib-theme-player-Ca8vejFM.js +8749 -0
- package/build/assets/{lib-worker-D7ltCEvc.js → lib-worker-PtOuAkPf.js} +1750 -1856
- package/build/assets/{lib-worker-DZgpvc1s.js → lib-worker-Z6aSHw7w.js} +1 -1
- package/build/assets/lib-worker-anime-index-CWT8EUVb.js +1 -0
- package/build/assets/lib-worker-anime-seasons-CoquI0pK.js +1 -0
- package/build/assets/lib-worker-fonts-pE_hQFbP.js +1 -0
- package/build/assets/lib-worker-index-wTApHofM.js +2631 -0
- package/build/assets/lib-worker-jassub-worker-5YNtWxS6.js +1 -0
- package/build/assets/lib-worker-worker-BNxa-Gim.js +150 -0
- package/build/assets/main-L3DMTKgc.js +5095 -0
- package/build/assets/preload-helper-BXrbqLIp.js +1 -0
- package/build/assets/site-status-c5cvFL2q.js +71 -0
- package/build/assets/theme-player-kjqP6iMr.js +1 -0
- package/build/assets/{worker-qLAlm6Pb.js → worker-DuBkNi7w.js} +1 -1
- package/build/assets/worker-DxIvGCqk.js +1 -0
- package/build/embed.html +6 -3
- package/build/index.html +6 -4
- package/build/index.js +12790 -13669
- package/fkn.json +1 -1
- package/package.json +2 -2
- package/build/assets/anime-index-Jbe1K3rX.js +0 -1
- package/build/assets/anime-seasons-DrpjiWUr.js +0 -1
- package/build/assets/embed-DOZMBs0N.js +0 -1602
- package/build/assets/embed-title-MMtofoQC.js +0 -1
- package/build/assets/index-B8gPouDs.js +0 -2450
- package/build/assets/lib-account-B1yNOmvG.js +0 -2
- package/build/assets/lib-api-BH2vA5gl.js +0 -2
- package/build/assets/lib-rolldown-runtime-Cb76FRpK.js +0 -27
- package/build/assets/lib-worker-anime-index-Jbe1K3rX.js +0 -1
- package/build/assets/lib-worker-anime-seasons-DrpjiWUr.js +0 -1
- package/build/assets/lib-worker-index-1ZMF_r_h.js +0 -2450
- package/build/assets/main-BszJRFw8.js +0 -4507
- package/build/assets/site-status--bPTCMnf.js +0 -71
- package/build/assets/worker-BJsKc37z.js +0 -1
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
import{a as e,b as t,i as n,l as r,p as i,s as a,t as o}from"./embed-title-BD9cgqvV.js";import{I as s,J as c,K as l,L as u,Q as d,U as f,X as p,Z as m,at as h,ct as g,d as _,dt as v,et as y,it as b,lt as x,n as S,nt as C,ot as w,q as T,r as E,rt as D,st as O,t as k,tt as A,ut as j,z as M}from"./emotion-react-jsx-runtime.browser.esm-BQbalngd.js";import{a as ee,b as N,c as te,l as ne,o as re,s as ie,u as ae}from"./site-status-c5cvFL2q.js";import{A as oe,B as P,C as se,D as F,E as ce,F as I,G as L,H as le,I as ue,J as de,K as fe,L as pe,M as me,N as he,O as R,P as ge,Q as z,R as _e,S as ve,T as ye,U as be,V as B,W as xe,X as Se,Y as V,Z as Ce,_ as we,a as Te,b as Ee,c as De,d as Oe,f as ke,g as Ae,h as je,i as H,j as Me,k as Ne,l as Pe,m as Fe,n as Ie,o as Le,p as Re,q as ze,r as Be,s as Ve,t as He,u as Ue,v as We,w as Ge,x as Ke,y as qe,z as Je}from"./dist-BhdcN4JK.js";import{n as Ye}from"./remote-CAlKhZLk.js";function U(e,t){let n={...t};for(let t in e)z(e[t])||(n[t]=e[t]);return n}function Xe(e,t){let n={};for(let r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function Ze(e){return typeof e==`string`?e:e.text}function Qe(e){return Se(e)&&`key`in e&&`text`in e}function W(e,t,n){return typeof e==`string`?e:typeof t==`function`?t(e,n):fe(Ze(e),t??n)}function $e(e){let t=e.closest(`[dir]`)?.getAttribute(`dir`);return t?t.toLowerCase()===`rtl`:getComputedStyle(e).direction===`rtl`}function et(){return typeof CSS<`u`&&CSS.supports(`anchor-name: --a`)}function tt(){return typeof navigator<`u`&&/mac/i.test(navigator.userAgent)}var nt={sideOffset:0,boundaryOffset:0},rt={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function it(e,t,n,r){let i=r.boundaryOffset??0;switch(n){case`top`:return e.top-t.top-i-r.sideOffset;case`bottom`:return t.bottom-e.bottom-i-r.sideOffset;case`left`:return e.left-t.left-i-r.sideOffset;case`right`:return t.right-e.right-i-r.sideOffset}}function at(e,t,n,r,i=nt){let a=r.side,o=rt[a],s=a===`top`||a===`bottom`?t.height:t.width,c=it(e,n,a,i);return c>=s?a:it(e,n,o,i)>c?o:a}function ot(e){try{e?.showPopover?.()}catch{}}function st(e){try{e?.hidePopover?.()}catch{}}function ct(e,t){let n=t.trim();if(!n)return 0;let r=Number.parseFloat(n);if(!Number.isNaN(r)&&(/^-?\d*\.?\d+$/.test(n)||n.endsWith(`px`)))return r;let i=e.ownerDocument,a=i?.documentElement;if(!Number.isNaN(r)&&n.endsWith(`rem`))return r*(a&&Number.parseFloat(getComputedStyle(a).fontSize)||16);if(!Number.isNaN(r)&&n.endsWith(`em`))return r*(e instanceof HTMLElement&&Number.parseFloat(getComputedStyle(e).fontSize)||16);if(!i)return Number.isNaN(r)?0:r;let o=i.createElement(`div`);if(o.style.position=`absolute`,o.style.visibility=`hidden`,o.style.pointerEvents=`none`,o.style.inlineSize=n,!o.style.inlineSize)return 0;o.style.blockSize=`0`,o.style.padding=`0`,o.style.border=`0`,o.style.inset=`0`;let s=getComputedStyle(e);o.style.fontSize=s.fontSize;for(let e=0;e<s.length;e++){let t=s.item(e);t.startsWith(`--`)&&o.style.setProperty(t,s.getPropertyValue(t))}let c=i.body??i.documentElement;if(!c)return Number.isNaN(r)?0:r;if(c.appendChild(o),getComputedStyle(o).inlineSize===`auto`)return o.remove(),0;let l=o.getBoundingClientRect().width;return o.remove(),Number.isFinite(l)?l:Number.isNaN(r)?0:r}function lt(e,t,n){let r=n?.leading??!1,i=null,a,o=!1;function s(){i=setTimeout(()=>{i=null,o&&(o=!1,e(...a),s())},t)}let c=(...n)=>{if(a=n,r)i===null?(e(...a),s()):o=!0;else{if(i!==null)return;i=setTimeout(()=>{i=null,e(...a)},t)}};return c.cancel=()=>{i!==null&&(clearTimeout(i),i=null),o=!1},c}function ut(e,t,n){return _e(t=>e.subscribe(t),()=>e.current,t??pe,n)}var dt={target:R,signals:new Ne,get:R,set:R};function G(e){let t=e.state(dt),n=Object.keys(t),r=n[0];return Object.assign(r?e=>{if(r in e)return Xe(e,n)}:()=>void 0,{displayName:e.name})}var K=class e extends Error{static MEDIA_ERR_ABORTED=1;static MEDIA_ERR_NETWORK=2;static MEDIA_ERR_DECODE=3;static MEDIA_ERR_SRC_NOT_SUPPORTED=4;static MEDIA_ERR_ENCRYPTED=5;static MEDIA_ERR_CUSTOM=100;static defaultMessages={1:`You stopped media playback before it finished.`,2:`This media could not be loaded due to a network or server issue.`,3:`This media could not be played. It may be corrupted, or your browser may not support its format.`,4:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`,5:`This media could not be played because it could not be decrypted.`};name;code;context;fatal;data;constructor(t,n=e.MEDIA_ERR_CUSTOM,r,i){super(t),this.name=`MediaError`,this.code=n,this.context=i,this.fatal=r??(n>=e.MEDIA_ERR_NETWORK&&n<=e.MEDIA_ERR_ENCRYPTED),this.message||=e.defaultMessages[this.code]??``}},ft={ON_DEMAND:`on-demand`,LIVE:`live`,UNKNOWN:`unknown`},pt=ce({name:`live`,state:()=>({liveEdgeStart:NaN,targetLiveWindow:NaN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(!se(r))return;let i=()=>n({liveEdgeStart:r.liveEdgeStart,targetLiveWindow:r.targetLiveWindow});i(),B(r,`targetlivewindowchange`,i,{signal:t}),B(r,`streamtypechange`,i,{signal:t}),B(r,`loadedmetadata`,i,{signal:t}),B(r,`canplay`,i,{signal:t}),B(r,`progress`,i,{signal:t}),B(r,`durationchange`,i,{signal:t}),B(r,`timeupdate`,i,{signal:t}),B(r,`emptied`,i,{signal:t})}}),mt=ce({name:`streamType`,state:()=>({streamType:ft.UNKNOWN}),attach({target:e,signal:t,set:n}){let{media:r}=e;if(ye(r)){let e=()=>n({streamType:r.streamType});e(),B(r,`streamtypechange`,e,{signal:t});return}if(!Ge(r))return;let i=()=>{let{duration:e}=r;return e===1/0?ft.LIVE:Number.isFinite(e)&&e>0?ft.ON_DEMAND:ft.UNKNOWN},a=()=>n({streamType:i()});a(),B(r,`durationchange`,a,{signal:t}),B(r,`loadedmetadata`,a,{signal:t}),B(r,`emptied`,a,{signal:t}),ve(r)&&B(r,`progress`,a,{signal:t})}});G(Ke);var ht=G(Ee),gt=G(We),_t=G(we),vt=G(Ae);G(pt);var yt=G(je),bt=G(Fe),xt=G(Re);G(ke),G(Oe),G(Ue),G(mt);var St=G(Pe),Ct=G(De),wt=G(Ve),Tt={seekStep({store:e,value:t}){if(z(t))return;let n=Ct(e.state);n&&n.seek(n.currentTime+t)},volumeStep({store:e,value:t}){if(z(t))return;let n=wt(e.state);n&&n.setVolume(n.volume+t)},speedUp({store:e}){let t=xt(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<0||i>=n.length-1?0:i+1;t.setPlaybackRate(n[a])},speedDown({store:e}){let t=xt(e.state);if(!t)return;let{playbackRates:n,playbackRate:r}=t,i=n.indexOf(r),a=i<=0?n.length-1:i-1;t.setPlaybackRate(n[a])}},Et={seekStep:Tt.seekStep,volumeStep:Tt.volumeStep,speedUp:Tt.speedUp,speedDown:Tt.speedDown};function Dt(e){return Et[e]||(({store:t})=>{let n=t.state[e];ze(n)&&n()})}var Ot=200,kt=class{#e=0;#t=null;handleUp(e,t){if(e.resolve(`doubletap`).length>0){let n=Date.now();if(n-this.#e<Ot){this.#n(),this.#e=0,e.resolve(`doubletap`)[0]?.onActivate(t);return}this.#e=n,this.#n(),this.#t=setTimeout(()=>{this.#t=null,this.#e=0,e.resolve(`tap`)[0]?.onActivate(t)},Ot);return}e.resolve(`tap`)[0]?.onActivate(t)}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}reset(){this.#n(),this.#e=0}},At=new WeakMap;function jt(e){let t=At.get(e);return t||(t=new kt,At.set(e,t),t)}function Mt(e,t,n){return qe(e).add({type:`tap`,recognizer:jt(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Nt(e,t,n){return qe(e).add({type:`doubletap`,recognizer:jt(e),onActivate:t,pointer:n?.pointer,region:n?.region,disabled:n?.disabled,action:n?.action,value:n?.value})}function Pt(e){return e.startsWith(`toggle`)}var Ft={togglePaused({store:e}){let t=bt(e.state);t&&(t.paused?t.play():t.pause())},toggleMuted({store:e}){wt(e.state)?.toggleMuted()},toggleFullscreen({store:e}){let t=vt(e.state);t&&(t.fullscreen?t.exitFullscreen():t.requestFullscreen())},toggleSubtitles({store:e}){St(e.state)?.toggleSubtitles()},togglePictureInPicture({store:e}){let t=yt(e.state);t&&(t.pip?t.exitPictureInPicture():t.requestPictureInPicture())},seekStep:Tt.seekStep,volumeStep:Tt.volumeStep,speedUp:Tt.speedUp,speedDown:Tt.speedDown,seekToPercent({store:e,value:t,key:n}){let r=Ct(e.state);if(!r||r.duration<=0)return;let i;if(!z(t))i=t;else if(n>=`0`&&n<=`9`)i=Number(n)*10;else return;r.seek(i/100*r.duration)}};function It(e){return Ft[e]}var Lt={shift:`Shift`,ctrl:`Control`,alt:`Alt`,meta:`Meta`},Rt={shift:`Shift`,ctrl:`Ctrl`,alt:`Alt`,meta:`Meta`},zt=[`ctrl`,`shift`,`alt`,`meta`];function Bt(e){return e.map(e=>{let t=[];for(let n of zt)e.modifiers.has(n)&&t.push(Lt[n]);return t.push(e.originalKey),t.join(`+`)}).join(` `)}function Vt(e){let t=[];for(let n of zt)e.modifiers.has(n)&&t.push(Rt[n]);return t.push(Ht(e.originalKey)),t.join(`+`)}function Ht(e){return e.length===1?e.toUpperCase():e}var Ut=class{#e;#t=[];#n=0;#r=null;#i=null;#a=new Set;#o=new Set;#s=!1;constructor(e){this.#e=e}subscribe(e){return this.#a.add(e),()=>this.#a.delete(e)}subscribeShortcutChanges(e){return this.#o.add(e),()=>this.#o.delete(e)}add(e){let t={parsed:Gt(e.keys),options:e,id:this.#n++};this.#t.push(t),this.#c(),e.target===`document`?this.#u():this.#l(),this.#h();let n=!1;return()=>{if(n)return;n=!0;let e=this.#t.indexOf(t);e!==-1&&this.#t.splice(e,1),this.#d(),this.#h()}}getAriaKeys(e){return this.getShortcut(e).aria}getShortcut(e,t){let n=this.#p(e,t);if(!n.length)return{};let r=n.flatMap(e=>e.parsed),i=n[n.length-1];return{aria:Bt(r),shortcut:this.#m(i)}}destroy(){this.#s||(this.#s=!0,this.#r?.abort(),this.#r=null,this.#i?.abort(),this.#i=null,this.#t=[],this.#h(),this.#a.clear(),this.#o.clear())}#c(){this.#t.sort((e,t)=>{let n=t.parsed[0].modifiers.size-e.parsed[0].modifiers.size;return n===0?e.id-t.id:n})}#l(){this.#r||(this.#r=new AbortController,B(this.#e,`keydown`,this.#f,{signal:this.#r.signal}))}#u(){this.#i||(this.#i=new AbortController,B(document,`keydown`,this.#f,{signal:this.#i.signal}))}#d(){let e=this.#t.some(e=>e.options.target!==`document`),t=this.#t.some(e=>e.options.target===`document`);e||(this.#r?.abort(),this.#r=null),t||(this.#i?.abort(),this.#i=null)}#f=e=>{if(e.key===`Unidentified`||be(e)||e.defaultPrevented)return;let t=le(e);for(let n of this.#t){let{options:r,parsed:i}=n;if(!r.disabled&&!(e.repeat&&r.repeatable===!1)&&r.target===`document`==(e.currentTarget===document)){for(let n of i)if(qt(n,e)&&!(t&&n.modifiers.size===0)){if(this.#a.size>0){let t={source:`hotkey`,action:r.action,value:r.value,event:e};for(let e of this.#a)try{e(t)}catch{}}e.preventDefault(),r.onActivate(e,n.originalKey);return}}}};#p(e,t){return this.#t.filter(n=>n.options.disabled||n.options.action!==e?!1:z(t)?!0:n.options.value===t).sort((e,t)=>e.id-t.id)}#m(e){return e.options.keys===`0-9`?e.options.keys:Vt(e.parsed[0])}#h(){for(let e of this.#o)e()}},Wt=new Set([`shift`,`ctrl`,`alt`,`meta`]);function Gt(e){if(e===`0-9`)return Array.from({length:10},(e,t)=>({modifiers:new Set,key:String(t),originalKey:String(t)}));let t=e.split(`+`),n=t.pop(),r=new Set;for(let e of t){let t=e.toLowerCase();t===`mod`?r.add(tt()?`meta`:`ctrl`):Wt.has(t)&&r.add(t)}return[{modifiers:r,key:n===`Space`?` `:n.toLowerCase(),originalKey:n}]}function Kt(e){return e.length===1&&!/[a-z]/i.test(e)}function qt(e,t){if(t.key===`Unidentified`||t.key.toLowerCase()!==e.key)return!1;let n=Kt(t.key),r=n?t.shiftKey&&e.modifiers.has(`shift`):t.shiftKey,i=n?t.altKey&&e.modifiers.has(`alt`):t.altKey;return r===e.modifiers.has(`shift`)&&t.ctrlKey===e.modifiers.has(`ctrl`)&&i===e.modifiers.has(`alt`)&&t.metaKey===e.modifiers.has(`meta`)}var Jt=new WeakMap;function Yt(e){let t=Jt.get(e);return t||(t=new Ut(e),Jt.set(e,t)),t}function Xt(e,t){return Yt(e).add(t)}function Zt(e){let{transition:t}=e,n=t.state,r=new AbortController,i=null;function a(){if(r.signal.aborted)return null;let{active:e,status:i}=n.current;return e&&i!==`ending`?null:(i===`ending`&&t.cancel(),t.open())}function o(e){let{active:i,status:a}=n.current;return r.signal.aborted||!i||a===`ending`?null:t.close(e)}function s(){if(c(),typeof document>`u`)return;i=new AbortController;let{signal:t}=i;B(document,`keydown`,l,{signal:t}),e.onDocumentActive?.(t)}function c(){i?.abort(),i=null}function l(t){t.key===`Escape`&&(t.defaultPrevented||n.current.active&&(e.closeOnEscape?.()??!0)&&e.onEscapeDismiss(t))}let u=n.subscribe(()=>{n.current.active?s():c()});r.signal.addEventListener(`abort`,()=>{u(),t.destroy(),c()});function d(){r.signal.aborted||r.abort()}return{input:n,open:a,close:o,signal:r.signal,destroy:d}}function Qt(e){let{onOpenChange:t}=e,n=null,r=null,i=null,a=Zt({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.stopPropagation(),c()}}),o=a.input;function s(){r=document.activeElement;let i=a.open();i&&(t(!0),requestAnimationFrame(()=>{!a.signal.aborted&&o.current.active&&n?.focus()}),i.then(()=>{!a.signal.aborted&&o.current.active&&e.onOpenChangeComplete?.(!0)}))}function c(){let i=a.close(n);i&&(t(!1),i.then(()=>{a.signal.aborted||(r&&=(r.focus(),null),e.onOpenChangeComplete?.(!1))}))}function l(){if(u(),!n)return;i=new AbortController;let{signal:e}=i;B(n,`click`,d,{signal:e})}function u(){i?.abort(),i=null}function d(e){e.target instanceof HTMLButtonElement&&c()}function f(e){n=e,l()}return a.signal.addEventListener(`abort`,()=>{u(),n=null,r=null}),{input:o,open:s,close:c,setElement:f,destroy:a.destroy}}function $t(e){let{onActivate:t,isDisabled:n}=e;return{role:`button`,tabIndex:0,onClick(e){if(n()){e.preventDefault();return}t(e)},onPointerDown(e){n()&&e.preventDefault()},onMouseDown(e){n()&&e.preventDefault()},onKeyDown(e){if(e.target===e.currentTarget){if(n()){e.key!==`Tab`&&e.preventDefault();return}e.key===`Enter`?(e.preventDefault(),t(e)):e.key===` `&&e.preventDefault()}},onKeyUp(e){e.target===e.currentTarget&&(n()||e.key===` `&&t(e))}}}var en={transitionStarting:`data-starting-style`,transitionEnding:`data-ending-style`};function tn(e){return{transitionStarting:e===`starting`,transitionEnding:e===`ending`}}function nn(e){let{onOpenChange:t,closeOnOutsideClick:n}=e,r=null,i=null,a=null,o=new Set,s=!1,c=null,l=Zt({transition:e.transition,closeOnEscape:e.closeOnEscape,onEscapeDismiss(e){e.preventDefault(),x(`escape`,e)},onDocumentActive(e){B(document,`pointerdown`,w,{capture:!0,signal:e})}}),u=l.input,d={close(e){x(e)}};function f(){a!==null&&(clearTimeout(a),a=null)}function p(){return globalThis.matchMedia?.(`(hover: hover)`)?.matches??!1}function m(){return p()?globalThis.matchMedia?.(`(pointer: fine)`)?.matches??!1:!1}function h(){return!e.openOnHover?.()||p()}function g(){s=!1,c!==null&&(clearTimeout(c),c=null)}function _(){s=!0,c!==null&&clearTimeout(c),c=setTimeout(g,500)}function v(){return s?(g(),!0):!1}function y(){return r?r.hasAttribute(`disabled`)?!0:r.getAttribute(`aria-disabled`)===`true`:!1}function b(n,r){let i=l.open();i&&(e.group?.()?.open(d),t(!0,r?{reason:n,event:r}:{reason:n}),i.then(()=>{!l.signal.aborted&&u.current.active&&e.onOpenChangeComplete?.(!0)}))}function x(n,r){let a=l.close(i);a&&(e.group?.()?.close(d),t(!1,r?{reason:n,event:r}:{reason:n}),a.then(()=>{l.signal.aborted||(st(i),e.onOpenChangeComplete?.(!1))}))}function S(e=`click`){b(e)}function C(e=`click`){x(e)}function w(e){if(!n()||!u.current.active)return;let t=e.composedPath();if(r&&t.includes(r)||i&&t.includes(i)){_();return}g(),x(`outside-click`,e)}l.signal.addEventListener(`abort`,()=>{e.group?.()?.close(d),f(),g(),o.clear(),r=null,i=null});let T={onClick(e){h()&&(y()||(u.current.active&&u.current.status!==`ending`?x(`click`,e):b(`click`,e)))},onPointerEnter(t){if(!e.openOnHover?.()||!p()||(f(),u.current.active))return;let n=e.delay?.()??300;a=setTimeout(()=>b(`hover`),n)},onPointerLeave(t){if(!e.openOnHover?.()||!p()||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onFocusIn(t){if(e.openOnHover?.()){if(!m())return;b(`focus`)}},onFocusOut(t){let n=t.relatedTarget;n&&(r?.contains(n)||i?.contains(n))||e.openOnHover?.()&&x(`blur`)}},E={onPointerEnter(t){e.openOnHover?.()&&f()},onPointerLeave(t){if(!e.openOnHover?.()||o.size>0||(f(),!u.current.active))return;let n=e.closeDelay?.()??0;a=setTimeout(()=>x(`hover`),n)},onGotPointerCapture(e){o.add(e.pointerId)},onLostPointerCapture(e){o.delete(e.pointerId)},onFocusOut(e){let t=e.relatedTarget;if(!(t&&(r?.contains(t)||i?.contains(t)))&&!v()){if(t!==null){x(`blur`);return}requestAnimationFrame(()=>{requestAnimationFrame(()=>{if(!u.current.active||u.current.status===`ending`||u.current.status===`starting`)return;let e=document.activeElement;e&&(r?.contains(e)||i?.contains(e))||x(`blur`)})})}}};function D(e){r=e}function O(e){!e&&i&&u.current.active&&st(i),i=e,e&&u.current.active&&ot(e)}return{input:u,triggerProps:T,popupProps:E,get triggerElement(){return r},setTriggerElement:D,setPopupElement:O,open:S,close:C,destroy:l.destroy}}function rn(e,t,n,r){let i=e+n,a=t+r;return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e,toJSON(){return{x:e,y:t,width:n,height:r,top:t,right:i,bottom:a,left:e}}}}function an(e,t){let n=Math.max(e.left,t.left),r=Math.max(e.top,t.top),i=Math.min(e.right,t.right),a=Math.min(e.bottom,t.bottom);return rn(n,r,Math.max(0,i-n),Math.max(0,a-r))}function on(e){let t=document.documentElement.getBoundingClientRect();return e?an(t,e.getBoundingClientRect()):t}function sn(e,t={}){if(!e)return null;if(!Ce(e))return e;if(e===`viewport`)return null;if(e===`container`)return t.container??null;try{return(t.root??document).querySelector(e)}catch{return null}}var cn={sideOffset:`--media-popover-side-offset`,alignOffset:`--media-popover-align-offset`,boundaryOffset:`--media-popover-boundary-offset`,anchorWidth:`--media-popover-anchor-width`,anchorHeight:`--media-popover-anchor-height`,availableWidth:`--media-popover-available-width`,availableHeight:`--media-popover-available-height`};function ln(e,t,n){return Math.max(t,Math.min(n,e))}function un(e,t,n){let r=Math.round((e-n)/t)*t+n,i=`${t}`.indexOf(`.`);return i===-1?r:Number(r.toFixed(`${t}`.length-i-1))}var dn={sideOffset:0,alignOffset:0,boundaryOffset:0},fn={top:`bottom`,bottom:`top`,left:`right`,right:`left`};function pn(e){return`${ln(e,0,1/0)}px`}function mn(e,t,n,r){let i=n-r;return i<t?t:ln(e,t,i)}function hn(e,t,n,r,i,a,o,s){let c=a===`start`?e+o:a===`end`?t+o:e+n/2+o,l=a===`start`?`0px`:a===`end`?`-100%`:`-50%`;return{base:`${c}px`,translate:`clamp(${r+s-c}px, ${l}, calc(${i-s-c}px - 100%))`}}function gn(e,t,n,r,i,a,o=cn){if(et())return{..._n(e,t,o,n,i,a),...n&&i?vn(n,i,t,a,o):{}};if(n&&r){let e=a??dn;return{position:`fixed`,margin:`0`,...yn(n,r,t,e,i),...i?vn(n,i,t,e,o):{}}}return{}}function _n(e,t,n=cn,r,i,a=dn){let o=`var(${n.sideOffset}, 0px)`,s=`var(${n.alignOffset}, 0px)`,{side:c,align:l}=t,u=a.boundaryOffset??0,d={positionAnchor:`--${e}`,position:`fixed`,inset:`auto`,margin:`0`,justifySelf:`normal`,alignSelf:`normal`,marginInlineStart:`0`,marginBlockStart:`0`,translate:`none`},f=fn[c];if(c===`top`||c===`bottom`){if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=hn(r.left,r.right,r.width,i.left,i.right,l,a.alignOffset,u);return d.left=e,d.translate=`${t} 0`,d}l===`start`?d.left=`calc(anchor(left) + ${s})`:l===`end`?d.right=`calc(anchor(right) + ${s})`:(d.justifySelf=`anchor-center`,d.marginInlineStart=s)}else{if(d[f]=`calc(anchor(${c}) + ${o})`,r&&i){let{base:e,translate:t}=hn(r.top,r.bottom,r.height,i.top,i.bottom,l,a.alignOffset,u);return d.top=e,d.translate=`0 ${t}`,d}l===`start`?d.top=`calc(anchor(top) + ${s})`:l===`end`?d.bottom=`calc(anchor(bottom) + ${s})`:(d.alignSelf=`anchor-center`,d.marginBlockStart=s)}return d}function vn(e,t,n,r=dn,i=cn){let a={},{side:o}=n,s=r.boundaryOffset??0,c=t.left+s,l=t.right-s,u=t.top+s,d=t.bottom-s;if(a[i.anchorWidth]=`${e.width}px`,a[i.anchorHeight]=`${e.height}px`,o===`top`||o===`bottom`){let t=o===`top`?e.top-u:d-e.bottom;a[i.availableHeight]=pn(t-r.sideOffset),a[i.availableWidth]=pn(l-c)}else{let t=o===`left`?e.left-c:l-e.right;a[i.availableWidth]=pn(t-r.sideOffset),a[i.availableHeight]=pn(d-u)}return a}function yn(e,t,n,r={sideOffset:0,alignOffset:0},i){let{side:a,align:o}=n,{sideOffset:s,alignOffset:c}=r,l=0,u,d=0,f;if(a===`top`?u=`calc(100% - ${e.top}px + ${s}px)`:a===`bottom`?l=e.bottom+s:a===`left`?f=`calc(100% - ${e.left}px + ${s}px)`:d=e.right+s,a===`top`||a===`bottom`?d=o===`start`?e.left+c:o===`end`?e.right-t.width+c:e.left+(e.width-t.width)/2+c:l=o===`start`?e.top+c:o===`end`?e.bottom-t.height+c:e.top+(e.height-t.height)/2+c,i){let e=r.boundaryOffset??0;a===`top`||a===`bottom`?d=mn(d,i.left+e,i.right-e,t.width):l=mn(l,i.top+e,i.bottom-e,t.height)}return{top:a===`top`?`auto`:`${l}px`,bottom:u??`auto`,left:a===`left`?`auto`:`${d}px`,right:f??`auto`}}function bn(e,t=cn){let n=getComputedStyle(e);return{sideOffset:ct(e,n.getPropertyValue(t.sideOffset)),alignOffset:ct(e,n.getPropertyValue(t.alignOffset)),boundaryOffset:ct(e,n.getPropertyValue(t.boundaryOffset))}}function xn(e,t){let n=e.getBoundingClientRect(),r=e.offsetWidth||n.width,i=e.offsetHeight||n.height;return rn(n.left,n.top,t===`left`||t===`right`?Math.max(r,e.scrollWidth):r,t===`top`||t===`bottom`?Math.max(i,e.scrollHeight):i)}function Sn(e,t,n,r){let i;return i=n===`vertical`?1-(e.clientY-t.top)/t.height:r?(t.right-e.clientX)/t.width:(e.clientX-t.left)/t.width,Number.isFinite(i)?ln(i*100,0,100):0}function Cn(e){let t=F({pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1}),n=new AbortController,r=e.changeThrottle??0,i=!1,a=!1,o=null,s=null,c=0,l=!1,u=r>0?lt(t=>e.onValueChange?.(t),r,{leading:!0}):null;function d(t,n){n&&u?u(t):e.onValueChange?.(t)}function f(){if(de(s))return;let t=s;s=null;try{e.getElement().releasePointerCapture(t)}catch{}}function p(){i?(l||e.onValueCommit?.(c),i=!1,t.patch({dragging:!1,pointing:!1}),e.onDragEnd?.()):t.patch({pointing:!1}),l=!1,m()}function m(){u?.cancel(),s=null,o=null}let h={onPointerDown(n){if(e.isDisabled())return;n.stopPropagation(),n.preventDefault();let r=e.getElement();o=r.getBoundingClientRect(),a=e.isRTL(),l=!1,f(),s=n.pointerId,r.setPointerCapture(n.pointerId);let u=Sn(n,o,e.getOrientation(),a);i=!0,c=u,t.patch({pointing:!0,dragging:!0,pointerPercent:u,dragPercent:u}),e.onDragStart?.(),e.onValueChange?.(u),e.getThumbElement?.()?.focus({preventScroll:!0,focusVisible:!1})},onPointerMove(n){if(e.isDisabled())return;if(!de(s)){if(n.pointerType!==`touch`&&n.buttons===0){p();return}let r=Sn(n,o,e.getOrientation(),a);c=r,t.patch({dragPercent:r,pointerPercent:r}),d(r,!0);return}let r=Sn(n,e.getElement().getBoundingClientRect(),e.getOrientation(),e.isRTL());t.patch({pointing:!0,pointerPercent:r})},onPointerUp(t){if(e.isDisabled()||(t.stopPropagation(),de(s)))return;let n=Sn(t,o,e.getOrientation(),a);u?.cancel(),e.onValueChange?.(n),e.onValueCommit?.(n),l=!0},onPointerLeave(){de(s)&&t.patch({pointing:!1})},onLostPointerCapture(){p()}},g={onKeyDown(n){if(e.isDisabled()){n.key!==`Tab`&&n.preventDefault();return}let r=e.getStepPercent(),i=e.getLargeStepPercent(),a=un(e.getPercent(),r,0),o=e.isRTL()?-1:1,s=n.shiftKey?i:r,c=null;switch(n.key){case`ArrowRight`:c=a+s*o;break;case`ArrowLeft`:c=a-s*o;break;case`ArrowUp`:c=a+s;break;case`ArrowDown`:c=a-s;break;case`PageUp`:c=a+i;break;case`PageDown`:c=a-i;break;case`Home`:c=0;break;case`End`:c=100}c!==null&&(n.preventDefault(),c=ln(c,0,100),t.patch({pointerPercent:c,dragPercent:c}),e.onValueChange?.(c),e.onValueCommit?.(c))},onFocus(){t.patch({focused:!0})},onBlur(){t.patch({focused:!1})}};function _(t){if(!e.adjustPercent||t.thumbAlignment!==`edge`)return t;let n=e.getElement(),r=e.getThumbElement?.();if(!r)return t;let i=t.orientation===`horizontal`,a=i?r.offsetWidth:r.offsetHeight,o=i?n.offsetWidth:n.offsetHeight;return{...t,fillPercent:e.adjustPercent(t.fillPercent,a,o),pointerPercent:e.adjustPercent(t.pointerPercent,a,o)}}let v=null;return e.onResize&&(v=new ResizeObserver(()=>e.onResize()),v.observe(e.getElement())),{input:t,rootProps:h,rootStyle:{touchAction:`none`,userSelect:`none`},thumbProps:g,adjustForAlignment:_,destroy(){n.signal.aborted||(n.abort(),v?.disconnect(),f(),m())}}}var wn={fill:`--media-slider-fill`,pointer:`--media-slider-pointer`,buffer:`--media-slider-buffer`};function Tn(e){return{[wn.fill]:`${e.fillPercent.toFixed(3)}%`,[wn.pointer]:`${e.pointerPercent.toFixed(3)}%`}}function En(e){return{...Tn(e),[wn.buffer]:`${e.bufferPercent.toFixed(3)}%`}}function Dn(e,t){let n=e/2;return{position:`absolute`,left:t===`visible`?`calc(var(${wn.pointer}) - ${n}px)`:`min(max(0px, calc(var(${wn.pointer}) - ${n}px)), calc(100% - ${e}px))`,width:`max-content`,pointerEvents:`none`}}var On=class{findActiveThumbnail(e,t){if(e.length===0)return;let n=0,r=e.length-1,i;for(;n<=r;){let a=n+r>>>1,o=e[a];t>=o.startTime?(i=o,n=a+1):r=a-1}return i}parseConstraints(e){let t=parseFloat(e.minWidth),n=parseFloat(e.maxWidth),r=parseFloat(e.minHeight),i=parseFloat(e.maxHeight);return{minWidth:Number.isFinite(t)?t:0,maxWidth:Number.isFinite(n)?n:1/0,minHeight:Number.isFinite(r)?r:0,maxHeight:Number.isFinite(i)?i:1/0}}calculateScale(e,t,n){let{minWidth:r,maxWidth:i,minHeight:a,maxHeight:o}=n,s=Math.min(i/e,o/t),c=Math.max(r/e,a/t);return Number.isFinite(s)&&s<1?s:Number.isFinite(c)&&c>1?c:1}resize(e,t,n,r){let i=e.width??t,a=e.height??n;if(!i||!a)return;let o=this.calculateScale(i,a,r),s=e.coords?.x??0,c=e.coords?.y??0,l=o===1?0:1;return{scale:o,containerWidth:Math.max(0,Math.floor(i*o)-l*2),containerHeight:Math.max(0,Math.floor(a*o)-l*2),imageWidth:Math.ceil(t*o),imageHeight:Math.ceil(n*o),offsetX:Math.ceil(s*o)+l,offsetY:Math.ceil(c*o)+l}}getState(e,t,n){return{loading:e,error:t,hidden:!e&&!n}}getAttrs(e){return{role:`img`,"aria-hidden":`true`}}};function kn(e){let{getContainer:t,getImg:n,onStateChange:r}=e,i=new On,a=new AbortController,o=a.signal,s=!1,c=!1,l=0,u=0,d=``,f=!1,p=null;function m(){let e=n();e&&(l=e.naturalWidth,u=e.naturalHeight),s=!1,c=!1,r()}function h(){s=!1,c=!0,r()}function g(e){B(e,`load`,m,{signal:o}),B(e,`error`,h,{signal:o})}function _(){if(!f){let e=n();e&&(g(e),f=!0)}if(!p){let e=t();e&&(p=new ResizeObserver(r),p.observe(e))}}function v(e){_();let t=e??``;t!==d&&(d=t,t?(s=!0,c=!1):(s=!1,c=!1,l=0,u=0))}function y(){_();let e=n();e?.complete&&d&&(e.naturalWidth>0?(l=e.naturalWidth,u=e.naturalHeight,s=!1,c=!1):(s=!1,c=!0),r())}function b(){a.abort(),p?.disconnect(),p=null}return{get loading(){return s},get error(){return c},get naturalWidth(){return l},get naturalHeight(){return u},readConstraints(){let e=t();return e?i.parseConstraints(getComputedStyle(e)):{minWidth:0,maxWidth:1/0,minHeight:0,maxHeight:1/0}},updateSrc:v,connect:y,destroy:b}}var An={hover:`hover`,focus:`focus`,escape:`escape`,blur:`blur`,"imperative-action":`imperative-action`};function jn(e){let t={transition:e.transition,onOpenChange(t,n){let r=An[n.reason];if(!r)return;let i=e.group?.();t?i?.notifyOpen():i?.notifyClose();let a=n.event?{reason:r,event:n.event}:{reason:r};e.onOpenChange(t,a)},closeOnEscape:()=>!0,closeOnOutsideClick:()=>!1,openOnHover:()=>!0,delay:()=>{let t=e.group?.();return t?.shouldSkipDelay()?0:e.delay?.()??t?.delay??600},closeDelay:()=>{let t=e.group?.();return e.closeDelay?.()??t?.closeDelay??0}};e.onOpenChangeComplete&&(t.onOpenChangeComplete=e.onOpenChangeComplete);let n=nn(t),r=!1,{onClick:i,...a}=n.triggerProps,o={...a,onPointerDown(){r=!0},onPointerEnter(t){e.disabled?.()||t.pointerType!==`touch`&&a.onPointerEnter(t)},onFocusIn(t){if(!e.disabled?.()){if(r){r=!1;return}a.onFocusIn(t)}}},s={...n.popupProps,onPointerEnter(t){e.disableHoverablePopup?.()||n.popupProps.onPointerEnter(t)}};return{...n,triggerProps:o,popupProps:s,get triggerElement(){return n.triggerElement},open:()=>n.open(`hover`),close:(e=`hover`)=>n.close(e)}}function Mn(){let e=F({active:!1,status:`idle`}),t=!1,n=0,r=0;function i(i=null){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0;let a=e.current.active;return a&&e.patch({status:`idle`}),e.patch({active:!0,status:`starting`}),new Promise(o=>{n=requestAnimationFrame(()=>{n=0,a&&(Pn(i),Nn(i)),r=requestAnimationFrame(()=>{if(r=0,t||!e.current.active)return o();e.patch({status:`idle`}),o()})})})}function a(i){return cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.patch({status:`ending`}),new Promise(a=>{n=requestAnimationFrame(()=>{n=0,r=requestAnimationFrame(()=>{if(r=0,t)return a();Fn(i).finally(()=>{if(t||e.current.status!==`ending`)return a();e.patch({active:!1,status:`idle`}),a()})})})})}function o(){cancelAnimationFrame(n),cancelAnimationFrame(r),n=0,r=0,e.current.status!==`idle`&&e.patch({status:`idle`})}return{state:e,open:i,close:a,cancel:o,destroy(){t||(t=!0,o())}}}function Nn(e){e&&e.offsetHeight}function Pn(e){let t=e?.getAnimations?.({subtree:!0})??[];for(let e of t)e.cancel()}function Fn(e){if(!e)return Promise.resolve();let t=e.getAnimations?.()??[];return t.length===0?Promise.resolve():Promise.all(t.map(e=>e.finished)).then(ue,ue)}function In(e){return{onWheel(t){if(e.isDisabled())return;let n=Math.sign(t.deltaY);if(n===0)return;t.preventDefault();let r=e.getStepPercent(),i=ln(e.getPercent()-n*r,0,100);e.onValueChange?.(i)}}}function Ln(e,t){if(!t)return!1;if(ze(e.composedPath))return e.composedPath().includes(t);let n=e.target;return n instanceof Node&&t.contains(n)}function Rn(e,t){let n={};for(let r in e){if(t&&!(r in t))continue;let i=t?.[r]??zn(r),a=e[r];a===!0?n[i]=``:a&&(n[i]=String(a))}return n}function zn(e){return`data-${e.toLowerCase()}`}function Bn(e){return e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>=65&&e.charCodeAt(2)<=90}function Vn(e,t){return Bn(e)&&(typeof t==`function`||t===void 0)}function Hn(e,t){return t?e?n=>{t(n),e(n)}:t:e}function Un(e,t){return t&&e?`${t} ${e}`:t||e}function Wn(e,t){return t?e?{...e,...t}:t:e}function Gn(e,t){if(!t)return e;for(let n in t){let r=t[n];n===`className`?e.className=Un(e.className,r):n===`style`?e.style=Wn(e.style,r):e[n]=Vn(n,r)?Hn(e[n],r):r}return e}function Kn(...e){let t={};for(let n of e)t=Gn(t,n);return t}T();function qn(e,t){return ze(e)?e(t):e}function Jn(e,t){return ze(e)?e(t):e}function Yn(e){let t=e;return t.ref??t.props?.ref}function q(e,t,n){let{className:r,style:i,render:a}=t,{state:o,ref:s,props:u,stateAttrMap:d}=n,f=qn(r,o),p=Jn(i,o),m=Kn(d?Rn(o,d):{},...Array.isArray(u)?u:u?[u]:[]);if(f!==void 0&&(m.className=m.className?`${m.className} ${f}`:f),p!==void 0&&(m.style=m.style?{...m.style,...p}:p),ze(a)){let e=Je(s,m.ref);return a({...m,ref:e},o)}if(c(a)){let e=Yn(a),t=Je(s,m.ref,e),n=Kn(m,a.props);return n.ref=t,l(a,n)}return m.ref=Je(s,m.ref),x(e,m)}T();function Xn(e){let{displayName:t,onActivate:n,isDisabled:r}=e,i=A(e=>{},[t]);return{getButtonProps:A(e=>Kn($t({onActivate:n,isDisabled:r}),e),[n,r]),buttonRef:i}}T();function Zn(e,t){let n=oe(),[r,i]=C({});return y(()=>{if(!n||!e){i({});return}let r=Yt(n),a=()=>i(r.getShortcut(e,t));return a(),r.subscribeShortcutChanges(a)},[n,e,t]),r}T(),g(null).Provider,g(null).Provider,g(null).Provider,g(null).Provider;var Qn=g(!1);Qn.Provider;function $n(){return b(Qn)}g(null).Provider,T();var er=g(null),tr=er.Provider;function nr(){let e=b(er);if(!e)throw Error(`Tooltip compound components must be used within a Tooltip.Root`);return e}function rr(){return b(er)}T();function ir(e,t){return e.getLabelParams?.(t)}function ar(e){let{displayName:t,core:n,stateAttrMap:r,selector:i,action:a,hotkeyAction:o,hotkeyValue:s,tooltipLabel:c,isSupported:l}=e,u=new Set(Object.keys(n.defaultProps)),d=f(function(e,d){let{render:f,className:m,style:h,...g}=e,_={},v={};for(let e of Object.keys(g))u.has(e)?_[e]=g[e]:v[e]=g[e];let y=rr(),b=$n(),x=y?.setContent,S=I(i),w=Zn(o,s?.(_)),T=L(),[E]=C(()=>new n);u.has(`menuTrigger`)&&z(_.menuTrigger)&&(_.menuTrigger=b),E.setProps(_);let{getButtonProps:D,buttonRef:O}=Xn({displayName:t,onActivate:()=>{Promise.resolve(a(E,S)).catch(e=>{})},isDisabled:()=>!!_.disabled||!S});S&&E.setMedia(S);let k=S?E.getState():null,A=k?l?.(k)??!0:!1,j=k&&A?W(E.getLabel(k),T,ir(E,k)):void 0,M=k&&A?c?.(E,k)??j:void 0;if(p(()=>{if(x)return x(M?{label:M,shortcut:w.shortcut}:void 0),()=>x(void 0)},[x,M,w.shortcut]),!S||!k||!A)return null;let ee=E.getAttrs(k),N=ee[`aria-label`],te={...ee,...Qe(N)?{"aria-label":W(N,T,ir(E,k))}:void 0,"aria-keyshortcuts":w.aria};return q(`button`,{render:f,className:m,style:h},{state:k,stateAttrMap:r,ref:[d,O],props:[D(),te,v]})});return d.displayName=t,d}function J(e,t){return ze(e)?e(t)||void 0:e||void 0}var or=class{static defaultProps={open:!1,defaultOpen:!1};setProps(e){}#e=null;#t=void 0;#n=void 0;setInput(e){this.#e=e}setTitleId(e){this.#t=e}setDescriptionId(e){this.#n=e}getState(){let e=this.#e;return{open:e.active,status:e.status,titleId:this.#t,descriptionId:this.#n,...tn(e.status)}}getAttrs(e){return{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":e.titleId,"aria-describedby":e.descriptionId}}},sr={open:`data-open`,...en},cr=class e{static defaultProps={delay:500};state=F({visible:!1});#e={...e.defaultProps};#t=null;setProps(t){this.#e=U(t,e.defaultProps)}destroy(){this.#n()}update(e){let t=e.waiting&&!e.paused;t&&!this.state.current.visible&&!this.#t?this.#t=setTimeout(()=>{this.#t=null,this.state.patch({visible:!0})},this.#e.delay):t||(this.#n(),this.state.patch({visible:!1}))}#n(){this.#t!==null&&(clearTimeout(this.#t),this.#t=null)}},lr={visible:`data-visible`},ur=class{#e=null;setMedia(e){this.#e=e}getState(){let e=this.#e;return{visible:e.controlsVisible,userActive:e.userActive}}},dr={visible:`data-visible`,userActive:`data-user-active`},fr=class extends or{setProps(){}},pr=`common.`,mr={key:`${pr}empty`,text:``},hr={key:`${pr}ok`,text:`OK`},gr=`errors.`,_r={key:`${gr}aborted`,text:`You stopped media playback before it finished.`},vr={key:`${gr}network`,text:`This media could not be loaded due to a network or server issue.`},yr={key:`${gr}decode`,text:`This media could not be played. It may be corrupted, or your browser may not support its format.`},br={key:`${gr}source`,text:`This media could not be loaded. It may be unavailable, or your browser may not support its format.`},xr={key:`${gr}encrypted`,text:`This media could not be played because it could not be decrypted.`},Sr={key:`${gr}title`,text:`Something went wrong.`},Cr={key:`${gr}unexpected`,text:`An unexpected error occurred.`},wr={[K.MEDIA_ERR_ABORTED]:_r,[K.MEDIA_ERR_NETWORK]:vr,[K.MEDIA_ERR_DECODE]:yr,[K.MEDIA_ERR_SRC_NOT_SUPPORTED]:br,[K.MEDIA_ERR_ENCRYPTED]:xr,[K.MEDIA_ERR_CUSTOM]:mr},Tr={[K.MEDIA_ERR_SRC_NOT_SUPPORTED]:[`Failed to open media`]};function Er(e){return e>=K.MEDIA_ERR_ABORTED&&e<=K.MEDIA_ERR_ENCRYPTED}function Dr(){return Sr}function Or(){return hr}function kr(e,t){if(e){let t=wr[e.code],n=e.message?.trim();if(n){let r=K.defaultMessages[e.code];if(t&&r&&n===r)return t;let i=Tr[e.code];return t&&Er(e.code)&&!e.context&&i?.includes(n)?t:n}if(t)return t}return t?.trim()||Cr}var Ar=`fullscreen.`,jr={key:`${Ar}enter`,text:`Enter fullscreen`},Mr={key:`${Ar}exit`,text:`Exit fullscreen`},Nr=class e{static defaultProps={label:``,disabled:!1};state=F({fullscreen:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.fullscreen?Mr:jr)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.fullscreenAvailability;return this.state.patch({fullscreen:e.fullscreen,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.fullscreen?e.exitFullscreen():e.requestFullscreen()}},Pr={fullscreen:`data-fullscreen`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},Fr={key:`playback.rate`,text:`Playback rate {rate}`},Ir=`volume.`,Lr={key:`${Ir}mutedValue`,text:`{percent}, muted`};`${Ir}`;var Rr={key:`${Ir}label`,text:`Volume`};`${Ir}`;var zr=Intl.DurationFormat,Br=new Map;function Vr(e,t){if(e===`digital`){let e=e=>String(e).padStart(2,`0`);return{format:n=>{let r=`${e(n.minutes??0)}:${e(n.seconds??0)}`;return t===`always`||n.hours!==void 0?`${n.hours??0}:${r}`:r}}}let n=[[`hours`,`hour`],[`minutes`,`minute`],[`seconds`,`second`]];return{format:e=>n.filter(([t])=>e[t]!==void 0).map(([t,n])=>{let r=e[t]??0;return`${r} ${n}${r===1?``:`s`}`}).join(`, `)}}function Hr(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function Ur(e){let t=Array.isArray(e)?e[0]:e;return!t||t===`en`||t.startsWith(`en-`)}function Wr(e,t=`long`,n){let r=`${Hr(e)}:${t}:${n??``}`,i=Br.get(r);return i||(i=zr?new zr(e,n===void 0?{style:t}:{style:t,hoursDisplay:n}):Vr(t,n),Br.set(r,i)),i}function Gr(e){return V(e)&&Number.isFinite(e)}function Kr(e,t){if(!Gr(e))return`0:00`;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s=Gr(t??0)?Math.abs(t??0):0,c=Math.floor(s/3600),l=Math.floor(s/60%60),u=i>0||c>0,d=u||l>=10,f=u?{hours:i,minutes:a,seconds:o}:{minutes:a,seconds:o},p=Wr(`en`,`digital`,u?`always`:`auto`).format(f);return d||(p=p.replace(/^0(?=\d:)/,``)),`${n?`-`:``}${p}`}function qr(e){if(!Gr(e))return`PT0S`;let t=Math.abs(e),n=Math.floor(t/3600),r=Math.floor(t/60%60),i=Math.floor(t%60),a=`PT`;return n>0&&(a+=`${n}H`),r>0&&(a+=`${r}M`),(i>0||a===`PT`)&&(a+=`${i}S`),a}function Jr(e,t){if(!Gr(e))return``;let n=e<0,r=Math.floor(Math.abs(e)),i=Math.floor(r/3600),a=Math.floor(r%3600/60),o=r%60,s={};i>0&&(s.hours=i),a>0&&(s.minutes=a),(o>0||i===0&&a===0)&&(s.seconds=o);let c=Wr(t?.locale,t?.style??`long`).format(s);if(n){let e=t?.formatRemaining;return e?e(c):Ur(t?.locale)?`${c} remaining`:c}return c}var Yr=`buttons.`,Xr={key:`${Yr}play`,text:`Play`},Zr={key:`${Yr}pause`,text:`Pause`},Qr={key:`${Yr}replay`,text:`Replay`},$r={key:`${Yr}mute`,text:`Mute`},ei={key:`${Yr}unmute`,text:`Unmute`},ti=class e{static defaultProps={label:``,disabled:!1};state=F({muted:!1,volumeLevel:`off`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.muted?ei:$r)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({muted:e.muted||e.volume===0,volumeLevel:ni(e)}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}toggle(e){this.#e.disabled||e.toggleMuted()}};function ni(e){return e.muted||e.volume===0?`off`:e.volume<.5?`low`:e.volume<.75?`medium`:`high`}var ri={muted:`data-muted`,volumeLevel:`data-volume-level`},ii=`pip.`,ai={key:`${ii}enter`,text:`Enter picture-in-picture`},oi={key:`${ii}exit`,text:`Exit picture-in-picture`},si=class e{static defaultProps={label:``,disabled:!1};state=F({pip:!1,availability:`unavailable`,disabled:!0,hidden:!0,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.pip?oi:ai)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":e.disabled?`true`:void 0,hidden:e.hidden?``:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=e.pipAvailability;return this.state.patch({pip:e.pip,availability:t,disabled:this.#e.disabled||t!==`available`,hidden:t!==`available`}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(this.setMedia(e),!this.getState().disabled)return e.pip?e.exitPictureInPicture():e.requestPictureInPicture()}},ci={pip:`data-pip`,availability:`data-availability`,disabled:`data-disabled`,hidden:`data-hidden`},li=class e{static defaultProps={label:``,disabled:!1};state=F({paused:!0,ended:!1,started:!1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){return J(this.#e.label,e)||(e.ended?Qr:e.paused?Xr:Zr)}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({paused:e.paused,ended:e.ended,started:e.started}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}async toggle(e){if(!this.#e.disabled){if(e.paused||e.ended)return e.play();e.pause()}}},ui={paused:`data-paused`,ended:`data-ended`,started:`data-started`},di=class e{static defaultProps={label:``,disabled:!1,menuTrigger:!1};state=F({rate:1,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){let t=J(this.#e.label,e);return t===void 0?Fr:t}getLabelParams(e){if(J(this.#e.label,e)===void 0)return{rate:e.rate}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t;return this.state.patch({rate:e.playbackRate}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}cycle(e){if(this.#e.disabled||this.#e.menuTrigger)return;let{playbackRates:t,playbackRate:n}=e;if(t.length===0)return;let r=t.indexOf(n),i=r===-1?t.find(e=>e>n)??t[0]:t[(r+1)%t.length];e.setPlaybackRate(i)}},fi={rate:`data-rate`},pi=class e{static defaultProps={side:`top`,align:`center`,modal:!1,closeOnEscape:!0,closeOnOutsideClick:!0,open:!1,defaultOpen:!1,openOnHover:!1,delay:300,closeDelay:0};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,modal:this.#e.modal,...tn(e.status)}}getTriggerAttrs(e,t){return{"aria-expanded":e.open&&e.status!==`ending`?`true`:`false`,"aria-haspopup":`dialog`,"aria-controls":t}}getPopupAttrs(e){return{popover:`manual`,role:`dialog`,"aria-modal":e.modal===!0?`true`:void 0}}},mi={open:`data-open`,side:`data-side`,align:`data-align`,...en},hi=`seek.`,gi={key:`${hi}forward`,text:`Seek forward {seconds} seconds`},_i={key:`${hi}backward`,text:`Seek backward {seconds} seconds`},vi=class e{static defaultProps={seconds:30,label:``,disabled:!1};state=F({seeking:!1,direction:`forward`,label:``});#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}getLabel(e){let t=J(this.#e.label,e);return t===void 0?e.direction===`backward`?_i:gi:t}getLabelParams(e){if(J(this.#e.label,e)===void 0)return{seconds:Math.abs(this.#e.seconds)}}getAttrs(e){return{"aria-label":this.getLabel(e),"aria-disabled":this.#e.disabled?`true`:void 0}}setMedia(e){this.#t=e}getState(){let e=this.#t,t=this.#e.seconds<0?`backward`:`forward`;return this.state.patch({seeking:e.seeking,direction:t}),this.state.patch({label:Ze(this.getLabel(this.state.current))}),this.state.current}async seek(e){this.#e.disabled||await e.seek(e.currentTime+this.#e.seconds)}},yi={seeking:`data-seeking`,direction:`data-direction`},bi=class e{static defaultProps={label:``,step:1,largeStep:10,orientation:`horizontal`,disabled:!1,thumbAlignment:`center`,value:0,min:0,max:100};static defaultInput={pointerPercent:0,dragPercent:0,dragging:!1,pointing:!1,focused:!1};#e={...e.defaultProps};#t={...e.defaultInput};get props(){return this.#e}get input(){return this.#t}constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}setInput(e){this.#t=e}getSliderState(e){let{orientation:t,disabled:n,thumbAlignment:r}=this.#e,{pointerPercent:i,dragging:a,pointing:o,focused:s}=this.#t;return{value:e,fillPercent:this.percentFromValue(e),pointerPercent:i,dragging:a,pointing:o,interactive:a||o||s,orientation:t,disabled:n,thumbAlignment:r}}getLabel(e){return J(this.#e.label,e)||``}getAttrs(e){return{role:`slider`,tabIndex:e.disabled?-1:0,autoComplete:`off`,"aria-label":this.getLabel(e),"aria-valuemin":this.#e.min,"aria-valuemax":this.#e.max,"aria-valuenow":e.value,"aria-orientation":e.orientation,"aria-disabled":e.disabled?`true`:void 0}}valueFromPercent(e){let{min:t,max:n,step:r}=this.#e;return un(ln(t+e/100*(n-t),t,n),r,t)}rawValueFromPercent(e){let{min:t,max:n}=this.#e;return ln(t+e/100*(n-t),t,n)}percentFromValue(e){let{min:t,max:n}=this.#e;return n===t?0:(e-t)/(n-t)*100}getStepPercent(){let{step:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}getLargeStepPercent(){let{largeStep:e,min:t,max:n}=this.#e,r=n-t;return r>0?e/r*100:0}adjustPercentForAlignment(e,t,n){if(this.#e.thumbAlignment===`center`||n===0)return e;let r=t/n*100/2,i=r,a=100-r;return i+e/100*(a-i)}},xi={dragging:`data-dragging`,pointing:`data-pointing`,interactive:`data-interactive`,orientation:`data-orientation`,disabled:`data-disabled`},Si={loading:`data-loading`,error:`data-error`,hidden:`data-hidden`};function Ci(e,t){let n=e.trim().split(`#`),r=n[0]??``,i=n[1],a=t?new URL(r,t).href:r;if(!i)return{url:a};let o=i.indexOf(`=`);if(o===-1)return{url:a};let s=i.slice(0,o),c=i.slice(o+1).split(`,`).map(Number),l={};for(let e=0;e<s.length;e++){let t=s[e],n=c[e];t&&V(n)&&!Number.isNaN(n)&&(l[t]=n)}let u={url:a};return V(l.w)&&(u.width=l.w),V(l.h)&&(u.height=l.h),V(l.x)&&V(l.y)&&(u.coords={x:l.x,y:l.y}),u}function wi(e,t){let n=[];for(let r of e){let e=Ci(r.text,t),i={url:e.url,startTime:r.startTime,endTime:r.endTime};e.width&&(i.width=e.width),e.height&&(i.height=e.height),e.coords&&(i.coords=e.coords),n.push(i)}return n}var Ti=`time.`,Ei={key:`${Ti}current`,text:`Current time`},Di={key:`${Ti}duration`,text:`Duration`},Oi={key:`${Ti}remaining`,text:`Remaining`},ki={key:`${Ti}remainingSuffix`,text:`{duration} remaining`},Ai={key:`${Ti}showElapsed`,text:`{duration}. Show elapsed time.`},ji={key:`${Ti}showDuration`,text:`{duration}. Show duration.`},Mi={key:`${Ti}showRemaining`,text:`{duration}. Show remaining time.`},Ni={key:`${Ti}position`,text:`{current} of {duration}`},Pi={current:Ai,duration:ji,remaining:Mi},Fi={current:Ei,duration:Di,remaining:Oi},Ii=class e{static defaultProps={type:`current`,negativeSign:`-`,label:``,toggle:!1};#e={...e.defaultProps};#t=null;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}setMedia(e){this.#t=e}#n(){let e=this.#t,{type:t}=this.#e;switch(t){case`current`:return e.currentTime;case`duration`:return e.duration;case`remaining`:return e.currentTime-e.duration;default:return 0}}#r(){let e=this.#t,t=this.#n();return Kr(Math.abs(t),e.duration)}#i(){let{type:e}=this.#e,t=this.#n();return Jr(e===`remaining`?t<0?t:-Math.abs(t):t)}#a(){let e=this.#n();return qr(Math.abs(e))}#o(e,t){return e===`current`?t===`remaining`?`current`:`remaining`:t===`duration`?`remaining`:`duration`}getLabel(e,t=this.#e.type){let n=J(this.#e.label,e);return n===void 0?this.#e.toggle?Pi[this.#o(t,e.type)]:Fi[this.#e.type]:n}getLabelParams(e){return J(this.#e.label,e)===void 0&&this.#e.toggle?{duration:e.phrase}:void 0}getAttrs(e,t=this.#e.type){return{"aria-label":this.getLabel(e,t),role:this.#e.toggle?`button`:void 0,tabIndex:this.#e.toggle?0:void 0}}getState(){let e=this.#n();return{type:this.#e.type,seconds:e,negative:this.#e.type===`remaining`&&e<0,text:this.#r(),phrase:this.#i(),datetime:this.#a()}}},Li={type:`data-type`},Ri={key:`slider.seek`,text:`Seek`},zi=class e extends bi{static defaultProps={...bi.defaultProps,label:``,changeThrottle:100,pauseOnDrag:!1};#e={...e.defaultProps};#t=null;#n;#r=!1;constructor(e){super(),e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps),super.setProps({...t,min:0})}setMedia(e){this.#t=e}setFormatLocale(e){this.#n=e}getState(){let{duration:e,currentTime:t,seeking:n,buffered:r}=this.#t;super.setProps({...this.#e,min:0,max:e});let i=super.getSliderState(t),a=r.length>0?r[r.length-1][1]:0,o=e>0?a/e*100:0;return{...i,currentTime:t,duration:e,seeking:n,bufferPercent:o}}getLabel(e){return super.getLabel(e)||Ri}#i(e){return e.dragging?this.rawValueFromPercent(e.pointerPercent):e.value}#a(e){return this.#n===void 0?Jr(e):Jr(e,{locale:this.#n})}getValueText(e){return Number.isFinite(e.duration)?Ni:this.getValueTextParams(e).current}getValueTextParams(e){let t=this.#a(this.#i(e));return Number.isFinite(e.duration)?{current:t,duration:this.#a(e.duration)}:{current:t}}startDrag(e){this.#r=!1,this.#e.pauseOnDrag&&e&&!e.paused&&(this.#r=!0,e.pause())}endDrag(e){this.#r&&e?.play().catch(()=>{}),this.#r=!1}getAttrs(e){let t=super.getAttrs(e),n=this.#i(e);return{...t,"aria-valuenow":n,"aria-valuetext":this.getValueText(e)}}},Bi={...xi,seeking:`data-seeking`},Vi=class e{static defaultProps={side:`top`,align:`center`,open:!1,defaultOpen:!1,delay:600,closeDelay:0,disableHoverablePopup:!0,disabled:!1};#e={...e.defaultProps};constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}#t=null;setInput(e){this.#t=e}getState(){let e=this.#t;return{open:e.active,status:e.status,side:this.#e.side,align:this.#e.align,...tn(e.status)}}getPopupAttrs(e){return{popover:`manual`,role:`presentation`}}},Hi={sideOffset:`--media-tooltip-side-offset`,alignOffset:`--media-tooltip-align-offset`,boundaryOffset:`--media-tooltip-boundary-offset`,anchorWidth:`--media-tooltip-anchor-width`,anchorHeight:`--media-tooltip-anchor-height`,availableWidth:`--media-tooltip-available-width`,availableHeight:`--media-tooltip-available-height`},Ui={open:`data-open`,side:`data-side`,align:`data-align`,...en},Wi=class e{static defaultProps={delay:600,closeDelay:0,timeout:400};#e={...e.defaultProps};#t=0;#n=!1;constructor(e){e&&this.setProps(e)}setProps(t){this.#e=U(t,e.defaultProps)}get delay(){return this.#e.delay}get closeDelay(){return this.#e.closeDelay}shouldSkipDelay(){return this.#n?!0:Date.now()-this.#t<this.#e.timeout}notifyOpen(){this.#n=!0}notifyClose(){this.#n=!1,this.#t=Date.now()}},Gi=new Map;function Ki(e){return e===void 0?``:Array.isArray(e)?e.join(`:`):e}function qi(e){let t=Ki(e),n=Gi.get(t);if(!n)try{n=new Intl.NumberFormat(e,{style:`percent`,maximumFractionDigits:0}),Gi.set(t,n)}catch{return}return n}function Ji(e){return`${Math.round(Math.min(1,Math.max(0,e))*100)}%`}function Yi(e,t){let n=!V(e)||!Number.isFinite(e)?0:Math.min(1,Math.max(0,e));try{let e=qi(t)??qi(void 0);if(e)return e.format(n)}catch{}return Ji(n)}var Xi=class e extends bi{static defaultProps={...bi.defaultProps,label:``,wheelStep:5};#e=null;#t;constructor(e){super(),e&&this.setProps(e)}setProps(t){super.setProps(U(t,e.defaultProps))}setMedia(e){this.#e=e}setFormatLocale(e){this.#t=e}getState(){let e=this.#e,{volume:t,muted:n}=e,r=n||t===0,{dragging:i,dragPercent:a}=this.input,o=t*100,s=i?this.valueFromPercent(a):o,c=super.getSliderState(s);return{...c,fillPercent:r?0:c.fillPercent,volume:t,muted:r,availability:e.volumeAvailability}}getWheelStepPercent(){let e=this.props,t=e.max-e.min;return t>0?e.wheelStep/t*100:0}getLabel(e){return super.getLabel(e)||Rr}getValueText(e){return e.muted?Lr:this.getValueTextParams(e).percent}getValueTextParams(e){return{percent:Yi(e.value/100,this.#t)}}getAttrs(e){return{...super.getAttrs(e),"aria-valuetext":this.getValueText(e)}}},Zi={...xi,availability:`data-availability`};T();var Qi=g(null),$i=Qi.Provider;function ea(){let e=b(Qi);if(!e)throw Error(`AlertDialog compound components must be used within an AlertDialog.Root`);return e}var ta=Object.defineProperty,na=(e,t)=>{let n={};for(var r in e)ta(n,r,{get:e[r],enumerable:!0});return t||ta(n,Symbol.toStringTag,{value:`Module`}),n};T();var ra=f(function({render:e,className:t,style:n,disabled:r,...i},a){let{dialog:o,state:s}=ea(),c=A(()=>{r||o.close()},[o,r]);return q(`button`,{render:e,className:t,style:n},{state:s,ref:[a],props:[{type:`button`,disabled:r,onClick:c},i]})});T();function ia(e){let{displayName:t,tag:n,useContext:r,staticProps:i,getProps:a}=e,o=f(function(e,t){let{render:o,className:s,style:c,...l}=e,u=r(),d=a?.(u.state);return q(n,{render:o,className:s,style:c},{state:u.state,stateAttrMap:u.stateAttrMap,ref:t,props:[i,d,l].filter(Boolean)})});return o.displayName=t,o}var aa=ia({displayName:`AlertDialogDescription`,tag:`p`,useContext:ea,getProps:e=>({id:e.descriptionId})});T();var oa=f(function({render:e,className:t,style:n,...r},i){let{core:a,dialog:o,state:s,stateAttrMap:c}=ea(),l=P(i,A(e=>{o.setElement(e)},[o]));return s.open?q(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:l,props:[{tabIndex:-1,...a.getAttrs(s)},r]}):null});T();var sa=/[^a-zA-Z0-9_-]/g;function ca(e){let t=d().replace(sa,``);return e?`${e}-${t}`:t}T();function la({open:e,defaultOpen:t=or.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,children:i}){let[a]=C(()=>new or),o=e!==void 0,s=H(n),c=H(r),[l]=C(()=>{let e=Qt({transition:Mn(),onOpenChange:e=>{s.current?.(e)},onOpenChangeComplete:e=>{c.current?.(e)}});return!o&&t&&e.open(),e}),u=ca(`alert-dialog-title`),d=ca(`alert-dialog-desc`);a.setTitleId(u),a.setDescriptionId(d),y(()=>{if(e===void 0)return;let{active:t}=l.input.current;e!==t&&(e?l.open():l.close())},[e,l]),Be(l);let f=ut(l.input);return a.setInput(f),_($i,{value:{core:a,dialog:l,state:a.getState(),stateAttrMap:sr},children:i})}var ua=ia({displayName:`AlertDialogTitle`,tag:`h2`,useContext:ea,getProps:e=>({id:e.titleId})}),da=na({Close:()=>ra,Description:()=>aa,Popup:()=>oa,Root:()=>la,Title:()=>ua});T();var fa=f(function(e,t){let{render:n,className:r,style:i,delay:a,...o}=e,s=I(bt),[c]=C(()=>new cr);Be(c),c.setProps({delay:a}),s&&c.update(s);let l=M(e=>c.state.subscribe(e),()=>c.state.current,()=>c.state.current);return s?q(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:lr,ref:[t],props:[o]}):null});T();var pa=g(null),ma=pa.Provider;function ha(){let e=b(pa);if(!e)throw Error(`Controls compound components must be used within a Controls.Root`);return e}function ga(){return b(pa)}T();var _a=f(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,{state:s,stateAttrMap:c}=ha(),l=o[`aria-label`]||o[`aria-labelledby`]?`group`:void 0;return q(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:c,ref:[t],props:[{role:l,children:a},o]})});T();var va=f(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e,s=I(gt),[c]=C(()=>new ur);if(!s)return null;c.setMedia(s);let l=c.getState();return _(ma,{value:{state:l,stateAttrMap:dr},children:q(`div`,{render:n,className:r,style:i},{state:l,stateAttrMap:dr,ref:[t],props:[{children:a},o,{"data-interactive":``}]})})}),ya=na({Group:()=>_a,Root:()=>va});T();var ba=g(null),xa=ba.Provider;function Sa(){let e=b(ba);if(!e)throw Error(`ErrorDialog compound components must be used within an ErrorDialog.Root`);return e}T();var Ca=f(function({render:e,className:t,style:n,disabled:r,children:i,...a},o){let s=L(),{dialog:c,state:l,stateAttrMap:u}=ea(),d=A(()=>{r||c.close()},[c,r]),f=i??W(Or(),s);return q(`button`,{render:e,className:t,style:n},{state:l,stateAttrMap:u,ref:o,props:[{type:`button`,disabled:r,onClick:d,children:f},a]})});T();var wa=f(function({render:e,className:t,style:n,children:r,...i},a){let o=L(),{state:s,stateAttrMap:c}=ea(),{lastError:l}=Sa(),u=kr(l),d=r??W(u,o);return q(`p`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.descriptionId,children:d},i]})});T();function Ta({children:e}){let[t]=C(()=>new fr),n=I(_t),r=m(n?.error??null);n?.error&&(r.current=n.error);let i=H(n),[a]=C(()=>Qt({transition:Mn(),onOpenChange:e=>{e||i.current?.dismissError()}})),o=ca(`error-dialog-title`),s=ca(`error-dialog-desc`);t.setTitleId(o),t.setDescriptionId(s),y(()=>{let e=!!n?.error,{active:t}=a.input.current;e&&!t?a.open():!e&&t&&a.close()},[n?.error,a]),Be(a);let c=ut(a.input);t.setInput(c);let l=t.getState();return n?_(xa,{value:{lastError:r.current},children:_($i,{value:{core:t,dialog:a,state:l,stateAttrMap:sr},children:e})}):null}T();var Ea=f(function({render:e,className:t,style:n,children:r,...i},a){let o=L(),{state:s,stateAttrMap:c}=ea(),l=r??W(Dr(),o);return q(`h2`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:a,props:[{id:s.titleId,children:l},i]})}),Da=na({Close:()=>Ca,Description:()=>wa,Popup:()=>oa,Root:()=>Ta,Title:()=>Ea}),Oa=ar({displayName:`FullscreenButton`,core:Nr,stateAttrMap:Pr,selector:vt,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleFullscreen`,isSupported:e=>!e.hidden});T();function ka({type:e,action:t,value:n,pointer:r,region:i,disabled:a}){let o=I(),s=oe();return y(()=>{if(!s||!e||!t||a)return;let c=Dt(t);if(!c)return;let l=e=>{c({store:o,value:n,event:e})},u={pointer:r,region:i,action:t,value:n};return e===`doubletap`?Nt(s,l,u):Mt(s,l,u)},[s,o,e,t,n,r,i,a]),null}var Aa=ka;T();function ja(){let[,e]=w(e=>e+1,0);return e}T();function Ma(e){let t=H(e),n=m(null),r=m(null),i=ja(),[a]=C(()=>Cn({getElement:()=>n.current,getThumbElement:()=>r.current,getOrientation:()=>t.current.orientation??`horizontal`,isRTL:()=>n.current?$e(n.current):!1,isDisabled:()=>t.current.disabled??!1,getPercent:()=>t.current.getPercent(),getStepPercent:()=>t.current.getStepPercent(),getLargeStepPercent:()=>t.current.getLargeStepPercent(),changeThrottle:t.current.changeThrottle,adjustPercent:t.current.adjustPercent,onValueChange:e=>t.current.onValueChange?.(e),onValueCommit:e=>t.current.onValueCommit?.(e),onDragStart:()=>t.current.onDragStart?.(),onDragEnd:()=>t.current.onDragEnd?.()}));Be(a);let o=ut(a.input),s=e.computeState(o);return p(()=>{s.thumbAlignment===`edge`&&n.current&&r.current&&i()},[s.thumbAlignment]),{state:s,cssVars:e.getCSSVars(a.adjustForAlignment(s)),rootRef:A(e=>{n.current=e},[]),thumbRef:A(e=>{r.current=e},[]),rootProps:a.rootProps,rootStyle:a.rootStyle,thumbProps:a.thumbProps}}T();function Na({keys:e,action:t,value:n,disabled:r,target:i}){let a=I(),o=oe();return y(()=>{if(!o||!e||!t||r)return;let s=It(t);if(s)return Xt(o,{keys:e,action:t,value:n,target:i,disabled:r,repeatable:!Pt(t),onActivate:(e,t)=>{s({store:a,key:t,value:n})}})},[o,a,e,t,n,r,i]),null}var Pa=Na;T();function Fa(e){let t=e.side,[n,r]=C({preferred:t,side:t}),i=e.open&&n.preferred===t?n.side:t,a=h(()=>i===t?e:{...e,side:i},[i,e,t]),o=A(e=>r(n=>n.preferred===t&&n.side===e?n:{preferred:t,side:e}),[t]);return y(()=>{e.open||o(t)},[e.open,t,o]),{state:a,preferredSide:t,setPositionedSide:o}}var Ia=ar({displayName:`MuteButton`,core:ti,stateAttrMap:ri,selector:wt,action:(e,t)=>e.toggle(t),hotkeyAction:`toggleMuted`}),La=ar({displayName:`PiPButton`,core:si,stateAttrMap:ci,selector:yt,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePictureInPicture`,isSupported:e=>!e.hidden}),Ra=ar({displayName:`PlayButton`,core:li,stateAttrMap:ui,selector:bt,action:(e,t)=>e.toggle(t),hotkeyAction:`togglePaused`}),za=ar({displayName:`PlaybackRateButton`,core:di,stateAttrMap:fi,selector:xt,action:(e,t)=>e.cycle(t),hotkeyAction:`speedUp`});T();var Ba=g(null),Va=Ba.Provider;function Ha(){let e=b(Ba);if(!e)throw Error(`Popover compound components must be used within a Popover.Root`);return e}var Ua=ia({displayName:`PopoverArrow`,tag:`div`,useContext:Ha,staticProps:{"aria-hidden":`true`}});T();var Wa={position:`fixed`,inset:`auto`,margin:0},Ga=f(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,preferredSide:c,setPositionedSide:l,stateAttrMap:u,anchorName:d,popupId:f,boundary:g,container:_}=Ha(),v=m(null),y=P(i,A(e=>{o.setPopupElement(e),e&&et()&&e.style.setProperty(`position-anchor`,`--${d}`)},[o,d]),v),b=h(()=>({side:c,align:s.align}),[c,s.align]),x=h(()=>{if(!et())return null;let{positionAnchor:e,...t}=gn(d,b);return t},[d,b]),[S,w]=C(null);p(()=>{if(!s.open){w(null);return}function e(){let e=o.triggerElement,t=v.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=sn(g,{container:_,root:r}),a=xn(t,b.side),s=on(i),c=bn(t),u=at(n,a,s,b,c),{positionAnchor:f,...p}=gn(d,{...b,side:u},n,et()?void 0:a,s,c);w(p),l(u)}e();let t=o.triggerElement,n=v.current,r=n?sn(g,{container:_,root:n.getRootNode()}):null,i=0;function a(t){t&&Ln(t,v.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let c=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&c&&c.observe(t),n&&c&&c.observe(n),r&&c&&c.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),c?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[s.open,d,b,o,g,_,l]);let T=S??x??Wa;if(!s.open)return null;let{onFocusOut:E,...D}=o.popupProps;return q(`div`,{render:e,className:t,style:n},{state:s,stateAttrMap:u,ref:y,props:[{id:f,style:T,...a.getPopupAttrs(s)},{...D,onBlur:E},r]})});T();function Ka({open:e,defaultOpen:t=pi.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,openOnHover:i=pi.defaultProps.openOnHover,delay:a=pi.defaultProps.delay,closeDelay:o=pi.defaultProps.closeDelay,boundary:s=`container`,children:c,...l}){let u=me(),d=ge(),f=ga(),[p]=C(()=>new pi(l));p.setProps(l);let m=!z(e),h=H(n),g=H(r),v=H(l.closeOnEscape),b=H(l.closeOnOutsideClick),x=H(i),S=H(a),w=H(o),T=H(d),[E]=C(()=>{let e=nn({transition:Mn(),onOpenChange:(e,t)=>{h.current?.(e,t)},onOpenChangeComplete:e=>{g.current?.(e)},closeOnEscape:()=>v.current??pi.defaultProps.closeOnEscape,closeOnOutsideClick:()=>b.current??pi.defaultProps.closeOnOutsideClick,openOnHover:()=>x.current,delay:()=>S.current,closeDelay:()=>w.current,group:()=>T.current});return!m&&t&&e.open(`click`),e}),D=ca(),O=ca(`popup`);y(()=>{if(z(e))return;let{active:t}=E.input.current;e!==t&&(e?E.open(`click`):E.close(`click`))},[e,E]),y(()=>{z(f?.state.visible)||f.state.visible||E.close(`imperative-action`)},[f?.state.visible,E]),Be(E);let k=ut(E.input);p.setInput(k);let{state:A,preferredSide:j,setPositionedSide:M}=Fa(p.getState());return _(Va,{value:{core:p,popover:E,state:A,preferredSide:j,setPositionedSide:M,stateAttrMap:mi,anchorName:D,popupId:O,boundary:s,container:u},children:c})}T();var qa=f(function({render:e,className:t,style:n,...r},i){let{core:a,popover:o,state:s,stateAttrMap:c,anchorName:l,popupId:u}=Ha(),d=A(e=>{o.setTriggerElement(e),e&&et()&&e.style.setProperty(`anchor-name`,`--${l}`)},[o,l]),{onFocusIn:f,onFocusOut:p,...m}=o.triggerProps;return q(`button`,{render:e,className:t,style:n},{state:s,stateAttrMap:c,ref:[i,d],props:[{type:`button`,...a.getTriggerAttrs(s,u)},{...m,onFocus:f,onBlur:p},r]})}),Ja=na({Arrow:()=>Ua,Popup:()=>Ga,Root:()=>Ka,Trigger:()=>qa}),Ya=ar({displayName:`SeekButton`,core:vi,stateAttrMap:yi,selector:Ct,action:(e,t)=>e.seek(t),hotkeyAction:`seekStep`,hotkeyValue:e=>typeof e.seconds==`number`?e.seconds:vi.defaultProps.seconds});T();var Xa=f(function(e,t){let{render:n,className:r,style:i,time:a=0,thumbnails:o,crossOrigin:s,loading:c,fetchPriority:l,...u}=e,[d]=C(()=>new On),f=m(null),p=m(null),g=he(St),[,v]=C(0),[y]=C(()=>kn({getContainer:()=>f.current,getImg:()=>p.current,onStateChange:()=>v(e=>e+1)}));Be(y,()=>y.connect());let b=h(()=>o&&o.length>0?o:g&&g.thumbnailCues.length>0?wi(g.thumbnailCues,g.thumbnailTrackSrc??void 0):[],[o,g]),x=h(()=>d.findActiveThumbnail(b,a),[d,b,a]);y.updateSrc(x?.url);let S=d.getState(y.loading,y.error,x),w={overflow:`hidden`},T;if(x&&y.naturalWidth&&y.naturalHeight){let e=y.readConstraints(),t=d.resize(x,y.naturalWidth,y.naturalHeight,e);t&&(w={overflow:`hidden`,width:t.containerWidth,height:t.containerHeight},T={width:t.imageWidth,height:t.imageHeight,maxWidth:`none`,transform:t.offsetX||t.offsetY?`translate(-${t.offsetX}px, -${t.offsetY}px)`:void 0})}return q(`div`,{render:n,className:r,style:i},{state:S,stateAttrMap:Si,ref:[t,f],props:[d.getAttrs(S),{style:w},u,{children:_(`img`,{ref:p,alt:``,"aria-hidden":`true`,decoding:`async`,src:x?.url,crossOrigin:s===``||s===null?void 0:s,loading:c,style:T,fetchPriority:l})}]})});T();var Za=g(null);function Qa({value:e,children:t}){return _(Za.Provider,{value:e,children:t})}function $a(){let e=b(Za);if(!e)throw Error(`Slider compound components must be used within a Slider.Root`);return e}var eo=ia({displayName:`SliderBuffer`,tag:`div`,useContext:$a}),to=ia({displayName:`SliderFill`,tag:`div`,useContext:$a});T();var no=f(function(e,t){let{render:n,className:r,style:i,overflow:a=`clamp`,...o}=e,s=$a(),{state:c}=s,l=m(null),[u,d]=C(0);y(()=>{let e=l.current;if(!e)return;let t=new ResizeObserver(([e])=>{d(e.contentRect.width)});return t.observe(e),()=>t.disconnect()},[]);let f=Dn(u,a);return q(`div`,{render:n,className:r,style:i},{state:c,stateAttrMap:s.stateAttrMap,ref:[t,l],props:[{style:f},o]})});T();var ro=f(function(e,t){let{render:n,className:r,style:i,label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f,value:p=0,onValueChange:m,onValueCommit:h,onDragStart:g,onDragEnd:v,...y}=e,[b]=C(()=>new bi),x=L();b.setProps({label:a,min:o,max:s,step:c,largeStep:l,orientation:u,disabled:d,thumbAlignment:f});let{state:S,cssVars:w,rootRef:T,thumbRef:E,rootProps:D,rootStyle:O,thumbProps:k}=Ma({computeState:e=>(b.setInput(e),b.getSliderState(p)),getPercent:()=>b.percentFromValue(p),getStepPercent:()=>b.getStepPercent(),getLargeStepPercent:()=>b.getLargeStepPercent(),orientation:u,disabled:d,adjustPercent:(e,t,n)=>b.adjustPercentForAlignment(e,t,n),getCSSVars:Tn,onValueChange:e=>m?.(b.valueFromPercent(e)),onValueCommit:e=>h?.(b.valueFromPercent(e)),onDragStart:g,onDragEnd:v});return _(Qa,{value:{state:S,pointerValue:b.valueFromPercent(S.pointerPercent),thumbRef:E,thumbProps:k,stateAttrMap:xi,getAttrs:e=>{let t=b.getAttrs(e);return{...t,"aria-label":W(t[`aria-label`],x)}},formatValue:void 0},children:q(`div`,{render:n,className:r,style:i},{state:S,stateAttrMap:xi,ref:[t,T],props:[{style:{...w,...O}},D,y]})})});T();var io=f(function(e,t){let{render:n,className:r,style:i,...a}=e,o=$a(),{state:s,thumbRef:c,thumbProps:l,getAttrs:u}=o,d=u(s);return q(`div`,{render:n,className:r,style:i},{state:s,stateAttrMap:o.stateAttrMap,ref:[t,c],props:[d,l,a]})});T();var ao=f(function(e,t){let{pointerValue:n}=$a();return _(Xa,{ref:t,...e,time:n})}),oo=ia({displayName:`SliderTrack`,tag:`div`,useContext:$a});T();var so=f(function(e,t){let{render:n,className:r,style:i,type:a=`current`,format:o,...s}=e,c=$a(),{state:l,pointerValue:u,formatValue:d}=c,f=a===`pointer`?u:l.value,p=o?o(f):d?d(f,a):String(Math.round(f));return q(`output`,{render:n,className:r,style:i},{state:l,stateAttrMap:c.stateAttrMap,ref:t,props:[{"aria-live":`off`,children:p},s]})}),co=na({Buffer:()=>eo,Fill:()=>to,Preview:()=>no,Root:()=>ro,Thumb:()=>io,Thumbnail:()=>ao,Track:()=>oo,Value:()=>so});T();var lo=f(function(e,t){let{render:n,className:r,style:i,children:a,...o}=e;return q(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{children:a},o]})});T();var uo=f(function(e,t){let{render:n,className:r,style:i,children:a=`/`,...o}=e;return q(`span`,{render:n,className:r,style:i},{state:{},ref:[t],props:[{"aria-hidden":`true`,children:a},o]})});T(),j();var fo=f(function(e,t){let{render:n,className:r,style:i,type:a,negativeSign:o,label:s,toggle:c=!1,...l}=e,u=I(Ct),d=L(),f=xe(),[p]=C(()=>new Ii),m=a??Ii.defaultProps.type,[h,g]=C(m);if(y(()=>{g(m)},[m,c]),p.setProps({type:h,negativeSign:o,label:s,toggle:c}),!u)return null;p.setMedia(u);let b=p.getState(),x=p.getAttrs(b,m),S=p.getLabelParams(b)?{duration:b.type===`remaining`?W(ki,d,{duration:Jr(Math.abs(b.seconds),{locale:f})}):Jr(Math.abs(b.seconds),{locale:f})}:void 0,w=b.negative?_(v,{children:[_(`span`,{"aria-hidden":`true`,children:o??Ii.defaultProps.negativeSign}),b.text]}):b.text,T=()=>{g(e=>m===`current`?e===`remaining`?`current`:`remaining`:e===`duration`?`remaining`:`duration`)},E=e=>{e.defaultPrevented||T()},D=e=>{!e.defaultPrevented&&be(e.nativeEvent)&&(e.preventDefault(),!e.repeat&&T())};return q(`time`,{render:n,className:r,style:i},{state:b,stateAttrMap:Li,ref:[t],props:[{dateTime:b.datetime,children:w,...x,"aria-label":W(x[`aria-label`],d,S),...c?{onClick:E,onKeyDown:D}:void 0},l]})}),po=na({Group:()=>lo,Separator:()=>uo,Value:()=>fo});T();var mo=()=>Promise.resolve(0),ho=f(function(e,t){let{render:n,className:r,style:i,label:a,changeThrottle:o=zi.defaultProps.changeThrottle,step:s=zi.defaultProps.step,largeStep:c=zi.defaultProps.largeStep,orientation:l,disabled:u,thumbAlignment:d,onDragStart:f,onDragEnd:p,pauseOnDrag:m,...h}=e,g=I(Ct),v=I(ht),b=I(bt),x=L(),S=xe(),[w]=C(()=>new zi);w.setProps({label:a,step:s,largeStep:c,orientation:l,disabled:u,thumbAlignment:d,pauseOnDrag:m,changeThrottle:o}),w.setFormatLocale(S);let T=H(g&&v?{...g,...v}:null),E=H(b);y(()=>()=>w.endDrag(E.current),[w]);let D=g?.duration??0,{state:O,cssVars:k,rootRef:A,thumbRef:j,rootProps:M,rootStyle:ee,thumbProps:N}=Ma({computeState:e=>(w.setInput(e),!g||!v?w.setMedia({currentTime:0,duration:0,seeking:!1,seek:mo,buffered:[],seekable:[]}):w.setMedia({...g,...v}),w.getState()),getPercent:()=>D>0?(g?.currentTime??0)/D*100:0,getStepPercent:()=>w.getStepPercent(),getLargeStepPercent:()=>w.getLargeStepPercent(),orientation:l,disabled:u,changeThrottle:o,adjustPercent:(e,t,n)=>w.adjustPercentForAlignment(e,t,n),getCSSVars:En,onValueCommit:e=>{let t=T.current;t&&t.seek(w.rawValueFromPercent(e))},onDragStart:()=>{w.startDrag(E.current),f?.()},onDragEnd:()=>{w.endDrag(E.current),p?.()}});return g?_(Qa,{value:{state:O,pointerValue:w.valueFromPercent(O.pointerPercent),thumbRef:j,thumbProps:N,stateAttrMap:Bi,getAttrs:e=>{let t=w.getAttrs(e);return{...t,"aria-label":W(t[`aria-label`],x),"aria-valuetext":W(t[`aria-valuetext`],x,w.getValueTextParams(e))}},formatValue:e=>Kr(e,D)},children:q(`div`,{render:n,className:r,style:i},{state:O,stateAttrMap:Bi,ref:[t,A],props:[{style:{...k,...ee}},M,h]})}):null}),go=na({Buffer:()=>eo,Fill:()=>to,Preview:()=>no,Root:()=>ho,Thumb:()=>io,Track:()=>oo,Value:()=>so}),_o=ia({displayName:`TooltipArrow`,tag:`div`,useContext:nr,staticProps:{"aria-hidden":`true`}});T();var vo=f(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=nr(),l=r===void 0?c?.label??``:r;return q(`span`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]})});T();var yo=f(function({render:e,className:t,style:n,children:r,...i},a){let{state:o,stateAttrMap:s,content:c}=nr(),l=r??c?.shortcut??null;return l?q(`kbd`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:a,props:[i,{children:l}]}):null});T(),j();var bo={position:`fixed`,inset:`auto`,margin:0},xo=f(function({render:e,className:t,style:n,children:r,...i},a){let{core:o,tooltip:s,state:c,preferredSide:l,setPositionedSide:u,stateAttrMap:d,anchorName:f,popupId:g,boundary:y,container:b}=nr(),x=m(null),S=P(a,A(e=>{s.setPopupElement(e),e&&et()&&e.style.setProperty(`position-anchor`,`--${f}`)},[s,f]),x),w=h(()=>({side:l,align:c.align}),[l,c.align]),T=h(()=>{if(!et())return null;let{positionAnchor:e,...t}=gn(f,w,void 0,void 0,void 0,void 0,Hi);return t},[f,w]),[E,D]=C(null);p(()=>{if(!c.open){D(null);return}function e(){let e=s.triggerElement,t=x.current;if(!e||!t)return;let n=e.getBoundingClientRect(),r=t.getRootNode(),i=sn(y,{container:b,root:r}),a=xn(t,w.side),o=on(i),c=bn(t,Hi),l=at(n,a,o,w,c),{positionAnchor:d,...p}=gn(f,{...w,side:l},n,et()?void 0:a,o,c,Hi);D(p),u(l)}e();let t=s.triggerElement,n=x.current,r=n?sn(y,{container:b,root:n.getRootNode()}):null,i=0;function a(t){t&&Ln(t,x.current)||(cancelAnimationFrame(i),i=requestAnimationFrame(e))}a();let o=typeof ResizeObserver==`function`?new ResizeObserver(()=>{a()}):null;return t&&o&&o.observe(t),n&&o&&o.observe(n),r&&o&&o.observe(r),window.addEventListener(`scroll`,a,{capture:!0,passive:!0}),window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(i),o?.disconnect(),window.removeEventListener(`scroll`,a,!0),window.removeEventListener(`resize`,a)}},[c.open,f,w,s,y,b,u]);let O=E??T??bo;if(!c.open)return null;let k=r===void 0?_(v,{children:[_(vo,{}),_(yo,{})]}):r,{onFocusOut:j,...M}=s.popupProps;return q(`div`,{render:e,className:t,style:n},{state:c,stateAttrMap:d,ref:S,props:[{id:g,style:O,...o.getPopupAttrs(c)},{children:k},{...M,onBlur:j},i]})});T();var So=g(null),Co=So.Provider;function wo(){return b(So)?.group}T();function To({delay:e,closeDelay:t,timeout:n,children:r}){let[i]=C(()=>new Wi({delay:e,closeDelay:t,timeout:n}));return i.setProps({delay:e,closeDelay:t,timeout:n}),_(Co,{value:{group:i},children:r})}T();function Eo({open:e,defaultOpen:t=Vi.defaultProps.defaultOpen,onOpenChange:n,onOpenChangeComplete:r,delay:i=Vi.defaultProps.delay,closeDelay:a=Vi.defaultProps.closeDelay,disableHoverablePopup:o=Vi.defaultProps.disableHoverablePopup,disabled:s=Vi.defaultProps.disabled,boundary:c=`container`,children:l,...u}){let d=me(),f=ga(),[p]=C(()=>new Vi(u));p.setProps(u);let m=!z(e),h=wo(),g=H(n),v=H(r),b=H(i),x=H(a),S=H(o),w=H(s),T=H(h),[E]=C(()=>{let e=jn({transition:Mn(),onOpenChange:(e,t)=>{g.current?.(e,t)},onOpenChangeComplete:e=>{v.current?.(e)},delay:()=>b.current,closeDelay:()=>x.current,disableHoverablePopup:()=>S.current,disabled:()=>w.current,group:()=>T.current});return!m&&t&&e.open(),e}),[D,O]=C(),k=ca(),A=ca(`tooltip`);y(()=>{if(z(e))return;let{active:t}=E.input.current;e!==t&&(e?E.open():E.close())},[e,E]),y(()=>{z(f?.state.visible)||f.state.visible||E.close(`imperative-action`)},[f?.state.visible,E]),Be(E);let j=ut(E.input);p.setInput(j);let{state:M,preferredSide:ee,setPositionedSide:N}=Fa(p.getState());return _(tr,{value:{core:p,tooltip:E,state:M,preferredSide:ee,setPositionedSide:N,stateAttrMap:Ui,anchorName:k,popupId:A,content:D,setContent:O,boundary:c,container:d},children:l})}T();var Do=f(function({render:e,className:t,style:n,...r},i){let{tooltip:a,state:o,stateAttrMap:s,anchorName:c}=nr(),l=A(e=>{a.setTriggerElement(e),e&&et()&&e.style.setProperty(`anchor-name`,`--${c}`)},[a,c]),{onFocusIn:u,onFocusOut:d,...f}=a.triggerProps;return q(`button`,{render:e,className:t,style:n},{state:o,stateAttrMap:s,ref:[i,l],props:[{type:`button`},{...f,onFocus:u,onBlur:d},r]})}),Oo=na({Arrow:()=>_o,Label:()=>vo,Popup:()=>xo,Provider:()=>To,Root:()=>Eo,Shortcut:()=>yo,Trigger:()=>Do});T();var ko={volume:0,muted:!1,volumeAvailability:`unsupported`,setVolume:()=>0,toggleMuted:()=>!1},Ao=f(function(e,t){let{render:n,className:r,style:i,label:a,orientation:o,step:s=Xi.defaultProps.step,largeStep:c=Xi.defaultProps.largeStep,wheelStep:l=Xi.defaultProps.wheelStep,disabled:u,thumbAlignment:d,onDragStart:f,onDragEnd:p,...h}=e,g=I(wt),v=L(),y=xe(),[b]=C(()=>new Xi);b.setProps({label:a,orientation:o,step:s,largeStep:c,wheelStep:l,disabled:u,thumbAlignment:d}),b.setFormatLocale(y);let x=H(g),S=H(u),w=()=>(x.current?.volume??0)*100,T=()=>b.getStepPercent(),E=e=>x.current?.setVolume(e/100),{state:D,cssVars:O,rootRef:k,thumbRef:j,rootProps:M,rootStyle:ee,thumbProps:N}=Ma({computeState:e=>(b.setInput(e),b.setMedia(g??ko),b.getState()),getPercent:w,getStepPercent:T,getLargeStepPercent:()=>b.getLargeStepPercent(),orientation:o,disabled:u,adjustPercent:(e,t,n)=>b.adjustPercentForAlignment(e,t,n),getCSSVars:Tn,onValueChange:E,onValueCommit:E,onDragStart:f,onDragEnd:p}),[te]=C(()=>In({isDisabled:()=>!!S.current||!x.current,getPercent:()=>(x.current?.volume??0)*100,getStepPercent:()=>b.getWheelStepPercent(),onValueChange:e=>x.current?.setVolume(e/100)})),ne=m(null),re=A(e=>{ne.current?.(),ne.current=null,e&&(ne.current=B(e,`wheel`,te.onWheel,{passive:!1}))},[te]);return g?_(Qa,{value:{state:D,pointerValue:b.valueFromPercent(D.pointerPercent),thumbRef:j,thumbProps:N,stateAttrMap:Zi,getAttrs:e=>{let t=b.getAttrs(e);return{...t,"aria-label":W(t[`aria-label`],v),"aria-valuetext":W(t[`aria-valuetext`],v,b.getValueTextParams(e))}},formatValue:e=>`${Math.round(e)}%`},children:q(`div`,{render:n,className:r,style:i},{state:D,stateAttrMap:Zi,ref:[t,k,re],props:[{style:{...O,...ee}},M,h]})}):null}),jo=na({Fill:()=>to,Preview:()=>no,Root:()=>Ao,Thumb:()=>io,Track:()=>oo,Value:()=>so});j(),D();var Mo=({menu:e,section:t,option:n,sectionIndex:r})=>[...[...document.querySelectorAll(e)].flatMap(e=>[...e.querySelectorAll(t)])[r]?.querySelectorAll(n)??[]].map(e=>({label:e.getAttribute(`aria-label`)??``,selected:e.getAttribute(`aria-checked`)===`true`,disabled:e.getAttribute(`aria-disabled`)===`true`})),No=async({button:e,timeout:t})=>{let n=Date.now()+t,r=document.querySelector(e);for(;!r&&Date.now()<n;)await new Promise(e=>setTimeout(e,100)),r=document.querySelector(e);if(!r)throw Object.assign(Error(`Crunchyroll track button is not on the page`),{name:`CrunchyrollControlMissingError`});let i=r.getBoundingClientRect(),a={bubbles:!0,cancelable:!0,composed:!0,clientX:i.left+i.width/2,clientY:i.top+i.height/2,button:0},o={...a,pointerType:`mouse`,pointerId:1,isPrimary:!0};r.dispatchEvent(new PointerEvent(`pointerdown`,{...o,buttons:1})),r.dispatchEvent(new MouseEvent(`mousedown`,{...a,buttons:1})),r.dispatchEvent(new PointerEvent(`pointerup`,{...o,buttons:0})),r.dispatchEvent(new MouseEvent(`mouseup`,{...a,buttons:0})),r.dispatchEvent(new MouseEvent(`click`,{...a,buttons:0}))},Po=({menu:e,section:t,option:n,sectionIndex:r,optionIndex:i})=>{let a=[...document.querySelectorAll(e)].flatMap(e=>[...e.querySelectorAll(t)])[r]?.querySelectorAll(n)[i];if(!a)throw Object.assign(Error(`Crunchyroll track option ${i} is not in the menu`),{name:`CrunchyrollControlMissingError`});let o=a.getBoundingClientRect(),s={bubbles:!0,cancelable:!0,composed:!0,clientX:o.left+o.width/2,clientY:o.top+o.height/2,button:0},c={...s,pointerType:`mouse`,pointerId:1,isPrimary:!0};a.dispatchEvent(new PointerEvent(`pointerdown`,{...c,buttons:1})),a.dispatchEvent(new MouseEvent(`mousedown`,{...s,buttons:1})),a.dispatchEvent(new PointerEvent(`pointerup`,{...c,buttons:0})),a.dispatchEvent(new MouseEvent(`mouseup`,{...s,buttons:0})),a.dispatchEvent(new MouseEvent(`click`,{...s,buttons:0}))},Fo=async({timeline:e,time:t,timeout:n})=>{let r=Date.now()+n,i=document.querySelector(e);for(;!i&&Date.now()<r;)await new Promise(e=>setTimeout(e,100)),i=document.querySelector(e);if(i?.tagName!==`INPUT`)throw Object.assign(Error(`Crunchyroll timeline is not on the page`),{name:`CrunchyrollControlMissingError`});let a=i,o=Number(a.min||0),s=Number(a.max||100),c=a.getBoundingClientRect(),l=Math.max(0,Math.min(1,(t-o)/(s-o))),u={bubbles:!0,cancelable:!0,composed:!0,clientX:c.left+c.width*l,clientY:c.top+c.height/2,button:0},d={...u,pointerType:`mouse`,pointerId:1,isPrimary:!0},f=a.type===`range`&&Number.isFinite(o)&&Number.isFinite(s)&&s>o;f&&(a.dispatchEvent(new PointerEvent(`pointerdown`,{...d,buttons:1})),a.dispatchEvent(new MouseEvent(`mousedown`,{...u,buttons:1}))),a._valueTracker?.setValue(``),Object.getOwnPropertyDescriptor(Object.getPrototypeOf(a),`value`).set.call(a,String(t)),a.dispatchEvent(new Event(`input`,{bubbles:!0})),f&&(a.dispatchEvent(new PointerEvent(`pointerup`,{...d,buttons:0})),a.dispatchEvent(new MouseEvent(`mouseup`,{...u,buttons:0}))),a.dispatchEvent(new Event(`change`,{bubbles:!0}))},Io=`stub:pictureinpicturerefused`,Lo=({video:e})=>{let t=document.querySelector(e);if(!document.pictureInPictureEnabled||typeof t?.requestPictureInPicture!=`function`)return!1;let n=(e,t)=>e.dispatchEvent(new CustomEvent(`stub:pictureinpicturerefused`,{detail:`${t.name}: ${t.message}`})),r=t=>{if(!t.isTrusted||(t.stopImmediatePropagation(),t.type!==`click`))return;t.preventDefault();let r=document.querySelector(e);r&&(r.disablePictureInPicture=!1,r.requestPictureInPicture().catch(e=>n(r,e)))};for(let e of[`pointerdown`,`mousedown`,`pointerup`,`mouseup`,`click`,`dblclick`])window.addEventListener(e,r,!0);return!0},Ro=`[data-testid="track-selection-button"]`,zo=`[data-testid="audio-text-track-menu"]`,Bo=`.timeline-slider`,Vo=`[role="menu"]`,Ho=`[role="menuitemradio"]`,Uo=1e4,Wo=2e4,Go=5e3,Ko=100,qo={menu:zo,section:Vo,option:Ho},Jo=/^(off|none|disabled)$/i,Yo=e=>new Promise(t=>setTimeout(t,e)),Xo=()=>!1,Y=e=>{if(e())throw Error(`Crunchyroll track operation cancelled`)},Zo=e=>e===`audio`?0:1,Qo=e=>e.replace(/\s+/g,` `).trim(),$o=(e,t)=>{let n=[...new Map(t.map(e=>({...e,label:Qo(e.label)})).filter(e=>e.label).map(e=>[e.id,e])).values()],r=n.find(e=>e.selected);if(!r)return;let i=e===`subtitles`?n.find(e=>Jo.test(e.label)):void 0,a=n.filter(e=>e!==i).map(e=>({id:e.id,label:e.label,disabled:e.disabled||void 0}));if(!(a.length<2&&!i)&&a.length)return{options:a,selectedId:r===i?null:r.id,...i?{offLabel:i.label}:{}}},es=async(e,t)=>{Y(t);let n=e.locator(zo);if(await n.exists({timeout:1e3})){Y(t);return}Y(t),await e.evaluate(No,{button:Ro,timeout:Uo});let r=Date.now()+Uo;for(;Date.now()<r;){if(Y(t),await n.exists({timeout:1e3}))return;await Yo(Ko)}throw Error(`Crunchyroll track menu did not open`)},ts=async(e,t,n)=>{Y(n);let r=await e.evaluate(Mo,{...qo,sectionIndex:Zo(t)});Y(n);let i=r.map((e,t)=>({...e,label:Qo(e.label),index:t})),a=new Map;for(let e of i)a.set(e.label,(a.get(e.label)??0)+1);let o=new Map;return i.map(e=>{let t=(o.get(e.label)??0)+1;return o.set(e.label,t),{...e,id:a.get(e.label)===1?e.label:`${e.label}#${t}`}})},ns=async(e,t)=>{let[n,r]=await Promise.all([ts(e,`audio`,t),ts(e,`subtitles`,t)]);return{audio:$o(`audio`,n),subtitles:$o(`subtitles`,r)}},rs=async(e,t=Xo)=>(await es(e,t),ns(e,t)),is=async(e,t,n,r)=>(await ts(e,t,r)).find(e=>n===null?Jo.test(e.label):e.id===n)?.index??-1,as=async(e,t,n,r)=>{let i=Date.now()+Wo;for(;Date.now()<i;){Y(r),await es(e,r);let i=(await ts(e,t,r)).find(e=>e.selected);if(i&&(n===null?Jo.test(i.label):i.id===n))return;await Yo(Ko)}throw Error(`Crunchyroll did not apply the ${t} option`)},os=(e,t)=>{let n=Number.isFinite(e)?Math.max(0,e):0;return!Number.isFinite(t)||t<=0?n:Math.min(n,Math.max(0,t-.1))},ss=e=>({currentTime:e.currentTime,paused:e.paused,volume:e.volume,muted:e.muted,playbackRate:e.playbackRate}),cs=(e,t)=>e.evaluate(Fo,{timeline:Bo,time:t,timeout:Wo}),ls=async(e,t,n)=>{let r=Date.now()+5e3;for(;Date.now()<r&&(Y(n),!(e.currentSrc!==t||e.readyState<2));)await Yo(Ko);if(e.currentSrc===t&&e.readyState>=2)return!1;let i=Date.now()+Wo;for(;Date.now()<i;){if(Y(n),e.readyState>=2)return!0;await Yo(Ko)}throw Error(`Crunchyroll playback did not become ready after changing tracks`)},us=async(e,t,n,r)=>{Y(r),t.volume=n.volume,t.muted=n.muted,t.playbackRate=n.playbackRate;let i=os(n.currentTime,t.duration);Math.abs(t.currentTime-i)>2&&await cs(e,i);let a=Date.now()+Wo;for(;Date.now()<a&&(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2);)Y(r),await Yo(Ko);if(Math.abs(t.currentTime-i)>2||t.seeking||t.readyState<2)throw Error(`Crunchyroll playback position was not restored after changing tracks`);Y(r),n.paused?t.pause():await t.play();let o=Date.now()+Go;for(;Date.now()<o&&t.paused!==n.paused;)Y(r),await Yo(Ko);if(t.paused!==n.paused)throw Error(`Crunchyroll playback state was not restored after changing tracks`)},ds=async(e,t,n,r,i=Xo)=>{await es(e,i);let a=await is(e,n,r,i);if(a<0)throw Error(`Crunchyroll ${n} option is no longer available`);Y(i);let o=t.currentSrc,s=ss(t);return await e.evaluate(Po,{...qo,sectionIndex:Zo(n),optionIndex:a}),await as(e,n,r,i),await ls(t,o,i)&&await us(e,t,s,i),rs(e,i)},fs=(e,t)=>{cs(e,t).catch(e=>console.warn(`[cr] timeline seek failed:`,e))},ps=(e,t)=>new Proxy(e,{set(e,n,r,i){return n===`currentTime`&&typeof r==`number`&&Number.isFinite(r)&&fs(t,r),Reflect.set(e,n,r,i)}}),ms=({title:e,remote:t,frame:n,subtitles:i,audioTracks:a,thumbnails:o,chapters:s,pictureInPicture:c,children:l})=>{let u=h(()=>t&&n?ps(t,n):null,[t,n]);return y(()=>t?r(t):void 0,[t]),S(He,{expose:!0,media:u,title:e,subtitles:i,audioTracks:a,thumbnails:o,chapters:s,pictureInPicture:c,children:l})},hs=3e4,gs=async(e,t)=>{let n=Date.now()+hs,r=!1;for(;!t();){let i=await e.locator(`.shell-header`).exists();r||=i;let[a,o]=await Promise.all([e.locator(`#user-menu-anonymous`).exists(),e.locator(`#user-menu-authenticated`).exists()]);if(t())break;if(o)return{isLoggedIn:o,isLoggedOut:!1};let s=Date.now()>=n;if(a&&!i&&(r||s))return{isLoggedIn:o,isLoggedOut:a};if(s)break;await new Promise(e=>setTimeout(e,100))}throw Error(`Login state check timed out`)};D();var _s=`video`,vs=(e,t,n)=>{let[r,i]=C(null);return y(()=>{if(!e||!t)return;let n=!1;(async()=>e.evaluate(Lo,{video:_s}))().then(e=>{!n&&e&&i(t)},e=>{n||console.warn(`[cr] picture in picture unavailable:`,e)});let r=e=>console.warn(`[cr] picture in picture refused:`,e.detail);return t.addEventListener(Io,r),()=>{n=!0,t.removeEventListener(Io,r),i(null)}},[e,t]),h(()=>r&&r===t&&n?{onArmedChange:e=>{n.style.pointerEvents=e?`auto`:``}}:void 0,[r,t,n])},ys=class extends Error{name=`BifParseError`},bs=[137,66,73,70,13,10,26,10],xs=64,Ss=8,Cs=4294967295,ws=36e3,Ts=e=>{if(e.byteLength<xs)throw new ys(`truncated header: ${e.byteLength} bytes`);let t=new DataView(e);if(bs.some((e,n)=>t.getUint8(n)!==e))throw new ys(`bad magic`);let n=t.getUint32(12,!0),r=t.getUint32(16,!0)||1e3;if(n>ws)throw new ys(`implausible frame count ${n}`);let i=xs+(n+1)*Ss;if(i>e.byteLength)throw new ys(`truncated index: ${n} frames need ${i} bytes, have ${e.byteLength}`);let a=e=>t.getUint32(xs+e*Ss,!0),o=e=>t.getUint32(xs+e*Ss+4,!0);if(a(n)!==Cs)throw new ys(`the index does not end on the 0xffffffff entry`);let s=[];for(let t=0;t<n;t+=1){let c=o(t),l=o(t+1);if(c<i||l<=c||l>e.byteLength)throw new ys(`image ${t} spans ${c}..${l}, outside ${i}..${e.byteLength}`);let u=a(t),d=t+1===n;if(!d&&a(t+1)<=u)throw new ys(`timestamps do not increase at image ${t}`);s.push({start:u*r,end:d?1/0:a(t+1)*r,bytes:new Uint8Array(e,c,l-c)})}return s},Es=(e,t)=>{if(!e.length||!Number.isFinite(t))return;let n=0,r=e.length-1;for(;n<r;){let i=Math.ceil((n+r)/2);e[i].start<=t?n=i:r=i-1}return e[n]},Ds=async({waitMs:e,fetchMs:t,maxBytes:n})=>{let r=/^(?:https?:\/\/|\/)\S*\.bif(?:[?#]\S*)?$/i,i=e=>typeof e==`string`&&e.length<8192&&e.includes(`.bif`)&&r.test(e),a=(e,t)=>{try{return e?.[t]}catch{return}},o=e=>{let t=Object.keys(e).find(e=>e.startsWith(`__reactFiber$`)||e.startsWith(`__reactInternalInstance$`));return t?a(e,t):void 0},s=e=>{let t=[],n=new Set,r=[e,...Array.from(e.querySelectorAll(`*`)).slice(0,3e3)];for(let e of r){let r=o(e);for(let e=0;r&&e<40&&!n.has(r);e+=1){n.add(r);let e=a(a(r,`memoizedProps`),`value`);e&&typeof e==`object`&&t.push(e),r=a(r,`return`)}}return t},c=e=>{let t=new Set,n=e,r=0;for(let e=0;e<=8&&n.length;e+=1){let e=[];for(let o of n){if(t.has(o))continue;if(t.add(o),r+=1,r>2e4)return;let n;try{n=Object.keys(o).slice(0,500)}catch{continue}for(let t of n){let n=a(o,t);if(i(n))return n;n&&typeof n==`object`&&(n===window||typeof a(n,`nodeType`)==`number`||ArrayBuffer.isView(n)||n instanceof ArrayBuffer||e.push(n))}}n=e}},l=e=>{let t=[];for(let n of e){let e=a(a(n,`volumeVM`),`_player`);if(!e||typeof e!=`object`)continue;let r=a(a(a(e,`playerOrchestrator`),`thumbnailOrchestrator`),`_currentBifUrl`);if(i(r))return{url:r,via:`named`};t.push(e)}let n=c(t.length?t:e);return n?{url:n,via:`search`}:void 0},u=async(e,r)=>{let i=new AbortController,a=setTimeout(()=>i.abort(),t);try{let t=await fetch(e,{signal:i.signal});if(!t.ok)return{none:`fetch-failed`,detail:`HTTP ${t.status}`};let a=Number(t.headers.get(`content-length`));if(a>n)return{none:`too-large`,detail:`${a} bytes`};let o=await t.arrayBuffer();return o.byteLength>n?{none:`too-large`,detail:`${o.byteLength} bytes`}:{bytes:o,via:r}}catch(e){return{none:`fetch-failed`,detail:String(e)}}finally{clearTimeout(a)}};try{let t=Date.now()+e,n=!1;for(;;){let e=document.querySelector(`.video-player-wrapper`);if(e?.querySelector(`video`)){n=!0;let t=l(s(e));if(t)return await u(t.url,t.via)}if(Date.now()>=t)return{none:n?`no-bif`:`no-player`};await new Promise(e=>setTimeout(e,500))}}catch(e){return{none:`failed`,detail:String(e)}}},Os={waitMs:1e4,fetchMs:15e3,maxBytes:31457280},ks=e=>{let t=new Map,n=!1;return{at:r=>{if(n)return;let i=Es(e,r*1e3);if(!i)return;let a=t.get(i);return a||(a={url:URL.createObjectURL(new Blob([i.bytes],{type:`image/jpeg`})),startTime:i.start/1e3,endTime:i.end/1e3},t.set(i,a)),a},dispose:()=>{n=!0;for(let{url:e}of t.values())URL.revokeObjectURL(e);t.clear()}}},As=async e=>{let t=await e.evaluate(Ds,Os);if(`none`in t)throw Error(`no BIF: ${t.none}${t.detail?` (${t.detail})`:``}`);let n=Ts(t.bytes);if(!n.length)throw Error(`no BIF: the file has no images`);return ks(n)};D();var js=e=>`https://static.crunchyroll.com/skip-events/production/${e}.json`,Ms=e=>{try{return new URL(e).pathname.match(/\/watch\/([A-Z0-9]+)(?:\/|$)/)?.[1]}catch{return}},Ns=[[`intro`,`Opening`],[`recap`,`Recap`],[`credits`,`Ending`],[`preview`,`Preview`]],Ps=`Episode`,Fs=e=>typeof e==`object`&&!!e&&!Array.isArray(e),Is=(e,t)=>{if(!Fs(e))return[];let n=t!==void 0&&Number.isFinite(t)&&t>0?t:1/0,r=Ns.flatMap(([t,r])=>{let i=e[t];if(!Fs(i))return[];let{start:a,end:o}=i;if(typeof a!=`number`||typeof o!=`number`||!Number.isFinite(a)||!Number.isFinite(o))return[];let s={start:Math.max(0,a),end:Math.min(o,n),title:r};return s.end>s.start?[s]:[]}).sort((e,t)=>e.start-t.start),i=[],a=0;for(let e of r){let t=Math.max(e.start,a);e.end<=t||(t>a&&i.push({start:a,end:t,title:Ps}),i.push({start:t,end:e.end,title:e.title}),a=e.end)}return i.length&&n!==1/0&&a<n&&i.push({start:a,end:n,title:Ps}),i},Ls=new Set([403,404]),Rs=async(e,t=ne)=>{let n=await t(js(e));if(!n.ok){if(await n.body?.cancel().catch(()=>{}),Ls.has(n.status))return{};throw Error(`${js(e)} answered ${n.status}`)}return n.json()},zs=e=>{let[t,n]=C();return y(()=>{if(n(e?.duration),!e)return;let t=()=>n(e.duration);return e.addEventListener(`durationchange`,t),e.addEventListener(`loadedmetadata`,t),()=>{e.removeEventListener(`durationchange`,t),e.removeEventListener(`loadedmetadata`,t)}},[e]),t},Bs=[],Vs=(e,t)=>{let n=Ms(e),[r,i]=C(),a=zs(t);return y(()=>{if(!n)return;let e=!1;return Rs(n).then(t=>{e||i({episodeId:n,events:t})},t=>{e||console.warn(`[cr] skip events unavailable:`,t)}),()=>{e=!0}},[n]),h(()=>{if(!r||r.episodeId!==n)return Bs;let e=Is(r.events,a);return e.length?e:Bs},[r,n,a])};D();var Hs=`
|
|
2
|
+
html, body {
|
|
3
|
+
margin: 0 !important;
|
|
4
|
+
padding: 0 !important;
|
|
5
|
+
width: 100% !important;
|
|
6
|
+
height: 100% !important;
|
|
7
|
+
background: #000 !important;
|
|
8
|
+
}
|
|
9
|
+
*:not(:has(.video-player-wrapper)):not(.video-player-wrapper):not(.video-player-wrapper *) {
|
|
10
|
+
display: none !important;
|
|
11
|
+
}
|
|
12
|
+
div[data-testid="player-controls-root"] {
|
|
13
|
+
display: none !important;
|
|
14
|
+
}
|
|
15
|
+
.video-player-wrapper,
|
|
16
|
+
.video-player,
|
|
17
|
+
.player-container,
|
|
18
|
+
.video-player-wrapper > *,
|
|
19
|
+
.video-player > *,
|
|
20
|
+
.player-container > * {
|
|
21
|
+
position: absolute !important;
|
|
22
|
+
inset: 0 !important;
|
|
23
|
+
width: 100% !important;
|
|
24
|
+
height: 100% !important;
|
|
25
|
+
z-index: 9999999;
|
|
26
|
+
}
|
|
27
|
+
.video-player-wrapper video,
|
|
28
|
+
.video-player video,
|
|
29
|
+
.player-container video {
|
|
30
|
+
width: 100% !important;
|
|
31
|
+
height: 100% !important;
|
|
32
|
+
object-fit: contain !important;
|
|
33
|
+
}
|
|
34
|
+
.video-player-wrapper *:not(:has(video)):not(video):not(:has(.timeline-slider)):not(.timeline-slider) {
|
|
35
|
+
display: none !important;
|
|
36
|
+
}
|
|
37
|
+
.timeline-container,
|
|
38
|
+
.timeline-container *,
|
|
39
|
+
.timeline-slider {
|
|
40
|
+
opacity: 0 !important;
|
|
41
|
+
pointer-events: none !important;
|
|
42
|
+
}
|
|
43
|
+
/* shows only where the frame takes pointer events: the player's picture in picture control, armed */
|
|
44
|
+
html, html * {
|
|
45
|
+
cursor: pointer !important;
|
|
46
|
+
}
|
|
47
|
+
`,Us=3e4,Ws=async(e,t)=>{let n=Date.now()+Us;for(;!t()&&Date.now()<n;){try{if(await e.locator(`video`).exists())return t()?null:await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,100))}return null},Gs=u`
|
|
48
|
+
to { transform: rotate(360deg); }
|
|
49
|
+
`,Ks=s`
|
|
50
|
+
position: relative;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
background: #000;
|
|
54
|
+
/* The double-tap-to-fullscreen gesture otherwise word-selects the
|
|
55
|
+
skin's labels/time readouts, flashing them blue. Player chrome isn't
|
|
56
|
+
meant to be selected, so suppress it across the whole player. */
|
|
57
|
+
user-select: none;
|
|
58
|
+
-webkit-user-select: none;
|
|
59
|
+
|
|
60
|
+
.cr-frame {
|
|
61
|
+
position: absolute;
|
|
62
|
+
inset: 0;
|
|
63
|
+
width: 100%;
|
|
64
|
+
height: 100%;
|
|
65
|
+
border: none;
|
|
66
|
+
background: #000;
|
|
67
|
+
/* CR's own chrome is hidden, so the iframe must not swallow clicks -
|
|
68
|
+
taps belong to the videojs gesture layer stacked above it. The one
|
|
69
|
+
exception is picture-in-picture.ts, which lifts this while the
|
|
70
|
+
player's picture in picture control is under the pointer. */
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.overlay {
|
|
75
|
+
position: absolute;
|
|
76
|
+
inset: 0;
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-direction: column;
|
|
79
|
+
align-items: center;
|
|
80
|
+
justify-content: center;
|
|
81
|
+
gap: 1.6rem;
|
|
82
|
+
background: #000;
|
|
83
|
+
font-size: 1.4rem;
|
|
84
|
+
color: rgba(255, 255, 255, 0.8);
|
|
85
|
+
/* Above the skin's own layers (its controls/error dialog top out at
|
|
86
|
+
z-index 20) so the login/loading screen fully covers them. */
|
|
87
|
+
z-index: 30;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.login-button {
|
|
91
|
+
padding: 0.8rem 2rem;
|
|
92
|
+
background: #f47521;
|
|
93
|
+
color: #fff;
|
|
94
|
+
border: none;
|
|
95
|
+
border-radius: 0.4rem;
|
|
96
|
+
font-size: 1.4rem;
|
|
97
|
+
font-weight: 600;
|
|
98
|
+
cursor: pointer;
|
|
99
|
+
|
|
100
|
+
&:hover {
|
|
101
|
+
background: #e0651a;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:disabled {
|
|
105
|
+
opacity: 0.6;
|
|
106
|
+
cursor: default;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* @banou/media-player's own buffering spinner (overlay.tsx), same box and centre, so when the video
|
|
111
|
+
arrives still buffering the player's spinner takes over from this one without a jump */
|
|
112
|
+
.loading-spinner {
|
|
113
|
+
box-sizing: border-box;
|
|
114
|
+
width: calc(4 * var(--mp-unit, 10px));
|
|
115
|
+
height: calc(4 * var(--mp-unit, 10px));
|
|
116
|
+
border-radius: 50%;
|
|
117
|
+
border: 3px solid rgba(255, 255, 255, 0.25);
|
|
118
|
+
border-top-color: #fff;
|
|
119
|
+
animation: ${Gs} 0.8s linear infinite;
|
|
120
|
+
}
|
|
121
|
+
`,qs=({url:r,title:i})=>{let[o,s]=C(`detecting`),[c,l]=C(null),[u,d]=C(null),[f,p]=C(!0),[g,_]=C(!1),[v,b]=C(),[x,w]=C(null),[T,D]=C(0),[O,j]=C(0),[M,N]=C(!1),[ne,oe]=C(!1),P=m(null),se=m(null),[F,ce]=C(!1),I=m(!1),[L,le]=C(),[ue,de]=C(0),[fe,pe]=C(),me=Vs(r,x),he=vs(u,x,c),R=m(0),ge=m({generation:0,tail:Promise.resolve()}),z=m(!0),_e=A(()=>{let e=R.current+1;return R.current=e,ge.current={generation:e,tail:Promise.resolve()},le(void 0),e},[]),ve=A((e,t)=>{if(ge.current.generation!==e)return Promise.reject(Error(`Crunchyroll track operation cancelled`));let n=ge.current,r=n.tail.then(t);return n.tail=r.then(()=>{},()=>{}),r},[]);y(()=>()=>{z.current=!1,R.current+=1},[]),y(()=>{let e=!1;return te().then(t=>{e||s(t)}),()=>{e=!0}},[]),y(()=>{if(!c||o===`detecting`)return;let e=!1;return ae({iframe:c,domains:n,cookies:ie(o),permissions:[{category:`evaluation`,reason:`Switch audio and subtitles, seek the video, show seek thumbnails and open picture in picture`}]}).then(t=>{e||d(t)}).catch(t=>{e||(console.error(`Failed to attach Crunchyroll frame`,t),b(t?.message||`Failed to load player`),p(!1))}),()=>{e=!0}},[c,o]),y(()=>{if(!u)return;let e=!1,t=()=>e;return p(!0),b(void 0),_(!1),w(null),_e(),(async()=>{if(o===`cloud`){if(await u.goto(r,{waitUntil:`commit`}),e)return;let{isLoggedIn:n}=await gs(u,t);if(e)return;if(ee.record(`crunchyroll`,n?`signed-in`:`signed-out`),!n){p(!1),_(!0);return}if(await u.addStyleTag({content:Hs}),e)return;let i=await Ws(u,t);if(e)return;if(p(!1),!i)throw Error(`The episode did not load a player.`);w(i);return}if(await u.goto(r,{waitUntil:`commit`}),e||(await u.addStyleTag({content:Hs}),e))return;let{isLoggedIn:n}=await gs(u,t);if(e)return;if(ee.record(`crunchyroll`,n?`signed-in`:`signed-out`),!n){p(!1),_(!0);return}let i=await Ws(u,t);if(!e){if(p(!1),!i)throw Error(`The episode did not load a player.`);w(i)}})().catch(t=>{e||(console.error(`Failed to load Crunchyroll player`,t),b(t?.message||`Failed to load player`),p(!1))}),()=>{e=!0}},[u,r,T,o,_e]),y(()=>{if(!u||!x)return;let e=_e(),t=!1,n=()=>t||!z.current||e!==R.current;return(async()=>{let t,r;for(let i=0;i<5&&!n();i+=1){try{if(r=await ve(e,()=>rs(u,n)),t=void 0,n()||(le(r),r.audio&&r.subtitles))return}catch(e){t=e}await new Promise(e=>setTimeout(e,500))}if(!r&&t)throw t})().then(()=>{},e=>{n()||console.warn(`[cr] track discovery failed:`,e)}),()=>{t=!0}},[u,x,_e,ve]),y(()=>{if(!u||!x)return;let e=!1,t;return As(u).then(n=>{if(e)return n.dispose();t=n,pe(n)},t=>{e||console.warn(`[cr] seek thumbnails unavailable:`,t)}),()=>{e=!0,t?.dispose(),pe(void 0)}},[u,x]);let ye=R.current,be=A((e,t)=>{if(!u||!x)return Promise.reject(Error(`Crunchyroll player is not ready`));let n=()=>!z.current||ye!==R.current;return de(e=>e+1),ve(ye,async()=>{try{let r=await ds(u,x,e,t,n);if(n())throw Error(`Crunchyroll track operation cancelled`);le(r)}catch(e){if(!n())try{let e=await rs(u,n);n()||le(e)}catch{}throw e}}).finally(()=>de(e=>e-1))},[u,x,ve,ye]),B=h(()=>L?.subtitles&&{selection:{...L.subtitles,select:e=>be(`subtitles`,e)}},[L?.subtitles,be]),xe=h(()=>L?.audio&&{selection:{...L.audio,select:e=>be(`audio`,e)}},[L?.audio,be]),Se=h(()=>{let e=e=>e&&{ids:e.options.filter(e=>!e.disabled).map(e=>e.id),selected:e.selectedId};return{subtitles:e(L?.subtitles),audio:e(L?.audio),busy:ue>0}},[L,ue]);y(()=>t(Se,(e,t)=>{be(e,t).catch(()=>{})}),[Se,be]);let V=A(()=>{if(P.current!==null)return;let t=globalThis.open(e,`_blank`,`width=500,height=700`);if(!t){oe(!0),p(!1);return}oe(!1),N(!0),se.current=t;let n=setInterval(()=>{t.closed&&(clearInterval(n),P.current===n&&(P.current=null),se.current===t&&(se.current=null),N(!1),D(e=>e+1))},500);P.current=n},[]),Ce=A(()=>{d(null),b(void 0),w(null),_e(),_(!1),p(!0),j(e=>e+1)},[_e]),we=A(()=>{if(I.current)return;I.current=!0;let t=re({url:e,domains:n,isSignedIn:a});oe(!1),ce(!0),t.then(e=>{if(z.current){if(e===`blocked`){oe(!0);return}if(e===`unsupported`){b(`The Crunchyroll sign-in window could not be opened here.`);return}if(e===`authed`){Ce();return}_(!1),p(!0),D(e=>e+1)}},e=>{z.current&&(console.error(`Crunchyroll sign-in window failed`,e),b(e?.message||`The sign-in window failed`))}).finally(()=>{I.current=!1,z.current&&ce(!1)})},[Ce]);y(()=>()=>{P.current!==null&&(clearInterval(P.current),P.current=null)},[]),y(()=>{P.current!==null&&(clearInterval(P.current),P.current=null,N(!1)),oe(!1)},[r]);let Te=A(()=>{se.current!==null&&(se.current.close(),se.current=null),P.current!==null&&(clearInterval(P.current),P.current=null),oe(!1),N(!1),Ce()},[Ce]),Ee=(f||v||ne||g)&&E(`div`,{className:`overlay`,children:[g&&!v&&!ne&&E(k,{children:[`Sign in to Crunchyroll to watch.`,o===`extension`?S(`button`,{className:`login-button`,onClick:V,disabled:M,children:M?`Finish signing in the popup...`:`Open Crunchyroll Login Page`}):S(`button`,{className:`login-button`,onClick:we,disabled:F,children:F?`Finish signing in the window...`:`Sign in to Crunchyroll`})]}),ne&&!v&&E(k,{children:[`The login popup was blocked. Allow popups for this page and try again.`,S(`button`,{className:`login-button`,onClick:o===`extension`?V:we,children:`Open Crunchyroll Login Page`})]}),v&&E(k,{children:[v,S(`button`,{className:`login-button`,onClick:Te,children:`Retry`})]}),f&&!v&&!g&&S(`div`,{className:`loading-spinner`,role:`status`,"aria-label":`Loading`})]});return E(`div`,{css:Ks,children:[o!==`detecting`&&S(ms,{title:i,remote:x,frame:u,subtitles:B,audioTracks:xe,thumbnails:fe,chapters:me,pictureInPicture:he,children:S(`iframe`,{ref:l,className:`cr-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`},`${o}-${O}`)}),Ee]})},X=e=>e,Z=X(({className:e,children:t})=>S(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:18,height:18,fill:`none`,"aria-hidden":`true`,className:e,children:t})),Js=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`m14.051 10.723-7.985 4.964a1.98 1.98 0 0 1-2.758-.638A2.06 2.06 0 0 1 3 13.964V4.036C3 2.91 3.895 2 5 2c.377 0 .747.109 1.066.313l7.985 4.964a2.057 2.057 0 0 1 .627 2.808c-.16.257-.373.475-.627.637`})})),Ys=X(({className:e})=>E(Z,{className:e,children:[S(`rect`,{width:5,height:14,x:2,y:2,fill:`currentColor`,rx:1.75}),S(`rect`,{width:5,height:14,x:11,y:2,fill:`currentColor`,rx:1.75})]})),Xs=X(({className:e})=>E(Z,{className:e,children:[S(`path`,{fill:`currentColor`,d:`M9 17a8 8 0 0 1-8-8h2a6 6 0 1 0 1.287-3.713l1.286 1.286A.25.25 0 0 1 5.396 7H1.25A.25.25 0 0 1 1 6.75V2.604a.25.25 0 0 1 .427-.177l1.438 1.438A8 8 0 1 1 9 17`}),S(`path`,{fill:`currentColor`,d:`m11.61 9.639-3.331 2.07a.826.826 0 0 1-1.15-.266.86.86 0 0 1-.129-.452V6.849C7 6.38 7.374 6 7.834 6c.158 0 .312.045.445.13l3.331 2.071a.858.858 0 0 1 0 1.438`})]})),Zs=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M1 9c0 2.21.895 4.21 2.343 5.657l1.414-1.414a6 6 0 1 1 8.956-7.956l-1.286 1.286a.25.25 0 0 0 .177.427h4.146a.25.25 0 0 0 .25-.25V2.604a.25.25 0 0 0-.427-.177l-1.438 1.438A8 8 0 0 0 1 9`})})),Qs=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752M14.5 7.586l-1.768-1.768a1 1 0 1 0-1.414 1.414L13.085 9l-1.767 1.768a1 1 0 0 0 1.414 1.414l1.768-1.768 1.768 1.768a1 1 0 0 0 1.414-1.414L15.914 9l1.768-1.768a1 1 0 0 0-1.414-1.414z`})})),$s=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})})),ec=X(({className:e})=>E(Z,{className:e,children:[S(`path`,{fill:`currentColor`,d:`M15.6 3.3c-.4-.4-1-.4-1.4 0s-.4 1 0 1.4C15.4 5.9 16 7.4 16 9s-.6 3.1-1.8 4.3c-.4.4-.4 1 0 1.4.2.2.5.3.7.3.3 0 .5-.1.7-.3C17.1 13.2 18 11.2 18 9s-.9-4.2-2.4-5.7`}),S(`path`,{fill:`currentColor`,d:`M.714 6.008h3.072l4.071-3.857c.5-.376 1.143 0 1.143.601V15.28c0 .602-.643.903-1.143.602l-4.071-3.858H.714c-.428 0-.714-.3-.714-.752V6.76c0-.451.286-.752.714-.752m10.568.59a.91.91 0 0 1 0-1.316.91.91 0 0 1 1.316 0c1.203 1.203 1.47 2.216 1.522 3.208q.012.255.011.51c0 1.16-.358 2.733-1.533 3.803a.7.7 0 0 1-.298.156c-.382.106-.873-.011-1.018-.156a.91.91 0 0 1 0-1.316c.57-.57.995-1.551.995-2.487 0-.944-.26-1.667-.995-2.402`})]})),tc=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M9.57 3.617A1 1 0 0 0 8.646 3H4c-.552 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1 1 1 0 0 0 .706-.293l4.647-4.647a1 1 0 0 0 .216-1.089m4.812 4.812a1 1 0 0 0-1.089.217l-4.647 4.647a.998.998 0 0 0 .708 1.706H14c.552 0 1-.449 1-1V9.353a1 1 0 0 0-.618-.924`})})),nc=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M7.883 1.93a.99.99 0 0 0-1.09.217L2.146 6.793A.998.998 0 0 0 2.853 8.5H7.5c.551 0 1-.449 1-1V2.854a1 1 0 0 0-.617-.924m7.263 7.57H10.5c-.551 0-1 .449-1 1v4.646a.996.996 0 0 0 1.001 1.001 1 1 0 0 0 .706-.293l4.646-4.646a.998.998 0 0 0-.707-1.707z`})})),rc=X(({className:e})=>E(Z,{className:e,children:[S(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.035A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.035.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),S(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),S(`path`,{fill:`currentColor`,d:`M7.129 5.547a.6.6 0 0 0-.656.13L3.677 8.473A.6.6 0 0 0 4.102 9.5h2.796c.332 0 .602-.27.602-.602V6.103a.6.6 0 0 0-.371-.556`})]})),ic=X(({className:e})=>E(Z,{className:e,children:[S(`path`,{fill:`currentColor`,d:`M13 2a4 4 0 0 1 4 4v2.036A3.5 3.5 0 0 0 16.5 8H15V6.273C15 5.018 13.96 4 12.679 4H4.32C3.04 4 2 5.018 2 6.273v5.454C2 12.982 3.04 14 4.321 14H6v1.5q0 .255.036.5H4a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4z`}),S(`rect`,{width:10,height:7,x:8,y:10,fill:`currentColor`,rx:2}),S(`path`,{fill:`currentColor`,d:`M4.871 10.454a.6.6 0 0 0 .656-.131l2.796-2.796A.6.6 0 0 0 7.898 6.5H5.102a.603.603 0 0 0-.602.602v2.795a.6.6 0 0 0 .371.556`})]})),ac=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M15 2a3 3 0 0 1 3 3v8a3 3 0 0 1-3 3H3a3 3 0 0 1-3-3V5a3 3 0 0 1 3-3zM4 11a1 1 0 1 0 0 2h5a1 1 0 1 0 0-2zm8 0a1 1 0 1 0 0 2h2a1 1 0 1 0 0-2zM4 8a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2zm4 0a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm6 0a1 1 0 1 0 0 2 1 1 0 0 0 0-2`})})),oc=X(({className:e})=>E(Z,{className:e,children:[S(`rect`,{width:16,height:12,x:1,y:3,stroke:`currentColor`,strokeWidth:2,rx:3}),S(`rect`,{width:3,height:2,x:3,y:8,fill:`currentColor`,rx:1}),S(`rect`,{width:2,height:2,x:13,y:8,fill:`currentColor`,rx:1}),S(`rect`,{width:4,height:2,x:11,y:11,fill:`currentColor`,rx:1}),S(`rect`,{width:5,height:2,x:7,y:8,fill:`currentColor`,rx:1}),S(`rect`,{width:7,height:2,x:3,y:11,fill:`currentColor`,rx:1})]})),sc=X(({className:e})=>S(Z,{className:e,children:E(`g`,{fill:`currentColor`,children:[S(`rect`,{width:2,height:5,x:8,y:.5,opacity:.5,rx:1,children:S(`animate`,{attributeName:`opacity`,begin:`0s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:2,height:5,x:12.243,y:2.257,opacity:.45,rx:1,transform:`rotate(45 13.243 4.757)`,children:S(`animate`,{attributeName:`opacity`,begin:`0.125s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:5,height:2,x:12.5,y:8,opacity:.4,rx:1,children:S(`animate`,{attributeName:`opacity`,begin:`0.25s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:5,height:2,x:10.743,y:12.243,opacity:.35,rx:1,transform:`rotate(45 13.243 13.243)`,children:S(`animate`,{attributeName:`opacity`,begin:`0.375s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:2,height:5,x:8,y:12.5,opacity:.3,rx:1,children:S(`animate`,{attributeName:`opacity`,begin:`0.5s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:2,height:5,x:3.757,y:10.743,opacity:.25,rx:1,transform:`rotate(45 4.757 13.243)`,children:S(`animate`,{attributeName:`opacity`,begin:`0.625s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:5,height:2,x:.5,y:8,opacity:.15,rx:1,children:S(`animate`,{attributeName:`opacity`,begin:`0.75s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})}),S(`rect`,{width:5,height:2,x:2.257,y:3.757,opacity:.1,rx:1,transform:`rotate(45 4.757 4.757)`,children:S(`animate`,{attributeName:`opacity`,begin:`0.875s`,calcMode:`linear`,dur:`1s`,repeatCount:`indefinite`,values:`1;0`})})]})})),cc=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M9 2a1 1 0 0 1 1 1v12a1 1 0 1 1-2 0V3a1 1 0 0 1 1-1zm4 3a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zM5 5a1 1 0 0 1 1 1v6a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1zm8 4a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1zM5 9a1 1 0 0 1 1 1v1a1 1 0 1 1-2 0v-1a1 1 0 0 1 1-1z`})})),lc=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M3 5a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm0 4a1 1 0 0 1 1-1h10a1 1 0 1 1 0 2H4a1 1 0 0 1-1-1zm1 3a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H4z`})})),uc=X(({className:e})=>S(Z,{className:e,children:S(`path`,{fill:`currentColor`,d:`M14.53 4.53a.75.75 0 0 0-1.06-1.06L7 9.94 4.53 7.47a.75.75 0 0 0-1.06 1.06l3 3a.75.75 0 0 0 1.06 0l7-7z`})}));D();var dc=10,Q=e=>e,fc=Q(ya.Root),pc=Q(fa),mc=Q(Da.Root),hc=Q(da.Popup),gc=Q(da.Title),_c=Q(da.Close),vc=Q(Da.Description),yc=Q(Oo.Provider),bc=Q(Oo.Root),xc=Q(Oo.Trigger),Sc=Q(Oo.Popup),Cc=Q(Ja.Root),wc=Q(Ja.Trigger),Tc=Q(Ja.Popup),Ec=Q(Ra),Dc=Q(Ya),Oc=Q(Ia),kc=Q(La),Ac=Q(Oa),jc=Q(za),Mc=Q(po.Value),Nc=Q(go.Root),Pc=Q(co.Track),Fc=Q(co.Fill),Ic=Q(co.Buffer),Lc=Q(co.Thumb),Rc=Q(co.Value),zc=Q(jo.Root),$=Q(Pa),Bc=Q(Aa),Vc=Q(Te),Hc=({className:e,...t})=>S(`button`,{type:`button`,className:`media-button media-button--subtle media-button--icon${e?` ${e}`:``}`,...t}),Uc=({selection:e,icon:t})=>{let[n,r]=C(!1),[i,a]=C(!1),[o,s]=C(!1);y(()=>s(!1),[e.selectedId]);let c=[...e.offLabel?[{id:null,label:e.offLabel}]:[],...e.options],l=t=>{if(t===e.selectedId){r(!1);return}s(!1),a(!0),Promise.resolve().then(()=>e.onSelect(t)).then(()=>r(!1)).catch(t=>{console.warn(`[player] ${e.label} selection failed:`,t),s(!0)}).finally(()=>a(!1))};return E(Cc,{open:n,onOpenChange:e=>r(e),children:[S(wc,{render:S(Hc,{className:`media-button--menu${o?` media-button--error`:``}`,"aria-label":e.label}),children:t}),S(Tc,{className:`media-surface media-popover media-popover--menu`,children:E(`div`,{className:`stub-menu`,role:`menu`,"aria-label":e.label,children:[S(`div`,{className:`stub-menu__heading`,children:e.label}),c.map(t=>{let n=t.id===e.selectedId;return E(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":n,className:`stub-menu__item${n?` stub-menu__item--active`:``}`,disabled:i||`disabled`in t&&t.disabled,onClick:()=>l(t.id),children:[S(`span`,{className:`stub-menu__check`,children:n?S(uc,{className:`media-icon`}):null}),S(`span`,{className:`stub-menu__label`,children:t.label}),`description`in t&&t.description?S(`span`,{className:`stub-menu__description`,children:t.description}):null]},t.id??`__off__`)})]})})]})},Wc=()=>E(Cc,{openOnHover:!0,delay:200,closeDelay:100,side:`top`,children:[S(wc,{render:E(Oc,{className:`media-button--mute`,render:S(Hc,{}),children:[S(Qs,{className:`media-icon media-icon--volume-off`}),S($s,{className:`media-icon media-icon--volume-low`}),S(ec,{className:`media-icon media-icon--volume-high`})]})}),S(Tc,{className:`media-surface media-popover media-popover--volume`,children:E(zc,{className:`media-slider`,orientation:`vertical`,thumbAlignment:`edge`,children:[S(Pc,{className:`media-slider__track`,children:S(Fc,{className:`media-slider__fill`})}),S(Lc,{className:`media-slider__thumb media-slider__thumb--persistent`})]})})]}),Gc=({capabilities:e,children:t,className:n,...r})=>E(Vc,{className:`media-default-skin media-default-skin--video${n?` ${n}`:``}`,...r,children:[t,S(pc,{render:e=>S(`div`,{...e,className:`media-buffering-indicator`,children:S(`div`,{className:`media-surface`,children:S(sc,{className:`media-icon`})})})}),S(mc,{children:S(hc,{className:`media-error`,children:E(`div`,{className:`media-error__dialog media-surface`,children:[E(`div`,{className:`media-error__content`,children:[S(gc,{className:`media-error__title`,children:`Something went wrong.`}),S(vc,{className:`media-error__description`})]}),S(`div`,{className:`media-error__actions`,children:S(_c,{className:`media-button media-button--primary`,children:`OK`})})]})})}),S(fc,{className:`media-surface media-controls`,children:E(yc,{children:[E(`div`,{className:`media-button-group`,children:[E(bc,{side:`top`,children:[S(xc,{render:E(Ec,{className:`media-button--play`,render:S(Hc,{}),children:[S(Xs,{className:`media-icon media-icon--restart`}),S(Js,{className:`media-icon media-icon--play`}),S(Ys,{className:`media-icon media-icon--pause`})]})}),S(Sc,{className:`media-surface media-tooltip`})]}),E(bc,{side:`top`,children:[S(xc,{render:S(Dc,{seconds:-10,className:`media-button--seek`,render:S(Hc,{}),children:E(`span`,{className:`media-icon__container`,children:[S(Zs,{className:`media-icon media-icon--seek media-icon--flipped`}),S(`span`,{className:`media-icon__label`,children:dc})]})})}),E(Sc,{className:`media-surface media-tooltip`,children:[`Seek backward `,dc,` seconds`]})]}),E(bc,{side:`top`,children:[S(xc,{render:S(Dc,{seconds:dc,className:`media-button--seek`,render:S(Hc,{}),children:E(`span`,{className:`media-icon__container`,children:[S(Zs,{className:`media-icon media-icon--seek`}),S(`span`,{className:`media-icon__label`,children:dc})]})})}),E(Sc,{className:`media-surface media-tooltip`,children:[`Seek forward `,dc,` seconds`]})]})]}),E(`div`,{className:`media-time-controls`,children:[S(Mc,{type:`current`,className:`media-time`}),E(Nc,{className:`media-slider`,children:[E(Pc,{className:`media-slider__track`,children:[S(Fc,{className:`media-slider__fill`}),S(Ic,{className:`media-slider__buffer`})]}),S(Lc,{className:`media-slider__thumb`}),S(`div`,{className:`media-surface media-thumbnail media-slider__preview`,children:S(Rc,{type:`pointer`,className:`media-time media-thumbnail__time`})})]}),S(Mc,{type:`duration`,className:`media-time`})]}),E(`div`,{className:`media-button-group`,children:[E(bc,{side:`top`,children:[S(xc,{render:S(jc,{className:`media-button--playback-rate`,render:S(Hc,{})})}),S(Sc,{className:`media-surface media-tooltip`,children:`Toggle playback rate`})]}),S(Wc,{}),e?.subtitles&&S(Uc,{selection:e.subtitles,icon:e.subtitles.selectedId?S(ac,{className:`media-icon`}):S(oc,{className:`media-icon`})},`subtitles`),e?.audioTracks&&S(Uc,{selection:e.audioTracks,icon:S(cc,{className:`media-icon`})},`audio`),e?.qualityLevels&&S(Uc,{selection:e.qualityLevels,icon:S(lc,{className:`media-icon`})},`quality`),E(bc,{side:`top`,children:[S(xc,{render:E(kc,{className:`media-button--pip`,render:S(Hc,{}),children:[S(rc,{className:`media-icon media-icon--pip-enter`}),S(ic,{className:`media-icon media-icon--pip-exit`})]})}),S(Sc,{className:`media-surface media-tooltip`})]}),E(bc,{side:`top`,children:[S(xc,{render:E(Ac,{className:`media-button--fullscreen`,render:S(Hc,{}),children:[S(tc,{className:`media-icon media-icon--fullscreen-enter`}),S(nc,{className:`media-icon media-icon--fullscreen-exit`})]})}),S(Sc,{className:`media-surface media-tooltip`})]})]})]})}),S(`div`,{className:`media-overlay`}),S($,{keys:`Space`,action:`togglePaused`}),S($,{keys:`k`,action:`togglePaused`}),S($,{keys:`m`,action:`toggleMuted`}),S($,{keys:`f`,action:`toggleFullscreen`}),S($,{keys:`i`,action:`togglePictureInPicture`}),S($,{keys:`ArrowRight`,action:`seekStep`,value:5}),S($,{keys:`ArrowLeft`,action:`seekStep`,value:-5}),S($,{keys:`l`,action:`seekStep`,value:10}),S($,{keys:`j`,action:`seekStep`,value:-10}),S($,{keys:`ArrowUp`,action:`volumeStep`,value:.05}),S($,{keys:`ArrowDown`,action:`volumeStep`,value:-.05}),S($,{keys:`0-9`,action:`seekToPercent`}),S($,{keys:`Home`,action:`seekToPercent`,value:0}),S($,{keys:`End`,action:`seekToPercent`,value:100}),S($,{keys:`>`,action:`speedUp`}),S($,{keys:`<`,action:`speedDown`}),S(Bc,{type:`tap`,action:`togglePaused`,pointer:`mouse`,region:`center`}),S(Bc,{type:`tap`,action:`toggleControls`,pointer:`touch`}),S(Bc,{type:`doubletap`,action:`seekStep`,value:-10,region:`left`}),S(Bc,{type:`doubletap`,action:`toggleFullscreen`,region:`center`}),S(Bc,{type:`doubletap`,action:`seekStep`,value:10,region:`right`})]});D();var{Provider:Kc}=Ie({features:Le}),qc=e=>`media`in e?e:{media:e},Jc=({remote:e,frame:t,adapter:n})=>{let i=Me();return y(()=>{if(!i||!e||!t)return;let a=n?n(e,t):e;if(!a)return;let o=qc(a),s=r(e);i(o.media);let c=Ye(o.media);return()=>{c(),s(),i(null),o.dispose?.()}},[e,t,n,i]),null},Yc=s`
|
|
122
|
+
position: absolute;
|
|
123
|
+
inset: 0;
|
|
124
|
+
border-radius: 0.8rem;
|
|
125
|
+
background: transparent !important;
|
|
126
|
+
&.media-default-skin--video {
|
|
127
|
+
background: transparent !important;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.media-popover--menu {
|
|
131
|
+
padding: 0.4rem;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* The track menu is stub's own markup, so it carries a stub prefix rather than a media one.
|
|
136
|
+
*
|
|
137
|
+
* It was named \`media-menu\` when the skin had no menu of its own. videojs beta.26 added one, and
|
|
138
|
+
* upstream's nested \`.media-default-skin .media-menu .media-menu__item\` is specificity (0,3,0)
|
|
139
|
+
* against this file's (0,2,0), so it silently took over padding, gap, cursor and justification the
|
|
140
|
+
* moment the dependency moved. A prefix upstream will never mint is the only durable fix; matching
|
|
141
|
+
* their specificity would just move the race to insertion order.
|
|
142
|
+
*/
|
|
143
|
+
.stub-menu {
|
|
144
|
+
display: flex;
|
|
145
|
+
flex-direction: column;
|
|
146
|
+
min-width: 18rem;
|
|
147
|
+
max-height: 32rem;
|
|
148
|
+
overflow-y: auto;
|
|
149
|
+
}
|
|
150
|
+
.stub-menu__heading {
|
|
151
|
+
padding: 0.6rem 1rem 0.4rem;
|
|
152
|
+
font-size: 1.1rem;
|
|
153
|
+
font-weight: 600;
|
|
154
|
+
letter-spacing: 0.04em;
|
|
155
|
+
text-transform: uppercase;
|
|
156
|
+
opacity: 0.6;
|
|
157
|
+
}
|
|
158
|
+
.stub-menu__item {
|
|
159
|
+
display: flex;
|
|
160
|
+
align-items: center;
|
|
161
|
+
gap: 0.6rem;
|
|
162
|
+
width: 100%;
|
|
163
|
+
padding: 0.6rem 1rem;
|
|
164
|
+
border: none;
|
|
165
|
+
border-radius: 0.4rem;
|
|
166
|
+
background: transparent;
|
|
167
|
+
color: inherit;
|
|
168
|
+
font-size: 1.3rem;
|
|
169
|
+
text-align: left;
|
|
170
|
+
cursor: pointer;
|
|
171
|
+
|
|
172
|
+
&:hover:not(:disabled) {
|
|
173
|
+
background: rgba(255, 255, 255, 0.12);
|
|
174
|
+
}
|
|
175
|
+
&:disabled {
|
|
176
|
+
opacity: 0.5;
|
|
177
|
+
cursor: default;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
.stub-menu__check {
|
|
181
|
+
display: inline-flex;
|
|
182
|
+
width: 1.6rem;
|
|
183
|
+
flex: none;
|
|
184
|
+
}
|
|
185
|
+
.stub-menu__label {
|
|
186
|
+
flex: 1;
|
|
187
|
+
}
|
|
188
|
+
.stub-menu__description {
|
|
189
|
+
opacity: 0.6;
|
|
190
|
+
font-size: 1.1rem;
|
|
191
|
+
}
|
|
192
|
+
.media-button--error {
|
|
193
|
+
color: #f66;
|
|
194
|
+
}
|
|
195
|
+
`,Xc=({remote:e,frame:t,adapter:n,capabilities:r,children:i})=>E(Kc,{children:[S(Jc,{remote:e,frame:t,adapter:n}),S(Gc,{capabilities:r,css:Yc,children:i})]}),Zc=`[data-uia="timeline"]`,Qc=`[data-uia="video-canvas"]`,$c=`[data-uia="player"]`,el=`Seeks the video to the point you pick on the timeline.`,tl=`Reveals the player controls so the timeline can be used.`,nl=140,rl=2,il=12e3,al=26,ol=110,sl={"still-watching":`[data-uia="interrupt-autoplay-continue"], [data-uia="interrupter-title"]`,"next-episode":`[data-uia="next-episode-seamless-button"], [data-uia="next-episode-seamless-button-draining"]`,error:`[data-uia="error-container"], [data-uia="nfp-error"]`},cl=e=>new Promise(t=>setTimeout(t,e)),ll=e=>e<0?0:e>1?1:e,ul=0,dl=()=>{let e=ul*1.1;return ul++,{x:.5+Math.cos(e)*.05,y:.5+Math.sin(e)*.05}},fl=(e,t)=>{let n=null,r,i,a=!1,o=async()=>{if(!a){a=!0;try{await Promise.all([t.locator(Qc).ensure(`hover`,{reason:tl}),t.locator($c).ensure(`hover`,{reason:tl}),t.locator(Zc).ensure(`click`,{reason:el})])}catch(e){a=!1,console.warn(`[nf] permission request failed:`,e)}}},s=()=>{if(n==null)return;let t=e.currentTime;Number.isFinite(t)&&Math.abs(t-n)<rl&&(n=null,i&&clearTimeout(i))};e.addEventListener(`timeupdate`,s);let c=async n=>{let r=e.duration;if(!Number.isFinite(r)||r<=0){console.warn(`[nf] seek: duration unknown`,r);return}let i=ll(n/r);o();let a=t.locator(Zc),s=e.paused===!0;if(s)try{await e.play()}catch{}let c=!1;for(let e=0;e<al;e++){if(e%2==0&&(await t.locator(Qc).hover({relativePosition:dl(),reason:tl}).catch(()=>{}),await t.locator($c).hover({relativePosition:dl(),reason:tl}).catch(()=>{})),await a.exists().catch(()=>!1)){c=!0;break}await cl(ol)}if(!c){let n=await Promise.all(Object.entries(sl).map(async([e,n])=>await t.locator(n).exists().catch(()=>!1)?e:``)).then(e=>e.filter(Boolean).join(`, `)).catch(()=>``);if(console.warn(`[nf] seek aborted: controls never revealed${n?` (blocked by ${n})`:``}`),s)try{await e.pause()}catch{}return}if(await a.click({relativePosition:{x:i,y:.5},reason:el}).catch(e=>console.warn(`[nf] timeline click failed:`,e?.message??e)),s)try{await e.pause()}catch{}};return{media:new Proxy(e,{get(e,t,r){return t===`currentTime`&&n!=null?n:Reflect.get(e,t,r)},set(e,t,a,o){return t===`currentTime`&&typeof a==`number`&&Number.isFinite(a)?(n=a,r&&clearTimeout(r),r=setTimeout(()=>{c(a).catch(e=>console.warn(`[nf] timeline seek failed:`,e))},nl),i&&clearTimeout(i),i=setTimeout(()=>{n=null},il),!0):Reflect.set(e,t,a,o)}}),dispose:()=>{e.removeEventListener(`timeupdate`,s),r&&clearTimeout(r),i&&clearTimeout(i)}}},pl=({remote:e,frame:t,capabilities:n,children:r})=>S(Xc,{remote:e,frame:t,adapter:fl,capabilities:n,children:r});D();var ml=[`netflix.com`,`www.netflix.com`,`nflxvideo.net`,`nflxso.net`,`nflxext.com`,`nflximg.net`,`assets.nflxext.com`],hl=`https://www.netflix.com/login`,gl=`
|
|
196
|
+
html, body {
|
|
197
|
+
margin: 0 !important;
|
|
198
|
+
padding: 0 !important;
|
|
199
|
+
width: 100% !important;
|
|
200
|
+
height: 100% !important;
|
|
201
|
+
overflow: hidden !important;
|
|
202
|
+
background: #000 !important;
|
|
203
|
+
}
|
|
204
|
+
/* Truly-unwanted chrome - collapse it entirely. */
|
|
205
|
+
.watch-video--evidence-overlay-container,
|
|
206
|
+
.watch-video--skip-content,
|
|
207
|
+
.watch-video--nextEpisode-seamless-button,
|
|
208
|
+
.watch-video--back-container,
|
|
209
|
+
[data-uia="player-back-to-browse"],
|
|
210
|
+
[data-uia="control-nav-back"],
|
|
211
|
+
[data-uia="control-flag"] {
|
|
212
|
+
display: none !important;
|
|
213
|
+
pointer-events: none !important;
|
|
214
|
+
}
|
|
215
|
+
/* Keep the controls bar in LAYOUT (so the seek adapter can locate + click the
|
|
216
|
+
[data-uia="timeline"] scrubber) but invisible and inert to real taps. NEVER
|
|
217
|
+
display:none here, or the scrubber loses its box and the seek no-ops - mirrors
|
|
218
|
+
Crunchyroll's opacity:0 timeline trick. The skin draws the visible controls. */
|
|
219
|
+
[data-uia="controls-standard"],
|
|
220
|
+
.watch-video--bottom-controls-container,
|
|
221
|
+
.PlayerControlsNeo__layout,
|
|
222
|
+
.PlayerControlsNeo__core-controls,
|
|
223
|
+
.PlayerControlsNeo__button-control-row {
|
|
224
|
+
opacity: 0 !important;
|
|
225
|
+
pointer-events: none !important;
|
|
226
|
+
}
|
|
227
|
+
[data-uia="timeline"],
|
|
228
|
+
[data-uia="timeline"] * {
|
|
229
|
+
pointer-events: auto !important;
|
|
230
|
+
}
|
|
231
|
+
.watch-video,
|
|
232
|
+
[data-uia="video-canvas"] {
|
|
233
|
+
position: fixed !important;
|
|
234
|
+
inset: 0 !important;
|
|
235
|
+
width: 100% !important;
|
|
236
|
+
height: 100% !important;
|
|
237
|
+
z-index: 9999999 !important;
|
|
238
|
+
}
|
|
239
|
+
.watch-video video,
|
|
240
|
+
[data-uia="video-canvas"] video {
|
|
241
|
+
width: 100% !important;
|
|
242
|
+
height: 100% !important;
|
|
243
|
+
object-fit: contain !important;
|
|
244
|
+
}
|
|
245
|
+
`,_l=async(e,t=10,n=500)=>{for(let r=0;r<t;r++)try{return await e()}catch(e){if(r===t-1||!(e instanceof Error)||!e.message.includes(`not registered`))throw e;await new Promise(e=>setTimeout(e,n))}throw Error(`unreachable`)},vl=async e=>{for(let t=0;t<50;t++){if(await e.locator(`[data-uia="header"] a[href*="/login"]`).exists())return!1;if(await e.locator(`.watch-video, [data-uia="video-canvas"]`).exists())return!0;await new Promise(e=>setTimeout(e,200))}return!1},yl=async(e,t)=>{for(;!t();){try{if(await e.locator(`video`).exists())return await e.locator(`video`).videoElement()}catch(e){if(e?.name===`LocatorUnsupportedError`)throw e}await new Promise(e=>setTimeout(e,200))}return null},bl=s`
|
|
246
|
+
position: relative;
|
|
247
|
+
width: 100%;
|
|
248
|
+
height: 100%;
|
|
249
|
+
background: #000;
|
|
250
|
+
user-select: none;
|
|
251
|
+
-webkit-user-select: none;
|
|
252
|
+
|
|
253
|
+
.nf-frame {
|
|
254
|
+
position: absolute;
|
|
255
|
+
inset: 0;
|
|
256
|
+
width: 100%;
|
|
257
|
+
height: 100%;
|
|
258
|
+
border: none;
|
|
259
|
+
background: #000;
|
|
260
|
+
/* Netflix's own chrome is hidden, so the iframe must not swallow taps -
|
|
261
|
+
they belong to the skin's gesture layer stacked above it. */
|
|
262
|
+
pointer-events: none;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.overlay {
|
|
266
|
+
position: absolute;
|
|
267
|
+
inset: 0;
|
|
268
|
+
display: flex;
|
|
269
|
+
flex-direction: column;
|
|
270
|
+
align-items: center;
|
|
271
|
+
justify-content: center;
|
|
272
|
+
gap: 1.6rem;
|
|
273
|
+
background: #000;
|
|
274
|
+
font-size: 1.4rem;
|
|
275
|
+
color: rgba(255, 255, 255, 0.8);
|
|
276
|
+
z-index: 30;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
.login-button {
|
|
280
|
+
padding: 0.8rem 2rem;
|
|
281
|
+
background: #e50914;
|
|
282
|
+
color: #fff;
|
|
283
|
+
border: none;
|
|
284
|
+
border-radius: 0.4rem;
|
|
285
|
+
font-size: 1.4rem;
|
|
286
|
+
font-weight: 600;
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
|
|
289
|
+
&:hover {
|
|
290
|
+
background: #c11119;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
`,xl={cr:qs,nf:({url:e})=>{let[t,n]=C(null),[r,i]=C(null),[a,o]=C(!0),[s,c]=C(!1),[l,u]=C(),[d,f]=C(null),[p,m]=C(0);y(()=>{if(!t)return;let e=!1;return(async()=>{for(let n=0;!e;n++)try{let n=await ae({iframe:t,domains:ml,cookies:`native`});if(e)return;i(n);return}catch(t){if(e)return;if(!N()){u(`Netflix playback currently needs the FKN browser extension.`),o(!1);return}if(n>=4){console.error(`Failed to attach Netflix frame`,t),u(t instanceof Error?t.message:`Failed to load player`),o(!1);return}await new Promise(e=>setTimeout(e,300*(n+1)))}})(),()=>{e=!0}},[t]),y(()=>{if(!r)return;let t=!1,n=()=>t;return o(!0),u(void 0),c(!1),f(null),(async()=>{if(await r.goto(e,{waitUntil:`load`}),await _l(()=>r.addStyleTag({content:gl})),t)return;o(!1);let i=await vl(r);if(t)return;if(!i){c(!0);return}let a=await yl(r,n);!t&&a&&f(a)})().catch(e=>{t||(console.error(`Failed to load Netflix player`,e),u(e?.message??`Failed to load player`),o(!1))}),()=>{t=!0}},[r,e,p]);let h=A(()=>{let e=globalThis.open(hl,`_blank`,`width=500,height=700`);if(!e)return;let t=setInterval(()=>{e.closed&&(clearInterval(t),m(e=>e+1))},500)},[]);return E(`div`,{css:bl,children:[S(pl,{remote:d,frame:r,children:S(`iframe`,{ref:n,className:`nf-frame`,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`})}),(s||l||a)&&E(`div`,{className:`overlay`,children:[s&&E(k,{children:[`Sign in to Netflix to watch.`,S(`button`,{className:`login-button`,onClick:h,children:`Open Netflix Login Page`})]}),l&&!s&&l,a&&!l&&!s&&`Loading Netflix player...`]})]})}},Sl=e=>xl[e];D();var Cl=new URLSearchParams(globalThis.location.search),wl=Cl.get(`mediaUri`),Tl=Cl.get(`episodeUri`),El=Cl.get(`sourceUri`),Dl=Cl.get(`url`),Ol=El?i(El).origin:void 0,kl=Ol?Sl(Ol):void 0;O(S(()=>{let[e,t]=C();return y(()=>o(t),[]),!wl||!Tl||!El||!Dl||!kl?S(`div`,{children:`Unsupported or missing parameters`}):S(kl,{url:Dl,mediaUri:wl,episodeUri:Tl,sourceUri:El,title:e})},{}),document.getElementById(`app`));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e=`stub:embed-tracks`,t=`stub:embed-tracks?`,n=`stub:embed-track-pick`,r=[`subtitles`,`audio`],i=(r,i,a=window)=>{let o=()=>a.parent.postMessage({type:e,tracks:r},a.location.origin),s=e=>{if(e.source!==a.parent||e.origin!==a.location.origin)return;let{type:r,kind:s,id:c}=e.data??{};r===t&&o(),r===n&&i(s,c)};return a.addEventListener(`message`,s),a.parent!==a&&o(),()=>a.removeEventListener(`message`,s)},a=(r,i=window)=>{let a=new Set,o,s=t=>{if(t.source!==r.contentWindow||t.origin!==i.location.origin)return;let{type:n,tracks:s}=t.data??{};if(n===e){o=s;for(let e of a)e(s)}},c=()=>r.contentWindow?.postMessage({type:t},i.location.origin);return i.addEventListener(`message`,s),r.addEventListener(`load`,c),{onTracks:e=>(a.add(e),o&&e(o),()=>{a.delete(e)}),select:(e,t)=>r.contentWindow?.postMessage({type:n,kind:e,id:t},i.location.origin),dispose:()=>{i.removeEventListener(`message`,s),r.removeEventListener(`load`,c)}}},o=e=>{let[t,n]=e.split(`:`);return{origin:t,id:n}},s=(e,t)=>{let n=e.split(`,`).filter(Boolean).map(e=>o(e));return t?n.find(({origin:e})=>e===t):n},c=({origin:e,id:t})=>`${e}:${t}`,l=e=>e.join(`,`),u=e=>{let t=e.split(`:`).filter(e=>e.length);if(t[1]?.includes(`,`))throw Error(`Invalid uri: ${e}, contains "," character in id`);return t.length===2},d=/[,/()]/,f=e=>{let t=e.indexOf(`:`);return t>0&&!d.test(e.slice(t+1))},p=e=>e.split(`,`).every(u),m=/ag:\((.*)\)(?:-(.*))?/,h=e=>{if(!e?.startsWith(`ag:`))return!1;let t=e.match(m);if(!t)return!1;let n=t?.[1];return!n||p(n)},g=e=>h(e)||!f(e)||!u(e)?e:y([e]),_=(e,t)=>{if(!e||!t||!h(e)||!h(t)||!S(e,t))return!1;let n=x(e)?.handleUris??[],r=x(t)?.handleUris??[];return n.length>r.length},v=e=>{if(!e||u(e)||h(e))return e;try{let t=decodeURIComponent(e);return u(t)||h(t)?t:e}catch{return e}},y=(e,t)=>`ag:(${b(e)})${t?`-${t}`:``}`,b=(e,t=!0)=>t?b(s(Array.isArray(e)?e.join(`,`):e).filter(e=>e.origin&&e.id).sort((e,t)=>e.id.localeCompare(t.id)).sort((e,t)=>e.origin.localeCompare(t.origin)).map(c),!1):encodeURI(Array.isArray(e)?e.join(`,`):e),x=e=>{if(typeof e!=`string`)return;let t=e.match(m);if(!t)return;let n=s(t[1]).filter(e=>e.origin&&e.id).sort((e,t)=>e.id.localeCompare(t.id)).sort((e,t)=>e.origin.localeCompare(t.origin));return t&&{uri:`ag:(${l(n.map(c))})`,origin:`ag`,id:`(${l(n.map(c))})`,handleUris:n.map(c),handleUrisString:l(n.map(c)),handleUrisValues:n,episodeId:t[2]}},S=(e,t)=>{let n=x(e),r=x(t);return!n||!r?!1:n.handleUris.some(e=>r.handleUris.some(t=>e===t))},C=`stub.player.volume`,w=()=>{try{let e=JSON.parse(globalThis.localStorage.getItem(`stub.player.volume`)??`null`);if(typeof e!=`object`||!e)return;let{volume:t,muted:n}=e;return typeof t==`number`&&t>=0&&t<=1&&typeof n==`boolean`?{volume:t,muted:n}:void 0}catch{return}},T=e=>{let t=w();t&&(e.volume=t.volume,e.muted=t.muted);let n=()=>{try{globalThis.localStorage.setItem(C,JSON.stringify({volume:e.volume,muted:e.muted}))}catch{}};return e.addEventListener(`volumechange`,n),()=>e.removeEventListener(`volumechange`,n)},E=[`www.crunchyroll.com`,`crunchyroll.com`,`sso.crunchyroll.com`,`static.crunchyroll.com`],D=`https://www.crunchyroll.com`,O=`noaihdevm_6iyg0a8l0q`,k=`https://sso.crunchyroll.com/authorize?${new URLSearchParams({client_id:O,redirect_uri:`${D}/callback`,response_type:`cookie`,state:`/`})}`,A=e=>e.locator(`#user-menu-authenticated`).exists(),j=`stub:embed-title`,M=`stub:embed-title?`,N=(e,t,n=window)=>{let r=()=>e.contentWindow?.postMessage({type:j,title:t},n.location.origin),i=t=>{t.source===e.contentWindow&&t.origin===n.location.origin&&t.data?.type===M&&r()};return n.addEventListener(`message`,i),r(),()=>n.removeEventListener(`message`,i)},P=(e,t=window)=>{let n=n=>{if(n.source!==t.parent||n.origin!==t.location.origin)return;let{type:r,title:i}=n.data??{};r===j&&typeof i==`string`&&e(i)};return t.addEventListener(`message`,n),t.parent!==t&&t.parent.postMessage({type:M},t.location.origin),()=>t.removeEventListener(`message`,n)};export{_,k as a,i as b,C as c,v as d,x as f,S as g,f as h,E as i,T as l,h as m,N as n,O as o,o as p,D as r,A as s,P as t,g as u,r as v,a as y};
|