@banou/stub 0.0.76 → 0.0.77
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/build/assets/{lib-base-text-vWGknURI.js → lib-base-text-C6BzXM2b.js} +1 -1
- package/build/assets/{lib-embed-C0QujlS6.js → lib-embed-Dh6Z0XhB.js} +1 -1
- package/build/assets/{lib-track-languages-ByAqcXWu.js → lib-track-languages-DeHLRrle.js} +1 -1
- package/build/assets/lib-worker-CqAJnBdc.js +1 -0
- package/build/assets/{lib-worker-anime-seasons-Zy6h3WN9.js → lib-worker-anime-seasons-C_n7DL9Z.js} +1 -1
- package/build/assets/{lib-worker-DrqmLeqh.js → lib-worker-clAamwWR.js} +1 -1
- package/build/assets/{lib-worker-index-D8IJrpJw.js → lib-worker-index-C8M1Omyu.js} +1 -1
- package/build/embed.html +4 -4
- package/build/index.html +3 -3
- package/build/index.js +4 -4
- package/fkn.json +1 -1
- package/package.json +1 -1
- package/build/assets/lib-worker-VWiCgR5H.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as e,K as t,P as n,Z as r,a as i,bt as a,c as o,ft as s,i as c,m as l,n as u,o as d,q as f,s as p,t as m,tt as h}from"./lib-track-languages-ByAqcXWu.js";import{M as g,f as _,j as v}from"./lib-intl-_4f6zNc2.js";import{V as y,W as ee,ft as b,ht as te,pt as x,r as S,ut as C}from"./lib-chapters-EBYXcEml-0fd33E6j.js";var ne={type:`conjunction`,style:`narrow`},re=_(),w=e=>e.flatMap(e=>e.type===v.argument?[{type:v.literal,value:``},e,{type:v.literal,value:``}]:e.type===v.tag?[{...e,children:w(e.children)}]:e.type===v.select||e.type===v.plural?[{...e,options:Object.fromEntries(Object.entries(e.options).map(([e,t])=>[e,{...t,value:w(t.value)}]))}]:[e]),ie=(e,t=` · `)=>{let n=e.filter(e=>!!e);return(f(E.locale)?n.map(e=>`\u2068${e}\u2069`):n).join(t)},ae=e=>{try{return w(g(e))}catch{return e}},T=(e,t,n)=>ee({locale:t,defaultLocale:e===`en`?t:`en`,messages:n},re),E=T(`en`,`en`,{}),D=e=>typeof e==`object`?`time`in e?E.formatTime(e.time,{hour:`2-digit`,minute:`2-digit`}):`list`in e?E.formatList(e.list.map(e=>String(D(e))),e.join===`and`?{type:`conjunction`}:ne):oe(e):e,oe=e=>{if(typeof e==`string`)return e;let t={id:e.message,defaultMessage:e.message};return E.formatMessage(t,e.values&&Object.fromEntries(Object.entries(e.values).map(([e,t])=>[e,D(t)])))},se=/* #__PURE__ */ Object.assign({"../locales/ar.json":()=>import(`./lib-ar-Cwy9NiHO.js`).then(e=>e.default),"../locales/cs.json":()=>import(`./lib-cs-CUZeWKHy.js`).then(e=>e.default),"../locales/de.json":()=>import(`./lib-de-DgNq83sj.js`).then(e=>e.default),"../locales/el.json":()=>import(`./lib-el-OgRN_TgV.js`).then(e=>e.default),"../locales/es-419.json":()=>import(`./lib-es-419-MxnMkr2z.js`).then(e=>e.default),"../locales/fr.json":()=>import(`./lib-fr-B4ITUNww.js`).then(e=>e.default),"../locales/he.json":()=>import(`./lib-he-QYAs3ljT.js`).then(e=>e.default),"../locales/hi.json":()=>import(`./lib-hi-BPDEVviM.js`).then(e=>e.default),"../locales/hu.json":()=>import(`./lib-hu-Sw_z65K9.js`).then(e=>e.default),"../locales/id.json":()=>import(`./lib-id-C3FcBMrL.js`).then(e=>e.default),"../locales/it.json":()=>import(`./lib-it-CC9RTs_v.js`).then(e=>e.default),"../locales/ja.json":()=>import(`./lib-ja-DDjsSpuP.js`).then(e=>e.default),"../locales/ko.json":()=>import(`./lib-ko-D-gLcGv1.js`).then(e=>e.default),"../locales/ms.json":()=>import(`./lib-ms-V3vyCfTV.js`).then(e=>e.default),"../locales/nl.json":()=>import(`./lib-nl-QqOBdm5S.js`).then(e=>e.default),"../locales/pl.json":()=>import(`./lib-pl-BBi7Fvwx.js`).then(e=>e.default),"../locales/pt-BR.json":()=>import(`./lib-pt-BR-C93RFgi6.js`).then(e=>e.default),"../locales/ro.json":()=>import(`./lib-ro-CNx42RTt.js`).then(e=>e.default),"../locales/ru.json":()=>import(`./lib-ru-CmElTAZx.js`).then(e=>e.default),"../locales/sv.json":()=>import(`./lib-sv-W3ShlW9D.js`).then(e=>e.default),"../locales/th.json":()=>import(`./lib-th-DdipOQwU.js`).then(e=>e.default),"../locales/tr.json":()=>import(`./lib-tr-D7RPpAOU.js`).then(e=>e.default),"../locales/uk.json":()=>import(`./lib-uk-D9v4eARO.js`).then(e=>e.default),"../locales/vi.json":()=>import(`./lib-vi-BSgkjJn0.js`).then(e=>e.default),"../locales/zh-Hans.json":()=>import(`./lib-zh-Hans-Cvii7o2Q.js`).then(e=>e.default),"../locales/zh-Hant.json":()=>import(`./lib-zh-Hant-cayi0jcS.js`).then(e=>e.default)}),ce=async({language:e=r(),languages:n,catalogues:i=se,html:a=globalThis.document?.documentElement}={})=>{let o=e===`en`?{}:await i[`../locales/${e}.json`]?.().catch(()=>void 0),s=o?e:`en`,c=o&&f(s)?Object.fromEntries(Object.entries(o).map(([e,t])=>[e,ae(t)])):o??{};return E=T(s,t(s,n),c),a&&(a.lang=s,f(s)?a.dir=`rtl`:a.removeAttribute(`dir`)),E},le=e=>{let t=e[0];for(let n of e)t&&n.id.startsWith(`${t.id}-`)&&(t=n);return t},ue=(e,t)=>P(e)?le(z(e)?.handleUrisValues.filter(e=>e.origin===t)??[]):j(e)&&O(e).origin===t?O(e):void 0,O=e=>{let[t,n]=e.split(`:`);return{origin:t,id:n}},de=(e,t)=>{let n=e.split(`,`).filter(Boolean).map(e=>O(e));return t?n.find(({origin:e})=>e===t):n},k=({origin:e,id:t})=>`${e}:${t}`,A=e=>e.join(`,`),j=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},fe=/[,/()]/,M=e=>{let t=e.indexOf(`:`);return t>0&&!fe.test(e.slice(t+1))},pe=e=>e.split(`,`).every(j),N=/ag:\((.*)\)(?:-(.*))?/,P=e=>{if(!e?.startsWith(`ag:`))return!1;let t=e.match(N);if(!t)return!1;let n=t?.[1];return!n||pe(n)},F=e=>P(e)||!M(e)||!j(e)?e:L([e]),me=(e,t,n)=>{if(!e||!t||e===t||!P(e)||!P(t)||!B(e,t))return!1;if(t===n)return!0;let r=z(e)?.handleUris??[],i=z(t)?.handleUris??[];return r.length>i.length},I=e=>{if(!e||j(e)||P(e))return e;try{let t=decodeURIComponent(e);return j(t)||P(t)?t:e}catch{return e}},he=e=>{let t=I(e);return t&&F(t)},L=(e,t)=>`ag:(${R(e)})${t?`-${t}`:``}`,R=(e,t=!0)=>t?R(de(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(k),!1):encodeURI(Array.isArray(e)?e.join(`,`):e),z=e=>{if(typeof e!=`string`)return;let t=e.match(N);if(!t)return;let n=de(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:(${A(n.map(k))})`,origin:`ag`,id:`(${A(n.map(k))})`,handleUris:n.map(k),handleUrisString:A(n.map(k)),handleUrisValues:n,episodeId:t[2]}},ge=e=>P(e)?[...new Set(z(e)?.handleUrisValues.map(e=>e.origin)??[])]:j(e)?[O(e).origin]:[],B=(e,t)=>{let n=z(e),r=z(t);return!n||!r?!1:n.handleUris.some(e=>r.handleUris.some(t=>e===t))};x();var V=`stub.player.autoplay`,_e=()=>h.getItem(V)!==`off`,H=e=>{try{e?h.removeItem(V):h.setItem(V,`off`)}catch{}},ve=e=>h.watch(V,e),U=(e,...t)=>{e.postMessage(...t)},W=`stub:embed-tracks`,G=`stub:embed-tracks?`,K=`stub:embed-track-pick`,ye=[`subtitles`,`audio`],be=(e,t,n=window)=>{let r=()=>U(n.parent,{type:W,tracks:e},n.location.origin),i=e=>{if(e.source!==n.parent||e.origin!==n.location.origin)return;let{type:i,kind:a,id:o}=e.data??{};i===G&&r(),i===K&&t(a,o)};return n.addEventListener(`message`,i),n.parent!==n&&r(),()=>n.removeEventListener(`message`,i)},xe=(e,t=window)=>{let n=/* @__PURE__ */ new Set,r,i=i=>{if(i.source!==e.contentWindow||i.origin!==t.location.origin)return;let{type:a,tracks:o}=i.data??{};if(a===W){r=o;for(let e of n)e(o)}},a=n=>{e.contentWindow&&U(e.contentWindow,n,t.location.origin)},o=()=>a({type:G});return t.addEventListener(`message`,i),e.addEventListener(`load`,o),{onTracks:e=>(n.add(e),r&&e(r),()=>{n.delete(e)}),select:(e,t)=>a({type:K,kind:e,id:t}),dispose:()=>{t.removeEventListener(`message`,i),e.removeEventListener(`load`,o)}}},Se=(e,t)=>{let[n,r]=b(e);return C(()=>(r(e()),t(()=>r(e()))),[]),n},Ce=[`amazon.co.jp`,`www.amazon.co.jp`,`watch.amazon.co.jp`,`amazon.com`,`www.amazon.com`,`watch.amazon.com`,`amazon.co.uk`,`www.amazon.co.uk`,`watch.amazon.co.uk`,`amazon.de`,`www.amazon.de`,`watch.amazon.de`,`primevideo.com`,`www.primevideo.com`,`app.primevideo.com`,`media-amazon.com`,`ssl-images-amazon.com`,`aiv-cdn.net`,`pv-cdn.net`,`aiv-delivery.net`,`a2z.com`,`prime-video.amazon.dev`],we={US:`amazon.com`,PR:`amazon.com`,GU:`amazon.com`,VI:`amazon.com`,AS:`amazon.com`,MP:`amazon.com`,UM:`amazon.com`,GB:`amazon.co.uk`,DE:`amazon.de`,AT:`amazon.de`,JP:`amazon.co.jp`},Te=e=>we[e]??`primevideo.com`,Ee=e=>URL.parse(e)?.hostname.replace(/^(www|watch|app)\./,``),De=e=>Ee(e)===Te(l()),Oe=e=>e===`amazon.co.jp`,ke=`https://www.amazon.co.jp/ap/signin?${new URLSearchParams({"openid.return_to":`https://www.amazon.co.jp/gp/video/storefront`,"openid.identity":`http://specs.openid.net/auth/2.0/identifier_select`,"openid.assoc_handle":`jpflex`,"openid.mode":`checkid_setup`,"openid.claimed_id":`http://specs.openid.net/auth/2.0/identifier_select`,"openid.ns":`http://specs.openid.net/auth/2.0`})}`,Ae=e=>e===`amazon.co.jp`?ke:e===`primevideo.com`?`https://www.primevideo.com/auth-redirect?signin=1&returnUrl=%2Fstorefront`:`https://www.${e}/gp/video/auth-redirect?signin=1&returnUrl=%2Fgp%2Fvideo%2Fstorefront`,je=`a[data-csa-c-content-id="nav_ya_signin"], [data-testid="pv-nav-sign-in"]`,Me=async e=>await e.locator(`#nav-link-accountList, #pv-footer`).exists()&&!await e.locator(`a[data-csa-c-content-id="nav_ya_signin"], [data-testid="pv-nav-sign-in"]`).exists(),q=1,Ne=6e3,Pe=1,J=10,Fe=120,Ie=e=>e.title===`Preview`,Y=e=>e!==void 0&&Number.isFinite(e)&&e>0,Le=(e,t)=>{let n=e[S(e).lastIndexOf(`ending`)];return n&&{ending:n,after:t-n.end}},Re=e=>S(e).includes(`ending`),ze=e=>Y(e)&&e>=60?e-30:void 0,Be=(e,t)=>{if(!Y(t))return;let n=Le(e,t);if(n&&n.after<J)return n.ending.start-q;if(n&&n.after<=Fe)return n.ending.end-q;let r=e.findLast(e=>Ie(e)&&t-e.end<J);return r&&r.start-q},Ve=(e,t)=>{let n=Y(t)?Le(e,t):void 0;return n&&n.after<J?e.filter(e=>e!==n.ending):e},He=e=>{let t,n,r=0,i=()=>clearTimeout(t),a=(o,{paused:s,time:c,rate:l,at:u},d)=>{i();let f=S(o),p=o.filter((e,t)=>f[t]),m=p.find(({start:e,end:t})=>e-q<=c&&c<t);(m?m.end!==n?.end||!d&&c<r-Pe:!d)&&(n=m&&{end:m.end,at:u}),d||(r=c);let h=!s&&l>0,g=m&&n?Math.min(n.at+Ne-u,h?(m.end-c)/l*1e3:1/0):0;e(g>0);let _=h?p.find(({start:e})=>e-q>c):void 0,v=g>0?g:_&&(_.start-q-c)/l*1e3;if(v===void 0)return;let y=Math.ceil(v);t=setTimeout(()=>a(o,{paused:s,rate:l,time:h?c+y/1e3*l:c,at:u+y},!0),y)};return{hear:(e,t)=>a(e,t,!1),stop:i}};x();var Ue=e=>`https://static.crunchyroll.com/skip-events/production/${e}.json`,X=e=>{try{return new URL(e).pathname.match(/\/watch\/([A-Z0-9]+)(?:\/|$)/)?.[1]}catch{return}},We=[[`intro`,`Opening`],[`recap`,`Recap`],[`credits`,`Ending`],[`preview`,`Preview`]],Ge=`Episode`,Ke=e=>typeof e==`object`&&!!e&&!Array.isArray(e),qe=(e,t)=>{if(!Ke(e))return[];let n=t!==void 0&&Number.isFinite(t)&&t>0?t:1/0,r=We.flatMap(([t,r])=>{let i=e[t];if(!Ke(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:Ge}),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:Ge}),i},Je=/* @__PURE__ */ new Set([403,404]),Ye=async(t,n=e)=>{let r=await n(Ue(t));if(!r.ok){if(await r.body?.cancel().catch(()=>{}),Je.has(r.status))return{};throw Error(`${Ue(t)} answered ${r.status}`)}return r.json()},Xe=e=>{let[t,n]=b();return C(()=>{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},Ze=[],Qe=e=>{let[t,n]=b();return C(()=>{if(!e)return;let t=!1;return Ye(e).then(r=>{t||n({episodeId:e,events:r})},e=>{t||console.warn(`[cr] skip events unavailable:`,e)}),()=>{t=!0}},[e]),e&&t?.episodeId===e?t.events:void 0},$e=(e,t)=>{let n=Qe(X(e)),r=Xe(t);return te(()=>{let e=Ve(qe(n,r),r);return e.length?e:Ze},[n,r])};x();var et=`stub:embed-fullscreen`,tt=`stub:embed-fullscreen?`,nt=`stub:embed-fullscreen-request`,rt=(e,t,n,r)=>{let i=i=>{let a=i.target;i.key!==`f`||i.repeat||i.ctrlKey||i.metaKey||i.altKey||a?.isContentEditable||/^(input|textarea|select)$/i.test(a?.tagName??``)||(e.fullscreenElement?e.exitFullscreen().catch(()=>{}):(n?.blur(),n?.focus(),t.requestFullscreen().then(r,()=>{})))};return e.addEventListener(`keydown`,i),()=>e.removeEventListener(`keydown`,i)},it=(e,t,n=window)=>{let{document:r}=n;if(!r.fullscreenEnabled)return()=>{};let i=rt(r,t,e),a=()=>{e.contentWindow&&U(e.contentWindow,{type:et,active:!!r.fullscreenElement},n.location.origin)},o=i=>{if(i.source!==e.contentWindow||i.origin!==n.location.origin)return;let o=i.data?.type;o===tt?a():o===nt&&(r.fullscreenElement?r.exitFullscreen():t.requestFullscreen()).catch(()=>{})};return n.addEventListener(`message`,o),r.addEventListener(`fullscreenchange`,a),a(),()=>{i(),n.removeEventListener(`message`,o),r.removeEventListener(`fullscreenchange`,a)}},at=(e,t=window)=>{let n=()=>U(t.parent,{type:nt},t.location.origin),r=r=>{if(r.source!==t.parent||r.origin!==t.location.origin)return;let{type:i,active:a}=r.data??{};i===et&&typeof a==`boolean`&&e({active:a,request:n})};return t.addEventListener(`message`,r),t.parent!==t&&U(t.parent,{type:tt},t.location.origin),()=>t.removeEventListener(`message`,r)},ot=()=>{let[e,t]=b();return C(()=>at(t),[]),e},Z=`stub:embed-language-picked`,st=()=>Object.fromEntries([u,c,m].flatMap(e=>{let t=h.getItem(e);return t===null?[]:[[e,t]]})),ct=e=>o(t=>e.get(t)),lt=(e,t=window)=>{let n=n=>{if(n.source!==e.contentWindow||n.origin!==t.location.origin)return;let{type:r,kind:a,language:o,on:s}=n.data??{};r===Z&&(a===`audio`&&typeof o==`string`&&d(o),a===`subtitles`&&(typeof o==`string`||o===null)&&p(o),a===`always-subtitles`&&typeof s==`boolean`&&i(s),a===`autoplay`&&typeof s==`boolean`&&H(s))};return t.addEventListener(`message`,n),()=>t.removeEventListener(`message`,n)},ut=(e,t,n=window)=>{n.parent!==n&&U(n.parent,{type:Z,kind:e,language:t},n.location.origin)},dt=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Z,kind:`always-subtitles`,on:e},t.location.origin)},ft=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Z,kind:`autoplay`,on:e},t.location.origin)},Q=`stub:embed-relay-tried`,pt=`triedRelays`,$=/* @__PURE__ */ new Map,mt=e=>e.split(`-`)[0],ht=e=>{let t=$.get(mt(e));return t?.length?{[pt]:t.join(`,`)}:{}},gt=e=>e.get(pt)?.split(`,`).filter(Boolean)??[],_t=(e,t,n=window)=>{let r=r=>{if(r.source!==e.contentWindow||r.origin!==n.location.origin)return;let{type:i,relay:a}=r.data??{};if(i!==Q||typeof a!=`string`)return;let o=mt(t),s=$.get(o)??[];s.includes(a)||$.set(o,[...s,a])};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)},vt=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Q,relay:e},t.location.origin)},yt=`stub:embed-unplayable`,bt=(e,t,n=window)=>{let r=r=>{r.source===e.contentWindow&&r.origin===n.location.origin&&r.data?.type===yt&&t()};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)},xt=(e=window)=>{e.parent!==e&&U(e.parent,{type:yt},e.location.origin)},St=`stub:embed-title`,Ct=`stub:embed-title?`,wt=(e,t,n=window)=>{let r=()=>{e.contentWindow&&U(e.contentWindow,{type:St,title:t},n.location.origin)},i=t=>{t.source===e.contentWindow&&t.origin===n.location.origin&&t.data?.type===Ct&&r()};return n.addEventListener(`message`,i),r(),()=>n.removeEventListener(`message`,i)},Tt=(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===St&&typeof i==`string`&&e(i)};return t.addEventListener(`message`,n),t.parent!==t&&U(t.parent,{type:Ct},t.location.origin),()=>t.removeEventListener(`message`,n)},Et=5e3,Dt=async(e,t)=>{let r=await s.fetch(`${n}/auth/v1/token`,{method:`POST`,headers:{authorization:`Basic ${btoa(`cr_web:`)}`,"content-type":`application/x-www-form-urlencoded`},body:`grant_type=client_id&device_id=${crypto.randomUUID()}`,relay:t}),i=a(r),{access_token:o}=await r.json();if(!i||!o)throw Error(`Crunchyroll token through ${i}: ${r.status}`);let c=await s.fetch(`${n}/content/v2/cms/objects/${e}?ratings=true&locale=en-US`,{headers:{authorization:`Bearer ${o}`},relay:{id:i}});if(!c.ok&&c.status!==404)throw Error(`Crunchyroll episode through ${i}: ${c.status}`);return{relay:i,episode:c}},Ot=async(e,t)=>{let{relay:n,episode:r}=await Dt(e,t);return{relay:n,listed:r.ok}},kt=async e=>{let t=X(e);if(!t)return;let{episode:n}=await Dt(t,{});if(!n.ok)return;let{data:r}=await n.json(),i=r?.[0]?.episode_metadata?.duration_ms;return typeof i==`number`&&Number.isFinite(i)&&i>0?i/1e3:void 0},At=async(e,t)=>{let n=X(e);if(!n)return[];let r=async()=>{let e=[];for(;;){let{relay:r,listed:i}=await Ot(n,{exclude:[...t,...e]});if(i)return e;if(t.includes(r)||e.includes(r))return[];e.push(r)}},i,a=new Promise(e=>{i=setTimeout(e,Et,[])});return Promise.race([r().catch(()=>[]),a]).finally(()=>clearTimeout(i))},jt=y`
|
|
1
|
+
import{B as e,K as t,P as n,Z as r,a as i,bt as a,c as o,ft as s,i as c,m as l,n as u,o as d,q as f,s as p,t as m,tt as h}from"./lib-track-languages-DeHLRrle.js";import{M as g,f as _,j as v}from"./lib-intl-_4f6zNc2.js";import{V as y,W as ee,ft as b,ht as te,pt as x,r as S,ut as C}from"./lib-chapters-EBYXcEml-0fd33E6j.js";var ne={type:`conjunction`,style:`narrow`},re=_(),w=e=>e.flatMap(e=>e.type===v.argument?[{type:v.literal,value:``},e,{type:v.literal,value:``}]:e.type===v.tag?[{...e,children:w(e.children)}]:e.type===v.select||e.type===v.plural?[{...e,options:Object.fromEntries(Object.entries(e.options).map(([e,t])=>[e,{...t,value:w(t.value)}]))}]:[e]),ie=(e,t=` · `)=>{let n=e.filter(e=>!!e);return(f(E.locale)?n.map(e=>`\u2068${e}\u2069`):n).join(t)},ae=e=>{try{return w(g(e))}catch{return e}},T=(e,t,n)=>ee({locale:t,defaultLocale:e===`en`?t:`en`,messages:n},re),E=T(`en`,`en`,{}),D=e=>typeof e==`object`?`time`in e?E.formatTime(e.time,{hour:`2-digit`,minute:`2-digit`}):`list`in e?E.formatList(e.list.map(e=>String(D(e))),e.join===`and`?{type:`conjunction`}:ne):oe(e):e,oe=e=>{if(typeof e==`string`)return e;let t={id:e.message,defaultMessage:e.message};return E.formatMessage(t,e.values&&Object.fromEntries(Object.entries(e.values).map(([e,t])=>[e,D(t)])))},se=/* #__PURE__ */ Object.assign({"../locales/ar.json":()=>import(`./lib-ar-Cwy9NiHO.js`).then(e=>e.default),"../locales/cs.json":()=>import(`./lib-cs-CUZeWKHy.js`).then(e=>e.default),"../locales/de.json":()=>import(`./lib-de-DgNq83sj.js`).then(e=>e.default),"../locales/el.json":()=>import(`./lib-el-OgRN_TgV.js`).then(e=>e.default),"../locales/es-419.json":()=>import(`./lib-es-419-MxnMkr2z.js`).then(e=>e.default),"../locales/fr.json":()=>import(`./lib-fr-B4ITUNww.js`).then(e=>e.default),"../locales/he.json":()=>import(`./lib-he-QYAs3ljT.js`).then(e=>e.default),"../locales/hi.json":()=>import(`./lib-hi-BPDEVviM.js`).then(e=>e.default),"../locales/hu.json":()=>import(`./lib-hu-Sw_z65K9.js`).then(e=>e.default),"../locales/id.json":()=>import(`./lib-id-C3FcBMrL.js`).then(e=>e.default),"../locales/it.json":()=>import(`./lib-it-CC9RTs_v.js`).then(e=>e.default),"../locales/ja.json":()=>import(`./lib-ja-DDjsSpuP.js`).then(e=>e.default),"../locales/ko.json":()=>import(`./lib-ko-D-gLcGv1.js`).then(e=>e.default),"../locales/ms.json":()=>import(`./lib-ms-V3vyCfTV.js`).then(e=>e.default),"../locales/nl.json":()=>import(`./lib-nl-QqOBdm5S.js`).then(e=>e.default),"../locales/pl.json":()=>import(`./lib-pl-BBi7Fvwx.js`).then(e=>e.default),"../locales/pt-BR.json":()=>import(`./lib-pt-BR-C93RFgi6.js`).then(e=>e.default),"../locales/ro.json":()=>import(`./lib-ro-CNx42RTt.js`).then(e=>e.default),"../locales/ru.json":()=>import(`./lib-ru-CmElTAZx.js`).then(e=>e.default),"../locales/sv.json":()=>import(`./lib-sv-W3ShlW9D.js`).then(e=>e.default),"../locales/th.json":()=>import(`./lib-th-DdipOQwU.js`).then(e=>e.default),"../locales/tr.json":()=>import(`./lib-tr-D7RPpAOU.js`).then(e=>e.default),"../locales/uk.json":()=>import(`./lib-uk-D9v4eARO.js`).then(e=>e.default),"../locales/vi.json":()=>import(`./lib-vi-BSgkjJn0.js`).then(e=>e.default),"../locales/zh-Hans.json":()=>import(`./lib-zh-Hans-Cvii7o2Q.js`).then(e=>e.default),"../locales/zh-Hant.json":()=>import(`./lib-zh-Hant-cayi0jcS.js`).then(e=>e.default)}),ce=async({language:e=r(),languages:n,catalogues:i=se,html:a=globalThis.document?.documentElement}={})=>{let o=e===`en`?{}:await i[`../locales/${e}.json`]?.().catch(()=>void 0),s=o?e:`en`,c=o&&f(s)?Object.fromEntries(Object.entries(o).map(([e,t])=>[e,ae(t)])):o??{};return E=T(s,t(s,n),c),a&&(a.lang=s,f(s)?a.dir=`rtl`:a.removeAttribute(`dir`)),E},le=e=>{let t=e[0];for(let n of e)t&&n.id.startsWith(`${t.id}-`)&&(t=n);return t},ue=(e,t)=>P(e)?le(z(e)?.handleUrisValues.filter(e=>e.origin===t)??[]):j(e)&&O(e).origin===t?O(e):void 0,O=e=>{let[t,n]=e.split(`:`);return{origin:t,id:n}},de=(e,t)=>{let n=e.split(`,`).filter(Boolean).map(e=>O(e));return t?n.find(({origin:e})=>e===t):n},k=({origin:e,id:t})=>`${e}:${t}`,A=e=>e.join(`,`),j=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},fe=/[,/()]/,M=e=>{let t=e.indexOf(`:`);return t>0&&!fe.test(e.slice(t+1))},pe=e=>e.split(`,`).every(j),N=/ag:\((.*)\)(?:-(.*))?/,P=e=>{if(!e?.startsWith(`ag:`))return!1;let t=e.match(N);if(!t)return!1;let n=t?.[1];return!n||pe(n)},F=e=>P(e)||!M(e)||!j(e)?e:L([e]),me=(e,t,n)=>{if(!e||!t||e===t||!P(e)||!P(t)||!B(e,t))return!1;if(t===n)return!0;let r=z(e)?.handleUris??[],i=z(t)?.handleUris??[];return r.length>i.length},I=e=>{if(!e||j(e)||P(e))return e;try{let t=decodeURIComponent(e);return j(t)||P(t)?t:e}catch{return e}},he=e=>{let t=I(e);return t&&F(t)},L=(e,t)=>`ag:(${R(e)})${t?`-${t}`:``}`,R=(e,t=!0)=>t?R(de(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(k),!1):encodeURI(Array.isArray(e)?e.join(`,`):e),z=e=>{if(typeof e!=`string`)return;let t=e.match(N);if(!t)return;let n=de(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:(${A(n.map(k))})`,origin:`ag`,id:`(${A(n.map(k))})`,handleUris:n.map(k),handleUrisString:A(n.map(k)),handleUrisValues:n,episodeId:t[2]}},ge=e=>P(e)?[...new Set(z(e)?.handleUrisValues.map(e=>e.origin)??[])]:j(e)?[O(e).origin]:[],B=(e,t)=>{let n=z(e),r=z(t);return!n||!r?!1:n.handleUris.some(e=>r.handleUris.some(t=>e===t))};x();var V=`stub.player.autoplay`,_e=()=>h.getItem(V)!==`off`,H=e=>{try{e?h.removeItem(V):h.setItem(V,`off`)}catch{}},ve=e=>h.watch(V,e),U=(e,...t)=>{e.postMessage(...t)},W=`stub:embed-tracks`,G=`stub:embed-tracks?`,K=`stub:embed-track-pick`,ye=[`subtitles`,`audio`],be=(e,t,n=window)=>{let r=()=>U(n.parent,{type:W,tracks:e},n.location.origin),i=e=>{if(e.source!==n.parent||e.origin!==n.location.origin)return;let{type:i,kind:a,id:o}=e.data??{};i===G&&r(),i===K&&t(a,o)};return n.addEventListener(`message`,i),n.parent!==n&&r(),()=>n.removeEventListener(`message`,i)},xe=(e,t=window)=>{let n=/* @__PURE__ */ new Set,r,i=i=>{if(i.source!==e.contentWindow||i.origin!==t.location.origin)return;let{type:a,tracks:o}=i.data??{};if(a===W){r=o;for(let e of n)e(o)}},a=n=>{e.contentWindow&&U(e.contentWindow,n,t.location.origin)},o=()=>a({type:G});return t.addEventListener(`message`,i),e.addEventListener(`load`,o),{onTracks:e=>(n.add(e),r&&e(r),()=>{n.delete(e)}),select:(e,t)=>a({type:K,kind:e,id:t}),dispose:()=>{t.removeEventListener(`message`,i),e.removeEventListener(`load`,o)}}},Se=(e,t)=>{let[n,r]=b(e);return C(()=>(r(e()),t(()=>r(e()))),[]),n},Ce=[`amazon.co.jp`,`www.amazon.co.jp`,`watch.amazon.co.jp`,`amazon.com`,`www.amazon.com`,`watch.amazon.com`,`amazon.co.uk`,`www.amazon.co.uk`,`watch.amazon.co.uk`,`amazon.de`,`www.amazon.de`,`watch.amazon.de`,`primevideo.com`,`www.primevideo.com`,`app.primevideo.com`,`media-amazon.com`,`ssl-images-amazon.com`,`aiv-cdn.net`,`pv-cdn.net`,`aiv-delivery.net`,`a2z.com`,`prime-video.amazon.dev`],we={US:`amazon.com`,PR:`amazon.com`,GU:`amazon.com`,VI:`amazon.com`,AS:`amazon.com`,MP:`amazon.com`,UM:`amazon.com`,GB:`amazon.co.uk`,DE:`amazon.de`,AT:`amazon.de`,JP:`amazon.co.jp`},Te=e=>we[e]??`primevideo.com`,Ee=e=>URL.parse(e)?.hostname.replace(/^(www|watch|app)\./,``),De=e=>Ee(e)===Te(l()),Oe=e=>e===`amazon.co.jp`,ke=`https://www.amazon.co.jp/ap/signin?${new URLSearchParams({"openid.return_to":`https://www.amazon.co.jp/gp/video/storefront`,"openid.identity":`http://specs.openid.net/auth/2.0/identifier_select`,"openid.assoc_handle":`jpflex`,"openid.mode":`checkid_setup`,"openid.claimed_id":`http://specs.openid.net/auth/2.0/identifier_select`,"openid.ns":`http://specs.openid.net/auth/2.0`})}`,Ae=e=>e===`amazon.co.jp`?ke:e===`primevideo.com`?`https://www.primevideo.com/auth-redirect?signin=1&returnUrl=%2Fstorefront`:`https://www.${e}/gp/video/auth-redirect?signin=1&returnUrl=%2Fgp%2Fvideo%2Fstorefront`,je=`a[data-csa-c-content-id="nav_ya_signin"], [data-testid="pv-nav-sign-in"]`,Me=async e=>await e.locator(`#nav-link-accountList, #pv-footer`).exists()&&!await e.locator(`a[data-csa-c-content-id="nav_ya_signin"], [data-testid="pv-nav-sign-in"]`).exists(),q=1,Ne=6e3,Pe=1,J=10,Fe=120,Ie=e=>e.title===`Preview`,Y=e=>e!==void 0&&Number.isFinite(e)&&e>0,Le=(e,t)=>{let n=e[S(e).lastIndexOf(`ending`)];return n&&{ending:n,after:t-n.end}},Re=e=>S(e).includes(`ending`),ze=e=>Y(e)&&e>=60?e-30:void 0,Be=(e,t)=>{if(!Y(t))return;let n=Le(e,t);if(n&&n.after<J)return n.ending.start-q;if(n&&n.after<=Fe)return n.ending.end-q;let r=e.findLast(e=>Ie(e)&&t-e.end<J);return r&&r.start-q},Ve=(e,t)=>{let n=Y(t)?Le(e,t):void 0;return n&&n.after<J?e.filter(e=>e!==n.ending):e},He=e=>{let t,n,r=0,i=()=>clearTimeout(t),a=(o,{paused:s,time:c,rate:l,at:u},d)=>{i();let f=S(o),p=o.filter((e,t)=>f[t]),m=p.find(({start:e,end:t})=>e-q<=c&&c<t);(m?m.end!==n?.end||!d&&c<r-Pe:!d)&&(n=m&&{end:m.end,at:u}),d||(r=c);let h=!s&&l>0,g=m&&n?Math.min(n.at+Ne-u,h?(m.end-c)/l*1e3:1/0):0;e(g>0);let _=h?p.find(({start:e})=>e-q>c):void 0,v=g>0?g:_&&(_.start-q-c)/l*1e3;if(v===void 0)return;let y=Math.ceil(v);t=setTimeout(()=>a(o,{paused:s,rate:l,time:h?c+y/1e3*l:c,at:u+y},!0),y)};return{hear:(e,t)=>a(e,t,!1),stop:i}};x();var Ue=e=>`https://static.crunchyroll.com/skip-events/production/${e}.json`,X=e=>{try{return new URL(e).pathname.match(/\/watch\/([A-Z0-9]+)(?:\/|$)/)?.[1]}catch{return}},We=[[`intro`,`Opening`],[`recap`,`Recap`],[`credits`,`Ending`],[`preview`,`Preview`]],Ge=`Episode`,Ke=e=>typeof e==`object`&&!!e&&!Array.isArray(e),qe=(e,t)=>{if(!Ke(e))return[];let n=t!==void 0&&Number.isFinite(t)&&t>0?t:1/0,r=We.flatMap(([t,r])=>{let i=e[t];if(!Ke(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:Ge}),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:Ge}),i},Je=/* @__PURE__ */ new Set([403,404]),Ye=async(t,n=e)=>{let r=await n(Ue(t));if(!r.ok){if(await r.body?.cancel().catch(()=>{}),Je.has(r.status))return{};throw Error(`${Ue(t)} answered ${r.status}`)}return r.json()},Xe=e=>{let[t,n]=b();return C(()=>{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},Ze=[],Qe=e=>{let[t,n]=b();return C(()=>{if(!e)return;let t=!1;return Ye(e).then(r=>{t||n({episodeId:e,events:r})},e=>{t||console.warn(`[cr] skip events unavailable:`,e)}),()=>{t=!0}},[e]),e&&t?.episodeId===e?t.events:void 0},$e=(e,t)=>{let n=Qe(X(e)),r=Xe(t);return te(()=>{let e=Ve(qe(n,r),r);return e.length?e:Ze},[n,r])};x();var et=`stub:embed-fullscreen`,tt=`stub:embed-fullscreen?`,nt=`stub:embed-fullscreen-request`,rt=(e,t,n,r)=>{let i=i=>{let a=i.target;i.key!==`f`||i.repeat||i.ctrlKey||i.metaKey||i.altKey||a?.isContentEditable||/^(input|textarea|select)$/i.test(a?.tagName??``)||(e.fullscreenElement?e.exitFullscreen().catch(()=>{}):(n?.blur(),n?.focus(),t.requestFullscreen().then(r,()=>{})))};return e.addEventListener(`keydown`,i),()=>e.removeEventListener(`keydown`,i)},it=(e,t,n=window)=>{let{document:r}=n;if(!r.fullscreenEnabled)return()=>{};let i=rt(r,t,e),a=()=>{e.contentWindow&&U(e.contentWindow,{type:et,active:!!r.fullscreenElement},n.location.origin)},o=i=>{if(i.source!==e.contentWindow||i.origin!==n.location.origin)return;let o=i.data?.type;o===tt?a():o===nt&&(r.fullscreenElement?r.exitFullscreen():t.requestFullscreen()).catch(()=>{})};return n.addEventListener(`message`,o),r.addEventListener(`fullscreenchange`,a),a(),()=>{i(),n.removeEventListener(`message`,o),r.removeEventListener(`fullscreenchange`,a)}},at=(e,t=window)=>{let n=()=>U(t.parent,{type:nt},t.location.origin),r=r=>{if(r.source!==t.parent||r.origin!==t.location.origin)return;let{type:i,active:a}=r.data??{};i===et&&typeof a==`boolean`&&e({active:a,request:n})};return t.addEventListener(`message`,r),t.parent!==t&&U(t.parent,{type:tt},t.location.origin),()=>t.removeEventListener(`message`,r)},ot=()=>{let[e,t]=b();return C(()=>at(t),[]),e},Z=`stub:embed-language-picked`,st=()=>Object.fromEntries([u,c,m].flatMap(e=>{let t=h.getItem(e);return t===null?[]:[[e,t]]})),ct=e=>o(t=>e.get(t)),lt=(e,t=window)=>{let n=n=>{if(n.source!==e.contentWindow||n.origin!==t.location.origin)return;let{type:r,kind:a,language:o,on:s}=n.data??{};r===Z&&(a===`audio`&&typeof o==`string`&&d(o),a===`subtitles`&&(typeof o==`string`||o===null)&&p(o),a===`always-subtitles`&&typeof s==`boolean`&&i(s),a===`autoplay`&&typeof s==`boolean`&&H(s))};return t.addEventListener(`message`,n),()=>t.removeEventListener(`message`,n)},ut=(e,t,n=window)=>{n.parent!==n&&U(n.parent,{type:Z,kind:e,language:t},n.location.origin)},dt=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Z,kind:`always-subtitles`,on:e},t.location.origin)},ft=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Z,kind:`autoplay`,on:e},t.location.origin)},Q=`stub:embed-relay-tried`,pt=`triedRelays`,$=/* @__PURE__ */ new Map,mt=e=>e.split(`-`)[0],ht=e=>{let t=$.get(mt(e));return t?.length?{[pt]:t.join(`,`)}:{}},gt=e=>e.get(pt)?.split(`,`).filter(Boolean)??[],_t=(e,t,n=window)=>{let r=r=>{if(r.source!==e.contentWindow||r.origin!==n.location.origin)return;let{type:i,relay:a}=r.data??{};if(i!==Q||typeof a!=`string`)return;let o=mt(t),s=$.get(o)??[];s.includes(a)||$.set(o,[...s,a])};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)},vt=(e,t=window)=>{t.parent!==t&&U(t.parent,{type:Q,relay:e},t.location.origin)},yt=`stub:embed-unplayable`,bt=(e,t,n=window)=>{let r=r=>{r.source===e.contentWindow&&r.origin===n.location.origin&&r.data?.type===yt&&t()};return n.addEventListener(`message`,r),()=>n.removeEventListener(`message`,r)},xt=(e=window)=>{e.parent!==e&&U(e.parent,{type:yt},e.location.origin)},St=`stub:embed-title`,Ct=`stub:embed-title?`,wt=(e,t,n=window)=>{let r=()=>{e.contentWindow&&U(e.contentWindow,{type:St,title:t},n.location.origin)},i=t=>{t.source===e.contentWindow&&t.origin===n.location.origin&&t.data?.type===Ct&&r()};return n.addEventListener(`message`,i),r(),()=>n.removeEventListener(`message`,i)},Tt=(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===St&&typeof i==`string`&&e(i)};return t.addEventListener(`message`,n),t.parent!==t&&U(t.parent,{type:Ct},t.location.origin),()=>t.removeEventListener(`message`,n)},Et=5e3,Dt=async(e,t)=>{let r=await s.fetch(`${n}/auth/v1/token`,{method:`POST`,headers:{authorization:`Basic ${btoa(`cr_web:`)}`,"content-type":`application/x-www-form-urlencoded`},body:`grant_type=client_id&device_id=${crypto.randomUUID()}`,relay:t}),i=a(r),{access_token:o}=await r.json();if(!i||!o)throw Error(`Crunchyroll token through ${i}: ${r.status}`);let c=await s.fetch(`${n}/content/v2/cms/objects/${e}?ratings=true&locale=en-US`,{headers:{authorization:`Bearer ${o}`},relay:{id:i}});if(!c.ok&&c.status!==404)throw Error(`Crunchyroll episode through ${i}: ${c.status}`);return{relay:i,episode:c}},Ot=async(e,t)=>{let{relay:n,episode:r}=await Dt(e,t);return{relay:n,listed:r.ok}},kt=async e=>{let t=X(e);if(!t)return;let{episode:n}=await Dt(t,{});if(!n.ok)return;let{data:r}=await n.json(),i=r?.[0]?.episode_metadata?.duration_ms;return typeof i==`number`&&Number.isFinite(i)&&i>0?i/1e3:void 0},At=async(e,t)=>{let n=X(e);if(!n)return[];let r=async()=>{let e=[];for(;;){let{relay:r,listed:i}=await Ot(n,{exclude:[...t,...e]});if(i)return e;if(t.includes(r)||e.includes(r))return[];e.push(r)}},i,a=new Promise(e=>{i=setTimeout(e,Et,[])});return Promise.race([r().catch(()=>[]),a]).finally(()=>clearTimeout(i))},jt=y`
|
|
2
2
|
@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,500;1,600;1,700;1,800;1,900&family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap');
|
|
3
3
|
|
|
4
4
|
body {
|