1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,233706,e=>{"use strict";var t=e.i(39693),r=e.i(208058),i=e.i(259608),s=e.i(79907);class n extends Error{statusCode;statusText;statusBody;constructor(e,t,r,i){super(`REQUEST_ERROR: (${t}) ${e}`),this.statusCode=t,this.statusText=r,this.statusBody=i,Object.setPrototypeOf(this,new.target.prototype)}}let a=new Set(["DELETE","POST","PUT"]);async function o(e,t={}){var i;let{baseURL:s,cache:a,next:c,onResponse:h,query:d,signal:f,timeout:p,...v}=t,y=function(e,t,r){let i=t?new URL(e,t).toString():e;if(r){let[e,t]=i.split("?"),s=new URLSearchParams(t);for(let[e,t]of Object.entries(r))if(null!=t)if(Array.isArray(t))for(let r of(s.delete(e),t))s.append(e,String(r));else s.set(e,String(t));let n=s.toString();i=n?`${e}?${n}`:e}return i}(e,s,d),m=l(y),b=v.body instanceof FormData,g={...v,body:(i=v.body)instanceof FormData?i:i?JSON.stringify(i):void 0,headers:{...v.headers,...m?{Authorization:`Basic ${m}`}:{},Accept:"application/json",...b?{}:{"Content-Type":"application/json"}},cache:a,next:"force-cache"===a?{...c,revalidate:c?.revalidate??r.HOUR_IN_SECONDS}:c},E=await u(y,g,f,p);if(!E.ok){let e;try{e=await E.json()}catch{throw new n(y,E.status,E.statusText)}throw new n(y,E.status,E.statusText,e)}return h?.(E),204===E.status?{}:E.json()}async function u(e,t,r,s){let n,o=!r&&!a.has(t.method??"GET"),u=s&&!o?new AbortController:void 0,l=r&&u?AbortSignal.any([r,u.signal]):r??u?.signal,c=l?fetch(e,{...t,signal:l}):fetch(e,t);if(!s)return c;try{return await Promise.race([c,new Promise((t,r)=>{n=setTimeout(()=>{(0,i.default)("Network").error("Fetch timeout:",e),u?.abort(),r(Error(`FETCH_TIMEOUT: (${s}ms) ${e}`))},s)})])}finally{clearTimeout(n)}}function l(e){let r;if(!(0,s.isProdEnv)()){try{({origin:r}=new URL(e))}catch{return}switch(r){case"https://plex.tv":return t.default.env.NEXT_PUBLIC_PLEXTV_API_BASIC_AUTH;case"https://discover.provider.plex.tv":case"https://epg.provider.plex.tv":case"https://vod.provider.plex.tv":return t.default.env.NEXT_PUBLIC_PROVIDER_BASIC_AUTH;default:return}}}e.s(["RequestError",0,n,"default",0,o,"getBasicAuth",0,l])},305763,e=>{"use strict";var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};e.s(["systemSetTimeoutZero",0,function(e){setTimeout(e,0)},"timeoutManager",0,r])},766271,e=>{"use strict";var t=e.i(305763),r="u"<typeof window||"Deno"in globalThis;function i(e,t){return(t?.queryKeyHashFn||s)(e)}function s(e){return JSON.stringify(e,(e,t)=>u(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function n(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>n(e[r],t[r]))}var a=Object.prototype.hasOwnProperty;function o(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function u(e){if(!l(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!l(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function l(e){return"[object Object]"===Object.prototype.toString.call(e)}var c=Symbol();e.s(["addConsumeAwareSignal",0,function(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e},"addToEnd",0,function(e,t,r=0){let i=[...e,t];return r&&i.length>r?i.slice(1):i},"addToStart",0,function(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i},"ensureQueryFn",0,function(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==c?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))},"functionalUpdate",0,function(e,t){return"function"==typeof e?e(t):e},"hashKey",0,s,"hashQueryKeyByOptions",0,i,"isServer",0,r,"isValidTimeout",0,function(e){return"number"==typeof e&&e>=0&&e!==1/0},"keepPreviousData",0,function(e){return e},"matchMutation",0,function(e,t){let{exact:r,status:i,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(r){if(s(t.options.mutationKey)!==s(o))return!1}
1else if(!n(t.options.mutationKey,o))return!1}return(!i||t.state.status===i)&&(!a||!!a(t))},"matchQuery",0,function(e,t){let{type:r="all",exact:s,fetchStatus:a,predicate:o,queryKey:u,stale:l}=e;if(u){if(s){if(t.queryHash!==i(u,t.options))return!1}else if(!n(t.queryKey,u))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof l||t.isStale()===l)&&(!a||a===t.state.fetchStatus)&&(!o||!!o(t))},"noop",0,function(){},"partialMatchKey",0,n,"replaceData",0,function(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=o(t)&&o(r);if(!s&&!(u(t)&&u(r)))return r;let n=(s?t:Object.keys(t)).length,l=s?r:Object.keys(r),c=l.length,h=s?Array(c):{},d=0;for(let o=0;o<c;o++){let u=s?o:l[o],c=t[u],f=r[u];if(c===f){h[u]=c,(s?o<n:a.call(t,u))&&d++;continue}if(null===c||null===f||"object"!=typeof c||"object"!=typeof f){h[u]=f;continue}let p=e(c,f,i+1);h[u]=p,p===c&&d++}return n===c&&d===n?t:h}(e,t):t},"resolveEnabled",0,function(e,t){return"function"==typeof e?e(t):e},"resolveStaleTime",0,function(e,t){return"function"==typeof e?e(t):e},"shallowEqualObjects",0,function(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0},"shouldThrowError",0,function(e,t){return"function"==typeof e?e(...t):!!e},"skipToken",0,c,"sleep",0,function(e){return new Promise(r=>{t.timeoutManager.setTimeout(r,e)})},"timeUntilStale",0,function(e,t){return Math.max(e+(t||0)-Date.now(),0)}])},259864,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(305763).systemSetTimeoutZero,u=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",0,u])},578889,e=>{"use strict";e.s(["Subscribable",0,class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}])},82679,e=>{"use strict";var t=e.i(578889),r=e.i(766271),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",0,i])},313805,60045,757142,e=>{"use strict";var t=e.i(82679),r=e.i(578889),i=e.i(766271),s=new class extends r.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!i.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function n(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function a(e){return Math.min(1e3*2**e,3e4)}function o(e){return(e??"online")!=="online"||s.isOnline()}e.s(["onlineManager",0,s],60045),e.s(["pendingThenable",0,n],757142);
1var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};e.s(["CancelledError",0,u,"canFetch",0,o,"createRetryer",0,function(e){let r,l=!1,c=0,h=n(),d=()=>t.focusManager.isFocused()&&("always"===e.networkMode||s.isOnline())&&e.canRun(),f=()=>o(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},v=e=>{"pending"===h.status&&(r?.(),h.reject(e))},y=()=>new Promise(t=>{r=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),m=()=>{let t;if("pending"!==h.status)return;let r=0===c?e.initialPromise:void 0;try{t=r??e.fn()}catch(e){t=Promise.reject(e)}Promise.resolve(t).then(p).catch(t=>{if("pending"!==h.status)return;let r=e.retry??3*!i.isServer,s=e.retryDelay??a,n="function"==typeof s?s(c,t):s,o=!0===r||"number"==typeof r&&c<r||"function"==typeof r&&r(c,t);l||!o?v(t):(c++,e.onFail?.(c,t),(0,i.sleep)(n).then(()=>d()?void 0:y()).then(()=>{l?v(t):m()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);v(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{l=!0},continueRetry:()=>{l=!1},canStart:f,start:()=>(f()?m():y().then(m),h)}}],313805)},539392,e=>{"use strict";var t=e.i(305763),r=e.i(766271),i=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,r.isValidTimeout)(this.gcTime)&&(this.#a=t.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(r.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(t.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",0,i])},959243,e=>{"use strict";var t=e.i(766271),r=e.i(259864),i=e.i(313805),s=e.i(539392),n=class extends s.Removable{#o;#u;#l;#c;#h;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#l=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=u(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=u(this.options);void 0!==e.data&&(this.setState(o(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#l.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#l.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#l.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let s;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,a=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,n.signal)}
1)},o=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(a(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},u=(a(s={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:o}),s);this.options.behavior?.onFetch(u,this),this.#u=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==u.fetchOptions?.meta)&&this.#p({type:"fetch",meta:u.fetchOptions?.meta}),this.#h=(0,i.createRetryer)({initialPromise:r?.initialPromise,fn:u.fetchFn,onCancel:e=>{e instanceof i.CancelledError&&e.revert&&this.setState({...this.#u,fetchStatus:"idle"}),n.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#l.config.onSuccess?.(e,this),this.#l.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof i.CancelledError){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#l.config.onError?.(e,this),this.#l.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...a(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...o(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#u=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#l.notify({query:this,type:"updated",action:e})})}};function a(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:(0,i.canFetch)(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function o(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function u(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",0,n,"fetchState",0,a])},393202,e=>{"use strict";var t=e.i(630242),r=e.i(161605),i=t.createContext(void 0);e.s(["QueryClientProvider",0,({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s})),"useQueryClient",0,e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r}])},849329,414822,768380,e=>{"use strict";let t;var r=e.i(82679),i=e.i(259864),s=e.i(959243),n=e.i(578889),a=e.i(757142),o=e.i(766271),u=e.i(305763),l=class extends n.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#v=null,this.#y=(0,a.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#m=void 0;#b=void 0;#g=void 0;#E;#R;#y;#v;#S;#T;#w;#O;#C;#I;#A=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#m.addObserver(this),c(this.#m,this.options)?this.#D():this.updateResult(),this.#Q())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return h(this.#m,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return h(this.#m,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#F(),this.#P(),this.#m.removeObserver(this)}setOptions(e){let t=this.options,r=this.#m;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,o.resolveEnabled)(this.options.enabled,this.#m))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#U(),this.#m.setOptions(this.options),t._defaulted&&!(0,o.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#m,observer:this});let i=this.hasListeners();i&&d(this.#m,r,this.options,t)&&this.#D(),this.updateResult(),i&&(this.#m!==r||(0,o.resolveEnabled)(this.options.enabled,this.#m)!==(0,o.resolveEnabled)(t.enabled,this.#m)||(0,o.resolveStaleTime)(this.options.staleTime,this.#m)!==(0,o.resolveStaleTime)(t.staleTime,this.#m))&&this.#k();let s=this.#x();i&&(this.#m!==r||(0,o.resolveEnabled)(this.options.enabled,this.#m)!==(0,o.resolveEnabled)(t.enabled,this.#m)||s!==this.#I)&&this.#_(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,o.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#g=s,this.#R=this.options,this.#E=this.#m.state),s}getCurrentResult(){return this.#g}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#y.status||this.#y.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#A.add(e)}getCurrentQuery(){return this.#m}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#D({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#g))}#D(e){this.#U();let t=this.#m.fetch(this.options,e);return e?.throwOnError||(t=t.catch(o.noop)),t}#k(){this.#F();let e=(0,o.resolveStaleTime)(this.options.staleTime,this.#m);if(o.isServer||this.#g.isStale||!(0,o.isValidTimeout)(e))return;let t=(0,o.timeUntilStale)(this.#g.dataUpdatedAt,e);this.#O=u.timeoutManager.setTimeout(()=>{this.#g.isStale||this.updateResult()},t+1)}#x(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#m):this.options.refetchInterval)??!1}#_(e){this.#P(),this.#I=e,!o.isServer&&!1!==(0,o.resolveEnabled)(this.options.enabled,this.#m)&&(0,o.isValidTimeout)(this.#I)&&0!==this.#I&&(this.#C=u.timeoutManager.setInterval(()=>
1{(this.options.refetchIntervalInBackground||r.focusManager.isFocused())&&this.#D()},this.#I))}#Q(){this.#k(),this.#_(this.#x())}#F(){this.#O&&(u.timeoutManager.clearTimeout(this.#O),this.#O=void 0)}#P(){this.#C&&(u.timeoutManager.clearInterval(this.#C),this.#C=void 0)}createResult(e,t){let r,i=this.#m,n=this.options,u=this.#g,l=this.#E,h=this.#R,p=e!==i?e.state:this.#b,{state:v}=e,y={...v},m=!1;if(t._optimisticResults){let r=this.hasListeners(),a=!r&&c(e,t),o=r&&d(e,i,t,n);(a||o)&&(y={...y,...(0,s.fetchState)(v.data,e.options)}),"isRestoring"===t._optimisticResults&&(y.fetchStatus="idle")}let{error:b,errorUpdatedAt:g,status:E}=y;r=y.data;let R=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===E){let e;u?.isPlaceholderData&&t.placeholderData===h?.placeholderData?(e=u.data,R=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#w?.state.data,this.#w):t.placeholderData,void 0!==e&&(E="success",r=(0,o.replaceData)(u?.data,e,t),m=!0)}if(t.select&&void 0!==r&&!R)if(u&&r===l?.data&&t.select===this.#S)r=this.#T;else try{this.#S=t.select,r=t.select(r),r=(0,o.replaceData)(u?.data,r,t),this.#T=r,this.#v=null}catch(e){this.#v=e}this.#v&&(b=this.#v,r=this.#T,g=Date.now(),E="error");let S="fetching"===y.fetchStatus,T="pending"===E,w="error"===E,O=T&&S,C=void 0!==r,I={status:E,fetchStatus:y.fetchStatus,isPending:T,isSuccess:"success"===E,isError:w,isInitialLoading:O,isLoading:O,data:r,dataUpdatedAt:y.dataUpdatedAt,error:b,errorUpdatedAt:g,failureCount:y.fetchFailureCount,failureReason:y.fetchFailureReason,errorUpdateCount:y.errorUpdateCount,isFetched:y.dataUpdateCount>0||y.errorUpdateCount>0,isFetchedAfterMount:y.dataUpdateCount>p.dataUpdateCount||y.errorUpdateCount>p.errorUpdateCount,isFetching:S,isRefetching:S&&!T,isLoadingError:w&&!C,isPaused:"paused"===y.fetchStatus,isPlaceholderData:m,isRefetchError:w&&C,isStale:f(e,t),refetch:this.refetch,promise:this.#y,isEnabled:!1!==(0,o.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==I.data,r="error"===I.status&&!t,s=e=>{r?e.reject(I.error):t&&e.resolve(I.data)},n=()=>{s(this.#y=I.promise=(0,a.pendingThenable)())},o=this.#y;switch(o.status){case"pending":e.queryHash===i.queryHash&&s(o);break;case"fulfilled":(r||I.data!==o.value)&&n();break;case"rejected":r&&I.error===o.reason||n()}}return I}updateResult(){let e=this.#g,t=this.createResult(this.#m,this.options);if(this.#E=this.#m.state,this.#R=this.options,void 0!==this.#E.data&&(this.#w=this.#m),(0,o.shallowEqualObjects)(t,e))return;this.#g=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#A.size)return!0;let i=new Set(r??this.#A);return this.options.throwOnError&&i.add("error"),Object.keys(this.#g).some(t=>this.#g[t]!==e[t]&&i.has(t))};this.#M({listeners:r()})}#U(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#m)return;let t=this.#m;this.#m=e,this.#b=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#Q()}#M(e){i.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#g)}),this.#c.getQueryCache().notify({query:this.#m,type:"observerResultsUpdated"})})}};function c(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&h(e,t,t.refetchOnMount)}function h(e,t,r){if(!1!==(0,o.resolveEnabled)(t.enabled,e)&&"static"!==(0,o.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&f(e,t)}return!1}function d(e,t,r,i){return(e!==t||!1===(0,o.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&f(e,r)}function f(e,t){return!1!==(0,o.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,o.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",0,l],414822),e.i(39693);var p=e.i(630242),v=e.i(393202);e.i(161605);var y=p.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),m=p.createContext(!1);m.Provider;var b=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function g(e,t,r){let s,n=p.useContext(m),a=p.useContext(y),u=(0,v.useQueryClient)(r),l=u.defaultQueryOptions(e);u.getDefaultOptions().queries?._experimental_beforeQuery?.(l);let c=u.getQueryCache().get(l.queryHash);if(l._optimisticResults=n?"isRestoring":"optimistic",l.suspense){let e=e=>"static"===e?e:Math.max(e??1e3,1e3),t=l.staleTime;l.staleTime="function"==typeof t?(...r)=>e(t(...r)):e(t),"number"==typeof l.gcTime&&(l.gcTime=Math.max(l.gcTime,1e3))}s=c?.state.error&&"function"==typeof l.throwOnError?(0,o.shouldThrowError)(l.throwOnError,[c.state.error,c]):l.throwOnError,(l.suspense||l.experimental_prefetchInRender||s)&&!a.isReset()&&(l.retryOn
1Mount=!1),p.useEffect(()=>{a.clearReset()},[a]);let h=!u.getQueryCache().get(l.queryHash),[d]=p.useState(()=>new t(u,l)),f=d.getOptimisticResult(l),g=!n&&!1!==e.subscribed;if(p.useSyncExternalStore(p.useCallback(e=>{let t=g?d.subscribe(i.notifyManager.batchCalls(e)):o.noop;return d.updateResult(),t},[d,g]),()=>d.getCurrentResult(),()=>d.getCurrentResult()),p.useEffect(()=>{d.setOptions(l)},[l,d]),l?.suspense&&f.isPending)throw b(l,d,a);if((({result:e,errorResetBoundary:t,throwOnError:r,query:i,suspense:s})=>e.isError&&!t.isReset()&&!e.isFetching&&i&&(s&&void 0===e.data||(0,o.shouldThrowError)(r,[e.error,i])))({result:f,errorResetBoundary:a,throwOnError:l.throwOnError,query:c,suspense:l.suspense}))throw f.error;if(u.getDefaultOptions().queries?._experimental_afterQuery?.(l,f),l.experimental_prefetchInRender&&!o.isServer&&f.isLoading&&f.isFetching&&!n){let e=h?b(l,d,a):c?.promise;e?.catch(o.noop).finally(()=>{d.updateResult()})}return l.notifyOnChangeProps?f:d.trackResult(f)}e.s(["useBaseQuery",0,g],768380),e.s(["useQuery",0,function(e,t){return g(e,l,t)}],849329)},831877,e=>{"use strict";var t=e.i(630242);e.s(["default",0,function(e){let r=e?JSON.stringify(e):void 0;return(0,t.useMemo)(()=>r?JSON.parse(r):void 0,[r])}])},826444,e=>{"use strict";var t=e.i(161605),r=e.i(630242),i=e.i(831877);let s=(0,r.createContext)({anonymousClientID:"",clientID:"",browser:{},device:{},isBot:!1,os:{},ua:""});e.s(["ClientInfoContext",0,s,"default",0,function({clientInfo:e,children:r}){let n=(0,i.default)(e);return(0,t.jsx)(s.Provider,{value:n,children:r})}])},52798,e=>{"use strict";var t=e.i(630242),r=e.i(826444);e.s(["default",0,function(){return(0,t.useContext)(r.ClientInfoContext)}])},854913,e=>{"use strict";e.i(39693);var t=e.i(208058),r=e.i(542931),i=e.i(928928);e.i(354370);var s=e.i(921144);let n=!1;async function a(e="/"){if(n)return;n=!0;let[u,l]=await Promise.all([(0,i.default)(),(0,r.getCookie)(t.COOKIES.CLIENT_ID,s.string())]);if(!u){n=!1,o(e);return}let c=fetch("https://plex.tv/api/v2/users/signout",{method:"DELETE",credentials:"include",keepalive:!0,headers:{[t.HEADERS.CLIENT_IDENTIFIER]:l??"",[t.HEADERS.TOKEN]:u.token}});await Promise.all([(0,r.deleteCookie)(t.COOKIES.AUTH),(0,r.deleteCookie)(t.COOKIES.USER_SETTINGS)]),window.google?.accounts?.id?.disableAutoSelect?.(),o(e),await c,n=!1}function o(e){e?window.location.href=e:window.location.reload()}e.s(["default",0,a,"refresh",0,function(e){o(e)}],854913)},14298,e=>{"use strict";var t=e.i(208058),r=e.i(581424),i=e.i(710466),s=e.i(928928),n=e.i(233706);async function a(e,t,r,i){let{skipAuth:s,...a}=i??{},u=await o(t,r,s);return(0,n.default)(e,{...a,headers:{...u,...a.headers}})}async function o(e,n,a=!1){let u=new URLSearchParams(window.location.search).get(t.REFERRER_SEARCH_PARAM),l={[t.HEADERS.CLIENT_IDENTIFIER]:n.clientID,[t.HEADERS.LANGUAGE]:e,[t.HEADERS.PRODUCT]:(0,i.default)(u),[t.HEADERS.PROVIDER_VERSION]:t.PROVIDER_API_VERSION};n.browser.name&&(l[t.HEADERS.PLATFORM]=n.browser.name),n.browser.version&&(l[t.HEADERS.PLATFORM_VERSION]=n.browser.version),n.os.name&&(l[t.HEADERS.DEVICE]=n.os.name);let c=(0,r.getPlaybackSessionID)();c&&(l[t.HEADERS.PLAYBACK_SESSION_ID]=c);let h=(0,r.getPlaybackID)();h&&(l[t.HEADERS.PLAYBACK_ID]=h);let d=(0,r.getSessionID)();if(d&&(l[t.HEADERS.SESSION_ID]=d),!a){let e=await (0,s.default)();e&&(l[t.HEADERS.TOKEN]=e.token)}return l}e.s(["default",0,a])},154250,e=>{"use strict";var t=e.i(459873);e.s(["default",0,function(){return"https://watch.plex.tv"+(0,t.usePathname)()}])},654023,348506,e=>{"use strict";var t=e.i(52798),r=e.i(154250);function i(e,...t){return e?.find(({code:e})=>e&&t.includes(e))}e.s(["default",0,function(e){let i=(0,r.default)(),{clientID:s}=(0,t.default)(),n=new URLSearchParams(e);return n.append("forwardUrl",i),n.append("clientID",s),"https://app.plex.tv/auth/#!?"+n.toString()}
1],654023),e.s(["EMAIL_VERIFICATION_INVALID_CODE",0,1130,"PASSWORD_RESET_REQUIRED",0,1087,"VERIFICATION_CODE_REQUIRED",0,1029,"findAdditionalAuthNeededError",0,function(e){return i(e,1044,1046)},"findErrorWithCode",0,i,"getAuthErrorMessage",0,function(e,t){return e.length?function(e,t){if(e.field&&e.code){let r=function(e,t,r){switch(e){case"email":switch(t){case 1010:return r("validation-email-required");case 1011:return r("validation-email-taken");case 1035:return r("validation-email-invalid")}break;case"login":if(1010===t)return r("validation-login-required");break;case"password":switch(t){case 1010:return r("validation-password-required");case 1032:return r("validation-password-min-length");case 1033:return r("validation-password-weak");case 1034:return r("validation-password-different")}break;case"passwordConfirmation":if(1039===t)return r("validation-password-confirmation-match");break;case"pin":if(1038===t)return r("validation-pin-digits");break;case"username":switch(t){case 1011:return r("validation-username-taken");case 1036:return r("validation-username-no-email");case 1037:return r("validation-username-invalid-chars")}}}(e.field,e.code,t);if(r)return r}switch(e.code){case 1001:return t("error-incorrect-credentials");case 1003:return t("error-sign-in-disabled");case 1004:return t("error-auth-failed");case 1028:return t("error-invalid-verification-code");case 1029:return t("error-enter-verification-code");case 1030:return t("error-email-only");case 1031:return t("error-incorrect-credentials-throttled");case 1040:case 1044:return t("error-invalid-password");case 1129:return t("error-email-verification-required");case 1130:return t("error-verification-code-invalid")}return e.message?e.message:t("error-unknown")}(e[0],t):t("error-unknown")},"getAuthErrors",0,function(e){return"object"==typeof e&&Array.isArray(e.errors)?e.errors:[]}],348506)},962503,e=>{"use strict";e.s(["default",()=>s]),e.i(459873);var t=e.i(66443),r=e.i(630242),i=e.i(956736);function s(e){let s=(0,i.default)(),n=(0,t.useLocale)();return(0,r.useMemo)(()=>[...e,n,s?.id],[s?.id,n,e])}},956736,787737,770008,e=>{"use strict";e.s(["default",()=>m],956736);var t=e.i(630242);e.s(["AuthContext",()=>v,"default",()=>y],770008);var r=e.i(161605);e.i(39693);var i=e.i(654023),s=e.i(348506);e.s(["default",()=>c],787737);var n=e.i(849329);e.i(459873);var a=e.i(66443),o=e.i(52798),u=e.i(962503),l=e.i(14298);function c(e,{fetchOptions:t,queryKey:r,...i}={}){let s=(0,o.default)(),h=(0,a.useLocale)(),d=(0,u.default)(["plex",e]);return(0,n.useQuery)({...i,enabled:!!e&&i.enabled,queryFn:()=>{if(!e)throw Error("Nothing to fetch without a `url`.");return(0,l.default)(e,h,s,t)},queryKey:r??d})}var h=e.i(259608),d=e.i(854913);let f="Auth";var p=e.i(831877);let v=(0,t.createContext)(void 0);function y({auth:e,children:n}){let a=function(e){let r=(0,i.default)({resetPassword:"1",resetRequired:"1"}),{data:n,error:a}=c("https://plex.tv/api/v2/users/signin?noGuest=true&skipAuthentication=true",{enabled:!!e&&!e.anonymous,fetchOptions:{credentials:"include",method:"POST",skipAuth:!0},staleTime:1/0});return(0,t.useEffect)(()=>{n?.email&&e?.email&&n.email!==e.email&&((0,h.default)(f).warn(`Forcing a reload due to the signed in user (${n.email}) differing from the initial cookie value (${e.email}). A different user may have been signed in with another browser tab or the user might have changed their email address.`),(0,d.refresh)())},[e,n]),(0,t.useEffect)(()=>{a&&e&&a.statusCode>=400&&a.statusCode<=499&&((0,h.default)(f).error(`Forcing a sign out due to the sign in request responding ${a.statusCode}. The cookie may have been invalidated.`),(0,s.findErrorWithCode)((0,s.getAuthErrors)(a.statusBody),s.PASSWORD_RESET_REQUIRED)?(0,d.default)(r):(0,d.default)())},[e,r,a]),(0,t.useMemo)(()=>n?.authToken&&e&&n.authToken!==e.token?{...e,token:n.authToken}:e,[e,n])}((0,p.default)(e));return(0,r.jsx)(v.Provider,{value:a,children:n})}function m(){return(0,t.useContext)(v)}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.