@banou/stub 0.0.48 → 0.0.50

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.
@@ -1,25 +1,25 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./worker-HiPGVuwy.js","./worker-B9CHWfL2.js","./build-mcPaLDi_.js","./site-status--bPTCMnf.js","./embed-title-MMtofoQC.js","./account-B2ETje0Z.js","./api-DIgTslNb-Cs0uqWX1.js"])))=>i.map(i=>d[i]);
2
- import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,I as c,J as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,St as v,T as y,U as b,V as x,X as S,Y as C,Z as w,_ as T,_t as E,a as D,at as O,b as k,c as A,ct as j,d as M,et as N,f as P,ft as ee,g as te,gt as ne,h as re,ht as ie,i as F,it as ae,j as oe,k as I,lt as L,m as se,mt as ce,n as le,nt as R,o as ue,ot as z,p as de,pt as fe,q as pe,r as me,rt as he,s as ge,st as B,tt as _e,u as ve,ut as V,v as H,vt as ye,w as be,xt as xe,y as U,z as Se}from"./embed-title-MMtofoQC.js";import{r as Ce}from"./account-B2ETje0Z.js";import{_ as we,a as Te,b as Ee,d as De,f as Oe,i as ke,l as Ae,m as je,n as Me,p as Ne,r as Pe,s as Fe,t as Ie,v as Le,x as Re,y as ze}from"./site-status--bPTCMnf.js";import{C as Be,E as Ve,S as He,T as Ue,_ as We,a as Ge,b as Ke,c as qe,f as Je,g as Ye,h as Xe,i as Ze,l as Qe,m as $e,n as et,o as tt,p as nt,r as rt,s as it,t as at,v as ot,w as st,x as ct,y as lt}from"./worker-B9CHWfL2.js";import{t as ut}from"./remote-CAlKhZLk.js";ie();var dt={NAME:`Name`,DOCUMENT:`Document`,OPERATION_DEFINITION:`OperationDefinition`,VARIABLE_DEFINITION:`VariableDefinition`,SELECTION_SET:`SelectionSet`,FIELD:`Field`,ARGUMENT:`Argument`,FRAGMENT_SPREAD:`FragmentSpread`,INLINE_FRAGMENT:`InlineFragment`,FRAGMENT_DEFINITION:`FragmentDefinition`,VARIABLE:`Variable`,INT:`IntValue`,FLOAT:`FloatValue`,STRING:`StringValue`,BOOLEAN:`BooleanValue`,NULL:`NullValue`,ENUM:`EnumValue`,LIST:`ListValue`,OBJECT:`ObjectValue`,OBJECT_FIELD:`ObjectField`,DIRECTIVE:`Directive`,NAMED_TYPE:`NamedType`,LIST_TYPE:`ListType`,NON_NULL_TYPE:`NonNullType`},ft=class extends Error{constructor(e,t,n,r,i,a,o){super(e),this.name=`GraphQLError`,this.message=e,i&&(this.path=i),t&&(this.nodes=Array.isArray(t)?t:[t]),n&&(this.source=n),r&&(this.positions=r),a&&(this.originalError=a);var s=o;if(!s&&a){var c=a.extensions;c&&typeof c==`object`&&(s=c)}this.extensions=s||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return`GraphQLError`}},W,G;function pt(e){return new ft(`Syntax Error: Unexpected token at ${G} in ${e}`)}function mt(e){if(e.lastIndex=G,e.test(W))return W.slice(G,G=e.lastIndex)}var ht=/ +(?=[^\s])/y;function gt(e){for(var t=e.split(`
3
- `),n=``,r=0,i=0,a=t.length-1,o=0;o<t.length;o++)ht.lastIndex=0,ht.test(t[o])&&(o&&(!r||ht.lastIndex<r)&&(r=ht.lastIndex),i||=o,a=o);for(var s=i;s<=a;s++)s!==i&&(n+=`
4
- `),n+=t[s].slice(r).replace(/\\"""/g,`"""`);return n}function K(){for(var e=0|W.charCodeAt(G++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|W.charCodeAt(G++))if(e===35)for(;(e=0|W.charCodeAt(G++))&&e!==10&&e!==13;);G--}function _t(){for(var e=G,t=0|W.charCodeAt(G++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|W.charCodeAt(G++));if(e===G-1)throw pt(`Name`);var n=W.slice(e,--G);return K(),n}function vt(){return{kind:`Name`,value:_t()}}var yt=/(?:"""|(?:[\s\S]*?[^\\])""")/y,bt=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function xt(e){var t;switch(W.charCodeAt(G)){case 91:G++,K();for(var n=[];W.charCodeAt(G)!==93;)n.push(xt(e));return G++,K(),{kind:`ListValue`,values:n};case 123:G++,K();for(var r=[];W.charCodeAt(G)!==125;){var i=vt();if(W.charCodeAt(G++)!==58)throw pt(`ObjectField`);K(),r.push({kind:`ObjectField`,name:i,value:xt(e)})}return G++,K(),{kind:`ObjectValue`,fields:r};case 36:if(e)throw pt(`Variable`);return G++,{kind:`Variable`,name:vt()};case 34:if(W.charCodeAt(G+1)===34&&W.charCodeAt(G+2)===34){if(G+=3,(t=mt(yt))==null)throw pt(`StringValue`);return K(),{kind:`StringValue`,value:gt(t.slice(0,-3)),block:!0}}var a=G,o;G++;var s=!1;for(o=0|W.charCodeAt(G++);o===92&&(G++,s=!0)||o!==10&&o!==13&&o!==34&&o;o=0|W.charCodeAt(G++));if(o!==34)throw pt(`StringValue`);return t=W.slice(a,G),K(),{kind:`StringValue`,value:s?JSON.parse(t):t.slice(1,-1),block:!1};case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var c=G++,l;(l=0|W.charCodeAt(G++))>=48&&l<=57;);var u=W.slice(c,--G);if((l=W.charCodeAt(G))===46||l===69||l===101){if((t=mt(bt))==null)throw pt(`FloatValue`);return K(),{kind:`FloatValue`,value:u+t}}return K(),{kind:`IntValue`,value:u};case 110:if(W.charCodeAt(G+1)===117&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===108)return G+=4,K(),{kind:`NullValue`};break;case 116:if(W.charCodeAt(G+1)===114&&W.charCodeAt(G+2)===117&&W.charCodeAt(G+3)===101)return G+=4,K(),{kind:`BooleanValue`,value:!0};break;case 102:if(W.charCodeAt(G+1)===97&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===115&&W.charCodeAt(G+4)===101)return G+=5,K(),{kind:`BooleanValue`,value:!1}}return{kind:`EnumValue`,value:_t()}}function St(e){if(W.charCodeAt(G)===40){var t=[];G++,K();do{var n=vt();if(W.charCodeAt(G++)!==58)throw pt(`Argument`);K(),t.push({kind:`Argument`,name:n,value:xt(e)})}while(W.charCodeAt(G)!==41);return G++,K(),t}}function Ct(e){if(W.charCodeAt(G)===64){var t=[];do G++,t.push({kind:`Directive`,name:vt(),arguments:St(e)});while(W.charCodeAt(G)===64);return t}}function wt(){for(var e=0;W.charCodeAt(G)===91;)e++,G++,K();var t={kind:`NamedType`,name:vt()};do if(W.charCodeAt(G)===33&&(G++,K(),t={kind:`NonNullType`,type:t}),e){if(W.charCodeAt(G++)!==93)throw pt(`NamedType`);K(),t={kind:`ListType`,type:t}}while(e--);return t}function Tt(){if(W.charCodeAt(G++)!==123)throw pt(`SelectionSet`);return K(),Et()}function Et(){var e=[];do if(W.charCodeAt(G)===46){if(W.charCodeAt(++G)!==46||W.charCodeAt(++G)!==46)throw pt(`SelectionSet`);switch(G++,K(),W.charCodeAt(G)){case 64:e.push({kind:`InlineFragment`,typeCondition:void 0,directives:Ct(!1),selectionSet:Tt()});break;case 111:W.charCodeAt(G+1)===110?(G+=2,K(),e.push({kind:`InlineFragment`,typeCondition:{kind:`NamedType`,name:vt()},directives:Ct(!1),selectionSet:Tt()})):e.push({kind:`FragmentSpread`,name:vt(),directives:Ct(!1)});break;case 123:G++,K(),e.push({kind:`InlineFragment`,typeCondition:void 0,directives:void 0,selectionSet:Et()});break;default:e.push({kind:`FragmentSpread`,name:vt(),directives:Ct(!1)})}}else{var t=vt(),n=void 0;W.charCodeAt(G)===58&&(G++,K(),n=t,t=vt());var r=St(!1),i=Ct(!1),a=void 0;W.charCodeAt(G)===123&&(G++,K(),a=Et()),e.push({kind:`Field`,alias:n,name:t,arguments:r,directives:i,selectionSet:a})}while(W.charCodeAt(G)!==125);return G++,K(),{kind:`SelectionSet`,selections:e}}function Dt(){if(K(),W.charCodeAt(G)===40){var e=[];G++,K();do{var t=void 0;if(W.charCodeAt(G)===34&&(t=xt(!0)),W.charCodeAt(G++)!==36)throw pt(`Variable`);var n=vt();if(W.charCodeAt(G++)!==58)throw pt(`VariableDefinition`);K();var r=wt(),i=void 0;W.charCodeAt(G)===61&&(G++,K(),i=xt(!0)),K();var a={kind:`VariableDefinition`,variable:{kind:`Variable`,name:n},type:r,defaultValue:i,directives:Ct(!0)};t&&(a.description=t),e.push(a)}while(W.charCodeAt(G)!==41);return G++,K(),e}}function Ot(e){var t=vt();if(W.charCodeAt(G++)!==111||W.charCodeAt(G++)!==110)throw pt(`FragmentDefinition`);K();var n={kind:`FragmentDefinition`,name:t,typeCondition:{kind:`NamedType`,name:vt()},directives:Ct(!1),selectionSet:Tt()};return e&&(n.description=e),n}function kt(){var e=[];do{var t=void 0;if(W.charCodeAt(G)===34&&(t=xt(!0)),W.charCodeAt(G)===123){if(t)throw pt(`Document`);G++,K(),e.push({kind:`OperationDefinition`,operation:`query`,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:Et()})}else{var n=_t();switch(n){case`fragment`:e.push(Ot(t));break;case`query`:case`mutation`:case`subscription`:var r,i=void 0;(r=W.charCodeAt(G))!==40&&r!==64&&r!==123&&(i=vt());var a={kind:`OperationDefinition`,operation:n,name:i,variableDefinitions:Dt(),directives:Ct(!1),selectionSet:Tt()};t&&(a.description=t),e.push(a);break;default:throw pt(`Document`)}}}while(G<W.length);return e}function At(e,t){return W=e.body?e.body:e,G=0,K(),t&&t.noLocation?{kind:`Document`,definitions:kt()}:{kind:`Document`,definitions:kt(),loc:{start:0,end:W.length,startToken:void 0,endToken:void 0,source:{body:W,name:`graphql.web`,locationOffset:{line:1,column:1}}}}}function jt(e,t,n){for(var r=``,i=0;i<e.length;i++)i&&(r+=t),r+=n(e[i]);return r}function Mt(e){return JSON.stringify(e)}function Nt(e){return`"""
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./worker-BqPITUlQ.js","./worker-NHcxxJEX.js","./build-mcPaLDi_.js","./site-status--bPTCMnf.js","./embed-title-MMtofoQC.js","./account-B2ETje0Z.js","./api-DIgTslNb-Cs0uqWX1.js"])))=>i.map(i=>d[i]);
2
+ import{$ as e,A as t,B as n,C as r,D as i,E as a,F as o,G as s,I as c,J as l,L as u,M as d,N as f,O as p,P as m,Q as h,R as g,S as _,St as v,T as y,U as b,V as x,X as S,Y as C,Z as w,_ as T,_t as E,a as D,at as O,b as k,c as A,ct as j,d as M,et as N,f as P,ft as ee,g as te,gt as ne,h as re,ht as ie,i as F,it as ae,j as oe,k as I,lt as L,m as se,mt as ce,n as le,nt as R,o as ue,ot as z,p as de,pt as fe,q as pe,r as me,rt as he,s as ge,st as B,tt as _e,u as ve,ut as V,v as H,vt as ye,w as be,xt as xe,y as U,z as Se}from"./embed-title-MMtofoQC.js";import{r as Ce}from"./account-B2ETje0Z.js";import{_ as we,a as Te,b as Ee,d as De,f as Oe,i as ke,l as Ae,m as je,n as Me,p as Ne,r as Pe,s as Fe,t as Ie,v as Le,x as Re,y as ze}from"./site-status--bPTCMnf.js";import{A as Be,C as Ve,D as He,E as Ue,O as We,S as Ge,T as Ke,_ as qe,a as Je,b as Ye,c as Xe,f as Ze,g as Qe,h as $e,i as et,j as tt,k as nt,l as rt,m as it,n as at,o as ot,p as st,r as ct,s as lt,t as ut,v as dt,w as ft,x as pt,y as mt}from"./worker-NHcxxJEX.js";import{t as ht}from"./remote-CAlKhZLk.js";ie();var gt={NAME:`Name`,DOCUMENT:`Document`,OPERATION_DEFINITION:`OperationDefinition`,VARIABLE_DEFINITION:`VariableDefinition`,SELECTION_SET:`SelectionSet`,FIELD:`Field`,ARGUMENT:`Argument`,FRAGMENT_SPREAD:`FragmentSpread`,INLINE_FRAGMENT:`InlineFragment`,FRAGMENT_DEFINITION:`FragmentDefinition`,VARIABLE:`Variable`,INT:`IntValue`,FLOAT:`FloatValue`,STRING:`StringValue`,BOOLEAN:`BooleanValue`,NULL:`NullValue`,ENUM:`EnumValue`,LIST:`ListValue`,OBJECT:`ObjectValue`,OBJECT_FIELD:`ObjectField`,DIRECTIVE:`Directive`,NAMED_TYPE:`NamedType`,LIST_TYPE:`ListType`,NON_NULL_TYPE:`NonNullType`},_t=class extends Error{constructor(e,t,n,r,i,a,o){super(e),this.name=`GraphQLError`,this.message=e,i&&(this.path=i),t&&(this.nodes=Array.isArray(t)?t:[t]),n&&(this.source=n),r&&(this.positions=r),a&&(this.originalError=a);var s=o;if(!s&&a){var c=a.extensions;c&&typeof c==`object`&&(s=c)}this.extensions=s||{}}toJSON(){return{...this,message:this.message}}toString(){return this.message}get[Symbol.toStringTag](){return`GraphQLError`}},W,G;function vt(e){return new _t(`Syntax Error: Unexpected token at ${G} in ${e}`)}function yt(e){if(e.lastIndex=G,e.test(W))return W.slice(G,G=e.lastIndex)}var bt=/ +(?=[^\s])/y;function xt(e){for(var t=e.split(`
3
+ `),n=``,r=0,i=0,a=t.length-1,o=0;o<t.length;o++)bt.lastIndex=0,bt.test(t[o])&&(o&&(!r||bt.lastIndex<r)&&(r=bt.lastIndex),i||=o,a=o);for(var s=i;s<=a;s++)s!==i&&(n+=`
4
+ `),n+=t[s].slice(r).replace(/\\"""/g,`"""`);return n}function K(){for(var e=0|W.charCodeAt(G++);e===9||e===10||e===13||e===32||e===35||e===44||e===65279;e=0|W.charCodeAt(G++))if(e===35)for(;(e=0|W.charCodeAt(G++))&&e!==10&&e!==13;);G--}function St(){for(var e=G,t=0|W.charCodeAt(G++);t>=48&&t<=57||t>=65&&t<=90||t===95||t>=97&&t<=122;t=0|W.charCodeAt(G++));if(e===G-1)throw vt(`Name`);var n=W.slice(e,--G);return K(),n}function Ct(){return{kind:`Name`,value:St()}}var wt=/(?:"""|(?:[\s\S]*?[^\\])""")/y,Tt=/(?:(?:\.\d+)?[eE][+-]?\d+|\.\d+)/y;function Et(e){var t;switch(W.charCodeAt(G)){case 91:G++,K();for(var n=[];W.charCodeAt(G)!==93;)n.push(Et(e));return G++,K(),{kind:`ListValue`,values:n};case 123:G++,K();for(var r=[];W.charCodeAt(G)!==125;){var i=Ct();if(W.charCodeAt(G++)!==58)throw vt(`ObjectField`);K(),r.push({kind:`ObjectField`,name:i,value:Et(e)})}return G++,K(),{kind:`ObjectValue`,fields:r};case 36:if(e)throw vt(`Variable`);return G++,{kind:`Variable`,name:Ct()};case 34:if(W.charCodeAt(G+1)===34&&W.charCodeAt(G+2)===34){if(G+=3,(t=yt(wt))==null)throw vt(`StringValue`);return K(),{kind:`StringValue`,value:xt(t.slice(0,-3)),block:!0}}var a=G,o;G++;var s=!1;for(o=0|W.charCodeAt(G++);o===92&&(G++,s=!0)||o!==10&&o!==13&&o!==34&&o;o=0|W.charCodeAt(G++));if(o!==34)throw vt(`StringValue`);return t=W.slice(a,G),K(),{kind:`StringValue`,value:s?JSON.parse(t):t.slice(1,-1),block:!1};case 45:case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:for(var c=G++,l;(l=0|W.charCodeAt(G++))>=48&&l<=57;);var u=W.slice(c,--G);if((l=W.charCodeAt(G))===46||l===69||l===101){if((t=yt(Tt))==null)throw vt(`FloatValue`);return K(),{kind:`FloatValue`,value:u+t}}return K(),{kind:`IntValue`,value:u};case 110:if(W.charCodeAt(G+1)===117&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===108)return G+=4,K(),{kind:`NullValue`};break;case 116:if(W.charCodeAt(G+1)===114&&W.charCodeAt(G+2)===117&&W.charCodeAt(G+3)===101)return G+=4,K(),{kind:`BooleanValue`,value:!0};break;case 102:if(W.charCodeAt(G+1)===97&&W.charCodeAt(G+2)===108&&W.charCodeAt(G+3)===115&&W.charCodeAt(G+4)===101)return G+=5,K(),{kind:`BooleanValue`,value:!1}}return{kind:`EnumValue`,value:St()}}function Dt(e){if(W.charCodeAt(G)===40){var t=[];G++,K();do{var n=Ct();if(W.charCodeAt(G++)!==58)throw vt(`Argument`);K(),t.push({kind:`Argument`,name:n,value:Et(e)})}while(W.charCodeAt(G)!==41);return G++,K(),t}}function Ot(e){if(W.charCodeAt(G)===64){var t=[];do G++,t.push({kind:`Directive`,name:Ct(),arguments:Dt(e)});while(W.charCodeAt(G)===64);return t}}function kt(){for(var e=0;W.charCodeAt(G)===91;)e++,G++,K();var t={kind:`NamedType`,name:Ct()};do if(W.charCodeAt(G)===33&&(G++,K(),t={kind:`NonNullType`,type:t}),e){if(W.charCodeAt(G++)!==93)throw vt(`NamedType`);K(),t={kind:`ListType`,type:t}}while(e--);return t}function At(){if(W.charCodeAt(G++)!==123)throw vt(`SelectionSet`);return K(),jt()}function jt(){var e=[];do if(W.charCodeAt(G)===46){if(W.charCodeAt(++G)!==46||W.charCodeAt(++G)!==46)throw vt(`SelectionSet`);switch(G++,K(),W.charCodeAt(G)){case 64:e.push({kind:`InlineFragment`,typeCondition:void 0,directives:Ot(!1),selectionSet:At()});break;case 111:W.charCodeAt(G+1)===110?(G+=2,K(),e.push({kind:`InlineFragment`,typeCondition:{kind:`NamedType`,name:Ct()},directives:Ot(!1),selectionSet:At()})):e.push({kind:`FragmentSpread`,name:Ct(),directives:Ot(!1)});break;case 123:G++,K(),e.push({kind:`InlineFragment`,typeCondition:void 0,directives:void 0,selectionSet:jt()});break;default:e.push({kind:`FragmentSpread`,name:Ct(),directives:Ot(!1)})}}else{var t=Ct(),n=void 0;W.charCodeAt(G)===58&&(G++,K(),n=t,t=Ct());var r=Dt(!1),i=Ot(!1),a=void 0;W.charCodeAt(G)===123&&(G++,K(),a=jt()),e.push({kind:`Field`,alias:n,name:t,arguments:r,directives:i,selectionSet:a})}while(W.charCodeAt(G)!==125);return G++,K(),{kind:`SelectionSet`,selections:e}}function Mt(){if(K(),W.charCodeAt(G)===40){var e=[];G++,K();do{var t=void 0;if(W.charCodeAt(G)===34&&(t=Et(!0)),W.charCodeAt(G++)!==36)throw vt(`Variable`);var n=Ct();if(W.charCodeAt(G++)!==58)throw vt(`VariableDefinition`);K();var r=kt(),i=void 0;W.charCodeAt(G)===61&&(G++,K(),i=Et(!0)),K();var a={kind:`VariableDefinition`,variable:{kind:`Variable`,name:n},type:r,defaultValue:i,directives:Ot(!0)};t&&(a.description=t),e.push(a)}while(W.charCodeAt(G)!==41);return G++,K(),e}}function Nt(e){var t=Ct();if(W.charCodeAt(G++)!==111||W.charCodeAt(G++)!==110)throw vt(`FragmentDefinition`);K();var n={kind:`FragmentDefinition`,name:t,typeCondition:{kind:`NamedType`,name:Ct()},directives:Ot(!1),selectionSet:At()};return e&&(n.description=e),n}function Pt(){var e=[];do{var t=void 0;if(W.charCodeAt(G)===34&&(t=Et(!0)),W.charCodeAt(G)===123){if(t)throw vt(`Document`);G++,K(),e.push({kind:`OperationDefinition`,operation:`query`,name:void 0,variableDefinitions:void 0,directives:void 0,selectionSet:jt()})}else{var n=St();switch(n){case`fragment`:e.push(Nt(t));break;case`query`:case`mutation`:case`subscription`:var r,i=void 0;(r=W.charCodeAt(G))!==40&&r!==64&&r!==123&&(i=Ct());var a={kind:`OperationDefinition`,operation:n,name:i,variableDefinitions:Mt(),directives:Ot(!1),selectionSet:At()};t&&(a.description=t),e.push(a);break;default:throw vt(`Document`)}}}while(G<W.length);return e}function Ft(e,t){return W=e.body?e.body:e,G=0,K(),t&&t.noLocation?{kind:`Document`,definitions:Pt()}:{kind:`Document`,definitions:Pt(),loc:{start:0,end:W.length,startToken:void 0,endToken:void 0,source:{body:W,name:`graphql.web`,locationOffset:{line:1,column:1}}}}}function It(e,t,n){for(var r=``,i=0;i<e.length;i++)i&&(r+=t),r+=n(e[i]);return r}function Lt(e){return JSON.stringify(e)}function Rt(e){return`"""
5
5
  `+e.replace(/"""/g,`\\"""`)+`
6
- """`}var Pt=`
7
- `,Ft={OperationDefinition(e){var t=``;e.description&&(t+=Ft.StringValue(e.description)+`
8
- `),t+=e.operation,e.name&&(t+=` `+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(t+=` `),t+=`(`+jt(e.variableDefinitions,`, `,Ft.VariableDefinition)+`)`),e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive));var n=Ft.SelectionSet(e.selectionSet);return t===`query`?n:t+` `+n},VariableDefinition(e){var t=``;return e.description&&(t+=Ft.StringValue(e.description)+` `),t+=Ft.Variable(e.variable)+`: `+It(e.type),e.defaultValue&&(t+=` = `+It(e.defaultValue)),e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive)),t},Field(e){var t=e.alias?e.alias.value+`: `+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var n=jt(e.arguments,`, `,Ft.Argument);t.length+n.length+2>80?t+=`(`+(Pt+=` `)+jt(e.arguments,Pt,Ft.Argument)+(Pt=Pt.slice(0,-2))+`)`:t+=`(`+n+`)`}return e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive)),e.selectionSet&&e.selectionSet.selections.length&&(t+=` `+Ft.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?Nt(e.value).replace(/\n/g,Pt):Mt(e.value)},BooleanValue:e=>``+e.value,NullValue:e=>`null`,IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>`$`+e.name.value,ListValue:e=>`[`+jt(e.values,`, `,It)+`]`,ObjectValue:e=>`{`+jt(e.fields,`, `,Ft.ObjectField)+`}`,ObjectField:e=>e.name.value+`: `+It(e.value),Document(e){return!e.definitions||!e.definitions.length?``:jt(e.definitions,`
9
-
10
- `,It)},SelectionSet:e=>`{`+(Pt+=` `)+jt(e.selections,Pt,It)+(Pt=Pt.slice(0,-2))+`}`,Argument:e=>e.name.value+`: `+It(e.value),FragmentSpread(e){var t=`...`+e.name.value;return e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive)),t},InlineFragment(e){var t=`...`;return e.typeCondition&&(t+=` on `+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive)),t+=` `+Ft.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t=``;return e.description&&(t+=Ft.StringValue(e.description)+`
11
- `),t+=`fragment `+e.name.value,t+=` on `+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=` `+jt(e.directives,` `,Ft.Directive)),t+` `+Ft.SelectionSet(e.selectionSet)},Directive(e){var t=`@`+e.name.value;return e.arguments&&e.arguments.length&&(t+=`(`+jt(e.arguments,`, `,Ft.Argument)+`)`),t},NamedType:e=>e.name.value,ListType:e=>`[`+It(e.type)+`]`,NonNullType:e=>It(e.type)+`!`},It=e=>Ft[e.kind](e);function Lt(e){return Pt=`
12
- `,Ft[e.kind]?Ft[e.kind](e):``}function Rt(e,t){switch(e.kind){case`NullValue`:return null;case`IntValue`:return parseInt(e.value,10);case`FloatValue`:return parseFloat(e.value);case`StringValue`:case`EnumValue`:case`BooleanValue`:return e.value;case`ListValue`:for(var n=[],r=0,i=e.values.length;r<i;r++)n.push(Rt(e.values[r],t));return n;case`ObjectValue`:for(var a=Object.create(null),o=0,s=e.fields.length;o<s;o++){var c=e.fields[o];a[c.name.value]=Rt(c.value,t)}return a;case`Variable`:return t&&t[e.name.value]}}var zt=()=>{},Bt=zt;function Vt(e){return{tag:0,0:e}}function Ht(e){return{tag:1,0:e}}var Ut=()=>typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`,Wt=e=>e;function Gt(e){return t=>n=>{var r=Bt;t((t=>{t===0?n(0):t.tag===0?(r=t[0],n(t)):e(t[0])?n(t):r(0)}))}}function Kt(e){return t=>n=>t((t=>{t===0||t.tag===0?n(t):n(Ht(e(t[0])))}))}function qt(e){return t=>n=>{var r=[],i=Bt,a=!1,o=!1;t((t=>{o||(t===0?(o=!0,r.length||n(0)):t.tag===0?i=t[0]:(a=!1,(function(e){var t=Bt;e((e=>{if(e===0){if(r.length){var s=r.indexOf(t);s>-1&&(r=r.slice()).splice(s,1),r.length||(o?n(0):a||(a=!0,i(0)))}}else e.tag===0?(r.push(t=e[0]),t(0)):r.length&&(n(e),t(0))}))})(e(t[0])),a||(a=!0,i(0))))})),n(Vt((e=>{if(e===1){o||(o=!0,i(1));for(var t=0,n=r,s=r.length;t<s;t++)n[t](1);r.length=0}else{!o&&!a?(a=!0,i(0)):a=!1;for(var c=0,l=r,u=r.length;c<u;c++)l[c](0)}})))}}function Jt(e){return qt(Wt)(e)}function Yt(e){return Jt(cn(e))}function Xt(e){return t=>n=>{var r=!1;t((t=>{if(!r){if(t===0)r=!0,n(0),e();else if(t.tag===0){var i=t[0];n(Vt((t=>{t===1?(r=!0,i(1),e()):i(t)})))}else n(t)}}))}}function Zt(e){return t=>n=>{var r=!1;t((t=>{if(!r){if(t===0)r=!0,n(0);else if(t.tag===0){var i=t[0];n(Vt((e=>{e===1&&(r=!0),i(e)})))}else e(t[0]),n(t)}}))}}function Qt(e){return t=>n=>t((t=>{t===0?n(0):t.tag===0?(n(t),e()):n(t)}))}function $t(e){var t=[],n=Bt,r=!1;return i=>{t.push(i),t.length===1&&e((e=>{if(e===0){for(var i=0,a=t,o=t.length;i<o;i++)a[i](0);t.length=0}else if(e.tag===0)n=e[0];else{r=!1;for(var s=0,c=t,l=t.length;s<l;s++)c[s](e)}})),i(Vt((e=>{if(e===1){var a=t.indexOf(i);a>-1&&(t=t.slice()).splice(a,1),t.length||n(1)}else r||(r=!0,n(0))})))}}function en(e){return t=>n=>{var r=Bt,i=Bt,a=!1,o=!1,s=!1,c=!1;t((t=>{c||(t===0?(c=!0,s||n(0)):t.tag===0?r=t[0]:(s&&(i(1),i=Bt),a?a=!1:(a=!0,r(0)),(function(e){s=!0,e((e=>{s&&(e===0?(s=!1,c?n(0):a||(a=!0,r(0))):e.tag===0?(o=!1,(i=e[0])(0)):(n(e),o?o=!1:i(0)))}))})(e(t[0]))))})),n(Vt((e=>{e===1?(c||(c=!0,r(1)),s&&(s=!1,i(1))):(!c&&!a&&(a=!0,r(0)),s&&!o&&(o=!0,i(0)))})))}}function tn(e){return t=>n=>{var r=Bt,i=!1,a=0;t((t=>{i||(t===0?(i=!0,n(0)):t.tag===0?e<=0?(i=!0,n(0),t[0](1)):r=t[0]:a++<e?(n(t),!i&&a>=e&&(i=!0,n(0),r(1))):n(t))})),n(Vt((t=>{t===1&&!i?(i=!0,r(1)):t===0&&!i&&a<e&&r(0)})))}}function nn(e){return t=>n=>{var r=Bt,i=Bt,a=!1;t((t=>{a||(t===0?(a=!0,i(1),n(0)):t.tag===0?(r=t[0],e((e=>{e===0||(e.tag===0?(i=e[0])(0):(a=!0,i(1),r(1),n(0)))}))):n(t))})),n(Vt((e=>{e===1&&!a?(a=!0,r(1),i(1)):a||r(0)})))}}function rn(e,t){return n=>r=>{var i=Bt,a=!1;n((n=>{a||(n===0?(a=!0,r(0)):n.tag===0?(i=n[0],r(n)):e(n[0])?r(n):(a=!0,t&&r(n),r(0),i(1)))}))}}function an(e){return t=>e()(t)}function on(e){return t=>{var n=e[Ut()]&&e[Ut()]()||e,r=!1,i=!1,a=!1,o;t(Vt((async e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=await n.next()).done)r=!0,n.return&&await n.return(),t(0);else try{a=!1,t(Ht(o.value))}catch(e){if(n.throw)(r=!!(await n.throw(e)).done)&&t(0);else throw e}i=!1}})))}}function sn(e){return e[Symbol.asyncIterator]?on(e):t=>{var n=e[Symbol.iterator](),r=!1,i=!1,a=!1,o;t(Vt((e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=n.next()).done)r=!0,n.return&&n.return(),t(0);else try{a=!1,t(Ht(o.value))}catch(e){if(n.throw)(r=!!n.throw(e).done)&&t(0);else throw e}i=!1}})))}}var cn=sn;function ln(e){return t=>{var n=!1;t(Vt((r=>{r===1?n=!0:n||(n=!0,t(Ht(e)),t(0))})))}}function un(e){return t=>{var n=!1,r=e({next(e){n||t(Ht(e))},complete(){n||(n=!0,t(0))}});t(Vt((e=>{e===1&&!n&&(n=!0,r())})))}}function dn(){var e,t;return{source:$t(un((n=>(e=n.next,t=n.complete,zt)))),next(t){e&&e(t)},complete(){t&&t()}}}var fn=e=>{var t=!1;e(Vt((n=>{n===1?t=!0:t||(t=!0,e(0))})))};function pn(e){return un((t=>(e.then((e=>{Promise.resolve(e).then((()=>{t.next(e),t.complete()}))})),zt)))}function mn(e){return t=>{var n=Bt,r=!1;return t((t=>{t===0?r=!0:t.tag===0?(n=t[0])(0):r||(e(t[0]),n(0))})),{unsubscribe(){r||(r=!0,n(1))}}}}function hn(e){mn((e=>{}))(e)}function gn(e){return new Promise((t=>{var n=Bt,r;e((e=>{e===0?Promise.resolve(r).then(t):e.tag===0?(n=e[0])(0):(r=e[0],n(0))}))}))}var _n=(...e)=>{for(var t=e[0],n=1,r=e.length;n<r;n++)t=e[n](t);return t},vn=e=>e&&typeof e.message==`string`&&(e.extensions||e.name===`GraphQLError`)?e:typeof e==`object`&&typeof e.message==`string`?new ft(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new ft(e),yn=class extends Error{constructor(e){var t=(e.graphQLErrors||[]).map(vn),n=((e,t)=>{var n=``;if(e)return`[Network] ${e.message}`;if(t)for(var r=0,i=t.length;r<i;r++)n&&(n+=`
13
- `),n+=`[GraphQL] ${t[r].message}`;return n})(e.networkError,t);super(n),this.name=`CombinedError`,this.message=n,this.graphQLErrors=t,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},bn=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},xn=new Set,Sn=new WeakMap,Cn=(e,t)=>{if(e===null||xn.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return Cn(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=Cn(e[r],t)||`null`;return n+=`]`}if(!t&&(Dn!==En&&e instanceof Dn||On!==En&&e instanceof On))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=Sn.get(e)||Math.random().toString(36).slice(2);return Sn.set(e,o),Cn({__key:o},t)}xn.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=Cn(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=Cn(a[c],t)+`:`+u)}return xn.delete(e),s+=`}`},wn=(e,t,n)=>{if(!(typeof n!=`object`||!n||n.toJSON||xn.has(n))){if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)wn(e,`${t}.${r}`,n[r]);else if(n instanceof Dn||n instanceof On)e.set(t,n);else for(var a in xn.add(n),n)wn(e,`${t}.${a}`,n[a])}},Tn=(e,t)=>(xn.clear(),Cn(e,t||!1)),En=class{},Dn=typeof File<`u`?File:En,On=typeof Blob<`u`?Blob:En,kn=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,An=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,jn=(e,t)=>t%2==0?e.replace(An,`
14
- `):e,Mn=e=>e.split(kn).map(jn).join(``).trim(),Nn=new Map,Pn=new Map,Fn=e=>{var t;return typeof e==`string`?t=Mn(e):e.loc&&Pn.get(e.__key)===e?t=e.loc.source.body:(t=Nn.get(e)||Mn(Lt(e)),Nn.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},In=e=>{var t;if(e.documentId)t=bn(e.documentId);else if(t=bn(Fn(e)),e.definitions){var n=zn(e);n&&(t=bn(`\n# ${n}`,t))}return t},Ln=e=>{var t,n;return typeof e==`string`?(t=In(e),n=Pn.get(t)||At(e,{noLocation:!0})):(t=e.__key||In(e),n=Pn.get(t)||e),n.loc||Fn(n),n.__key=t,Pn.set(t,n),n},Rn=(e,t,n)=>{var r=t||{},i=Ln(e),a=Tn(r,!0),o=i.__key;return a!==`{}`&&(o=bn(a,o)),{key:o,query:i,variables:r,extensions:n}},zn=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===dt.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},Bn=(e,t,n)=>{if(!(`data`in t||`errors`in t&&Array.isArray(t.errors)))throw Error(`No Content`);var r=e.kind===`subscription`;return{operation:e,data:t.data,error:Array.isArray(t.errors)?new yn({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},Vn=(e,t)=>{if(typeof e==`object`&&e){if(Array.isArray(e)){e=[...e];for(var n=0,r=t.length;n<r;n++)e[n]=Vn(e[n],t[n]);return e}if(!e.constructor||e.constructor===Object){for(var i in e={...e},t)e[i]=Vn(e[i],t[i]);return e}}return t},Hn=(e,t,n,r)=>{var i=e.error?e.error.graphQLErrors:[],a=!!e.extensions||!!(t.payload||t).extensions,o={...e.extensions,...(t.payload||t).extensions},s=t.incremental;`path`in t&&(s=[t]);var c={data:e.data};if(s)for(var l=function(){var e=s[u];Array.isArray(e.errors)&&i.push(...e.errors),e.extensions&&(Object.assign(o,e.extensions),a=!0);var t=`data`,n=c,l=[];if(e.path)l=e.path;else if(r){var d=r.find((t=>t.id===e.id));l=e.subPath?[...d.path,...e.subPath]:d.path}for(var f=0,p=l.length;f<p;t=l[f++])n=n[t]=Array.isArray(n[t])?[...n[t]]:{...n[t]};if(e.items)for(var m=+t>=0?t:0,h=0,g=e.items.length;h<g;h++)n[m+h]=Vn(n[m+h],e.items[h]);else e.data!==void 0&&(n[t]=Vn(n[t],e.data))},u=0,d=s.length;u<d;u++)l();else c.data=(t.payload||t).data||e.data,i=t.errors||t.payload&&t.payload.errors||i;return{operation:e.operation,data:c.data,error:i.length?new yn({graphQLErrors:i,response:n}):void 0,extensions:a?o:void 0,hasNext:t.hasNext==null?e.hasNext:t.hasNext,stale:!1}},Un=(e,t,n)=>({operation:e,data:void 0,error:new yn({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function Wn(e){var t={query:void 0,documentId:void 0,operationName:zn(e.query),variables:e.variables||void 0,extensions:e.extensions};return`documentId`in e.query&&e.query.documentId&&(!e.query.definitions||!e.query.definitions.length)?t.documentId=e.query.documentId:(!e.extensions||!e.extensions.persistedQuery||e.extensions.persistedQuery.miss)&&(t.query=Fn(e.query)),t}var Gn=(e,t)=>{var n=e.kind===`query`&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=Kn(e.context.url);for(var i in t){var a=t[i];a&&r[1].set(i,typeof a==`object`?Tn(a):a)}var o=r.join(`?`);return o.length>2047&&n!==`force`?(e.context.preferGetMethod=!1,e.context.url):o},Kn=e=>{var t=e.indexOf(`?`);return t>-1?[e.slice(0,t),new URLSearchParams(e.slice(t+1))]:[e,new URLSearchParams]},qn=(e,t)=>{if(t&&!(e.kind===`query`&&e.context.preferGetMethod)){var n=Tn(t),r=(e=>{var t=new Map;return(Dn!==En||On!==En)&&(xn.clear(),wn(t,`variables`,e)),t})(t.variables);if(r.size){var i=new FormData;i.append(`operations`,n),i.append(`map`,Tn({...[...r.keys()].map((e=>[e]))}));var a=0;for(var o of r.values())i.append(``+a++,o);return i}return n}},Jn=(e,t)=>{var n={accept:e.kind===`subscription`?`text/event-stream, multipart/mixed`:`application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed`},r=(typeof e.context.fetchOptions==`function`?e.context.fetchOptions():e.context.fetchOptions)||{};if(r.headers){if((e=>`has`in e&&!Object.keys(e).length)(r.headers))r.headers.forEach(((e,t)=>{n[t]=e}));else if(Array.isArray(r.headers))r.headers.forEach(((e,t)=>{Array.isArray(e)?n[e[0]]?n[e[0]]=`${n[e[0]]},${e[1]}`:n[e[0]]=e[1]:n[t]=e}));else for(var i in r.headers)n[i.toLowerCase()]=r.headers[i]}var a=qn(e,t);return typeof a==`string`&&!n[`content-type`]&&(n[`content-type`]=`application/json`),{...r,method:a?`POST`:`GET`,body:a,headers:n}},Yn=/boundary="?([^=";]+)"?/i,Xn=/data: ?([^\n]+)/;async function*Zn(e){if(e.body[Symbol.asyncIterator])for await(var t of e.body)yield t;else{var n=e.body.getReader(),r;try{for(;!(r=await n.read()).done;)yield r.value}finally{n.cancel()}}}async function*Qn(e,t){var n=typeof TextDecoder<`u`?new TextDecoder:null,r=``,i;for await(var a of e)for(r+=a.constructor.name===`Buffer`?a.toString():n.decode(a,{stream:!0});(i=r.indexOf(t))>-1;)yield r.slice(0,i),r=r.slice(i+t.length)}async function*$n(e,t,n){var r=!0,i=null,a;try{yield await Promise.resolve();var o=(a=await(e.context.fetch||fetch)(t,n)).headers.get(`Content-Type`)||``,s=/multipart\/mixed/i.test(o)?async function*(e,t){var n=e.match(Yn),r=`--`+(n?n[1]:`-`),i=!0,a;for await(var o of Qn(Zn(t),`\r
6
+ """`}var zt=`
7
+ `,Bt={OperationDefinition(e){var t=``;e.description&&(t+=Bt.StringValue(e.description)+`
8
+ `),t+=e.operation,e.name&&(t+=` `+e.name.value),e.variableDefinitions&&e.variableDefinitions.length&&(e.name||(t+=` `),t+=`(`+It(e.variableDefinitions,`, `,Bt.VariableDefinition)+`)`),e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive));var n=Bt.SelectionSet(e.selectionSet);return t===`query`?n:t+` `+n},VariableDefinition(e){var t=``;return e.description&&(t+=Bt.StringValue(e.description)+` `),t+=Bt.Variable(e.variable)+`: `+Vt(e.type),e.defaultValue&&(t+=` = `+Vt(e.defaultValue)),e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive)),t},Field(e){var t=e.alias?e.alias.value+`: `+e.name.value:e.name.value;if(e.arguments&&e.arguments.length){var n=It(e.arguments,`, `,Bt.Argument);t.length+n.length+2>80?t+=`(`+(zt+=` `)+It(e.arguments,zt,Bt.Argument)+(zt=zt.slice(0,-2))+`)`:t+=`(`+n+`)`}return e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive)),e.selectionSet&&e.selectionSet.selections.length&&(t+=` `+Bt.SelectionSet(e.selectionSet)),t},StringValue(e){return e.block?Rt(e.value).replace(/\n/g,zt):Lt(e.value)},BooleanValue:e=>``+e.value,NullValue:e=>`null`,IntValue:e=>e.value,FloatValue:e=>e.value,EnumValue:e=>e.value,Name:e=>e.value,Variable:e=>`$`+e.name.value,ListValue:e=>`[`+It(e.values,`, `,Vt)+`]`,ObjectValue:e=>`{`+It(e.fields,`, `,Bt.ObjectField)+`}`,ObjectField:e=>e.name.value+`: `+Vt(e.value),Document(e){return!e.definitions||!e.definitions.length?``:It(e.definitions,`
9
+
10
+ `,Vt)},SelectionSet:e=>`{`+(zt+=` `)+It(e.selections,zt,Vt)+(zt=zt.slice(0,-2))+`}`,Argument:e=>e.name.value+`: `+Vt(e.value),FragmentSpread(e){var t=`...`+e.name.value;return e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive)),t},InlineFragment(e){var t=`...`;return e.typeCondition&&(t+=` on `+e.typeCondition.name.value),e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive)),t+=` `+Bt.SelectionSet(e.selectionSet)},FragmentDefinition(e){var t=``;return e.description&&(t+=Bt.StringValue(e.description)+`
11
+ `),t+=`fragment `+e.name.value,t+=` on `+e.typeCondition.name.value,e.directives&&e.directives.length&&(t+=` `+It(e.directives,` `,Bt.Directive)),t+` `+Bt.SelectionSet(e.selectionSet)},Directive(e){var t=`@`+e.name.value;return e.arguments&&e.arguments.length&&(t+=`(`+It(e.arguments,`, `,Bt.Argument)+`)`),t},NamedType:e=>e.name.value,ListType:e=>`[`+Vt(e.type)+`]`,NonNullType:e=>Vt(e.type)+`!`},Vt=e=>Bt[e.kind](e);function Ht(e){return zt=`
12
+ `,Bt[e.kind]?Bt[e.kind](e):``}function Ut(e,t){switch(e.kind){case`NullValue`:return null;case`IntValue`:return parseInt(e.value,10);case`FloatValue`:return parseFloat(e.value);case`StringValue`:case`EnumValue`:case`BooleanValue`:return e.value;case`ListValue`:for(var n=[],r=0,i=e.values.length;r<i;r++)n.push(Ut(e.values[r],t));return n;case`ObjectValue`:for(var a=Object.create(null),o=0,s=e.fields.length;o<s;o++){var c=e.fields[o];a[c.name.value]=Ut(c.value,t)}return a;case`Variable`:return t&&t[e.name.value]}}var Wt=()=>{},Gt=Wt;function Kt(e){return{tag:0,0:e}}function qt(e){return{tag:1,0:e}}var Jt=()=>typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`,Yt=e=>e;function Xt(e){return t=>n=>{var r=Gt;t((t=>{t===0?n(0):t.tag===0?(r=t[0],n(t)):e(t[0])?n(t):r(0)}))}}function Zt(e){return t=>n=>t((t=>{t===0||t.tag===0?n(t):n(qt(e(t[0])))}))}function Qt(e){return t=>n=>{var r=[],i=Gt,a=!1,o=!1;t((t=>{o||(t===0?(o=!0,r.length||n(0)):t.tag===0?i=t[0]:(a=!1,(function(e){var t=Gt;e((e=>{if(e===0){if(r.length){var s=r.indexOf(t);s>-1&&(r=r.slice()).splice(s,1),r.length||(o?n(0):a||(a=!0,i(0)))}}else e.tag===0?(r.push(t=e[0]),t(0)):r.length&&(n(e),t(0))}))})(e(t[0])),a||(a=!0,i(0))))})),n(Kt((e=>{if(e===1){o||(o=!0,i(1));for(var t=0,n=r,s=r.length;t<s;t++)n[t](1);r.length=0}else{!o&&!a?(a=!0,i(0)):a=!1;for(var c=0,l=r,u=r.length;c<u;c++)l[c](0)}})))}}function $t(e){return Qt(Yt)(e)}function en(e){return $t(pn(e))}function tn(e){return t=>n=>{var r=!1;t((t=>{if(!r){if(t===0)r=!0,n(0),e();else if(t.tag===0){var i=t[0];n(Kt((t=>{t===1?(r=!0,i(1),e()):i(t)})))}else n(t)}}))}}function nn(e){return t=>n=>{var r=!1;t((t=>{if(!r){if(t===0)r=!0,n(0);else if(t.tag===0){var i=t[0];n(Kt((e=>{e===1&&(r=!0),i(e)})))}else e(t[0]),n(t)}}))}}function rn(e){return t=>n=>t((t=>{t===0?n(0):t.tag===0?(n(t),e()):n(t)}))}function an(e){var t=[],n=Gt,r=!1;return i=>{t.push(i),t.length===1&&e((e=>{if(e===0){for(var i=0,a=t,o=t.length;i<o;i++)a[i](0);t.length=0}else if(e.tag===0)n=e[0];else{r=!1;for(var s=0,c=t,l=t.length;s<l;s++)c[s](e)}})),i(Kt((e=>{if(e===1){var a=t.indexOf(i);a>-1&&(t=t.slice()).splice(a,1),t.length||n(1)}else r||(r=!0,n(0))})))}}function on(e){return t=>n=>{var r=Gt,i=Gt,a=!1,o=!1,s=!1,c=!1;t((t=>{c||(t===0?(c=!0,s||n(0)):t.tag===0?r=t[0]:(s&&(i(1),i=Gt),a?a=!1:(a=!0,r(0)),(function(e){s=!0,e((e=>{s&&(e===0?(s=!1,c?n(0):a||(a=!0,r(0))):e.tag===0?(o=!1,(i=e[0])(0)):(n(e),o?o=!1:i(0)))}))})(e(t[0]))))})),n(Kt((e=>{e===1?(c||(c=!0,r(1)),s&&(s=!1,i(1))):(!c&&!a&&(a=!0,r(0)),s&&!o&&(o=!0,i(0)))})))}}function sn(e){return t=>n=>{var r=Gt,i=!1,a=0;t((t=>{i||(t===0?(i=!0,n(0)):t.tag===0?e<=0?(i=!0,n(0),t[0](1)):r=t[0]:a++<e?(n(t),!i&&a>=e&&(i=!0,n(0),r(1))):n(t))})),n(Kt((t=>{t===1&&!i?(i=!0,r(1)):t===0&&!i&&a<e&&r(0)})))}}function cn(e){return t=>n=>{var r=Gt,i=Gt,a=!1;t((t=>{a||(t===0?(a=!0,i(1),n(0)):t.tag===0?(r=t[0],e((e=>{e===0||(e.tag===0?(i=e[0])(0):(a=!0,i(1),r(1),n(0)))}))):n(t))})),n(Kt((e=>{e===1&&!a?(a=!0,r(1),i(1)):a||r(0)})))}}function ln(e,t){return n=>r=>{var i=Gt,a=!1;n((n=>{a||(n===0?(a=!0,r(0)):n.tag===0?(i=n[0],r(n)):e(n[0])?r(n):(a=!0,t&&r(n),r(0),i(1)))}))}}function un(e){return t=>e()(t)}function dn(e){return t=>{var n=e[Jt()]&&e[Jt()]()||e,r=!1,i=!1,a=!1,o;t(Kt((async e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=await n.next()).done)r=!0,n.return&&await n.return(),t(0);else try{a=!1,t(qt(o.value))}catch(e){if(n.throw)(r=!!(await n.throw(e)).done)&&t(0);else throw e}i=!1}})))}}function fn(e){return e[Symbol.asyncIterator]?dn(e):t=>{var n=e[Symbol.iterator](),r=!1,i=!1,a=!1,o;t(Kt((e=>{if(e===1)r=!0,n.return&&n.return();else if(i)a=!0;else{for(a=i=!0;a&&!r;)if((o=n.next()).done)r=!0,n.return&&n.return(),t(0);else try{a=!1,t(qt(o.value))}catch(e){if(n.throw)(r=!!n.throw(e).done)&&t(0);else throw e}i=!1}})))}}var pn=fn;function mn(e){return t=>{var n=!1;t(Kt((r=>{r===1?n=!0:n||(n=!0,t(qt(e)),t(0))})))}}function hn(e){return t=>{var n=!1,r=e({next(e){n||t(qt(e))},complete(){n||(n=!0,t(0))}});t(Kt((e=>{e===1&&!n&&(n=!0,r())})))}}function gn(){var e,t;return{source:an(hn((n=>(e=n.next,t=n.complete,Wt)))),next(t){e&&e(t)},complete(){t&&t()}}}var _n=e=>{var t=!1;e(Kt((n=>{n===1?t=!0:t||(t=!0,e(0))})))};function vn(e){return hn((t=>(e.then((e=>{Promise.resolve(e).then((()=>{t.next(e),t.complete()}))})),Wt)))}function yn(e){return t=>{var n=Gt,r=!1;return t((t=>{t===0?r=!0:t.tag===0?(n=t[0])(0):r||(e(t[0]),n(0))})),{unsubscribe(){r||(r=!0,n(1))}}}}function bn(e){yn((e=>{}))(e)}function xn(e){return new Promise((t=>{var n=Gt,r;e((e=>{e===0?Promise.resolve(r).then(t):e.tag===0?(n=e[0])(0):(r=e[0],n(0))}))}))}var Sn=(...e)=>{for(var t=e[0],n=1,r=e.length;n<r;n++)t=e[n](t);return t},Cn=e=>e&&typeof e.message==`string`&&(e.extensions||e.name===`GraphQLError`)?e:typeof e==`object`&&typeof e.message==`string`?new _t(e.message,e.nodes,e.source,e.positions,e.path,e,e.extensions||{}):new _t(e),wn=class extends Error{constructor(e){var t=(e.graphQLErrors||[]).map(Cn),n=((e,t)=>{var n=``;if(e)return`[Network] ${e.message}`;if(t)for(var r=0,i=t.length;r<i;r++)n&&(n+=`
13
+ `),n+=`[GraphQL] ${t[r].message}`;return n})(e.networkError,t);super(n),this.name=`CombinedError`,this.message=n,this.graphQLErrors=t,this.networkError=e.networkError,this.response=e.response}toString(){return this.message}},Tn=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},En=new Set,Dn=new WeakMap,On=(e,t)=>{if(e===null||En.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return On(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=On(e[r],t)||`null`;return n+=`]`}if(!t&&(Mn!==jn&&e instanceof Mn||Nn!==jn&&e instanceof Nn))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=Dn.get(e)||Math.random().toString(36).slice(2);return Dn.set(e,o),On({__key:o},t)}En.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=On(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=On(a[c],t)+`:`+u)}return En.delete(e),s+=`}`},kn=(e,t,n)=>{if(!(typeof n!=`object`||!n||n.toJSON||En.has(n))){if(Array.isArray(n))for(var r=0,i=n.length;r<i;r++)kn(e,`${t}.${r}`,n[r]);else if(n instanceof Mn||n instanceof Nn)e.set(t,n);else for(var a in En.add(n),n)kn(e,`${t}.${a}`,n[a])}},An=(e,t)=>(En.clear(),On(e,t||!1)),jn=class{},Mn=typeof File<`u`?File:jn,Nn=typeof Blob<`u`?Blob:jn,Pn=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,Fn=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,In=(e,t)=>t%2==0?e.replace(Fn,`
14
+ `):e,Ln=e=>e.split(Pn).map(In).join(``).trim(),Rn=new Map,zn=new Map,Bn=e=>{var t;return typeof e==`string`?t=Ln(e):e.loc&&zn.get(e.__key)===e?t=e.loc.source.body:(t=Rn.get(e)||Ln(Ht(e)),Rn.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},Vn=e=>{var t;if(e.documentId)t=Tn(e.documentId);else if(t=Tn(Bn(e)),e.definitions){var n=Wn(e);n&&(t=Tn(`\n# ${n}`,t))}return t},Hn=e=>{var t,n;return typeof e==`string`?(t=Vn(e),n=zn.get(t)||Ft(e,{noLocation:!0})):(t=e.__key||Vn(e),n=zn.get(t)||e),n.loc||Bn(n),n.__key=t,zn.set(t,n),n},Un=(e,t,n)=>{var r=t||{},i=Hn(e),a=An(r,!0),o=i.__key;return a!==`{}`&&(o=Tn(a,o)),{key:o,query:i,variables:r,extensions:n}},Wn=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===gt.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},Gn=(e,t,n)=>{if(!(`data`in t||`errors`in t&&Array.isArray(t.errors)))throw Error(`No Content`);var r=e.kind===`subscription`;return{operation:e,data:t.data,error:Array.isArray(t.errors)?new wn({graphQLErrors:t.errors,response:n}):void 0,extensions:t.extensions?{...t.extensions}:void 0,hasNext:t.hasNext==null?r:t.hasNext,stale:!1}},Kn=(e,t)=>{if(typeof e==`object`&&e){if(Array.isArray(e)){e=[...e];for(var n=0,r=t.length;n<r;n++)e[n]=Kn(e[n],t[n]);return e}if(!e.constructor||e.constructor===Object){for(var i in e={...e},t)e[i]=Kn(e[i],t[i]);return e}}return t},qn=(e,t,n,r)=>{var i=e.error?e.error.graphQLErrors:[],a=!!e.extensions||!!(t.payload||t).extensions,o={...e.extensions,...(t.payload||t).extensions},s=t.incremental;`path`in t&&(s=[t]);var c={data:e.data};if(s)for(var l=function(){var e=s[u];Array.isArray(e.errors)&&i.push(...e.errors),e.extensions&&(Object.assign(o,e.extensions),a=!0);var t=`data`,n=c,l=[];if(e.path)l=e.path;else if(r){var d=r.find((t=>t.id===e.id));l=e.subPath?[...d.path,...e.subPath]:d.path}for(var f=0,p=l.length;f<p;t=l[f++])n=n[t]=Array.isArray(n[t])?[...n[t]]:{...n[t]};if(e.items)for(var m=+t>=0?t:0,h=0,g=e.items.length;h<g;h++)n[m+h]=Kn(n[m+h],e.items[h]);else e.data!==void 0&&(n[t]=Kn(n[t],e.data))},u=0,d=s.length;u<d;u++)l();else c.data=(t.payload||t).data||e.data,i=t.errors||t.payload&&t.payload.errors||i;return{operation:e.operation,data:c.data,error:i.length?new wn({graphQLErrors:i,response:n}):void 0,extensions:a?o:void 0,hasNext:t.hasNext==null?e.hasNext:t.hasNext,stale:!1}},Jn=(e,t,n)=>({operation:e,data:void 0,error:new wn({networkError:t,response:n}),extensions:void 0,hasNext:!1,stale:!1});function Yn(e){var t={query:void 0,documentId:void 0,operationName:Wn(e.query),variables:e.variables||void 0,extensions:e.extensions};return`documentId`in e.query&&e.query.documentId&&(!e.query.definitions||!e.query.definitions.length)?t.documentId=e.query.documentId:(!e.extensions||!e.extensions.persistedQuery||e.extensions.persistedQuery.miss)&&(t.query=Bn(e.query)),t}var Xn=(e,t)=>{var n=e.kind===`query`&&e.context.preferGetMethod;if(!n||!t)return e.context.url;var r=Zn(e.context.url);for(var i in t){var a=t[i];a&&r[1].set(i,typeof a==`object`?An(a):a)}var o=r.join(`?`);return o.length>2047&&n!==`force`?(e.context.preferGetMethod=!1,e.context.url):o},Zn=e=>{var t=e.indexOf(`?`);return t>-1?[e.slice(0,t),new URLSearchParams(e.slice(t+1))]:[e,new URLSearchParams]},Qn=(e,t)=>{if(t&&!(e.kind===`query`&&e.context.preferGetMethod)){var n=An(t),r=(e=>{var t=new Map;return(Mn!==jn||Nn!==jn)&&(En.clear(),kn(t,`variables`,e)),t})(t.variables);if(r.size){var i=new FormData;i.append(`operations`,n),i.append(`map`,An({...[...r.keys()].map((e=>[e]))}));var a=0;for(var o of r.values())i.append(``+a++,o);return i}return n}},$n=(e,t)=>{var n={accept:e.kind===`subscription`?`text/event-stream, multipart/mixed`:`application/graphql-response+json, application/graphql+json, application/json, text/event-stream, multipart/mixed`},r=(typeof e.context.fetchOptions==`function`?e.context.fetchOptions():e.context.fetchOptions)||{};if(r.headers){if((e=>`has`in e&&!Object.keys(e).length)(r.headers))r.headers.forEach(((e,t)=>{n[t]=e}));else if(Array.isArray(r.headers))r.headers.forEach(((e,t)=>{Array.isArray(e)?n[e[0]]?n[e[0]]=`${n[e[0]]},${e[1]}`:n[e[0]]=e[1]:n[t]=e}));else for(var i in r.headers)n[i.toLowerCase()]=r.headers[i]}var a=Qn(e,t);return typeof a==`string`&&!n[`content-type`]&&(n[`content-type`]=`application/json`),{...r,method:a?`POST`:`GET`,body:a,headers:n}},er=/boundary="?([^=";]+)"?/i,tr=/data: ?([^\n]+)/;async function*nr(e){if(e.body[Symbol.asyncIterator])for await(var t of e.body)yield t;else{var n=e.body.getReader(),r;try{for(;!(r=await n.read()).done;)yield r.value}finally{n.cancel()}}}async function*rr(e,t){var n=typeof TextDecoder<`u`?new TextDecoder:null,r=``,i;for await(var a of e)for(r+=a.constructor.name===`Buffer`?a.toString():n.decode(a,{stream:!0});(i=r.indexOf(t))>-1;)yield r.slice(0,i),r=r.slice(i+t.length)}async function*ir(e,t,n){var r=!0,i=null,a;try{yield await Promise.resolve();var o=(a=await(e.context.fetch||fetch)(t,n)).headers.get(`Content-Type`)||``,s=/multipart\/mixed/i.test(o)?async function*(e,t){var n=e.match(er),r=`--`+(n?n[1]:`-`),i=!0,a;for await(var o of rr(nr(t),`\r
15
15
  `+r)){if(i){i=!1;var s=o.indexOf(r);if(s>-1)o=o.slice(s+r.length);else continue}try{yield a=JSON.parse(o.slice(o.indexOf(`\r
16
16
  \r
17
- `)+4))}catch(e){if(!a)throw e}if(a&&!1===a.hasNext)break}a&&!1!==a.hasNext&&(yield{hasNext:!1})}(o,a):/text\/event-stream/i.test(o)?async function*(e){var t;for await(var n of Qn(Zn(e),`
17
+ `)+4))}catch(e){if(!a)throw e}if(a&&!1===a.hasNext)break}a&&!1!==a.hasNext&&(yield{hasNext:!1})}(o,a):/text\/event-stream/i.test(o)?async function*(e){var t;for await(var n of rr(nr(e),`
18
18
 
19
- `)){var r=n.match(Xn);if(r){var i=r[1];try{yield t=JSON.parse(i)}catch(e){if(!t)throw e}if(t&&!1===t.hasNext)break}}t&&!1!==t.hasNext&&(yield{hasNext:!1})}(a):/text\//i.test(o)?async function*(e){var t=await e.text();try{yield JSON.parse(t)}catch{throw Error(t)}}(a):async function*(e){yield JSON.parse(await e.text())}(a),c;for await(var l of s)l.pending&&!i?c=l.pending:l.pending&&(c=[...c,...l.pending]),i=i?Hn(i,l,a,c):Bn(e,l,a),r=!1,yield i,r=!0;i||(yield i=Bn(e,{},a))}catch(t){if(!r)throw t;yield Un(e,a&&(a.status<200||a.status>=300)&&a.statusText?Error(a.statusText):t,a)}}function er(e,t,n){var r;return typeof AbortController<`u`&&(n.signal=(r=new AbortController).signal),Xt((()=>{r&&r.abort()}))(Gt((e=>!!e))(on($n(e,t,n))))}function tr(e){var t=t=>e(t);return t.toPromise=()=>gn(tn(1)(Gt((e=>!e.stale&&!e.hasNext))(t))),t.then=(e,n)=>t.toPromise().then(e,n),t.subscribe=e=>mn(e)(t),t}function nr(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var rr=()=>{},ir=({forward:e,dispatchDebug:t})=>t=>Yt([qt((e=>{var n=Wn(e),r=Gn(e,n),i=Jn(e,n);return nn(Gt((t=>t.kind===`teardown`&&t.key===e.key))(t))(er(e,r,i))}))(Gt((e=>e.kind!==`teardown`&&(e.kind!==`subscription`||!!e.context.fetchSubscriptions)))(t)),e(Gt((e=>e.kind===`teardown`||e.kind===`subscription`&&!e.context.fetchSubscriptions))(t))]),ar=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight(((e,n)=>n({client:t,forward(t){return $t(e($t(t)))},dispatchDebug(e){}})),n),or=({onOperation:e,onResult:t,onError:n})=>({forward:r})=>i=>qt((e=>{n&&e.error&&n(e.error,e.operation);var r=t&&t(e)||e;return`then`in r?pn(r):ln(r)}))(r(qt((t=>{var n=e&&e(t)||t;return`then`in n?pn(n):ln(n)}))(i))),sr=({dispatchDebug:e})=>e=>Gt((e=>!1))(e),cr=function e(t){var n=0,r=new Map,i=new Map,a=new Set,o=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||`cache-first`},c=dn();function l(e){(e.kind===`mutation`||e.kind===`teardown`||!a.has(e.key))&&(e.kind===`teardown`?a.delete(e.key):e.kind!==`mutation`&&a.add(e.key),c.next(e))}var u=!1;function d(e){if(e&&l(e),!u){for(u=!0;u&&(e=o.shift());)l(e);u=!1}}var f=e=>{var t=nn(Gt((t=>t.kind===`teardown`&&t.key===e.key))(c.source))(Gt((t=>t.operation.kind===e.kind&&t.operation.key===e.key&&(!t.operation.context._instance||t.operation.context._instance===e.context._instance)))(g));return t=e.kind===`query`?en((t=>{var n=ln(t);return t.stale||t.hasNext?n:Yt([n,Kt((()=>(t.stale=!0,t)))(tn(1)(Gt((t=>t.key===e.key))(c.source)))])}))(t):rn((e=>!!e.hasNext),!0)(t),t=e.kind===`mutation`?Qt((()=>{l(e)}))(t):Xt((()=>{a.delete(e.key),r.delete(e.key),i.delete(e.key),u=!1;for(var t=o.length-1;t>=0;t--)o[t].key===e.key&&o.splice(t,1);l(nr(`teardown`,e,e.context))}))(Zt((t=>{if(t.stale){if(!t.hasNext)a.delete(e.key);else for(var n=0;n<o.length;n++){var i=o[n];if(i.key===t.operation.key){a.delete(i.key);break}}}else t.hasNext||a.delete(e.key);r.set(e.key,t)}))(t)),$t(t)},p=this instanceof e?this:Object.create(e.prototype),m=Object.assign(p,{suspense:!!t.suspense,operations$:c.source,reexecuteOperation(e){if(e.kind===`teardown`)d(e);else if(e.kind===`mutation`)o.push(e),Promise.resolve().then(d);else if(i.has(e.key)){for(var t=!1,n=0;n<o.length;n++)o[n].key===e.key&&(o[n]=e,t=!0);t||a.has(e.key)&&e.context.requestPolicy!==`network-only`?(a.delete(e.key),Promise.resolve().then(d)):(o.push(e),Promise.resolve().then(d))}},createRequestOperation(e,t,r){return r||={},nr(e,t,{_instance:e===`mutation`?n=n+1|0:void 0,...s,...r,requestPolicy:r.requestPolicy||s.requestPolicy,suspense:r.suspense||!1!==r.suspense&&m.suspense})},executeRequestOperation(e){return e.kind===`mutation`?tr(f(e)):tr(an((()=>{var t=i.get(e.key);t||i.set(e.key,t=f(e)),t=Qt((()=>{d(e)}))(t);var n=r.get(e.key);return e.kind===`query`&&n&&(n.stale||n.hasNext)?en(ln)(Yt([t,Gt((t=>t===r.get(e.key)))(ln(n))])):t})))},executeQuery(e,t){var n=m.createRequestOperation(`query`,e,t);return m.executeRequestOperation(n)},executeSubscription(e,t){var n=m.createRequestOperation(`subscription`,e,t);return m.executeRequestOperation(n)},executeMutation(e,t){var n=m.createRequestOperation(`mutation`,e,t);return m.executeRequestOperation(n)},readQuery(e,t,n){var r=null;return mn((e=>{r=e}))(m.query(e,t,n)).unsubscribe(),r},query:(e,t,n)=>m.executeQuery(Rn(e,t),n),subscription:(e,t,n)=>m.executeSubscription(Rn(e,t),n),mutation:(e,t,n)=>m.executeMutation(Rn(e,t),n)}),h=rr,g=$t(ar(t.exchanges)({client:m,dispatchDebug:h,forward:sr({dispatchDebug:h})})(c.source));return hn(g),m};h();var lr=fe({}),ur=lr.Provider;lr.Consumer,lr.displayName=`UrqlContext`;var dr=()=>L(lr),fr={fetching:!1,stale:!1,hasNext:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0},pr=(e,t)=>e===t||!(!e||!t||e.key!==t.key),mr=(e,t)=>{var n={...e,...t,data:t.data!==void 0||t.error?t.data:e.data,fetching:!!t.fetching,stale:!!t.stale};return((e,t)=>{for(var n in e)if(!(n in t))return!0;for(var r in t)if(r===`operation`?!pr(e[r],t[r]):e[r]!==t[r])return!0;return!1})(e,n)?n:e},hr=(e,t)=>{for(var n=0,r=t.length;n<r;n++)if(e[n]!==t[n])return!0;return!1};function gr(e,t){e(t)}function _r(e){var t=R(!0),n=dr(),[r,i]=B(fr),a=z(((r,a)=>(gr(i,{...fr,fetching:!0}),gn(tn(1)(Gt((e=>!e.hasNext))(Zt((e=>{t.current&&gr(i,{fetching:!1,stale:e.stale,data:e.data,error:e.error,extensions:e.extensions,operation:e.operation,hasNext:e.hasNext})}))(n.executeMutation(Rn(e,r),a||{}))))))),[n,e,i]);return O((()=>(t.current=!0,()=>{t.current=!1})),[]),[r,a]}function vr(e,t){var n=R(void 0);return V((()=>{var r=Rn(e,t);return n.current!==void 0&&n.current.key===r.key?n.current:(n.current=r,r)}),[e,t])}function yr(e,t){var n=dr(),r=vr(e.query,e.variables),i=R(t);i.current=t;var a=V((()=>e.pause?null:n.executeSubscription(r,e.context)),[n,r,e.pause,e.context]),o=[n,r,e.context,e.pause],[s,c]=B((()=>[a,{...fr,fetching:!!a},o])),l=s[1];a!==s[0]&&hr(s[2],o)&&c([a,l=mr(s[1],{fetching:!!a}),o]),O((()=>{var e=e=>{gr(c,(t=>{var n=mr(t[1],e);return t[1]===n?t:(i.current&&n.data!=null&&t[1].data!==n.data&&(n.data=i.current(t[1].data,n.data)),[t[0],n,t[2]])}))};if(s[0])return mn(e)(Xt((()=>{e({fetching:!!a})}))(s[0])).unsubscribe;e({fetching:!1})}),[s[0]]);var u=z((t=>{var i=n.executeSubscription(r,{...e.context,...t});gr(c,(e=>[i,e[1],o]))}),[n,r,e.context,e.pause]);return[l,u]}j();var br=()=>`https://fkn.app/connect-button`,xr=e=>Math.max(1,e),Sr={POINT_100:{step:1,native:e=>Math.round(e),raw:e=>e},POINT_10_DECIMAL:{step:1,native:e=>Math.round(e)/10,raw:e=>Math.round(e*10)},POINT_10:{step:10,native:e=>xr(Math.floor(e/10)),raw:e=>e*10},POINT_5:{step:20,native:e=>xr(Math.round(e/20)),raw:e=>e*20},POINT_3:{step:33,native:e=>e<36?1:e<61?2:3,raw:e=>[30,50,85][e-1]??85}},Cr=e=>Sr[e??``]??Sr.POINT_100,wr=e=>e!=null&&e>0,Tr=(e,t)=>Cr(t).native(e),Er=(e,t)=>{let{native:n,raw:r}=Cr(t);return r(n(e))},Dr=(e,t)=>Cr(t).step>Cr(e).step?t:e,Or=`stub-source@1`,kr=`stub-enabled-plugins`,Ar=()=>{try{return globalThis.localStorage}catch{return}},jr=(e=Ar())=>{try{let t=JSON.parse(e?.getItem(`stub-enabled-plugins`)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}},Mr=(e,t=Ar())=>{try{t?.setItem(kr,JSON.stringify(e))}catch{}},Nr=3e3,Pr=new Map,Fr=new Set,Ir=()=>Fr.forEach(e=>{try{e()}catch{}}),Lr=e=>(Fr.add(e),()=>{Fr.delete(e)}),Rr=()=>jr().map(e=>Pr.get(e)??{uri:e,state:`connecting`}),zr=()=>jr(),Br=(e,t)=>{Pr.set(e,{uri:e,...t}),Ir()},Vr=45e3,Hr=(e,t)=>Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(t)),Vr))]),Ur=new Set,Wr=new Map,Gr=3e4,Kr=(e,t)=>{if(!jr().includes(e)||Ur.has(e)||Wr.has(e))return;Pr.get(e)?.state!==`error`&&Br(e,{state:`connecting`});let n=Math.min(Nr*t,Gr),r=setTimeout(()=>{Wr.delete(e),qr(e,t+1).catch(()=>{})},n);Wr.set(e,r)},qr=async(e,t=1)=>{if(!Ur.has(e)){Ur.add(e),Br(e,{state:`connecting`});try{let{port:t,closed:n}=await Hr(Oe.connect(e,{protocol:Or,raw:!0}),`connecting to '${e}' timed out`);n.then(()=>{Ur.delete(e),$e(e),Kr(e,1)});let r=await Hr(Promise.race([tt(t,e),n.then(()=>({error:`the package closed before the source registered`}))]),`'${e}' connected but never registered its source`);if(`error`in r)throw Error(r.error);Br(e,{state:`connected`,sources:r.ok.sources,rejected:r.ok.rejected})}catch(n){Ur.delete(e);let r=n instanceof Error?n.message:String(n);throw console.warn(`Plugin '${e}' failed to connect:`,n),Br(e,{state:`error`,error:r}),Kr(e,t+1),n}}},Jr=e=>{let t=Wr.get(e);t!==void 0&&(clearTimeout(t),Wr.delete(e))},Yr=async(e,t)=>{let n=await Oe.install(e,t);return n?(Mr([...new Set([...jr(),n.uri])]),n.uri):null},Xr=async e=>{let t=await Yr(e);return t&&qr(t).catch(()=>{}),t},Zr=async(e,t)=>{let n=await Yr(e,t);return n&&await qr(n),n},Qr=async e=>{Mr(jr().filter(t=>t!==e)),Jr(e),Ur.delete(e),Pr.delete(e),$e(e),Ir(),await Oe.uninstall(e).catch(()=>{})},$r=async()=>{let e=await Oe.pick({type:`plugin`,id:`stub`},{multiple:!0,title:`Add stub sources`});for(let t of e)await Zr(t.uri).catch(()=>{})};for(let e of jr())qr(e).catch(()=>{});function ei(e){var t=e.forward;return function(e){return _n(e,t)}}var ti=function(){return typeof navigator>`u`||navigator==null||navigator.product,ei}(),ni=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},ri=new Set,ii=new WeakMap,ai=(e,t)=>{if(e===null||ri.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return ai(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=ai(e[r],t)||`null`;return n+=`]`}if(!t&&(ci!==si&&e instanceof ci||li!==si&&e instanceof li))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=ii.get(e)||Math.random().toString(36).slice(2);return ii.set(e,o),ai({__key:o},t)}ri.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=ai(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=ai(a[c],t)+`:`+u)}return ri.delete(e),s+=`}`},oi=(e,t)=>(ri.clear(),ai(e,t||!1)),si=class{},ci=typeof File<`u`?File:si,li=typeof Blob<`u`?Blob:si,ui=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,di=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,fi=(e,t)=>t%2==0?e.replace(di,`
20
- `):e,pi=e=>e.split(ui).map(fi).join(``).trim(),mi=new Map,hi=new Map,gi=e=>{var t;return typeof e==`string`?t=pi(e):e.loc&&hi.get(e.__key)===e?t=e.loc.source.body:(t=mi.get(e)||pi(Lt(e)),mi.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},_i=e=>{var t;if(e.documentId)t=ni(e.documentId);else if(t=ni(gi(e)),e.definitions){var n=bi(e);n&&(t=ni(`\n# ${n}`,t))}return t},vi=e=>{var t,n;return typeof e==`string`?(t=_i(e),n=hi.get(t)||At(e,{noLocation:!0})):(t=e.__key||_i(e),n=hi.get(t)||e),n.loc||gi(n),n.__key=t,hi.set(t,n),n},yi=(e,t,n)=>{var r=t||{},i=vi(e),a=oi(r,!0),o=i.__key;return a!==`{}`&&(o=ni(a,o)),{key:o,query:i,variables:r,extensions:n}},bi=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===dt.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},xi=e=>{if(`definitions`in e){for(var t=[],n=0,r=e.definitions.length;n<r;n++){var i=xi(e.definitions[n]);t.push(i)}return{...e,definitions:t}}if(`directives`in e&&e.directives&&e.directives.length){for(var a=[],o={},s=0,c=e.directives.length;s<c;s++){var l=e.directives[s],u=l.name.value;u[0]===`_`?u=u.slice(1):a.push(l),o[u]=l}e={...e,directives:a,_directives:o}}if(`selectionSet`in e){var d=[],f=e.kind===dt.OPERATION_DEFINITION;if(e.selectionSet){for(var p=0,m=e.selectionSet.selections.length;p<m;p++){var h=e.selectionSet.selections[p];f||=h.kind===dt.FIELD&&h.name.value===`__typename`&&!h.alias;var g=xi(h);d.push(g)}return f||d.push({kind:dt.FIELD,name:{kind:dt.NAME,value:`__typename`},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:d}}}}return e},Si=new Map,Ci=e=>{var t=vi(e),n=Si.get(t.__key);return n||(Si.set(t.__key,n=xi(t)),Object.defineProperty(n,"__key",{value:t.__key,enumerable:!1})),n};function wi(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Ti=`
21
- https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+`
22
- `,i=Error(r+Ti+n);throw i.name=`Graphcache Error`,i}}var Di={},Oi=e=>e._directives||Di,ki=e=>e.name.value,Ai=e=>e.typeCondition.name.value,ji=e=>e.alias?e.alias.value:e.name.value,Mi=[],Ni=e=>e.selectionSet?e.selectionSet.selections:Mi,Pi=e=>e.typeCondition?e.typeCondition.name.value:null,Fi=(e,t)=>{var n=null;if(e.arguments)for(var r=0,i=e.arguments.length;r<i;r++){var a=e.arguments[r],o=Rt(a.value,t);o!=null&&(n||={},n[ki(a)]=o)}return n},Ii=(e,t)=>{if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=ki(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},Li=(e,t)=>{var n={};if(!t)return n;if(e.variableDefinitions)for(var r=0,i=e.variableDefinitions.length;r<i;r++){var a=e.variableDefinitions[r],o=ki(a.variable);n[o]=t[o]===void 0&&a.defaultValue?Rt(a.defaultValue,t):t[o]}for(var s in t)s in n||(n[s]=t[s]);return n};function Ri(e){for(var t=0;t<e.definitions.length;t++)if(e.definitions[t].kind===dt.OPERATION_DEFINITION)return e.definitions[t];Ei(!1,``,1)}var zi=e=>{for(var t={},n=0;n<e.definitions.length;n++){var r=e.definitions[n];r.kind===dt.FRAGMENT_DEFINITION&&(t[ki(r)]=r)}return t},Bi=(e,t)=>{var n=Oi(e);if(n.include||n.skip)for(var r in n){var i=n[r];if(i&&(r===`include`||r===`skip`)&&i.arguments&&i.arguments[0]&&ki(i.arguments[0])===`if`){var a=Rt(i.arguments[0].value,t);return r===`include`?!!a:!a}}return!0},Vi=(e,t)=>{var{defer:n}=Oi(e);if(n){for(var r of n.arguments||[])if(ki(r)===`if`)return!!Rt(r.value,t);return!0}return!1},Hi=e=>{var{optional:t,required:n}=Oi(e);if(n)return!1;if(t)return!0},Ui=`__`,Wi=(e,t,n,r)=>{var i=qi(e,t,n,r);return!!i&&i.type.kind!==`NON_NULL`},Gi=(e,t,n,r)=>{var i=qi(e,t,n,r);if(!i)return!1;var a=i.type.kind===`NON_NULL`?i.type.ofType:i.type;return a.kind===`LIST`&&a.ofType.kind!==`NON_NULL`},Ki=(e,t,n)=>{if(!n)return!1;var r=Pi(t);return!r||n===r?!0:e.types.has(r)&&e.types.get(r).kind===`OBJECT`?r===n:((function(e,t){Ei(e.types.has(t)&&(e.types.get(t).kind===`INTERFACE`||e.types.get(t).kind===`UNION`),``,5)})(e,r),Ji(e,n),e.isSubType(r,n))},qi=(e,t,n,r)=>{if(n.indexOf(Ui)!==0&&t.indexOf(Ui)!==0)return Ji(e,t),e.types.get(t).fields()[n]};function Ji(e,t){Ei(e.types.has(t)&&e.types.get(t).kind===`OBJECT`,``,3)}var Yi=(e,t)=>t?`${e}(${oi(t)})`:e,Xi=(e,t)=>`${e}.${t}`,Zi=e=>{var t=e.indexOf(`(`);return t>-1?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},Qi=e=>{var t=e.indexOf(`.`);return{entityKey:e.slice(0,t).replace(/%2e/g,`.`),fieldKey:e.slice(t+1)}},$i=null,ea=null,q=null,ta=null,na=null,ra=null,ia=!1,aa=!1;function oa(e,t){var n;if(e){if($i.has(e))return e;n=ea.get(e)}return n??=t?[]:{},e&&ea.set(e,n),$i.add(n),n}var sa=e=>!!e&&$i.has(e),ca=(e,t,n,r,i)=>{$i=new WeakSet,ea=new WeakMap,na=e,q=t,ra=new Set,aa=!!r,ia=!!i,n?na===`read`?ta=n:r||t.hydrating||t.optimisticOrder.length>1?(!r&&!t.commutativeKeys.has(n)?Da(t,n):r&&(t.optimisticOrder.indexOf(n)!==-1&&!t.commutativeKeys.has(n)&&t.optimisticOrder.splice(t.optimisticOrder.indexOf(n),1),t.commutativeKeys.delete(n)),ta=n,Oa(t,n)):(ta=null,Aa(t,n)):ta=null},la=()=>{var e=q,t=ta;if(aa=!1,ta=null,!e.hydrating&&t&&e.optimisticOrder.indexOf(t)>-1)for(var n=e.optimisticOrder.length;--n>=0&&e.dirtyKeys.has(e.optimisticOrder[n])&&e.commutativeKeys.has(e.optimisticOrder[n]);)ja(e.optimisticOrder[n]);$i=null,ea=null,na=null,q=null,ra=null,!e.defer&&(e.storage||!e.optimisticOrder.length)&&(e.defer=!0,setTimeout((()=>{ca(`read`,e,null),va(),Na(),la(),e.defer=!1})))},ua=(e,t,n)=>{t&&!n&&e.deferredKeys.delete(t),ca(`write`,e,t,n),la()},da=new Set,fa=(e,t,n,r)=>{var i=ta?e.optimistic.get(ta):e.base,a=i.get(t);a===void 0&&i.set(t,a=Object.create(null)),r===void 0&&!ta?delete a[n]:a[n]=r},pa=(e,t,n)=>{for(var r,i=!aa&&na===`read`&&ta&&q.commutativeKeys.has(ta),a=0,o=q.optimisticOrder.length;a<o;a++){var s=q.optimisticOrder[a],c=e.optimistic.get(s);if(i&&=s!==ta,c&&(!i||!q.commutativeKeys.has(s))&&(!aa||na===`write`||q.commutativeKeys.has(s))&&(r=c.get(t))!==void 0&&n in r)return r[n]}return(r=e.base.get(t))===void 0?void 0:r[n]};function ma(e){return q.refCount.get(e)||0}var ha=(e,t)=>{if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)ha(e[n],t);else typeof e==`string`&&((e,t)=>{var n=ma(e),r=n+t>0?n+t:0;q.refCount.set(e,r),r?!n&&r&&q.gc.delete(e):q.gc.add(e)})(e,t)},ga=(e,t,n)=>{if(n!==void 0)for(var r in n)t.has(r)||(e.push(Zi(r)),t.add(r))},_a=(e,t,n,r)=>{ga(e,t,r.base.get(n));for(var i=0,a=q.optimisticOrder.length;i<a;i++){var o=r.optimistic.get(q.optimisticOrder[i]);o!==void 0&&ga(e,t,o.get(n))}},va=()=>{if(!q.optimisticOrder.length){for(var e of q.gc.keys())if(q.gc.delete(e),!(ma(e)>0)){var t=q.records.base.get(e);q.refCount.delete(e),q.records.base.delete(e);var n=t&&t.__typename;if(n){var r=q.types.get(n);r&&r.delete(e)}var i=q.links.base.get(e);if(i)for(var a in q.links.base.delete(e),i)ha(i[a],-1)}}},ya=(e,t)=>{e===q.queryRootKey?t!==void 0&&t!==`__typename`&&ra.add(Xi(e,t)):ra.add(e)},ba=(e,t)=>{!aa&&q.storage&&q.persist.add(((e,t)=>`${e.replace(/\./g,`%2e`)}.${t}`)(e,t))},xa=(e,t)=>(na===`read`&&ya(e,t),pa(q.records,e,t)),Sa=(e,t)=>(na===`read`&&ya(e,t),pa(q.links,e,t)),Ca=(e,t)=>{var n=q.abstractToConcreteMap.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.abstractToConcreteMap.set(e,r)}},wa=(e,t,n)=>{Pa(pa(q.records,e,t),n)||(ya(e,t),ba(e,t)),fa(q.records,e,t,n)},Ta=(e,t)=>xa(e,t)!==void 0||Sa(e,t)!==void 0,Ea=(e,t,n)=>{var r=ta?q.links.optimistic.get(ta):q.links.base;if(!ta){var i=r&&r.get(e);ha(i&&i[t],-1),ha(n,1)}Pa(pa(q.links,e,t),n)||(ya(e,t),ba(e,t)),fa(q.links,e,t,n)},Da=(e,t,n)=>{var r=e.optimisticOrder.indexOf(t);if(r>-1&&e.optimisticOrder.splice(r,1),n)for(e.deferredKeys.add(t),r=r>-1?r:0;r<e.optimisticOrder.length&&!e.deferredKeys.has(e.optimisticOrder[r])&&(!e.dirtyKeys.has(e.optimisticOrder[r])||!e.commutativeKeys.has(e.optimisticOrder[r]));r++);else e.deferredKeys.delete(t),r>-1&&!e.commutativeKeys.has(t)&&ka(e,t),r=0;e.optimisticOrder.splice(r,0,t),e.commutativeKeys.add(t)},Oa=(e,t)=>{e.optimisticOrder.indexOf(t)===-1&&e.optimisticOrder.unshift(t),e.dirtyKeys.has(t)||(e.dirtyKeys.add(t),e.links.optimistic.set(t,new Map),e.records.optimistic.set(t,new Map))},ka=(e,t)=>{e.dirtyKeys.has(t)&&(e.dirtyKeys.delete(t),e.records.optimistic.delete(t),e.links.optimistic.delete(t),e.deferredKeys.delete(t))},Aa=(e,t)=>{var n=e.optimisticOrder.indexOf(t);n>-1&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),ka(e,t)},ja=e=>{var t=ra;ra=new Set,na=`write`;var n=q.links.optimistic.get(e);if(n)for(var r of n.entries()){var i=r[0],a=r[1];for(var o in a)Ea(i,o,a[o])}var s=q.records.optimistic.get(e);if(s)for(var c of s.entries()){var l=c[0],u=c[1];for(var d in u)wa(l,d,u[d])}ra=t,Aa(q,e)},Ma=e=>{var{links:t,records:n}=q,r=[],i=new Set;return ya(e),_a(r,i,e,t),_a(r,i,e,n),r},Na=()=>{if(q.storage){aa=!0,na=`read`;var e={};for(var t of q.persist.keys()){var{entityKey:n,fieldKey:r}=Qi(t),i=void 0;e[t]=(i=Sa(n,r))===void 0?(i=xa(n,r))===void 0?void 0:oi(i):`:${oi(i)}`}aa=!1,q.storage.writeData(e),q.persist.clear()}};function Pa(e,t){return typeof e!=typeof t||e!==t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&!e.some(((e,n)=>e!==t[n])):!0}var Fa=null,Ia=!1,La=void 0,Ra=e=>e.__internal.path.length>0&&e.__internal.errorMap?e.__internal.errorMap[e.__internal.path.join(`.`)]:void 0,za=(e,t,n,r,i,a)=>{var o={store:e,variables:t,fragments:n,parent:{__typename:r},parentTypeName:r,parentKey:i,parentFieldKey:``,fieldName:``,error:void 0,partial:!1,hasNext:!1,optimistic:aa,__internal:{path:[],errorMap:void 0}};if(a&&a.graphQLErrors)for(var s=0;s<a.graphQLErrors.length;s++){var c=a.graphQLErrors[s];c.path&&c.path.length&&(o.__internal.errorMap||(o.__internal.errorMap=Object.create(null)),o.__internal.errorMap[c.path.join(`.`)]=c)}return o},Ba=(e,t,n,r,i,a)=>{Fa=e,e.parent=t,e.parentTypeName=n,e.parentKey=r,e.parentFieldKey=i,e.fieldName=a,e.error=Ra(e)},Va=(e,t,n,r,i)=>{if(!t)return!1;var a=Pi(e);return!a||t===a||!Ni(e).some((e=>e.kind===dt.FIELD&&!Ta(n,Yi(ki(e),Fi(e,r)))))},Ha=class{constructor(e,t,n,r,i,a){this.typename=e,this.entityKey=t,this.ctx=a,this.stack=[{selectionSet:i,index:0,defer:n,optional:r}]}next(){for(;this.stack.length>0;){for(var e=this.stack[this.stack.length-1];e.index<e.selectionSet.length;){var t=e.selectionSet[e.index++];if(Bi(t,this.ctx.variables)){if(t.kind!==dt.FIELD){var n=t.kind===dt.INLINE_FRAGMENT?t:this.ctx.fragments[ki(t)];if(n){var r=!n.typeCondition||(this.ctx.store.schema?Ki(this.ctx.store.schema,n,this.typename):this.ctx.store.possibleTypeMap?Ua(this.ctx.store.possibleTypeMap,n.typeCondition.name.value,this.typename):na===`read`&&Wa(n.typeCondition.name.value,this.typename)||Va(n,this.typename,this.entityKey,this.ctx.variables,this.ctx.store.logger));if(r||na===`write`&&!this.ctx.store.schema){var i=Hi(t);r&&n.typeCondition&&this.typename!==n.typeCondition.name.value&&Ca(n.typeCondition.name.value,this.typename),this.stack.push(e={selectionSet:Ni(n),index:0,defer:e.defer||Vi(t,this.ctx.variables),optional:i===void 0?e.optional:i})}}}else if(na===`write`||!t._generated)return Ia=e.defer,La=e.optional,t}}this.stack.pop()}}},Ua=(e,t,n)=>{if(!n)return!1;if(t===n)return!0;var r=e.get(t);return r&&r.has(n)},Wa=(e,t)=>{if(!t)return!1;if(e===t)return!0;if((e=>q.types.has(e))(e))return!1;var n=(e=>q.abstractToConcreteMap.get(e)||da)(e);return n.size&&n.has(t)},Ga=e=>e??null,Ka=(e,t)=>{if(!t)return t||null;if(Array.isArray(t)){for(var n=Array(t.length),r=0,i=n.length;r<i;r++)n[r]=Ka(e,t[r]);return n}return e.keyOfEntity(t)},qa=(e,t,n,r)=>{var i=Ci(t.query),a=Ri(i),o=e.rootFields[a.operation],s=Ni(a),c=za(e,Li(a,t.variables),zi(i),o,o,r),l=o===c.store.rootFields.query?Za(c,o,s,n||oa()):Ja(c,o,s,n||oa());return{dependencies:ra,partial:c.partial||!l,hasNext:c.hasNext,data:l||null}},Ja=(e,t,n,r)=>{if(typeof(e.store.rootNames[t]?t:r.__typename)!=`string`)return r;for(var i=new Ha(t,t,!1,void 0,n,e),a,o=ia,s=oa(r);a=i.next();){var c=ji(a),l=r[c];e.__internal.path.push(c);var u=void 0;u=a.selectionSet&&l!==null?Ya(e,Ni(a),Ga(l)):l,o||=u!==l,u!==void 0&&(s[c]=u),e.__internal.path.pop()}return o?s:r},Ya=(e,t,n)=>{if(Array.isArray(n)){for(var r=Array(n.length),i=ia,a=0,o=n.length;a<o;a++)e.__internal.path.push(a),r[a]=Ya(e,t,n[a]),i||=r[a]!==n[a],e.__internal.path.pop();return i?r:n}if(n===null)return null;var s=e.store.keyOfEntity(n);return s===null?Ja(e,n.__typename,t,n):Za(e,s,t,n)||null};function Xa(e,t,n,r){var i=r.store.resolvers[t],a=i&&i[n],o;for(var s in e){var c=e[s];if(c&&s!==`include`&&s!==`skip`&&r.store.directives[s])return o=r.store.directives[s](Fi(c,r.variables)),o}return o||a}var Za=(e,t,n,r,i)=>{var{store:a}=e,o=t===a.rootFields.query,s=i&&a.keyOfEntity(i)||t,c=o?t:xa(s,`__typename`)||i&&i.__typename;if(typeof c==`string`&&!(i&&c!==i.__typename)){for(var l=new Ha(c,s,!1,void 0,n,e),u=!1,d=!1,f=ia,p,m=e.partial,h=oa(r);(p=l.next())!==void 0;){var g=ki(p),_=Fi(p,e.variables),v=ji(p),y=Oi(p),b=Xa(y,c,g,e),x=Yi(g,_),S=Xi(s,x),C=xa(s,x),w=i?i[g]:void 0;e.__internal.path.push(v);var T=void 0;if(g===`__typename`)T=c;else if(w!==void 0&&p.selectionSet===void 0)T=w;else if(na===`read`&&b){var E=h;if(p.selectionSet===void 0&&C!==void 0&&(E={...h,[v]:C,[g]:C}),Ba(e,E,c,s,x,g),T=b(E,_||{},a,e),p.selectionSet&&(T=Qa(e,c,g,S,Ni(p),h[v]===void 0?r[v]:h[v],T,sa(r))),a.schema&&T===null&&!Wi(a.schema,c,g,e.store.logger))return}else if(!p.selectionSet)T=C;else if(w!==void 0)T=Qa(e,c,g,S,Ni(p),h[v]===void 0?r[v]:h[v],w,sa(r));else{var D=Sa(s,x);D===void 0?typeof C==`object`&&C&&(T=C):T=$a(e,D,c,g,Ni(p),h[v]===void 0?r[v]:h[v],sa(r))}if(!Ia&&T===void 0&&(y.optional||La&&!y.required||Ra(e)||!y.required&&a.schema&&Wi(a.schema,c,g,e.store.logger))?(e.partial=!0,T=null):T===null&&(y.required||!1===La)?(e.store.logger,T=void 0):u||=g!==`__typename`,e.__internal.path.pop(),f||=T!==r[v],T!==void 0)h[v]=T;else if(Ia)d=!0;else{e.store.logger,e.partial=m;return}}return e.partial=e.partial||m,e.hasNext=e.hasNext||d,o&&e.partial&&!u?void 0:f?h:r}},Qa=(e,t,n,r,i,a,o,s)=>{if(Array.isArray(o)){for(var{store:c}=e,l=c.schema?Gi(c.schema,t,n,e.store.logger):!1,u=e.partial,d=oa(a,!0),f=ia||!Array.isArray(a)||o.length!==a.length,p=0,m=o.length;p<m;p++){e.__internal.path.push(p);var h=Qa(e,t,n,Xi(r,`${p}`),i,a?.[p],o[p],s);if(e.__internal.path.pop(),h===void 0&&!l){e.partial=u;return}e.partial=e.partial||h===void 0&&l,d[p]=h??null,f||=d[p]!==a[p]}return f?d:a}if(o==null)return o;if(s&&a===null)return null;if(eo(o)){var g=a||oa(a);return typeof o==`string`?Za(e,o,i,g):Za(e,r,i,g,o)}},$a=(e,t,n,r,i,a,o)=>{if(Array.isArray(t)){for(var{store:s}=e,c=s.schema?Gi(s.schema,n,r,e.store.logger):!1,l=oa(a,!0),u=e.partial,d=ia||!Array.isArray(a)||t.length!==a.length,f=0,p=t.length;f<p;f++){e.__internal.path.push(f);var m=$a(e,t[f],n,r,i,a?.[f],o);if(e.__internal.path.pop(),m===void 0&&!c){e.partial=u;return}e.partial=e.partial||m===void 0&&c,l[f]=m||null,d||=l[f]!==a[f]}return d?l:a}return t===null||a===null&&o?null:Za(e,t,i,a||oa(a))},eo=e=>typeof e==`string`||typeof e==`object`&&typeof e.__typename==`string`,to=(e,t,n)=>{for(var r=t?[{fieldKey:Yi(t,n)}]:Ma(e),i=0,a=r.length;i<a;i++){var{fieldKey:o}=r[i];Sa(e,o)===void 0?wa(e,o,void 0):Ea(e,o,void 0)}},no=(e,t)=>{for(var n of(e=>q.types.get(e)||da)(e))t.includes(n)||to(n)},ro=(e,t,n,r)=>{var i=Ci(t.query),a=Ri(i),o={data:n||oa(),dependencies:ra},s=e.rootFields[a.operation];return io(za(e,Li(a,t.variables),zi(i),s,s,r),s,Ni(a),o.data),o},io=(e,t,n,r)=>{var i=e.store.rootNames[t]||`query`,a=!!e.store.rootNames[t],o=a?t:r.__typename;if(!o&&t&&e.optimistic&&(o=xa(t,`__typename`)),o)!a&&t&&(wa(t,`__typename`,o),((e,t)=>{var n=q.types.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.types.set(e,r)}})(o,t));else return;for(var s=e.store.updates[o],c=new Ha(o,t||o,!1,void 0,n,e),l;l=c.next();){var u=ki(l),d=Fi(l,e.variables),f=Yi(u,d),p=ji(l),m=r[e.optimistic?u:p];if(!(u===`__typename`||m===void 0&&(Ia||e.optimistic&&i===`query`))){e.__internal.path.push(p);var h=void 0;if(e.optimistic&&i===`mutation`){if(!(h=e.store.optimisticMutations[u]))continue}else e.optimistic&&typeof m==`function`&&(h=m);if(h&&(Ba(e,r,o,t||o,f,u),m=Ga(h(d||{},e.store,e))),m!==void 0){if(l.selectionSet){if(t&&i===`query`){var g=Xi(t,f),_=ao(e,Ni(l),Ga(m),g,e.optimistic?Sa(t||o,f):void 0);Ea(t||o,f,_)}else ao(e,Ni(l),Ga(m))}else t&&i===`query`&&wa(t||o,f,m!==null||!Ra(e)?m:void 0);var v=s&&s[u];if(v)Ba(e,r,o,t||o,f,u),r[u]=m,v(r,d||{},e.store,e);else if(o===e.store.rootFields.mutation&&!e.optimistic){if(m&&Array.isArray(m))for(var y=m.map((t=>e.store.keyOfEntity(t)||``)),b=0,x=m.length;b<x;b++){var S=y[b];if(S&&m[b].__typename){var C=xa(S,`__typename`),w=ma(S);C&&!w&&no(m[b].__typename,y)}}else if(m&&typeof m==`object`){var T=e.store.keyOfEntity(m);if(T){var E=xa(T,`__typename`),D=ma(T);(!E||!D)&&m.__typename&&no(m.__typename,[T])}}}e.__internal.path.pop()}}}},ao=(e,t,n,r,i)=>{if(Array.isArray(n)){for(var a=Array(n.length),o=0,s=n.length;o<s;o++){e.__internal.path.push(o);var c=r?Xi(r,`${o}`):void 0,l=ao(e,t,n[o],c,i?.[o]);a[o]=l,e.__internal.path.pop()}return a}if(n===null)return Ra(e)?void 0:null;var u=e.store.keyOfEntity(n)||(typeof i==`string`?i:null);n.__typename;var d=u||r;return io(e,d,t,n),d||null},oo=class{constructor(e){e||={},this.logger=e.logger,this.resolvers=e.resolvers||{},this.directives=e.directives||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.globalIDs=Array.isArray(e.globalIDs)?new Set(e.globalIDs):!!e.globalIDs;var t=`Query`,n=`Mutation`,r=`Subscription`;if(e.schema){var i=(({__schema:e})=>{var t=new Map,n=e=>{var t;return()=>{if(!t){t={};for(var n=0;n<e.length;n++)t[e[n].name]=e[n]}return t}},r=e=>{switch(e.kind){case`OBJECT`:case`INTERFACE`:return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map((e=>({name:e.name,type:e.type,args:n(e.args)}))))};case`UNION`:return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},i={query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:void 0,isSubType(e,n){var r=t.get(e),i=t.get(n);return!r||!i?!1:r.kind===`UNION`?!!r.types()[n]:r.kind!==`OBJECT`&&i.kind===`OBJECT`?!!i.interfaces()[e]:e===n}};if(e.types){i.types=t;for(var a=0;a<e.types.length;a++){var o=e.types[a];if(o&&o.name){var s=r(o);s&&t.set(o.name,s)}}}return i})(e.schema);t=i.query||t,n=i.mutation||n,r=i.subscription||r,i.types&&(this.schema=i)}if(!this.schema&&e.possibleTypes){this.possibleTypeMap=new Map;for(var a of Object.entries(e.possibleTypes)){var[o,s]=a;this.possibleTypeMap.set(o,new Set(s))}}this.updates=e.updates||{},this.rootFields={query:t,mutation:n,subscription:r},this.rootNames={[t]:`query`,[n]:`mutation`,[r]:`subscription`},this.data=(c=t,{hydrating:!1,defer:!1,gc:new Set,types:new Map,persist:new Set,queryRootKey:c,refCount:new Map,links:{optimistic:new Map,base:new Map},abstractToConcreteMap:new Map,records:{optimistic:new Map,base:new Map},deferredKeys:new Set,commutativeKeys:new Set,dirtyKeys:new Set,optimisticOrder:[],storage:null});var c;this.schema}keyOfField(e,t){return Yi(e,t)}keyOfEntity(e){if(Fa&&e===Fa.parent)return Fa.parentKey;if(e==null||typeof e==`string`)return e||null;if(!e.__typename)return null;if(this.rootNames[e.__typename])return e.__typename;var t=null;this.keys[e.__typename]?t=this.keys[e.__typename](e)||null:e.id==null?e._id!=null&&(t=`${e._id}`):t=`${e.id}`;var n=e.__typename;return!0===this.globalIDs||this.globalIDs&&this.globalIDs.has(n)||!t?t:`${n}:${t}`}resolve(e,t,n){var r=this.keyOfEntity(e);if(r){var i=Yi(t,n),a=xa(r,i);if(a!==void 0)return a;var o=Sa(r,i);return o!==void 0&&(o=Ka(this,o)),o}}invalidate(e,t,n){var r=this.keyOfEntity(e);e&&typeof e==`string`&&!t&&!n&&!this.resolve(e,`__typename`)?no(e,[]):(Ei(r,``,19),to(r,t,n))}inspectFields(e){var t=this.keyOfEntity(e);return t?Ma(t):[]}updateQuery(e,t){var n=yi(e.query,e.variables),r=t(this.readQuery(n));r!==null&&ro(this,n,r,void 0)}readQuery(e){var t=yi(e.query,e.variables);return qa(this,t,void 0,void 0).data}readFragment(e,t,n,r){return((e,t,n,r,i)=>{var a=zi(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Ai(o);typeof n!=`string`&&!n.__typename&&(n.__typename=s);var c=e.keyOfEntity(n);return c&&Za(za(e,r||{},a,s,c,void 0),c,Ni(o),oa())||null})(this,Ci(e),t,n,r)}writeFragment(e,t,n,r){((e,t,n,r,i)=>{var a=zi(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Ai(o),c={__typename:s,...n},l=e.keyOfEntity(c);l&&io(za(e,r||{},a,s,l,void 0),l,Ni(o),c)})(this,Ci(e),t,n,r)}link(e,t,...n){var r=n.length===2?n[0]:null,i=n.length===2?n[1]:n[0],a=this.keyOfEntity(e);a&&Ea(a,Yi(t,r),Ka(this,i))}},so=(e,t)=>wi(e.kind,e,{...e.context,meta:{...e.context.meta,...t}}),co=(e,t)=>wi(e.kind,e,{...e.context,requestPolicy:t}),lo=(e=>({forward:t,client:n,dispatchDebug:r})=>{var i=new oo(e);e&&e.storage&&(i.data.hydrating=!0,e.storage.readData().then((t=>{((e,t,n)=>{for(var r in ca(`write`,e,null),n){var i=n[r];if(i!==void 0){var{entityKey:a,fieldKey:o}=Qi(r);i[0]===`:`?Sa(a,o)===void 0&&Ea(a,o,JSON.parse(i.slice(1))):xa(a,o)===void 0&&wa(a,o,JSON.parse(i))}}e.storage=t,e.hydrating=!1,la()})(i.data,e.storage,t),e.storage.onCacheHydrated&&e.storage.onCacheHydrated()})));var a=new Map,o=[],s=new Map,c=new Map,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=e=>{for(var t of e.values())if(l.has(t))return!0;return!1},h=(e,t)=>{if(t)for(var n of t.values()){var r=d.get(n);if(r)for(var i of r.values())e.add(i)}},g=(e,t,r)=>{for(var i of t.values())if(i!==e.key){var a=s.get(i);if(a){e.kind===`query`&&p.add(i);var o=`cache-first`;u.has(i)&&(u.delete(i),o=`cache-and-network`),n.reexecuteOperation(co(a,o))}}if(!r){var c=f;f=p,e.kind===`query`&&f.add(e.key),(p=c).clear()}},_=e=>{var t=!1;if(e.kind===`query`)Da(i.data,e.key),s.set(e.key,e);else if(e.kind===`teardown`)return s.delete(e.key),c.delete(e.key),f.delete(e.key),ua(i.data,e.key),e;else if(e.kind===`mutation`&&e.context.requestPolicy!==`network-only`){s.set(e.key,e),ca(`write`,i.data,e.key,!0,!1);var{dependencies:n}=ro(i,e,void 0,void 0);if(la(),n.size){for(var r of n.values())l.add(r);a.set(e.key,n);var o=new Set;h(o,n),g(e,o,!0),t=!0}}return wi(e.kind,{key:e.key,query:Ci(e.query),variables:e.variables?Ii(Ri(e.query),e.variables):e.variables},{...e.context,optimistic:t})},v=(e,t)=>{for(var n of t.values()){var r=d.get(n);r||d.set(n,r=new Set),r.add(e.key)}},y=e=>{ca(`read`,i.data,void 0,!1,!1);var t=qa(i,e,c.get(e.key),void 0);la();var n=t.data?!t.partial&&!t.hasNext?`hit`:`partial`:`miss`;return c.set(e.key,t.data),s.set(e.key,e),v(e,t.dependencies),{outcome:n,operation:e,data:t.data,dependencies:t.dependencies,hasNext:t.hasNext}},b=(e,t)=>{var n=s.get(e.operation.key)||e.operation;n.kind===`mutation`&&(h(t,a.get(n.key)),a.delete(n.key)),(n.kind===`subscription`||e.hasNext)&&Da(i.data,n.key,!0);var r,o=e.data;if(o){ca(`write`,i.data,n.key,!1,!1);var l=ro(i,n,o,e.error).dependencies;la(),h(t,l);var u=n.kind===`query`?c.get(n.key):null;ca(`read`,i.data,n.key,!1,u!==o);var d=qa(i,n,u||o,e.error);la(),o=d.data,n.kind===`query`&&(h(t,r=d.dependencies),c.set(n.key,o))}else ua(i.data,n.key);return r&&v(e.operation,r),{operation:n,data:o,error:e.error,extensions:e.extensions,hasNext:e.hasNext,stale:e.stale}};return e=>{var r=$t(Kt(y)(Gt((e=>e.kind===`query`&&e.context.requestPolicy!==`network-only`))(e))),c=Gt((e=>e.kind!==`query`||e.context.requestPolicy===`network-only`))(e),d=Kt((e=>so(e.operation,{cacheOutcome:`miss`})))(Gt((e=>e.outcome===`miss`&&e.operation.context.requestPolicy!==`cache-only`&&!m(e.dependencies)&&!f.has(e.operation.key)))(r)),p=Kt((e=>{var{requestPolicy:t}=e.operation.context,r=t!==`cache-only`&&(e.hasNext||t===`cache-and-network`||t===`cache-first`&&e.outcome===`partial`&&!f.has(e.operation.key)),a=t!==`cache-only`&&(r||e.outcome===`partial`&&f.has(e.operation.key)&&((o=i.data).commutativeKeys.has(c=e.operation.key)||o.optimisticOrder.indexOf(c)>-1)),o,c,l={operation:so(e.operation,{cacheOutcome:e.outcome}),data:e.data,error:e.error,extensions:e.extensions,stale:a&&!e.hasNext,hasNext:r&&e.hasNext};return r&&(m(e.dependencies)?t===`cache-and-network`&&u.add(e.operation.key):n.reexecuteOperation(co(s.get(e.operation.key)||e.operation,`network-only`))),l}))(Gt((e=>e.outcome!==`miss`||e.operation.context.requestPolicy===`cache-only`))(r)),h=t(Kt(_)(Yt([c,d])));return Yt([Kt((e=>{var t=new Set,n=b(e,t);return g(e.operation,t,!1),n}))(Gt((e=>!a.has(e.operation.key)))(h)),qt((e=>{if(o.push(e)<a.size)return fn;for(var t=0;t<o.length;t++)Da(i.data,o[t].operation.key);l.clear();for(var n=[],r=new Set,s;s=o.shift();)n.push(b(s,r));return g(e.operation,r,!1),cn(n)}))(Gt((e=>a.has(e.operation.key)))(h)),p])}})({schema:{__schema:JSON.parse(`{"queryType":{"name":"Query","kind":"OBJECT"},"mutationType":{"name":"Mutation","kind":"OBJECT"},"subscriptionType":{"name":"Subscription","kind":"OBJECT"},"types":[{"kind":"OBJECT","name":"Episode","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"absoluteEpisodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"absoluteNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"embedUrl","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"mediaUri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relativeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"releaseDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"runtime","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"thumbnails","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeThumbnail","ofType":null}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeHandle","fields":[{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeThumbnail","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"FuzzyDate","fields":[{"name":"day","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"month","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"year","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"ListEntry","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"completedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"cover","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"mediaUri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"progress","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"rewatchCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"updatedAt","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Media","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"anomalies","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAnomaly","ofType":null}}},"args":[]},{"name":"averageScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"banners","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaBanner","ofType":null}}}},"args":[]},{"name":"categories","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"endDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}}}},"args":[]},{"name":"franchise","type":{"kind":"OBJECT","name":"MediaFranchise","ofType":null},"args":[]},{"name":"genres","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isAdult","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"kind","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextAiringEpisode","type":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"popularity","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"provenance","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFieldProvenance","ofType":null}}},"args":[]},{"name":"relations","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRelationEdge","ofType":null}}}},"args":[]},{"name":"scope","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"season","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonYear","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tags","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"trailers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTrailer","ofType":null}}}},"args":[]},{"name":"type","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAiringEpisode","fields":[{"name":"airingAt","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"episodeNumber","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAnomaly","fields":[{"name":"detail","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaBanner","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCover","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFieldProvenance","fields":[{"name":"answerSeq","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"field","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tier","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uris","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"witnesses","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchise","fields":[{"name":"edges","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseEdge","ofType":null}}}},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseNode","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseEdge","fields":[{"name":"from","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"to","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseNode","fields":[{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaHandle","fields":[{"name":"by","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"provenance","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"via","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRelationEdge","fields":[{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTrailer","fields":[{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"thumbnail","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Mutation","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"addHeldStubEntries","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"deleteListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"saveListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Origin","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isApiOnly","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"OriginPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Origin","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"PlaybackSource","fields":[{"name":"Episode","type":{"kind":"OBJECT","name":"Episode","ofType":null},"args":[]},{"name":"data","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"type","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Query","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"StubTrackerStorage","fields":[{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"held","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"location","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"locked","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"waiting","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Subscription","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"containingMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"media","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"mediaPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"origin","type":{"kind":"OBJECT","name":"Origin","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"originPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"OriginPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"similarMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"stubTrackerStorage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"tracking","type":{"kind":"OBJECT","name":"Tracking","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracker","fields":[{"name":"account","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canWrite","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"scoreScale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"writeNotice","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"TrackerAnswer","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"candidates","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"state","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Tracker","ofType":null}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracking","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"answers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"TrackerAnswer","ofType":null}}}},"args":[]},{"name":"disagreements","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"summary","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"WriteOutcome","fields":[{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"outcome","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"SCALAR","name":"Any"}],"directives":[]}`)},keys:{Media:e=>e._id,MediaHandle:()=>null,MediaRelationEdge:()=>null,MediaFranchise:()=>null,MediaFranchiseNode:()=>null,MediaFranchiseEdge:()=>null,EpisodeHandle:()=>null,MediaTitle:()=>null,MediaDescription:()=>null,MediaShortDescription:()=>null,MediaCover:()=>null,MediaBanner:()=>null,MediaAiringEpisode:()=>null,MediaFieldProvenance:()=>null,MediaAnomaly:()=>null,MediaTrailer:e=>e.uri,Episode:e=>e._id,EpisodeTitle:()=>null,EpisodeDescription:()=>null,EpisodeShortDescription:()=>null,EpisodeThumbnail:()=>null,PlaybackSource:e=>e.uri,Tracking:e=>String(e._id),TrackerAnswer:e=>String(e._id),Tracker:e=>e.id,ListEntry:e=>String(e._id),FuzzyDate:()=>null,WriteOutcome:()=>null,StubTrackerStorage:()=>null},resolvers:{}}),uo=new cr({url:`http://d/graphql`,exchanges:[or({onError(e,t){for(let n of e.graphQLErrors)console.error(Error(n.message,{cause:`GQL Error originated from ${t.query.definitions.find(e=>e.kind===`OperationDefinition`)?.name?.value}`}))}}),ti,lo,ir],fetchSubscriptions:!0,fetch:async(e,t)=>Ge(e,t)});function fo(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var po=ye((e=>{var t=(h(),xe(S));function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),mo=ye(((e,t)=>{t.exports=po()}));h();var ho=mo(),go=N,_o=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_e:O,vo=go||_o,yo=e=>{let t=R([e,(...e)=>t[0](...e)]).current;return vo(()=>{t[0]=e}),t[1]},bo=`popstate`,xo=`pushState`,So=`replaceState`,Co=[bo,xo,So,`hashchange`],wo=e=>{for(let t of Co)addEventListener(t,e);return()=>{for(let t of Co)removeEventListener(t,e)}},To=(e,t)=>(0,ho.useSyncExternalStore)(wo,e,t),Eo=()=>location.search,Do=({ssrSearch:e=``}={})=>To(Eo,()=>e),Oo=()=>location.pathname,ko=({ssrPath:e}={})=>To(Oo,e?()=>e:Oo),Ao=(e,{replace:t=!1,state:n=null}={})=>history[t?So:xo](n,``,e),jo=(e={})=>[ko(e),Ao],Mo=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Mo]===void 0){for(let e of[xo,So]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Mo,{value:!0})}var No=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,Po=(e=``)=>e===`/`?``:e,Fo=(e,t)=>e[0]===`~`?e.slice(1):Po(t)+e,Io=(e=``,t)=>No(Ro(Po(e)),Ro(t)),Lo=e=>e[0]===`?`?e.slice(1):e,Ro=e=>{try{return decodeURI(e)}catch{return e}},zo=e=>Ro(Lo(e)),Bo={hook:jo,searchHook:Do,parser:fo,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},Vo=fe(Bo),Ho=()=>L(Vo),Uo={},Wo=fe(Uo),Go=()=>L(Wo),Ko=e=>{let[t,n]=e.hook(e);return[Io(e.base,t),yo((t,r)=>n(Fo(t,e.base),r))]},qo=()=>Ko(Ho()),Jo=()=>{let e=Ho();return zo(e.searchHook(e))},Yo=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},Xo=e=>Yo(Ho().parser,e,qo()[0]),Zo=({children:e,...t})=>{let n=Ho(),r=t.hook?Bo:n,i=r,[a,o]=t.ssrPath?.split(`?`)??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=R({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]||``):t[e]||r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return ce(Vo.Provider,{value:i,children:e})},Qo=({children:e,component:t},n)=>t?ce(t,{params:n}):typeof e==`function`?e(n):e,$o=e=>{let t=R(Uo),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},es=({path:e,nest:t,match:n,...r})=>{let i=Ho(),[a]=Ko(i),[o,s,c]=n??Yo(i.parser,e,a,t),l=$o({...Go(),...s});if(!o)return null;let u=c?ce(Zo,{base:c},Qo(r,l)):Qo(r,l);return ce(Wo.Provider,{value:l,children:u})},ts=l((t,n)=>{let r=Ho(),[i,a]=Ko(r),{to:o=``,href:s=o,onClick:c,asChild:l,children:u,className:d,replace:f,state:p,...m}=t,h=yo(e=>{e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0||(c?.(e),e.defaultPrevented||(e.preventDefault(),a(s,t)))}),g=r.hrefs(s[0]===`~`?s.slice(1):r.base+s,r);return l&&e(u)?w(u,{onClick:h,href:g}):ce(`a`,{...m,onClick:h,href:g,className:d?.call?d(i===s):d,children:u,ref:n})}),ns=e=>Array.isArray(e)?e.flatMap(e=>ns(e&&e.type===ne?e.props.children:e)):[e],rs=({children:t,location:n})=>{let r=Ho(),[i]=Ko(r);for(let a of ns(t)){let t=0;if(e(a)&&(t=Yo(r.parser,a.props.path,n||i,a.props.nest))[0])return w(a,{match:t})}return null},is=e=>{let{to:t,href:n=t}=e,r=Ho(),[,i]=Ko(r),a=yo(()=>i(t||n,e)),{ssrContext:o}=r;return _o(()=>{a()},[]),o&&(o.redirectTo=t),null},J=function(e){return e.HOME=`HOME`,e.MEDIA=`MEDIA`,e.MEDIA_EPISODE=`MEDIA_EPISODE`,e.SEARCH=`SEARCH`,e.SEARCH_LEGACY=`SEARCH_LEGACY`,e.LEGAL=`LEGAL`,e.PRIVACY=`PRIVACY`,e.SETTINGS=`SETTINGS`,e.WATCH=`WATCH`,e.PARTY=`PARTY`,e.DEBUG_TRACE=`DEBUG_TRACE`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({}),as={HOME:()=>`/`,MEDIA:({uri:e})=>`/media/${e}`,MEDIA_EPISODE:({uri:e,mediaUri:t})=>`/media/${e}/${t}`,SEARCH:()=>`/search`,SEARCH_LEGACY:({query:e})=>`/search/${encodeURIComponent(e)}`,LEGAL:()=>`/legal`,PRIVACY:()=>`/privacy`,SETTINGS:()=>`/settings`,WATCH:({mediaUri:e,episodeUri:t,sourceUri:n})=>`/watch/${e}/${t}${n?`/${n}`:``}`,PARTY:()=>`/party`,DEBUG_TRACE:()=>`/debug/trace`,LOGIN_CALLBACK:()=>`/login/callback`},os={HOME:`/`,MEDIA:`/media/:uri`,MEDIA_EPISODE:`/media/:uri/:mediaUri`,SEARCH:`/search`,SEARCH_LEGACY:`/search/:query`,LEGAL:`/legal`,PRIVACY:`/privacy`,SETTINGS:`/settings`,WATCH:`/watch/:mediaUri/:episodeUri/:sourceUri?`,PARTY:`/party`,DEBUG_TRACE:`/debug/trace`,LOGIN_CALLBACK:`/login/callback`},ss=e=>os[e],cs=(e,t)=>as[e](t),ls=function(e){return e.Anime=`ANIME`,e.Movie=`MOVIE`,e.Series=`SERIES`,e}({}),us=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),ds=function(e){return e.Fall=`FALL`,e.Spring=`SPRING`,e.Summer=`SUMMER`,e.Winter=`WINTER`,e}({}),fs=function(e){return e.Popularity=`POPULARITY`,e.PopularityDesc=`POPULARITY_DESC`,e}({}),ps=function(e){return e.Cancelled=`CANCELLED`,e.Finished=`FINISHED`,e.Hiatus=`HIATUS`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Releasing=`RELEASING`,e}({}),ms=function(e){return e.Anime=`ANIME`,e.LiveAction=`LIVE_ACTION`,e.Movie=`MOVIE`,e.Ona=`ONA`,e.Ova=`OVA`,e.Special=`SPECIAL`,e.Tv=`TV`,e.TvShort=`TV_SHORT`,e}({}),hs=function(e){return e.IsApiOnly=`IS_API_ONLY`,e.IsNotApiOnly=`IS_NOT_API_ONLY`,e}({}),gs={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},_s={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},vs={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},ys={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`MediaTracking`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`TrackingInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracking`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`disagreements`}},{kind:`Field`,name:{kind:`Name`,value:`summary`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}},{kind:`Field`,name:{kind:`Name`,value:`answers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`state`}},{kind:`Field`,name:{kind:`Name`,value:`candidates`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`tracker`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`canWrite`}},{kind:`Field`,name:{kind:`Name`,value:`account`}},{kind:`Field`,name:{kind:`Name`,value:`scoreScale`}},{kind:`Field`,name:{kind:`Name`,value:`writeNotice`}}]}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]}}]},bs={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`SaveListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`SaveListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`saveListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]},xs={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`DeleteListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`DeleteListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`deleteListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Ss={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`StubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`stubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Cs={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`AddHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`addHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},ws={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetReleasingMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Ts={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModal`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`description`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`categories`}},{kind:`Field`,name:{kind:`Name`,value:`franchise`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`edges`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`from`}},{kind:`Field`,name:{kind:`Name`,value:`to`}},{kind:`Field`,name:{kind:`Name`,value:`relation`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`relations`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Es={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModalOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`OriginFragment`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},Ds={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`SearchMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`genres`}},{kind:`Field`,name:{kind:`Name`,value:`tags`}},{kind:`Field`,name:{kind:`Name`,value:`averageScore`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`season`}},{kind:`Field`,name:{kind:`Name`,value:`seasonYear`}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Os={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchMedia`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`embedUrl`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}}]}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},ks={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]}}]}}]},As={query:`q`,category:`category`,status:`status`,season:`season`,year:`year`,format:`format`,genre:`genre`,tag:`tag`},js=[{value:ms.Tv,label:`TV Show`},{value:ms.Movie,label:`Movie`},{value:ms.TvShort,label:`TV Short`},{value:ms.Special,label:`Special`},{value:ms.Ova,label:`OVA`},{value:ms.Ona,label:`ONA`}],Ms=[{value:ps.Releasing,label:`Airing`},{value:ps.Finished,label:`Finished`},{value:ps.NotYetReleased,label:`Not yet aired`},{value:ps.Cancelled,label:`Cancelled`},{value:ps.Hiatus,label:`Hiatus`}],Ns=[{value:ds.Winter,label:`Winter`},{value:ds.Spring,label:`Spring`},{value:ds.Summer,label:`Summer`},{value:ds.Fall,label:`Fall`}],Ps=[{value:ls.Anime,label:`Anime`},{value:ls.Series,label:`Series`},{value:ls.Movie,label:`Movies`}],Fs=[`Action`,`Adventure`,`Comedy`,`Drama`,`Ecchi`,`Fantasy`,`Horror`,`Mahou Shoujo`,`Mecha`,`Music`,`Mystery`,`Psychological`,`Romance`,`Sci-Fi`,`Slice of Life`,`Sports`,`Supernatural`,`Thriller`],Is=new Set(Fs.map(e=>e.toLowerCase())),Ls=e=>Is.has(e.trim().toLowerCase()),Rs=(e,t)=>e.find(e=>e===t)??null,zs=(e,t)=>t.map(t=>Rs(e,t)).filter(e=>e!==null),Bs=e=>Ns.map(e=>e.value).find(t=>t===e)??null,Vs=js.map(e=>e.value),Hs=Ms.map(e=>e.value),Us=Ns.map(e=>e.value),Ws=Ps.map(e=>e.value),Gs=1917,Ks=(e=new Date)=>e.getFullYear()+5,qs=(e,t=new Date)=>{if(!e||!/^\d{4}$/.test(e))return null;let n=Number(e);return n>=1917&&n<=Ks(t)?n:null},Js=(e,t=new Date)=>{let n=new URLSearchParams(e);return{query:(n.get(As.query)??``).trim(),category:Rs(Ws,n.get(As.category)),status:Rs(Hs,n.get(As.status)),season:Rs(Us,n.get(As.season)),year:qs(n.get(As.year),t),formats:zs(Vs,n.getAll(As.format)),genres:Ys(n.getAll(As.genre)),tags:Ys(n.getAll(As.tag))}},Ys=e=>{let t=new Set,n=[];for(let r of e){let e=r.trim(),i=e.toLowerCase();e&&!t.has(i)&&(t.add(i),n.push(e))}return n},Xs=e=>{let t=new URLSearchParams,n=e.query?.trim();n&&t.set(As.query,n),e.category&&t.set(As.category,e.category),e.status&&t.set(As.status,e.status),e.season&&t.set(As.season,e.season),e.year&&t.set(As.year,String(e.year));for(let n of e.formats??[])t.append(As.format,n);for(let n of e.genres??[])t.append(As.genre,n);for(let n of e.tags??[])t.append(As.tag,n);return t.toString()},Zs=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return e}},Qs=(e={})=>{let t=Xs(e);return t?`/search?${t}`:`/search`},$s=e=>{if(e.query)return`Results for \u201C${e.query}\u201D`;let t=Ns.find(t=>t.value===e.season)?.label;return t&&e.year?`${t} ${e.year}`:t?`${t} seasons`:e.year?String(e.year):rc(e)?`Browsing`:`Search`},ec=e=>js.find(t=>t.value===e)?.label,tc=e=>Ms.find(t=>t.value===e)?.label,nc=(e,t)=>{let n=Ns.find(t=>t.value===e)?.label;return n&&t?`${n} ${t}`:t?String(t):void 0},rc=e=>!!(e.query||e.category||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),ic=e=>!!(e.query||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),ac=`plugins`,oc=`plugin`,sc=(e,t)=>{try{return new URL(e,t)}catch{return}},cc=e=>{let t=new Set;return e.filter(e=>{let n=lc(e);return!n||t.has(n)?!1:(t.add(n),!0)})},lc=e=>e.trim().replace(/\/+$/,``).replace(/@\d[^@/]*$/,``),uc=(e,t)=>{let n=sc(e,t);return n?cc([...n.searchParams].filter(([e])=>e===`plugins`||e===oc).map(([,e])=>e.trim())):[]},dc=e=>encodeURIComponent(e).replace(/%3A/g,`:`).replace(/%2F/g,`/`).replace(/%40/g,`@`),fc=(e,t,n)=>{let r=sc(e,n),i=sc(n);return!r||!i||r.origin!==i.origin?e:(r.searchParams.delete(ac),r.searchParams.delete(oc),r.search=[r.searchParams.toString(),cc(t.map(e=>e.trim())).sort().map(e=>`${ac}=${dc(e)}`).join(`&`)].filter(Boolean).join(`&`),r.href)},pc=new Map,mc=new Set,hc=new Set,gc=()=>hc.forEach(e=>{try{e()}catch{}}),_c=e=>(hc.add(e),()=>{hc.delete(e)}),vc=()=>[...pc.values()],yc=()=>[...pc.keys()],bc=e=>{let t=new Set(zr().map(lc)),n=!1;for(let r of e){let e=lc(r);!e||t.has(e)||mc.has(e)||pc.has(r)||(pc.set(r,{uri:r,state:`offered`}),n=!0)}n&&gc()},xc=()=>{if(pc.size){for(let e of pc.keys())mc.add(lc(e));pc.clear(),gc()}},Sc=async()=>{let e=[...pc.keys()];if(e.length){for(let t of e)pc.set(t,{uri:t,state:`installing`});gc();for(let t of e){try{await Zr(t,{noConfirm:!0})||mc.add(lc(t)),pc.delete(t)}catch(e){pc.set(t,{uri:t,state:`error`,error:e instanceof Error?e.message:String(e)})}gc()}}},Cc=e=>{pc.delete(e)&&(mc.add(lc(e)),gc())},wc=()=>[...zr(),...yc()],Tc=()=>{let e=fc(location.href,wc(),location.href);e!==location.href&&history.replaceState(history.state,``,e)},Ec=()=>bc(uc(location.href)),Dc=e=>{let t=fc(e,wc(),location.href);return t.startsWith(location.origin)?t.slice(location.origin.length):t},Oc=e=>{let t=history[e];history[e]=function(e,n,r){let i=r==null?location.href:String(r);return t.call(this,e,n,fc(i,wc(),location.href))}},kc=Symbol.for(`stub_plugin_url`);kc in globalThis||(Object.defineProperty(globalThis,kc,{value:!0}),Oc(`pushState`),Oc(`replaceState`),addEventListener(`popstate`,()=>{Ec(),Tc()}),Lr(Tc),_c(Tc),Ec(),Tc());var Ac=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),jc=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Mc=e=>{let t=jc(e);return t.charAt(0).toUpperCase()+t.slice(1)},Nc=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Pc=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Fc={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};h();var Ic=l(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>ce(`svg`,{ref:c,...Fc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Nc(`lucide`,i),...!a&&!Pc(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>ce(e,t)),...Array.isArray(a)?a:[a]]));h();var Y=(e,t)=>{let n=l(({className:n,...r},i)=>ce(Ic,{ref:i,iconNode:t,className:Nc(`lucide-${Ac(Mc(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Mc(e),n},Lc=Y(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Rc=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),zc=Y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Bc=Y(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Vc=Y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Hc=Y(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Uc=Y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Wc=Y(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Gc=Y(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Kc=Y(`grid-3x2`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),qc=Y(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),Jc=Y(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),Yc=Y(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),Xc=Y(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Zc=Y(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),Qc=Y(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),$c=Y(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),el=Y(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),tl=Y(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),nl=Y(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),rl=Y(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),il=Y(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),al=Y(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ol=Y(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),sl=Y(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),cl=Y(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ll=Y(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),ul=Y(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),dl=Y(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),fl=Y(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),pl=Y(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),ml=Y(`volume`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}]]),hl=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),gl=e=>e===`/`||e===`/media`||e.startsWith(`/media/`),_l=({from:e,to:t,kind:n,asked:r=!1})=>r?!0:n===`pop`||gl(e.pathname)&&gl(t.pathname)?!1:n!==`replace`||e.pathname!==t.pathname,vl=()=>{window.scrollTo({top:0,left:0,behavior:`instant`})},yl=0,bl=()=>{xl(),yl=requestAnimationFrame(()=>{yl=0,vl()})},xl=()=>{cancelAnimationFrame(yl),yl=0},Sl=!1,Cl=()=>{Sl=!0},wl=()=>{let e=Sl;return Sl=!1,e},Tl=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`].join(`,`),El=typeof Element>`u`,Dl=El?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Ol=!El&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},kl=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},Al=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},jl=function(e,t,n){if(kl(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Tl));return t&&Dl.call(e,Tl)&&r.unshift(e),r=r.filter(n),r},Ml=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!kl(o,!1)){if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{Dl.call(o,Tl)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!kl(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}}return i},Nl=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Pl=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Al(e))&&!Nl(e)?0:e.tabIndex},Fl=function(e,t){var n=Pl(e);return n<0&&t&&!Nl(e)?0:n},Il=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Ll=function(e){return e.tagName===`INPUT`},Rl=function(e){return Ll(e)&&e.type===`hidden`},zl=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Bl=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Vl=function(e){if(!e.name)return!0;var t=e.form||Ol(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Bl(r,e.form);return!i||i===e},Hl=function(e){return Ll(e)&&e.type===`radio`},Ul=function(e){return Hl(e)&&!Vl(e)},Wl=function(e){var t=e&&Ol(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Ol(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Gl=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Kl=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Dl.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Dl.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Ol(e);if(o&&!o.shadowRoot&&r(o)===!0)return Gl(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Wl(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Gl(e);return!1},ql=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Dl.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},Jl=function(e,t){return!(t.disabled||kl(t)||Rl(t)||Kl(t,e)||zl(t)||ql(t))},Yl=function(e,t){return!(Ul(t)||Pl(t)<0||!Jl(e,t))},Xl=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},Zl=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=Fl(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(Il).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},Ql=function(e,t){return t||={},Zl(t.getShadowRoot?Ml([e],t.includeContainer,{filter:Yl.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:Xl}):jl(e,t.includeContainer,Yl.bind(null,t)))},$l=function(e,t){return t||={},t.getShadowRoot?Ml([e],t.includeContainer,{filter:Jl.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):jl(e,t.includeContainer,Jl.bind(null,t))},eu=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Dl.call(e,Tl)!==!1&&Yl(t,e)};h();function tu(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function nu(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function ru(){return/apple/i.test(navigator.vendor)}function iu(){let e=/android/i;return e.test(tu())||e.test(nu())}function au(){return tu().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function ou(){return nu().includes(`jsdom/`)}var su=`data-floating-ui-focusable`,cu=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function lu(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function uu(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function du(e){return`composedPath`in e?e.composedPath()[0]:e.target}function fu(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function pu(e){return e.matches(`html,body`)}function mu(e){return e?.ownerDocument||document}function hu(e){return o(e)&&e.matches(cu)}function gu(e){return e?e.getAttribute(`role`)===`combobox`&&hu(e):!1}function _u(e){if(!e||ou())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function vu(e){return e?e.hasAttribute(su)?e:e.querySelector(`[`+su+`]`)||e:null}function yu(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...yu(e,t.id,n)])}function bu(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function xu(e){e.preventDefault(),e.stopPropagation()}function Su(e){return`nativeEvent`in e}function Cu(e){return e.mozInputSource===0&&e.isTrusted?!0:iu()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function wu(e){return ou()?!1:!iu()&&e.width===0&&e.height===0||iu()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Tu(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Eu=typeof document<`u`?_e:function(){},Du={...S};function Ou(e){let t=R(e);return Eu(()=>{t.current=e}),t}var ku=Du.useInsertionEffect||(e=>e());function Au(e){let t=R(()=>{});return ku(()=>{t.current=e}),z(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var ju=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Mu(e,t){let n=Ql(e,ju()),r=n.length;if(r===0)return;let i=lu(mu(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Nu(e){return Mu(mu(e).body,1)||e}function Pu(e){return Mu(mu(e).body,-1)||e}function Fu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!uu(n,r)}function Iu(e){Ql(e,ju()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Lu(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}h();var Ru=typeof document<`u`?_e:function(){};function zu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!zu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!zu(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Bu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Vu(e,t){let n=Bu(e);return Math.round(t*n)/n}function Hu(e){let t=R(e);return Ru(()=>{t.current=e}),t}function Uu(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:i=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=B({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=B(i);zu(p,i)||m(i);let[h,g]=B(null),[_,v]=B(null),y=z(e=>{e!==w.current&&(w.current=e,g(e))},[]),b=z(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=o||h,S=s||_,w=R(null),T=R(null),E=R(d),D=l!=null,O=Hu(l),k=Hu(a),A=Hu(u),j=z(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),r(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!zu(E.current,t)&&(E.current=t,C(()=>{f(t)}))})},[p,t,n,k,A]);Ru(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=R(!1);Ru(()=>(M.current=!0,()=>{M.current=!1}),[]),Ru(()=>{if(x&&(w.current=x),S&&(T.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=V(()=>({reference:w,floating:T,setReference:y,setFloating:b}),[y,b]),P=V(()=>({reference:x,floating:S}),[x,S]),ee=V(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Vu(P.floating,d.x),r=Vu(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Bu(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return V(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var Wu=(e,t)=>({...y(e),options:[e,t]}),Gu=(e,t)=>({...a(e),options:[e,t]}),Ku=(e,t)=>({...be(e),options:[e,t]}),qu=(e,t)=>({...i(e),options:[e,t]});h(),ie();function Ju(e){let t=R(void 0),n=z(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return V(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var Yu=`data-floating-ui-focusable`,Xu=`active`,Zu=`selected`,Qu=`ArrowLeft`,$u=`ArrowRight`,ed=`ArrowUp`,td=`ArrowDown`,nd=[Qu,$u],rd=[ed,td];[...nd,...rd];var id={...S},ad=!1,od=0,sd=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+od++;function cd(){let[e,t]=B(()=>ad?sd():void 0);return Eu(()=>{e??t(sd())},[]),O(()=>{ad=!0},[]),e}var ld=id.useId||cd;function ud(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var dd=fe(null),fd=fe(null),pd=()=>L(dd)?.id||null,md=()=>L(fd);function hd(e){return`data-floating-ui-`+e}function gd(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var _d=hd(`safe-polygon`);function vd(e,t,n){if(n&&!Tu(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function yd(e){return typeof e==`function`?e():e}function bd(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=md(),h=pd(),g=Ou(l),_=Ou(c),v=Ou(n),y=Ou(d),b=R(),x=R(-1),S=R(),C=R(-1),w=R(!0),T=R(!1),E=R(()=>{}),D=R(!1),k=Au(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});O(()=>{if(!s)return;function e(e){let{open:t}=e;t||(gd(x),gd(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),O(()=>{if(!s||!g.current||!n)return;function e(e){k()&&r(!1,e,`hover`)}let t=mu(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,g,k]);let A=z(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=vd(_.current,`close`,b.current);i&&!S.current?(gd(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(gd(x),r(!1,e,n))},[_,r]),j=Au(()=>{E.current(),S.current=void 0}),M=Au(()=>{if(T.current){let e=mu(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(_d),T.current=!1}}),N=Au(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);O(()=>{if(!s)return;function e(e){if(gd(x),w.current=!1,u&&!Tu(b.current)||yd(y.current)>0&&!vd(_.current,`open`))return;let t=vd(_.current,`open`,b.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(N()){M();return}E.current();let t=mu(o.floating);if(gd(C),D.current=!1,g.current&&i.current.floatingContext){n||gd(x),S.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){M(),j(),N()||A(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(b.current!==`touch`||!uu(o.floating,e.relatedTarget))&&A(e)}function a(e){N()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){M(),j(),N()||A(e)}})(e))}function c(){gd(x)}function l(e){N()||A(e,!1)}if(m(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,A,j,M,r,n,v,p,_,g,i,N,y]),Eu(()=>{var e;if(s&&n&&(e=g.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&k()){T.current=!0;let e=o.floating;if(m(o.domReference)&&e){var t;let n=mu(o.floating).body;n.setAttribute(_d,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===h))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,h,o,p,g,k]),Eu(()=>{n||(b.current=void 0,D.current=!1,j(),M())},[n,j,M]),O(()=>()=>{j(),gd(x),gd(C),M()},[s,o.domReference,j,M]);let P=V(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!v.current&&r(!0,t,`hover`)}(!u||Tu(b.current))&&(n||yd(y.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(gd(C),b.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,yd(y.current)))))}}},[u,r,n,v,y]);return V(()=>s?{reference:P}:{},[s,P])}var xd=0;function Sd(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(xd);let a=()=>e?.focus({preventScroll:n});i?a():xd=requestAnimationFrame(a)}function Cd(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function wd(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Td(e){return e?.ownerDocument||document}var Ed={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Dd(e){return e===`inert`?Ed.inert:e===`aria-hidden`?Ed[`aria-hidden`]:Ed.none}var Od=new WeakSet,kd={},Ad=0,jd=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,Md=e=>e&&(e.host||Md(e.parentNode)),Nd=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Md(t);return e.contains(n)?n:null}).filter(e=>e!=null);function Pd(e,n,r,i){let a=`data-floating-ui-inert`,o=i?`inert`:r?`aria-hidden`:null,s=Nd(n,e),c=new Set,l=new Set(s),u=[];kd[a]||(kd[a]=new WeakMap);let d=kd[a];s.forEach(f),p(n),c.clear();function f(e){e&&!c.has(e)&&(c.add(e),e.parentNode&&f(e.parentNode))}function p(e){e&&!l.has(e)&&[].forEach.call(e.children,e=>{if(t(e)!==`script`){if(c.has(e))p(e);else{let t=o?e.getAttribute(o):null,n=t!==null&&t!==`false`,r=Dd(o),i=(r.get(e)||0)+1,s=(d.get(e)||0)+1;r.set(e,i),d.set(e,s),u.push(e),i===1&&n&&Od.add(e),s===1&&e.setAttribute(a,``),!n&&o&&e.setAttribute(o,o===`inert`?``:`true`)}}})}return Ad++,()=>{u.forEach(e=>{let t=Dd(o),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Od.has(e)&&o&&e.removeAttribute(o),Od.delete(e)),r||e.removeAttribute(a)}),Ad--,Ad||(Ed.inert=new WeakMap,Ed[`aria-hidden`]=new WeakMap,Ed.none=new WeakMap,Od=new WeakSet,kd={})}}function Fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Td(e[0]).body;return Pd(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var Id={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Ld=l(function(e,t){let[n,r]=B();Eu(()=>{ru()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[hd(`focus-guard`)]:``,style:Id};return p(`span`,{...e,...i})}),Rd=fe(null),zd=hd(`portal`);function Bd(e){e===void 0&&(e={});let{id:t,root:n}=e,r=ld(),i=Hd(),[a,o]=B(null),s=R(null);return Eu(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),Eu(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(zd,``),e.appendChild(n),s.current=n,o(n)},[t,r]),Eu(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!u(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(zd,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Vd(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Bd({id:n,root:r}),[o,s]=B(null),c=R(null),l=R(null),u=R(null),d=R(null),f=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return O(()=>{if(!a||!i||f)return;function e(e){a&&Fu(e)&&(e.type===`focusin`?Lu:Iu)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),O(()=>{a&&(m||Lu(a))},[m,a]),p(Rd.Provider,{value:V(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&p(Ld,{"data-type":`outside`,ref:c,onFocus:e=>{if(Fu(e,a)){var t;(t=u.current)==null||t.focus()}else Pu(o?o.domReference:null)?.focus()}}),h&&a&&p(`span`,{"aria-owns":a.id,style:Id}),a&&pe(t,a),h&&a&&p(Ld,{"data-type":`outside`,ref:l,onFocus:e=>{if(Fu(e,a)){var t;(t=d.current)==null||t.focus()}else Nu(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var Hd=()=>L(Rd);function Ud(e){return V(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Wd=20,Gd=[];function Kd(){Gd=Gd.filter(e=>e.isConnected)}function qd(e){Kd(),e&&t(e)!==`body`&&(Gd.push(e),Gd.length>Wd&&(Gd=Gd.slice(-20)))}function Jd(){return Kd(),Gd[Gd.length-1]}function Yd(e){let t=ju();return eu(e,t)?e:Ql(e,t)[0]||e}function Xd(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=ju(),i=$l(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return eu(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var Zd=l(function(e,t){return p(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Id})});function Qd(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0,outsideElementsInert:m=!1,getInsideElements:h=()=>[]}=e,{open:g,onOpenChange:_,events:v,dataRef:y,elements:{domReference:b,floating:x}}=t,S=Au(()=>y.current.floatingContext?.nodeId),C=Au(h),w=typeof s==`number`&&s<0,T=gu(b)&&w,E=jd(),D=!E||a,k=!D||E&&m,A=Ou(i),j=Ou(s),M=Ou(c),N=md(),P=Hd(),ee=R(null),te=R(null),re=R(!1),ie=R(!1),F=R(-1),ae=R(-1),oe=P!=null,I=vu(x),L=Au(function(e){return e===void 0&&(e=I),e?Ql(e,ju()):[]}),se=Au(e=>{let t=L(e);return A.current.map(e=>b&&e===`reference`?b:I&&e===`floating`?I:t).filter(Boolean).flat()});O(()=>{if(r||!u)return;function e(e){if(e.key===`Tab`){uu(I,lu(mu(I)))&&L().length===0&&!T&&xu(e);let t=se(),n=du(e);A.current[0]===`reference`&&n===b&&(xu(e),e.shiftKey?Sd(t[t.length-1]):Sd(t[1])),A.current[1]===`floating`&&n===I&&e.shiftKey&&(xu(e),Sd(t[0]))}}let t=mu(I);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,b,I,u,A,T,L,se]),O(()=>{if(r||!x)return;function e(e){let t=du(e),n=L().indexOf(t);n!==-1&&(F.current=n)}return x.addEventListener(`focusin`,e),()=>{x.removeEventListener(`focusin`,e)}},[r,x,L]),O(()=>{if(r||!f)return;function e(){ie.current=!0,setTimeout(()=>{ie.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=du(e);queueMicrotask(()=>{let i=S(),a=!(uu(b,t)||uu(x,t)||uu(t,x)||uu(P?.portalNode,t)||t!=null&&t.hasAttribute(hd(`focus-guard`))||N&&(yu(N.nodesRef.current,i).find(e=>uu(e.context?.elements.floating,t)||uu(e.context?.elements.domReference,t))||bu(N.nodesRef.current,i).find(e=>[e.context?.elements.floating,vu(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===b&&I&&Xd(I,A),l&&n!==b&&!(r!=null&&r.isConnected)&&lu(mu(I))===mu(I).body){o(I)&&I.focus();let e=F.current,t=L(),n=t[e]||t[t.length-1]||I;o(n)&&n.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(T||!u)&&t&&a&&!ie.current&&t!==Jd()&&(re.current=!0,_(!1,e,`focus-out`))})}let n=!(N||!P);function i(){gd(ae),y.current.insideReactTree=!0,ae.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(x&&o(b))return b.addEventListener(`focusout`,t),b.addEventListener(`pointerdown`,e),x.addEventListener(`focusout`,t),n&&x.addEventListener(`focusout`,i,!0),()=>{b.removeEventListener(`focusout`,t),b.removeEventListener(`pointerdown`,e),x.removeEventListener(`focusout`,t),n&&x.removeEventListener(`focusout`,i,!0)}},[r,b,x,I,u,N,P,_,f,l,L,T,S,A,y]);let ce=R(null),le=R(null),ue=Ud([ce,P?.beforeInsideRef]),z=Ud([le,P?.afterInsideRef]);O(()=>{var e,t;if(r||!x)return;let n=Array.from((P==null||(e=P.portalNode)==null?void 0:e.querySelectorAll(`[`+hd(`portal`)+`]`))||[]),i=(t=(N?bu(N.nodesRef.current,S()):[]).find(e=>gu(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[x,i,...n,...C(),ee.current,te.current,ce.current,le.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,A.current.includes(`reference`)||T?b:null].filter(e=>e!=null),o=u||T?Fd(a,!k,k):Fd(a);return()=>{o()}},[r,b,x,u,A,P,T,D,k,N,S,C]),Eu(()=>{if(r||!o(I))return;let e=lu(mu(I));queueMicrotask(()=>{let t=se(I),n=j.current,r=(typeof n==`number`?t[n]:n.current)||I,i=uu(I,e);!w&&!i&&g&&Sd(r,{preventScroll:r===I})})},[r,g,I,w,se,j]),Eu(()=>{if(r||!I)return;let e=mu(I);qd(lu(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(re.current=!0),t===`outside-press`){if(r)re.current=!1;else if(Cu(n)||wu(n))re.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?re.current=!1:re.current=!0}}}v.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Id),oe&&b&&b.insertAdjacentElement(`afterend`,n);function i(){if(typeof M.current==`boolean`){let e=b||Jd();return e&&e.isConnected?e:n}return M.current.current||n}return()=>{v.off(`openchange`,t);let r=lu(e),a=uu(x,r)||N&&yu(N.nodesRef.current,S(),!1).some(e=>uu(e.context?.elements.floating,r)),s=i();queueMicrotask(()=>{let t=Yd(s);M.current&&!re.current&&o(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,x,I,M,y,v,N,oe,b,S]),O(()=>(queueMicrotask(()=>{re.current=!1}),()=>{queueMicrotask(Kd)}),[r]),Eu(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:f,open:g,onOpenChange:_,domReference:b}),()=>{P.setFocusManagerState(null)}},[r,P,u,g,_,f,b]),Eu(()=>{r||I&&Xd(I,A)},[r,I,A]);function de(e){return r||!d||!u?null:p(Zd,{ref:e===`start`?ee:te,onClick:e=>_(!1,e.nativeEvent),children:typeof d==`string`?d:`Dismiss`})}let fe=!r&&D&&(!u||!T)&&(oe||u);return p(ne,{children:[fe&&p(Ld,{"data-type":`inside`,ref:ue,onFocus:e=>{if(u){let e=se();Sd(i[0]===`reference`?e[0]:e[e.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode){if(re.current=!1,Fu(e,P.portalNode))Nu(b)?.focus();else{var t;(t=P.beforeOutsideRef.current)==null||t.focus()}}}}),!T&&de(`start`),n,de(`end`),fe&&p(Ld,{"data-type":`inside`,ref:z,onFocus:e=>{if(u)Sd(se()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode){if(f&&(re.current=!0),Fu(e,P.portalNode))Pu(b)?.focus();else{var t;(t=P.afterOutsideRef.current)==null||t.focus()}}}})]})}var $d=0,ef=`--floating-ui-scrollbar-width`;function tf(){let e=tu(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(ef,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(ef),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var nf=()=>{},rf=l(function(e,t){let{lockScroll:n=!1,...r}=e;return Eu(()=>{if(n)return $d++,$d===1&&(nf=tf()),()=>{$d--,$d===0&&nf()}},[n]),p(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function af(e){return o(e.target)&&e.target.tagName===`BUTTON`}function of(e){return o(e.target)&&e.target.tagName===`A`}function sf(e){return hu(e)}function cf(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=R(),p=R(!1),m=V(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current;e.button===0&&s!==`click`&&(Tu(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=f.current;if(s===`mousedown`&&f.current){f.current=void 0;return}Tu(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){f.current=void 0,!(e.defaultPrevented||!u||af(e))&&(e.key===` `&&!sf(a)&&(e.preventDefault(),p.current=!0),!of(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||af(e)||sf(a)||e.key===` `&&p.current&&(p.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,d,c]);return V(()=>o?{reference:m}:{},[o,m])}var lf={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},uf={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},df=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function ff(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:f=`pointerdown`,referencePress:p=!1,referencePressEvent:h=`pointerdown`,ancestorScroll:g=!1,bubbles:_,capture:v}=t,y=md(),b=Au(typeof u==`function`?u:()=>!1),x=typeof u==`function`?b:u,S=R(!1),{escapeKey:C,outsidePress:w}=df(_),{escapeKey:T,outsidePress:E}=df(v),D=R(!1),k=Au(e=>{if(!n||!s||!l||e.key!==`Escape`||D.current)return;let t=a.current.floatingContext?.nodeId,i=y?yu(y.nodesRef.current,t):[];if(!C&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Su(e)?e.nativeEvent:e,`escape-key`)}),A=Au(e=>{var t;let n=()=>{var t;k(e),(t=du(e))==null||t.removeEventListener(`keydown`,n)};(t=du(e))==null||t.addEventListener(`keydown`,n)}),j=Au(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=S.current;if(S.current=!1,f===`click`&&n||t||typeof x==`function`&&!x(e))return;let s=du(e),l=`[`+hd(`inert`)+`]`,u=mu(i.floating).querySelectorAll(l),p=m(s)?s:null;for(;p&&!c(p);){let e=d(p);if(c(e)||!m(e))break;p=e}if(u.length&&m(s)&&!pu(s)&&!uu(s,i.floating)&&Array.from(u).every(e=>!uu(p,e)))return;if(o(s)&&P){let t=c(s),n=I(s),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),o=i&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=a&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,u=n.direction===`rtl`,d=l&&(u?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),f=o&&e.offsetY>s.clientHeight;if(d||f)return}let h=a.current.floatingContext?.nodeId,g=y&&yu(y.nodesRef.current,h).some(t=>fu(e,t.context?.elements.floating));if(fu(e,i.floating)||fu(e,i.domReference)||g)return;let _=y?yu(y.nodesRef.current,h):[];if(_.length>0){let e=!0;if(_.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),M=Au(e=>{var t;let n=()=>{var t;j(e),(t=du(e))==null||t.removeEventListener(f,n)};(t=du(e))==null||t.addEventListener(f,n)});O(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function o(){window.clearTimeout(e),D.current=!0}function c(){e=window.setTimeout(()=>{D.current=!1},Se()?5:0)}let u=mu(i.floating);l&&(u.addEventListener(`keydown`,T?A:k,T),u.addEventListener(`compositionstart`,o),u.addEventListener(`compositionend`,c)),x&&u.addEventListener(f,E?M:j,E);let d=[];return g&&(m(i.domReference)&&(d=oe(i.domReference)),m(i.floating)&&(d=d.concat(oe(i.floating))),!m(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(oe(i.reference.contextElement)))),d=d.filter(e=>e!==u.defaultView?.visualViewport),d.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{l&&(u.removeEventListener(`keydown`,T?A:k,T),u.removeEventListener(`compositionstart`,o),u.removeEventListener(`compositionend`,c)),x&&u.removeEventListener(f,E?M:j,E),d.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,l,x,f,n,r,g,s,C,w,k,T,A,j,E,M]),O(()=>{a.current.insideReactTree=!1},[a,x,f]);let N=V(()=>({onKeyDown:k,...p&&{[lf[h]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...h!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[k,r,p,h]),P=V(()=>({onKeyDown:k,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[uf[f]]:()=>{a.current.insideReactTree=!0}}),[k,f,a]);return V(()=>s?{reference:N,floating:P}:{},[s,N,P])}function pf(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=ld(),a=R({}),[o]=B(()=>ud()),s=pd()!=null,[c,l]=B(r.reference),u=Au((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=V(()=>({setPositionReference:l}),[]),f=V(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return V(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function mf(e){e===void 0&&(e={});let{nodeId:t}=e,n=pf({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=B(null),[s,c]=B(null),l=i?.domReference||a,u=R(null),d=md();Eu(()=>{l&&(u.current=l)},[l]);let f=Uu({...e,elements:{...i,...s&&{reference:s}}}),p=z(e=>{let t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),h=z(e=>{(m(e)||e===null)&&(u.current=e,o(e)),(m(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!m(e))&&f.refs.setReference(e)},[f.refs]),g=V(()=>({...f.refs,setReference:h,setPositionReference:p,domReference:u}),[f.refs,h,p]),_=V(()=>({...f.elements,domReference:l}),[f.elements,l]),v=V(()=>({...f,...r,refs:g,elements:_,nodeId:t}),[f,g,_,t,r]);return Eu(()=>{r.dataRef.current.floatingContext=v;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),V(()=>({...f,context:v,refs:g,elements:_}),[f,g,_,v])}function hf(){return au()&&ru()}function gf(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:s}=e,{enabled:c=!0,visibleOnly:l=!0}=t,u=R(!1),d=R(-1),p=R(!0);O(()=>{if(!c)return;let e=f(s.domReference);function t(){!n&&o(s.domReference)&&s.domReference===lu(mu(s.domReference))&&(u.current=!0)}function r(){p.current=!0}function i(){p.current=!1}return e.addEventListener(`blur`,t),hf()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),hf()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[s.domReference,n,c]),O(()=>{if(!c)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(u.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,c]),O(()=>()=>{gd(d)},[]);let h=V(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;let t=du(e.nativeEvent);if(l&&m(t)){if(hf()&&!e.relatedTarget){if(!p.current&&!hu(t))return}else if(!_u(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){u.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=m(t)&&t.hasAttribute(hd(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;d.current=window.setTimeout(()=>{let e=lu(s.domReference?s.domReference.ownerDocument:document);(t||e!==s.domReference)&&(uu(a.current.floatingContext?.refs.floating.current,e)||uu(s.domReference,e)||i||r(!1,n,`focus`))})}}),[a,s.domReference,r,l]);return V(()=>c?{reference:h}:{},[c,h])}function _f(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[Xu]:t,[Zu]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[Yu]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[Xu,Zu].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function vf(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=z(t=>_f(t,e,`reference`),t),a=z(t=>_f(t,e,`floating`),n),o=z(t=>_f(t,e,`item`),r);return V(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var yf=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function bf(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=ld(),c=r.domReference?.id||s,l=V(()=>vu(r.floating)?.id||i,[r.floating,i]),u=yf.get(o)??o,d=pd()!=null,f=V(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=V(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=z(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return V(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var xf=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function Sf(e,t){return typeof e==`function`?e(t):e}function Cf(e,t){let[n,r]=B(e);return e&&!n&&r(!0),O(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function wf(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=B(`unmounted`),c=Cf(n,a);return!c&&o===`close`&&s(`unmounted`),Eu(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{C(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Tf(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=V(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=B(()=>({...Sf(a,l),...Sf(n,l)})),{isMounted:h,status:g}=wf(e,{duration:o}),_=Ou(n),v=Ou(r),y=Ou(i),b=Ou(a);return Eu(()=>{let e=Sf(_.current,l),t=Sf(y.current,l),n=Sf(b.current,l),r=Sf(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(xf).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(xf).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function Ef(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ef(e,t.id,n)])}function Df(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Of(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function kf(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){gd(i),u()}if(gd(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:h,clientY:g}=e,_=[h,g],v=wd(e),y=e.type===`mouseleave`,b=Cd(c.floating,v),x=Cd(c.domReference,v),S=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),w=s.split(`-`)[0],T=n>C.right-C.width/2,E=o>C.bottom-C.height/2,D=Of(_,S),O=C.width>S.width,k=C.height>S.height,A=(O?S:C).left,j=(O?S:C).right,M=(k?S:C).top,N=(k?S:C).bottom;if(b&&(a=!0,!y))return;if(x&&(a=!1),x&&!y){a=!0;return}if(y&&m(e.relatedTarget)&&Cd(c.floating,e.relatedTarget)||f&&Ef(f.nodesRef.current,d).length)return;if(w===`top`&&o>=S.bottom-1||w===`bottom`&&o<=S.top+1||w===`left`&&n>=S.right-1||w===`right`&&n<=S.left+1)return p();let P=[];switch(w){case`top`:P=[[A,S.top+1],[A,C.bottom-1],[j,C.bottom-1],[j,S.top+1]];break;case`bottom`:P=[[A,C.top+1],[A,S.bottom-1],[j,S.bottom-1],[j,C.top+1]];break;case`left`:P=[[C.right-1,N],[C.right-1,M],[S.left+1,M],[S.left+1,N]];break;case`right`:P=[[S.right-1,N],[S.right-1,M],[C.left+1,M],[C.left+1,N]]}function ee(e){let[n,r]=e;switch(w){case`top`:return[[O?n+t/2:T?n+t*4:n-t*4,r+t+1],[O?n-t/2:T?n+t*4:n-t*4,r+t+1],[C.left,T||O?C.bottom-t:C.top],[C.right,T?O?C.bottom-t:C.top:C.bottom-t]];case`bottom`:return[[O?n+t/2:T?n+t*4:n-t*4,r-t],[O?n-t/2:T?n+t*4:n-t*4,r-t],[C.left,T||O?C.top+t:C.bottom],[C.right,T?O?C.top+t:C.bottom:C.top+t]];case`left`:{let e=[n+t+1,k?r+t/2:E?r+t*4:r-t*4],i=[n+t+1,k?r-t/2:E?r+t*4:r-t*4];return[[E||k?C.right-t:C.left,C.top],[E?k?C.right-t:C.left:C.right-t,C.bottom],e,i]}case`right`:return[[n-t,k?r+t/2:E?r+t*4:r-t*4],[n-t,k?r-t/2:E?r+t*4:r-t*4],[E||k?C.left+t:C.right,C.top],[E?k?C.left+t:C.right:C.left+t,C.bottom]]}}if(!Df([h,g],P)){if(a&&!D)return p();if(!y&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Df([h,g],ee([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}h();var Af=({className:e,style:t}={})=>ce(`iframe`,{src:br(),title:`Connect your FKN account`,className:e,style:{border:`none`,width:150,height:40,background:`transparent`,colorScheme:`normal`,...t}}),jf=8e3,Mf=async(e,t=jf)=>{let n,r=new Promise(e=>{n=setTimeout(()=>e(`timeout`),t)});try{return await Promise.race([Promise.resolve().then(e).then(()=>`settled`,()=>`settled`),r])}finally{clearTimeout(n)}},Nf=()=>Promise.race([Ce.info(),new Promise(e=>setTimeout(()=>e(null),4e3))]),Pf=()=>{let[e,t]=B(null),[n,r]=B(!1),i=z(()=>Nf().then(e=>{t(e),r(!0)}).catch(()=>r(!0)),[]);return O(()=>{let e=!1,t=Ce.onChange(()=>{e||i()});i();let n=window.setInterval(()=>{e||i()},3e4);return()=>{e=!0,window.clearInterval(n),t.then(e=>e()).catch(()=>{})}},[i]),{info:e,ready:n,logout:z(async()=>{let e=await Mf(()=>Ce.logout());return await i(),e},[i])}},Ff={categoryBar:1,hoverCard:150,sourcePopup:300,filterMenu:500,mediaModal:1e3,header:1100,headerPopup:1150,franchiseDialog:1200,pluginPrompt:2e3,partyCursor:3e3};j();var If=`https://fkn.app/account`,Lf=150,Rf=40,zf=x`
19
+ `)){var r=n.match(tr);if(r){var i=r[1];try{yield t=JSON.parse(i)}catch(e){if(!t)throw e}if(t&&!1===t.hasNext)break}}t&&!1!==t.hasNext&&(yield{hasNext:!1})}(a):/text\//i.test(o)?async function*(e){var t=await e.text();try{yield JSON.parse(t)}catch{throw Error(t)}}(a):async function*(e){yield JSON.parse(await e.text())}(a),c;for await(var l of s)l.pending&&!i?c=l.pending:l.pending&&(c=[...c,...l.pending]),i=i?qn(i,l,a,c):Gn(e,l,a),r=!1,yield i,r=!0;i||(yield i=Gn(e,{},a))}catch(t){if(!r)throw t;yield Jn(e,a&&(a.status<200||a.status>=300)&&a.statusText?Error(a.statusText):t,a)}}function ar(e,t,n){var r;return typeof AbortController<`u`&&(n.signal=(r=new AbortController).signal),tn((()=>{r&&r.abort()}))(Xt((e=>!!e))(dn(ir(e,t,n))))}function or(e){var t=t=>e(t);return t.toPromise=()=>xn(sn(1)(Xt((e=>!e.stale&&!e.hasNext))(t))),t.then=(e,n)=>t.toPromise().then(e,n),t.subscribe=e=>yn(e)(t),t}function sr(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var cr=()=>{},lr=({forward:e,dispatchDebug:t})=>t=>en([Qt((e=>{var n=Yn(e),r=Xn(e,n),i=$n(e,n);return cn(Xt((t=>t.kind===`teardown`&&t.key===e.key))(t))(ar(e,r,i))}))(Xt((e=>e.kind!==`teardown`&&(e.kind!==`subscription`||!!e.context.fetchSubscriptions)))(t)),e(Xt((e=>e.kind===`teardown`||e.kind===`subscription`&&!e.context.fetchSubscriptions))(t))]),ur=e=>({client:t,forward:n,dispatchDebug:r})=>e.reduceRight(((e,n)=>n({client:t,forward(t){return an(e(an(t)))},dispatchDebug(e){}})),n),dr=({onOperation:e,onResult:t,onError:n})=>({forward:r})=>i=>Qt((e=>{n&&e.error&&n(e.error,e.operation);var r=t&&t(e)||e;return`then`in r?vn(r):mn(r)}))(r(Qt((t=>{var n=e&&e(t)||t;return`then`in n?vn(n):mn(n)}))(i))),fr=({dispatchDebug:e})=>e=>Xt((e=>!1))(e),pr=function e(t){var n=0,r=new Map,i=new Map,a=new Set,o=[],s={url:t.url,fetchSubscriptions:t.fetchSubscriptions,fetchOptions:t.fetchOptions,fetch:t.fetch,preferGetMethod:t.preferGetMethod,requestPolicy:t.requestPolicy||`cache-first`},c=gn();function l(e){(e.kind===`mutation`||e.kind===`teardown`||!a.has(e.key))&&(e.kind===`teardown`?a.delete(e.key):e.kind!==`mutation`&&a.add(e.key),c.next(e))}var u=!1;function d(e){if(e&&l(e),!u){for(u=!0;u&&(e=o.shift());)l(e);u=!1}}var f=e=>{var t=cn(Xt((t=>t.kind===`teardown`&&t.key===e.key))(c.source))(Xt((t=>t.operation.kind===e.kind&&t.operation.key===e.key&&(!t.operation.context._instance||t.operation.context._instance===e.context._instance)))(g));return t=e.kind===`query`?on((t=>{var n=mn(t);return t.stale||t.hasNext?n:en([n,Zt((()=>(t.stale=!0,t)))(sn(1)(Xt((t=>t.key===e.key))(c.source)))])}))(t):ln((e=>!!e.hasNext),!0)(t),t=e.kind===`mutation`?rn((()=>{l(e)}))(t):tn((()=>{a.delete(e.key),r.delete(e.key),i.delete(e.key),u=!1;for(var t=o.length-1;t>=0;t--)o[t].key===e.key&&o.splice(t,1);l(sr(`teardown`,e,e.context))}))(nn((t=>{if(t.stale){if(!t.hasNext)a.delete(e.key);else for(var n=0;n<o.length;n++){var i=o[n];if(i.key===t.operation.key){a.delete(i.key);break}}}else t.hasNext||a.delete(e.key);r.set(e.key,t)}))(t)),an(t)},p=this instanceof e?this:Object.create(e.prototype),m=Object.assign(p,{suspense:!!t.suspense,operations$:c.source,reexecuteOperation(e){if(e.kind===`teardown`)d(e);else if(e.kind===`mutation`)o.push(e),Promise.resolve().then(d);else if(i.has(e.key)){for(var t=!1,n=0;n<o.length;n++)o[n].key===e.key&&(o[n]=e,t=!0);t||a.has(e.key)&&e.context.requestPolicy!==`network-only`?(a.delete(e.key),Promise.resolve().then(d)):(o.push(e),Promise.resolve().then(d))}},createRequestOperation(e,t,r){return r||={},sr(e,t,{_instance:e===`mutation`?n=n+1|0:void 0,...s,...r,requestPolicy:r.requestPolicy||s.requestPolicy,suspense:r.suspense||!1!==r.suspense&&m.suspense})},executeRequestOperation(e){return e.kind===`mutation`?or(f(e)):or(un((()=>{var t=i.get(e.key);t||i.set(e.key,t=f(e)),t=rn((()=>{d(e)}))(t);var n=r.get(e.key);return e.kind===`query`&&n&&(n.stale||n.hasNext)?on(mn)(en([t,Xt((t=>t===r.get(e.key)))(mn(n))])):t})))},executeQuery(e,t){var n=m.createRequestOperation(`query`,e,t);return m.executeRequestOperation(n)},executeSubscription(e,t){var n=m.createRequestOperation(`subscription`,e,t);return m.executeRequestOperation(n)},executeMutation(e,t){var n=m.createRequestOperation(`mutation`,e,t);return m.executeRequestOperation(n)},readQuery(e,t,n){var r=null;return yn((e=>{r=e}))(m.query(e,t,n)).unsubscribe(),r},query:(e,t,n)=>m.executeQuery(Un(e,t),n),subscription:(e,t,n)=>m.executeSubscription(Un(e,t),n),mutation:(e,t,n)=>m.executeMutation(Un(e,t),n)}),h=cr,g=an(ur(t.exchanges)({client:m,dispatchDebug:h,forward:fr({dispatchDebug:h})})(c.source));return bn(g),m};h();var mr=fe({}),hr=mr.Provider;mr.Consumer,mr.displayName=`UrqlContext`;var gr=()=>L(mr),_r={fetching:!1,stale:!1,hasNext:!1,error:void 0,data:void 0,extensions:void 0,operation:void 0},vr=(e,t)=>e===t||!(!e||!t||e.key!==t.key),yr=(e,t)=>{var n={...e,...t,data:t.data!==void 0||t.error?t.data:e.data,fetching:!!t.fetching,stale:!!t.stale};return((e,t)=>{for(var n in e)if(!(n in t))return!0;for(var r in t)if(r===`operation`?!vr(e[r],t[r]):e[r]!==t[r])return!0;return!1})(e,n)?n:e},br=(e,t)=>{for(var n=0,r=t.length;n<r;n++)if(e[n]!==t[n])return!0;return!1};function xr(e,t){e(t)}function Sr(e){var t=R(!0),n=gr(),[r,i]=B(_r),a=z(((r,a)=>(xr(i,{..._r,fetching:!0}),xn(sn(1)(Xt((e=>!e.hasNext))(nn((e=>{t.current&&xr(i,{fetching:!1,stale:e.stale,data:e.data,error:e.error,extensions:e.extensions,operation:e.operation,hasNext:e.hasNext})}))(n.executeMutation(Un(e,r),a||{}))))))),[n,e,i]);return O((()=>(t.current=!0,()=>{t.current=!1})),[]),[r,a]}function Cr(e,t){var n=R(void 0);return V((()=>{var r=Un(e,t);return n.current!==void 0&&n.current.key===r.key?n.current:(n.current=r,r)}),[e,t])}function wr(e,t){var n=gr(),r=Cr(e.query,e.variables),i=R(t);i.current=t;var a=V((()=>e.pause?null:n.executeSubscription(r,e.context)),[n,r,e.pause,e.context]),o=[n,r,e.context,e.pause],[s,c]=B((()=>[a,{..._r,fetching:!!a},o])),l=s[1];a!==s[0]&&br(s[2],o)&&c([a,l=yr(s[1],{fetching:!!a}),o]),O((()=>{var e=e=>{xr(c,(t=>{var n=yr(t[1],e);return t[1]===n?t:(i.current&&n.data!=null&&t[1].data!==n.data&&(n.data=i.current(t[1].data,n.data)),[t[0],n,t[2]])}))};if(s[0])return yn(e)(tn((()=>{e({fetching:!!a})}))(s[0])).unsubscribe;e({fetching:!1})}),[s[0]]);var u=z((t=>{var i=n.executeSubscription(r,{...e.context,...t});xr(c,(e=>[i,e[1],o]))}),[n,r,e.context,e.pause]);return[l,u]}j();var Tr=()=>`https://fkn.app/connect-button`,Er=e=>Math.max(1,e),Dr={POINT_100:{step:1,native:e=>Math.round(e),raw:e=>e},POINT_10_DECIMAL:{step:1,native:e=>Math.round(e)/10,raw:e=>Math.round(e*10)},POINT_10:{step:10,native:e=>Er(Math.floor(e/10)),raw:e=>e*10},POINT_5:{step:20,native:e=>Er(Math.round(e/20)),raw:e=>e*20},POINT_3:{step:33,native:e=>e<36?1:e<61?2:3,raw:e=>[30,50,85][e-1]??85}},Or=e=>Dr[e??``]??Dr.POINT_100,kr=e=>e!=null&&e>0,Ar=(e,t)=>Or(t).native(e),jr=(e,t)=>{let{native:n,raw:r}=Or(t);return r(n(e))},Mr=(e,t)=>Or(t).step>Or(e).step?t:e,Nr=`stub-source@1`,Pr=`stub-enabled-plugins`,Fr=()=>{try{return globalThis.localStorage}catch{return}},Ir=(e=Fr())=>{try{let t=JSON.parse(e?.getItem(`stub-enabled-plugins`)??`[]`);return Array.isArray(t)?t.filter(e=>typeof e==`string`):[]}catch{return[]}},Lr=(e,t=Fr())=>{try{t?.setItem(Pr,JSON.stringify(e))}catch{}},Rr=3e3,zr=new Map,Br=new Set,Vr=()=>Br.forEach(e=>{try{e()}catch{}}),Hr=e=>(Br.add(e),()=>{Br.delete(e)}),Ur=()=>Ir().map(e=>zr.get(e)??{uri:e,state:`connecting`}),Wr=()=>Ir(),Gr=(e,t)=>{zr.set(e,{uri:e,...t}),Vr()},Kr=45e3,qr=(e,t)=>Promise.race([e,new Promise((e,n)=>setTimeout(()=>n(Error(t)),Kr))]),Jr=new Set,Yr=new Map,Xr=3e4,Zr=(e,t)=>{if(!Ir().includes(e)||Jr.has(e)||Yr.has(e))return;zr.get(e)?.state!==`error`&&Gr(e,{state:`connecting`});let n=Math.min(Rr*t,Xr),r=setTimeout(()=>{Yr.delete(e),Qr(e,t+1).catch(()=>{})},n);Yr.set(e,r)},Qr=async(e,t=1)=>{if(!Jr.has(e)){Jr.add(e),Gr(e,{state:`connecting`});try{let{port:t,closed:n}=await qr(Oe.connect(e,{protocol:Nr,raw:!0}),`connecting to '${e}' timed out`);n.then(()=>{Jr.delete(e),it(e),Zr(e,1)});let r=await qr(Promise.race([ot(t,e),n.then(()=>({error:`the package closed before the source registered`}))]),`'${e}' connected but never registered its source`);if(`error`in r)throw Error(r.error);Gr(e,{state:`connected`,sources:r.ok.sources,rejected:r.ok.rejected})}catch(n){Jr.delete(e);let r=n instanceof Error?n.message:String(n);throw console.warn(`Plugin '${e}' failed to connect:`,n),Gr(e,{state:`error`,error:r}),Zr(e,t+1),n}}},$r=e=>{let t=Yr.get(e);t!==void 0&&(clearTimeout(t),Yr.delete(e))},ei=async(e,t)=>{let n=await Oe.install(e,t);return n?(Lr([...new Set([...Ir(),n.uri])]),n.uri):null},ti=async e=>{let t=await ei(e);return t&&Qr(t).catch(()=>{}),t},ni=async(e,t)=>{let n=await ei(e,t);return n&&await Qr(n),n},ri=async e=>{Lr(Ir().filter(t=>t!==e)),$r(e),Jr.delete(e),zr.delete(e),it(e),Vr(),await Oe.uninstall(e).catch(()=>{})},ii=async()=>{let e=await Oe.pick({type:`plugin`,id:`stub`},{multiple:!0,title:`Add stub sources`});for(let t of e)await ni(t.uri).catch(()=>{})};for(let e of Ir())Qr(e).catch(()=>{});function ai(e){var t=e.forward;return function(e){return Sn(e,t)}}var oi=function(){return typeof navigator>`u`||navigator==null||navigator.product,ai}(),si=(e,t)=>{for(var n=0|(t||5381),r=0,i=0|e.length;r<i;r++)n=(n<<5)+n+e.charCodeAt(r);return n},ci=new Set,li=new WeakMap,ui=(e,t)=>{if(e===null||ci.has(e))return`null`;if(typeof e!=`object`)return JSON.stringify(e)||``;if(e.toJSON)return ui(e.toJSON(),t);if(Array.isArray(e)){for(var n=`[`,r=0,i=e.length;r<i;r++)n.length>1&&(n+=`,`),n+=ui(e[r],t)||`null`;return n+=`]`}if(!t&&(pi!==fi&&e instanceof pi||mi!==fi&&e instanceof mi))return`null`;var a=Object.keys(e).sort();if(!a.length&&e.constructor&&Object.getPrototypeOf(e).constructor!==Object.prototype.constructor){var o=li.get(e)||Math.random().toString(36).slice(2);return li.set(e,o),ui({__key:o},t)}ci.add(e);for(var s=`{`,c=0,l=a.length;c<l;c++){var u=ui(e[a[c]],t);u&&(s.length>1&&(s+=`,`),s+=ui(a[c],t)+`:`+u)}return ci.delete(e),s+=`}`},di=(e,t)=>(ci.clear(),ui(e,t||!1)),fi=class{},pi=typeof File<`u`?File:fi,mi=typeof Blob<`u`?Blob:fi,hi=/("{3}[\s\S]*"{3}|"(?:\\.|[^"])*")/g,gi=/(?:#[^\n\r]+)?(?:[\r\n]+|$)/g,_i=(e,t)=>t%2==0?e.replace(gi,`
20
+ `):e,vi=e=>e.split(hi).map(_i).join(``).trim(),yi=new Map,bi=new Map,xi=e=>{var t;return typeof e==`string`?t=vi(e):e.loc&&bi.get(e.__key)===e?t=e.loc.source.body:(t=yi.get(e)||vi(Ht(e)),yi.set(e,t)),typeof e!=`string`&&!e.loc&&(e.loc={start:0,end:t.length,source:{body:t,name:`gql`,locationOffset:{line:1,column:1}}}),t},Si=e=>{var t;if(e.documentId)t=si(e.documentId);else if(t=si(xi(e)),e.definitions){var n=Ti(e);n&&(t=si(`\n# ${n}`,t))}return t},Ci=e=>{var t,n;return typeof e==`string`?(t=Si(e),n=bi.get(t)||Ft(e,{noLocation:!0})):(t=e.__key||Si(e),n=bi.get(t)||e),n.loc||xi(n),n.__key=t,bi.set(t,n),n},wi=(e,t,n)=>{var r=t||{},i=Ci(e),a=di(r,!0),o=i.__key;return a!==`{}`&&(o=si(a,o)),{key:o,query:i,variables:r,extensions:n}},Ti=e=>{for(var t=0,n=e.definitions.length;t<n;t++){var r=e.definitions[t];if(r.kind===gt.OPERATION_DEFINITION)return r.name?r.name.value:void 0}},Ei=e=>{if(`definitions`in e){for(var t=[],n=0,r=e.definitions.length;n<r;n++){var i=Ei(e.definitions[n]);t.push(i)}return{...e,definitions:t}}if(`directives`in e&&e.directives&&e.directives.length){for(var a=[],o={},s=0,c=e.directives.length;s<c;s++){var l=e.directives[s],u=l.name.value;u[0]===`_`?u=u.slice(1):a.push(l),o[u]=l}e={...e,directives:a,_directives:o}}if(`selectionSet`in e){var d=[],f=e.kind===gt.OPERATION_DEFINITION;if(e.selectionSet){for(var p=0,m=e.selectionSet.selections.length;p<m;p++){var h=e.selectionSet.selections[p];f||=h.kind===gt.FIELD&&h.name.value===`__typename`&&!h.alias;var g=Ei(h);d.push(g)}return f||d.push({kind:gt.FIELD,name:{kind:gt.NAME,value:`__typename`},_generated:!0}),{...e,selectionSet:{...e.selectionSet,selections:d}}}}return e},Di=new Map,Oi=e=>{var t=Ci(e),n=Di.get(t.__key);return n||(Di.set(t.__key,n=Ei(t)),Object.defineProperty(n,"__key",{value:t.__key,enumerable:!1})),n};function ki(e,t,n){return{...t,kind:e,context:t.context?{...t.context,...n}:n||t.context}}var Ai=`
21
+ https://bit.ly/2XbVrpR#`;function ji(e,t,n){if(!e){var r=t||`Minfied Error #`+n+`
22
+ `,i=Error(r+Ai+n);throw i.name=`Graphcache Error`,i}}var Mi={},Ni=e=>e._directives||Mi,Pi=e=>e.name.value,Fi=e=>e.typeCondition.name.value,Ii=e=>e.alias?e.alias.value:e.name.value,Li=[],Ri=e=>e.selectionSet?e.selectionSet.selections:Li,zi=e=>e.typeCondition?e.typeCondition.name.value:null,Bi=(e,t)=>{var n=null;if(e.arguments)for(var r=0,i=e.arguments.length;r<i;r++){var a=e.arguments[r],o=Ut(a.value,t);o!=null&&(n||={},n[Pi(a)]=o)}return n},Vi=(e,t)=>{if(t&&e.variableDefinitions){for(var n={},r=0,i=e.variableDefinitions.length;r<i;r++){var a=Pi(e.variableDefinitions[r].variable);n[a]=t[a]}return n}},Hi=(e,t)=>{var n={};if(!t)return n;if(e.variableDefinitions)for(var r=0,i=e.variableDefinitions.length;r<i;r++){var a=e.variableDefinitions[r],o=Pi(a.variable);n[o]=t[o]===void 0&&a.defaultValue?Ut(a.defaultValue,t):t[o]}for(var s in t)s in n||(n[s]=t[s]);return n};function Ui(e){for(var t=0;t<e.definitions.length;t++)if(e.definitions[t].kind===gt.OPERATION_DEFINITION)return e.definitions[t];ji(!1,``,1)}var Wi=e=>{for(var t={},n=0;n<e.definitions.length;n++){var r=e.definitions[n];r.kind===gt.FRAGMENT_DEFINITION&&(t[Pi(r)]=r)}return t},Gi=(e,t)=>{var n=Ni(e);if(n.include||n.skip)for(var r in n){var i=n[r];if(i&&(r===`include`||r===`skip`)&&i.arguments&&i.arguments[0]&&Pi(i.arguments[0])===`if`){var a=Ut(i.arguments[0].value,t);return r===`include`?!!a:!a}}return!0},Ki=(e,t)=>{var{defer:n}=Ni(e);if(n){for(var r of n.arguments||[])if(Pi(r)===`if`)return!!Ut(r.value,t);return!0}return!1},qi=e=>{var{optional:t,required:n}=Ni(e);if(n)return!1;if(t)return!0},Ji=`__`,Yi=(e,t,n,r)=>{var i=Qi(e,t,n,r);return!!i&&i.type.kind!==`NON_NULL`},Xi=(e,t,n,r)=>{var i=Qi(e,t,n,r);if(!i)return!1;var a=i.type.kind===`NON_NULL`?i.type.ofType:i.type;return a.kind===`LIST`&&a.ofType.kind!==`NON_NULL`},Zi=(e,t,n)=>{if(!n)return!1;var r=zi(t);return!r||n===r?!0:e.types.has(r)&&e.types.get(r).kind===`OBJECT`?r===n:((function(e,t){ji(e.types.has(t)&&(e.types.get(t).kind===`INTERFACE`||e.types.get(t).kind===`UNION`),``,5)})(e,r),$i(e,n),e.isSubType(r,n))},Qi=(e,t,n,r)=>{if(n.indexOf(Ji)!==0&&t.indexOf(Ji)!==0)return $i(e,t),e.types.get(t).fields()[n]};function $i(e,t){ji(e.types.has(t)&&e.types.get(t).kind===`OBJECT`,``,3)}var ea=(e,t)=>t?`${e}(${di(t)})`:e,ta=(e,t)=>`${e}.${t}`,na=e=>{var t=e.indexOf(`(`);return t>-1?{fieldKey:e,fieldName:e.slice(0,t),arguments:JSON.parse(e.slice(t+1,-1))}:{fieldKey:e,fieldName:e,arguments:null}},ra=e=>{var t=e.indexOf(`.`);return{entityKey:e.slice(0,t).replace(/%2e/g,`.`),fieldKey:e.slice(t+1)}},ia=null,aa=null,q=null,oa=null,sa=null,ca=null,la=!1,ua=!1;function da(e,t){var n;if(e){if(ia.has(e))return e;n=aa.get(e)}return n??=t?[]:{},e&&aa.set(e,n),ia.add(n),n}var fa=e=>!!e&&ia.has(e),pa=(e,t,n,r,i)=>{ia=new WeakSet,aa=new WeakMap,sa=e,q=t,ca=new Set,ua=!!r,la=!!i,n?sa===`read`?oa=n:r||t.hydrating||t.optimisticOrder.length>1?(!r&&!t.commutativeKeys.has(n)?Ma(t,n):r&&(t.optimisticOrder.indexOf(n)!==-1&&!t.commutativeKeys.has(n)&&t.optimisticOrder.splice(t.optimisticOrder.indexOf(n),1),t.commutativeKeys.delete(n)),oa=n,Na(t,n)):(oa=null,Fa(t,n)):oa=null},ma=()=>{var e=q,t=oa;if(ua=!1,oa=null,!e.hydrating&&t&&e.optimisticOrder.indexOf(t)>-1)for(var n=e.optimisticOrder.length;--n>=0&&e.dirtyKeys.has(e.optimisticOrder[n])&&e.commutativeKeys.has(e.optimisticOrder[n]);)Ia(e.optimisticOrder[n]);ia=null,aa=null,sa=null,q=null,ca=null,!e.defer&&(e.storage||!e.optimisticOrder.length)&&(e.defer=!0,setTimeout((()=>{pa(`read`,e,null),Ca(),Ra(),ma(),e.defer=!1})))},ha=(e,t,n)=>{t&&!n&&e.deferredKeys.delete(t),pa(`write`,e,t,n),ma()},ga=new Set,_a=(e,t,n,r)=>{var i=oa?e.optimistic.get(oa):e.base,a=i.get(t);a===void 0&&i.set(t,a=Object.create(null)),r===void 0&&!oa?delete a[n]:a[n]=r},va=(e,t,n)=>{for(var r,i=!ua&&sa===`read`&&oa&&q.commutativeKeys.has(oa),a=0,o=q.optimisticOrder.length;a<o;a++){var s=q.optimisticOrder[a],c=e.optimistic.get(s);if(i&&=s!==oa,c&&(!i||!q.commutativeKeys.has(s))&&(!ua||sa===`write`||q.commutativeKeys.has(s))&&(r=c.get(t))!==void 0&&n in r)return r[n]}return(r=e.base.get(t))===void 0?void 0:r[n]};function ya(e){return q.refCount.get(e)||0}var ba=(e,t)=>{if(Array.isArray(e))for(var n=0,r=e.length;n<r;n++)ba(e[n],t);else typeof e==`string`&&((e,t)=>{var n=ya(e),r=n+t>0?n+t:0;q.refCount.set(e,r),r?!n&&r&&q.gc.delete(e):q.gc.add(e)})(e,t)},xa=(e,t,n)=>{if(n!==void 0)for(var r in n)t.has(r)||(e.push(na(r)),t.add(r))},Sa=(e,t,n,r)=>{xa(e,t,r.base.get(n));for(var i=0,a=q.optimisticOrder.length;i<a;i++){var o=r.optimistic.get(q.optimisticOrder[i]);o!==void 0&&xa(e,t,o.get(n))}},Ca=()=>{if(!q.optimisticOrder.length){for(var e of q.gc.keys())if(q.gc.delete(e),!(ya(e)>0)){var t=q.records.base.get(e);q.refCount.delete(e),q.records.base.delete(e);var n=t&&t.__typename;if(n){var r=q.types.get(n);r&&r.delete(e)}var i=q.links.base.get(e);if(i)for(var a in q.links.base.delete(e),i)ba(i[a],-1)}}},wa=(e,t)=>{e===q.queryRootKey?t!==void 0&&t!==`__typename`&&ca.add(ta(e,t)):ca.add(e)},Ta=(e,t)=>{!ua&&q.storage&&q.persist.add(((e,t)=>`${e.replace(/\./g,`%2e`)}.${t}`)(e,t))},Ea=(e,t)=>(sa===`read`&&wa(e,t),va(q.records,e,t)),Da=(e,t)=>(sa===`read`&&wa(e,t),va(q.links,e,t)),Oa=(e,t)=>{var n=q.abstractToConcreteMap.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.abstractToConcreteMap.set(e,r)}},ka=(e,t,n)=>{za(va(q.records,e,t),n)||(wa(e,t),Ta(e,t)),_a(q.records,e,t,n)},Aa=(e,t)=>Ea(e,t)!==void 0||Da(e,t)!==void 0,ja=(e,t,n)=>{var r=oa?q.links.optimistic.get(oa):q.links.base;if(!oa){var i=r&&r.get(e);ba(i&&i[t],-1),ba(n,1)}za(va(q.links,e,t),n)||(wa(e,t),Ta(e,t)),_a(q.links,e,t,n)},Ma=(e,t,n)=>{var r=e.optimisticOrder.indexOf(t);if(r>-1&&e.optimisticOrder.splice(r,1),n)for(e.deferredKeys.add(t),r=r>-1?r:0;r<e.optimisticOrder.length&&!e.deferredKeys.has(e.optimisticOrder[r])&&(!e.dirtyKeys.has(e.optimisticOrder[r])||!e.commutativeKeys.has(e.optimisticOrder[r]));r++);else e.deferredKeys.delete(t),r>-1&&!e.commutativeKeys.has(t)&&Pa(e,t),r=0;e.optimisticOrder.splice(r,0,t),e.commutativeKeys.add(t)},Na=(e,t)=>{e.optimisticOrder.indexOf(t)===-1&&e.optimisticOrder.unshift(t),e.dirtyKeys.has(t)||(e.dirtyKeys.add(t),e.links.optimistic.set(t,new Map),e.records.optimistic.set(t,new Map))},Pa=(e,t)=>{e.dirtyKeys.has(t)&&(e.dirtyKeys.delete(t),e.records.optimistic.delete(t),e.links.optimistic.delete(t),e.deferredKeys.delete(t))},Fa=(e,t)=>{var n=e.optimisticOrder.indexOf(t);n>-1&&(e.optimisticOrder.splice(n,1),e.commutativeKeys.delete(t)),Pa(e,t)},Ia=e=>{var t=ca;ca=new Set,sa=`write`;var n=q.links.optimistic.get(e);if(n)for(var r of n.entries()){var i=r[0],a=r[1];for(var o in a)ja(i,o,a[o])}var s=q.records.optimistic.get(e);if(s)for(var c of s.entries()){var l=c[0],u=c[1];for(var d in u)ka(l,d,u[d])}ca=t,Fa(q,e)},La=e=>{var{links:t,records:n}=q,r=[],i=new Set;return wa(e),Sa(r,i,e,t),Sa(r,i,e,n),r},Ra=()=>{if(q.storage){ua=!0,sa=`read`;var e={};for(var t of q.persist.keys()){var{entityKey:n,fieldKey:r}=ra(t),i=void 0;e[t]=(i=Da(n,r))===void 0?(i=Ea(n,r))===void 0?void 0:di(i):`:${di(i)}`}ua=!1,q.storage.writeData(e),q.persist.clear()}};function za(e,t){return typeof e!=typeof t||e!==t?!1:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&!e.some(((e,n)=>e!==t[n])):!0}var Ba=null,Va=!1,Ha=void 0,Ua=e=>e.__internal.path.length>0&&e.__internal.errorMap?e.__internal.errorMap[e.__internal.path.join(`.`)]:void 0,Wa=(e,t,n,r,i,a)=>{var o={store:e,variables:t,fragments:n,parent:{__typename:r},parentTypeName:r,parentKey:i,parentFieldKey:``,fieldName:``,error:void 0,partial:!1,hasNext:!1,optimistic:ua,__internal:{path:[],errorMap:void 0}};if(a&&a.graphQLErrors)for(var s=0;s<a.graphQLErrors.length;s++){var c=a.graphQLErrors[s];c.path&&c.path.length&&(o.__internal.errorMap||(o.__internal.errorMap=Object.create(null)),o.__internal.errorMap[c.path.join(`.`)]=c)}return o},Ga=(e,t,n,r,i,a)=>{Ba=e,e.parent=t,e.parentTypeName=n,e.parentKey=r,e.parentFieldKey=i,e.fieldName=a,e.error=Ua(e)},Ka=(e,t,n,r,i)=>{if(!t)return!1;var a=zi(e);return!a||t===a||!Ri(e).some((e=>e.kind===gt.FIELD&&!Aa(n,ea(Pi(e),Bi(e,r)))))},qa=class{constructor(e,t,n,r,i,a){this.typename=e,this.entityKey=t,this.ctx=a,this.stack=[{selectionSet:i,index:0,defer:n,optional:r}]}next(){for(;this.stack.length>0;){for(var e=this.stack[this.stack.length-1];e.index<e.selectionSet.length;){var t=e.selectionSet[e.index++];if(Gi(t,this.ctx.variables)){if(t.kind!==gt.FIELD){var n=t.kind===gt.INLINE_FRAGMENT?t:this.ctx.fragments[Pi(t)];if(n){var r=!n.typeCondition||(this.ctx.store.schema?Zi(this.ctx.store.schema,n,this.typename):this.ctx.store.possibleTypeMap?Ja(this.ctx.store.possibleTypeMap,n.typeCondition.name.value,this.typename):sa===`read`&&Ya(n.typeCondition.name.value,this.typename)||Ka(n,this.typename,this.entityKey,this.ctx.variables,this.ctx.store.logger));if(r||sa===`write`&&!this.ctx.store.schema){var i=qi(t);r&&n.typeCondition&&this.typename!==n.typeCondition.name.value&&Oa(n.typeCondition.name.value,this.typename),this.stack.push(e={selectionSet:Ri(n),index:0,defer:e.defer||Ki(t,this.ctx.variables),optional:i===void 0?e.optional:i})}}}else if(sa===`write`||!t._generated)return Va=e.defer,Ha=e.optional,t}}this.stack.pop()}}},Ja=(e,t,n)=>{if(!n)return!1;if(t===n)return!0;var r=e.get(t);return r&&r.has(n)},Ya=(e,t)=>{if(!t)return!1;if(e===t)return!0;if((e=>q.types.has(e))(e))return!1;var n=(e=>q.abstractToConcreteMap.get(e)||ga)(e);return n.size&&n.has(t)},Xa=e=>e??null,Za=(e,t)=>{if(!t)return t||null;if(Array.isArray(t)){for(var n=Array(t.length),r=0,i=n.length;r<i;r++)n[r]=Za(e,t[r]);return n}return e.keyOfEntity(t)},Qa=(e,t,n,r)=>{var i=Oi(t.query),a=Ui(i),o=e.rootFields[a.operation],s=Ri(a),c=Wa(e,Hi(a,t.variables),Wi(i),o,o,r),l=o===c.store.rootFields.query?no(c,o,s,n||da()):$a(c,o,s,n||da());return{dependencies:ca,partial:c.partial||!l,hasNext:c.hasNext,data:l||null}},$a=(e,t,n,r)=>{if(typeof(e.store.rootNames[t]?t:r.__typename)!=`string`)return r;for(var i=new qa(t,t,!1,void 0,n,e),a,o=la,s=da(r);a=i.next();){var c=Ii(a),l=r[c];e.__internal.path.push(c);var u=void 0;u=a.selectionSet&&l!==null?eo(e,Ri(a),Xa(l)):l,o||=u!==l,u!==void 0&&(s[c]=u),e.__internal.path.pop()}return o?s:r},eo=(e,t,n)=>{if(Array.isArray(n)){for(var r=Array(n.length),i=la,a=0,o=n.length;a<o;a++)e.__internal.path.push(a),r[a]=eo(e,t,n[a]),i||=r[a]!==n[a],e.__internal.path.pop();return i?r:n}if(n===null)return null;var s=e.store.keyOfEntity(n);return s===null?$a(e,n.__typename,t,n):no(e,s,t,n)||null};function to(e,t,n,r){var i=r.store.resolvers[t],a=i&&i[n],o;for(var s in e){var c=e[s];if(c&&s!==`include`&&s!==`skip`&&r.store.directives[s])return o=r.store.directives[s](Bi(c,r.variables)),o}return o||a}var no=(e,t,n,r,i)=>{var{store:a}=e,o=t===a.rootFields.query,s=i&&a.keyOfEntity(i)||t,c=o?t:Ea(s,`__typename`)||i&&i.__typename;if(typeof c==`string`&&!(i&&c!==i.__typename)){for(var l=new qa(c,s,!1,void 0,n,e),u=!1,d=!1,f=la,p,m=e.partial,h=da(r);(p=l.next())!==void 0;){var g=Pi(p),_=Bi(p,e.variables),v=Ii(p),y=Ni(p),b=to(y,c,g,e),x=ea(g,_),S=ta(s,x),C=Ea(s,x),w=i?i[g]:void 0;e.__internal.path.push(v);var T=void 0;if(g===`__typename`)T=c;else if(w!==void 0&&p.selectionSet===void 0)T=w;else if(sa===`read`&&b){var E=h;if(p.selectionSet===void 0&&C!==void 0&&(E={...h,[v]:C,[g]:C}),Ga(e,E,c,s,x,g),T=b(E,_||{},a,e),p.selectionSet&&(T=ro(e,c,g,S,Ri(p),h[v]===void 0?r[v]:h[v],T,fa(r))),a.schema&&T===null&&!Yi(a.schema,c,g,e.store.logger))return}else if(!p.selectionSet)T=C;else if(w!==void 0)T=ro(e,c,g,S,Ri(p),h[v]===void 0?r[v]:h[v],w,fa(r));else{var D=Da(s,x);D===void 0?typeof C==`object`&&C&&(T=C):T=io(e,D,c,g,Ri(p),h[v]===void 0?r[v]:h[v],fa(r))}if(!Va&&T===void 0&&(y.optional||Ha&&!y.required||Ua(e)||!y.required&&a.schema&&Yi(a.schema,c,g,e.store.logger))?(e.partial=!0,T=null):T===null&&(y.required||!1===Ha)?(e.store.logger,T=void 0):u||=g!==`__typename`,e.__internal.path.pop(),f||=T!==r[v],T!==void 0)h[v]=T;else if(Va)d=!0;else{e.store.logger,e.partial=m;return}}return e.partial=e.partial||m,e.hasNext=e.hasNext||d,o&&e.partial&&!u?void 0:f?h:r}},ro=(e,t,n,r,i,a,o,s)=>{if(Array.isArray(o)){for(var{store:c}=e,l=c.schema?Xi(c.schema,t,n,e.store.logger):!1,u=e.partial,d=da(a,!0),f=la||!Array.isArray(a)||o.length!==a.length,p=0,m=o.length;p<m;p++){e.__internal.path.push(p);var h=ro(e,t,n,ta(r,`${p}`),i,a?.[p],o[p],s);if(e.__internal.path.pop(),h===void 0&&!l){e.partial=u;return}e.partial=e.partial||h===void 0&&l,d[p]=h??null,f||=d[p]!==a[p]}return f?d:a}if(o==null)return o;if(s&&a===null)return null;if(ao(o)){var g=a||da(a);return typeof o==`string`?no(e,o,i,g):no(e,r,i,g,o)}},io=(e,t,n,r,i,a,o)=>{if(Array.isArray(t)){for(var{store:s}=e,c=s.schema?Xi(s.schema,n,r,e.store.logger):!1,l=da(a,!0),u=e.partial,d=la||!Array.isArray(a)||t.length!==a.length,f=0,p=t.length;f<p;f++){e.__internal.path.push(f);var m=io(e,t[f],n,r,i,a?.[f],o);if(e.__internal.path.pop(),m===void 0&&!c){e.partial=u;return}e.partial=e.partial||m===void 0&&c,l[f]=m||null,d||=l[f]!==a[f]}return d?l:a}return t===null||a===null&&o?null:no(e,t,i,a||da(a))},ao=e=>typeof e==`string`||typeof e==`object`&&typeof e.__typename==`string`,oo=(e,t,n)=>{for(var r=t?[{fieldKey:ea(t,n)}]:La(e),i=0,a=r.length;i<a;i++){var{fieldKey:o}=r[i];Da(e,o)===void 0?ka(e,o,void 0):ja(e,o,void 0)}},so=(e,t)=>{for(var n of(e=>q.types.get(e)||ga)(e))t.includes(n)||oo(n)},co=(e,t,n,r)=>{var i=Oi(t.query),a=Ui(i),o={data:n||da(),dependencies:ca},s=e.rootFields[a.operation];return lo(Wa(e,Hi(a,t.variables),Wi(i),s,s,r),s,Ri(a),o.data),o},lo=(e,t,n,r)=>{var i=e.store.rootNames[t]||`query`,a=!!e.store.rootNames[t],o=a?t:r.__typename;if(!o&&t&&e.optimistic&&(o=Ea(t,`__typename`)),o)!a&&t&&(ka(t,`__typename`,o),((e,t)=>{var n=q.types.get(e);if(n)n.add(t);else{var r=new Set;r.add(t),q.types.set(e,r)}})(o,t));else return;for(var s=e.store.updates[o],c=new qa(o,t||o,!1,void 0,n,e),l;l=c.next();){var u=Pi(l),d=Bi(l,e.variables),f=ea(u,d),p=Ii(l),m=r[e.optimistic?u:p];if(!(u===`__typename`||m===void 0&&(Va||e.optimistic&&i===`query`))){e.__internal.path.push(p);var h=void 0;if(e.optimistic&&i===`mutation`){if(!(h=e.store.optimisticMutations[u]))continue}else e.optimistic&&typeof m==`function`&&(h=m);if(h&&(Ga(e,r,o,t||o,f,u),m=Xa(h(d||{},e.store,e))),m!==void 0){if(l.selectionSet){if(t&&i===`query`){var g=ta(t,f),_=uo(e,Ri(l),Xa(m),g,e.optimistic?Da(t||o,f):void 0);ja(t||o,f,_)}else uo(e,Ri(l),Xa(m))}else t&&i===`query`&&ka(t||o,f,m!==null||!Ua(e)?m:void 0);var v=s&&s[u];if(v)Ga(e,r,o,t||o,f,u),r[u]=m,v(r,d||{},e.store,e);else if(o===e.store.rootFields.mutation&&!e.optimistic){if(m&&Array.isArray(m))for(var y=m.map((t=>e.store.keyOfEntity(t)||``)),b=0,x=m.length;b<x;b++){var S=y[b];if(S&&m[b].__typename){var C=Ea(S,`__typename`),w=ya(S);C&&!w&&so(m[b].__typename,y)}}else if(m&&typeof m==`object`){var T=e.store.keyOfEntity(m);if(T){var E=Ea(T,`__typename`),D=ya(T);(!E||!D)&&m.__typename&&so(m.__typename,[T])}}}e.__internal.path.pop()}}}},uo=(e,t,n,r,i)=>{if(Array.isArray(n)){for(var a=Array(n.length),o=0,s=n.length;o<s;o++){e.__internal.path.push(o);var c=r?ta(r,`${o}`):void 0,l=uo(e,t,n[o],c,i?.[o]);a[o]=l,e.__internal.path.pop()}return a}if(n===null)return Ua(e)?void 0:null;var u=e.store.keyOfEntity(n)||(typeof i==`string`?i:null);n.__typename;var d=u||r;return lo(e,d,t,n),d||null},fo=class{constructor(e){e||={},this.logger=e.logger,this.resolvers=e.resolvers||{},this.directives=e.directives||{},this.optimisticMutations=e.optimistic||{},this.keys=e.keys||{},this.globalIDs=Array.isArray(e.globalIDs)?new Set(e.globalIDs):!!e.globalIDs;var t=`Query`,n=`Mutation`,r=`Subscription`;if(e.schema){var i=(({__schema:e})=>{var t=new Map,n=e=>{var t;return()=>{if(!t){t={};for(var n=0;n<e.length;n++)t[e[n].name]=e[n]}return t}},r=e=>{switch(e.kind){case`OBJECT`:case`INTERFACE`:return{name:e.name,kind:e.kind,interfaces:n(e.interfaces||[]),fields:n(e.fields.map((e=>({name:e.name,type:e.type,args:n(e.args)}))))};case`UNION`:return{name:e.name,kind:e.kind,types:n(e.possibleTypes||[])}}},i={query:e.queryType?e.queryType.name:null,mutation:e.mutationType?e.mutationType.name:null,subscription:e.subscriptionType?e.subscriptionType.name:null,types:void 0,isSubType(e,n){var r=t.get(e),i=t.get(n);return!r||!i?!1:r.kind===`UNION`?!!r.types()[n]:r.kind!==`OBJECT`&&i.kind===`OBJECT`?!!i.interfaces()[e]:e===n}};if(e.types){i.types=t;for(var a=0;a<e.types.length;a++){var o=e.types[a];if(o&&o.name){var s=r(o);s&&t.set(o.name,s)}}}return i})(e.schema);t=i.query||t,n=i.mutation||n,r=i.subscription||r,i.types&&(this.schema=i)}if(!this.schema&&e.possibleTypes){this.possibleTypeMap=new Map;for(var a of Object.entries(e.possibleTypes)){var[o,s]=a;this.possibleTypeMap.set(o,new Set(s))}}this.updates=e.updates||{},this.rootFields={query:t,mutation:n,subscription:r},this.rootNames={[t]:`query`,[n]:`mutation`,[r]:`subscription`},this.data=(c=t,{hydrating:!1,defer:!1,gc:new Set,types:new Map,persist:new Set,queryRootKey:c,refCount:new Map,links:{optimistic:new Map,base:new Map},abstractToConcreteMap:new Map,records:{optimistic:new Map,base:new Map},deferredKeys:new Set,commutativeKeys:new Set,dirtyKeys:new Set,optimisticOrder:[],storage:null});var c;this.schema}keyOfField(e,t){return ea(e,t)}keyOfEntity(e){if(Ba&&e===Ba.parent)return Ba.parentKey;if(e==null||typeof e==`string`)return e||null;if(!e.__typename)return null;if(this.rootNames[e.__typename])return e.__typename;var t=null;this.keys[e.__typename]?t=this.keys[e.__typename](e)||null:e.id==null?e._id!=null&&(t=`${e._id}`):t=`${e.id}`;var n=e.__typename;return!0===this.globalIDs||this.globalIDs&&this.globalIDs.has(n)||!t?t:`${n}:${t}`}resolve(e,t,n){var r=this.keyOfEntity(e);if(r){var i=ea(t,n),a=Ea(r,i);if(a!==void 0)return a;var o=Da(r,i);return o!==void 0&&(o=Za(this,o)),o}}invalidate(e,t,n){var r=this.keyOfEntity(e);e&&typeof e==`string`&&!t&&!n&&!this.resolve(e,`__typename`)?so(e,[]):(ji(r,``,19),oo(r,t,n))}inspectFields(e){var t=this.keyOfEntity(e);return t?La(t):[]}updateQuery(e,t){var n=wi(e.query,e.variables),r=t(this.readQuery(n));r!==null&&co(this,n,r,void 0)}readQuery(e){var t=wi(e.query,e.variables);return Qa(this,t,void 0,void 0).data}readFragment(e,t,n,r){return((e,t,n,r,i)=>{var a=Wi(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Fi(o);typeof n!=`string`&&!n.__typename&&(n.__typename=s);var c=e.keyOfEntity(n);return c&&no(Wa(e,r||{},a,s,c,void 0),c,Ri(o),da())||null})(this,Oi(e),t,n,r)}writeFragment(e,t,n,r){((e,t,n,r,i)=>{var a=Wi(t),o;if(i){if(!(o=a[i]))return null}else if(!(o=a[Object.keys(a)[0]]))return null;var s=Fi(o),c={__typename:s,...n},l=e.keyOfEntity(c);l&&lo(Wa(e,r||{},a,s,l,void 0),l,Ri(o),c)})(this,Oi(e),t,n,r)}link(e,t,...n){var r=n.length===2?n[0]:null,i=n.length===2?n[1]:n[0],a=this.keyOfEntity(e);a&&ja(a,ea(t,r),Za(this,i))}},po=(e,t)=>ki(e.kind,e,{...e.context,meta:{...e.context.meta,...t}}),mo=(e,t)=>ki(e.kind,e,{...e.context,requestPolicy:t}),ho=(e=>({forward:t,client:n,dispatchDebug:r})=>{var i=new fo(e);e&&e.storage&&(i.data.hydrating=!0,e.storage.readData().then((t=>{((e,t,n)=>{for(var r in pa(`write`,e,null),n){var i=n[r];if(i!==void 0){var{entityKey:a,fieldKey:o}=ra(r);i[0]===`:`?Da(a,o)===void 0&&ja(a,o,JSON.parse(i.slice(1))):Ea(a,o)===void 0&&ka(a,o,JSON.parse(i))}}e.storage=t,e.hydrating=!1,ma()})(i.data,e.storage,t),e.storage.onCacheHydrated&&e.storage.onCacheHydrated()})));var a=new Map,o=[],s=new Map,c=new Map,l=new Set,u=new Set,d=new Map,f=new Set,p=new Set,m=e=>{for(var t of e.values())if(l.has(t))return!0;return!1},h=(e,t)=>{if(t)for(var n of t.values()){var r=d.get(n);if(r)for(var i of r.values())e.add(i)}},g=(e,t,r)=>{for(var i of t.values())if(i!==e.key){var a=s.get(i);if(a){e.kind===`query`&&p.add(i);var o=`cache-first`;u.has(i)&&(u.delete(i),o=`cache-and-network`),n.reexecuteOperation(mo(a,o))}}if(!r){var c=f;f=p,e.kind===`query`&&f.add(e.key),(p=c).clear()}},_=e=>{var t=!1;if(e.kind===`query`)Ma(i.data,e.key),s.set(e.key,e);else if(e.kind===`teardown`)return s.delete(e.key),c.delete(e.key),f.delete(e.key),ha(i.data,e.key),e;else if(e.kind===`mutation`&&e.context.requestPolicy!==`network-only`){s.set(e.key,e),pa(`write`,i.data,e.key,!0,!1);var{dependencies:n}=co(i,e,void 0,void 0);if(ma(),n.size){for(var r of n.values())l.add(r);a.set(e.key,n);var o=new Set;h(o,n),g(e,o,!0),t=!0}}return ki(e.kind,{key:e.key,query:Oi(e.query),variables:e.variables?Vi(Ui(e.query),e.variables):e.variables},{...e.context,optimistic:t})},v=(e,t)=>{for(var n of t.values()){var r=d.get(n);r||d.set(n,r=new Set),r.add(e.key)}},y=e=>{pa(`read`,i.data,void 0,!1,!1);var t=Qa(i,e,c.get(e.key),void 0);ma();var n=t.data?!t.partial&&!t.hasNext?`hit`:`partial`:`miss`;return c.set(e.key,t.data),s.set(e.key,e),v(e,t.dependencies),{outcome:n,operation:e,data:t.data,dependencies:t.dependencies,hasNext:t.hasNext}},b=(e,t)=>{var n=s.get(e.operation.key)||e.operation;n.kind===`mutation`&&(h(t,a.get(n.key)),a.delete(n.key)),(n.kind===`subscription`||e.hasNext)&&Ma(i.data,n.key,!0);var r,o=e.data;if(o){pa(`write`,i.data,n.key,!1,!1);var l=co(i,n,o,e.error).dependencies;ma(),h(t,l);var u=n.kind===`query`?c.get(n.key):null;pa(`read`,i.data,n.key,!1,u!==o);var d=Qa(i,n,u||o,e.error);ma(),o=d.data,n.kind===`query`&&(h(t,r=d.dependencies),c.set(n.key,o))}else ha(i.data,n.key);return r&&v(e.operation,r),{operation:n,data:o,error:e.error,extensions:e.extensions,hasNext:e.hasNext,stale:e.stale}};return e=>{var r=an(Zt(y)(Xt((e=>e.kind===`query`&&e.context.requestPolicy!==`network-only`))(e))),c=Xt((e=>e.kind!==`query`||e.context.requestPolicy===`network-only`))(e),d=Zt((e=>po(e.operation,{cacheOutcome:`miss`})))(Xt((e=>e.outcome===`miss`&&e.operation.context.requestPolicy!==`cache-only`&&!m(e.dependencies)&&!f.has(e.operation.key)))(r)),p=Zt((e=>{var{requestPolicy:t}=e.operation.context,r=t!==`cache-only`&&(e.hasNext||t===`cache-and-network`||t===`cache-first`&&e.outcome===`partial`&&!f.has(e.operation.key)),a=t!==`cache-only`&&(r||e.outcome===`partial`&&f.has(e.operation.key)&&((o=i.data).commutativeKeys.has(c=e.operation.key)||o.optimisticOrder.indexOf(c)>-1)),o,c,l={operation:po(e.operation,{cacheOutcome:e.outcome}),data:e.data,error:e.error,extensions:e.extensions,stale:a&&!e.hasNext,hasNext:r&&e.hasNext};return r&&(m(e.dependencies)?t===`cache-and-network`&&u.add(e.operation.key):n.reexecuteOperation(mo(s.get(e.operation.key)||e.operation,`network-only`))),l}))(Xt((e=>e.outcome!==`miss`||e.operation.context.requestPolicy===`cache-only`))(r)),h=t(Zt(_)(en([c,d])));return en([Zt((e=>{var t=new Set,n=b(e,t);return g(e.operation,t,!1),n}))(Xt((e=>!a.has(e.operation.key)))(h)),Qt((e=>{if(o.push(e)<a.size)return _n;for(var t=0;t<o.length;t++)Ma(i.data,o[t].operation.key);l.clear();for(var n=[],r=new Set,s;s=o.shift();)n.push(b(s,r));return g(e.operation,r,!1),pn(n)}))(Xt((e=>a.has(e.operation.key)))(h)),p])}})({schema:{__schema:JSON.parse(`{"queryType":{"name":"Query","kind":"OBJECT"},"mutationType":{"name":"Mutation","kind":"OBJECT"},"subscriptionType":{"name":"Subscription","kind":"OBJECT"},"types":[{"kind":"OBJECT","name":"Episode","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"absoluteEpisodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"absoluteNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"embedUrl","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"mediaUri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relativeNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"releaseDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"runtime","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonNumber","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"thumbnails","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeThumbnail","ofType":null}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"EpisodeTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeHandle","fields":[{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeThumbnail","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"EpisodeTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"FuzzyDate","fields":[{"name":"day","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"month","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"year","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"ListEntry","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"completedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"cover","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"mediaUri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"progress","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"rewatchCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startedAt","type":{"kind":"OBJECT","name":"FuzzyDate","ofType":null},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"updatedAt","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Media","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"anomalies","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaAnomaly","ofType":null}}},"args":[]},{"name":"averageScore","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"banners","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaBanner","ofType":null}}}},"args":[]},{"name":"categories","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"descriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"endDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"episodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Episode","ofType":null}}}},"args":[]},{"name":"franchise","type":{"kind":"OBJECT","name":"MediaFranchise","ofType":null},"args":[]},{"name":"genres","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"handles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaHandle","ofType":null}}}},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isAdult","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"kind","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextAiringEpisode","type":{"kind":"OBJECT","name":"MediaAiringEpisode","ofType":null},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"popularity","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"provenance","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFieldProvenance","ofType":null}}},"args":[]},{"name":"relations","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaRelationEdge","ofType":null}}}},"args":[]},{"name":"scope","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"season","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"seasonYear","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescriptions","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaShortDescription","ofType":null}}}},"args":[{"name":"input","type":{"kind":"SCALAR","name":"Any"}}]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"tags","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"trailers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTrailer","ofType":null}}}},"args":[]},{"name":"type","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAiringEpisode","fields":[{"name":"airingAt","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"episodeNumber","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaAnomaly","fields":[{"name":"detail","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaBanner","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaCover","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"height","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"url","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"width","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaDescription","fields":[{"name":"description","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFieldProvenance","fields":[{"name":"answerSeq","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"field","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"rule","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tier","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uris","type":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}},"args":[]},{"name":"witnesses","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchise","fields":[{"name":"edges","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseEdge","ofType":null}}}},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaFranchiseNode","ofType":null}}}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseEdge","fields":[{"name":"from","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"to","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaFranchiseNode","fields":[{"name":"covers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaCover","ofType":null}}}},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"startDate","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"status","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"titles","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaTitle","ofType":null}}}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaHandle","fields":[{"name":"by","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"provenance","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"via","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaRelationEdge","fields":[{"name":"format","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"node","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Media","ofType":null}},"args":[]},{"name":"relation","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaShortDescription","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"shortDescription","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTitle","fields":[{"name":"language","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"score","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"title","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"MediaTrailer","fields":[{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"language","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"thumbnail","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Mutation","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"addHeldStubEntries","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"deleteListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"saveListEntry","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"WriteOutcome","ofType":null}}}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Origin","fields":[{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"isApiOnly","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"OriginPage","fields":[{"name":"afterCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"beforeCurrentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"currentPageNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"firstPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"lastPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nextPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"nodes","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Origin","ofType":null}}}},"args":[]},{"name":"previousPageCursor","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"totalNodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"PlaybackSource","fields":[{"name":"Episode","type":{"kind":"OBJECT","name":"Episode","ofType":null},"args":[]},{"name":"data","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"origin","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"type","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"uri","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"url","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Query","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"StubTrackerStorage","fields":[{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"held","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"location","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"locked","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"waiting","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Subscription","fields":[{"name":"_empty","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"containingMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"media","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"mediaPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"MediaPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"origin","type":{"kind":"OBJECT","name":"Origin","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"originPage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"OriginPage","ofType":null}},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"similarMedia","type":{"kind":"OBJECT","name":"Media","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]},{"name":"stubTrackerStorage","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"StubTrackerStorage","ofType":null}},"args":[]},{"name":"tracking","type":{"kind":"OBJECT","name":"Tracking","ofType":null},"args":[{"name":"input","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracker","fields":[{"name":"account","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"canWrite","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"color","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"icon","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"name","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"scoreScale","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"signedIn","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"writeNotice","type":{"kind":"SCALAR","name":"Any"},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"TrackerAnswer","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"candidates","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"episodeCount","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"state","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"Tracker","ofType":null}},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"Tracking","fields":[{"name":"_id","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"answers","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"OBJECT","name":"TrackerAnswer","ofType":null}}}},"args":[]},{"name":"disagreements","type":{"kind":"NON_NULL","ofType":{"kind":"LIST","ofType":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}}}},"args":[]},{"name":"summary","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]}],"interfaces":[]},{"kind":"OBJECT","name":"WriteOutcome","fields":[{"name":"entry","type":{"kind":"OBJECT","name":"ListEntry","ofType":null},"args":[]},{"name":"error","type":{"kind":"SCALAR","name":"Any"},"args":[]},{"name":"outcome","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]},{"name":"tracker","type":{"kind":"NON_NULL","ofType":{"kind":"SCALAR","name":"Any"}},"args":[]}],"interfaces":[]},{"kind":"SCALAR","name":"Any"}],"directives":[]}`)},keys:{Media:e=>e._id,MediaHandle:()=>null,MediaRelationEdge:()=>null,MediaFranchise:()=>null,MediaFranchiseNode:()=>null,MediaFranchiseEdge:()=>null,EpisodeHandle:()=>null,MediaTitle:()=>null,MediaDescription:()=>null,MediaShortDescription:()=>null,MediaCover:()=>null,MediaBanner:()=>null,MediaAiringEpisode:()=>null,MediaFieldProvenance:()=>null,MediaAnomaly:()=>null,MediaTrailer:e=>e.uri,Episode:e=>e._id,EpisodeTitle:()=>null,EpisodeDescription:()=>null,EpisodeShortDescription:()=>null,EpisodeThumbnail:()=>null,PlaybackSource:e=>e.uri,Tracking:e=>String(e._id),TrackerAnswer:e=>String(e._id),Tracker:e=>e.id,ListEntry:e=>String(e._id),FuzzyDate:()=>null,WriteOutcome:()=>null,StubTrackerStorage:()=>null},resolvers:{}}),go=new pr({url:`http://d/graphql`,exchanges:[dr({onError(e,t){for(let n of e.graphQLErrors)console.error(Error(n.message,{cause:`GQL Error originated from ${t.query.definitions.find(e=>e.kind===`OperationDefinition`)?.name?.value}`}))}}),oi,ho,lr],fetchSubscriptions:!0,fetch:async(e,t)=>Je(e,t)});function _o(e,t){if(e instanceof RegExp)return{keys:!1,pattern:e};var n,r,i,a,o=[],s=``,c=e.split(`/`);for(c[0]||c.shift();i=c.shift();)n=i[0],n===`*`?(o.push(n),s+=i[1]===`?`?`(?:/(.*))?`:`/(.*)`):n===`:`?(r=i.indexOf(`?`,1),a=i.indexOf(`.`,1),o.push(i.substring(1,~r?r:~a?a:i.length)),s+=~r&&!~a?`(?:/([^/]+?))?`:`/([^/]+?)`,~a&&(s+=(~r?`?`:``)+`\\`+i.substring(a))):s+=`/`+i;return{keys:o,pattern:RegExp(`^`+s+(t?`(?=$|/)`:`/?$`),`i`)}}var vo=ye((e=>{var t=(h(),xe(S));function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),yo=ye(((e,t)=>{t.exports=vo()}));h();var bo=yo(),xo=N,So=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0?_e:O,Co=xo||So,wo=e=>{let t=R([e,(...e)=>t[0](...e)]).current;return Co(()=>{t[0]=e}),t[1]},To=`popstate`,Eo=`pushState`,Do=`replaceState`,Oo=[To,Eo,Do,`hashchange`],ko=e=>{for(let t of Oo)addEventListener(t,e);return()=>{for(let t of Oo)removeEventListener(t,e)}},Ao=(e,t)=>(0,bo.useSyncExternalStore)(ko,e,t),jo=()=>location.search,Mo=({ssrSearch:e=``}={})=>Ao(jo,()=>e),No=()=>location.pathname,Po=({ssrPath:e}={})=>Ao(No,e?()=>e:No),Fo=(e,{replace:t=!1,state:n=null}={})=>history[t?Do:Eo](n,``,e),Io=(e={})=>[Po(e),Fo],Lo=Symbol.for(`wouter_v3`);if(typeof history<`u`&&window[Lo]===void 0){for(let e of[Eo,Do]){let t=history[e];history[e]=function(){let n=t.apply(this,arguments),r=new Event(e);return r.arguments=arguments,dispatchEvent(r),n}}Object.defineProperty(window,Lo,{value:!0})}var Ro=(e,t)=>t.toLowerCase().indexOf(e.toLowerCase())?`~`+t:t.slice(e.length)||`/`,zo=(e=``)=>e===`/`?``:e,Bo=(e,t)=>e[0]===`~`?e.slice(1):zo(t)+e,Vo=(e=``,t)=>Ro(Uo(zo(e)),Uo(t)),Ho=e=>e[0]===`?`?e.slice(1):e,Uo=e=>{try{return decodeURI(e)}catch{return e}},Wo=e=>Uo(Ho(e)),Go={hook:Io,searchHook:Mo,parser:_o,base:``,ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:e=>e},Ko=fe(Go),qo=()=>L(Ko),Jo={},Yo=fe(Jo),Xo=()=>L(Yo),Zo=e=>{let[t,n]=e.hook(e);return[Vo(e.base,t),wo((t,r)=>n(Bo(t,e.base),r))]},Qo=()=>Zo(qo()),$o=()=>{let e=qo();return Wo(e.searchHook(e))},es=(e,t,n,r)=>{let{pattern:i,keys:a}=t instanceof RegExp?{keys:!1,pattern:t}:e(t||`*`,r),o=i.exec(n)||[],[s,...c]=o;return s===void 0?[!1,null]:[!0,(()=>{let e=a===!1?o.groups:Object.fromEntries(a.map((e,t)=>[e,c[t]])),t={...c};return e&&Object.assign(t,e),t})(),...r?[s]:[]]},ts=e=>es(qo().parser,e,Qo()[0]),ns=({children:e,...t})=>{let n=qo(),r=t.hook?Go:n,i=r,[a,o]=t.ssrPath?.split(`?`)??[];o&&(t.ssrSearch=o,t.ssrPath=a),t.hrefs=t.hrefs??t.hook?.hrefs;let s=R({}),c=s.current,l=c;for(let e in r){let n=e===`base`?r[e]+(t[e]||``):t[e]||r[e];c===l&&n!==l[e]&&(s.current=l={...l}),l[e]=n,(n!==r[e]||n!==i[e])&&(i=l)}return ce(Ko.Provider,{value:i,children:e})},rs=({children:e,component:t},n)=>t?ce(t,{params:n}):typeof e==`function`?e(n):e,is=e=>{let t=R(Jo),n=t.current;return t.current=Object.keys(e).length!==Object.keys(n).length||Object.entries(e).some(([e,t])=>t!==n[e])?e:n},as=({path:e,nest:t,match:n,...r})=>{let i=qo(),[a]=Zo(i),[o,s,c]=n??es(i.parser,e,a,t),l=is({...Xo(),...s});if(!o)return null;let u=c?ce(ns,{base:c},rs(r,l)):rs(r,l);return ce(Yo.Provider,{value:l,children:u})},os=l((t,n)=>{let r=qo(),[i,a]=Zo(r),{to:o=``,href:s=o,onClick:c,asChild:l,children:u,className:d,replace:f,state:p,...m}=t,h=wo(e=>{e.ctrlKey||e.metaKey||e.altKey||e.shiftKey||e.button!==0||(c?.(e),e.defaultPrevented||(e.preventDefault(),a(s,t)))}),g=r.hrefs(s[0]===`~`?s.slice(1):r.base+s,r);return l&&e(u)?w(u,{onClick:h,href:g}):ce(`a`,{...m,onClick:h,href:g,className:d?.call?d(i===s):d,children:u,ref:n})}),ss=e=>Array.isArray(e)?e.flatMap(e=>ss(e&&e.type===ne?e.props.children:e)):[e],cs=({children:t,location:n})=>{let r=qo(),[i]=Zo(r);for(let a of ss(t)){let t=0;if(e(a)&&(t=es(r.parser,a.props.path,n||i,a.props.nest))[0])return w(a,{match:t})}return null},ls=e=>{let{to:t,href:n=t}=e,r=qo(),[,i]=Zo(r),a=wo(()=>i(t||n,e)),{ssrContext:o}=r;return So(()=>{a()},[]),o&&(o.redirectTo=t),null},J=function(e){return e.HOME=`HOME`,e.MEDIA=`MEDIA`,e.MEDIA_EPISODE=`MEDIA_EPISODE`,e.SEARCH=`SEARCH`,e.SEARCH_LEGACY=`SEARCH_LEGACY`,e.LEGAL=`LEGAL`,e.PRIVACY=`PRIVACY`,e.SETTINGS=`SETTINGS`,e.WATCH=`WATCH`,e.PARTY=`PARTY`,e.DEBUG_TRACE=`DEBUG_TRACE`,e.LOGIN_CALLBACK=`LOGIN_CALLBACK`,e}({}),us={HOME:()=>`/`,MEDIA:({uri:e})=>`/media/${e}`,MEDIA_EPISODE:({uri:e,mediaUri:t})=>`/media/${e}/${t}`,SEARCH:()=>`/search`,SEARCH_LEGACY:({query:e})=>`/search/${encodeURIComponent(e)}`,LEGAL:()=>`/legal`,PRIVACY:()=>`/privacy`,SETTINGS:()=>`/settings`,WATCH:({mediaUri:e,episodeUri:t,sourceUri:n})=>`/watch/${e}/${t}${n?`/${n}`:``}`,PARTY:()=>`/party`,DEBUG_TRACE:()=>`/debug/trace`,LOGIN_CALLBACK:()=>`/login/callback`},ds={HOME:`/`,MEDIA:`/media/:uri`,MEDIA_EPISODE:`/media/:uri/:mediaUri`,SEARCH:`/search`,SEARCH_LEGACY:`/search/:query`,LEGAL:`/legal`,PRIVACY:`/privacy`,SETTINGS:`/settings`,WATCH:`/watch/:mediaUri/:episodeUri/:sourceUri?`,PARTY:`/party`,DEBUG_TRACE:`/debug/trace`,LOGIN_CALLBACK:`/login/callback`},fs=e=>ds[e],ps=(e,t)=>us[e](t),ms=function(e){return e.Anime=`ANIME`,e.Movie=`MOVIE`,e.Series=`SERIES`,e}({}),hs=function(e){return e.Html=`HTML`,e.Text=`TEXT`,e}({}),gs=function(e){return e.Fall=`FALL`,e.Spring=`SPRING`,e.Summer=`SUMMER`,e.Winter=`WINTER`,e}({}),_s=function(e){return e.Popularity=`POPULARITY`,e.PopularityDesc=`POPULARITY_DESC`,e}({}),vs=function(e){return e.Cancelled=`CANCELLED`,e.Finished=`FINISHED`,e.Hiatus=`HIATUS`,e.NotYetReleased=`NOT_YET_RELEASED`,e.Releasing=`RELEASING`,e}({}),ys=function(e){return e.Anime=`ANIME`,e.LiveAction=`LIVE_ACTION`,e.Movie=`MOVIE`,e.Ona=`ONA`,e.Ova=`OVA`,e.Special=`SPECIAL`,e.Tv=`TV`,e.TvShort=`TV_SHORT`,e}({}),bs=function(e){return e.IsApiOnly=`IS_API_ONLY`,e.IsNotApiOnly=`IS_NOT_API_ONLY`,e}({}),xs={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},Ss={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Cs={kind:`Document`,definitions:[{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},ws={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`MediaTracking`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`TrackingInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracking`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`disagreements`}},{kind:`Field`,name:{kind:`Name`,value:`summary`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}},{kind:`Field`,name:{kind:`Name`,value:`answers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`state`}},{kind:`Field`,name:{kind:`Name`,value:`candidates`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`tracker`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`canWrite`}},{kind:`Field`,name:{kind:`Name`,value:`account`}},{kind:`Field`,name:{kind:`Name`,value:`scoreScale`}},{kind:`Field`,name:{kind:`Name`,value:`writeNotice`}}]}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]}}]},Ts={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`SaveListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`SaveListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`saveListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}},{kind:`Field`,name:{kind:`Name`,value:`entry`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`progress`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}}]}}]},Es={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`DeleteListEntry`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`DeleteListEntryInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`deleteListEntry`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`tracker`}},{kind:`Field`,name:{kind:`Name`,value:`outcome`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Ds={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`StubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`stubTrackerStorage`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},Os={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`mutation`,name:{kind:`Name`,value:`AddHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`addHeldStubEntries`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`location`}},{kind:`Field`,name:{kind:`Name`,value:`signedIn`}},{kind:`Field`,name:{kind:`Name`,value:`locked`}},{kind:`Field`,name:{kind:`Name`,value:`waiting`}},{kind:`Field`,name:{kind:`Name`,value:`held`}},{kind:`Field`,name:{kind:`Name`,value:`error`}}]}}]}}]},ks={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetReleasingMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},As={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModal`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`descriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`descriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`description`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`categories`}},{kind:`Field`,name:{kind:`Name`,value:`franchise`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`edges`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`from`}},{kind:`Field`,name:{kind:`Name`,value:`to`}},{kind:`Field`,name:{kind:`Name`,value:`relation`}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`relations`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`format`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`startDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`releaseDate`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}}]},js={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetMediaModalOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`OriginFragment`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`OriginFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Origin`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]},Ms={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`SearchMediaPage`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaPageInput`}}}},{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaShortDescriptionInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`mediaPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`score`}},{kind:`Field`,name:{kind:`Name`,value:`episodeCount`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`title`}},{kind:`Field`,name:{kind:`Name`,value:`score`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`shortDescriptionInput`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}},{kind:`Field`,name:{kind:`Name`,value:`covers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`color`}}]}},{kind:`Field`,name:{kind:`Name`,value:`banners`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`trailers`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`thumbnail`}}]}},{kind:`Field`,name:{kind:`Name`,value:`popularity`}},{kind:`Field`,name:{kind:`Name`,value:`genres`}},{kind:`Field`,name:{kind:`Name`,value:`tags`}},{kind:`Field`,name:{kind:`Name`,value:`averageScore`}},{kind:`Field`,name:{kind:`Name`,value:`status`}},{kind:`Field`,name:{kind:`Name`,value:`type`}},{kind:`Field`,name:{kind:`Name`,value:`season`}},{kind:`Field`,name:{kind:`Name`,value:`seasonYear`}},{kind:`Field`,name:{kind:`Name`,value:`nextAiringEpisode`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`airingAt`}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Ns={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchMedia`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`MediaInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`media`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`thumbnails`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`url`}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`embedUrl`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}},{kind:`Field`,name:{kind:`Name`,value:`titles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`title`}}]}},{kind:`Field`,name:{kind:`Name`,value:`shortDescriptions`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`language`}},{kind:`Field`,name:{kind:`Name`,value:`shortDescription`}}]}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`MediaFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}}]}}]}}]}},{kind:`Field`,name:{kind:`Name`,value:`episodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`FragmentSpread`,name:{kind:`Name`,value:`EpisodeFragment`}},{kind:`Field`,name:{kind:`Name`,value:`episodeNumber`}}]}}]}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`EpisodeFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Episode`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`mediaUri`}}]}}]}}]}},{kind:`FragmentDefinition`,name:{kind:`Name`,value:`MediaFragment`},typeCondition:{kind:`NamedType`,name:{kind:`Name`,value:`Media`}},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`handles`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`relation`}},{kind:`Field`,name:{kind:`Name`,value:`node`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`_id`}},{kind:`Field`,name:{kind:`Name`,value:`uri`}},{kind:`Field`,name:{kind:`Name`,value:`origin`}},{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}}]}}]}}]}}]},Ps={kind:`Document`,definitions:[{kind:`OperationDefinition`,operation:`subscription`,name:{kind:`Name`,value:`GetWatchOrigins`},variableDefinitions:[{kind:`VariableDefinition`,variable:{kind:`Variable`,name:{kind:`Name`,value:`input`}},type:{kind:`NonNullType`,type:{kind:`NamedType`,name:{kind:`Name`,value:`OriginPageInput`}}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`originPage`},arguments:[{kind:`Argument`,name:{kind:`Name`,value:`input`},value:{kind:`Variable`,name:{kind:`Name`,value:`input`}}}],selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`nodes`},selectionSet:{kind:`SelectionSet`,selections:[{kind:`Field`,name:{kind:`Name`,value:`id`}},{kind:`Field`,name:{kind:`Name`,value:`url`}},{kind:`Field`,name:{kind:`Name`,value:`name`}},{kind:`Field`,name:{kind:`Name`,value:`icon`}},{kind:`Field`,name:{kind:`Name`,value:`color`}},{kind:`Field`,name:{kind:`Name`,value:`isApiOnly`}}]}}]}}]}}]},Fs={query:`q`,category:`category`,status:`status`,season:`season`,year:`year`,format:`format`,genre:`genre`,tag:`tag`},Is=[{value:ys.Tv,label:`TV Show`},{value:ys.Movie,label:`Movie`},{value:ys.TvShort,label:`TV Short`},{value:ys.Special,label:`Special`},{value:ys.Ova,label:`OVA`},{value:ys.Ona,label:`ONA`}],Ls=[{value:vs.Releasing,label:`Airing`},{value:vs.Finished,label:`Finished`},{value:vs.NotYetReleased,label:`Not yet aired`},{value:vs.Cancelled,label:`Cancelled`},{value:vs.Hiatus,label:`Hiatus`}],Rs=[{value:gs.Winter,label:`Winter`},{value:gs.Spring,label:`Spring`},{value:gs.Summer,label:`Summer`},{value:gs.Fall,label:`Fall`}],zs=[{value:ms.Anime,label:`Anime`},{value:ms.Series,label:`Series`},{value:ms.Movie,label:`Movies`}],Bs=[`Action`,`Adventure`,`Comedy`,`Drama`,`Ecchi`,`Fantasy`,`Horror`,`Mahou Shoujo`,`Mecha`,`Music`,`Mystery`,`Psychological`,`Romance`,`Sci-Fi`,`Slice of Life`,`Sports`,`Supernatural`,`Thriller`],Vs=new Set(Bs.map(e=>e.toLowerCase())),Hs=e=>Vs.has(e.trim().toLowerCase()),Us=(e,t)=>e.find(e=>e===t)??null,Ws=(e,t)=>t.map(t=>Us(e,t)).filter(e=>e!==null),Gs=e=>Rs.map(e=>e.value).find(t=>t===e)??null,Ks=Is.map(e=>e.value),qs=Ls.map(e=>e.value),Js=Rs.map(e=>e.value),Ys=zs.map(e=>e.value),Xs=1917,Zs=(e=new Date)=>e.getFullYear()+5,Qs=(e,t=new Date)=>{if(!e||!/^\d{4}$/.test(e))return null;let n=Number(e);return n>=1917&&n<=Zs(t)?n:null},$s=(e,t=new Date)=>{let n=new URLSearchParams(e);return{query:(n.get(Fs.query)??``).trim(),category:Us(Ys,n.get(Fs.category)),status:Us(qs,n.get(Fs.status)),season:Us(Js,n.get(Fs.season)),year:Qs(n.get(Fs.year),t),formats:Ws(Ks,n.getAll(Fs.format)),genres:ec(n.getAll(Fs.genre)),tags:ec(n.getAll(Fs.tag))}},ec=e=>{let t=new Set,n=[];for(let r of e){let e=r.trim(),i=e.toLowerCase();e&&!t.has(i)&&(t.add(i),n.push(e))}return n},tc=e=>{let t=new URLSearchParams,n=e.query?.trim();n&&t.set(Fs.query,n),e.category&&t.set(Fs.category,e.category),e.status&&t.set(Fs.status,e.status),e.season&&t.set(Fs.season,e.season),e.year&&t.set(Fs.year,String(e.year));for(let n of e.formats??[])t.append(Fs.format,n);for(let n of e.genres??[])t.append(Fs.genre,n);for(let n of e.tags??[])t.append(Fs.tag,n);return t.toString()},nc=e=>{if(!e)return``;try{return decodeURIComponent(e)}catch{return e}},rc=(e={})=>{let t=tc(e);return t?`/search?${t}`:`/search`},ic=e=>{if(e.query)return`Results for \u201C${e.query}\u201D`;let t=Rs.find(t=>t.value===e.season)?.label;return t&&e.year?`${t} ${e.year}`:t?`${t} seasons`:e.year?String(e.year):cc(e)?`Browsing`:`Search`},ac=e=>Is.find(t=>t.value===e)?.label,oc=e=>Ls.find(t=>t.value===e)?.label,sc=(e,t)=>{let n=Rs.find(t=>t.value===e)?.label;return n&&t?`${n} ${t}`:t?String(t):void 0},cc=e=>!!(e.query||e.category||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),lc=e=>!!(e.query||e.status||e.season||e.year||e.formats.length||e.genres.length||e.tags.length),uc=`plugins`,dc=`plugin`,fc=(e,t)=>{try{return new URL(e,t)}catch{return}},pc=e=>{let t=new Set;return e.filter(e=>{let n=mc(e);return!n||t.has(n)?!1:(t.add(n),!0)})},mc=e=>e.trim().replace(/\/+$/,``).replace(/@\d[^@/]*$/,``),hc=(e,t)=>{let n=fc(e,t);return n?pc([...n.searchParams].filter(([e])=>e===`plugins`||e===dc).map(([,e])=>e.trim())):[]},gc=e=>encodeURIComponent(e).replace(/%3A/g,`:`).replace(/%2F/g,`/`).replace(/%40/g,`@`),_c=(e,t,n)=>{let r=fc(e,n),i=fc(n);return!r||!i||r.origin!==i.origin?e:(r.searchParams.delete(uc),r.searchParams.delete(dc),r.search=[r.searchParams.toString(),pc(t.map(e=>e.trim())).sort().map(e=>`${uc}=${gc(e)}`).join(`&`)].filter(Boolean).join(`&`),r.href)},vc=new Map,yc=new Set,bc=new Set,xc=()=>bc.forEach(e=>{try{e()}catch{}}),Sc=e=>(bc.add(e),()=>{bc.delete(e)}),Cc=()=>[...vc.values()],wc=()=>[...vc.keys()],Tc=e=>{let t=new Set(Wr().map(mc)),n=!1;for(let r of e){let e=mc(r);!e||t.has(e)||yc.has(e)||vc.has(r)||(vc.set(r,{uri:r,state:`offered`}),n=!0)}n&&xc()},Ec=()=>{if(vc.size){for(let e of vc.keys())yc.add(mc(e));vc.clear(),xc()}},Dc=async()=>{let e=[...vc.keys()];if(e.length){for(let t of e)vc.set(t,{uri:t,state:`installing`});xc();for(let t of e){try{await ni(t,{noConfirm:!0})||yc.add(mc(t)),vc.delete(t)}catch(e){vc.set(t,{uri:t,state:`error`,error:e instanceof Error?e.message:String(e)})}xc()}}},Oc=e=>{vc.delete(e)&&(yc.add(mc(e)),xc())},kc=()=>[...Wr(),...wc()],Ac=()=>{let e=_c(location.href,kc(),location.href);e!==location.href&&history.replaceState(history.state,``,e)},jc=()=>Tc(hc(location.href)),Mc=e=>{let t=_c(e,kc(),location.href);return t.startsWith(location.origin)?t.slice(location.origin.length):t},Nc=e=>{let t=history[e];history[e]=function(e,n,r){let i=r==null?location.href:String(r);return t.call(this,e,n,_c(i,kc(),location.href))}},Pc=Symbol.for(`stub_plugin_url`);Pc in globalThis||(Object.defineProperty(globalThis,Pc,{value:!0}),Nc(`pushState`),Nc(`replaceState`),addEventListener(`popstate`,()=>{jc(),Ac()}),Hr(Ac),Sc(Ac),jc(),Ac());var Fc=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ic=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Lc=e=>{let t=Ic(e);return t.charAt(0).toUpperCase()+t.slice(1)},Rc=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),zc=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0},Bc={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`};h();var Vc=l(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>ce(`svg`,{ref:c,...Bc,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Rc(`lucide`,i),...!a&&!zc(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>ce(e,t)),...Array.isArray(a)?a:[a]]));h();var Y=(e,t)=>{let n=l(({className:n,...r},i)=>ce(Vc,{ref:i,iconNode:t,className:Rc(`lucide-${Fc(Lc(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Lc(e),n},Hc=Y(`ban`,[[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}],[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}]]),Uc=Y(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Wc=Y(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Gc=Y(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),Kc=Y(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),qc=Y(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Jc=Y(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Yc=Y(`frown`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M16 16s-1.5-2-4-2-4 2-4 2`,key:`epbg0q`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Xc=Y(`grid-2x2`,[[`path`,{d:`M12 3v18`,key:`108xh3`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Zc=Y(`grid-3x2`,[[`path`,{d:`M15 3v18`,key:`14nvp0`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),Qc=Y(`layout-list`,[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}],[`path`,{d:`M14 4h7`,key:`3xa0d5`}],[`path`,{d:`M14 9h7`,key:`1icrd9`}],[`path`,{d:`M14 15h7`,key:`1mj8o2`}],[`path`,{d:`M14 20h7`,key:`11slyb`}]]),$c=Y(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),el=Y(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),tl=Y(`meh`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`8`,x2:`16`,y1:`15`,y2:`15`,key:`1xb1d9`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),nl=Y(`message-circle`,[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]),rl=Y(`minus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),il=Y(`network`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),al=Y(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),ol=Y(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),sl=Y(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),cl=Y(`radio`,[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]),ll=Y(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ul=Y(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),dl=Y(`settings`,[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]),fl=Y(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),pl=Y(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),ml=Y(`user-x`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}],[`line`,{x1:`17`,x2:`22`,y1:`8`,y2:`13`,key:`3nzzx3`}],[`line`,{x1:`22`,x2:`17`,y1:`8`,y2:`13`,key:`1swrse`}]]),hl=Y(`users`,[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),gl=Y(`volume-1`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}]]),_l=Y(`volume-2`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`path`,{d:`M16 9a5 5 0 0 1 0 6`,key:`1q6k2b`}],[`path`,{d:`M19.364 18.364a9 9 0 0 0 0-12.728`,key:`ijwkga`}]]),vl=Y(`volume-x`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}],[`line`,{x1:`22`,x2:`16`,y1:`9`,y2:`15`,key:`1ewh16`}],[`line`,{x1:`16`,x2:`22`,y1:`9`,y2:`15`,key:`5ykzw1`}]]),yl=Y(`volume`,[[`path`,{d:`M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z`,key:`uqj9uw`}]]),bl=Y(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),xl=e=>e===`/`||e===`/media`||e.startsWith(`/media/`),Sl=({from:e,to:t,kind:n,asked:r=!1})=>r?!0:n===`pop`||xl(e.pathname)&&xl(t.pathname)?!1:n!==`replace`||e.pathname!==t.pathname,Cl=()=>{window.scrollTo({top:0,left:0,behavior:`instant`})},wl=0,Tl=()=>{El(),wl=requestAnimationFrame(()=>{wl=0,Cl()})},El=()=>{cancelAnimationFrame(wl),wl=0},Dl=!1,Ol=()=>{Dl=!0},kl=()=>{let e=Dl;return Dl=!1,e},Al=[`input:not([inert])`,`select:not([inert])`,`textarea:not([inert])`,`a[href]:not([inert])`,`button:not([inert])`,`[tabindex]:not(slot):not([inert])`,`audio[controls]:not([inert])`,`video[controls]:not([inert])`,`[contenteditable]:not([contenteditable="false"]):not([inert])`,`details>summary:first-of-type:not([inert])`,`details:not([inert])`].join(`,`),jl=typeof Element>`u`,Ml=jl?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Nl=!jl&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},Pl=function e(t,n){n===void 0&&(n=!0);var r=t?.getAttribute?.call(t,`inert`);return r===``||r===`true`||n&&t&&e(t.parentNode)},Fl=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Il=function(e,t,n){if(Pl(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(Al));return t&&Ml.call(e,Al)&&r.unshift(e),r=r.filter(n),r},Ll=function e(t,n,r){for(var i=[],a=Array.from(t);a.length;){var o=a.shift();if(!Pl(o,!1)){if(o.tagName===`SLOT`){var s=o.assignedElements(),c=e(s.length?s:o.children,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{Ml.call(o,Al)&&r.filter(o)&&(n||!t.includes(o))&&i.push(o);var l=o.shadowRoot||typeof r.getShadowRoot==`function`&&r.getShadowRoot(o),u=!Pl(l,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(l&&u){var d=e(l===!0?o.children:l.children,!0,r);r.flatten?i.push.apply(i,d):i.push({scopeParent:o,candidates:d})}else a.unshift.apply(a,o.children)}}}return i},Rl=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},zl=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Fl(e))&&!Rl(e)?0:e.tabIndex},Bl=function(e,t){var n=zl(e);return n<0&&t&&!Rl(e)?0:n},Vl=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Hl=function(e){return e.tagName===`INPUT`},Ul=function(e){return Hl(e)&&e.type===`hidden`},Wl=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Gl=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Kl=function(e){if(!e.name)return!0;var t=e.form||Nl(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Gl(r,e.form);return!i||i===e},ql=function(e){return Hl(e)&&e.type===`radio`},Jl=function(e){return ql(e)&&!Kl(e)},Yl=function(e){var t=e&&Nl(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Nl(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},Xl=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Zl=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(getComputedStyle(e).visibility===`hidden`)return!0;var i=Ml.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(Ml.call(i,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`legacy-full`){if(typeof r==`function`){for(var a=e;e;){var o=e.parentElement,s=Nl(e);if(o&&!o.shadowRoot&&r(o)===!0)return Xl(e);e=e.assignedSlot?e.assignedSlot:!o&&s!==e.ownerDocument?s.host:o}e=a}if(Yl(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return Xl(e);return!1},Ql=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return Ml.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},$l=function(e,t){return!(t.disabled||Pl(t)||Ul(t)||Zl(t,e)||Wl(t)||Ql(t))},eu=function(e,t){return!(Jl(t)||zl(t)<0||!$l(e,t))},tu=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},nu=function e(t){var n=[],r=[];return t.forEach(function(t,i){var a=!!t.scopeParent,o=a?t.scopeParent:t,s=Bl(o,a),c=a?e(t.candidates):o;s===0?a?n.push.apply(n,c):n.push(o):r.push({documentOrder:i,tabIndex:s,item:t,isScope:a,content:c})}),r.sort(Vl).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(n)},ru=function(e,t){return t||={},nu(t.getShadowRoot?Ll([e],t.includeContainer,{filter:eu.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:tu}):Il(e,t.includeContainer,eu.bind(null,t)))},iu=function(e,t){return t||={},t.getShadowRoot?Ll([e],t.includeContainer,{filter:$l.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Il(e,t.includeContainer,$l.bind(null,t))},au=function(e,t){if(t||={},!e)throw Error(`No node provided`);return Ml.call(e,Al)!==!1&&eu(t,e)};h();function ou(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function su(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function cu(){return/apple/i.test(navigator.vendor)}function lu(){let e=/android/i;return e.test(ou())||e.test(su())}function uu(){return ou().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function du(){return su().includes(`jsdom/`)}var fu=`data-floating-ui-focusable`,pu=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function mu(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function hu(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function gu(e){return`composedPath`in e?e.composedPath()[0]:e.target}function _u(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function vu(e){return e.matches(`html,body`)}function yu(e){return e?.ownerDocument||document}function bu(e){return o(e)&&e.matches(pu)}function xu(e){return e?e.getAttribute(`role`)===`combobox`&&bu(e):!1}function Su(e){if(!e||du())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Cu(e){return e?e.hasAttribute(fu)?e:e.querySelector(`[`+fu+`]`)||e:null}function wu(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...wu(e,t.id,n)])}function Tu(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function Eu(e){e.preventDefault(),e.stopPropagation()}function Du(e){return`nativeEvent`in e}function Ou(e){return e.mozInputSource===0&&e.isTrusted?!0:lu()&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function ku(e){return du()?!1:!lu()&&e.width===0&&e.height===0||lu()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Au(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var ju=typeof document<`u`?_e:function(){},Mu={...S};function Nu(e){let t=R(e);return ju(()=>{t.current=e}),t}var Pu=Mu.useInsertionEffect||(e=>e());function Fu(e){let t=R(()=>{});return Pu(()=>{t.current=e}),z(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}var Iu=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`});function Lu(e,t){let n=ru(e,Iu()),r=n.length;if(r===0)return;let i=mu(yu(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ru(e){return Lu(yu(e).body,1)||e}function zu(e){return Lu(yu(e).body,-1)||e}function Bu(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!hu(n,r)}function Vu(e){ru(e,Iu()).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Hu(e){e.querySelectorAll(`[data-tabindex]`).forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}h();var Uu=typeof document<`u`?_e:function(){};function Wu(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Wu(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Wu(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Gu(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ku(e,t){let n=Gu(e);return Math.round(t*n)/n}function qu(e){let t=R(e);return Uu(()=>{t.current=e}),t}function Ju(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:i=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=B({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=B(i);Wu(p,i)||m(i);let[h,g]=B(null),[_,v]=B(null),y=z(e=>{e!==w.current&&(w.current=e,g(e))},[]),b=z(e=>{e!==T.current&&(T.current=e,v(e))},[]),x=o||h,S=s||_,w=R(null),T=R(null),E=R(d),D=l!=null,O=qu(l),k=qu(a),A=qu(u),j=z(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:p};k.current&&(e.platform=k.current),r(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Wu(E.current,t)&&(E.current=t,C(()=>{f(t)}))})},[p,t,n,k,A]);Uu(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let M=R(!1);Uu(()=>(M.current=!0,()=>{M.current=!1}),[]),Uu(()=>{if(x&&(w.current=x),S&&(T.current=S),x&&S){if(O.current)return O.current(x,S,j);j()}},[x,S,j,O,D]);let N=V(()=>({reference:w,floating:T,setReference:y,setFloating:b}),[y,b]),P=V(()=>({reference:x,floating:S}),[x,S]),ee=V(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ku(P.floating,d.x),r=Ku(P.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Gu(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,P.floating,d.x,d.y]);return V(()=>({...d,update:j,refs:N,elements:P,floatingStyles:ee}),[d,j,N,P,ee])}var Yu=(e,t)=>({...y(e),options:[e,t]}),Xu=(e,t)=>({...a(e),options:[e,t]}),Zu=(e,t)=>({...be(e),options:[e,t]}),Qu=(e,t)=>({...i(e),options:[e,t]});h(),ie();function $u(e){let t=R(void 0),n=z(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return V(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var ed=`data-floating-ui-focusable`,td=`active`,nd=`selected`,rd=`ArrowLeft`,id=`ArrowRight`,ad=`ArrowUp`,od=`ArrowDown`,sd=[rd,id],cd=[ad,od];[...sd,...cd];var ld={...S},ud=!1,dd=0,fd=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+dd++;function pd(){let[e,t]=B(()=>ud?fd():void 0);return ju(()=>{e??t(fd())},[]),O(()=>{ud=!0},[]),e}var md=ld.useId||pd;function hd(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var gd=fe(null),_d=fe(null),vd=()=>L(gd)?.id||null,yd=()=>L(_d);function bd(e){return`data-floating-ui-`+e}function xd(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var Sd=bd(`safe-polygon`);function Cd(e,t,n){if(n&&!Au(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function wd(e){return typeof e==`function`?e():e}function Td(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=yd(),h=vd(),g=Nu(l),_=Nu(c),v=Nu(n),y=Nu(d),b=R(),x=R(-1),S=R(),C=R(-1),w=R(!0),T=R(!1),E=R(()=>{}),D=R(!1),k=Fu(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});O(()=>{if(!s)return;function e(e){let{open:t}=e;t||(xd(x),xd(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),O(()=>{if(!s||!g.current||!n)return;function e(e){k()&&r(!1,e,`hover`)}let t=yu(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,g,k]);let A=z(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Cd(_.current,`close`,b.current);i&&!S.current?(xd(x),x.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(xd(x),r(!1,e,n))},[_,r]),j=Fu(()=>{E.current(),S.current=void 0}),M=Fu(()=>{if(T.current){let e=yu(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(Sd),T.current=!1}}),N=Fu(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);O(()=>{if(!s)return;function e(e){if(xd(x),w.current=!1,u&&!Au(b.current)||wd(y.current)>0&&!Cd(_.current,`open`))return;let t=Cd(_.current,`open`,b.current);t?x.current=window.setTimeout(()=>{v.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(N()){M();return}E.current();let t=yu(o.floating);if(xd(C),D.current=!1,g.current&&i.current.floatingContext){n||xd(x),S.current=g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){M(),j(),N()||A(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(b.current!==`touch`||!hu(o.floating,e.relatedTarget))&&A(e)}function a(e){N()||i.current.floatingContext&&(g.current==null||g.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){M(),j(),N()||A(e)}})(e))}function c(){xd(x)}function l(e){N()||A(e,!1)}if(m(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,A,j,M,r,n,v,p,_,g,i,N,y]),ju(()=>{var e;if(s&&n&&(e=g.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&k()){T.current=!0;let e=o.floating;if(m(o.domReference)&&e){var t;let n=yu(o.floating).body;n.setAttribute(Sd,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===h))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,h,o,p,g,k]),ju(()=>{n||(b.current=void 0,D.current=!1,j(),M())},[n,j,M]),O(()=>()=>{j(),xd(x),xd(C),M()},[s,o.domReference,j,M]);let P=V(()=>{function e(e){b.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!v.current&&r(!0,t,`hover`)}(!u||Au(b.current))&&(n||wd(y.current)===0||D.current&&e.movementX**2+e.movementY**2<2||(xd(C),b.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,wd(y.current)))))}}},[u,r,n,v,y]);return V(()=>s?{reference:P}:{},[s,P])}var Ed=0;function Dd(e,t){t===void 0&&(t={});let{preventScroll:n=!1,cancelPrevious:r=!0,sync:i=!1}=t;r&&cancelAnimationFrame(Ed);let a=()=>e?.focus({preventScroll:n});i?a():Ed=requestAnimationFrame(a)}function Od(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&g(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function kd(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Ad(e){return e?.ownerDocument||document}var jd={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Md(e){return e===`inert`?jd.inert:e===`aria-hidden`?jd[`aria-hidden`]:jd.none}var Nd=new WeakSet,Pd={},Fd=0,Id=()=>typeof HTMLElement<`u`&&`inert`in HTMLElement.prototype,Ld=e=>e&&(e.host||Ld(e.parentNode)),Rd=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Ld(t);return e.contains(n)?n:null}).filter(e=>e!=null);function zd(e,n,r,i){let a=`data-floating-ui-inert`,o=i?`inert`:r?`aria-hidden`:null,s=Rd(n,e),c=new Set,l=new Set(s),u=[];Pd[a]||(Pd[a]=new WeakMap);let d=Pd[a];s.forEach(f),p(n),c.clear();function f(e){e&&!c.has(e)&&(c.add(e),e.parentNode&&f(e.parentNode))}function p(e){e&&!l.has(e)&&[].forEach.call(e.children,e=>{if(t(e)!==`script`){if(c.has(e))p(e);else{let t=o?e.getAttribute(o):null,n=t!==null&&t!==`false`,r=Md(o),i=(r.get(e)||0)+1,s=(d.get(e)||0)+1;r.set(e,i),d.set(e,s),u.push(e),i===1&&n&&Nd.add(e),s===1&&e.setAttribute(a,``),!n&&o&&e.setAttribute(o,o===`inert`?``:`true`)}}})}return Fd++,()=>{u.forEach(e=>{let t=Md(o),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Nd.has(e)&&o&&e.removeAttribute(o),Nd.delete(e)),r||e.removeAttribute(a)}),Fd--,Fd||(jd.inert=new WeakMap,jd[`aria-hidden`]=new WeakMap,jd.none=new WeakMap,Nd=new WeakSet,Pd={})}}function Bd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);let r=Ad(e[0]).body;return zd(e.concat(Array.from(r.querySelectorAll(`[aria-live],[role="status"],output`))),r,t,n)}var Vd={border:0,clip:`rect(0 0 0 0)`,height:`1px`,margin:`-1px`,overflow:`hidden`,padding:0,position:`fixed`,whiteSpace:`nowrap`,width:`1px`,top:0,left:0},Hd=l(function(e,t){let[n,r]=B();ju(()=>{cu()&&r(`button`)},[]);let i={ref:t,tabIndex:0,role:n,"aria-hidden":!n||void 0,[bd(`focus-guard`)]:``,style:Vd};return p(`span`,{...e,...i})}),Ud=fe(null),Wd=bd(`portal`);function Gd(e){e===void 0&&(e={});let{id:t,root:n}=e,r=md(),i=qd(),[a,o]=B(null),s=R(null);return ju(()=>()=>{a?.remove(),queueMicrotask(()=>{s.current=null})},[a]),ju(()=>{if(!r||s.current)return;let e=t?document.getElementById(t):null;if(!e)return;let n=document.createElement(`div`);n.id=r,n.setAttribute(Wd,``),e.appendChild(n),s.current=n,o(n)},[t,r]),ju(()=>{if(n===null||!r||s.current)return;let e=n||i?.portalNode;e&&!u(e)&&(e=e.current),e||=document.body;let a=null;t&&(a=document.createElement(`div`),a.id=t,e.appendChild(a));let c=document.createElement(`div`);c.id=r,c.setAttribute(Wd,``),e=a||e,e.appendChild(c),s.current=c,o(c)},[t,n,r,i]),a}function Kd(e){let{children:t,id:n,root:r,preserveTabOrder:i=!0}=e,a=Gd({id:n,root:r}),[o,s]=B(null),c=R(null),l=R(null),u=R(null),d=R(null),f=o?.modal,m=o?.open,h=!!o&&!o.modal&&o.open&&i&&!!(r||a);return O(()=>{if(!a||!i||f)return;function e(e){a&&Bu(e)&&(e.type===`focusin`?Hu:Vu)(a)}return a.addEventListener(`focusin`,e,!0),a.addEventListener(`focusout`,e,!0),()=>{a.removeEventListener(`focusin`,e,!0),a.removeEventListener(`focusout`,e,!0)}},[a,i,f]),O(()=>{a&&(m||Hu(a))},[m,a]),p(Ud.Provider,{value:V(()=>({preserveTabOrder:i,beforeOutsideRef:c,afterOutsideRef:l,beforeInsideRef:u,afterInsideRef:d,portalNode:a,setFocusManagerState:s}),[i,a]),children:[h&&a&&p(Hd,{"data-type":`outside`,ref:c,onFocus:e=>{if(Bu(e,a)){var t;(t=u.current)==null||t.focus()}else zu(o?o.domReference:null)?.focus()}}),h&&a&&p(`span`,{"aria-owns":a.id,style:Vd}),a&&pe(t,a),h&&a&&p(Hd,{"data-type":`outside`,ref:l,onFocus:e=>{if(Bu(e,a)){var t;(t=d.current)==null||t.focus()}else Ru(o?o.domReference:null)?.focus(),o!=null&&o.closeOnFocusOut&&o?.onOpenChange(!1,e.nativeEvent,`focus-out`)}})]})}var qd=()=>L(Ud);function Jd(e){return V(()=>t=>{e.forEach(e=>{e&&(e.current=t)})},e)}var Yd=20,Xd=[];function Zd(){Xd=Xd.filter(e=>e.isConnected)}function Qd(e){Zd(),e&&t(e)!==`body`&&(Xd.push(e),Xd.length>Yd&&(Xd=Xd.slice(-20)))}function $d(){return Zd(),Xd[Xd.length-1]}function ef(e){let t=Iu();return au(e,t)?e:ru(e,t)[0]||e}function tf(e,t){var n;if(!t.current.includes(`floating`)&&!((n=e.getAttribute(`role`))!=null&&n.includes(`dialog`)))return;let r=Iu(),i=iu(e,r).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return au(e,r)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),a=e.getAttribute(`tabindex`);t.current.includes(`floating`)||i.length===0?a!==`0`&&e.setAttribute(`tabindex`,`0`):(a!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}var nf=l(function(e,t){return p(`button`,{...e,type:`button`,ref:t,tabIndex:-1,style:Vd})});function rf(e){let{context:t,children:n,disabled:r=!1,order:i=[`content`],guards:a=!0,initialFocus:s=0,returnFocus:c=!0,restoreFocus:l=!1,modal:u=!0,visuallyHiddenDismiss:d=!1,closeOnFocusOut:f=!0,outsideElementsInert:m=!1,getInsideElements:h=()=>[]}=e,{open:g,onOpenChange:_,events:v,dataRef:y,elements:{domReference:b,floating:x}}=t,S=Fu(()=>y.current.floatingContext?.nodeId),C=Fu(h),w=typeof s==`number`&&s<0,T=xu(b)&&w,E=Id(),D=!E||a,k=!D||E&&m,A=Nu(i),j=Nu(s),M=Nu(c),N=yd(),P=qd(),ee=R(null),te=R(null),re=R(!1),ie=R(!1),F=R(-1),ae=R(-1),oe=P!=null,I=Cu(x),L=Fu(function(e){return e===void 0&&(e=I),e?ru(e,Iu()):[]}),se=Fu(e=>{let t=L(e);return A.current.map(e=>b&&e===`reference`?b:I&&e===`floating`?I:t).filter(Boolean).flat()});O(()=>{if(r||!u)return;function e(e){if(e.key===`Tab`){hu(I,mu(yu(I)))&&L().length===0&&!T&&Eu(e);let t=se(),n=gu(e);A.current[0]===`reference`&&n===b&&(Eu(e),e.shiftKey?Dd(t[t.length-1]):Dd(t[1])),A.current[1]===`floating`&&n===I&&e.shiftKey&&(Eu(e),Dd(t[0]))}}let t=yu(I);return t.addEventListener(`keydown`,e),()=>{t.removeEventListener(`keydown`,e)}},[r,b,I,u,A,T,L,se]),O(()=>{if(r||!x)return;function e(e){let t=gu(e),n=L().indexOf(t);n!==-1&&(F.current=n)}return x.addEventListener(`focusin`,e),()=>{x.removeEventListener(`focusin`,e)}},[r,x,L]),O(()=>{if(r||!f)return;function e(){ie.current=!0,setTimeout(()=>{ie.current=!1})}function t(e){let t=e.relatedTarget,n=e.currentTarget,r=gu(e);queueMicrotask(()=>{let i=S(),a=!(hu(b,t)||hu(x,t)||hu(t,x)||hu(P?.portalNode,t)||t!=null&&t.hasAttribute(bd(`focus-guard`))||N&&(wu(N.nodesRef.current,i).find(e=>hu(e.context?.elements.floating,t)||hu(e.context?.elements.domReference,t))||Tu(N.nodesRef.current,i).find(e=>[e.context?.elements.floating,Cu(e.context?.elements.floating)].includes(t)||e.context?.elements.domReference===t)));if(n===b&&I&&tf(I,A),l&&n!==b&&!(r!=null&&r.isConnected)&&mu(yu(I))===yu(I).body){o(I)&&I.focus();let e=F.current,t=L(),n=t[e]||t[t.length-1]||I;o(n)&&n.focus()}if(y.current.insideReactTree){y.current.insideReactTree=!1;return}(T||!u)&&t&&a&&!ie.current&&t!==$d()&&(re.current=!0,_(!1,e,`focus-out`))})}let n=!(N||!P);function i(){xd(ae),y.current.insideReactTree=!0,ae.current=window.setTimeout(()=>{y.current.insideReactTree=!1})}if(x&&o(b))return b.addEventListener(`focusout`,t),b.addEventListener(`pointerdown`,e),x.addEventListener(`focusout`,t),n&&x.addEventListener(`focusout`,i,!0),()=>{b.removeEventListener(`focusout`,t),b.removeEventListener(`pointerdown`,e),x.removeEventListener(`focusout`,t),n&&x.removeEventListener(`focusout`,i,!0)}},[r,b,x,I,u,N,P,_,f,l,L,T,S,A,y]);let ce=R(null),le=R(null),ue=Jd([ce,P?.beforeInsideRef]),z=Jd([le,P?.afterInsideRef]);O(()=>{var e,t;if(r||!x)return;let n=Array.from((P==null||(e=P.portalNode)==null?void 0:e.querySelectorAll(`[`+bd(`portal`)+`]`))||[]),i=(t=(N?Tu(N.nodesRef.current,S()):[]).find(e=>xu(e.context?.elements.domReference||null)))==null||(t=t.context)==null?void 0:t.elements.domReference,a=[x,i,...n,...C(),ee.current,te.current,ce.current,le.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,A.current.includes(`reference`)||T?b:null].filter(e=>e!=null),o=u||T?Bd(a,!k,k):Bd(a);return()=>{o()}},[r,b,x,u,A,P,T,D,k,N,S,C]),ju(()=>{if(r||!o(I))return;let e=mu(yu(I));queueMicrotask(()=>{let t=se(I),n=j.current,r=(typeof n==`number`?t[n]:n.current)||I,i=hu(I,e);!w&&!i&&g&&Dd(r,{preventScroll:r===I})})},[r,g,I,w,se,j]),ju(()=>{if(r||!I)return;let e=yu(I);Qd(mu(e));function t(e){let{reason:t,event:n,nested:r}=e;if([`hover`,`safe-polygon`].includes(t)&&n.type===`mouseleave`&&(re.current=!0),t===`outside-press`){if(r)re.current=!1;else if(Ou(n)||ku(n))re.current=!1;else{let e=!1;document.createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?re.current=!1:re.current=!0}}}v.on(`openchange`,t);let n=e.createElement(`span`);n.setAttribute(`tabindex`,`-1`),n.setAttribute(`aria-hidden`,`true`),Object.assign(n.style,Vd),oe&&b&&b.insertAdjacentElement(`afterend`,n);function i(){if(typeof M.current==`boolean`){let e=b||$d();return e&&e.isConnected?e:n}return M.current.current||n}return()=>{v.off(`openchange`,t);let r=mu(e),a=hu(x,r)||N&&wu(N.nodesRef.current,S(),!1).some(e=>hu(e.context?.elements.floating,r)),s=i();queueMicrotask(()=>{let t=ef(s);M.current&&!re.current&&o(t)&&(t===r||r===e.body||a)&&t.focus({preventScroll:!0}),n.remove()})}},[r,x,I,M,y,v,N,oe,b,S]),O(()=>(queueMicrotask(()=>{re.current=!1}),()=>{queueMicrotask(Zd)}),[r]),ju(()=>{if(!r&&P)return P.setFocusManagerState({modal:u,closeOnFocusOut:f,open:g,onOpenChange:_,domReference:b}),()=>{P.setFocusManagerState(null)}},[r,P,u,g,_,f,b]),ju(()=>{r||I&&tf(I,A)},[r,I,A]);function de(e){return r||!d||!u?null:p(nf,{ref:e===`start`?ee:te,onClick:e=>_(!1,e.nativeEvent),children:typeof d==`string`?d:`Dismiss`})}let fe=!r&&D&&(!u||!T)&&(oe||u);return p(ne,{children:[fe&&p(Hd,{"data-type":`inside`,ref:ue,onFocus:e=>{if(u){let e=se();Dd(i[0]===`reference`?e[0]:e[e.length-1])}else if(P!=null&&P.preserveTabOrder&&P.portalNode){if(re.current=!1,Bu(e,P.portalNode))Ru(b)?.focus();else{var t;(t=P.beforeOutsideRef.current)==null||t.focus()}}}}),!T&&de(`start`),n,de(`end`),fe&&p(Hd,{"data-type":`inside`,ref:z,onFocus:e=>{if(u)Dd(se()[0]);else if(P!=null&&P.preserveTabOrder&&P.portalNode){if(f&&(re.current=!0),Bu(e,P.portalNode))zu(b)?.focus();else{var t;(t=P.afterOutsideRef.current)==null||t.focus()}}}})]})}var af=0,of=`--floating-ui-scrollbar-width`;function sf(){let e=ou(),t=/iP(hone|ad|od)|iOS/.test(e)||e===`MacIntel`&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?`paddingLeft`:`paddingRight`,i=window.innerWidth-document.documentElement.clientWidth,a=n.left?parseFloat(n.left):window.scrollX,o=n.top?parseFloat(n.top):window.scrollY;if(n.overflow=`hidden`,n.setProperty(of,i+`px`),i&&(n[r]=i+`px`),t){let e=window.visualViewport?.offsetLeft||0,t=window.visualViewport?.offsetTop||0;Object.assign(n,{position:`fixed`,top:-(o-Math.floor(t))+`px`,left:-(a-Math.floor(e))+`px`,right:`0`})}return()=>{Object.assign(n,{overflow:``,[r]:``}),n.removeProperty(of),t&&(Object.assign(n,{position:``,top:``,left:``,right:``}),window.scrollTo(a,o))}}var cf=()=>{},lf=l(function(e,t){let{lockScroll:n=!1,...r}=e;return ju(()=>{if(n)return af++,af===1&&(cf=sf()),()=>{af--,af===0&&cf()}},[n]),p(`div`,{ref:t,...r,style:{position:`fixed`,overflow:`auto`,top:0,right:0,bottom:0,left:0,...r.style}})});function uf(e){return o(e.target)&&e.target.tagName===`BUTTON`}function df(e){return o(e.target)&&e.target.tagName===`A`}function ff(e){return bu(e)}function pf(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,elements:{domReference:a}}=e,{enabled:o=!0,event:s=`click`,toggle:c=!0,ignoreMouse:l=!1,keyboardHandlers:u=!0,stickIfOpen:d=!0}=t,f=R(),p=R(!1),m=V(()=>({onPointerDown(e){f.current=e.pointerType},onMouseDown(e){let t=f.current;e.button===0&&s!==`click`&&(Au(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`mousedown`)?r(!1,e.nativeEvent,`click`):(e.preventDefault(),r(!0,e.nativeEvent,`click`))))},onClick(e){let t=f.current;if(s===`mousedown`&&f.current){f.current=void 0;return}Au(t,!0)&&l||(n&&c&&(!(i.current.openEvent&&d)||i.current.openEvent.type===`click`)?r(!1,e.nativeEvent,`click`):r(!0,e.nativeEvent,`click`))},onKeyDown(e){f.current=void 0,!(e.defaultPrevented||!u||uf(e))&&(e.key===` `&&!ff(a)&&(e.preventDefault(),p.current=!0),!df(e)&&e.key===`Enter`&&r(!(n&&c),e.nativeEvent,`click`))},onKeyUp(e){e.defaultPrevented||!u||uf(e)||ff(a)||e.key===` `&&p.current&&(p.current=!1,r(!(n&&c),e.nativeEvent,`click`))}}),[i,a,s,l,u,r,n,d,c]);return V(()=>o?{reference:m}:{},[o,m])}var mf={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},hf={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},gf=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function _f(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:s=!0,escapeKey:l=!0,outsidePress:u=!0,outsidePressEvent:f=`pointerdown`,referencePress:p=!1,referencePressEvent:h=`pointerdown`,ancestorScroll:g=!1,bubbles:_,capture:v}=t,y=yd(),b=Fu(typeof u==`function`?u:()=>!1),x=typeof u==`function`?b:u,S=R(!1),{escapeKey:C,outsidePress:w}=gf(_),{escapeKey:T,outsidePress:E}=gf(v),D=R(!1),k=Fu(e=>{if(!n||!s||!l||e.key!==`Escape`||D.current)return;let t=a.current.floatingContext?.nodeId,i=y?wu(y.nodesRef.current,t):[];if(!C&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,Du(e)?e.nativeEvent:e,`escape-key`)}),A=Fu(e=>{var t;let n=()=>{var t;k(e),(t=gu(e))==null||t.removeEventListener(`keydown`,n)};(t=gu(e))==null||t.addEventListener(`keydown`,n)}),j=Fu(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=S.current;if(S.current=!1,f===`click`&&n||t||typeof x==`function`&&!x(e))return;let s=gu(e),l=`[`+bd(`inert`)+`]`,u=yu(i.floating).querySelectorAll(l),p=m(s)?s:null;for(;p&&!c(p);){let e=d(p);if(c(e)||!m(e))break;p=e}if(u.length&&m(s)&&!vu(s)&&!hu(s,i.floating)&&Array.from(u).every(e=>!hu(p,e)))return;if(o(s)&&P){let t=c(s),n=I(s),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),o=i&&s.clientWidth>0&&s.scrollWidth>s.clientWidth,l=a&&s.clientHeight>0&&s.scrollHeight>s.clientHeight,u=n.direction===`rtl`,d=l&&(u?e.offsetX<=s.offsetWidth-s.clientWidth:e.offsetX>s.clientWidth),f=o&&e.offsetY>s.clientHeight;if(d||f)return}let h=a.current.floatingContext?.nodeId,g=y&&wu(y.nodesRef.current,h).some(t=>_u(e,t.context?.elements.floating));if(_u(e,i.floating)||_u(e,i.domReference)||g)return;let _=y?wu(y.nodesRef.current,h):[];if(_.length>0){let e=!0;if(_.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),M=Fu(e=>{var t;let n=()=>{var t;j(e),(t=gu(e))==null||t.removeEventListener(f,n)};(t=gu(e))==null||t.addEventListener(f,n)});O(()=>{if(!n||!s)return;a.current.__escapeKeyBubbles=C,a.current.__outsidePressBubbles=w;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function o(){window.clearTimeout(e),D.current=!0}function c(){e=window.setTimeout(()=>{D.current=!1},Se()?5:0)}let u=yu(i.floating);l&&(u.addEventListener(`keydown`,T?A:k,T),u.addEventListener(`compositionstart`,o),u.addEventListener(`compositionend`,c)),x&&u.addEventListener(f,E?M:j,E);let d=[];return g&&(m(i.domReference)&&(d=oe(i.domReference)),m(i.floating)&&(d=d.concat(oe(i.floating))),!m(i.reference)&&i.reference&&i.reference.contextElement&&(d=d.concat(oe(i.reference.contextElement)))),d=d.filter(e=>e!==u.defaultView?.visualViewport),d.forEach(e=>{e.addEventListener(`scroll`,t,{passive:!0})}),()=>{l&&(u.removeEventListener(`keydown`,T?A:k,T),u.removeEventListener(`compositionstart`,o),u.removeEventListener(`compositionend`,c)),x&&u.removeEventListener(f,E?M:j,E),d.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,l,x,f,n,r,g,s,C,w,k,T,A,j,E,M]),O(()=>{a.current.insideReactTree=!1},[a,x,f]);let N=V(()=>({onKeyDown:k,...p&&{[mf[h]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...h!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[k,r,p,h]),P=V(()=>({onKeyDown:k,onMouseDown(){S.current=!0},onMouseUp(){S.current=!0},[hf[f]]:()=>{a.current.insideReactTree=!0}}),[k,f,a]);return V(()=>s?{reference:N,floating:P}:{},[s,N,P])}function vf(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=md(),a=R({}),[o]=B(()=>hd()),s=vd()!=null,[c,l]=B(r.reference),u=Fu((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=V(()=>({setPositionReference:l}),[]),f=V(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return V(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function yf(e){e===void 0&&(e={});let{nodeId:t}=e,n=vf({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[a,o]=B(null),[s,c]=B(null),l=i?.domReference||a,u=R(null),d=yd();ju(()=>{l&&(u.current=l)},[l]);let f=Ju({...e,elements:{...i,...s&&{reference:s}}}),p=z(e=>{let t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;c(t),f.refs.setReference(t)},[f.refs]),h=z(e=>{(m(e)||e===null)&&(u.current=e,o(e)),(m(f.refs.reference.current)||f.refs.reference.current===null||e!==null&&!m(e))&&f.refs.setReference(e)},[f.refs]),g=V(()=>({...f.refs,setReference:h,setPositionReference:p,domReference:u}),[f.refs,h,p]),_=V(()=>({...f.elements,domReference:l}),[f.elements,l]),v=V(()=>({...f,...r,refs:g,elements:_,nodeId:t}),[f,g,_,t,r]);return ju(()=>{r.dataRef.current.floatingContext=v;let e=d?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),V(()=>({...f,context:v,refs:g,elements:_}),[f,g,_,v])}function bf(){return uu()&&cu()}function xf(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:s}=e,{enabled:c=!0,visibleOnly:l=!0}=t,u=R(!1),d=R(-1),p=R(!0);O(()=>{if(!c)return;let e=f(s.domReference);function t(){!n&&o(s.domReference)&&s.domReference===mu(yu(s.domReference))&&(u.current=!0)}function r(){p.current=!0}function i(){p.current=!1}return e.addEventListener(`blur`,t),bf()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),bf()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[s.domReference,n,c]),O(()=>{if(!c)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(u.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,c]),O(()=>()=>{xd(d)},[]);let h=V(()=>({onMouseLeave(){u.current=!1},onFocus(e){if(u.current)return;let t=gu(e.nativeEvent);if(l&&m(t)){if(bf()&&!e.relatedTarget){if(!p.current&&!bu(t))return}else if(!Su(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){u.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=m(t)&&t.hasAttribute(bd(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;d.current=window.setTimeout(()=>{let e=mu(s.domReference?s.domReference.ownerDocument:document);(t||e!==s.domReference)&&(hu(a.current.floatingContext?.refs.floating.current,e)||hu(s.domReference,e)||i||r(!1,n,`focus`))})}}),[a,s.domReference,r,l]);return V(()=>c?{reference:h}:{},[c,h])}function Sf(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[td]:t,[nd]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[ed]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[td,nd].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Cf(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=z(t=>Sf(t,e,`reference`),t),a=z(t=>Sf(t,e,`floating`),n),o=z(t=>Sf(t,e,`item`),r);return V(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var wf=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Tf(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=md(),c=r.domReference?.id||s,l=V(()=>Cu(r.floating)?.id||i,[r.floating,i]),u=wf.get(o)??o,d=vd()!=null,f=V(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=V(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=z(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return V(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}var Ef=e=>e.replace(/[A-Z]+(?![a-z])|[A-Z]/g,(e,t)=>(t?`-`:``)+e.toLowerCase());function Df(e,t){return typeof e==`function`?e(t):e}function Of(e,t){let[n,r]=B(e);return e&&!n&&r(!0),O(()=>{if(!e&&n){let e=setTimeout(()=>r(!1),t);return()=>clearTimeout(e)}},[e,n,t]),n}function kf(e,t){t===void 0&&(t={});let{open:n,elements:{floating:r}}=e,{duration:i=250}=t,a=(typeof i==`number`?i:i.close)||0,[o,s]=B(`unmounted`),c=Of(n,a);return!c&&o===`close`&&s(`unmounted`),ju(()=>{if(r){if(n){s(`initial`);let e=requestAnimationFrame(()=>{C(()=>{s(`open`)})});return()=>{cancelAnimationFrame(e)}}s(`close`)}},[n,r]),{isMounted:c,status:o}}function Af(e,t){t===void 0&&(t={});let{initial:n={opacity:0},open:r,close:i,common:a,duration:o=250}=t,s=e.placement,c=s.split(`-`)[0],l=V(()=>({side:c,placement:s}),[c,s]),u=typeof o==`number`,d=(u?o:o.open)||0,f=(u?o:o.close)||0,[p,m]=B(()=>({...Df(a,l),...Df(n,l)})),{isMounted:h,status:g}=kf(e,{duration:o}),_=Nu(n),v=Nu(r),y=Nu(i),b=Nu(a);return ju(()=>{let e=Df(_.current,l),t=Df(y.current,l),n=Df(b.current,l),r=Df(v.current,l)||Object.keys(e).reduce((e,t)=>(e[t]=``,e),{});if(g===`initial`&&m(t=>({transitionProperty:t.transitionProperty,...n,...e})),g===`open`&&m({transitionProperty:Object.keys(r).map(Ef).join(`,`),transitionDuration:d+`ms`,...n,...r}),g===`close`){let r=t||e;m({transitionProperty:Object.keys(r).map(Ef).join(`,`),transitionDuration:f+`ms`,...n,...r})}},[f,y,_,v,b,d,g,l]),{isMounted:h,styles:p}}function jf(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...jf(e,t.id,n)])}function Mf(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e<a;o=e++){let[a,s]=t[e]||[0,0],[c,l]=t[o]||[0,0];s>=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Nf(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Pf(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){xd(i),u()}if(xd(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:h,clientY:g}=e,_=[h,g],v=kd(e),y=e.type===`mouseleave`,b=Od(c.floating,v),x=Od(c.domReference,v),S=c.domReference.getBoundingClientRect(),C=c.floating.getBoundingClientRect(),w=s.split(`-`)[0],T=n>C.right-C.width/2,E=o>C.bottom-C.height/2,D=Nf(_,S),O=C.width>S.width,k=C.height>S.height,A=(O?S:C).left,j=(O?S:C).right,M=(k?S:C).top,N=(k?S:C).bottom;if(b&&(a=!0,!y))return;if(x&&(a=!1),x&&!y){a=!0;return}if(y&&m(e.relatedTarget)&&Od(c.floating,e.relatedTarget)||f&&jf(f.nodesRef.current,d).length)return;if(w===`top`&&o>=S.bottom-1||w===`bottom`&&o<=S.top+1||w===`left`&&n>=S.right-1||w===`right`&&n<=S.left+1)return p();let P=[];switch(w){case`top`:P=[[A,S.top+1],[A,C.bottom-1],[j,C.bottom-1],[j,S.top+1]];break;case`bottom`:P=[[A,C.top+1],[A,S.bottom-1],[j,S.bottom-1],[j,C.top+1]];break;case`left`:P=[[C.right-1,N],[C.right-1,M],[S.left+1,M],[S.left+1,N]];break;case`right`:P=[[S.right-1,N],[S.right-1,M],[C.left+1,M],[C.left+1,N]]}function ee(e){let[n,r]=e;switch(w){case`top`:return[[O?n+t/2:T?n+t*4:n-t*4,r+t+1],[O?n-t/2:T?n+t*4:n-t*4,r+t+1],[C.left,T||O?C.bottom-t:C.top],[C.right,T?O?C.bottom-t:C.top:C.bottom-t]];case`bottom`:return[[O?n+t/2:T?n+t*4:n-t*4,r-t],[O?n-t/2:T?n+t*4:n-t*4,r-t],[C.left,T||O?C.top+t:C.bottom],[C.right,T?O?C.top+t:C.bottom:C.top+t]];case`left`:{let e=[n+t+1,k?r+t/2:E?r+t*4:r-t*4],i=[n+t+1,k?r-t/2:E?r+t*4:r-t*4];return[[E||k?C.right-t:C.left,C.top],[E?k?C.right-t:C.left:C.right-t,C.bottom],e,i]}case`right`:return[[n-t,k?r+t/2:E?r+t*4:r-t*4],[n-t,k?r-t/2:E?r+t*4:r-t*4],[E||k?C.left+t:C.right,C.top],[E?k?C.left+t:C.right:C.left+t,C.bottom]]}}if(!Mf([h,g],P)){if(a&&!D)return p();if(!y&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Mf([h,g],ee([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}h();var Ff=({className:e,style:t}={})=>ce(`iframe`,{src:Tr(),title:`Connect your FKN account`,className:e,style:{border:`none`,width:150,height:40,background:`transparent`,colorScheme:`normal`,...t}}),If=8e3,Lf=async(e,t=If)=>{let n,r=new Promise(e=>{n=setTimeout(()=>e(`timeout`),t)});try{return await Promise.race([Promise.resolve().then(e).then(()=>`settled`,()=>`settled`),r])}finally{clearTimeout(n)}},Rf=()=>Promise.race([Ce.info(),new Promise(e=>setTimeout(()=>e(null),4e3))]),zf=()=>{let[e,t]=B(null),[n,r]=B(!1),i=z(()=>Rf().then(e=>{t(e),r(!0)}).catch(()=>r(!0)),[]);return O(()=>{let e=!1,t=Ce.onChange(()=>{e||i()});i();let n=window.setInterval(()=>{e||i()},3e4);return()=>{e=!0,window.clearInterval(n),t.then(e=>e()).catch(()=>{})}},[i]),{info:e,ready:n,logout:z(async()=>{let e=await Lf(()=>Ce.logout());return await i(),e},[i])}},Bf={categoryBar:1,hoverCard:150,sourcePopup:300,filterMenu:500,mediaModal:1e3,header:1100,headerPopup:1150,franchiseDialog:1200,pluginPrompt:2e3,partyCursor:3e3};j();var Vf=`https://fkn.app/account`,Hf=150,Uf=40,Wf=x`
23
23
  display: flex;
24
24
  align-items: center;
25
25
  gap: 0.8rem;
@@ -68,8 +68,8 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
68
68
  .tier.free { color: rgba(255, 255, 255, 0.45); }
69
69
 
70
70
  .chevron { flex-shrink: 0; }
71
- `,Bf=x`
72
- z-index: ${Ff.headerPopup};
71
+ `,Gf=x`
72
+ z-index: ${Bf.headerPopup};
73
73
  display: flex;
74
74
  flex-direction: column;
75
75
  min-width: 18rem;
@@ -108,10 +108,10 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
108
108
 
109
109
  svg { flex-shrink: 0; }
110
110
  }
111
- `,Vf=x`
112
- width: ${Lf}px;
113
- height: ${Rf}px;
114
- `,Hf=()=>{let{info:e,ready:t,logout:n}=Pf(),[r,i]=B(!1),[a,o]=B(!1),{refs:s,floatingStyles:c,context:l}=mf({open:r,onOpenChange:i,placement:`bottom-end`,middleware:[Wu(8),Ku(),Gu({padding:8})],whileElementsMounted:_}),{getReferenceProps:u,getFloatingProps:d}=vf([cf(l),ff(l),bf(l,{role:`menu`})]);O(()=>{e||(i(!1),o(!1))},[e]);let f=async()=>{o(!0);try{await n()}finally{o(!1),i(!1)}};return t?e?k(H,{children:[k(`button`,{ref:s.setReference,css:zf,type:`button`,"aria-label":`FKN account: ${e.name||`Account`}`,...u(),children:[k(`span`,{className:`who`,children:[U(`span`,{className:`name`,children:e.name||`Account`}),U(`span`,{className:`tier ${e.premium?`premium`:`free`}`,children:e.premium?`Premium`:`Free`})]}),U(zc,{size:16,className:`chevron`})]}),r?U(Vd,{children:U(Qd,{context:l,modal:!1,children:k(`div`,{ref:s.setFloating,style:c,css:Bf,...d(),children:[k(`a`,{className:`item`,href:If,target:`_blank`,rel:`noreferrer`,children:[U(Uc,{size:16}),`Manage account`]}),k(`button`,{className:`item`,type:`button`,disabled:a,onClick:f,children:[U(Yc,{size:16}),a?`Disconnecting...`:`Disconnect`]})]})})}):void 0]}):U(Af,{style:{flex:`none`,width:Lf,height:Rf}}):U(`div`,{css:Vf})},Uf=new Set([`nav`,`scroll`,`cursor`,`playback`,`state`,`pong`]),Wf=e=>Uf.has(e.t),Gf=e=>e.trim().slice(0,500)||void 0,Kf=e=>e.trim().replace(/\s+/g,` `).slice(0,32)||void 0,qf=e=>JSON.stringify({v:1,...e}),Jf=e=>{let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;let n=t;if(n.v===1)switch(n.t){case`nav`:return Yf(n.path)?{t:`nav`,path:n.path}:void 0;case`scroll`:return Zf(n.y)?{t:`scroll`,y:n.y}:void 0;case`cursor`:return Zf(n.x)&&Zf(n.y)?{t:`cursor`,x:n.x,y:n.y}:void 0;case`chat`:{let e=typeof n.text==`string`?Gf(n.text):void 0;return e?{t:`chat`,text:e}:void 0}case`name`:{let e=typeof n.name==`string`?Kf(n.name):void 0;return e?{t:`name`,name:e}:void 0}case`ping`:return Xf(n.n)&&Xf(n.at)?{t:`ping`,n:n.n,at:n.at}:void 0;case`pong`:return Xf(n.n)&&Xf(n.at)&&Xf(n.host)?{t:`pong`,n:n.n,at:n.at,host:n.host}:void 0;case`playback`:return Qf(n.s)?{t:`playback`,s:n.s}:void 0;case`state`:return!Yf(n.path)||!Zf(n.y)||n.s!==void 0&&!Qf(n.s)?void 0:{t:`state`,path:n.path,y:n.y,...n.s?{s:n.s}:{}};default:return}},Yf=e=>typeof e==`string`&&e.length>0&&e.length<=2048&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!/[\r\n\t]/.test(e),Xf=e=>typeof e==`number`&&Number.isFinite(e),Zf=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1,Qf=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.paused==`boolean`&&typeof t.time==`number`&&Number.isFinite(t.time)&&t.time>=0&&typeof t.rate==`number`&&Number.isFinite(t.rate)&&t.rate>0&&t.rate<=16&&typeof t.at==`number`&&Number.isFinite(t.at)},$f=1.05,ep=5e3,tp=(e,t,n=!1)=>{if(e.paused)return e.time;let r=Math.max(t-e.at,0),i=(n?r:Math.min(r,np))/1e3;return e.time+i*e.rate},np=2e3,rp=(e,t,n,r=!1)=>{let i={},a=tp(t,n,r),o=a-e.time;Math.abs(o)>.5&&(i.seek=a),t.paused&&!e.paused&&(i.pause=!0),!t.paused&&e.paused&&(i.play=!0);let s=!t.paused&&i.seek===void 0&&Math.abs(o)>=.05?t.rate*(o>0?$f:1/$f):t.rate;return Math.abs(e.rate-s)>.001&&(i.rate=s),i},ip=(e,t,n)=>({...e,time:e.paused?e.time:e.time+Math.max(0,n-t)/1e3*e.rate,at:n}),ap=(e,t,n)=>({rtt:n-e,offset:t-(e+n)/2}),op=e=>e.length?e.reduce((e,t)=>t.rtt<e.rtt?t:e):void 0,sp=(e,t)=>e-t,cp=4e3,lp=`stub-party-invite`,up=`stub-party-name`,dp=1e4,fp=3e4,pp=6e4,mp=()=>{try{return globalThis.sessionStorage}catch{return}},hp=e=>e instanceof Error&&typeof e.code==`string`,gp=(e,t=mp())=>{let n={status:`idle`},r,i,a={path:`/`,y:0},o=new Set,s=new Set,c,l,u=new Map,d=new Map,f=[],p,m,h,g=new Map,_=1,v=(()=>{try{return t?.getItem(`stub-party-name`)??void 0}catch{return}})(),y=e=>{n=e;for(let e of o)e(n)},b=e=>{try{t?.setItem(lp,e)}catch{}},x=()=>{try{t?.removeItem(lp)}catch{}},S=()=>{try{return t?.getItem(`stub-party-invite`)??void 0}catch{return}},C=e=>e.owner===e.self.id?`host`:`guest`,w=(e,t)=>{for(let n of s)n(e,t)},T=async e=>{let t=await e.members().catch(()=>void 0);r===e&&n.status===`active`&&t&&y({...n,members:t.length})},E=e=>{r&&n.status===`active`&&(Wf(e)&&n.role!==`host`||r.send(qf(e)).catch(()=>{}))},D=()=>{if(!r||n.status!==`active`||n.role!==`guest`)return;let e=r,t=[];m=t;for(let n=0;n<5;n++)setTimeout(()=>{if(m!==t||r!==e)return;let n=Date.now(),i=_++;g.set(i,n),setTimeout(()=>g.delete(i),cp),E({t:`ping`,n:i,at:n})},n*400);setTimeout(()=>{if(m!==t||r!==e)return;m=void 0;let n=op(t);n&&(p=n)},2e3+cp)},O=()=>({t:`state`,path:a.path,y:a.y,...a.playback?{s:ip(a.playback,a.playbackAt??Date.now(),Date.now())}:{}}),k=()=>{let e=u.get(`state`),t=u.get(`scroll`);if(e?.t!==`state`||t?.t!==`scroll`)return e;let n=[...u.keys()];return n.indexOf(`scroll`)>n.indexOf(`state`)?{...e,y:t.y}:e},A=()=>{i?.(),i=void 0,r=void 0,c&&clearInterval(c),c=void 0,l&&clearInterval(l),l=void 0,h&&clearInterval(h),h=void 0,m=void 0,p=void 0,g.clear()},j=async e=>{r=e;let t=C(e);if(d.clear(),f.length=0,y({status:`active`,role:t,invite:e.invite,members:1,self:e.self.id,owner:e.owner}),b(e.invite),i=await e.on(n=>{if(r===e)switch(n.type){case`message`:{let r=Jf(n.message.text);if(!r)return;let i=n.message.from,a=i===e.self.id;if(r.t===`ping`){t===`host`&&!a&&E({t:`pong`,n:r.n,at:r.at,host:Date.now()});return}if(r.t===`pong`){if(t!==`guest`||i!==e.owner)return;let n=g.get(r.n);if(n===void 0||n!==r.at)return;g.delete(r.n);let a=ap(n,r.host,Date.now());if(a.rtt>4e3)return;m?.push(a),p||=a;return}if(Wf(r)){if(i!==e.owner||t===`host`)return;u.delete(r.t),u.set(r.t,r),w(r,{replayed:!1,from:i,self:a});return}r.t===`name`&&d.set(i,r.name),r.t===`chat`&&(f.push({seq:n.message.seq,from:i,name:d.get(i),text:r.text,at:n.message.at,self:a}),f.length>200&&f.splice(0,f.length-200)),w(r,{replayed:!1,from:i,self:a});return}case`joined`:t===`host`&&E(O()),v&&E({t:`name`,name:v}),T(e);return;case`left`:if(t===`guest`&&n.id===e.owner){M(`host-left`);return}T(e);return}}),r!==e){i(),i=void 0;return}t===`host`&&(c=setInterval(()=>E(O()),dp)),t===`guest`&&(D(),h=setInterval(D,pp)),l=setInterval(()=>{v&&E({t:`name`,name:v})},fp),v&&E({t:`name`,name:v}),T(e),e.closed.then(({reason:t})=>{r===e&&(A(),x(),y({status:`ended`,reason:t}))})},M=async e=>{let t=r;A(),x(),y({status:`ended`,reason:e}),await t?.leave().catch(()=>{})},N=(e,t)=>{if(x(),t){y({status:`idle`});return}y({status:`failed`,code:hp(e)?e.code:`unknown`})},P=async(e,t,n=!1)=>{r&&await M(`left`),u.clear(),y({status:`joining`,invite:e??``});try{let e=await t();await j(e)}catch(e){N(e,n)}};return{getState:()=>n,subscribe:e=>(o.add(e),()=>{o.delete(e)}),onMessage:e=>(s.add(e),()=>{s.delete(e)}),create:()=>P(void 0,()=>e.create()),join:t=>P(t,()=>e.join(t)),resume:async()=>{let t=S();t&&!r&&await P(t,()=>e.join(t),!0)},leave:async()=>{r&&await M(`left`)},send:E,setLocation:(e,t)=>{a.path=e,a.y=t},setPlayback:e=>{a.playback=e,a.playbackAt=Date.now()},invite:()=>n.status===`active`?n.invite:void 0,hostClock:()=>p,hostPath:()=>[...u.values()].filter(e=>`path`in e).at(-1)?.path,replay:()=>{for(let e of[`state`,`nav`,`scroll`,`playback`]){let t=e===`state`?k():u.get(e);t&&r&&w(t,{replayed:!0,from:r.owner,self:!1})}},nameOf:e=>d.get(e),roster:async()=>{if(!r)return[];let e=r;return(await e.members().catch(()=>[])).map(t=>({id:t.id,name:d.get(t.id),host:t.id===e.owner,self:t.id===e.self.id}))},chat:()=>f.slice(),setName:e=>{v=e;try{e?t?.setItem(up,e):t?.removeItem(up)}catch{}e&&E({t:`name`,name:e})},name:()=>v,kick:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.remove(e)},ban:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.block(e)},playing:()=>!(!a.playback||a.playback.paused),dismiss:()=>{(n.status===`ended`||n.status===`failed`)&&y({status:`idle`})}}},_p=`/party`,vp=(e,t)=>`${e}${_p}#${bp(e,t)}`,yp=(e,t)=>{let n=e.startsWith(`#`)?e.slice(1):e,r;try{r=decodeURIComponent(n).trim()}catch{return}if(Cp.test(r))return r;if(!wp.test(r))return;let i=r.indexOf(`.`),a=`${r.slice(0,i)}.${t}/${r.slice(i+1)}`;return Cp.test(a)?a:void 0},bp=(e,t)=>{let n=t.indexOf(`.`),r=t.slice(n+1),i=r.lastIndexOf(`/`);return i>0&&r.slice(0,i)===e?`${t.slice(0,n)}.${r.slice(i+1)}`:t},xp=`[A-Za-z0-9_-]{43}`,Sp=`[a-z0-9][a-z0-9._-]{0,63}`,Cp=RegExp(`^${xp}\\.[\\x21-\\x7e]{1,256}\\/${Sp}$`),wp=RegExp(`^${xp}\\.${Sp}$`),X=gp(De);j();var Tp=()=>{let[e,t]=B(X.getState);return O(()=>X.subscribe(t),[]),e},Ep=e=>{let[t]=B(()=>({current:e}));t.current=e,O(()=>X.onMessage((e,n)=>t.current(e,n)),[])};j();var Dp=x`
111
+ `,Kf=x`
112
+ width: ${Hf}px;
113
+ height: ${Uf}px;
114
+ `,qf=()=>{let{info:e,ready:t,logout:n}=zf(),[r,i]=B(!1),[a,o]=B(!1),{refs:s,floatingStyles:c,context:l}=yf({open:r,onOpenChange:i,placement:`bottom-end`,middleware:[Yu(8),Zu(),Xu({padding:8})],whileElementsMounted:_}),{getReferenceProps:u,getFloatingProps:d}=Cf([pf(l),_f(l),Tf(l,{role:`menu`})]);O(()=>{e||(i(!1),o(!1))},[e]);let f=async()=>{o(!0);try{await n()}finally{o(!1),i(!1)}};return t?e?k(H,{children:[k(`button`,{ref:s.setReference,css:Wf,type:`button`,"aria-label":`FKN account: ${e.name||`Account`}`,...u(),children:[k(`span`,{className:`who`,children:[U(`span`,{className:`name`,children:e.name||`Account`}),U(`span`,{className:`tier ${e.premium?`premium`:`free`}`,children:e.premium?`Premium`:`Free`})]}),U(Wc,{size:16,className:`chevron`})]}),r?U(Kd,{children:U(rf,{context:l,modal:!1,children:k(`div`,{ref:s.setFloating,style:c,css:Gf,...d(),children:[k(`a`,{className:`item`,href:Vf,target:`_blank`,rel:`noreferrer`,children:[U(Jc,{size:16}),`Manage account`]}),k(`button`,{className:`item`,type:`button`,disabled:a,onClick:f,children:[U(el,{size:16}),a?`Disconnecting...`:`Disconnect`]})]})})}):void 0]}):U(Ff,{style:{flex:`none`,width:Hf,height:Uf}}):U(`div`,{css:Kf})},Jf=new Set([`nav`,`scroll`,`cursor`,`playback`,`state`,`pong`]),Yf=e=>Jf.has(e.t),Xf=e=>e.trim().slice(0,500)||void 0,Zf=e=>e.trim().replace(/\s+/g,` `).slice(0,32)||void 0,Qf=e=>JSON.stringify({v:1,...e}),$f=e=>{let t;try{t=JSON.parse(e)}catch{return}if(!t||typeof t!=`object`)return;let n=t;if(n.v===1)switch(n.t){case`nav`:return ep(n.path)?{t:`nav`,path:n.path}:void 0;case`scroll`:return np(n.y)?{t:`scroll`,y:n.y}:void 0;case`cursor`:return np(n.x)&&np(n.y)?{t:`cursor`,x:n.x,y:n.y}:void 0;case`chat`:{let e=typeof n.text==`string`?Xf(n.text):void 0;return e?{t:`chat`,text:e}:void 0}case`name`:{let e=typeof n.name==`string`?Zf(n.name):void 0;return e?{t:`name`,name:e}:void 0}case`ping`:return tp(n.n)&&tp(n.at)?{t:`ping`,n:n.n,at:n.at}:void 0;case`pong`:return tp(n.n)&&tp(n.at)&&tp(n.host)?{t:`pong`,n:n.n,at:n.at,host:n.host}:void 0;case`playback`:return rp(n.s)?{t:`playback`,s:n.s}:void 0;case`state`:return!ep(n.path)||!np(n.y)||n.s!==void 0&&!rp(n.s)?void 0:{t:`state`,path:n.path,y:n.y,...n.s?{s:n.s}:{}};default:return}},ep=e=>typeof e==`string`&&e.length>0&&e.length<=2048&&e.startsWith(`/`)&&!e.startsWith(`//`)&&!e.startsWith(`/\\`)&&!/[\r\n\t]/.test(e),tp=e=>typeof e==`number`&&Number.isFinite(e),np=e=>typeof e==`number`&&Number.isFinite(e)&&e>=0&&e<=1,rp=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.paused==`boolean`&&typeof t.time==`number`&&Number.isFinite(t.time)&&t.time>=0&&typeof t.rate==`number`&&Number.isFinite(t.rate)&&t.rate>0&&t.rate<=16&&typeof t.at==`number`&&Number.isFinite(t.at)},ip=1.05,ap=5e3,op=(e,t,n=!1)=>{if(e.paused)return e.time;let r=Math.max(t-e.at,0),i=(n?r:Math.min(r,sp))/1e3;return e.time+i*e.rate},sp=2e3,cp=(e,t,n,r=!1)=>{let i={},a=op(t,n,r),o=a-e.time;Math.abs(o)>.5&&(i.seek=a),t.paused&&!e.paused&&(i.pause=!0),!t.paused&&e.paused&&(i.play=!0);let s=!t.paused&&i.seek===void 0&&Math.abs(o)>=.05?t.rate*(o>0?ip:1/ip):t.rate;return Math.abs(e.rate-s)>.001&&(i.rate=s),i},lp=(e,t,n)=>({...e,time:e.paused?e.time:e.time+Math.max(0,n-t)/1e3*e.rate,at:n}),up=(e,t,n)=>({rtt:n-e,offset:t-(e+n)/2}),dp=e=>e.length?e.reduce((e,t)=>t.rtt<e.rtt?t:e):void 0,fp=(e,t)=>e-t,pp=4e3,mp=`stub-party-invite`,hp=`stub-party-name`,gp=1e4,_p=3e4,vp=6e4,yp=()=>{try{return globalThis.sessionStorage}catch{return}},bp=e=>e instanceof Error&&typeof e.code==`string`,xp=(e,t=yp())=>{let n={status:`idle`},r,i,a={path:`/`,y:0},o=new Set,s=new Set,c,l,u=new Map,d=new Map,f=[],p,m,h,g=new Map,_=1,v=(()=>{try{return t?.getItem(`stub-party-name`)??void 0}catch{return}})(),y=e=>{n=e;for(let e of o)e(n)},b=e=>{try{t?.setItem(mp,e)}catch{}},x=()=>{try{t?.removeItem(mp)}catch{}},S=()=>{try{return t?.getItem(`stub-party-invite`)??void 0}catch{return}},C=e=>e.owner===e.self.id?`host`:`guest`,w=(e,t)=>{for(let n of s)n(e,t)},T=async e=>{let t=await e.members().catch(()=>void 0);r===e&&n.status===`active`&&t&&y({...n,members:t.length})},E=e=>{r&&n.status===`active`&&(Yf(e)&&n.role!==`host`||r.send(Qf(e)).catch(()=>{}))},D=()=>{if(!r||n.status!==`active`||n.role!==`guest`)return;let e=r,t=[];m=t;for(let n=0;n<5;n++)setTimeout(()=>{if(m!==t||r!==e)return;let n=Date.now(),i=_++;g.set(i,n),setTimeout(()=>g.delete(i),pp),E({t:`ping`,n:i,at:n})},n*400);setTimeout(()=>{if(m!==t||r!==e)return;m=void 0;let n=dp(t);n&&(p=n)},2e3+pp)},O=()=>({t:`state`,path:a.path,y:a.y,...a.playback?{s:lp(a.playback,a.playbackAt??Date.now(),Date.now())}:{}}),k=()=>{let e=u.get(`state`),t=u.get(`scroll`);if(e?.t!==`state`||t?.t!==`scroll`)return e;let n=[...u.keys()];return n.indexOf(`scroll`)>n.indexOf(`state`)?{...e,y:t.y}:e},A=()=>{i?.(),i=void 0,r=void 0,c&&clearInterval(c),c=void 0,l&&clearInterval(l),l=void 0,h&&clearInterval(h),h=void 0,m=void 0,p=void 0,g.clear()},j=async e=>{r=e;let t=C(e);if(d.clear(),f.length=0,y({status:`active`,role:t,invite:e.invite,members:1,self:e.self.id,owner:e.owner}),b(e.invite),i=await e.on(n=>{if(r===e)switch(n.type){case`message`:{let r=$f(n.message.text);if(!r)return;let i=n.message.from,a=i===e.self.id;if(r.t===`ping`){t===`host`&&!a&&E({t:`pong`,n:r.n,at:r.at,host:Date.now()});return}if(r.t===`pong`){if(t!==`guest`||i!==e.owner)return;let n=g.get(r.n);if(n===void 0||n!==r.at)return;g.delete(r.n);let a=up(n,r.host,Date.now());if(a.rtt>4e3)return;m?.push(a),p||=a;return}if(Yf(r)){if(i!==e.owner||t===`host`)return;u.delete(r.t),u.set(r.t,r),w(r,{replayed:!1,from:i,self:a});return}r.t===`name`&&d.set(i,r.name),r.t===`chat`&&(f.push({seq:n.message.seq,from:i,name:d.get(i),text:r.text,at:n.message.at,self:a}),f.length>200&&f.splice(0,f.length-200)),w(r,{replayed:!1,from:i,self:a});return}case`joined`:t===`host`&&E(O()),v&&E({t:`name`,name:v}),T(e);return;case`left`:if(t===`guest`&&n.id===e.owner){M(`host-left`);return}T(e);return}}),r!==e){i(),i=void 0;return}t===`host`&&(c=setInterval(()=>E(O()),gp)),t===`guest`&&(D(),h=setInterval(D,vp)),l=setInterval(()=>{v&&E({t:`name`,name:v})},_p),v&&E({t:`name`,name:v}),T(e),e.closed.then(({reason:t})=>{r===e&&(A(),x(),y({status:`ended`,reason:t}))})},M=async e=>{let t=r;A(),x(),y({status:`ended`,reason:e}),await t?.leave().catch(()=>{})},N=(e,t)=>{if(x(),t){y({status:`idle`});return}y({status:`failed`,code:bp(e)?e.code:`unknown`})},P=async(e,t,n=!1)=>{r&&await M(`left`),u.clear(),y({status:`joining`,invite:e??``});try{let e=await t();await j(e)}catch(e){N(e,n)}};return{getState:()=>n,subscribe:e=>(o.add(e),()=>{o.delete(e)}),onMessage:e=>(s.add(e),()=>{s.delete(e)}),create:()=>P(void 0,()=>e.create()),join:t=>P(t,()=>e.join(t)),resume:async()=>{let t=S();t&&!r&&await P(t,()=>e.join(t),!0)},leave:async()=>{r&&await M(`left`)},send:E,setLocation:(e,t)=>{a.path=e,a.y=t},setPlayback:e=>{a.playback=e,a.playbackAt=Date.now()},invite:()=>n.status===`active`?n.invite:void 0,hostClock:()=>p,hostPath:()=>[...u.values()].filter(e=>`path`in e).at(-1)?.path,replay:()=>{for(let e of[`state`,`nav`,`scroll`,`playback`]){let t=e===`state`?k():u.get(e);t&&r&&w(t,{replayed:!0,from:r.owner,self:!1})}},nameOf:e=>d.get(e),roster:async()=>{if(!r)return[];let e=r;return(await e.members().catch(()=>[])).map(t=>({id:t.id,name:d.get(t.id),host:t.id===e.owner,self:t.id===e.self.id}))},chat:()=>f.slice(),setName:e=>{v=e;try{e?t?.setItem(hp,e):t?.removeItem(hp)}catch{}e&&E({t:`name`,name:e})},name:()=>v,kick:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.remove(e)},ban:async e=>{r&&n.status===`active`&&n.role===`host`&&await r.block(e)},playing:()=>!(!a.playback||a.playback.paused),dismiss:()=>{(n.status===`ended`||n.status===`failed`)&&y({status:`idle`})}}},Sp=`/party`,Cp=(e,t)=>`${e}${Sp}#${Tp(e,t)}`,wp=(e,t)=>{let n=e.startsWith(`#`)?e.slice(1):e,r;try{r=decodeURIComponent(n).trim()}catch{return}if(Op.test(r))return r;if(!kp.test(r))return;let i=r.indexOf(`.`),a=`${r.slice(0,i)}.${t}/${r.slice(i+1)}`;return Op.test(a)?a:void 0},Tp=(e,t)=>{let n=t.indexOf(`.`),r=t.slice(n+1),i=r.lastIndexOf(`/`);return i>0&&r.slice(0,i)===e?`${t.slice(0,n)}.${r.slice(i+1)}`:t},Ep=`[A-Za-z0-9_-]{43}`,Dp=`[a-z0-9][a-z0-9._-]{0,63}`,Op=RegExp(`^${Ep}\\.[\\x21-\\x7e]{1,256}\\/${Dp}$`),kp=RegExp(`^${Ep}\\.${Dp}$`),X=xp(De);j();var Ap=()=>{let[e,t]=B(X.getState);return O(()=>X.subscribe(t),[]),e},jp=e=>{let[t]=B(()=>({current:e}));t.current=e,O(()=>X.onMessage((e,n)=>t.current(e,n)),[])};j();var Mp=x`
115
115
  display: flex;
116
116
  align-items: center;
117
117
  gap: 0.6rem;
@@ -156,7 +156,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
156
156
  padding: 0 1rem;
157
157
  .label { display: none; }
158
158
  }
159
- `,Op=x`
159
+ `,Np=x`
160
160
  width: 30rem;
161
161
  padding: 1.2rem;
162
162
  border-radius: 0.8rem;
@@ -165,7 +165,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
165
165
  color: rgba(255, 255, 255, 0.85);
166
166
  font-size: 1.3rem;
167
167
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
168
- z-index: ${Ff.headerPopup};
168
+ z-index: ${Bf.headerPopup};
169
169
 
170
170
  .title {
171
171
  font-size: 1.4rem;
@@ -222,7 +222,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
222
222
 
223
223
  button:hover { border-color: rgba(255, 255, 255, 0.4); color: #fff; }
224
224
  button.primary { background: rgba(255, 255, 255, 0.1); }
225
- `,kp={"not-found":`That party has ended.`,"bad-key":`That invite link is not valid.`,invalid:`That invite link is broken.`,full:`That party is full.`,blocked:`You cannot join that party.`,unavailable:`Parties are not available right now. Is FKN connected?`,"rate-limited":`Too many attempts. Try again in a moment.`},Ap={"host-left":`The host left the party.`,removed:`You were removed from the party.`,blocked:`You were removed from the party.`,ended:`The party ended.`,unavailable:`The party was lost. Parties are unavailable right now.`,left:`You left the party.`},jp=()=>{let e=Tp(),[t,n]=B(!1),[r,i]=B(!1),[,a]=qo(),o=()=>{n(!1),a(cs(J.PARTY))},{refs:s,floatingStyles:c,context:l}=mf({open:t,onOpenChange:n,placement:`bottom-end`,whileElementsMounted:_,middleware:[Wu(8),Ku(),Gu({padding:12})]}),{getReferenceProps:u,getFloatingProps:d}=vf([cf(l),ff(l),bf(l,{role:`dialog`})]);O(()=>{if(!r)return;let e=setTimeout(()=>i(!1),1500);return()=>clearTimeout(e)},[r]),O(()=>{(e.status===`ended`||e.status===`failed`)&&n(!0)},[e.status]);let f=e.status===`active`?vp(location.origin,e.invite):void 0,p=async()=>{if(f)try{await navigator.clipboard.writeText(f),i(!0)}catch{}};if(e.status===`idle`)return k(`button`,{type:`button`,css:Dp,onClick:()=>{X.create()},title:`Watch together`,children:[U(ul,{size:16}),U(`span`,{className:`label`,children:`Watch together`})]});let m=e.status===`active`,h=e.status===`joining`?`Joining…`:e.status===`active`?e.role===`host`?`Hosting`:`Following`:e.status===`ended`?`Party over`:`Party failed`;return k(H,{children:[k(`button`,{type:`button`,ref:s.setReference,css:Dp,className:m?`live`:e.status===`joining`?void 0:`over`,...u(),children:[m&&e.role===`host`?U(rl,{size:16}):U(ul,{size:16}),U(`span`,{className:`label`,children:h}),m&&U(`span`,{className:`count`,children:e.members})]}),t&&U(Vd,{children:U(Qd,{context:l,modal:!1,children:k(`div`,{ref:s.setFloating,css:Op,style:c,...d(),children:[e.status===`joining`&&U(`div`,{className:`title`,children:`Joining the party…`}),e.status===`active`&&e.role===`host`&&k(H,{children:[U(`div`,{className:`title`,children:`You are hosting`}),k(`div`,{className:`hint`,children:[e.members===1?`Nobody has joined yet.`:`${e.members-1} ${e.members===2?`person is`:`people are`} following you.`,` `,`Everyone who opens this link follows you around and watches what you play.`]}),k(`div`,{className:`link`,children:[U(`input`,{readOnly:!0,value:f,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),U(`button`,{type:`button`,onClick:()=>{p()},"aria-label":`Copy invite link`,children:U(r?Rc:Hc,{size:14})})]}),k(`div`,{className:`actions`,children:[k(`button`,{type:`button`,className:`primary`,onClick:o,children:[U(ul,{size:14}),` Party`]}),k(`button`,{type:`button`,onClick:()=>{X.leave(),n(!1)},children:[U(Yc,{size:14}),` End party`]})]})]}),e.status===`active`&&e.role===`guest`&&k(H,{children:[U(`div`,{className:`title`,children:`You are following the host`}),k(`div`,{className:`hint`,children:[e.members,` in the party. The host decides where the party goes and what plays. Wander off if you like, and catch up when you want back.`]}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`primary`,onClick:()=>{X.replay(),n(!1)},children:`Catch up`}),k(`button`,{type:`button`,onClick:o,children:[U(ul,{size:14}),` Party`]}),k(`button`,{type:`button`,onClick:()=>{X.leave(),n(!1)},children:[U(Yc,{size:14}),` Leave`]})]})]}),(e.status===`ended`||e.status===`failed`)&&k(H,{children:[U(`div`,{className:`title`,children:e.status===`ended`?Ap[e.reason]??`The party ended.`:kp[e.code]??`The party could not start.`}),U(`div`,{className:`actions`,children:U(`button`,{type:`button`,className:`primary`,onClick:()=>{X.dismiss(),n(!1)},children:`OK`})})]})]})})})]})};j();var Mp=x`
225
+ `,Pp={"not-found":`That party has ended.`,"bad-key":`That invite link is not valid.`,invalid:`That invite link is broken.`,full:`That party is full.`,blocked:`You cannot join that party.`,unavailable:`Parties are not available right now. Is FKN connected?`,"rate-limited":`Too many attempts. Try again in a moment.`},Fp={"host-left":`The host left the party.`,removed:`You were removed from the party.`,blocked:`You were removed from the party.`,ended:`The party ended.`,unavailable:`The party was lost. Parties are unavailable right now.`,left:`You left the party.`},Ip=()=>{let e=Ap(),[t,n]=B(!1),[r,i]=B(!1),[,a]=Qo(),o=()=>{n(!1),a(ps(J.PARTY))},{refs:s,floatingStyles:c,context:l}=yf({open:t,onOpenChange:n,placement:`bottom-end`,whileElementsMounted:_,middleware:[Yu(8),Zu(),Xu({padding:12})]}),{getReferenceProps:u,getFloatingProps:d}=Cf([pf(l),_f(l),Tf(l,{role:`dialog`})]);O(()=>{if(!r)return;let e=setTimeout(()=>i(!1),1500);return()=>clearTimeout(e)},[r]),O(()=>{(e.status===`ended`||e.status===`failed`)&&n(!0)},[e.status]);let f=e.status===`active`?Cp(location.origin,e.invite):void 0,p=async()=>{if(f)try{await navigator.clipboard.writeText(f),i(!0)}catch{}};if(e.status===`idle`)return k(`button`,{type:`button`,css:Mp,onClick:()=>{X.create()},title:`Watch together`,children:[U(hl,{size:16}),U(`span`,{className:`label`,children:`Watch together`})]});let m=e.status===`active`,h=e.status===`joining`?`Joining…`:e.status===`active`?e.role===`host`?`Hosting`:`Following`:e.status===`ended`?`Party over`:`Party failed`;return k(H,{children:[k(`button`,{type:`button`,ref:s.setReference,css:Mp,className:m?`live`:e.status===`joining`?void 0:`over`,...u(),children:[m&&e.role===`host`?U(cl,{size:16}):U(hl,{size:16}),U(`span`,{className:`label`,children:h}),m&&U(`span`,{className:`count`,children:e.members})]}),t&&U(Kd,{children:U(rf,{context:l,modal:!1,children:k(`div`,{ref:s.setFloating,css:Np,style:c,...d(),children:[e.status===`joining`&&U(`div`,{className:`title`,children:`Joining the party…`}),e.status===`active`&&e.role===`host`&&k(H,{children:[U(`div`,{className:`title`,children:`You are hosting`}),k(`div`,{className:`hint`,children:[e.members===1?`Nobody has joined yet.`:`${e.members-1} ${e.members===2?`person is`:`people are`} following you.`,` `,`Everyone who opens this link follows you around and watches what you play.`]}),k(`div`,{className:`link`,children:[U(`input`,{readOnly:!0,value:f,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),U(`button`,{type:`button`,onClick:()=>{p()},"aria-label":`Copy invite link`,children:U(r?Uc:qc,{size:14})})]}),k(`div`,{className:`actions`,children:[k(`button`,{type:`button`,className:`primary`,onClick:o,children:[U(hl,{size:14}),` Party`]}),k(`button`,{type:`button`,onClick:()=>{X.leave(),n(!1)},children:[U(el,{size:14}),` End party`]})]})]}),e.status===`active`&&e.role===`guest`&&k(H,{children:[U(`div`,{className:`title`,children:`You are following the host`}),k(`div`,{className:`hint`,children:[e.members,` in the party. The host decides where the party goes and what plays. Wander off if you like, and catch up when you want back.`]}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`primary`,onClick:()=>{X.replay(),n(!1)},children:`Catch up`}),k(`button`,{type:`button`,onClick:o,children:[U(hl,{size:14}),` Party`]}),k(`button`,{type:`button`,onClick:()=>{X.leave(),n(!1)},children:[U(el,{size:14}),` Leave`]})]})]}),(e.status===`ended`||e.status===`failed`)&&k(H,{children:[U(`div`,{className:`title`,children:e.status===`ended`?Fp[e.reason]??`The party ended.`:Pp[e.code]??`The party could not start.`}),U(`div`,{className:`actions`,children:U(`button`,{type:`button`,className:`primary`,onClick:()=>{X.dismiss(),n(!1)},children:`OK`})})]})]})})})]})};j();var Lp=x`
226
226
  position: fixed;
227
227
  /* the FKN broker's docked bar reserves the page's top strip with a root margin, which cannot
228
228
  move a fixed element; the variable is its half of the contract and reads 0 everywhere else */
@@ -231,7 +231,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
231
231
  right: 0;
232
232
  /* the bar itself; what its controls OPEN is layer.headerPopup, since a portalled menu inherits
233
233
  nothing from this one */
234
- z-index: ${Ff.header};
234
+ z-index: ${Bf.header};
235
235
  /* three tracks rather than a flex row: the search field stays centred on the VIEWPORT whatever the
236
236
  wordmark and the action cluster happen to measure, which auto margins on a flex item cannot promise */
237
237
  display: grid;
@@ -378,7 +378,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
378
378
  }
379
379
  }
380
380
  }
381
- `,Np=()=>{let[,e]=qo(),[t]=Xo(ss(J.LOGIN_CALLBACK)),[n]=Xo(ss(J.WATCH)),r=Js(Jo()),i=r.query,a=R(r);a.current=r;let[o,s]=B(i),c=R(null),l=R(void 0);O(()=>{document.activeElement!==c.current&&i!==o&&s(i)},[i]);let u=(t,n)=>{let r=t.trim();r&&e(Qs({...a.current,query:r}),{replace:n})};return t?null:k(`header`,{css:Mp,className:n?`docked`:void 0,children:[U(ts,{to:cs(J.HOME),className:`logo`,onClick:Cl,children:`stub`}),k(`form`,{className:`search`,onSubmit:e=>{e.preventDefault(),l.current&&clearTimeout(l.current),u(o,!1),c.current?.blur()},children:[U(il,{size:20}),U(`input`,{ref:c,type:`text`,value:o,placeholder:`Search anime, shows, movies…`,"aria-label":`Search`,onInput:e=>{let t=e.currentTarget.value;s(t),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>u(t,!0),350)}})]}),k(`div`,{className:`actions`,children:[U(jp,{}),U(ts,{to:cs(J.SETTINGS),className:`icon-button`,"aria-label":`Settings`,title:`Settings`,children:U(ol,{size:20})}),U(Hf,{})]})]})},Pp=x`
381
+ `,Rp=()=>{let[,e]=Qo(),[t]=ts(fs(J.LOGIN_CALLBACK)),[n]=ts(fs(J.WATCH)),r=$s($o()),i=r.query,a=R(r);a.current=r;let[o,s]=B(i),c=R(null),l=R(void 0);O(()=>{document.activeElement!==c.current&&i!==o&&s(i)},[i]);let u=(t,n)=>{let r=t.trim();r&&e(rc({...a.current,query:r}),{replace:n})};return t?null:k(`header`,{css:Lp,className:n?`docked`:void 0,children:[U(os,{to:ps(J.HOME),className:`logo`,onClick:Ol,children:`stub`}),k(`form`,{className:`search`,onSubmit:e=>{e.preventDefault(),l.current&&clearTimeout(l.current),u(o,!1),c.current?.blur()},children:[U(ll,{size:20}),U(`input`,{ref:c,type:`text`,value:o,placeholder:`Search anime, shows, movies…`,"aria-label":`Search`,onInput:e=>{let t=e.currentTarget.value;s(t),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>u(t,!0),350)}})]}),k(`div`,{className:`actions`,children:[U(Ip,{}),U(os,{to:ps(J.SETTINGS),className:`icon-button`,"aria-label":`Settings`,title:`Settings`,children:U(dl,{size:20})}),U(qf,{})]})]})},zp=x`
382
382
  display: flex;
383
383
  align-items: center;
384
384
  gap: 2rem;
@@ -424,12 +424,12 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
424
424
  gap: 1.2rem;
425
425
  padding: 2rem 1.5rem;
426
426
  }
427
- `,Fp=()=>{let[e]=Xo(ss(J.WATCH)),[t]=Xo(ss(J.LOGIN_CALLBACK));return e||t?null:k(`footer`,{css:Pp,children:[U(ts,{to:cs(J.HOME),className:`wordmark`,onClick:Cl,children:`stub`}),U(ts,{to:cs(J.LEGAL),className:`nav-link`,children:`Legal`}),U(ts,{to:cs(J.PRIVACY),className:`nav-link`,children:`Privacy`}),k(`span`,{className:`version`,title:`stub v0.0.48, commit 754c8e1`,children:[`v`,`0.0.48`,` `,U(`span`,{className:`commit`,children:`754c8e1`})]})]})};j();var Ip=x`
427
+ `,Bp=()=>{let[e]=ts(fs(J.WATCH)),[t]=ts(fs(J.LOGIN_CALLBACK));return e||t?null:k(`footer`,{css:zp,children:[U(os,{to:ps(J.HOME),className:`wordmark`,onClick:Ol,children:`stub`}),U(os,{to:ps(J.LEGAL),className:`nav-link`,children:`Legal`}),U(os,{to:ps(J.PRIVACY),className:`nav-link`,children:`Privacy`}),k(`span`,{className:`version`,title:`stub v0.0.50, commit 9098dbc`,children:[`v`,`0.0.50`,` `,U(`span`,{className:`commit`,children:`9098dbc`})]})]})};j();var Vp=x`
428
428
  position: fixed;
429
429
  inset: 0;
430
430
  /* a sibling of the modal's portal rather than a child of it, so it competes at the root and 200
431
431
  put it behind the modal on any /media route */
432
- z-index: ${Ff.pluginPrompt};
432
+ z-index: ${Bf.pluginPrompt};
433
433
  display: flex;
434
434
  align-items: center;
435
435
  justify-content: center;
@@ -529,7 +529,7 @@ https://bit.ly/2XbVrpR#`;function Ei(e,t,n){if(!e){var r=t||`Minfied Error #`+n+
529
529
  color: inherit;
530
530
  font-weight: 400;
531
531
  }
532
- `,Lp=e=>e.state===`installing`?`adding…`:e.state===`error`?e.error??`failed`:``,Rp=()=>{let[e,t]=B(vc);if(O(()=>(t(vc()),_c(()=>t(vc()))),[]),!e.length)return null;let n=e.some(e=>e.state===`installing`);return U(`div`,{css:Ip,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`plugin-prompt-title`,children:k(`div`,{className:`dialog`,children:[U(`h2`,{id:`plugin-prompt-title`,children:e.length>1?`Add these sources?`:`Add this source?`}),k(`p`,{className:`intro`,children:[`This link was shared with `,e.length>1?`sources`:`a source`,` you have not added.`,` `,`Sources are community-made, installed through FKN, and run isolated from stub.`]}),U(`div`,{className:`list`,children:e.map(e=>k(`div`,{className:`invite`,children:[U(`span`,{className:`uri`,children:e.uri}),U(`span`,{className:`state${e.state===`error`?` error`:``}`,children:Lp(e)}),e.state===`error`&&U(`button`,{type:`button`,className:`dismiss`,onClick:()=>Cc(e.uri),children:`Dismiss`})]},e.uri))}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`decline`,disabled:n,onClick:()=>xc(),children:`Not now`}),U(`button`,{type:`button`,disabled:n,onClick:()=>{Sc()},children:e.length>1?`Add sources`:`Add source`})]})]})})},zp={"\n subscription MediaTracking($input: TrackingInput!) {\n tracking(input: $input) {\n _id\n disagreements\n summary {\n _id\n status\n progress\n score\n episodeCount\n }\n answers {\n _id\n state\n candidates\n error\n episodeCount\n tracker {\n id\n name\n icon\n color\n canWrite\n account\n scoreScale\n writeNotice\n }\n entry {\n _id\n status\n progress\n score\n episodeCount\n }\n }\n }\n }\n":ys,"\n mutation SaveListEntry($input: SaveListEntryInput!) {\n saveListEntry(input: $input) {\n tracker\n outcome\n error\n entry {\n _id\n status\n progress\n score\n episodeCount\n }\n }\n }\n":bs,"\n mutation DeleteListEntry($input: DeleteListEntryInput!) {\n deleteListEntry(input: $input) {\n tracker\n outcome\n error\n }\n }\n":xs,"\n subscription StubTrackerStorage {\n stubTrackerStorage {\n location\n signedIn\n locked\n waiting\n held\n error\n }\n }\n":Ss,"\n mutation AddHeldStubEntries {\n addHeldStubEntries {\n location\n signedIn\n locked\n waiting\n held\n error\n }\n }\n":Cs,"\n subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n }\n }\n }\n":ws,"\n subscription GetMediaModal($input: MediaInput!, $descriptionInput: MediaDescriptionInput!) {\n media(input: $input) {\n ...MediaFragment\n titles {\n language\n title\n score\n }\n descriptions(input: $descriptionInput) {\n language\n description\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n categories\n franchise {\n nodes {\n uri\n format\n status\n episodeCount\n startDate\n titles {\n title\n }\n }\n edges {\n from\n to\n relation\n }\n }\n relations {\n relation\n format\n node {\n _id\n uri\n origin\n id\n url\n status\n episodeCount\n startDate\n titles {\n title\n }\n covers {\n url\n color\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodeCount\n }\n }\n":Ts,"\n subscription GetMediaModalOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n ...OriginFragment\n }\n }\n }\n":Es,"\n subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n color\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n genres\n tags\n averageScore\n status\n type\n season\n seasonYear\n nextAiringEpisode {\n episodeNumber\n airingAt\n }\n }\n }\n }\n":Ds,"\n subscription GetWatchMedia($input: MediaInput!) {\n media(input: $input) {\n _id\n uri\n origin\n id\n titles {\n title\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n titles {\n title\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n embedUrl\n mediaUri\n episodeNumber\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n }\n }\n }\n }\n }\n":Os,"\n subscription GetWatchOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n }\n }\n":ks,"\n fragment EpisodeFragment on Episode {\n _id\n uri\n origin\n id\n url\n mediaUri\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n mediaUri\n }\n }\n }\n":gs,"\n fragment MediaFragment on Media {\n _id\n uri\n origin\n id\n url\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n }\n }\n }\n":_s,"\n fragment OriginFragment on Origin {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n":vs};function Bp(e){return zp[e]??{}}var Vp=e=>{let t;try{t=new URL(e)}catch{return null}let n=t.hostname.replace(/^(?:www|m)\./,``);return n===`youtu.be`?t.pathname.split(`/`)[1]||null:n!==`youtube.com`&&n!==`youtube-nocookie.com`?null:t.pathname===`/watch`?t.searchParams.get(`v`)||null:t.pathname.match(/^\/(?:embed|v|shorts)\/([^/?#]+)/)?.[1]??null};h();var Hp=`https://www.youtube.com`,Up=0,Wp=250,Gp=40,Kp=x`
532
+ `,Hp=e=>e.state===`installing`?`adding…`:e.state===`error`?e.error??`failed`:``,Up=()=>{let[e,t]=B(Cc);if(O(()=>(t(Cc()),Sc(()=>t(Cc()))),[]),!e.length)return null;let n=e.some(e=>e.state===`installing`);return U(`div`,{css:Vp,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`plugin-prompt-title`,children:k(`div`,{className:`dialog`,children:[U(`h2`,{id:`plugin-prompt-title`,children:e.length>1?`Add these sources?`:`Add this source?`}),k(`p`,{className:`intro`,children:[`This link was shared with `,e.length>1?`sources`:`a source`,` you have not added.`,` `,`Sources are community-made, installed through FKN, and run isolated from stub.`]}),U(`div`,{className:`list`,children:e.map(e=>k(`div`,{className:`invite`,children:[U(`span`,{className:`uri`,children:e.uri}),U(`span`,{className:`state${e.state===`error`?` error`:``}`,children:Hp(e)}),e.state===`error`&&U(`button`,{type:`button`,className:`dismiss`,onClick:()=>Oc(e.uri),children:`Dismiss`})]},e.uri))}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`decline`,disabled:n,onClick:()=>Ec(),children:`Not now`}),U(`button`,{type:`button`,disabled:n,onClick:()=>{Dc()},children:e.length>1?`Add sources`:`Add source`})]})]})})},Wp={"\n subscription MediaTracking($input: TrackingInput!) {\n tracking(input: $input) {\n _id\n disagreements\n summary {\n _id\n status\n progress\n score\n episodeCount\n }\n answers {\n _id\n state\n candidates\n error\n episodeCount\n tracker {\n id\n name\n icon\n color\n canWrite\n account\n scoreScale\n writeNotice\n }\n entry {\n _id\n status\n progress\n score\n episodeCount\n }\n }\n }\n }\n":ws,"\n mutation SaveListEntry($input: SaveListEntryInput!) {\n saveListEntry(input: $input) {\n tracker\n outcome\n error\n entry {\n _id\n status\n progress\n score\n episodeCount\n }\n }\n }\n":Ts,"\n mutation DeleteListEntry($input: DeleteListEntryInput!) {\n deleteListEntry(input: $input) {\n tracker\n outcome\n error\n }\n }\n":Es,"\n subscription StubTrackerStorage {\n stubTrackerStorage {\n location\n signedIn\n locked\n waiting\n held\n error\n }\n }\n":Ds,"\n mutation AddHeldStubEntries {\n addHeldStubEntries {\n location\n signedIn\n locked\n waiting\n held\n error\n }\n }\n":Os,"\n subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n }\n }\n }\n":ks,"\n subscription GetMediaModal($input: MediaInput!, $descriptionInput: MediaDescriptionInput!) {\n media(input: $input) {\n ...MediaFragment\n titles {\n language\n title\n score\n }\n descriptions(input: $descriptionInput) {\n language\n description\n }\n covers {\n language\n url\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n categories\n franchise {\n nodes {\n uri\n format\n status\n episodeCount\n startDate\n titles {\n title\n }\n }\n edges {\n from\n to\n relation\n }\n }\n relations {\n relation\n format\n node {\n _id\n uri\n origin\n id\n url\n status\n episodeCount\n startDate\n titles {\n title\n }\n covers {\n url\n color\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n ...EpisodeFragment\n episodeNumber\n releaseDate\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n thumbnails {\n url\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodeCount\n }\n }\n":As,"\n subscription GetMediaModalOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n ...OriginFragment\n }\n }\n }\n":js,"\n subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {\n mediaPage(input: $input) {\n nodes {\n ...MediaFragment\n score\n episodeCount\n titles {\n language\n title\n score\n }\n shortDescriptions(input: $shortDescriptionInput) {\n language\n shortDescription\n }\n covers {\n language\n url\n color\n }\n banners {\n language\n url\n }\n trailers {\n uri\n origin\n id\n url\n thumbnail\n }\n popularity\n genres\n tags\n averageScore\n status\n type\n season\n seasonYear\n nextAiringEpisode {\n episodeNumber\n airingAt\n }\n }\n }\n }\n":Ms,"\n subscription GetWatchMedia($input: MediaInput!) {\n media(input: $input) {\n _id\n uri\n origin\n id\n titles {\n title\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n titles {\n title\n }\n thumbnails {\n url\n }\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n embedUrl\n mediaUri\n episodeNumber\n titles {\n title\n }\n shortDescriptions {\n language\n shortDescription\n }\n }\n }\n }\n handles {\n relation\n node {\n ...MediaFragment\n handles {\n relation\n node {\n ...MediaFragment\n episodes {\n ...EpisodeFragment\n }\n }\n }\n episodes {\n ...EpisodeFragment\n episodeNumber\n }\n }\n }\n }\n }\n":Ns,"\n subscription GetWatchOrigins($input: OriginPageInput!) {\n originPage(input: $input) {\n nodes {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n }\n }\n":Ps,"\n fragment EpisodeFragment on Episode {\n _id\n uri\n origin\n id\n url\n mediaUri\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n mediaUri\n }\n }\n }\n":xs,"\n fragment MediaFragment on Media {\n _id\n uri\n origin\n id\n url\n handles {\n relation\n node {\n _id\n uri\n origin\n id\n url\n }\n }\n }\n":Ss,"\n fragment OriginFragment on Origin {\n id\n url\n name\n icon\n color\n isApiOnly\n }\n":Cs};function Gp(e){return Wp[e]??{}}var Kp=e=>{let t;try{t=new URL(e)}catch{return null}let n=t.hostname.replace(/^(?:www|m)\./,``);return n===`youtu.be`?t.pathname.split(`/`)[1]||null:n!==`youtube.com`&&n!==`youtube-nocookie.com`?null:t.pathname===`/watch`?t.searchParams.get(`v`)||null:t.pathname.match(/^\/(?:embed|v|shorts)\/([^/?#]+)/)?.[1]??null};h();var qp=`https://www.youtube.com`,Jp=0,Yp=250,Xp=40,Zp=x`
533
533
  position: absolute;
534
534
  top: 0;
535
535
  left: 0;
@@ -543,7 +543,7 @@ container-type: size;
543
543
  position: absolute;
544
544
  inset: 0;
545
545
  }
546
- `,qp=x`
546
+ `,Qp=x`
547
547
  position: absolute;
548
548
  top: 50%;
549
549
  left: 50%;
@@ -552,7 +552,7 @@ width: max(100cqw, 100cqh * 16 / 9);
552
552
  height: calc(max(100cqh, 100cqw * 9 / 16) + 160px);
553
553
  pointer-events: none;
554
554
  border: 0;
555
- `,Jp=e=>typeof e==`object`&&e&&typeof e.playerState==`number`?e.playerState:null,Yp=e=>{let t=new URLSearchParams({enablejsapi:`1`,controls:`0`,disablekb:`1`,modestbranding:`1`,rel:`0`,playsinline:`1`,iv_load_policy:`3`,autoplay:`1`,mute:`1`,loop:`1`,playlist:e,origin:location.origin});return`${Hp}/embed/${encodeURIComponent(e)}?${t.toString()}`},Xp=({url:e,redirectTo:t,volume:n=1,paused:r=!1,onError:i,...a})=>{let o=R(null),s=R(null),[c,l]=B(!1),u=Vp(e),d=R(i);d.current=i;let f=z((e,t=[])=>{o.current?.contentWindow?.postMessage(JSON.stringify({event:`command`,func:e,args:t}),Hp)},[]);if(O(()=>{u||d.current?.()},[e,u]),O(()=>{l(!1);let e=o.current;if(!u||!e)return;let t=t=>{if(t.origin!==Hp||t.source!==e.contentWindow)return;let n;try{n=typeof t.data==`string`?JSON.parse(t.data):t.data}catch{return}if(n?.event===`onReady`){clearInterval(r),l(!0);return}if(n?.event===`onError`){l(!1),d.current?.();return}(n?.event===`onStateChange`&&typeof n.info==`number`?n.info:Jp(n?.info))===Up&&f(`playVideo`)};addEventListener(`message`,t);let n=0,r=setInterval(()=>{if(s.current===e&&++n>Gp){clearInterval(r),d.current?.();return}e.contentWindow?.postMessage(JSON.stringify({event:`listening`,id:1,channel:`widget`}),Hp)},Wp);return()=>{removeEventListener(`message`,t),clearInterval(r)}},[u,f]),O(()=>{c&&(n===0?f(`mute`):(f(`unMute`),f(`setVolume`,[Math.round(Math.min(Math.max(n,0),1)*100)])))},[c,n,f]),O(()=>{c&&f(r?`pauseVideo`:`playVideo`)},[c,r,f]),!u)return null;let p=U(`iframe`,{ref:o,onLoad:e=>{s.current=e.currentTarget},css:qp,src:Yp(u),title:`Trailer`,allow:`autoplay; encrypted-media; picture-in-picture`,referrerPolicy:`strict-origin-when-cross-origin`,loading:`eager`,style:{display:c?``:`none`}},u);return U(`div`,{css:Kp,...a,children:t?U(ts,{to:t,children:p}):p})};h();var Zp=({element:e,defaultValue:t})=>{let[n,r]=B(t),[i,a]=B(!1),o=z(t=>{if(a(!0),!e)return;let{clientX:n}=t,{left:i,right:o}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(o-i),0),1))},[e]);return O(()=>{if(!i)return;let t=()=>a(!1),n=t=>{if(!e)return;let{clientX:n}=t,{left:i,right:a}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(a-i),0),1))};return document.addEventListener(`mousemove`,n),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,t)}},[e,i]),{value:n,scrubbing:i,scrubHandler:o}};j();var Qp=x`
555
+ `,$p=e=>typeof e==`object`&&e&&typeof e.playerState==`number`?e.playerState:null,em=e=>{let t=new URLSearchParams({enablejsapi:`1`,controls:`0`,disablekb:`1`,modestbranding:`1`,rel:`0`,playsinline:`1`,iv_load_policy:`3`,autoplay:`1`,mute:`1`,loop:`1`,playlist:e,origin:location.origin});return`${qp}/embed/${encodeURIComponent(e)}?${t.toString()}`},tm=({url:e,redirectTo:t,volume:n=1,paused:r=!1,onError:i,...a})=>{let o=R(null),s=R(null),[c,l]=B(!1),u=Kp(e),d=R(i);d.current=i;let f=z((e,t=[])=>{o.current?.contentWindow?.postMessage(JSON.stringify({event:`command`,func:e,args:t}),qp)},[]);if(O(()=>{u||d.current?.()},[e,u]),O(()=>{l(!1);let e=o.current;if(!u||!e)return;let t=t=>{if(t.origin!==qp||t.source!==e.contentWindow)return;let n;try{n=typeof t.data==`string`?JSON.parse(t.data):t.data}catch{return}if(n?.event===`onReady`){clearInterval(r),l(!0);return}if(n?.event===`onError`){l(!1),d.current?.();return}(n?.event===`onStateChange`&&typeof n.info==`number`?n.info:$p(n?.info))===Jp&&f(`playVideo`)};addEventListener(`message`,t);let n=0,r=setInterval(()=>{if(s.current===e&&++n>Xp){clearInterval(r),d.current?.();return}e.contentWindow?.postMessage(JSON.stringify({event:`listening`,id:1,channel:`widget`}),qp)},Yp);return()=>{removeEventListener(`message`,t),clearInterval(r)}},[u,f]),O(()=>{c&&(n===0?f(`mute`):(f(`unMute`),f(`setVolume`,[Math.round(Math.min(Math.max(n,0),1)*100)])))},[c,n,f]),O(()=>{c&&f(r?`pauseVideo`:`playVideo`)},[c,r,f]),!u)return null;let p=U(`iframe`,{ref:o,onLoad:e=>{s.current=e.currentTarget},css:Qp,src:em(u),title:`Trailer`,allow:`autoplay; encrypted-media; picture-in-picture`,referrerPolicy:`strict-origin-when-cross-origin`,loading:`eager`,style:{display:c?``:`none`}},u);return U(`div`,{css:Zp,...a,children:t?U(os,{to:t,children:p}):p})};h();var nm=({element:e,defaultValue:t})=>{let[n,r]=B(t),[i,a]=B(!1),o=z(t=>{if(a(!0),!e)return;let{clientX:n}=t,{left:i,right:o}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(o-i),0),1))},[e]);return O(()=>{if(!i)return;let t=()=>a(!1),n=t=>{if(!e)return;let{clientX:n}=t,{left:i,right:a}=e.getBoundingClientRect();r(Math.min(Math.max((n-i)/(a-i),0),1))};return document.addEventListener(`mousemove`,n),document.addEventListener(`mouseup`,t),()=>{document.removeEventListener(`mousemove`,n),document.removeEventListener(`mouseup`,t)}},[e,i]),{value:n,scrubbing:i,scrubHandler:o}};j();var rm=x`
556
556
  display: flex;
557
557
  align-items: center;
558
558
  justify-content: center;
@@ -654,14 +654,14 @@ gap: 0.5rem;
654
654
  }
655
655
  }
656
656
  }
657
- `,$p=({defaultMuted:e=!0,defaultVolume:t=1,onMutedUpdate:n,onVolumeUpdate:r})=>{let[i,a]=B(t),[o,s]=B(e),[c,l]=B(null),[u,d]=B(!0),{scrubHandler:f,value:p}=Zp({element:c,defaultValue:i});O(()=>{p!==void 0&&(a(p),r(p**2,p))},[a,p]);let m=z(()=>{p!==void 0&&(s(e=>!e),n(!o))},[s,a,p,o]),h=z(()=>{d(!1)},[d]),g=z(e=>{d(!0)},[d]),_=o?pl:(i??0)>.66?fl:(i??0)>.33?dl:(i??0)>0?ml:pl;return k(`div`,{css:Qp,onMouseLeave:g,children:[U(`button`,{className:`volume-icon`,onClick:m,onMouseOver:h,children:k(H,{children:[U(_,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`}),U(_,{className:`icon-body`,size:30})]})}),U(`div`,{className:`volume-area`,onMouseOver:h,children:U(`div`,{ref:e=>l(e),className:`volume-panel${u?``:` volume-control-hover`}`,onMouseDown:f,children:U(`div`,{className:`slider`,children:U(`div`,{className:`slider-handle`,style:{left:`${(i??0)*100}%`}})})})})]})};j();var em=x`
657
+ `,im=({defaultMuted:e=!0,defaultVolume:t=1,onMutedUpdate:n,onVolumeUpdate:r})=>{let[i,a]=B(t),[o,s]=B(e),[c,l]=B(null),[u,d]=B(!0),{scrubHandler:f,value:p}=nm({element:c,defaultValue:i});O(()=>{p!==void 0&&(a(p),r(p**2,p))},[a,p]);let m=z(()=>{p!==void 0&&(s(e=>!e),n(!o))},[s,a,p,o]),h=z(()=>{d(!1)},[d]),g=z(e=>{d(!0)},[d]),_=o?vl:(i??0)>.66?_l:(i??0)>.33?gl:(i??0)>0?yl:vl;return k(`div`,{css:rm,onMouseLeave:g,children:[U(`button`,{className:`volume-icon`,onClick:m,onMouseOver:h,children:k(H,{children:[U(_,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`}),U(_,{className:`icon-body`,size:30})]})}),U(`div`,{className:`volume-area`,onMouseOver:h,children:U(`div`,{ref:e=>l(e),className:`volume-panel${u?``:` volume-control-hover`}`,onMouseDown:f,children:U(`div`,{className:`slider`,children:U(`div`,{className:`slider-handle`,style:{left:`${(i??0)*100}%`}})})})})]})};j();var am=x`
658
658
  display: -webkit-box;
659
659
  -webkit-box-orient: vertical;
660
660
  overflow: hidden;
661
661
  text-overflow: ellipsis;
662
662
  width: 100%;
663
663
  height: 100%;
664
- `,tm=({children:e,...t})=>{let[n,r]=B(null),[i,a]=B(0),[o,s]=B(0);return O(()=>{if(!n)return;let e=0,t=()=>{let e=window.getComputedStyle(n),t;t=e.lineHeight===`normal`?parseFloat(e.fontSize)*1.2:parseFloat(e.lineHeight);let r=n.clientHeight;if(a(e=>e===t?e:t),t&&r){let e=Math.max(1,Math.floor(r/t));s(t=>t===e?t:e)}},r=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(t)});return r.observe(n),()=>{cancelAnimationFrame(e),r.disconnect()}},[n]),U(`div`,{...t,ref:r,css:em,style:{...typeof t.style==`object`?t.style:void 0,WebkitLineClamp:o,height:i&&o?o*i:void 0},children:e})},nm=e=>e._id??e.uri??``,rm=e=>{let t=e.filter(e=>e.titles?.length&&e.shortDescriptions?.length),n=t.filter(e=>e.trailers?.length);return n.length?n:t},im=.3,am=e=>(e.titles?.[0]?.score??0)>im,om=5e3,sm=(e,t,n=e=>Math.floor(Math.random()*e))=>{let r=t&&e.find(e=>nm(e)===nm(t));if(t&&r)return am(t)?t:r;let i=e.slice(0,10);return i.length?i[Math.min(i.length-1,Math.max(0,n(i.length)))]:t};j();var cm=new Map,lm=3e4,um=e=>{let t=cm.get(e);if(t)return t;let n=new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>{setTimeout(()=>cm.delete(e),lm),t(!1)},n.src=e});return cm.set(e,n),n},dm=e=>{let t=(e??[]).map(e=>e?.url).filter(e=>!!e),n=t.join(`|`),[r,i]=B(t[0]);return O(()=>{let e=!1;return i(t[0]),(async()=>{for(let n of t){let t=await um(n);if(e)return;if(t){i(n);return}}})(),()=>{e=!0}},[n]),r};h();var fm=x`
664
+ `,om=({children:e,...t})=>{let[n,r]=B(null),[i,a]=B(0),[o,s]=B(0);return O(()=>{if(!n)return;let e=0,t=()=>{let e=window.getComputedStyle(n),t;t=e.lineHeight===`normal`?parseFloat(e.fontSize)*1.2:parseFloat(e.lineHeight);let r=n.clientHeight;if(a(e=>e===t?e:t),t&&r){let e=Math.max(1,Math.floor(r/t));s(t=>t===e?t:e)}},r=new ResizeObserver(()=>{cancelAnimationFrame(e),e=requestAnimationFrame(t)});return r.observe(n),()=>{cancelAnimationFrame(e),r.disconnect()}},[n]),U(`div`,{...t,ref:r,css:am,style:{...typeof t.style==`object`?t.style:void 0,WebkitLineClamp:o,height:i&&o?o*i:void 0},children:e})},sm=e=>e._id??e.uri??``,cm=e=>{let t=e.filter(e=>e.titles?.length&&e.shortDescriptions?.length),n=t.filter(e=>e.trailers?.length);return n.length?n:t},lm=.3,um=e=>(e.titles?.[0]?.score??0)>lm,dm=5e3,fm=(e,t,n=e=>Math.floor(Math.random()*e))=>{let r=t&&e.find(e=>sm(e)===sm(t));if(t&&r)return um(t)?t:r;let i=e.slice(0,10);return i.length?i[Math.min(i.length-1,Math.max(0,n(i.length)))]:t};j();var pm=new Map,mm=3e4,hm=e=>{let t=pm.get(e);if(t)return t;let n=new Promise(t=>{let n=new Image;n.onload=()=>t(!0),n.onerror=()=>{setTimeout(()=>pm.delete(e),mm),t(!1)},n.src=e});return pm.set(e,n),n},gm=e=>{let t=(e??[]).map(e=>e?.url).filter(e=>!!e),n=t.join(`|`),[r,i]=B(t[0]);return O(()=>{let e=!1;return i(t[0]),(async()=>{for(let n of t){let t=await hm(n);if(e)return;if(t){i(n);return}}})(),()=>{e=!0}},[n]),r};h();var _m=x`
665
665
  height: 70vh;
666
666
  .player-wrapper {
667
667
  position: absolute;
@@ -766,7 +766,7 @@ height: 70vh;
766
766
  }
767
767
  }
768
768
  }
769
- `,pm=({mediaNodes:e})=>{let[t]=Xo(ss(J.MEDIA)),[n,r]=B(!0);O(()=>{let e=setTimeout(()=>r(!1),om);return()=>clearTimeout(e)},[]);let i=V(()=>rm(e).filter(e=>!n||am(e)),[e,n]),a=R(void 0);a.current=sm(i,a.current);let o=a.current,s=o?.titles?.at(0)?.title,c=o?.shortDescriptions?.at(0)?.shortDescription,[l,u]=B([]),d=o?.trailers?.find(e=>!l.includes(e.uri)),f=dm(d?.url?void 0:o?.banners?.length?o.banners:o?.covers),[p,m]=B(!1),[h,g]=B(!0),[_,v]=B(.25),y=z(()=>{d&&u(e=>[...e,d.uri])},[d]);return k(`div`,{css:fm,className:`theater`,children:[k(`div`,{className:`player-wrapper`,style:!d?.url&&f?{backgroundImage:`url(${f})`}:void 0,children:[d?.url&&U(Xp,{url:d.url,paused:p||t,onError:y,volume:h?0:_,className:`player`}),U(`div`,{className:`shadow`})]}),k(`div`,{className:`information`,css:fm,children:[d?.url&&k(`div`,{className:`player-controls`,children:[k(`span`,{className:`playback`,children:[p?U(tl,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>m(!1)}):U(el,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>m(!0)}),p?U(tl,{className:`icon-body`,size:30,onClick:()=>m(!1)}):U(el,{className:`icon-body`,size:30,onClick:()=>m(!0)})]}),U($p,{defaultMuted:h,onMutedUpdate:g,defaultVolume:_,onVolumeUpdate:e=>v(e)})]}),U(`div`,{className:`title`,children:s}),U(tm,{className:`short-description`,children:c})]})]})};h();function mm(e){let t=e;for(;t;){if(t.dir)return t.dir===`rtl`;t=t.parentElement}return!1}function hm(e,t){let[n,r]=B(t===`rtl`);return _e(()=>{e&&(t||r(mm(e)))},[t,e]),n}var gm=typeof window<`u`?_e:O;function _m(e){if(e!==void 0)switch(typeof e){case`number`:return e;case`string`:if(e.endsWith(`px`))return parseFloat(e)}}function vm({box:e,defaultHeight:t,defaultWidth:n,disabled:r,element:i,mode:a,style:o}){let{styleHeight:s,styleWidth:c}=V(()=>({styleHeight:_m(o?.height),styleWidth:_m(o?.width)}),[o?.height,o?.width]),[l,u]=B({height:t,width:n}),d=r||a===`only-height`&&s!==void 0||a===`only-width`&&c!==void 0||s!==void 0&&c!==void 0;return gm(()=>{if(i===null||d)return;let t=new ResizeObserver(e=>{for(let t of e){let{contentRect:e,target:n}=t;i===n&&u(t=>t.height===e.height&&t.width===e.width?t:{height:e.height,width:e.width})}});return t.observe(i,{box:e}),()=>{t?.unobserve(i)}},[e,d,i,s,c]),V(()=>({height:s??l.height,width:c??l.width}),[l,s,c])}function ym(e){let t=R(()=>{throw Error(`Cannot call an event handler while rendering.`)});return gm(()=>{t.current=e},[e]),z(e=>t.current?.(e),[t])}var bm=null;function xm(e=!1){if(bm===null||e){let e=document.createElement(`div`),t=e.style;t.width=`50px`,t.height=`50px`,t.overflow=`scroll`,t.direction=`rtl`;let n=document.createElement(`div`),r=n.style;return r.width=`100px`,r.height=`100px`,e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?bm=`positive-descending`:(e.scrollLeft=1,bm=e.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(e),bm}return bm}function Sm({containerElement:e,direction:t,isRtl:n,scrollOffset:r}){if(t===`horizontal`&&n)switch(xm()){case`negative`:return-r;case`positive-descending`:if(e){let{clientWidth:t,scrollLeft:n,scrollWidth:r}=e;return r-t-n}}return r}function Cm(e,t=`Assertion error`){if(!e)throw console.error(t),Error(t)}function wm({cachedBounds:e,itemCount:t,itemSize:n}){if(t===0)return 0;if(typeof n==`number`)return t*n;{let n=e.get(e.size===0?0:e.size-1);return Cm(n!==void 0,`Unexpected bounds cache miss`),t*((n.scrollOffset+n.size)/e.size)}}function Tm({align:e,cachedBounds:t,index:n,itemCount:r,itemSize:i,containerScrollOffset:a,containerSize:o}){let s=wm({cachedBounds:t,itemCount:r,itemSize:i}),c=t.get(n),l=Math.max(0,Math.min(s-o,c.scrollOffset)),u=Math.max(0,c.scrollOffset-o+c.size);switch(e===`smart`&&(e=a>=u&&a<=l?`auto`:`center`),e){case`start`:return l;case`end`:return u;case`center`:return c.scrollOffset<=o/2?0:c.scrollOffset+c.size/2>=s-o/2?s-o:c.scrollOffset+c.size/2-o/2;default:return a>=u&&a<=l?a:a<u?u:l}}function Em({cachedBounds:e,containerScrollOffset:t,containerSize:n,itemCount:r,overscanCount:i}){let a=r-1,o=0,s=-1,c=0;for(;c<a;){let n=e.get(c);if(n.scrollOffset+n.size>t)break;c++}for(o=c,o=Math.max(0,o-i);c<a;){let r=e.get(c);if(r.scrollOffset+r.size>=t+n)break;c++}return s=Math.min(a,c),s=Math.min(r-1,s+i),o<0?[0,-1]:[o,s]}function Dm({itemCount:e,itemProps:t,itemSize:n}){let r=new Map;return{get(i){for(Cm(i<e,`Invalid index ${i}`);r.size-1<i;){let e=r.size,a;switch(typeof n){case`function`:a=n(e,t);break;case`number`:a=n}if(e===0)r.set(e,{size:a,scrollOffset:0});else{let t=r.get(e-1);Cm(t!==void 0,`Unexpected bounds cache miss for index ${i}`),r.set(e,{scrollOffset:t.scrollOffset+t.size,size:a})}}let a=r.get(i);return Cm(a!==void 0,`Unexpected bounds cache miss for index ${i}`),a},set(e,t){r.set(e,t)},get size(){return r.size}}}function Om({itemCount:e,itemProps:t,itemSize:n}){return V(()=>Dm({itemCount:e,itemProps:t,itemSize:n}),[e,t,n])}function km({containerSize:e,itemSize:t}){let n;switch(typeof t){case`string`:Cm(t.endsWith(`%`),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),Cm(e!==void 0,`Container size must be defined if a percentage item size is specified`),n=e*parseInt(t)/100;break;default:n=t}return n}function Am({containerElement:e,containerStyle:t,defaultContainerSize:n=0,direction:r,isRtl:i=!1,itemCount:a,itemProps:o,itemSize:s,onResize:c,overscanCount:l}){let[u,d]=B([0,-1]),[f,p]=[Math.min(a-1,u[0]),Math.min(a-1,u[1])],{height:m=n,width:h=n}=vm({defaultHeight:r===`vertical`?n:void 0,defaultWidth:r===`horizontal`?n:void 0,element:e,mode:r===`vertical`?`only-height`:`only-width`,style:t}),g=R({height:0,width:0}),_=r===`vertical`?m:h,v=km({containerSize:_,itemSize:s});_e(()=>{if(typeof c==`function`){let e=g.current;(e.height!==m||e.width!==h)&&(c({height:m,width:h},{...e}),e.height=m,e.width=h)}},[m,c,h]);let y=Om({itemCount:a,itemProps:o,itemSize:v}),b=z(e=>y.get(e),[y]),x=z(()=>wm({cachedBounds:y,itemCount:a,itemSize:v}),[y,a,v]),S=z(t=>{let n=Sm({containerElement:e,direction:r,isRtl:i,scrollOffset:t});return Em({cachedBounds:y,containerScrollOffset:n,containerSize:_,itemCount:a,overscanCount:l})},[y,e,_,r,i,a,l]);return gm(()=>{let t=(r===`vertical`?e?.scrollTop:e?.scrollLeft)??0;d(S(t))},[e,r,S]),gm(()=>{if(!e)return;let t=()=>{d(t=>{let{scrollLeft:n,scrollTop:o}=e,s=Sm({containerElement:e,direction:r,isRtl:i,scrollOffset:r===`vertical`?o:n}),c=Em({cachedBounds:y,containerScrollOffset:s,containerSize:_,itemCount:a,overscanCount:l});return c[0]===t[0]&&c[1]===t[1]?t:c})};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t)}},[y,e,_,r,a,l]),{getCellBounds:b,getEstimatedSize:x,scrollToIndex:ym(({align:t=`auto`,behavior:n=`auto`,containerScrollOffset:o,index:s})=>{let c=Tm({align:t,cachedBounds:y,containerScrollOffset:o,containerSize:_,index:s,itemCount:a,itemSize:v});if(e){if(c=Sm({containerElement:e,direction:r,isRtl:i,scrollOffset:c}),typeof e.scrollTo==`function`)r===`horizontal`?e.scrollTo({left:c,behavior:n||void 0}):e.scrollTo({behavior:n||void 0,top:c});else{let e=S(c);(e[0]!==f||e[1]!==p)&&d(e)}}}),startIndex:f,stopIndex:p}}function jm(e){return V(()=>e,Object.values(e))}function Mm(e,t){if(e===t)return!0;if(!!e!=!!t||(Cm(e!==void 0),Cm(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(let n in e)if(!Object.is(t[n],e[n]))return!1;return!0}function Nm(e,t){let{style:n,...r}=e,{style:i,...a}=t;return Mm(n,i)&&Mm(r,a)}function Pm({cellComponent:e,cellProps:t,className:n,columnCount:r,columnWidth:i,defaultHeight:a=0,defaultWidth:o=0,dir:s,gridRef:c,onCellsRendered:l,onResize:u,overscanCount:d=3,rowCount:f,rowHeight:m,style:h,...g}){let _=jm(t),v=V(()=>b(e,Nm),[e]),[y,x]=B(null),S=hm(y,s),{getCellBounds:C,getEstimatedSize:w,startIndex:T,scrollToIndex:E,stopIndex:D}=Am({containerElement:y,defaultContainerSize:o,direction:`horizontal`,isRtl:S,itemCount:r,itemProps:_,itemSize:i,onResize:u,overscanCount:d}),{getCellBounds:k,getEstimatedSize:A,startIndex:j,scrollToIndex:M,stopIndex:N}=Am({containerElement:y,defaultContainerSize:a,direction:`vertical`,itemCount:f,itemProps:_,itemSize:m,onResize:u,overscanCount:d});ae(c,()=>({get element(){return y},scrollToCell({behavior:e=`auto`,columnAlign:t=`auto`,columnIndex:n,rowAlign:r=`auto`,rowIndex:i}){M({align:r,behavior:e,containerScrollOffset:y?.scrollTop??0,index:i}),E({align:t,behavior:e,containerScrollOffset:y?.scrollLeft??0,index:n})},scrollToColumn({align:e=`auto`,behavior:t=`auto`,index:n}){E({align:e,behavior:t,containerScrollOffset:y?.scrollLeft??0,index:n})},scrollToRow({align:e=`auto`,behavior:t=`auto`,index:n}){M({align:e,behavior:t,containerScrollOffset:y?.scrollTop??0,index:n})}}),[y,E,M]),O(()=>{T>=0&&D>=0&&j>=0&&N>=0&&l&&l({columnStartIndex:T,columnStopIndex:D,rowStartIndex:j,rowStopIndex:N})},[l,T,D,j,N]);let P=V(()=>{let e=[];if(r>0&&f>0)for(let t=j;t<=N;t++){let n=k(t);for(let r=T;r<=D;r++){let i=C(r);e.push(ce(v,{..._,columnIndex:r,key:`${t}-${r}`,rowIndex:t,style:{position:`absolute`,left:S?void 0:0,right:S?0:void 0,transform:`translate(${S?-i.scrollOffset:i.scrollOffset}px, ${n.scrollOffset}px)`,height:f>1?n.size:`100%`,width:i.size}}))}}return e},[v,_,r,T,D,C,k,S,f,j,N]);return p(`div`,{...g,className:n,dir:s,ref:x,style:{width:`100%`,height:`100%`,...h,maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`},children:p(`div`,{className:n,style:{position:`relative`,height:A(),width:w()},children:P})})}var Fm=R,Im=x`
769
+ `,vm=({mediaNodes:e})=>{let[t]=ts(fs(J.MEDIA)),[n,r]=B(!0);O(()=>{let e=setTimeout(()=>r(!1),dm);return()=>clearTimeout(e)},[]);let i=V(()=>cm(e).filter(e=>!n||um(e)),[e,n]),a=R(void 0);a.current=fm(i,a.current);let o=a.current,s=o?.titles?.at(0)?.title,c=o?.shortDescriptions?.at(0)?.shortDescription,[l,u]=B([]),d=o?.trailers?.find(e=>!l.includes(e.uri)),f=gm(d?.url?void 0:o?.banners?.length?o.banners:o?.covers),[p,m]=B(!1),[h,g]=B(!0),[_,v]=B(.25),y=z(()=>{d&&u(e=>[...e,d.uri])},[d]);return k(`div`,{css:_m,className:`theater`,children:[k(`div`,{className:`player-wrapper`,style:!d?.url&&f?{backgroundImage:`url(${f})`}:void 0,children:[d?.url&&U(tm,{url:d.url,paused:p||t,onError:y,volume:h?0:_,className:`player`}),U(`div`,{className:`shadow`})]}),k(`div`,{className:`information`,css:_m,children:[d?.url&&k(`div`,{className:`player-controls`,children:[k(`span`,{className:`playback`,children:[p?U(ol,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>m(!1)}):U(al,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>m(!0)}),p?U(ol,{className:`icon-body`,size:30,onClick:()=>m(!1)}):U(al,{className:`icon-body`,size:30,onClick:()=>m(!0)})]}),U(im,{defaultMuted:h,onMutedUpdate:g,defaultVolume:_,onVolumeUpdate:e=>v(e)})]}),U(`div`,{className:`title`,children:s}),U(om,{className:`short-description`,children:c})]})]})};h();function ym(e){let t=e;for(;t;){if(t.dir)return t.dir===`rtl`;t=t.parentElement}return!1}function bm(e,t){let[n,r]=B(t===`rtl`);return _e(()=>{e&&(t||r(ym(e)))},[t,e]),n}var xm=typeof window<`u`?_e:O;function Sm(e){if(e!==void 0)switch(typeof e){case`number`:return e;case`string`:if(e.endsWith(`px`))return parseFloat(e)}}function Cm({box:e,defaultHeight:t,defaultWidth:n,disabled:r,element:i,mode:a,style:o}){let{styleHeight:s,styleWidth:c}=V(()=>({styleHeight:Sm(o?.height),styleWidth:Sm(o?.width)}),[o?.height,o?.width]),[l,u]=B({height:t,width:n}),d=r||a===`only-height`&&s!==void 0||a===`only-width`&&c!==void 0||s!==void 0&&c!==void 0;return xm(()=>{if(i===null||d)return;let t=new ResizeObserver(e=>{for(let t of e){let{contentRect:e,target:n}=t;i===n&&u(t=>t.height===e.height&&t.width===e.width?t:{height:e.height,width:e.width})}});return t.observe(i,{box:e}),()=>{t?.unobserve(i)}},[e,d,i,s,c]),V(()=>({height:s??l.height,width:c??l.width}),[l,s,c])}function wm(e){let t=R(()=>{throw Error(`Cannot call an event handler while rendering.`)});return xm(()=>{t.current=e},[e]),z(e=>t.current?.(e),[t])}var Tm=null;function Em(e=!1){if(Tm===null||e){let e=document.createElement(`div`),t=e.style;t.width=`50px`,t.height=`50px`,t.overflow=`scroll`,t.direction=`rtl`;let n=document.createElement(`div`),r=n.style;return r.width=`100px`,r.height=`100px`,e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?Tm=`positive-descending`:(e.scrollLeft=1,Tm=e.scrollLeft===0?`negative`:`positive-ascending`),document.body.removeChild(e),Tm}return Tm}function Dm({containerElement:e,direction:t,isRtl:n,scrollOffset:r}){if(t===`horizontal`&&n)switch(Em()){case`negative`:return-r;case`positive-descending`:if(e){let{clientWidth:t,scrollLeft:n,scrollWidth:r}=e;return r-t-n}}return r}function Om(e,t=`Assertion error`){if(!e)throw console.error(t),Error(t)}function km({cachedBounds:e,itemCount:t,itemSize:n}){if(t===0)return 0;if(typeof n==`number`)return t*n;{let n=e.get(e.size===0?0:e.size-1);return Om(n!==void 0,`Unexpected bounds cache miss`),t*((n.scrollOffset+n.size)/e.size)}}function Am({align:e,cachedBounds:t,index:n,itemCount:r,itemSize:i,containerScrollOffset:a,containerSize:o}){let s=km({cachedBounds:t,itemCount:r,itemSize:i}),c=t.get(n),l=Math.max(0,Math.min(s-o,c.scrollOffset)),u=Math.max(0,c.scrollOffset-o+c.size);switch(e===`smart`&&(e=a>=u&&a<=l?`auto`:`center`),e){case`start`:return l;case`end`:return u;case`center`:return c.scrollOffset<=o/2?0:c.scrollOffset+c.size/2>=s-o/2?s-o:c.scrollOffset+c.size/2-o/2;default:return a>=u&&a<=l?a:a<u?u:l}}function jm({cachedBounds:e,containerScrollOffset:t,containerSize:n,itemCount:r,overscanCount:i}){let a=r-1,o=0,s=-1,c=0;for(;c<a;){let n=e.get(c);if(n.scrollOffset+n.size>t)break;c++}for(o=c,o=Math.max(0,o-i);c<a;){let r=e.get(c);if(r.scrollOffset+r.size>=t+n)break;c++}return s=Math.min(a,c),s=Math.min(r-1,s+i),o<0?[0,-1]:[o,s]}function Mm({itemCount:e,itemProps:t,itemSize:n}){let r=new Map;return{get(i){for(Om(i<e,`Invalid index ${i}`);r.size-1<i;){let e=r.size,a;switch(typeof n){case`function`:a=n(e,t);break;case`number`:a=n}if(e===0)r.set(e,{size:a,scrollOffset:0});else{let t=r.get(e-1);Om(t!==void 0,`Unexpected bounds cache miss for index ${i}`),r.set(e,{scrollOffset:t.scrollOffset+t.size,size:a})}}let a=r.get(i);return Om(a!==void 0,`Unexpected bounds cache miss for index ${i}`),a},set(e,t){r.set(e,t)},get size(){return r.size}}}function Nm({itemCount:e,itemProps:t,itemSize:n}){return V(()=>Mm({itemCount:e,itemProps:t,itemSize:n}),[e,t,n])}function Pm({containerSize:e,itemSize:t}){let n;switch(typeof t){case`string`:Om(t.endsWith(`%`),`Invalid item size: "${t}"; string values must be percentages (e.g. "100%")`),Om(e!==void 0,`Container size must be defined if a percentage item size is specified`),n=e*parseInt(t)/100;break;default:n=t}return n}function Fm({containerElement:e,containerStyle:t,defaultContainerSize:n=0,direction:r,isRtl:i=!1,itemCount:a,itemProps:o,itemSize:s,onResize:c,overscanCount:l}){let[u,d]=B([0,-1]),[f,p]=[Math.min(a-1,u[0]),Math.min(a-1,u[1])],{height:m=n,width:h=n}=Cm({defaultHeight:r===`vertical`?n:void 0,defaultWidth:r===`horizontal`?n:void 0,element:e,mode:r===`vertical`?`only-height`:`only-width`,style:t}),g=R({height:0,width:0}),_=r===`vertical`?m:h,v=Pm({containerSize:_,itemSize:s});_e(()=>{if(typeof c==`function`){let e=g.current;(e.height!==m||e.width!==h)&&(c({height:m,width:h},{...e}),e.height=m,e.width=h)}},[m,c,h]);let y=Nm({itemCount:a,itemProps:o,itemSize:v}),b=z(e=>y.get(e),[y]),x=z(()=>km({cachedBounds:y,itemCount:a,itemSize:v}),[y,a,v]),S=z(t=>{let n=Dm({containerElement:e,direction:r,isRtl:i,scrollOffset:t});return jm({cachedBounds:y,containerScrollOffset:n,containerSize:_,itemCount:a,overscanCount:l})},[y,e,_,r,i,a,l]);return xm(()=>{let t=(r===`vertical`?e?.scrollTop:e?.scrollLeft)??0;d(S(t))},[e,r,S]),xm(()=>{if(!e)return;let t=()=>{d(t=>{let{scrollLeft:n,scrollTop:o}=e,s=Dm({containerElement:e,direction:r,isRtl:i,scrollOffset:r===`vertical`?o:n}),c=jm({cachedBounds:y,containerScrollOffset:s,containerSize:_,itemCount:a,overscanCount:l});return c[0]===t[0]&&c[1]===t[1]?t:c})};return e.addEventListener(`scroll`,t),()=>{e.removeEventListener(`scroll`,t)}},[y,e,_,r,a,l]),{getCellBounds:b,getEstimatedSize:x,scrollToIndex:wm(({align:t=`auto`,behavior:n=`auto`,containerScrollOffset:o,index:s})=>{let c=Am({align:t,cachedBounds:y,containerScrollOffset:o,containerSize:_,index:s,itemCount:a,itemSize:v});if(e){if(c=Dm({containerElement:e,direction:r,isRtl:i,scrollOffset:c}),typeof e.scrollTo==`function`)r===`horizontal`?e.scrollTo({left:c,behavior:n||void 0}):e.scrollTo({behavior:n||void 0,top:c});else{let e=S(c);(e[0]!==f||e[1]!==p)&&d(e)}}}),startIndex:f,stopIndex:p}}function Im(e){return V(()=>e,Object.values(e))}function Lm(e,t){if(e===t)return!0;if(!!e!=!!t||(Om(e!==void 0),Om(t!==void 0),Object.keys(e).length!==Object.keys(t).length))return!1;for(let n in e)if(!Object.is(t[n],e[n]))return!1;return!0}function Rm(e,t){let{style:n,...r}=e,{style:i,...a}=t;return Lm(n,i)&&Lm(r,a)}function zm({cellComponent:e,cellProps:t,className:n,columnCount:r,columnWidth:i,defaultHeight:a=0,defaultWidth:o=0,dir:s,gridRef:c,onCellsRendered:l,onResize:u,overscanCount:d=3,rowCount:f,rowHeight:m,style:h,...g}){let _=Im(t),v=V(()=>b(e,Rm),[e]),[y,x]=B(null),S=bm(y,s),{getCellBounds:C,getEstimatedSize:w,startIndex:T,scrollToIndex:E,stopIndex:D}=Fm({containerElement:y,defaultContainerSize:o,direction:`horizontal`,isRtl:S,itemCount:r,itemProps:_,itemSize:i,onResize:u,overscanCount:d}),{getCellBounds:k,getEstimatedSize:A,startIndex:j,scrollToIndex:M,stopIndex:N}=Fm({containerElement:y,defaultContainerSize:a,direction:`vertical`,itemCount:f,itemProps:_,itemSize:m,onResize:u,overscanCount:d});ae(c,()=>({get element(){return y},scrollToCell({behavior:e=`auto`,columnAlign:t=`auto`,columnIndex:n,rowAlign:r=`auto`,rowIndex:i}){M({align:r,behavior:e,containerScrollOffset:y?.scrollTop??0,index:i}),E({align:t,behavior:e,containerScrollOffset:y?.scrollLeft??0,index:n})},scrollToColumn({align:e=`auto`,behavior:t=`auto`,index:n}){E({align:e,behavior:t,containerScrollOffset:y?.scrollLeft??0,index:n})},scrollToRow({align:e=`auto`,behavior:t=`auto`,index:n}){M({align:e,behavior:t,containerScrollOffset:y?.scrollTop??0,index:n})}}),[y,E,M]),O(()=>{T>=0&&D>=0&&j>=0&&N>=0&&l&&l({columnStartIndex:T,columnStopIndex:D,rowStartIndex:j,rowStopIndex:N})},[l,T,D,j,N]);let P=V(()=>{let e=[];if(r>0&&f>0)for(let t=j;t<=N;t++){let n=k(t);for(let r=T;r<=D;r++){let i=C(r);e.push(ce(v,{..._,columnIndex:r,key:`${t}-${r}`,rowIndex:t,style:{position:`absolute`,left:S?void 0:0,right:S?0:void 0,transform:`translate(${S?-i.scrollOffset:i.scrollOffset}px, ${n.scrollOffset}px)`,height:f>1?n.size:`100%`,width:i.size}}))}}return e},[v,_,r,T,D,C,k,S,f,j,N]);return p(`div`,{...g,className:n,dir:s,ref:x,style:{width:`100%`,height:`100%`,...h,maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`},children:p(`div`,{className:n,style:{position:`relative`,height:A(),width:w()},children:P})})}var Bm=R,Vm=x`
770
770
  &.card, .card {
771
771
  position: relative;
772
772
  display: flex;
@@ -838,7 +838,7 @@ height: 70vh;
838
838
  aspect-ratio: 5 / 7;
839
839
  }
840
840
  }
841
- `,Lm=({media:e,to:t,ellipsis:n=!0,...r})=>{let i=e.titles?.at(0)?.title,a=dm(e.covers);return k(`div`,{...r,css:Im,className:`card category-item${n?``:` full-title`}`,style:{...typeof r.style==`object`?r.style:void 0,backgroundImage:`url(${a})`,backgroundSize:`cover`},children:[U(ts,{tabIndex:-1,to:t,className:`card link`}),U(`div`,{className:`information`,children:U(`div`,{className:`title`,children:U(ts,{to:t,className:`title-text`,children:n?U(tm,{children:i}):i})})})]})};h();var Rm=x`
841
+ `,Hm=({media:e,to:t,ellipsis:n=!0,...r})=>{let i=e.titles?.at(0)?.title,a=gm(e.covers);return k(`div`,{...r,css:Vm,className:`card category-item${n?``:` full-title`}`,style:{...typeof r.style==`object`?r.style:void 0,backgroundImage:`url(${a})`,backgroundSize:`cover`},children:[U(os,{tabIndex:-1,to:t,className:`card link`}),U(`div`,{className:`information`,children:U(`div`,{className:`title`,children:U(os,{to:t,className:`title-text`,children:n?U(om,{children:i}):i})})})]})};h();var Um=x`
842
842
  cursor: grab;
843
843
  &:active {
844
844
  cursor: grabbing;
@@ -846,7 +846,7 @@ height: 70vh;
846
846
  &.active * {
847
847
  pointer-events: none;
848
848
  }
849
- `,zm=({children:e,isDragging:t,setIsDragging:n})=>{if(`ontouchstart`in document.documentElement)return U(H,{children:e});let[r,i]=B(null),[a,o]=B(!1),[s,c]=B(),l=R({startX:0,startY:0,scrollLeft:0,scrollTop:0}),u=V(()=>globalThis,[]),d=z(e=>{if(!(e.target instanceof HTMLElement)||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||!r||!r.contains(e.target))return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=t.scrollLeft,a=t.scrollTop;l.current={startX:n,startY:r,scrollLeft:i,scrollTop:a}}o(!0)},[o,n,c,r]),f=z(e=>{o(!1),n(!1),u.removeEventListener(`mousemove`,p),s&&clearTimeout(s),c(globalThis.setTimeout(()=>n(!1),50))},[o,n,c,s,r]),p=z(e=>{if(!a||!r)return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=n-l.current.startX,a=r-l.current.startY;t.scrollLeft=l.current.scrollLeft-i,t.scrollTop=l.current.scrollTop-a}n(!0)},[a,r]);return O(()=>{if(r)return u.addEventListener(`mousedown`,d),u.addEventListener(`mouseup`,f),u.addEventListener(`mousemove`,p),()=>{u.removeEventListener(`mousedown`,d),u.removeEventListener(`mouseup`,f),u.removeEventListener(`mousemove`,p)}},[r,a,n,s,d,f,p]),U(`div`,{ref:e=>i(e),className:`draggable ${t?`active`:``}`,css:Rm,children:e})};j();var Bm=x`
849
+ `,Wm=({children:e,isDragging:t,setIsDragging:n})=>{if(`ontouchstart`in document.documentElement)return U(H,{children:e});let[r,i]=B(null),[a,o]=B(!1),[s,c]=B(),l=R({startX:0,startY:0,scrollLeft:0,scrollTop:0}),u=V(()=>globalThis,[]),d=z(e=>{if(!(e.target instanceof HTMLElement)||e.offsetX>e.target.clientWidth||e.offsetY>e.target.clientHeight||!r||!r.contains(e.target))return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=t.scrollLeft,a=t.scrollTop;l.current={startX:n,startY:r,scrollLeft:i,scrollTop:a}}o(!0)},[o,n,c,r]),f=z(e=>{o(!1),n(!1),u.removeEventListener(`mousemove`,p),s&&clearTimeout(s),c(globalThis.setTimeout(()=>n(!1),50))},[o,n,c,s,r]),p=z(e=>{if(!a||!r)return;e.preventDefault();let t=r.children.item(0);if(t){let n=e.pageX-t.offsetLeft,r=e.pageY-t.offsetTop,i=n-l.current.startX,a=r-l.current.startY;t.scrollLeft=l.current.scrollLeft-i,t.scrollTop=l.current.scrollTop-a}n(!0)},[a,r]);return O(()=>{if(r)return u.addEventListener(`mousedown`,d),u.addEventListener(`mouseup`,f),u.addEventListener(`mousemove`,p),()=>{u.removeEventListener(`mousedown`,d),u.removeEventListener(`mouseup`,f),u.removeEventListener(`mousemove`,p)}},[r,a,n,s,d,f,p]),U(`div`,{ref:e=>i(e),className:`draggable ${t?`active`:``}`,css:Um,children:e})};j();var Gm=x`
850
850
  display: grid;
851
851
  background-color: rgb(35, 35, 35);
852
852
  border-radius: 1rem;
@@ -913,7 +913,7 @@ a {
913
913
  background-size: cover;
914
914
  background-position: center;
915
915
  }
916
- `,Vm=({ref:e,media:t,...n})=>{let r=V(()=>t?.titles?.at(0)?.title,[t]),i=V(()=>t?.shortDescriptions?.at(0)?.shortDescription,[t]),a=dm(t?.covers),[o,s]=B([]),c=V(()=>t?.trailers.filter(e=>!o.includes(e.uri)).at(0),[o]),l=z(()=>{c&&s([...o,c.uri])},[c,o]);return k(`div`,{ref:e,className:`title-hovercard`,css:Bm,...n,children:[c?.url?U(Xp,{volume:0,url:c?.url,onError:l,redirectTo:cs(J.MEDIA,{uri:t.uri}),className:`title-hovercard-player`}):a?U(ts,{className:`trailer-fallback-cover`,style:{backgroundImage:`url(${a})`},to:cs(J.MEDIA,{uri:t.uri})}):void 0,U(ts,{to:cs(J.MEDIA,{uri:t.uri}),children:k(`div`,{className:`content`,children:[U(`div`,{className:`title`,children:r}),U(`div`,{className:`top`,children:k(`span`,{className:`episodes`,children:[t.episodeCount??`?`,` Episodes`]})}),U(tm,{className:`description`,children:i})]})})]})};h();var Hm=x`
916
+ `,Km=({ref:e,media:t,...n})=>{let r=V(()=>t?.titles?.at(0)?.title,[t]),i=V(()=>t?.shortDescriptions?.at(0)?.shortDescription,[t]),a=gm(t?.covers),[o,s]=B([]),c=V(()=>t?.trailers.filter(e=>!o.includes(e.uri)).at(0),[o]),l=z(()=>{c&&s([...o,c.uri])},[c,o]);return k(`div`,{ref:e,className:`title-hovercard`,css:Gm,...n,children:[c?.url?U(tm,{volume:0,url:c?.url,onError:l,redirectTo:ps(J.MEDIA,{uri:t.uri}),className:`title-hovercard-player`}):a?U(os,{className:`trailer-fallback-cover`,style:{backgroundImage:`url(${a})`},to:ps(J.MEDIA,{uri:t.uri})}):void 0,U(os,{to:ps(J.MEDIA,{uri:t.uri}),children:k(`div`,{className:`content`,children:[U(`div`,{className:`title`,children:r}),U(`div`,{className:`top`,children:k(`span`,{className:`episodes`,children:[t.episodeCount??`?`,` Episodes`]})}),U(om,{className:`description`,children:i})]})})]})};h();var qm=x`
917
917
  display: flex;
918
918
  flex-direction: column;
919
919
  position: relative;
@@ -983,7 +983,7 @@ position: relative;
983
983
  display: none;
984
984
  }
985
985
  }
986
- `,Um=({style:e,mediaNodes:t,columnIndex:n})=>{let r=t[n];if(!r)return null;let[i,a]=B(!1),{x:o,y:s,strategy:c,refs:l,context:u}=mf({open:i,onOpenChange:a,whileElementsMounted:_,placement:`top`,middleware:[Wu(({rects:e})=>-e.reference.height/2-e.floating.height/2),Gu({crossAxis:!0,padding:25})]}),d=bd(u,{restMs:400,handleClose:kf()}),{styles:f}=Tf(u,{initial:{opacity:0,transform:`scale(0.8)`},open:{opacity:1,transform:`scale(1)`},duration:150}),{getReferenceProps:p,getFloatingProps:m}=vf([d]);return k(H,{children:[i&&U(Vd,{children:U(Vm,{media:r,ref:l.setFloating,style:{...f,position:c,top:s??0,left:o??0,zIndex:Ff.hoverCard},...m()})}),U(Lm,{media:r,to:cs(J.MEDIA,{uri:r.uri}),style:{...e,width:250,marginLeft:`var(--card-gutter, 100px)`},onMouseEnter:e=>{e.target instanceof HTMLElement&&l.setReference(e.target)},...p()},r._id)]})},Wm=({title:e,titleTo:t,mediaNodes:n})=>{let[r,i]=B(0),[a,o]=B(0),[s,c]=B(!1),l=Fm(null),u=z(e=>{let t=l.current;t&&t.scrollToColumn({index:e===`left`?r<=0?0:r:a+1>=n.length?n.length-1:a,behavior:`smooth`})},[r,a,n.length,l]);return k(`div`,{css:Hm,children:[t?U(ts,{to:t,className:`title`,children:e}):U(`span`,{className:`title`,children:e}),k(`div`,{className:`list-container`,children:[U(zm,{isDragging:s,setIsDragging:c,children:U(Pm,{gridRef:l,className:`virtual-list`,cellComponent:Um,cellProps:{mediaNodes:n},columnCount:n.length,columnWidth:260,rowCount:1,rowHeight:350,overscanCount:5,onCellsRendered:({columnStartIndex:e,columnStopIndex:t})=>{i(e),o(t)}})}),U(`button`,{className:`scroll-button left`,onClick:()=>u(`left`),children:U(Bc,{})}),U(`button`,{className:`scroll-button right`,onClick:()=>u(`right`),children:U(Vc,{})})]})]})};j();var Gm=x`
986
+ `,Jm=({style:e,mediaNodes:t,columnIndex:n})=>{let r=t[n];if(!r)return null;let[i,a]=B(!1),{x:o,y:s,strategy:c,refs:l,context:u}=yf({open:i,onOpenChange:a,whileElementsMounted:_,placement:`top`,middleware:[Yu(({rects:e})=>-e.reference.height/2-e.floating.height/2),Xu({crossAxis:!0,padding:25})]}),d=Td(u,{restMs:400,handleClose:Pf()}),{styles:f}=Af(u,{initial:{opacity:0,transform:`scale(0.8)`},open:{opacity:1,transform:`scale(1)`},duration:150}),{getReferenceProps:p,getFloatingProps:m}=Cf([d]);return k(H,{children:[i&&U(Kd,{children:U(Km,{media:r,ref:l.setFloating,style:{...f,position:c,top:s??0,left:o??0,zIndex:Bf.hoverCard},...m()})}),U(Hm,{media:r,to:ps(J.MEDIA,{uri:r.uri}),style:{...e,width:250,marginLeft:`var(--card-gutter, 100px)`},onMouseEnter:e=>{e.target instanceof HTMLElement&&l.setReference(e.target)},...p()},r._id)]})},Ym=({title:e,titleTo:t,mediaNodes:n})=>{let[r,i]=B(0),[a,o]=B(0),[s,c]=B(!1),l=Bm(null),u=z(e=>{let t=l.current;t&&t.scrollToColumn({index:e===`left`?r<=0?0:r:a+1>=n.length?n.length-1:a,behavior:`smooth`})},[r,a,n.length,l]);return k(`div`,{css:qm,children:[t?U(os,{to:t,className:`title`,children:e}):U(`span`,{className:`title`,children:e}),k(`div`,{className:`list-container`,children:[U(Wm,{isDragging:s,setIsDragging:c,children:U(zm,{gridRef:l,className:`virtual-list`,cellComponent:Jm,cellProps:{mediaNodes:n},columnCount:n.length,columnWidth:260,rowCount:1,rowHeight:350,overscanCount:5,onCellsRendered:({columnStartIndex:e,columnStopIndex:t})=>{i(e),o(t)}})}),U(`button`,{className:`scroll-button left`,onClick:()=>u(`left`),children:U(Gc,{})}),U(`button`,{className:`scroll-button right`,onClick:()=>u(`right`),children:U(Kc,{})})]})]})};j();var Xm=x`
987
987
  position: relative;
988
988
  overflow: hidden;
989
989
  transition: max-height 0.3s ease-in-out;
@@ -1020,7 +1020,7 @@ transition: max-height 0.3s ease-in-out;
1020
1020
  width: 100%;
1021
1021
  background-color: rgb(35, 35, 35);
1022
1022
  }
1023
- `,Km=({children:e,collapsedHeight:t=200,...n})=>{let[r,i]=B(!1),[a,o]=B(!1),s=R(null),[c,l]=B(0);O(()=>{if(!s.current)return;let e=new ResizeObserver(()=>{if(s.current){let e=s.current.scrollHeight;l(e),o(e>t)}});return e.observe(s.current),()=>e.disconnect()},[t]);let u=()=>i(!r);return k(`div`,{...n,ref:s,css:Gm,className:`${n.className||``} ${!r&&a?`collapsed`:`expanded`}`,children:[U(`div`,{className:`content`,children:e}),a&&!r?U(`div`,{className:`fade-overlay`}):void 0,a?U(`button`,{className:`toggle-button`,onClick:u,children:r?`Collapse`:`Expand`}):void 0]})},qm=`this build of the worker exposes no traceGraph, so there is nothing to read a trace from`,Jm=async()=>await Ne(()=>import(`./worker-HiPGVuwy.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),Ym=async e=>{let t=await Jm();if(typeof t.traceGraph!=`function`)throw Error(qm);return t.traceGraph(e)},Xm=async e=>{let t=await Jm();if(typeof t.traceAnswer!=`function`)throw Error(qm);return t.traceAnswer(e)},Zm=[`graph`,`store`],Qm=({uri:e,search:t}={})=>{let n=cs(J.DEBUG_TRACE),r=new URLSearchParams;e&&r.set(`uri`,e);let i=nh(t??``);for(let e of Zm)for(let t of i.getAll(e))r.append(e,t);let a=r.toString();return a?`${n}?${a}`:n},$m=e=>{let t=nh(ih(e)),n=new URLSearchParams;for(let e of Zm)for(let r of t.getAll(e))n.append(e,r);let r=n.toString();return r?`?${r}`:``},eh=(e,t=`graph`)=>{let n=nh(e);return n.set(t,`1`),`${cs(J.DEBUG_TRACE)}?${n.toString()}`},th=e=>{let t=nh(e);t.delete(`store`);let n=t.toString();return`${cs(J.DEBUG_TRACE)}${n?`?${n}`:``}`},nh=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),rh=typeof location>`u`?``:location.search,ih=(e=``)=>{let t=nh(rh);for(let[n,r]of nh(e))t.set(n,r);return t.toString()},ah=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e).get(`uri`)??``,oh={PREQUEL:`SEQUEL`,ADAPTATION:`SOURCE`,COMPILATION:`CONTAINS`,SIDE_STORY:`PARENT`},sh=e=>{let t=new Set,n=[];for(let r of e){if(!r?.from||!r?.to||r.from===r.to)continue;let e=oh[r.relation],i=e?{from:r.to,to:r.from,relation:e}:r,a=`${i.from}\u0000${i.to}\u0000${i.relation}`;t.has(a)||(t.add(a),n.push(i))}return n},ch=new Set([`TV`,`TV_SHORT`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`,`MUSIC`]),lh=e=>!e||ch.has(e),uh=e=>[...new Set((e.nodes??[]).map(e=>e.format??``).filter(Boolean))].sort(),dh=(e,t)=>{let n=(e.nodes??[]).filter(t),r=new Set(n.map(e=>e.uri));return{nodes:n,edges:(e.edges??[]).filter(e=>r.has(e.from)&&r.has(e.to))}},fh=e=>`${e.from}\u0000${e.to}\u0000${e.relation}`,ph=(e,t)=>{if(!e)return{nodes:new Set,edges:new Set};if(e.kind===`node`){let n=t.filter(t=>t.from===e.uri||t.to===e.uri);return{nodes:new Set([e.uri]),edges:new Set(n.map(fh))}}let n=t.find(t=>fh(t)===e.key);return n?{nodes:new Set([n.from,n.to]),edges:new Set([e.key])}:{nodes:new Set,edges:new Set}},mh=e=>e.titles?.[0]?.title||e.uri,hh=e=>[...e].sort((e,t)=>(e.startDate??`9999`).localeCompare(t.startDate??`9999`)||mh(e).localeCompare(mh(t))),gh=(e,t)=>{let n=new Map(e.map(e=>[e.uri,0]));for(let r=0;r<e.length;r++){let e=!1;for(let r of t){let t=n.get(r.from),i=n.get(r.to);t!==void 0&&i!==void 0&&i<t+1&&(n.set(r.to,t+1),e=!0)}if(!e)break}let r=[...new Set(n.values())].sort((e,t)=>e-t),i=new Map(r.map((e,t)=>[e,t]));for(let[e,t]of n)n.set(e,i.get(t)??0);return n},_h=(e,t=`story`)=>{let n=sh(e.edges??[]),r=new Set((e.nodes??[]).map(e=>e.uri)),i=n.filter(e=>r.has(e.from)&&r.has(e.to)),a=hh(e.nodes??[]),o=t===`graph`?gh(a,i):void 0,s=[...new Set(a.map(e=>e.startDate??``))],c=new Map(s.map((e,t)=>[e,t])),l=new Map,u=a.map(e=>{let t=o?o.get(e.uri)??0:c.get(e.startDate??``)??0,n=l.get(t)??0;return l.set(t,n+1),{...e,column:t,row:n}}),d=[];if(t===`story`)for(let e=0;e<u.length-1;e++){let t=u[e],n=u[e+1];n.column>t.column&&d.push({from:t.uri,to:n.uri})}return{nodes:u,edges:i,chain:d,columns:Math.max(0,...u.map(e=>e.column+1)),rows:Math.max(0,...l.values())}},vh={ADAPTATION:`Adaptation`,PREQUEL:`Prequel`,SEQUEL:`Sequel`,PARENT:`Parent story`,SIDE_STORY:`Side story`,CHARACTER:`Character`,SUMMARY:`Summary`,ALTERNATIVE:`Alternative`,SPIN_OFF:`Spin off`,SOURCE:`Source`,COMPILATION:`Compilation`,CONTAINS:`Contains`,OTHER:`Related`},yh=[`SOURCE`,`PREQUEL`,`SEQUEL`,`PARENT`,`SIDE_STORY`,`SPIN_OFF`,`ALTERNATIVE`,`ADAPTATION`,`SUMMARY`,`COMPILATION`,`CONTAINS`,`CHARACTER`,`OTHER`],bh=e=>{let t=yh.indexOf(e);return t===-1?yh.length:t},xh=e=>e&&vh[e]||vh.OTHER,Sh={TV:`TV`,TV_SHORT:`TV Short`,MOVIE:`Movie`,SPECIAL:`Special`,OVA:`OVA`,ONA:`ONA`,MUSIC:`Music`,MANGA:`Manga`,NOVEL:`Light Novel`,ONE_SHOT:`One Shot`},Ch=e=>e?Sh[e]||e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):void 0,wh=e=>[...e].sort((e,t)=>bh(e.relation)-bh(t.relation)),Th=e=>e.filter(e=>lh(e.format)),Eh=e=>{let t=wh(e);return{before:t.filter(e=>e.relation===`PREQUEL`),middle:t.filter(e=>e.relation!==`PREQUEL`&&e.relation!==`SEQUEL`),after:t.filter(e=>e.relation===`SEQUEL`)}},Dh=x`
1023
+ `,Zm=({children:e,collapsedHeight:t=200,...n})=>{let[r,i]=B(!1),[a,o]=B(!1),s=R(null),[c,l]=B(0);O(()=>{if(!s.current)return;let e=new ResizeObserver(()=>{if(s.current){let e=s.current.scrollHeight;l(e),o(e>t)}});return e.observe(s.current),()=>e.disconnect()},[t]);let u=()=>i(!r);return k(`div`,{...n,ref:s,css:Xm,className:`${n.className||``} ${!r&&a?`collapsed`:`expanded`}`,children:[U(`div`,{className:`content`,children:e}),a&&!r?U(`div`,{className:`fade-overlay`}):void 0,a?U(`button`,{className:`toggle-button`,onClick:u,children:r?`Collapse`:`Expand`}):void 0]})},Qm=`this build of the worker exposes no traceGraph, so there is nothing to read a trace from`,$m=async()=>await Ne(()=>import(`./worker-BqPITUlQ.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),eh=async e=>{let t=await $m();if(typeof t.traceGraph!=`function`)throw Error(Qm);return t.traceGraph(e)},th=async e=>{let t=await $m();if(typeof t.traceAnswer!=`function`)throw Error(Qm);return t.traceAnswer(e)},nh=[`graph`,`store`],rh=({uri:e,search:t}={})=>{let n=ps(J.DEBUG_TRACE),r=new URLSearchParams;e&&r.set(`uri`,e);let i=sh(t??``);for(let e of nh)for(let t of i.getAll(e))r.append(e,t);let a=r.toString();return a?`${n}?${a}`:n},ih=e=>{let t=sh(lh(e)),n=new URLSearchParams;for(let e of nh)for(let r of t.getAll(e))n.append(e,r);let r=n.toString();return r?`?${r}`:``},ah=(e,t=`graph`)=>{let n=sh(e);return n.set(t,`1`),`${ps(J.DEBUG_TRACE)}?${n.toString()}`},oh=e=>{let t=sh(e);t.delete(`store`);let n=t.toString();return`${ps(J.DEBUG_TRACE)}${n?`?${n}`:``}`},sh=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e),ch=typeof location>`u`?``:location.search,lh=(e=``)=>{let t=sh(ch);for(let[n,r]of sh(e))t.set(n,r);return t.toString()},uh=e=>new URLSearchParams(e.startsWith(`?`)?e.slice(1):e).get(`uri`)??``,dh={PREQUEL:`SEQUEL`,ADAPTATION:`SOURCE`,COMPILATION:`CONTAINS`,SIDE_STORY:`PARENT`},fh=e=>{let t=new Set,n=[];for(let r of e){if(!r?.from||!r?.to||r.from===r.to)continue;let e=dh[r.relation],i=e?{from:r.to,to:r.from,relation:e}:r,a=`${i.from}\u0000${i.to}\u0000${i.relation}`;t.has(a)||(t.add(a),n.push(i))}return n},ph=new Set([`TV`,`TV_SHORT`,`MOVIE`,`SPECIAL`,`OVA`,`ONA`,`MUSIC`]),mh=e=>!e||ph.has(e),hh=e=>[...new Set((e.nodes??[]).map(e=>e.format??``).filter(Boolean))].sort(),gh=(e,t)=>{let n=(e.nodes??[]).filter(t),r=new Set(n.map(e=>e.uri));return{nodes:n,edges:(e.edges??[]).filter(e=>r.has(e.from)&&r.has(e.to))}},_h=e=>`${e.from}\u0000${e.to}\u0000${e.relation}`,vh=(e,t)=>{if(!e)return{nodes:new Set,edges:new Set};if(e.kind===`node`){let n=t.filter(t=>t.from===e.uri||t.to===e.uri);return{nodes:new Set([e.uri]),edges:new Set(n.map(_h))}}let n=t.find(t=>_h(t)===e.key);return n?{nodes:new Set([n.from,n.to]),edges:new Set([e.key])}:{nodes:new Set,edges:new Set}},yh=e=>e.titles?.[0]?.title||e.uri,bh=e=>[...e].sort((e,t)=>(e.startDate??`9999`).localeCompare(t.startDate??`9999`)||yh(e).localeCompare(yh(t))),xh=(e,t)=>{let n=new Map(e.map(e=>[e.uri,0]));for(let r=0;r<e.length;r++){let e=!1;for(let r of t){let t=n.get(r.from),i=n.get(r.to);t!==void 0&&i!==void 0&&i<t+1&&(n.set(r.to,t+1),e=!0)}if(!e)break}let r=[...new Set(n.values())].sort((e,t)=>e-t),i=new Map(r.map((e,t)=>[e,t]));for(let[e,t]of n)n.set(e,i.get(t)??0);return n},Sh=(e,t=`story`)=>{let n=fh(e.edges??[]),r=new Set((e.nodes??[]).map(e=>e.uri)),i=n.filter(e=>r.has(e.from)&&r.has(e.to)),a=bh(e.nodes??[]),o=t===`graph`?xh(a,i):void 0,s=[...new Set(a.map(e=>e.startDate??``))],c=new Map(s.map((e,t)=>[e,t])),l=new Map,u=a.map(e=>{let t=o?o.get(e.uri)??0:c.get(e.startDate??``)??0,n=l.get(t)??0;return l.set(t,n+1),{...e,column:t,row:n}}),d=[];if(t===`story`)for(let e=0;e<u.length-1;e++){let t=u[e],n=u[e+1];n.column>t.column&&d.push({from:t.uri,to:n.uri})}return{nodes:u,edges:i,chain:d,columns:Math.max(0,...u.map(e=>e.column+1)),rows:Math.max(0,...l.values())}},Ch={ADAPTATION:`Adaptation`,PREQUEL:`Prequel`,SEQUEL:`Sequel`,PARENT:`Parent story`,SIDE_STORY:`Side story`,CHARACTER:`Character`,SUMMARY:`Summary`,ALTERNATIVE:`Alternative`,SPIN_OFF:`Spin off`,SOURCE:`Source`,COMPILATION:`Compilation`,CONTAINS:`Contains`,OTHER:`Related`},wh=[`SOURCE`,`PREQUEL`,`SEQUEL`,`PARENT`,`SIDE_STORY`,`SPIN_OFF`,`ALTERNATIVE`,`ADAPTATION`,`SUMMARY`,`COMPILATION`,`CONTAINS`,`CHARACTER`,`OTHER`],Th=e=>{let t=wh.indexOf(e);return t===-1?wh.length:t},Eh=e=>e&&Ch[e]||Ch.OTHER,Dh={TV:`TV`,TV_SHORT:`TV Short`,MOVIE:`Movie`,SPECIAL:`Special`,OVA:`OVA`,ONA:`ONA`,MUSIC:`Music`,MANGA:`Manga`,NOVEL:`Light Novel`,ONE_SHOT:`One Shot`},Oh=e=>e?Dh[e]||e.split(`_`).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):void 0,kh=e=>[...e].sort((e,t)=>Th(e.relation)-Th(t.relation)),Ah=e=>e.filter(e=>mh(e.format)),jh=e=>{let t=kh(e);return{before:t.filter(e=>e.relation===`PREQUEL`),middle:t.filter(e=>e.relation!==`PREQUEL`&&e.relation!==`SEQUEL`),after:t.filter(e=>e.relation===`SEQUEL`)}},Mh=x`
1024
1024
  margin-top: 4rem;
1025
1025
 
1026
1026
  & > .heading {
@@ -1061,7 +1061,7 @@ transition: max-height 0.3s ease-in-out;
1061
1061
  @media (max-width: 768px) {
1062
1062
  & > .grid > .lane { flex: 1 1 100%; justify-content: flex-start; }
1063
1063
  }
1064
- `,Oh=x`
1064
+ `,Nh=x`
1065
1065
  /* A card sized itself off the grid track until the lanes replaced it, so it needs its own basis
1066
1066
  now. 28rem is the track's old minimum, and shrinking is left on so a narrow modal wraps rather
1067
1067
  than overflows. */
@@ -1122,13 +1122,13 @@ transition: max-height 0.3s ease-in-out;
1122
1122
  font-size: 1.25rem;
1123
1123
  color: rgba(255, 255, 255, 0.55);
1124
1124
  }
1125
- `,kh=({edge:e,search:t})=>{let n=dm(e.node.covers),r=e.node.titles?.at(0)?.title,i=[Ch(e.format),tc(e.node.status)].filter(Boolean).join(` · `);return k(ts,{className:`relation-card`,css:Oh,to:`${cs(J.MEDIA,{uri:ve(e.node.uri)})}${t}`,children:[n?U(`img`,{className:`cover`,src:n,alt:``}):U(`div`,{className:`cover`}),k(`div`,{className:`body`,children:[U(`div`,{className:`relation`,children:xh(e.relation)}),U(`div`,{className:`title`,children:r??e.node.uri}),i?U(`div`,{className:`meta`,children:i}):void 0]})]})},Ah=({relations:e,action:t})=>{let n=$m(Jo()),r=Th(e);if(!r.length)return null;let i=Eh(r);return k(`div`,{css:Dh,"data-relations":!0,children:[k(`div`,{className:`heading`,children:[U(`span`,{children:`Relations`}),t]}),U(`div`,{className:`grid`,children:[`before`,`middle`,`after`].map(e=>U(`div`,{className:`lane ${e}`,children:i[e].map(e=>U(kh,{edge:e,search:n},`${e.relation}:${e.node.uri}`))},e))})]})};function jh(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=jh(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Mh={value:()=>{}};function Nh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new Ph(n)}function Ph(e){this._=e}function Fh(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}Ph.prototype=Nh.prototype={constructor:Ph,on:function(e,t){var n=this._,r=Fh(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Ih(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Lh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Lh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Ph(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Ih(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Lh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Mh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Rh={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function zh(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Rh.hasOwnProperty(t)?{space:Rh[t],local:e}:e}function Bh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Vh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Hh(e){var t=zh(e);return(t.local?Vh:Bh)(t)}function Uh(){}function Wh(e){return e==null?Uh:function(){return this.querySelector(e)}}function Gh(e){typeof e!=`function`&&(e=Wh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new N_(r,this._parents)}function Kh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qh(){return[]}function Jh(e){return e==null?qh:function(){return this.querySelectorAll(e)}}function Yh(e){return function(){return Kh(e.apply(this,arguments))}}function Xh(e){e=typeof e==`function`?Yh(e):Jh(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new N_(r,i)}function Zh(e){return function(){return this.matches(e)}}function Qh(e){return function(t){return t.matches(e)}}var $h=Array.prototype.find;function eg(e){return function(){return $h.call(this.children,e)}}function tg(){return this.firstElementChild}function ng(e){return this.select(e==null?tg:eg(typeof e==`function`?e:Qh(e)))}var rg=Array.prototype.filter;function ig(){return Array.from(this.children)}function ag(e){return function(){return rg.call(this.children,e)}}function og(e){return this.selectAll(e==null?ig:ag(typeof e==`function`?e:Qh(e)))}function sg(e){typeof e!=`function`&&(e=Zh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new N_(r,this._parents)}function cg(e){return Array(e.length)}function lg(){return new N_(this._enter||this._groups.map(cg),this._parents)}function ug(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}ug.prototype={constructor:ug,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function dg(e){return function(){return e}}function fg(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new ug(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function pg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new ug(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function mg(e){return e.__data__}function hg(e,t){if(!arguments.length)return Array.from(this,mg);var n=t?pg:fg,r=this._parents,i=this._groups;typeof e!=`function`&&(e=dg(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=gg(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new N_(o,r),o._enter=s,o._exit=c,o}function gg(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function _g(){return new N_(this._exit||this._groups.map(cg),this._parents)}function vg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function yg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new N_(s,this._parents)}function bg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function xg(e){e||=Sg;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new N_(i,this._parents).order()}function Sg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Cg(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function wg(){return Array.from(this)}function Tg(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function Eg(){let e=0;for(let t of this)++e;return e}function Dg(){return!this.node()}function Og(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function kg(e){return function(){this.removeAttribute(e)}}function Ag(e){return function(){this.removeAttributeNS(e.space,e.local)}}function jg(e,t){return function(){this.setAttribute(e,t)}}function Mg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Ng(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function Pg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Fg(e,t){var n=zh(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Ag:kg:typeof t==`function`?n.local?Pg:Ng:n.local?Mg:jg)(n,t))}function Ig(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Lg(e){return function(){this.style.removeProperty(e)}}function Rg(e,t,n){return function(){this.style.setProperty(e,t,n)}}function zg(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Bg(e,t,n){return arguments.length>1?this.each((t==null?Lg:typeof t==`function`?zg:Rg)(e,t,n??``)):Vg(this.node(),e)}function Vg(e,t){return e.style.getPropertyValue(t)||Ig(e).getComputedStyle(e,null).getPropertyValue(t)}function Hg(e){return function(){delete this[e]}}function Ug(e,t){return function(){this[e]=t}}function Wg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Gg(e,t){return arguments.length>1?this.each((t==null?Hg:typeof t==`function`?Wg:Ug)(e,t)):this.node()[e]}function Kg(e){return e.trim().split(/^|\s+/)}function qg(e){return e.classList||new Jg(e)}function Jg(e){this._node=e,this._names=Kg(e.getAttribute(`class`)||``)}Jg.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function Yg(e,t){for(var n=qg(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function Xg(e,t){for(var n=qg(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function Zg(e){return function(){Yg(this,e)}}function Qg(e){return function(){Xg(this,e)}}function $g(e,t){return function(){(t.apply(this,arguments)?Yg:Xg)(this,e)}}function e_(e,t){var n=Kg(e+``);if(arguments.length<2){for(var r=qg(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?$g:t?Zg:Qg)(n,t))}function t_(){this.textContent=``}function n_(e){return function(){this.textContent=e}}function r_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function i_(e){return arguments.length?this.each(e==null?t_:(typeof e==`function`?r_:n_)(e)):this.node().textContent}function a_(){this.innerHTML=``}function o_(e){return function(){this.innerHTML=e}}function s_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function c_(e){return arguments.length?this.each(e==null?a_:(typeof e==`function`?s_:o_)(e)):this.node().innerHTML}function l_(){this.nextSibling&&this.parentNode.appendChild(this)}function u_(){return this.each(l_)}function d_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function f_(){return this.each(d_)}function p_(e){var t=typeof e==`function`?e:Hh(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function m_(){return null}function h_(e,t){var n=typeof e==`function`?e:Hh(e),r=t==null?m_:typeof t==`function`?t:Wh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function g_(){var e=this.parentNode;e&&e.removeChild(this)}function __(){return this.each(g_)}function v_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function y_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function b_(e){return this.select(e?y_:v_)}function x_(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function S_(e){return function(t){e.call(this,t,this.__data__)}}function C_(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function w_(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function T_(e,t,n){return function(){var r=this.__on,i,a=S_(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function E_(e,t,n){var r=C_(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?T_:w_,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function D_(e,t,n){var r=Ig(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function O_(e,t){return function(){return D_(this,e,t)}}function k_(e,t){return function(){return D_(this,e,t.apply(this,arguments))}}function A_(e,t){return this.each((typeof t==`function`?k_:O_)(e,t))}function*j_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var M_=[null];function N_(e,t){this._groups=e,this._parents=t}function P_(){return new N_([[document.documentElement]],M_)}function F_(){return this}N_.prototype=P_.prototype={constructor:N_,select:Gh,selectAll:Xh,selectChild:ng,selectChildren:og,filter:sg,data:hg,enter:lg,exit:_g,join:vg,merge:yg,selection:F_,order:bg,sort:xg,call:Cg,nodes:wg,node:Tg,size:Eg,empty:Dg,each:Og,attr:Fg,style:Bg,property:Gg,classed:e_,text:i_,html:c_,raise:u_,lower:f_,append:p_,insert:h_,remove:__,clone:b_,datum:x_,on:E_,dispatch:A_,[Symbol.iterator]:j_};function I_(e){return typeof e==`string`?new N_([[document.querySelector(e)]],[document.documentElement]):new N_([[e]],M_)}function L_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function R_(e,t){if(e=L_(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var z_={passive:!1},B_={capture:!0,passive:!1};function V_(e){e.stopImmediatePropagation()}function H_(e){e.preventDefault(),e.stopImmediatePropagation()}function U_(e){var t=e.document.documentElement,n=I_(e).on(`dragstart.drag`,H_,B_);`onselectstart`in t?n.on(`selectstart.drag`,H_,B_):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function W_(e,t){var n=e.document.documentElement,r=I_(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,H_,B_),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var G_=e=>()=>e;function K_(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}K_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function q_(e){return!e.ctrlKey&&!e.button}function J_(){return this.parentNode}function Y_(e,t){return t??{x:e.x,y:e.y}}function X_(){return navigator.maxTouchPoints||`ontouchstart`in this}function Z_(){var e=q_,t=J_,n=Y_,r=X_,i={},a=Nh(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,z_).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(I_(n.view).on(`mousemove.drag`,m,B_).on(`mouseup.drag`,h,B_),U_(n.view),V_(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(H_(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){I_(e.view).on(`mousemove.drag mouseup.drag`,null),W_(e.view,l),H_(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(V_(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(H_(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(V_(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=R_(l||r,t),p,m,h;if((h=n.call(e,new K_(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=R_(l||a,t),_=o}u.call(r,e,new K_(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:G_(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:G_(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:G_(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:G_(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function Q_(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function $_(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function ev(){}var tv=.7,nv=1/tv,rv=`\\s*([+-]?\\d+)\\s*`,iv=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,av=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,ov=/^#([0-9a-f]{3,8})$/,sv=RegExp(`^rgb\\(${rv},${rv},${rv}\\)$`),cv=RegExp(`^rgb\\(${av},${av},${av}\\)$`),lv=RegExp(`^rgba\\(${rv},${rv},${rv},${iv}\\)$`),uv=RegExp(`^rgba\\(${av},${av},${av},${iv}\\)$`),dv=RegExp(`^hsl\\(${iv},${av},${av}\\)$`),fv=RegExp(`^hsla\\(${iv},${av},${av},${iv}\\)$`),pv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Q_(ev,vv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:mv,formatHex:mv,formatHex8:hv,formatHsl:gv,formatRgb:_v,toString:_v});function mv(){return this.rgb().formatHex()}function hv(){return this.rgb().formatHex8()}function gv(){return jv(this).formatHsl()}function _v(){return this.rgb().formatRgb()}function vv(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=ov.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?yv(t):n===3?new Cv(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?bv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?bv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=sv.exec(e))?new Cv(t[1],t[2],t[3],1):(t=cv.exec(e))?new Cv(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=lv.exec(e))?bv(t[1],t[2],t[3],t[4]):(t=uv.exec(e))?bv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=dv.exec(e))?Av(t[1],t[2]/100,t[3]/100,1):(t=fv.exec(e))?Av(t[1],t[2]/100,t[3]/100,t[4]):pv.hasOwnProperty(e)?yv(pv[e]):e===`transparent`?new Cv(NaN,NaN,NaN,0):null}function yv(e){return new Cv(e>>16&255,e>>8&255,e&255,1)}function bv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Cv(e,t,n,r)}function xv(e){return e instanceof ev||(e=vv(e)),e?(e=e.rgb(),new Cv(e.r,e.g,e.b,e.opacity)):new Cv}function Sv(e,t,n,r){return arguments.length===1?xv(e):new Cv(e,t,n,r??1)}function Cv(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Q_(Cv,Sv,$_(ev,{brighter(e){return e=e==null?nv:nv**+e,new Cv(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?tv:tv**+e,new Cv(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Cv(Ov(this.r),Ov(this.g),Ov(this.b),Dv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:wv,formatHex:wv,formatHex8:Tv,formatRgb:Ev,toString:Ev}));function wv(){return`#${kv(this.r)}${kv(this.g)}${kv(this.b)}`}function Tv(){return`#${kv(this.r)}${kv(this.g)}${kv(this.b)}${kv((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ev(){let e=Dv(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Ov(this.r)}, ${Ov(this.g)}, ${Ov(this.b)}${e===1?`)`:`, ${e})`}`}function Dv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ov(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function kv(e){return e=Ov(e),(e<16?`0`:``)+e.toString(16)}function Av(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Nv(e,t,n,r)}function jv(e){if(e instanceof Nv)return new Nv(e.h,e.s,e.l,e.opacity);if(e instanceof ev||(e=vv(e)),!e)return new Nv;if(e instanceof Nv)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Nv(o,s,c,e.opacity)}function Mv(e,t,n,r){return arguments.length===1?jv(e):new Nv(e,t,n,r??1)}function Nv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Q_(Nv,Mv,$_(ev,{brighter(e){return e=e==null?nv:nv**+e,new Nv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?tv:tv**+e,new Nv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Cv(Iv(e>=240?e-240:e+120,i,r),Iv(e,i,r),Iv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Nv(Pv(this.h),Fv(this.s),Fv(this.l),Dv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Dv(this.opacity);return`${e===1?`hsl(`:`hsla(`}${Pv(this.h)}, ${Fv(this.s)*100}%, ${Fv(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function Pv(e){return e=(e||0)%360,e<0?e+360:e}function Fv(e){return Math.max(0,Math.min(1,e||0))}function Iv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Lv=e=>()=>e;function Rv(e,t){return function(n){return e+n*t}}function zv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Bv(e){return(e=+e)==1?Vv:function(t,n){return n-t?zv(t,n,e):Lv(isNaN(t)?n:t)}}function Vv(e,t){var n=t-e;return n?Rv(e,n):Lv(isNaN(e)?t:e)}var Hv=(function e(t){var n=Bv(t);function r(e,t){var r=n((e=Sv(e)).r,(t=Sv(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Vv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Uv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Wv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Gv(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ey(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Kv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function qv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Jv(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ey(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var Yv=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Xv=new RegExp(Yv.source,`g`);function Zv(e){return function(){return e}}function Qv(e){return function(t){return e(t)+``}}function $v(e,t){var n=Yv.lastIndex=Xv.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=Yv.exec(e))&&(i=Xv.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:qv(r,i)})),n=Xv.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?Qv(c[0].x):Zv(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ey(e,t){var n=typeof t,r;return t==null||n===`boolean`?Lv(t):(n===`number`?qv:n===`string`?(r=vv(t))?(t=r,Hv):$v:t instanceof vv?Hv:t instanceof Date?Kv:Wv(t)?Uv:Array.isArray(t)?Gv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?Jv:qv)(e,t)}var ty=180/Math.PI,ny={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function ry(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*ty,skewX:Math.atan(c)*ty,scaleX:o,scaleY:s}}var iy;function ay(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?ny:ry(t.a,t.b,t.c,t.d,t.e,t.f)}function oy(e){return e==null||(iy||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),iy.setAttribute(`transform`,e),!(e=iy.transform.baseVal.consolidate()))?ny:(e=e.matrix,ry(e.a,e.b,e.c,e.d,e.e,e.f))}function sy(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:qv(e,i)},{i:c-2,x:qv(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:qv(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:qv(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:qv(e,n)},{i:s-2,x:qv(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var cy=sy(ay,`px, `,`px)`,`deg)`),ly=sy(oy,`, `,`)`,`)`),uy=1e-12;function dy(e){return((e=Math.exp(e))+1/e)/2}function fy(e){return((e=Math.exp(e))-1/e)/2}function py(e){return((e=Math.exp(2*e))-1)/(e+1)}var my=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<uy)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=dy(y),c=s/(n*g)*(i*py(t*r+y)-fy(y));return[a+c*d,o+c*f,s*i/dy(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),hy=0,gy=0,_y=0,vy=1e3,yy,by,xy=0,Sy=0,Cy=0,wy=typeof performance==`object`&&performance.now?performance:Date,Ty=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ey(){return Sy||=(Ty(Dy),wy.now()+Cy)}function Dy(){Sy=0}function Oy(){this._call=this._time=this._next=null}Oy.prototype=ky.prototype={constructor:Oy,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?Ey():+n)+(t==null?0:+t),!this._next&&by!==this&&(by?by._next=this:yy=this,by=this),this._call=e,this._time=n,Py()},stop:function(){this._call&&(this._call=null,this._time=1/0,Py())}};function ky(e,t,n){var r=new Oy;return r.restart(e,t,n),r}function Ay(){Ey(),++hy;for(var e=yy,t;e;)(t=Sy-e._time)>=0&&e._call.call(void 0,t),e=e._next;--hy}function jy(){Sy=(xy=wy.now())+Cy,hy=gy=0;try{Ay()}finally{hy=0,Ny(),Sy=0}}function My(){var e=wy.now(),t=e-xy;t>vy&&(Cy-=t,xy=e)}function Ny(){for(var e,t=yy,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:yy=n);by=e,Py(r)}function Py(e){hy||(gy&&=clearTimeout(gy),e-Sy>24?(e<1/0&&(gy=setTimeout(jy,e-wy.now()-Cy)),_y&&=clearInterval(_y)):(_y||=(xy=wy.now(),setInterval(My,vy)),hy=1,Ty(jy)))}function Fy(e,t,n){var r=new Oy;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Iy=Nh(`start`,`end`,`cancel`,`interrupt`),Ly=[];function Ry(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;Hy(e,n,{name:t,index:r,group:i,on:Iy,tween:Ly,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function zy(e,t){var n=Vy(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function By(e,t){var n=Vy(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Vy(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function Hy(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=ky(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return Fy(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(Fy(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Uy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Wy(e){return this.each(function(){Uy(this,e)})}function Gy(e,t){var n,r;return function(){var i=By(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Ky(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=By(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function qy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Vy(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Gy:Ky)(n,e,t))}function Jy(e,t,n){var r=e._id;return e.each(function(){var e=By(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Vy(e,r).value[t]}}function Yy(e,t){var n;return(typeof t==`number`?qv:t instanceof vv?Hv:(n=vv(t))?(t=n,Hv):$v)(e,t)}function Xy(e){return function(){this.removeAttribute(e)}}function Zy(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Qy(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function $y(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function eb(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function tb(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function nb(e,t){var n=zh(e),r=n===`transform`?ly:Yy;return this.attrTween(e,typeof t==`function`?(n.local?tb:eb)(n,r,Jy(this,`attr.`+e,t)):t==null?(n.local?Zy:Xy)(n):(n.local?$y:Qy)(n,r,t))}function rb(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function ib(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ab(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&ib(e,i)),n}return i._value=t,i}function ob(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&rb(e,i)),n}return i._value=t,i}function sb(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=zh(e);return this.tween(n,(r.local?ab:ob)(r,t))}function cb(e,t){return function(){zy(this,e).delay=+t.apply(this,arguments)}}function lb(e,t){return t=+t,function(){zy(this,e).delay=t}}function ub(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?cb:lb)(t,e)):Vy(this.node(),t).delay}function db(e,t){return function(){By(this,e).duration=+t.apply(this,arguments)}}function fb(e,t){return t=+t,function(){By(this,e).duration=t}}function pb(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?db:fb)(t,e)):Vy(this.node(),t).duration}function mb(e,t){if(typeof t!=`function`)throw Error();return function(){By(this,e).ease=t}}function hb(e){var t=this._id;return arguments.length?this.each(mb(t,e)):Vy(this.node(),t).ease}function gb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();By(this,e).ease=n}}function _b(e){if(typeof e!=`function`)throw Error();return this.each(gb(this._id,e))}function vb(e){typeof e!=`function`&&(e=Zh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new qb(r,this._parents,this._name,this._id)}function yb(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new qb(o,this._parents,this._name,this._id)}function bb(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function xb(e,t,n){var r,i,a=bb(t)?zy:By;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Sb(e,t){var n=this._id;return arguments.length<2?Vy(this.node(),n).on.on(e):this.each(xb(n,e,t))}function Cb(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function wb(){return this.on(`end.remove`,Cb(this._id))}function Tb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Wh(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Ry(l[f],t,n,f,l,Vy(u,n)));return new qb(a,this._parents,t,n)}function Eb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Jh(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Vy(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Ry(p,t,n,h,f,m);a.push(f),o.push(u)}return new qb(a,o,t,n)}var Db=P_.prototype.constructor;function Ob(){return new Db(this._groups,this._parents)}function kb(e,t){var n,r,i;return function(){var a=Vg(this,e),o=(this.style.removeProperty(e),Vg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Ab(e){return function(){this.style.removeProperty(e)}}function jb(e,t,n){var r,i=n+``,a;return function(){var o=Vg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Mb(e,t,n){var r,i,a;return function(){var o=Vg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Vg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Nb(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=By(this,e),l=c.on,u=c.value[a]==null?s||=Ab(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function Pb(e,t,n){var r=(e+=``)==`transform`?cy:Yy;return t==null?this.styleTween(e,kb(e,r)).on(`end.style.`+e,Ab(e)):typeof t==`function`?this.styleTween(e,Mb(e,r,Jy(this,`style.`+e,t))).each(Nb(this._id,e)):this.styleTween(e,jb(e,r,t),n).on(`end.style.`+e,null)}function Fb(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Ib(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Fb(e,a,n)),r}return a._value=t,a}function Lb(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Ib(e,t,n??``))}function Rb(e){return function(){this.textContent=e}}function zb(e){return function(){var t=e(this);this.textContent=t??``}}function Bb(e){return this.tween(`text`,typeof e==`function`?zb(Jy(this,`text`,e)):Rb(e==null?``:e+``))}function Vb(e){return function(t){this.textContent=e.call(this,t)}}function Hb(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Vb(r)),t}return r._value=e,r}function Ub(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,Hb(e))}function Wb(){for(var e=this._name,t=this._id,n=Jb(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Vy(c,t);Ry(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new qb(r,this._parents,e,n)}function Gb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=By(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Kb=0;function qb(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function Jb(){return++Kb}var Yb=P_.prototype;qb.prototype={constructor:qb,select:Tb,selectAll:Eb,selectChild:Yb.selectChild,selectChildren:Yb.selectChildren,filter:vb,merge:yb,selection:Ob,transition:Wb,call:Yb.call,nodes:Yb.nodes,node:Yb.node,size:Yb.size,empty:Yb.empty,each:Yb.each,on:Sb,attr:nb,attrTween:sb,style:Pb,styleTween:Lb,text:Bb,textTween:Ub,remove:wb,tween:qy,delay:ub,duration:pb,ease:hb,easeVarying:_b,end:Gb,[Symbol.iterator]:Yb[Symbol.iterator]};function Xb(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Zb={time:null,delay:0,duration:250,ease:Xb};function Qb(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function $b(e){var t,n;e instanceof qb?(t=e._id,e=e._name):(t=Jb(),(n=Zb).time=Ey(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Ry(c,e,t,l,o,n||Qb(c,t));return new qb(r,this._parents,e,t)}P_.prototype.interrupt=Wy,P_.prototype.transition=$b;var ex=e=>()=>e;function tx(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function nx(e,t,n){this.k=e,this.x=t,this.y=n}nx.prototype={constructor:nx,scale:function(e){return e===1?this:new nx(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new nx(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var rx=new nx(1,0,0);ix.prototype=nx.prototype;function ix(e){for(;!e.__zoom;)if(!(e=e.parentNode))return rx;return e.__zoom}function ax(e){e.stopImmediatePropagation()}function ox(e){e.preventDefault(),e.stopImmediatePropagation()}function sx(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function cx(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function lx(){return this.__zoom||rx}function ux(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dx(){return navigator.maxTouchPoints||`ontouchstart`in this}function fx(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function px(){var e=sx,t=cx,n=fx,r=ux,i=dx,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=my,l=Nh(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,lx).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,lx),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(rx.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new nx(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new nx(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new nx(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=I_(this.that).datum();l.call(e,this.that,new tx(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=R_(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Uy(this),s.start();ox(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=I_(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=R_(t,i),l=t.clientX,u=t.clientY;U_(t.view),ax(t),a.mouse=[c,this.__zoom.invert(c)],Uy(this),a.start();function d(e){if(ox(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=R_(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),W_(e.view,a.moved),ox(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=R_(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);ox(r),s>0?I_(this).transition().duration(s).call(x,d,c,r):I_(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(ax(t),s=0;s<i;++s)c=r[s],l=R_(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Uy(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(ox(e),s=0;s<a;++s)c=i[s],l=R_(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(ax(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=R_(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=I_(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ex(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ex(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ex(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ex([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var mx={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},hx=[[-1/0,-1/0],[1/0,1/0]],gx=[`Enter`,` `,`Escape`],_x={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},vx;(function(e){e.Strict=`strict`,e.Loose=`loose`})(vx||={});var yx;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(yx||={});var bx;(function(e){e.Partial=`partial`,e.Full=`full`})(bx||={});var xx={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Sx;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Sx||={});var Cx;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Cx||={});var Z;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Z||={});var wx={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},Tx=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,Ex=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),Dx=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Ox=(e,t=[0,0])=>{let{width:n,height:r}=cS(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},kx=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):Dx(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,Hx(e,Kx(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Wx(r):{x:0,y:0,width:0,height:0}},Ax=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=Hx(n,Kx(e)),r=!0)}),r?Wx(n):{x:0,y:0,width:0,height:0}},jx=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=Jx(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Mx=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Nx(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=cS(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function Px({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=aS(Ax(Nx(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function Fx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,mx.error005());else{let{width:e,height:t}=cS(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&sS(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=sS(d)?Rx(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,mx.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Ix({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Mx(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Lx=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Rx=(e={x:0,y:0},t,n)=>({x:Lx(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Lx(e.y,t[0][1],t[1][1]-(n?.height??0))});function zx(e,t,n){let{width:r,height:i}=cS(n),{x:a,y:o}=n.internals.positionAbsolute;return Rx(e,[[a,o],[a+r,o+i]],t)}var Bx=(e,t,n)=>e<t?Lx(Math.abs(e-t),1,t)/t:e>n?-Lx(Math.abs(e-n),1,t)/t:0,Vx=(e,t,n=15,r=40)=>[Bx(e.x,r,t.width-r)*n,Bx(e.y,r,t.height-r)*n],Hx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ux=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Wx=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Gx=(e,t=[0,0])=>{let{x:n,y:r}=Dx(e)?e.internals.positionAbsolute:Ox(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Kx=(e,t=[0,0])=>{let{x:n,y:r}=Dx(e)?e.internals.positionAbsolute:Ox(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},qx=(e,t)=>Wx(Hx(Ux(e),Ux(t))),Jx=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},Yx=(e,t)=>Jx(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),Xx=e=>Zx(e.width)&&Zx(e.height)&&Zx(e.x)&&Zx(e.y),Zx=e=>!isNaN(e)&&isFinite(e),Qx=(e,t)=>(e,t)=>{},$x=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),eS=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?$x(s,o):s},tS=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function nS(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function rS(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=nS(e,n),i=nS(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=nS(e.top??e.y??0,n),i=nS(e.bottom??e.y??0,n),a=nS(e.left??e.x??0,t),o=nS(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function iS(e,t,n,r,i,a){let{x:o,y:s}=tS(e,[t,n,r]),{x:c,y:l}=tS({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var aS=(e,t,n,r,i,a)=>{let o=rS(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Lx(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=iS(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},oS=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function sS(e){return e!=null&&e!==`parent`}function cS(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function lS(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function uS(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function dS(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function fS(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function pS(e){return{..._x,...e||{}}}function mS(e){return e===null?null:e?`valid`:`invalid`}function hS(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=xS(e),s=eS({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?$x(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var gS=e=>({width:e.offsetWidth,height:e.offsetHeight}),_S=e=>e?.getRootNode?.()||window?.document,vS=[`INPUT`,`SELECT`,`TEXTAREA`];function yS(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?vS.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var bS=e=>`clientX`in e,xS=(e,t)=>{let n=bS(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},SS=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...gS(t)}})};function CS({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function wS(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function TS({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Z.Left:return[t-wS(t-r,a),n];case Z.Right:return[t+wS(r-t,a),n];case Z.Top:return[t,n-wS(n-i,a)];case Z.Bottom:return[t,n+wS(i-n,a)]}}function ES({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,curvature:o=.25}){let[s,c]=TS({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=TS({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=CS({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function DS({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function OS({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function kS({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=Hx(Kx(e),Kx(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),Yx({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Wx(a))>0}var AS=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,jS=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),MS=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,mx.error006()),t;let r=n.getEdgeId||AS,i;return i=Tx(e)?{...e}:{...e,id:r(e)},jS(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function NS({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=DS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var PS={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},FS=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},IS=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function LS({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:a,stepPosition:o}){let s=PS[t],c=PS[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=FS({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=DS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function RS(e,t,n,r){let i=Math.min(IS(e,t)/2,IS(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function zS({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=LS({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=RS(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function BS(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function VS(e){let{sourceNode:t,targetNode:n}=e;if(!BS(t)||!BS(n))return null;let r=t.internals.handleBounds||HS(t.handles),i=n.internals.handleBounds||HS(n.handles),a=WS(r?.source??[],e.sourceHandle),o=WS(e.connectionMode===vx.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,mx.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Z.Bottom,c=o?.position||Z.Top,l=US(t,a,s),u=US(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function HS(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function US(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??cS(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Z.Top:return{x:i+o/2,y:a};case Z.Right:return{x:i+o,y:a+s/2};case Z.Bottom:return{x:i+o/2,y:a+s};case Z.Left:return{x:i,y:a+s/2}}}function WS(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function GS(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function KS(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=GS(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var qS=1e3,JS=10,YS={nodeOrigin:[0,0],nodeExtent:hx,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},XS={...YS,checkEquality:!0};function ZS(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function QS(e,t,n){let r=ZS(YS,n);for(let n of e.values())if(n.parentId)rC(n,e,t,r);else{let e=Rx(Ox(n,r.nodeOrigin),sS(n.extent)?n.extent:r.nodeExtent,cS(n));n.internals.positionAbsolute=e}}function $S(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function eC(e){return e===`manual`}function tC(e,t,n,r={}){let i=ZS(XS,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!eC(i.zIndexMode)?qS:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Rx(Ox(u,i.nodeOrigin),sS(u.extent)?u.extent:i.nodeExtent,cS(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:$S(u,e),z:iC(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&rC(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function nC(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function rC(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=ZS(YS,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}nC(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*JS),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=aC(e,u,o,s,a&&!eC(c)?qS:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function iC(e,t,n){let r=Zx(e.zIndex)?e.zIndex:0;return eC(n)?r:r+(e.selected?t:0)}function aC(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=cS(e),l=Ox(e,n),u=sS(e.extent)?Rx(l,e.extent,c):l,d=Rx({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=zx(d,c,t));let f=iC(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function oC(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=qx(a.get(n.parentId)?.expandedRect??Gx(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=cS(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function sC(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=gS(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=sS(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=zx(h,s,n))}else m&&(h=Rx(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:SS(`source`,r.nodeElement,p,d,e.id),target:SS(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&rC(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Gx(g,i)}))}}if(f.length>0){let e=oC(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function cC({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function lC(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function uC(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;lC(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),lC(`target`,s,c,e,i,o),t.set(r.id,r)}}function dC(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:dC(n,t):!1}function fC(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function pC(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!dC(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function mC({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function hC({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=$x(a,t);return{x:o.x-a.x,y:o.y-a.y}}function gC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=I_(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Ux(Ax(s)):null,x=v&&l?hC({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:$x(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Fx({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=mC({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Vx(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=hS(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=pC(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=mC({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=Z_().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=hS(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=xS(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=hS(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=xS(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=xS(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=mC({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!fC(t,`.${g}`,v))&&(!_||fC(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function _C(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())Yx(i,Gx(e))>0&&r.push(e);return r}var vC=250;function yC(e,t,n,r){let i=[],a=1/0,o=_C(e,n,t+vC);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=US(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function bC(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...US(o,c,c.position,!0)}:c}function xC(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function SC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var CC=()=>!0;function wC(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=CC,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=_S(e.target),E=0,D,{x:O,y:k}=xS(e),A=xC(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=bC(i,A,r,c,t);if(!N)return;let P=xS(e,j),ee=!1,te=null,ne=!1,re=null;function ie(){if(!u||!j)return;let[e,t]=Vx(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let F={...N,nodeId:i,type:A,position:N.position},ae=c.get(i),oe={inProgress:!0,isValid:null,from:US(ae,F,Z.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:ae,to:P,toHandle:null,toPosition:wx[F.position],toNode:null,pointer:P};function I(){M=!0,y(oe),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&I();function L(e){if(!M){let{x:t,y:n}=xS(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;I()}if(!x()||!F){se(e);return}let a=b();P=xS(e,j),D=yC(eS(P,a,!1,[1,1]),n,c,F),ee||=(ie(),!0);let s=TC(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,te=s.connection,ne=SC(!!D,s.isValid);let u=c.get(i),f=u?US(u,F,Z.Left,!0):oe.from,p={...oe,from:f,isValid:ne,to:s.toHandle&&ne?tS({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:wx[F.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),oe=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||re)&&te&&ne&&h?.(te);let{inProgress:t,...n}=oe,r={...n,toPosition:oe.toHandle?oe.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ee=!1,ne=!1,te=null,re=null,T.removeEventListener(`mousemove`,L),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,L),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,L),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,L),T.addEventListener(`touchend`,se)}function TC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=CC,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=xS(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=xC(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===vx.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=bC(t,e,a,u,n,!0)}return _}var EC={onPointerDown:wC,isValid:TC};function DC({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=I_(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&oS()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=px().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:R_}}var OC=e=>({x:e.x,y:e.y,zoom:e.k}),kC=({x:e,y:t,zoom:n})=>rx.translate(e,t).scale(n),AC=(e,t)=>e.target.closest(`.${t}`),jC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),MC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,NC=(e,t=0,n=MC,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},PC=e=>{let t=e.ctrlKey&&oS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function FC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(AC(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=R_(u),t=d*2**PC(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===yx.Vertical?0:u.deltaX*f,m=i===yx.Horizontal?0:u.deltaY*f;!oS()&&u.shiftKey&&i!==yx.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=OC(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function IC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=AC(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function LC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=OC(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function RC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&jC(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,OC(a.transform))}}function zC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&jC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=OC(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function BC({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(AC(f,`${u}-flow__node`)||AC(f,`${u}-flow__edge`)||AC(f,`${u}-flow__selection`)||AC(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||AC(f,c)&&h||AC(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function VC({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=px().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=I_(e).call(f);y({x:i.x,y:i.y,zoom:Lx(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(PC);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ey:my).transform(NC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!Zx(D)||D<0?0:D);let A=k?FC({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):IC({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=LC({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=RC({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=zC({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let P=BC({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(P),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=kC(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=kC(e);return await g(n,t),n}function x(e){if(p){let t=kC(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?ix(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ey:my).scaleTo(NC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ey:my).scaleBy(NC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!Zx(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var HC;(function(e){e.Line=`line`,e.Handle=`handle`})(HC||={});function UC({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function WC(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function GC(e,t){return Math.max(0,t-e)}function KC(e,t){return Math.max(0,e-t)}function qC(e,t,n){return Math.max(0,t-e,e-n)}function JC(e,t){return e?!t:t}function YC(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=qC(E,h,g),j=qC(D,_,v);if(o){let e=0,t=0;c&&w<0?e=GC(y+w+O,o[0][0]):!c&&w>0&&(e=KC(y+E+O,o[1][0])),l&&T<0?t=GC(b+T+k,o[0][1]):!l&&T>0&&(t=KC(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=KC(y+w,s[0][0]):!c&&w<0&&(e=GC(y+E,s[1][0])),l&&T>0?t=KC(b+T,s[0][1]):!l&&T<0&&(t=GC(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=qC(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?KC(b+k+E/C,o[1][1])*C:GC(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?GC(b+E/C,s[1][1])*C:KC(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=qC(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?KC(y+D*C+O,o[1][0])/C:GC(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?GC(y+D*C,s[1][0])/C:KC(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=(JC(c,l)?-w:w)/C:w=(JC(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var XC={width:0,height:0,x:0,y:0},ZC={...XC,pointerX:0,pointerY:0,aspectRatio:1};function QC(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function $C({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=I_(e),o={controlDirection:WC(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...XC},h={...ZC};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:WC(e)};let g,_=null,v=[],y,b,x,S=!1,C=Z_().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=hS(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=sS(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=QC(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=hS(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=YC(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let ee=UC({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),te={...m,direction:ee};p?.(e,te)!==!1&&(S=!0,d?.(e,te),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var ew=ye((e=>{var t=(h(),xe(S)),n=mo();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),tw=v(ye(((e,t)=>{t.exports=ew()}))(),1),nw=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},rw=e=>e?nw(e):nw;h();var{useDebugValue:iw}=s,{useSyncExternalStoreWithSelector:aw}=tw.default,ow=e=>e;function sw(e,t=ow,n){let r=aw(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return iw(r),r}var cw=(e,t)=>{let n=rw(e),r=(e,r=t)=>sw(n,e,r);return Object.assign(r,n),r},lw=(e,t)=>e?cw(e,t):cw;function uw(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}ie(),h();var dw=fe(null),fw=dw.Provider,pw=mx.error001(`react`);function Q(e,t){let n=L(dw);if(n===null)throw Error(pw);return sw(n,e,t)}function mw(){let e=L(dw);if(e===null)throw Error(pw);return V(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var hw={display:`none`},gw={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},_w=`react-flow__node-desc`,vw=`react-flow__edge-desc`,yw=`react-flow__aria-live`,bw=e=>e.ariaLiveMessage,xw=e=>e.ariaLabelConfig;function Sw({rfId:e}){let t=Q(bw);return p(`div`,{id:`${yw}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:gw,children:t})}function Cw({rfId:e,disableKeyboardA11y:t}){let n=Q(xw);return p(ne,{children:[p(`div`,{id:`${_w}-${e}`,style:hw,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),p(`div`,{id:`${vw}-${e}`,style:hw,children:n[`edge.a11yDescription.default`]}),!t&&p(Sw,{rfId:e})]})}var ww=l(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return p(`div`,{className:jh([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});ww.displayName=`Panel`;var Tw=`https://reactflow.dev?utm_source=attribution`;function Ew({proOptions:e,position:t=`bottom-right`}){return O(()=>{},[]),e?.hideAttribution?null:p(ww,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Tw}`,children:p(`a`,{href:Tw,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var Dw=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Ow=e=>e.id;function kw(e,t){return uw(e.selectedNodes.map(Ow),t.selectedNodes.map(Ow))&&uw(e.selectedEdges.map(Ow),t.selectedEdges.map(Ow))}function Aw({onSelectionChange:e}){let t=mw(),{selectedNodes:n,selectedEdges:r}=Q(Dw,kw);return O(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var jw=e=>!!e.onSelectionChangeHandlers;function Mw({onSelectionChange:e}){let t=Q(jw);return e||t?p(Aw,{onSelectionChange:e}):null}var Nw=[0,0],Pw={x:0,y:0,zoom:1},Fw=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Iw=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Lw={translateExtent:hx,nodeOrigin:Nw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Rw(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=Q(Iw,uw),l=mw();O(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Lw,s()}),[]);let u=R(Lw);return O(()=>{for(let s of Fw){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:pS(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},Fw.map(t=>e[t])),null}function zw(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Bw(e){let[t,n]=B(e===`system`?null:e);return O(()=>{if(e!==`system`){n(e);return}let t=zw(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?zw()?.matches?`dark`:`light`:t}var Vw=typeof document<`u`?document:null;function Hw(e=null,t={target:Vw,actInsideInputWithModifier:!0}){let[n,r]=B(!1),i=R(!1),a=R(new Set([])),[o,s]=V(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
1125
+ `,Ph=({edge:e,search:t})=>{let n=gm(e.node.covers),r=e.node.titles?.at(0)?.title,i=[Oh(e.format),oc(e.node.status)].filter(Boolean).join(` · `);return k(os,{className:`relation-card`,css:Nh,to:`${ps(J.MEDIA,{uri:ve(e.node.uri)})}${t}`,children:[n?U(`img`,{className:`cover`,src:n,alt:``}):U(`div`,{className:`cover`}),k(`div`,{className:`body`,children:[U(`div`,{className:`relation`,children:Eh(e.relation)}),U(`div`,{className:`title`,children:r??e.node.uri}),i?U(`div`,{className:`meta`,children:i}):void 0]})]})},Fh=({relations:e,action:t})=>{let n=ih($o()),r=Ah(e);if(!r.length)return null;let i=jh(r);return k(`div`,{css:Mh,"data-relations":!0,children:[k(`div`,{className:`heading`,children:[U(`span`,{children:`Relations`}),t]}),U(`div`,{className:`grid`,children:[`before`,`middle`,`after`].map(e=>U(`div`,{className:`lane ${e}`,children:i[e].map(e=>U(Ph,{edge:e,search:n},`${e.relation}:${e.node.uri}`))},e))})]})};function Ih(e){if(typeof e==`string`||typeof e==`number`)return``+e;let t=``;if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Ih(e[n]))!==``&&(t+=(t&&` `)+r);else for(let n in e)e[n]&&(t+=(t&&` `)+n);return t}var Lh={value:()=>{}};function Rh(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+``)||r in n||/[\s.]/.test(r))throw Error(`illegal type: `+r);n[r]=[]}return new zh(n)}function zh(e){this._=e}function Bh(e,t){return e.trim().split(/^|\s+/).map(function(e){var n=``,r=e.indexOf(`.`);if(r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),e&&!t.hasOwnProperty(e))throw Error(`unknown type: `+e);return{type:e,name:n}})}zh.prototype=Rh.prototype={constructor:zh,on:function(e,t){var n=this._,r=Bh(e+``,n),i,a=-1,o=r.length;if(arguments.length<2){for(;++a<o;)if((i=(e=r[a]).type)&&(i=Vh(n[i],e.name)))return i;return}if(t!=null&&typeof t!=`function`)throw Error(`invalid callback: `+t);for(;++a<o;)if(i=(e=r[a]).type)n[i]=Hh(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Hh(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new zh(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=Array(i),r=0,i,a;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(a=this._[e],r=0,i=a.length;r<i;++r)a[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw Error(`unknown type: `+e);for(var r=this._[e],i=0,a=r.length;i<a;++i)r[i].value.apply(t,n)}};function Vh(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Hh(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=Lh,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Uh={svg:`http://www.w3.org/2000/svg`,xhtml:`http://www.w3.org/1999/xhtml`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function Wh(e){var t=e+=``,n=t.indexOf(`:`);return n>=0&&(t=e.slice(0,n))!==`xmlns`&&(e=e.slice(n+1)),Uh.hasOwnProperty(t)?{space:Uh[t],local:e}:e}function Gh(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===`http://www.w3.org/1999/xhtml`&&t.documentElement.namespaceURI===`http://www.w3.org/1999/xhtml`?t.createElement(e):t.createElementNS(n,e)}}function Kh(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function qh(e){var t=Wh(e);return(t.local?Kh:Gh)(t)}function Jh(){}function Yh(e){return e==null?Jh:function(){return this.querySelector(e)}}function Xh(e){typeof e!=`function`&&(e=Yh(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=Array(o),c,l,u=0;u<o;++u)(c=a[u])&&(l=e.call(c,c.__data__,u,a))&&(`__data__`in c&&(l.__data__=c.__data__),s[u]=l);return new R_(r,this._parents)}function Zh(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Qh(){return[]}function $h(e){return e==null?Qh:function(){return this.querySelectorAll(e)}}function eg(e){return function(){return Zh(e.apply(this,arguments))}}function tg(e){e=typeof e==`function`?eg(e):$h(e);for(var t=this._groups,n=t.length,r=[],i=[],a=0;a<n;++a)for(var o=t[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&(r.push(e.call(c,c.__data__,l,o)),i.push(c));return new R_(r,i)}function ng(e){return function(){return this.matches(e)}}function rg(e){return function(t){return t.matches(e)}}var ig=Array.prototype.find;function ag(e){return function(){return ig.call(this.children,e)}}function og(){return this.firstElementChild}function sg(e){return this.select(e==null?og:ag(typeof e==`function`?e:rg(e)))}var cg=Array.prototype.filter;function lg(){return Array.from(this.children)}function ug(e){return function(){return cg.call(this.children,e)}}function dg(e){return this.selectAll(e==null?lg:ug(typeof e==`function`?e:rg(e)))}function fg(e){typeof e!=`function`&&(e=ng(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new R_(r,this._parents)}function pg(e){return Array(e.length)}function mg(){return new R_(this._enter||this._groups.map(pg),this._parents)}function hg(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}hg.prototype={constructor:hg,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function gg(e){return function(){return e}}function _g(e,t,n,r,i,a){for(var o=0,s,c=t.length,l=a.length;o<l;++o)(s=t[o])?(s.__data__=a[o],r[o]=s):n[o]=new hg(e,a[o]);for(;o<c;++o)(s=t[o])&&(i[o]=s)}function vg(e,t,n,r,i,a,o){var s,c,l=new Map,u=t.length,d=a.length,f=Array(u),p;for(s=0;s<u;++s)(c=t[s])&&(f[s]=p=o.call(c,c.__data__,s,t)+``,l.has(p)?i[s]=c:l.set(p,c));for(s=0;s<d;++s)p=o.call(e,a[s],s,a)+``,(c=l.get(p))?(r[s]=c,c.__data__=a[s],l.delete(p)):n[s]=new hg(e,a[s]);for(s=0;s<u;++s)(c=t[s])&&l.get(f[s])===c&&(i[s]=c)}function yg(e){return e.__data__}function bg(e,t){if(!arguments.length)return Array.from(this,yg);var n=t?vg:_g,r=this._parents,i=this._groups;typeof e!=`function`&&(e=gg(e));for(var a=i.length,o=Array(a),s=Array(a),c=Array(a),l=0;l<a;++l){var u=r[l],d=i[l],f=d.length,p=xg(e.call(u,u&&u.__data__,l,r)),m=p.length,h=s[l]=Array(m),g=o[l]=Array(m);n(u,d,h,g,c[l]=Array(f),p,t);for(var _=0,v=0,y,b;_<m;++_)if(y=h[_]){for(_>=v&&(v=_+1);!(b=g[v])&&++v<m;);y._next=b||null}}return o=new R_(o,r),o._enter=s,o._exit=c,o}function xg(e){return typeof e==`object`&&`length`in e?e:Array.from(e)}function Sg(){return new R_(this._exit||this._groups.map(pg),this._parents)}function Cg(e,t,n){var r=this.enter(),i=this,a=this.exit();return typeof e==`function`?(r=e(r),r&&=r.selection()):r=r.append(e+``),t!=null&&(i=t(i),i&&=i.selection()),n==null?a.remove():n(a),r&&i?r.merge(i).order():i}function wg(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,i=n.length,a=r.length,o=Math.min(i,a),s=Array(i),c=0;c<o;++c)for(var l=n[c],u=r[c],d=l.length,f=s[c]=Array(d),p,m=0;m<d;++m)(p=l[m]||u[m])&&(f[m]=p);for(;c<i;++c)s[c]=n[c];return new R_(s,this._parents)}function Tg(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],i=r.length-1,a=r[i],o;--i>=0;)(o=r[i])&&(a&&o.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(o,a),a=o);return this}function Eg(e){e||=Dg;function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}for(var n=this._groups,r=n.length,i=Array(r),a=0;a<r;++a){for(var o=n[a],s=o.length,c=i[a]=Array(s),l,u=0;u<s;++u)(l=o[u])&&(c[u]=l);c.sort(t)}return new R_(i,this._parents).order()}function Dg(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function Og(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function kg(){return Array.from(this)}function Ag(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length;i<a;++i){var o=r[i];if(o)return o}return null}function jg(){let e=0;for(let t of this)++e;return e}function Mg(){return!this.node()}function Ng(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var i=t[n],a=0,o=i.length,s;a<o;++a)(s=i[a])&&e.call(s,s.__data__,a,i);return this}function Pg(e){return function(){this.removeAttribute(e)}}function Fg(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Ig(e,t){return function(){this.setAttribute(e,t)}}function Lg(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Rg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function zg(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Bg(e,t){var n=Wh(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?Fg:Pg:typeof t==`function`?n.local?zg:Rg:n.local?Lg:Ig)(n,t))}function Vg(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Hg(e){return function(){this.style.removeProperty(e)}}function Ug(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Wg(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Gg(e,t,n){return arguments.length>1?this.each((t==null?Hg:typeof t==`function`?Wg:Ug)(e,t,n??``)):Kg(this.node(),e)}function Kg(e,t){return e.style.getPropertyValue(t)||Vg(e).getComputedStyle(e,null).getPropertyValue(t)}function qg(e){return function(){delete this[e]}}function Jg(e,t){return function(){this[e]=t}}function Yg(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Xg(e,t){return arguments.length>1?this.each((t==null?qg:typeof t==`function`?Yg:Jg)(e,t)):this.node()[e]}function Zg(e){return e.trim().split(/^|\s+/)}function Qg(e){return e.classList||new $g(e)}function $g(e){this._node=e,this._names=Zg(e.getAttribute(`class`)||``)}$g.prototype={add:function(e){this._names.indexOf(e)<0&&(this._names.push(e),this._node.setAttribute(`class`,this._names.join(` `)))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute(`class`,this._names.join(` `)))},contains:function(e){return this._names.indexOf(e)>=0}};function e_(e,t){for(var n=Qg(e),r=-1,i=t.length;++r<i;)n.add(t[r])}function t_(e,t){for(var n=Qg(e),r=-1,i=t.length;++r<i;)n.remove(t[r])}function n_(e){return function(){e_(this,e)}}function r_(e){return function(){t_(this,e)}}function i_(e,t){return function(){(t.apply(this,arguments)?e_:t_)(this,e)}}function a_(e,t){var n=Zg(e+``);if(arguments.length<2){for(var r=Qg(this.node()),i=-1,a=n.length;++i<a;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof t==`function`?i_:t?n_:r_)(n,t))}function o_(){this.textContent=``}function s_(e){return function(){this.textContent=e}}function c_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??``}}function l_(e){return arguments.length?this.each(e==null?o_:(typeof e==`function`?c_:s_)(e)):this.node().textContent}function u_(){this.innerHTML=``}function d_(e){return function(){this.innerHTML=e}}function f_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??``}}function p_(e){return arguments.length?this.each(e==null?u_:(typeof e==`function`?f_:d_)(e)):this.node().innerHTML}function m_(){this.nextSibling&&this.parentNode.appendChild(this)}function h_(){return this.each(m_)}function g_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function __(){return this.each(g_)}function v_(e){var t=typeof e==`function`?e:qh(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function y_(){return null}function b_(e,t){var n=typeof e==`function`?e:qh(e),r=t==null?y_:typeof t==`function`?t:Yh(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function x_(){var e=this.parentNode;e&&e.removeChild(this)}function S_(){return this.each(x_)}function C_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function w_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function T_(e){return this.select(e?w_:C_)}function E_(e){return arguments.length?this.property(`__data__`,e):this.node().__data__}function D_(e){return function(t){e.call(this,t,this.__data__)}}function O_(e){return e.trim().split(/^|\s+/).map(function(e){var t=``,n=e.indexOf(`.`);return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}function k_(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,i=t.length,a;n<i;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++r]=a;++r?t.length=r:delete this.__on}}}function A_(e,t,n){return function(){var r=this.__on,i,a=D_(t);if(r){for(var o=0,s=r.length;o<s;++o)if((i=r[o]).type===e.type&&i.name===e.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=a,i.options=n),i.value=t;return}}this.addEventListener(e.type,a,n),i={type:e.type,name:e.name,value:t,listener:a,options:n},r?r.push(i):this.__on=[i]}}function j_(e,t,n){var r=O_(e+``),i,a=r.length,o;if(arguments.length<2){var s=this.node().__on;if(s){for(var c=0,l=s.length,u;c<l;++c)for(i=0,u=s[c];i<a;++i)if((o=r[i]).type===u.type&&o.name===u.name)return u.value}return}for(s=t?A_:k_,i=0;i<a;++i)this.each(s(r[i],t,n));return this}function M_(e,t,n){var r=Vg(e),i=r.CustomEvent;typeof i==`function`?i=new i(t,n):(i=r.document.createEvent(`Event`),n?(i.initEvent(t,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(t,!1,!1)),e.dispatchEvent(i)}function N_(e,t){return function(){return M_(this,e,t)}}function P_(e,t){return function(){return M_(this,e,t.apply(this,arguments))}}function F_(e,t){return this.each((typeof t==`function`?P_:N_)(e,t))}function*I_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],i=0,a=r.length,o;i<a;++i)(o=r[i])&&(yield o)}var L_=[null];function R_(e,t){this._groups=e,this._parents=t}function z_(){return new R_([[document.documentElement]],L_)}function B_(){return this}R_.prototype=z_.prototype={constructor:R_,select:Xh,selectAll:tg,selectChild:sg,selectChildren:dg,filter:fg,data:bg,enter:mg,exit:Sg,join:Cg,merge:wg,selection:B_,order:Tg,sort:Eg,call:Og,nodes:kg,node:Ag,size:jg,empty:Mg,each:Ng,attr:Bg,style:Gg,property:Xg,classed:a_,text:l_,html:p_,raise:h_,lower:__,append:v_,insert:b_,remove:S_,clone:T_,datum:E_,on:j_,dispatch:F_,[Symbol.iterator]:I_};function V_(e){return typeof e==`string`?new R_([[document.querySelector(e)]],[document.documentElement]):new R_([[e]],L_)}function H_(e){let t;for(;t=e.sourceEvent;)e=t;return e}function U_(e,t){if(e=H_(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var i=t.getBoundingClientRect();return[e.clientX-i.left-t.clientLeft,e.clientY-i.top-t.clientTop]}}return[e.pageX,e.pageY]}var W_={passive:!1},G_={capture:!0,passive:!1};function K_(e){e.stopImmediatePropagation()}function q_(e){e.preventDefault(),e.stopImmediatePropagation()}function J_(e){var t=e.document.documentElement,n=V_(e).on(`dragstart.drag`,q_,G_);`onselectstart`in t?n.on(`selectstart.drag`,q_,G_):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect=`none`)}function Y_(e,t){var n=e.document.documentElement,r=V_(e).on(`dragstart.drag`,null);t&&(r.on(`click.drag`,q_,G_),setTimeout(function(){r.on(`click.drag`,null)},0)),`onselectstart`in n?r.on(`selectstart.drag`,null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var X_=e=>()=>e;function Z_(e,{sourceEvent:t,subject:n,target:r,identifier:i,active:a,x:o,y:s,dx:c,dy:l,dispatch:u}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}Z_.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Q_(e){return!e.ctrlKey&&!e.button}function $_(){return this.parentNode}function ev(e,t){return t??{x:e.x,y:e.y}}function tv(){return navigator.maxTouchPoints||`ontouchstart`in this}function nv(){var e=Q_,t=$_,n=ev,r=tv,i={},a=Rh(`start`,`drag`,`end`),o=0,s,c,l,u,d=0;function f(e){e.on(`mousedown.drag`,p).filter(r).on(`touchstart.drag`,g).on(`touchmove.drag`,_,W_).on(`touchend.drag touchcancel.drag`,v).style(`touch-action`,`none`).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}function p(n,r){if(!u&&e.call(this,n,r)){var i=y(this,t.call(this,n,r),n,r,`mouse`);i&&(V_(n.view).on(`mousemove.drag`,m,G_).on(`mouseup.drag`,h,G_),J_(n.view),K_(n),l=!1,s=n.clientX,c=n.clientY,i(`start`,n))}}function m(e){if(q_(e),!l){var t=e.clientX-s,n=e.clientY-c;l=t*t+n*n>d}i.mouse(`drag`,e)}function h(e){V_(e.view).on(`mousemove.drag mouseup.drag`,null),Y_(e.view,l),q_(e),i.mouse(`end`,e)}function g(n,r){if(e.call(this,n,r))for(var i=n.changedTouches,a=t.call(this,n,r),o=i.length,s=0,c;s<o;++s)(c=y(this,a,n,r,i[s].identifier,i[s]))&&(K_(n),c(`start`,n,i[s]))}function _(e){for(var t=e.changedTouches,n=t.length,r=0,a;r<n;++r)(a=i[t[r].identifier])&&(q_(e),a(`drag`,e,t[r]))}function v(e){var t=e.changedTouches,n=t.length,r,a;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),r=0;r<n;++r)(a=i[t[r].identifier])&&(K_(e),a(`end`,e,t[r]))}function y(e,t,r,s,c,l){var u=a.copy(),d=U_(l||r,t),p,m,h;if((h=n.call(e,new Z_(`beforestart`,{sourceEvent:r,target:f,identifier:c,active:o,x:d[0],y:d[1],dx:0,dy:0,dispatch:u}),s))!=null)return p=h.x-d[0]||0,m=h.y-d[1]||0,function n(r,a,l){var g=d,_;switch(r){case`start`:i[c]=n,_=o++;break;case`end`:delete i[c],--o;case`drag`:d=U_(l||a,t),_=o}u.call(r,e,new Z_(r,{sourceEvent:a,subject:h,target:f,identifier:c,active:_,x:d[0]+p,y:d[1]+m,dx:d[0]-g[0],dy:d[1]-g[1],dispatch:u}),s)}}return f.filter=function(t){return arguments.length?(e=typeof t==`function`?t:X_(!!t),f):e},f.container=function(e){return arguments.length?(t=typeof e==`function`?e:X_(e),f):t},f.subject=function(e){return arguments.length?(n=typeof e==`function`?e:X_(e),f):n},f.touchable=function(e){return arguments.length?(r=typeof e==`function`?e:X_(!!e),f):r},f.on=function(){var e=a.on.apply(a,arguments);return e===a?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}function rv(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function iv(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function av(){}var ov=.7,sv=1/ov,cv=`\\s*([+-]?\\d+)\\s*`,lv=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*`,uv=`\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*`,dv=/^#([0-9a-f]{3,8})$/,fv=RegExp(`^rgb\\(${cv},${cv},${cv}\\)$`),pv=RegExp(`^rgb\\(${uv},${uv},${uv}\\)$`),mv=RegExp(`^rgba\\(${cv},${cv},${cv},${lv}\\)$`),hv=RegExp(`^rgba\\(${uv},${uv},${uv},${lv}\\)$`),gv=RegExp(`^hsl\\(${lv},${uv},${uv}\\)$`),_v=RegExp(`^hsla\\(${lv},${uv},${uv},${lv}\\)$`),vv={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};rv(av,Cv,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:yv,formatHex:yv,formatHex8:bv,formatHsl:xv,formatRgb:Sv,toString:Sv});function yv(){return this.rgb().formatHex()}function bv(){return this.rgb().formatHex8()}function xv(){return Iv(this).formatHsl()}function Sv(){return this.rgb().formatRgb()}function Cv(e){var t,n;return e=(e+``).trim().toLowerCase(),(t=dv.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?wv(t):n===3?new Ov(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Tv(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Tv(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=fv.exec(e))?new Ov(t[1],t[2],t[3],1):(t=pv.exec(e))?new Ov(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=mv.exec(e))?Tv(t[1],t[2],t[3],t[4]):(t=hv.exec(e))?Tv(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=gv.exec(e))?Fv(t[1],t[2]/100,t[3]/100,1):(t=_v.exec(e))?Fv(t[1],t[2]/100,t[3]/100,t[4]):vv.hasOwnProperty(e)?wv(vv[e]):e===`transparent`?new Ov(NaN,NaN,NaN,0):null}function wv(e){return new Ov(e>>16&255,e>>8&255,e&255,1)}function Tv(e,t,n,r){return r<=0&&(e=t=n=NaN),new Ov(e,t,n,r)}function Ev(e){return e instanceof av||(e=Cv(e)),e?(e=e.rgb(),new Ov(e.r,e.g,e.b,e.opacity)):new Ov}function Dv(e,t,n,r){return arguments.length===1?Ev(e):new Ov(e,t,n,r??1)}function Ov(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}rv(Ov,Dv,iv(av,{brighter(e){return e=e==null?sv:sv**+e,new Ov(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ov:ov**+e,new Ov(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Ov(Nv(this.r),Nv(this.g),Nv(this.b),Mv(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:kv,formatHex:kv,formatHex8:Av,formatRgb:jv,toString:jv}));function kv(){return`#${Pv(this.r)}${Pv(this.g)}${Pv(this.b)}`}function Av(){return`#${Pv(this.r)}${Pv(this.g)}${Pv(this.b)}${Pv((isNaN(this.opacity)?1:this.opacity)*255)}`}function jv(){let e=Mv(this.opacity);return`${e===1?`rgb(`:`rgba(`}${Nv(this.r)}, ${Nv(this.g)}, ${Nv(this.b)}${e===1?`)`:`, ${e})`}`}function Mv(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Nv(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Pv(e){return e=Nv(e),(e<16?`0`:``)+e.toString(16)}function Fv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Rv(e,t,n,r)}function Iv(e){if(e instanceof Rv)return new Rv(e.h,e.s,e.l,e.opacity);if(e instanceof av||(e=Cv(e)),!e)return new Rv;if(e instanceof Rv)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=NaN,s=a-i,c=(a+i)/2;return s?(o=t===a?(n-r)/s+(n<r)*6:n===a?(r-t)/s+2:(t-n)/s+4,s/=c<.5?a+i:2-a-i,o*=60):s=c>0&&c<1?0:o,new Rv(o,s,c,e.opacity)}function Lv(e,t,n,r){return arguments.length===1?Iv(e):new Rv(e,t,n,r??1)}function Rv(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}rv(Rv,Lv,iv(av,{brighter(e){return e=e==null?sv:sv**+e,new Rv(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ov:ov**+e,new Rv(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,i=2*n-r;return new Ov(Vv(e>=240?e-240:e+120,i,r),Vv(e,i,r),Vv(e<120?e+240:e-120,i,r),this.opacity)},clamp(){return new Rv(zv(this.h),Bv(this.s),Bv(this.l),Mv(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){let e=Mv(this.opacity);return`${e===1?`hsl(`:`hsla(`}${zv(this.h)}, ${Bv(this.s)*100}%, ${Bv(this.l)*100}%${e===1?`)`:`, ${e})`}`}}));function zv(e){return e=(e||0)%360,e<0?e+360:e}function Bv(e){return Math.max(0,Math.min(1,e||0))}function Vv(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}var Hv=e=>()=>e;function Uv(e,t){return function(n){return e+n*t}}function Wv(e,t,n){return e**=+n,t=t**+n-e,n=1/n,function(r){return(e+r*t)**+n}}function Gv(e){return(e=+e)==1?Kv:function(t,n){return n-t?Wv(t,n,e):Hv(isNaN(t)?n:t)}}function Kv(e,t){var n=t-e;return n?Uv(e,n):Hv(isNaN(e)?t:e)}var qv=(function e(t){var n=Gv(t);function r(e,t){var r=n((e=Dv(e)).r,(t=Dv(t)).r),i=n(e.g,t.g),a=n(e.b,t.b),o=Kv(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=i(t),e.b=a(t),e.opacity=o(t),e+``}}return r.gamma=e,r})(1);function Jv(e,t){t||=[];var n=e?Math.min(t.length,e.length):0,r=t.slice(),i;return function(a){for(i=0;i<n;++i)r[i]=e[i]*(1-a)+t[i]*a;return r}}function Yv(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Xv(e,t){for(var n=t?t.length:0,r=e?Math.min(n,e.length):0,i=Array(r),a=Array(n),o=0;o<r;++o)i[o]=ay(e[o],t[o]);for(;o<n;++o)a[o]=t[o];return function(e){for(o=0;o<r;++o)a[o]=i[o](e);return a}}function Zv(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Qv(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function $v(e,t){var n={},r={},i;for(i in(typeof e!=`object`||!e)&&(e={}),(typeof t!=`object`||!t)&&(t={}),t)i in e?n[i]=ay(e[i],t[i]):r[i]=t[i];return function(e){for(i in n)r[i]=n[i](e);return r}}var ey=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ty=new RegExp(ey.source,`g`);function ny(e){return function(){return e}}function ry(e){return function(t){return e(t)+``}}function iy(e,t){var n=ey.lastIndex=ty.lastIndex=0,r,i,a,o=-1,s=[],c=[];for(e+=``,t+=``;(r=ey.exec(e))&&(i=ty.exec(t));)(a=i.index)>n&&(a=t.slice(n,a),s[o]?s[o]+=a:s[++o]=a),(r=r[0])===(i=i[0])?s[o]?s[o]+=i:s[++o]=i:(s[++o]=null,c.push({i:o,x:Qv(r,i)})),n=ty.lastIndex;return n<t.length&&(a=t.slice(n),s[o]?s[o]+=a:s[++o]=a),s.length<2?c[0]?ry(c[0].x):ny(t):(t=c.length,function(e){for(var n=0,r;n<t;++n)s[(r=c[n]).i]=r.x(e);return s.join(``)})}function ay(e,t){var n=typeof t,r;return t==null||n===`boolean`?Hv(t):(n===`number`?Qv:n===`string`?(r=Cv(t))?(t=r,qv):iy:t instanceof Cv?qv:t instanceof Date?Zv:Yv(t)?Jv:Array.isArray(t)?Xv:typeof t.valueOf!=`function`&&typeof t.toString!=`function`||isNaN(t)?$v:Qv)(e,t)}var oy=180/Math.PI,sy={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cy(e,t,n,r,i,a){var o,s,c;return(o=Math.sqrt(e*e+t*t))&&(e/=o,t/=o),(c=e*n+t*r)&&(n-=e*c,r-=t*c),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,c/=s),e*r<t*n&&(e=-e,t=-t,c=-c,o=-o),{translateX:i,translateY:a,rotate:Math.atan2(t,e)*oy,skewX:Math.atan(c)*oy,scaleX:o,scaleY:s}}var ly;function uy(e){let t=new(typeof DOMMatrix==`function`?DOMMatrix:WebKitCSSMatrix)(e+``);return t.isIdentity?sy:cy(t.a,t.b,t.c,t.d,t.e,t.f)}function dy(e){return e==null||(ly||=document.createElementNS(`http://www.w3.org/2000/svg`,`g`),ly.setAttribute(`transform`,e),!(e=ly.transform.baseVal.consolidate()))?sy:(e=e.matrix,cy(e.a,e.b,e.c,e.d,e.e,e.f))}function fy(e,t,n,r){function i(e){return e.length?e.pop()+` `:``}function a(e,r,i,a,o,s){if(e!==i||r!==a){var c=o.push(`translate(`,null,t,null,n);s.push({i:c-4,x:Qv(e,i)},{i:c-2,x:Qv(r,a)})}else(i||a)&&o.push(`translate(`+i+t+a+n)}function o(e,t,n,a){e===t?t&&n.push(i(n)+`rotate(`+t+r):(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(i(n)+`rotate(`,null,r)-2,x:Qv(e,t)}))}function s(e,t,n,a){e===t?t&&n.push(i(n)+`skewX(`+t+r):a.push({i:n.push(i(n)+`skewX(`,null,r)-2,x:Qv(e,t)})}function c(e,t,n,r,a,o){if(e!==n||t!==r){var s=a.push(i(a)+`scale(`,null,`,`,null,`)`);o.push({i:s-4,x:Qv(e,n)},{i:s-2,x:Qv(t,r)})}else(n!==1||r!==1)&&a.push(i(a)+`scale(`+n+`,`+r+`)`)}return function(t,n){var r=[],i=[];return t=e(t),n=e(n),a(t.translateX,t.translateY,n.translateX,n.translateY,r,i),o(t.rotate,n.rotate,r,i),s(t.skewX,n.skewX,r,i),c(t.scaleX,t.scaleY,n.scaleX,n.scaleY,r,i),t=n=null,function(e){for(var t=-1,n=i.length,a;++t<n;)r[(a=i[t]).i]=a.x(e);return r.join(``)}}}var py=fy(uy,`px, `,`px)`,`deg)`),my=fy(dy,`, `,`)`,`)`),hy=1e-12;function gy(e){return((e=Math.exp(e))+1/e)/2}function _y(e){return((e=Math.exp(e))-1/e)/2}function vy(e){return((e=Math.exp(2*e))-1)/(e+1)}var yy=(function e(t,n,r){function i(e,i){var a=e[0],o=e[1],s=e[2],c=i[0],l=i[1],u=i[2],d=c-a,f=l-o,p=d*d+f*f,m,h;if(p<hy)h=Math.log(u/s)/t,m=function(e){return[a+e*d,o+e*f,s*Math.exp(t*e*h)]};else{var g=Math.sqrt(p),_=(u*u-s*s+r*p)/(2*s*n*g),v=(u*u-s*s-r*p)/(2*u*n*g),y=Math.log(Math.sqrt(_*_+1)-_);h=(Math.log(Math.sqrt(v*v+1)-v)-y)/t,m=function(e){var r=e*h,i=gy(y),c=s/(n*g)*(i*vy(t*r+y)-_y(y));return[a+c*d,o+c*f,s*i/gy(t*r+y)]}}return m.duration=h*1e3*t/Math.SQRT2,m}return i.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},i})(Math.SQRT2,2,4),by=0,xy=0,Sy=0,Cy=1e3,wy,Ty,Ey=0,Dy=0,Oy=0,ky=typeof performance==`object`&&performance.now?performance:Date,Ay=typeof window==`object`&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function jy(){return Dy||=(Ay(My),ky.now()+Oy)}function My(){Dy=0}function Ny(){this._call=this._time=this._next=null}Ny.prototype=Py.prototype={constructor:Ny,restart:function(e,t,n){if(typeof e!=`function`)throw TypeError(`callback is not a function`);n=(n==null?jy():+n)+(t==null?0:+t),!this._next&&Ty!==this&&(Ty?Ty._next=this:wy=this,Ty=this),this._call=e,this._time=n,zy()},stop:function(){this._call&&(this._call=null,this._time=1/0,zy())}};function Py(e,t,n){var r=new Ny;return r.restart(e,t,n),r}function Fy(){jy(),++by;for(var e=wy,t;e;)(t=Dy-e._time)>=0&&e._call.call(void 0,t),e=e._next;--by}function Iy(){Dy=(Ey=ky.now())+Oy,by=xy=0;try{Fy()}finally{by=0,Ry(),Dy=0}}function Ly(){var e=ky.now(),t=e-Ey;t>Cy&&(Oy-=t,Ey=e)}function Ry(){for(var e,t=wy,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:wy=n);Ty=e,zy(r)}function zy(e){by||(xy&&=clearTimeout(xy),e-Dy>24?(e<1/0&&(xy=setTimeout(Iy,e-ky.now()-Oy)),Sy&&=clearInterval(Sy)):(Sy||=(Ey=ky.now(),setInterval(Ly,Cy)),by=1,Ay(Iy)))}function By(e,t,n){var r=new Ny;return t=t==null?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}var Vy=Rh(`start`,`end`,`cancel`,`interrupt`),Hy=[];function Uy(e,t,n,r,i,a){var o=e.__transition;if(!o)e.__transition={};else if(n in o)return;qy(e,n,{name:t,index:r,group:i,on:Vy,tween:Hy,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function Wy(e,t){var n=Ky(e,t);if(n.state>0)throw Error(`too late; already scheduled`);return n}function Gy(e,t){var n=Ky(e,t);if(n.state>3)throw Error(`too late; already running`);return n}function Ky(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw Error(`transition not found`);return n}function qy(e,t,n){var r=e.__transition,i;r[t]=n,n.timer=Py(a,0,n.time);function a(e){n.state=1,n.timer.restart(o,n.delay,n.time),n.delay<=e&&o(e-n.delay)}function o(a){var l,u,d,f;if(n.state!==1)return c();for(l in r)if(f=r[l],f.name===n.name){if(f.state===3)return By(o);f.state===4?(f.state=6,f.timer.stop(),f.on.call(`interrupt`,e,e.__data__,f.index,f.group),delete r[l]):+l<t&&(f.state=6,f.timer.stop(),f.on.call(`cancel`,e,e.__data__,f.index,f.group),delete r[l])}if(By(function(){n.state===3&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call(`start`,e,e.__data__,n.index,n.group),n.state===2){for(n.state=3,i=Array(d=n.tween.length),l=0,u=-1;l<d;++l)(f=n.tween[l].value.call(e,e.__data__,n.index,n.group))&&(i[++u]=f);i.length=u+1}}function s(t){for(var r=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(c),n.state=5,1),a=-1,o=i.length;++a<o;)i[a].call(e,r);n.state===5&&(n.on.call(`end`,e,e.__data__,n.index,n.group),c())}function c(){for(var i in n.state=6,n.timer.stop(),delete r[t],r)return;delete e.__transition}}function Jy(e,t){var n=e.__transition,r,i,a=!0,o;if(n){for(o in t=t==null?null:t+``,n){if((r=n[o]).name!==t){a=!1;continue}i=r.state>2&&r.state<5,r.state=6,r.timer.stop(),r.on.call(i?`interrupt`:`cancel`,e,e.__data__,r.index,r.group),delete n[o]}a&&delete e.__transition}}function Yy(e){return this.each(function(){Jy(this,e)})}function Xy(e,t){var n,r;return function(){var i=Gy(this,e),a=i.tween;if(a!==n){r=n=a;for(var o=0,s=r.length;o<s;++o)if(r[o].name===t){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Zy(e,t,n){var r,i;if(typeof n!=`function`)throw Error();return function(){var a=Gy(this,e),o=a.tween;if(o!==r){i=(r=o).slice();for(var s={name:t,value:n},c=0,l=i.length;c<l;++c)if(i[c].name===t){i[c]=s;break}c===l&&i.push(s)}a.tween=i}}function Qy(e,t){var n=this._id;if(e+=``,arguments.length<2){for(var r=Ky(this.node(),n).tween,i=0,a=r.length,o;i<a;++i)if((o=r[i]).name===e)return o.value;return null}return this.each((t==null?Xy:Zy)(n,e,t))}function $y(e,t,n){var r=e._id;return e.each(function(){var e=Gy(this,r);(e.value||={})[t]=n.apply(this,arguments)}),function(e){return Ky(e,r).value[t]}}function eb(e,t){var n;return(typeof t==`number`?Qv:t instanceof Cv?qv:(n=Cv(t))?(t=n,qv):iy)(e,t)}function tb(e){return function(){this.removeAttribute(e)}}function nb(e){return function(){this.removeAttributeNS(e.space,e.local)}}function rb(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttribute(e);return o===i?null:o===r?a:a=t(r=o,n)}}function ib(e,t,n){var r,i=n+``,a;return function(){var o=this.getAttributeNS(e.space,e.local);return o===i?null:o===r?a:a=t(r=o,n)}}function ab(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttribute(e):(o=this.getAttribute(e),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function ob(e,t,n){var r,i,a;return function(){var o,s=n(this),c;return s==null?void this.removeAttributeNS(e.space,e.local):(o=this.getAttributeNS(e.space,e.local),c=s+``,o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s)))}}function sb(e,t){var n=Wh(e),r=n===`transform`?my:eb;return this.attrTween(e,typeof t==`function`?(n.local?ob:ab)(n,r,$y(this,`attr.`+e,t)):t==null?(n.local?nb:tb)(n):(n.local?ib:rb)(n,r,t))}function cb(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function lb(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function ub(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&lb(e,i)),n}return i._value=t,i}function db(e,t){var n,r;function i(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&cb(e,i)),n}return i._value=t,i}function fb(e,t){var n=`attr.`+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!=`function`)throw Error();var r=Wh(e);return this.tween(n,(r.local?ub:db)(r,t))}function pb(e,t){return function(){Wy(this,e).delay=+t.apply(this,arguments)}}function mb(e,t){return t=+t,function(){Wy(this,e).delay=t}}function hb(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?pb:mb)(t,e)):Ky(this.node(),t).delay}function gb(e,t){return function(){Gy(this,e).duration=+t.apply(this,arguments)}}function _b(e,t){return t=+t,function(){Gy(this,e).duration=t}}function vb(e){var t=this._id;return arguments.length?this.each((typeof e==`function`?gb:_b)(t,e)):Ky(this.node(),t).duration}function yb(e,t){if(typeof t!=`function`)throw Error();return function(){Gy(this,e).ease=t}}function bb(e){var t=this._id;return arguments.length?this.each(yb(t,e)):Ky(this.node(),t).ease}function xb(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!=`function`)throw Error();Gy(this,e).ease=n}}function Sb(e){if(typeof e!=`function`)throw Error();return this.each(xb(this._id,e))}function Cb(e){typeof e!=`function`&&(e=ng(e));for(var t=this._groups,n=t.length,r=Array(n),i=0;i<n;++i)for(var a=t[i],o=a.length,s=r[i]=[],c,l=0;l<o;++l)(c=a[l])&&e.call(c,c.__data__,l,a)&&s.push(c);return new Qb(r,this._parents,this._name,this._id)}function wb(e){if(e._id!==this._id)throw Error();for(var t=this._groups,n=e._groups,r=t.length,i=n.length,a=Math.min(r,i),o=Array(r),s=0;s<a;++s)for(var c=t[s],l=n[s],u=c.length,d=o[s]=Array(u),f,p=0;p<u;++p)(f=c[p]||l[p])&&(d[p]=f);for(;s<r;++s)o[s]=t[s];return new Qb(o,this._parents,this._name,this._id)}function Tb(e){return(e+``).trim().split(/^|\s+/).every(function(e){var t=e.indexOf(`.`);return t>=0&&(e=e.slice(0,t)),!e||e===`start`})}function Eb(e,t,n){var r,i,a=Tb(t)?Wy:Gy;return function(){var o=a(this,e),s=o.on;s!==r&&(i=(r=s).copy()).on(t,n),o.on=i}}function Db(e,t){var n=this._id;return arguments.length<2?Ky(this.node(),n).on.on(e):this.each(Eb(n,e,t))}function Ob(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function kb(){return this.on(`end.remove`,Ob(this._id))}function Ab(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=Yh(e));for(var r=this._groups,i=r.length,a=Array(i),o=0;o<i;++o)for(var s=r[o],c=s.length,l=a[o]=Array(c),u,d,f=0;f<c;++f)(u=s[f])&&(d=e.call(u,u.__data__,f,s))&&(`__data__`in u&&(d.__data__=u.__data__),l[f]=d,Uy(l[f],t,n,f,l,Ky(u,n)));return new Qb(a,this._parents,t,n)}function jb(e){var t=this._name,n=this._id;typeof e!=`function`&&(e=$h(e));for(var r=this._groups,i=r.length,a=[],o=[],s=0;s<i;++s)for(var c=r[s],l=c.length,u,d=0;d<l;++d)if(u=c[d]){for(var f=e.call(u,u.__data__,d,c),p,m=Ky(u,n),h=0,g=f.length;h<g;++h)(p=f[h])&&Uy(p,t,n,h,f,m);a.push(f),o.push(u)}return new Qb(a,o,t,n)}var Mb=z_.prototype.constructor;function Nb(){return new Mb(this._groups,this._parents)}function Pb(e,t){var n,r,i;return function(){var a=Kg(this,e),o=(this.style.removeProperty(e),Kg(this,e));return a===o?null:a===n&&o===r?i:i=t(n=a,r=o)}}function Fb(e){return function(){this.style.removeProperty(e)}}function Ib(e,t,n){var r,i=n+``,a;return function(){var o=Kg(this,e);return o===i?null:o===r?a:a=t(r=o,n)}}function Lb(e,t,n){var r,i,a;return function(){var o=Kg(this,e),s=n(this),c=s+``;return s??(c=s=(this.style.removeProperty(e),Kg(this,e))),o===c?null:o===r&&c===i?a:(i=c,a=t(r=o,s))}}function Rb(e,t){var n,r,i,a=`style.`+t,o=`end.`+a,s;return function(){var c=Gy(this,e),l=c.on,u=c.value[a]==null?s||=Fb(t):void 0;(l!==n||i!==u)&&(r=(n=l).copy()).on(o,i=u),c.on=r}}function zb(e,t,n){var r=(e+=``)==`transform`?py:eb;return t==null?this.styleTween(e,Pb(e,r)).on(`end.style.`+e,Fb(e)):typeof t==`function`?this.styleTween(e,Lb(e,r,$y(this,`style.`+e,t))).each(Rb(this._id,e)):this.styleTween(e,Ib(e,r,t),n).on(`end.style.`+e,null)}function Bb(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function Vb(e,t,n){var r,i;function a(){var a=t.apply(this,arguments);return a!==i&&(r=(i=a)&&Bb(e,a,n)),r}return a._value=t,a}function Hb(e,t,n){var r=`style.`+(e+=``);if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!=`function`)throw Error();return this.tween(r,Vb(e,t,n??``))}function Ub(e){return function(){this.textContent=e}}function Wb(e){return function(){var t=e(this);this.textContent=t??``}}function Gb(e){return this.tween(`text`,typeof e==`function`?Wb($y(this,`text`,e)):Ub(e==null?``:e+``))}function Kb(e){return function(t){this.textContent=e.call(this,t)}}function qb(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&Kb(r)),t}return r._value=e,r}function Jb(e){var t=`text`;if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!=`function`)throw Error();return this.tween(t,qb(e))}function Yb(){for(var e=this._name,t=this._id,n=$b(),r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)if(c=o[l]){var u=Ky(c,t);Uy(c,e,n,l,o,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Qb(r,this._parents,e,n)}function Xb(){var e,t,n=this,r=n._id,i=n.size();return new Promise(function(a,o){var s={value:o},c={value:function(){--i===0&&a()}};n.each(function(){var n=Gy(this,r),i=n.on;i!==e&&(t=(e=i).copy(),t._.cancel.push(s),t._.interrupt.push(s),t._.end.push(c)),n.on=t}),i===0&&a()})}var Zb=0;function Qb(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function $b(){return++Zb}var ex=z_.prototype;Qb.prototype={constructor:Qb,select:Ab,selectAll:jb,selectChild:ex.selectChild,selectChildren:ex.selectChildren,filter:Cb,merge:wb,selection:Nb,transition:Yb,call:ex.call,nodes:ex.nodes,node:ex.node,size:ex.size,empty:ex.empty,each:ex.each,on:Db,attr:sb,attrTween:fb,style:zb,styleTween:Hb,text:Gb,textTween:Jb,remove:kb,tween:Qy,delay:hb,duration:vb,ease:bb,easeVarying:Sb,end:Xb,[Symbol.iterator]:ex[Symbol.iterator]};function tx(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var nx={time:null,delay:0,duration:250,ease:tx};function rx(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw Error(`transition ${t} not found`);return n}function ix(e){var t,n;e instanceof Qb?(t=e._id,e=e._name):(t=$b(),(n=nx).time=jy(),e=e==null?null:e+``);for(var r=this._groups,i=r.length,a=0;a<i;++a)for(var o=r[a],s=o.length,c,l=0;l<s;++l)(c=o[l])&&Uy(c,e,t,l,o,n||rx(c,t));return new Qb(r,this._parents,e,t)}z_.prototype.interrupt=Yy,z_.prototype.transition=ix;var ax=e=>()=>e;function ox(e,{sourceEvent:t,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function sx(e,t,n){this.k=e,this.x=t,this.y=n}sx.prototype={constructor:sx,scale:function(e){return e===1?this:new sx(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new sx(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return`translate(`+this.x+`,`+this.y+`) scale(`+this.k+`)`}};var cx=new sx(1,0,0);lx.prototype=sx.prototype;function lx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return cx;return e.__zoom}function ux(e){e.stopImmediatePropagation()}function dx(e){e.preventDefault(),e.stopImmediatePropagation()}function fx(e){return(!e.ctrlKey||e.type===`wheel`)&&!e.button}function px(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute(`viewBox`)?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function mx(){return this.__zoom||cx}function hx(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function gx(){return navigator.maxTouchPoints||`ontouchstart`in this}function _x(e,t,n){var r=e.invertX(t[0][0])-n[0][0],i=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],o=e.invertY(t[1][1])-n[1][1];return e.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o))}function vx(){var e=fx,t=px,n=_x,r=hx,i=gx,a=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],s=250,c=yy,l=Rh(`start`,`zoom`,`end`),u,d,f,p=500,m=150,h=0,g=10;function _(e){e.property(`__zoom`,mx).on(`wheel.zoom`,w,{passive:!1}).on(`mousedown.zoom`,T).on(`dblclick.zoom`,E).filter(i).on(`touchstart.zoom`,D).on(`touchmove.zoom`,O).on(`touchend.zoom touchcancel.zoom`,k).style(`-webkit-tap-highlight-color`,`rgba(0,0,0,0)`)}_.transform=function(e,t,n,r){var i=e.selection?e.selection():e;i.property(`__zoom`,mx),e===i?i.interrupt().each(function(){S(this,arguments).event(r).start().zoom(null,typeof t==`function`?t.apply(this,arguments):t).end()}):x(e,t,n,r)},_.scaleBy=function(e,t,n,r){_.scaleTo(e,function(){return this.__zoom.k*(typeof t==`function`?t.apply(this,arguments):t)},n,r)},_.scaleTo=function(e,r,i,a){_.transform(e,function(){var e=t.apply(this,arguments),a=this.__zoom,s=i==null?b(e):typeof i==`function`?i.apply(this,arguments):i,c=a.invert(s),l=typeof r==`function`?r.apply(this,arguments):r;return n(y(v(a,l),s,c),e,o)},i,a)},_.translateBy=function(e,r,i,a){_.transform(e,function(){return n(this.__zoom.translate(typeof r==`function`?r.apply(this,arguments):r,typeof i==`function`?i.apply(this,arguments):i),t.apply(this,arguments),o)},null,a)},_.translateTo=function(e,r,i,a,s){_.transform(e,function(){var e=t.apply(this,arguments),s=this.__zoom,c=a==null?b(e):typeof a==`function`?a.apply(this,arguments):a;return n(cx.translate(c[0],c[1]).scale(s.k).translate(typeof r==`function`?-r.apply(this,arguments):-r,typeof i==`function`?-i.apply(this,arguments):-i),e,o)},a,s)};function v(e,t){return t=Math.max(a[0],Math.min(a[1],t)),t===e.k?e:new sx(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,i=t[1]-n[1]*e.k;return r===e.x&&i===e.y?e:new sx(e.k,r,i)}function b(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function x(e,n,r,i){e.on(`start.zoom`,function(){S(this,arguments).event(i).start()}).on(`interrupt.zoom end.zoom`,function(){S(this,arguments).event(i).end()}).tween(`zoom`,function(){var e=this,a=arguments,o=S(e,a).event(i),s=t.apply(e,a),l=r==null?b(s):typeof r==`function`?r.apply(e,a):r,u=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),d=e.__zoom,f=typeof n==`function`?n.apply(e,a):n,p=c(d.invert(l).concat(u/d.k),f.invert(l).concat(u/f.k));return function(e){if(e===1)e=f;else{var t=p(e),n=u/t[2];e=new sx(n,l[0]-t[0]*n,l[1]-t[1]*n)}o.zoom(null,e)}})}function S(e,t,n){return!n&&e.__zooming||new C(e,t)}function C(e,n){this.that=e,this.args=n,this.active=0,this.sourceEvent=null,this.extent=t.apply(e,n),this.taps=0}C.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit(`start`)),this},zoom:function(e,t){return this.mouse&&e!==`mouse`&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&e!==`touch`&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&e!==`touch`&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit(`zoom`),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit(`end`)),this},emit:function(e){var t=V_(this.that).datum();l.call(e,this.that,new ox(e,{sourceEvent:this.sourceEvent,target:_,type:e,transform:this.that.__zoom,dispatch:l}),t)}};function w(t,...i){if(!e.apply(this,arguments))return;var s=S(this,i).event(t),c=this.__zoom,l=Math.max(a[0],Math.min(a[1],c.k*2**r.apply(this,arguments))),u=U_(t);if(s.wheel)(s.mouse[0][0]!==u[0]||s.mouse[0][1]!==u[1])&&(s.mouse[1]=c.invert(s.mouse[0]=u)),clearTimeout(s.wheel);else if(c.k===l)return;else s.mouse=[u,c.invert(u)],Jy(this),s.start();dx(t),s.wheel=setTimeout(d,m),s.zoom(`mouse`,n(y(v(c,l),s.mouse[0],s.mouse[1]),s.extent,o));function d(){s.wheel=null,s.end()}}function T(t,...r){if(f||!e.apply(this,arguments))return;var i=t.currentTarget,a=S(this,r,!0).event(t),s=V_(t.view).on(`mousemove.zoom`,d,!0).on(`mouseup.zoom`,p,!0),c=U_(t,i),l=t.clientX,u=t.clientY;J_(t.view),ux(t),a.mouse=[c,this.__zoom.invert(c)],Jy(this),a.start();function d(e){if(dx(e),!a.moved){var t=e.clientX-l,r=e.clientY-u;a.moved=t*t+r*r>h}a.event(e).zoom(`mouse`,n(y(a.that.__zoom,a.mouse[0]=U_(e,i),a.mouse[1]),a.extent,o))}function p(e){s.on(`mousemove.zoom mouseup.zoom`,null),Y_(e.view,a.moved),dx(e),a.event(e).end()}}function E(r,...i){if(e.apply(this,arguments)){var a=this.__zoom,c=U_(r.changedTouches?r.changedTouches[0]:r,this),l=a.invert(c),u=a.k*(r.shiftKey?.5:2),d=n(y(v(a,u),c,l),t.apply(this,i),o);dx(r),s>0?V_(this).transition().duration(s).call(x,d,c,r):V_(this).call(_.transform,d,c,r)}}function D(t,...n){if(e.apply(this,arguments)){var r=t.touches,i=r.length,a=S(this,n,t.changedTouches.length===i).event(t),o,s,c,l;for(ux(t),s=0;s<i;++s)c=r[s],l=U_(c,this),l=[l,this.__zoom.invert(l),c.identifier],a.touch0?!a.touch1&&a.touch0[2]!==l[2]&&(a.touch1=l,a.taps=0):(a.touch0=l,o=!0,a.taps=1+!!u);u&&=clearTimeout(u),o&&(a.taps<2&&(d=l[0],u=setTimeout(function(){u=null},p)),Jy(this),a.start())}}function O(e,...t){if(this.__zooming){var r=S(this,t).event(e),i=e.changedTouches,a=i.length,s,c,l,u;for(dx(e),s=0;s<a;++s)c=i[s],l=U_(c,this),r.touch0&&r.touch0[2]===c.identifier?r.touch0[0]=l:r.touch1&&r.touch1[2]===c.identifier&&(r.touch1[0]=l);if(c=r.that.__zoom,r.touch1){var d=r.touch0[0],f=r.touch0[1],p=r.touch1[0],m=r.touch1[1],h=(h=p[0]-d[0])*h+(h=p[1]-d[1])*h,g=(g=m[0]-f[0])*g+(g=m[1]-f[1])*g;c=v(c,Math.sqrt(h/g)),l=[(d[0]+p[0])/2,(d[1]+p[1])/2],u=[(f[0]+m[0])/2,(f[1]+m[1])/2]}else if(r.touch0)l=r.touch0[0],u=r.touch0[1];else return;r.zoom(`touch`,n(y(c,l,u),r.extent,o))}}function k(e,...t){if(this.__zooming){var n=S(this,t).event(e),r=e.changedTouches,i=r.length,a,o;for(ux(e),f&&clearTimeout(f),f=setTimeout(function(){f=null},p),a=0;a<i;++a)o=r[a],n.touch0&&n.touch0[2]===o.identifier?delete n.touch0:n.touch1&&n.touch1[2]===o.identifier&&delete n.touch1;if(n.touch1&&!n.touch0&&(n.touch0=n.touch1,delete n.touch1),n.touch0)n.touch0[1]=this.__zoom.invert(n.touch0[0]);else if(n.end(),n.taps===2&&(o=U_(o,this),Math.hypot(d[0]-o[0],d[1]-o[1])<g)){var s=V_(this).on(`dblclick.zoom`);s&&s.apply(this,arguments)}}}return _.wheelDelta=function(e){return arguments.length?(r=typeof e==`function`?e:ax(+e),_):r},_.filter=function(t){return arguments.length?(e=typeof t==`function`?t:ax(!!t),_):e},_.touchable=function(e){return arguments.length?(i=typeof e==`function`?e:ax(!!e),_):i},_.extent=function(e){return arguments.length?(t=typeof e==`function`?e:ax([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),_):t},_.scaleExtent=function(e){return arguments.length?(a[0]=+e[0],a[1]=+e[1],_):[a[0],a[1]]},_.translateExtent=function(e){return arguments.length?(o[0][0]=+e[0][0],o[1][0]=+e[1][0],o[0][1]=+e[0][1],o[1][1]=+e[1][1],_):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},_.constrain=function(e){return arguments.length?(n=e,_):n},_.duration=function(e){return arguments.length?(s=+e,_):s},_.interpolate=function(e){return arguments.length?(c=e,_):c},_.on=function(){var e=l.on.apply(l,arguments);return e===l?_:e},_.clickDistance=function(e){return arguments.length?(h=(e=+e)*e,_):Math.sqrt(h)},_.tapDistance=function(e){return arguments.length?(g=+e,_):g},_}var yx={error001:(e=`react`)=>`Seems like you have not used ${e===`svelte`?`SvelteFlowProvider`:`ReactFlowProvider`} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>`It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.`,error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>`The parent container needs a width and a height to render the graph.`,error005:()=>`Only child nodes can use a parent extent.`,error006:()=>`Can't create edge. An edge needs a source and a target.`,error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e===`source`?n:r}", edge id: ${t}.`,error010:()=>`Handle: No node id found. Make sure to only use a Handle inside a custom Node.`,error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e=`react`)=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>`useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.`,error015:()=>`It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.`,error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},bx=[[-1/0,-1/0],[1/0,1/0]],xx=[`Enter`,` `,`Escape`],Sx={"node.a11yDescription.default":`Press enter or space to select a node. Press delete to remove it and escape to cancel.`,"node.a11yDescription.keyboardDisabled":`Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.`,"node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":`Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.`,"controls.ariaLabel":`Control Panel`,"controls.zoomIn.ariaLabel":`Zoom In`,"controls.zoomOut.ariaLabel":`Zoom Out`,"controls.fitView.ariaLabel":`Fit View`,"controls.interactive.ariaLabel":`Toggle Interactivity`,"minimap.ariaLabel":`Mini Map`,"handle.ariaLabel":`Handle`},Cx;(function(e){e.Strict=`strict`,e.Loose=`loose`})(Cx||={});var wx;(function(e){e.Free=`free`,e.Vertical=`vertical`,e.Horizontal=`horizontal`})(wx||={});var Tx;(function(e){e.Partial=`partial`,e.Full=`full`})(Tx||={});var Ex={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null},Dx;(function(e){e.Bezier=`default`,e.Straight=`straight`,e.Step=`step`,e.SmoothStep=`smoothstep`,e.SimpleBezier=`simplebezier`})(Dx||={});var Ox;(function(e){e.Arrow=`arrow`,e.ArrowClosed=`arrowclosed`})(Ox||={});var Z;(function(e){e.Left=`left`,e.Top=`top`,e.Right=`right`,e.Bottom=`bottom`})(Z||={});var kx={[Z.Left]:Z.Right,[Z.Right]:Z.Left,[Z.Top]:Z.Bottom,[Z.Bottom]:Z.Top},Ax=e=>!!e&&typeof e==`object`&&`id`in e&&`source`in e&&`target`in e,jx=e=>!!e&&typeof e==`object`&&`id`in e&&`position`in e&&!(`source`in e)&&!(`target`in e),Mx=e=>!!e&&typeof e==`object`&&`id`in e&&`internals`in e&&!(`source`in e)&&!(`target`in e),Nx=(e,t=[0,0])=>{let{width:n,height:r}=pS(e),i=e.origin??t,a=n*i[0],o=r*i[1];return{x:e.position.x-a,y:e.position.y-o}},Px=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};let n=!1,r=e.reduce((e,r)=>{let i=typeof r==`string`,a=!t.nodeLookup&&!i?r:void 0;return t.nodeLookup&&(a=i?t.nodeLookup.get(r):Mx(r)?r:t.nodeLookup.get(r.id)),a?(n=!0,qx(e,Zx(a,t.nodeOrigin))):e},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return n?Yx(r):{x:0,y:0,width:0,height:0}},Fx=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(e=>{(t.filter===void 0||t.filter(e))&&(n=qx(n,Zx(e)),r=!0)}),r?Yx(n):{x:0,y:0,width:0,height:0}},Ix=(e,t,[n,r,i]=[0,0,1],a=!1,o=!1)=>{let s=(t.x-n)/i,c=(t.y-r)/i,l=t.width/i,u=t.height/i,d=[];for(let t of e.values()){let{measured:e,selectable:n=!0,hidden:r=!1}=t;if(o&&!n||r)continue;let i=e.width??t.width??t.initialWidth??0,f=e.height??t.height??t.initialHeight??0,{x:p,y:m}=t.internals.positionAbsolute,h=$x(s,c,l,u,p,m,i,f),g=i*f,_=a&&h>0;(!t.internals.handleBounds||_||h>=g||t.dragging)&&d.push(t)}return d},Lx=(e,t)=>{let n=new Set;return e.forEach(e=>{n.add(e.id)}),t.filter(e=>n.has(e.source)||n.has(e.target))};function Rx(e,t){let n=new Map,r=t?.nodes?new Set(t.nodes.map(e=>e.id)):null;return e.forEach(e=>{let i;if(t?.includeHiddenNodes){let{width:t,height:n}=pS(e);i=t>0&&n>0}else i=!!(e.measured.width&&e.measured.height&&!e.hidden);i&&(!r||r.has(e.id))&&n.set(e.id,e)}),n}async function zx({nodes:e,width:t,height:n,panZoom:r,minZoom:i,maxZoom:a},o){if(e.size===0)return!0;let s=uS(Fx(Rx(e,o)),t,n,o?.minZoom??i,o?.maxZoom??a,o?.padding??.1);return await r.setViewport(s,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),!0}function Bx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:i,onError:a}){let o=n.get(e),s=o.parentId?n.get(o.parentId):void 0,{x:c,y:l}=s?s.internals.positionAbsolute:{x:0,y:0},u=o.origin??r,d=o.extent||i;if(o.extent===`parent`&&!o.expandParent){if(!s)a?.(`005`,yx.error005());else{let{width:e,height:t}=pS(s);e&&t&&(d=[[c,l],[c+e,l+t]])}}else s&&fS(o.extent)&&(d=[[o.extent[0][0]+c,o.extent[0][1]+l],[o.extent[1][0]+c,o.extent[1][1]+l]]);let f=fS(d)?Ux(t,d,o.measured):t;return(o.measured.width===void 0||o.measured.height===void 0)&&a?.(`015`,yx.error015()),{position:{x:f.x-c+(o.measured.width??0)*u[0],y:f.y-l+(o.measured.height??0)*u[1]},positionAbsolute:f}}async function Vx({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:i}){let a=new Set(e.map(e=>e.id)),o=[];for(let e of n){if(e.deletable===!1)continue;let t=a.has(e.id),n=!t&&e.parentId&&o.find(t=>t.id===e.parentId);(t||n)&&o.push(e)}let s=new Set(t.map(e=>e.id)),c=r.filter(e=>e.deletable!==!1),l=Lx(o,c);for(let e of c)s.has(e.id)&&!l.find(t=>t.id===e.id)&&l.push(e);if(!i)return{edges:l,nodes:o};let u=await i({nodes:o,edges:l});return typeof u==`boolean`?u?{edges:l,nodes:o}:{edges:[],nodes:[]}:u}var Hx=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Ux=(e={x:0,y:0},t,n)=>({x:Hx(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Hx(e.y,t[0][1],t[1][1]-(n?.height??0))});function Wx(e,t,n){let{width:r,height:i}=pS(n),{x:a,y:o}=n.internals.positionAbsolute;return Ux(e,[[a,o],[a+r,o+i]],t)}var Gx=(e,t,n)=>e<t?Hx(Math.abs(e-t),1,t)/t:e>n?-Hx(Math.abs(e-n),1,t)/t:0,Kx=(e,t,n=15,r=40)=>[Gx(e.x,r,t.width-r)*n,Gx(e.y,r,t.height-r)*n],qx=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Jx=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Yx=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Xx=(e,t=[0,0])=>{let{x:n,y:r}=Mx(e)?e.internals.positionAbsolute:Nx(e,t);return{x:n,y:r,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Zx=(e,t=[0,0])=>{let{x:n,y:r}=Mx(e)?e.internals.positionAbsolute:Nx(e,t);return{x:n,y:r,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:r+(e.measured?.height??e.height??e.initialHeight??0)}},Qx=(e,t)=>Yx(qx(Jx(e),Jx(t))),$x=(e,t,n,r,i,a,o,s)=>{let c=Math.max(0,Math.min(e+n,i+o)-Math.max(e,i)),l=Math.max(0,Math.min(t+r,a+s)-Math.max(t,a));return Math.ceil(c*l)},eS=(e,t)=>$x(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),tS=e=>nS(e.width)&&nS(e.height)&&nS(e.x)&&nS(e.y),nS=e=>!isNaN(e)&&isFinite(e),rS=(e,t)=>(e,t)=>{},iS=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),aS=({x:e,y:t},[n,r,i],a=!1,o=[1,1])=>{let s={x:(e-n)/i,y:(t-r)/i};return a?iS(s,o):s},oS=({x:e,y:t},[n,r,i])=>({x:e*i+n,y:t*i+r});function sS(e,t){if(typeof e==`number`)return Math.floor((t-t/(1+e))*.5);if(typeof e==`string`&&e.endsWith(`px`)){let t=parseFloat(e);if(!Number.isNaN(t))return Math.floor(t)}if(typeof e==`string`&&e.endsWith(`%`)){let n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function cS(e,t,n){if(typeof e==`string`||typeof e==`number`){let r=sS(e,n),i=sS(e,t);return{top:r,right:i,bottom:r,left:i,x:i*2,y:r*2}}if(typeof e==`object`){let r=sS(e.top??e.y??0,n),i=sS(e.bottom??e.y??0,n),a=sS(e.left??e.x??0,t),o=sS(e.right??e.x??0,t);return{top:r,right:o,bottom:i,left:a,x:a+o,y:r+i}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function lS(e,t,n,r,i,a){let{x:o,y:s}=oS(e,[t,n,r]),{x:c,y:l}=oS({x:e.x+e.width,y:e.y+e.height},[t,n,r]),u=i-c,d=a-l;return{left:Math.floor(o),top:Math.floor(s),right:Math.floor(u),bottom:Math.floor(d)}}var uS=(e,t,n,r,i,a)=>{let o=cS(a,t,n),s=(t-o.x)/e.width,c=(n-o.y)/e.height,l=Hx(Math.min(s,c),r,i),u=e.x+e.width/2,d=e.y+e.height/2,f=t/2-u*l,p=n/2-d*l,m=lS(e,f,p,l,t,n),h={left:Math.min(m.left-o.left,0),top:Math.min(m.top-o.top,0),right:Math.min(m.right-o.right,0),bottom:Math.min(m.bottom-o.bottom,0)};return{x:f-h.left+h.right,y:p-h.top+h.bottom,zoom:l}},dS=()=>typeof navigator<`u`&&navigator?.userAgent?.indexOf(`Mac`)>=0;function fS(e){return e!=null&&e!==`parent`}function pS(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function mS(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function hS(e,t={width:0,height:0},n,r,i){let a={...e},o=r.get(n);if(o){let e=o.origin||i;a.x+=o.internals.positionAbsolute.x-(t.width??0)*e[0],a.y+=o.internals.positionAbsolute.y-(t.height??0)*e[1]}return a}function gS(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function _S(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}function vS(e){return{...Sx,...e||{}}}function yS(e){return e===null?null:e?`valid`:`invalid`}function bS(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:i}){let{x:a,y:o}=ES(e),s=aS({x:a-(i?.left??0),y:o-(i?.top??0)},r),{x:c,y:l}=n?iS(s,t):s;return{xSnapped:c,ySnapped:l,...s}}var xS=e=>({width:e.offsetWidth,height:e.offsetHeight}),SS=e=>e?.getRootNode?.()||window?.document,CS=[`INPUT`,`SELECT`,`TEXTAREA`];function wS(e){let t=e.composedPath?.()?.[0]||e.target;return t?.nodeType===1?CS.includes(t.nodeName)||t.hasAttribute(`contenteditable`)||!!t.closest(`.nokey`):!1}var TS=e=>`clientX`in e,ES=(e,t)=>{let n=TS(e),r=n?e.clientX:e.touches?.[0].clientX,i=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:i-(t?.top??0)}},DS=(e,t,n,r,i)=>{let a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(t=>{let a=t.getBoundingClientRect();return{id:t.getAttribute(`data-handleid`),type:e,nodeId:i,position:t.getAttribute(`data-handlepos`),x:(a.left-n.left)/r,y:(a.top-n.top)/r,...xS(t)}})};function OS({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:i,sourceControlY:a,targetControlX:o,targetControlY:s}){let c=e*.125+i*.375+o*.375+n*.125,l=t*.125+a*.375+s*.375+r*.125;return[c,l,Math.abs(c-e),Math.abs(l-t)]}function kS(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function AS({pos:e,x1:t,y1:n,x2:r,y2:i,c:a}){switch(e){case Z.Left:return[t-kS(t-r,a),n];case Z.Right:return[t+kS(r-t,a),n];case Z.Top:return[t,n-kS(n-i,a)];case Z.Bottom:return[t,n+kS(i-n,a)]}}function jS({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,curvature:o=.25}){let[s,c]=AS({pos:n,x1:e,y1:t,x2:r,y2:i,c:o}),[l,u]=AS({pos:a,x1:r,y1:i,x2:e,y2:t,c:o}),[d,f,p,m]=OS({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:s,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${s},${c} ${l},${u} ${r},${i}`,d,f,p,m]}function MS({sourceX:e,sourceY:t,targetX:n,targetY:r}){let i=Math.abs(n-e)/2,a=n<e?n+i:n-i,o=Math.abs(r-t)/2;return[a,r<t?r+o:r-o,i,o]}function NS({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:i=!1,zIndexMode:a=`basic`}){return a===`manual`?r:(i&&n?r+1e3:r)+Math.max(e.parentId||i&&e.selected?e.internals.z:0,t.parentId||i&&t.selected?t.internals.z:0)}function PS({sourceNode:e,targetNode:t,width:n,height:r,transform:i}){let a=qx(Zx(e),Zx(t));return a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1),eS({x:-i[0]/i[2],y:-i[1]/i[2],width:n/i[2],height:r/i[2]},Yx(a))>0}var FS=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||``}-${n}${r||``}`,IS=(e,t)=>t.some(t=>t.source===e.source&&t.target===e.target&&(t.sourceHandle===e.sourceHandle||!t.sourceHandle&&!e.sourceHandle)&&(t.targetHandle===e.targetHandle||!t.targetHandle&&!e.targetHandle)),LS=(e,t,n={})=>{if(!e.source||!e.target)return n.onError?.(`006`,yx.error006()),t;let r=n.getEdgeId||FS,i;return i=Ax(e)?{...e}:{...e,id:r(e)},IS(i,t)?t:(i.sourceHandle===null&&delete i.sourceHandle,i.targetHandle===null&&delete i.targetHandle,t.concat(i))};function RS({sourceX:e,sourceY:t,targetX:n,targetY:r}){let[i,a,o,s]=MS({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,i,a,o,s]}var zS={[Z.Left]:{x:-1,y:0},[Z.Right]:{x:1,y:0},[Z.Top]:{x:0,y:-1},[Z.Bottom]:{x:0,y:1}},BS=({source:e,sourcePosition:t=Z.Bottom,target:n})=>t===Z.Left||t===Z.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},VS=(e,t)=>Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2);function HS({source:e,sourcePosition:t=Z.Bottom,target:n,targetPosition:r=Z.Top,center:i,offset:a,stepPosition:o}){let s=zS[t],c=zS[r],l={x:e.x+s.x*a,y:e.y+s.y*a},u={x:n.x+c.x*a,y:n.y+c.y*a},d=BS({source:l,sourcePosition:t,target:u}),f=d.x===0?`y`:`x`,p=d[f],m=[],h,g,_={x:0,y:0},v={x:0,y:0},[,,y,b]=MS({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(s[f]*c[f]===-1){f===`x`?(h=i.x??l.x+(u.x-l.x)*o,g=i.y??(l.y+u.y)/2):(h=i.x??(l.x+u.x)/2,g=i.y??l.y+(u.y-l.y)*o);let e=[{x:h,y:l.y},{x:h,y:u.y}],t=[{x:l.x,y:g},{x:u.x,y:g}];m=s[f]===p?f===`x`?e:t:f===`x`?t:e}else{let i=[{x:l.x,y:u.y}],o=[{x:u.x,y:l.y}];if(m=f===`x`?s.x===p?o:i:s.y===p?i:o,t===r){let t=Math.abs(e[f]-n[f]);if(t<=a){let r=Math.min(a-1,a-t);s[f]===p?_[f]=(l[f]>e[f]?-1:1)*r:v[f]=(u[f]>n[f]?-1:1)*r}}if(t!==r){let e=f===`x`?`y`:`x`,t=s[f]===c[e],n=l[e]>u[e],r=l[e]<u[e];(s[f]===1&&(!t&&n||t&&r)||s[f]!==1&&(!t&&r||t&&n))&&(m=f===`x`?i:o)}let d={x:l.x+_.x,y:l.y+_.y},y={x:u.x+v.x,y:u.y+v.y};Math.max(Math.abs(d.x-m[0].x),Math.abs(y.x-m[0].x))>=Math.max(Math.abs(d.y-m[0].y),Math.abs(y.y-m[0].y))?(h=(d.x+y.x)/2,g=m[0].y):(h=m[0].x,g=(d.y+y.y)/2)}let x={x:l.x+_.x,y:l.y+_.y},S={x:u.x+v.x,y:u.y+v.y};return[[e,...x.x!==m[0].x||x.y!==m[0].y?[x]:[],...m,...S.x!==m[m.length-1].x||S.y!==m[m.length-1].y?[S]:[],n],h,g,y,b]}function US(e,t,n,r){let i=Math.min(VS(e,t)/2,VS(t,n)/2,r),{x:a,y:o}=t;if(e.x===a&&a===n.x||e.y===o&&o===n.y)return`L${a} ${o}`;if(e.y===o){let t=e.x<n.x?-1:1,r=e.y<n.y?1:-1;return`L ${a+i*t},${o}Q ${a},${o} ${a},${o+i*r}`}let s=e.x<n.x?1:-1;return`L ${a},${o+i*(e.y<n.y?-1:1)}Q ${a},${o} ${a+i*s},${o}`}function WS({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top,borderRadius:o=5,centerX:s,centerY:c,offset:l=20,stepPosition:u=.5}){let[d,f,p,m,h]=HS({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:i},targetPosition:a,center:{x:s,y:c},offset:l,stepPosition:u}),g=`M${d[0].x} ${d[0].y}`;for(let e=1;e<d.length-1;e++)g+=US(d[e-1],d[e],d[e+1],o);return g+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[g,f,p,m,h]}function GS(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function KS(e){let{sourceNode:t,targetNode:n}=e;if(!GS(t)||!GS(n))return null;let r=t.internals.handleBounds||qS(t.handles),i=n.internals.handleBounds||qS(n.handles),a=YS(r?.source??[],e.sourceHandle),o=YS(e.connectionMode===Cx.Strict?i?.target??[]:(i?.target??[]).concat(i?.source??[]),e.targetHandle);if(!a||!o)return e.onError?.(`008`,yx.error008(a?`target`:`source`,{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;let s=a?.position||Z.Bottom,c=o?.position||Z.Top,l=JS(t,a,s),u=JS(n,o,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:s,targetPosition:c}}function qS(e){if(!e)return null;let t=[],n=[];for(let r of e)r.width=r.width??1,r.height=r.height??1,r.type===`source`?t.push(r):r.type===`target`&&n.push(r);return{source:t,target:n}}function JS(e,t,n=Z.Left,r=!1){let i=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:o,height:s}=t??pS(e);if(r)return{x:i+o/2,y:a+s/2};switch(t?.position??n){case Z.Top:return{x:i+o/2,y:a};case Z.Right:return{x:i+o,y:a+s/2};case Z.Bottom:return{x:i+o/2,y:a+s};case Z.Left:return{x:i,y:a+s/2}}}function YS(e,t){return e&&(t?e.find(e=>e.id===t):e[0])||null}function XS(e,t){return e?typeof e==`string`?e:`${t?`${t}__`:``}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join(`&`)}`:``}function ZS(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:i}){let a=new Set;return e.reduce((e,o)=>([o.markerStart||r,o.markerEnd||i].forEach(r=>{if(r&&typeof r==`object`){let i=XS(r,t);a.has(i)||(e.push({id:i,color:r.color||n,...r}),a.add(i))}}),e),[]).sort((e,t)=>e.id.localeCompare(t.id))}var QS=1e3,$S=10,eC={nodeOrigin:[0,0],nodeExtent:bx,elevateNodesOnSelect:!0,zIndexMode:`basic`,defaults:{}},tC={...eC,checkEquality:!0};function nC(e,t){let n={...e};for(let e in t)t[e]!==void 0&&(n[e]=t[e]);return n}function rC(e,t,n){let r=nC(eC,n);for(let n of e.values())if(n.parentId)cC(n,e,t,r);else{let e=Ux(Nx(n,r.nodeOrigin),fS(n.extent)?n.extent:r.nodeExtent,pS(n));n.internals.positionAbsolute=e}}function iC(e,t){if(!e.handles)return e.measured?t?.internals.handleBounds:void 0;let n=[],r=[];for(let t of e.handles){let i={id:t.id,width:t.width??1,height:t.height??1,nodeId:e.id,x:t.x,y:t.y,position:t.position,type:t.type};t.type===`source`?n.push(i):t.type===`target`&&r.push(i)}return{source:n,target:r}}function aC(e){return e===`manual`}function oC(e,t,n,r={}){let i=nC(tC,r),a={i:0},o=new Map(t),s=i?.elevateNodesOnSelect&&!aC(i.zIndexMode)?QS:0,c=e.length>0,l=!1;t.clear(),n.clear();for(let u of e){let e=o.get(u.id);if(i.checkEquality&&u===e?.internals.userNode)t.set(u.id,e);else{let n=Ux(Nx(u,i.nodeOrigin),fS(u.extent)?u.extent:i.nodeExtent,pS(u));e={...i.defaults,...u,measured:{width:u.measured?.width,height:u.measured?.height},internals:{positionAbsolute:n,handleBounds:iC(u,e),z:lC(u,s,i.zIndexMode),userNode:u}},t.set(u.id,e)}(e.measured===void 0||e.measured.width===void 0||e.measured.height===void 0)&&!e.hidden&&(c=!1),u.parentId&&cC(e,t,n,r,a),l||=u.selected??!1}return{nodesInitialized:c,hasSelectedNodes:l}}function sC(e,t){if(!e.parentId)return;let n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function cC(e,t,n,r,i){let{elevateNodesOnSelect:a,nodeOrigin:o,nodeExtent:s,zIndexMode:c}=nC(eC,r),l=e.parentId,u=t.get(l);if(!u){console.warn(`Parent node ${l} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}sC(e,n),i&&!u.parentId&&u.internals.rootParentIndex===void 0&&c===`auto`&&(u.internals.rootParentIndex=++i.i,u.internals.z=u.internals.z+i.i*$S),i&&u.internals.rootParentIndex!==void 0&&(i.i=u.internals.rootParentIndex);let{x:d,y:f,z:p}=uC(e,u,o,s,a&&!aC(c)?QS:0,c),{positionAbsolute:m}=e.internals,h=d!==m.x||f!==m.y;(h||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:h?{x:d,y:f}:m,z:p}})}function lC(e,t,n){let r=nS(e.zIndex)?e.zIndex:0;return aC(n)?r:r+(e.selected?t:0)}function uC(e,t,n,r,i,a){let{x:o,y:s}=t.internals.positionAbsolute,c=pS(e),l=Nx(e,n),u=fS(e.extent)?Ux(l,e.extent,c):l,d=Ux({x:o+u.x,y:s+u.y},r,c);e.extent===`parent`&&(d=Wx(d,c,t));let f=lC(e,i,a),p=t.internals.z??0;return{x:d.x,y:d.y,z:p>=f?p+1:f}}function dC(e,t,n,r=[0,0]){let i=[],a=new Map;for(let n of e){let e=t.get(n.parentId);if(!e)continue;let r=Qx(a.get(n.parentId)?.expandedRect??Xx(e),n.rect);a.set(n.parentId,{expandedRect:r,parent:e})}return a.size>0&&a.forEach(({expandedRect:t,parent:a},o)=>{let s=a.internals.positionAbsolute,c=pS(a),l=a.origin??r,u=t.x<s.x?Math.round(Math.abs(s.x-t.x)):0,d=t.y<s.y?Math.round(Math.abs(s.y-t.y)):0,f=Math.max(c.width,Math.round(t.width)),p=Math.max(c.height,Math.round(t.height)),m=(f-c.width)*l[0],h=(p-c.height)*l[1];(u>0||d>0||m||h)&&(i.push({id:o,type:`position`,position:{x:a.position.x-u+m,y:a.position.y-d+h}}),n.get(o)?.forEach(t=>{e.some(e=>e.id===t.id)||i.push({id:t.id,type:`position`,position:{x:t.position.x+u,y:t.position.y+d}})})),(c.width<t.width||c.height<t.height||u||d)&&i.push({id:o,type:`dimensions`,setAttributes:!0,dimensions:{width:f+(u?l[0]*u-m:0),height:p+(d?l[1]*d-h:0)}})}),i}function fC(e,t,n,r,i,a,o){let s=r?.querySelector(`.xyflow__viewport`),c=!1;if(!s)return{changes:[],updatedInternals:c};let l=[],u=window.getComputedStyle(s),{m22:d}=new window.DOMMatrixReadOnly(u.transform),f=[];for(let r of e.values()){let e=t.get(r.id);if(!e)continue;if(e.hidden){t.set(e.id,{...e,internals:{...e.internals,handleBounds:void 0}}),c=!0;continue}let s=xS(r.nodeElement),u=e.measured.width!==s.width||e.measured.height!==s.height;if(s.width&&s.height&&(u||!e.internals.handleBounds||r.force)){let p=r.nodeElement.getBoundingClientRect(),m=fS(e.extent)?e.extent:a,{positionAbsolute:h}=e.internals;if(e.parentId&&e.extent===`parent`){let n=t.get(e.parentId);n&&(h=Wx(h,s,n))}else m&&(h=Ux(h,m,s));let g={...e,measured:s,internals:{...e.internals,positionAbsolute:h,handleBounds:{source:DS(`source`,r.nodeElement,p,d,e.id),target:DS(`target`,r.nodeElement,p,d,e.id)}}};t.set(e.id,g),e.parentId&&cC(g,t,n,{nodeOrigin:i,zIndexMode:o}),c=!0,u&&(l.push({id:e.id,type:`dimensions`,dimensions:s}),e.expandParent&&e.parentId&&f.push({id:e.id,parentId:e.parentId,rect:Xx(g,i)}))}}if(f.length>0){let e=dC(f,t,n,i);l.push(...e)}return{changes:l,updatedInternals:c}}async function pC({delta:e,panZoom:t,transform:n,translateExtent:r,width:i,height:a}){if(!t||!e.x&&!e.y)return!1;let o=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[i,a]],r);return!!o&&(o.x!==n[0]||o.y!==n[1]||o.k!==n[2])}function mC(e,t,n,r,i,a){let o=i,s=r.get(o)||new Map;r.set(o,s.set(n,t)),o=`${i}-${e}`;let c=r.get(o)||new Map;if(r.set(o,c.set(n,t)),a){o=`${i}-${e}-${a}`;let s=r.get(o)||new Map;r.set(o,s.set(n,t))}}function hC(e,t,n){e.clear(),t.clear();for(let r of n){let{source:n,target:i,sourceHandle:a=null,targetHandle:o=null}=r,s={edgeId:r.id,source:n,target:i,sourceHandle:a,targetHandle:o},c=`${n}-${a}--${i}-${o}`;mC(`source`,s,`${i}-${o}--${n}-${a}`,e,n,a),mC(`target`,s,c,e,i,o),t.set(r.id,r)}}function gC(e,t){if(!e.parentId)return!1;let n=t.get(e.parentId);return n?n.selected?!0:gC(n,t):!1}function _C(e,t,n){let r=e;do{if(r?.matches?.(t))return!0;if(r===n)return!1;r=r?.parentElement}while(r);return!1}function vC(e,t,n,r){let i=new Map;for(let[a,o]of e)if((o.selected||o.id===r)&&(!o.parentId||!gC(o,e))&&(o.draggable||t&&o.draggable===void 0)){let t=e.get(a);t&&i.set(a,{id:a,position:t.position||{x:0,y:0},distance:{x:n.x-t.internals.positionAbsolute.x,y:n.y-t.internals.positionAbsolute.y},extent:t.extent,parentId:t.parentId,origin:t.origin,expandParent:t.expandParent,internals:{positionAbsolute:t.internals.positionAbsolute||{x:0,y:0}},measured:{width:t.measured.width??0,height:t.measured.height??0}})}return i}function yC({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){let i=[];for(let[e,a]of t){let t=n.get(e)?.internals.userNode;t&&i.push({...t,position:a.position,dragging:r})}if(!e)return[i[0],i];let a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:r}:i[0],i]}function bC({dragItems:e,snapGrid:t,x:n,y:r}){let i=e.values().next().value;if(!i)return null;let a={x:n-i.distance.x,y:r-i.distance.y},o=iS(a,t);return{x:o.x-a.x,y:o.y-a.y}}function xC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:i}){let a={x:null,y:null},o=0,s=new Map,c=!1,l={x:0,y:0},u=null,d=!1,f=null,p=!1,m=!1,h=null;function g({noDragClassName:g,handleSelector:_,domNode:v,isSelectable:y,nodeId:b,nodeClickDistance:x=0}){f=V_(v);function S({x:e,y:n}){let{nodeLookup:i,nodeExtent:o,snapGrid:c,snapToGrid:l,nodeOrigin:u,onNodeDrag:d,onSelectionDrag:f,onError:p,updateNodePositions:g}=t();a={x:e,y:n};let _=!1,v=s.size>1,y=v&&o?Jx(Fx(s)):null,x=v&&l?bC({dragItems:s,snapGrid:c,x:e,y:n}):null;for(let[t,r]of s){if(!i.has(t))continue;let a={x:e-r.distance.x,y:n-r.distance.y};l&&(a=x?{x:Math.round(a.x+x.x),y:Math.round(a.y+x.y)}:iS(a,c));let s=null;if(v&&o&&!r.extent&&y){let{positionAbsolute:e}=r.internals,t=e.x-y.x+o[0][0],n=e.x+r.measured.width-y.x2+o[1][0],i=e.y-y.y+o[0][1],a=e.y+r.measured.height-y.y2+o[1][1];s=[[t,i],[n,a]]}let{position:d,positionAbsolute:f}=Bx({nodeId:t,nextPosition:a,nodeLookup:i,nodeExtent:s||o,nodeOrigin:u,onError:p});_=_||r.position.x!==d.x||r.position.y!==d.y,r.position=d,r.internals.positionAbsolute=f}if(m||=_,_&&(g(s,!0),h&&(r||d||!b&&f))){let[e,t]=yC({nodeId:b,dragItems:s,nodeLookup:i});r?.(h,s,e,t),d?.(h,e,t),b||f?.(h,t)}}async function C(){if(!u)return;let{transform:e,panBy:n,autoPanSpeed:r,autoPanOnNodeDrag:i}=t();if(!i){c=!1,cancelAnimationFrame(o);return}let[s,d]=Kx(l,u,r);(s!==0||d!==0)&&(a.x=(a.x??0)-s/e[2],a.y=(a.y??0)-d/e[2],await n({x:s,y:d})&&S(a)),o=requestAnimationFrame(C)}function w(r){let{nodeLookup:i,multiSelectionActive:o,nodesDraggable:c,transform:l,snapGrid:f,snapToGrid:p,selectNodesOnDrag:m,onNodeDragStart:h,onSelectionDragStart:g,unselectNodesAndEdges:_}=t();d=!0,(!m||!y)&&!o&&b&&(i.get(b)?.selected||_()),y&&m&&b&&e?.(b);let v=bS(r.sourceEvent,{transform:l,snapGrid:f,snapToGrid:p,containerBounds:u});if(a=v,s=vC(i,c,v,b),s.size>0&&(n||h||!b&&g)){let[e,t]=yC({nodeId:b,dragItems:s,nodeLookup:i});n?.(r.sourceEvent,s,e,t),h?.(r.sourceEvent,e,t),b||g?.(r.sourceEvent,t)}}let T=nv().clickDistance(x).on(`start`,e=>{let{domNode:n,nodeDragThreshold:r,transform:i,snapGrid:o,snapToGrid:s}=t();u=n?.getBoundingClientRect()||null,p=!1,m=!1,h=e.sourceEvent,r===0&&w(e),a=bS(e.sourceEvent,{transform:i,snapGrid:o,snapToGrid:s,containerBounds:u}),l=ES(e.sourceEvent,u)}).on(`drag`,e=>{let{autoPanOnNodeDrag:n,transform:r,snapGrid:i,snapToGrid:o,nodeDragThreshold:f,nodeLookup:m}=t(),g=bS(e.sourceEvent,{transform:r,snapGrid:i,snapToGrid:o,containerBounds:u});if(h=e.sourceEvent,(e.sourceEvent.type===`touchmove`&&e.sourceEvent.touches.length>1||b&&!m.has(b))&&(p=!0),!p){if(!c&&n&&d&&(c=!0,C()),!d){let t=ES(e.sourceEvent,u),n=t.x-l.x,r=t.y-l.y;Math.sqrt(n*n+r*r)>f&&w(e)}(a.x!==g.xSnapped||a.y!==g.ySnapped)&&s&&d&&(l=ES(e.sourceEvent,u),S(g))}}).on(`end`,e=>{if(!d||p){p&&s.size>0&&t().updateNodePositions(s,!1);return}if(c=!1,d=!1,cancelAnimationFrame(o),s.size>0){let{nodeLookup:n,updateNodePositions:r,onNodeDragStop:a,onSelectionDragStop:o}=t();if(m&&=(r(s,!1),!1),i||a||!b&&o){let[t,r]=yC({nodeId:b,dragItems:s,nodeLookup:n,dragging:!1});i?.(e.sourceEvent,s,t,r),a?.(e.sourceEvent,t,r),b||o?.(e.sourceEvent,r)}}}).filter(e=>{let t=e.target;return!e.button&&(!g||!_C(t,`.${g}`,v))&&(!_||_C(t,_,v))});f.call(T)}function _(){f?.on(`.drag`,null)}return{update:g,destroy:_}}function SC(e,t,n){let r=[],i={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(let e of t.values())eS(i,Xx(e))>0&&r.push(e);return r}var CC=250;function wC(e,t,n,r){let i=[],a=1/0,o=SC(e,n,t+CC);for(let n of o){let o=[...n.internals.handleBounds?.source??[],...n.internals.handleBounds?.target??[]];for(let s of o){if(r.nodeId===s.nodeId&&r.type===s.type&&r.id===s.id)continue;let{x:o,y:c}=JS(n,s,s.position,!0),l=Math.sqrt((o-e.x)**2+(c-e.y)**2);l>t||(l<a?(i=[{...s,x:o,y:c}],a=l):l===a&&i.push({...s,x:o,y:c}))}}if(!i.length)return null;if(i.length>1){let e=r.type===`source`?`target`:`source`;return i.find(t=>t.type===e)??i[0]}return i[0]}function TC(e,t,n,r,i,a=!1){let o=r.get(e);if(!o)return null;let s=i===`strict`?o.internals.handleBounds?.[t]:[...o.internals.handleBounds?.source??[],...o.internals.handleBounds?.target??[]],c=(n?s?.find(e=>e.id===n):s?.[0])??null;return c&&a?{...c,...JS(o,c,c.position,!0)}:c}function EC(e,t){return e||(t?.classList.contains(`target`)?`target`:t?.classList.contains(`source`)?`source`:null)}function DC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}var OC=()=>!0;function kC(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:i,edgeUpdaterType:a,isTarget:o,domNode:s,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:d,panBy:f,cancelConnection:p,onConnectStart:m,onConnect:h,onConnectEnd:g,isValidConnection:_=OC,onReconnectEnd:v,updateConnection:y,getTransform:b,getFromHandle:x,autoPanSpeed:S,dragThreshold:C=1,handleDomNode:w}){let T=SS(e.target),E=0,D,{x:O,y:k}=ES(e),A=EC(a,w),j=s?.getBoundingClientRect(),M=!1;if(!j||!A)return;let N=TC(i,A,r,c,t);if(!N)return;let P=ES(e,j),ee=!1,te=null,ne=!1,re=null;function ie(){if(!u||!j)return;let[e,t]=Kx(P,j,S);f({x:e,y:t}),E=requestAnimationFrame(ie)}let F={...N,nodeId:i,type:A,position:N.position},ae=c.get(i),oe={inProgress:!0,isValid:null,from:JS(ae,F,Z.Left,!0),fromHandle:F,fromPosition:F.position,fromNode:ae,to:P,toHandle:null,toPosition:kx[F.position],toNode:null,pointer:P};function I(){M=!0,y(oe),m?.(e,{nodeId:i,handleId:r,handleType:A})}C===0&&I();function L(e){if(!M){let{x:t,y:n}=ES(e),r=t-O,i=n-k;if(!(r*r+i*i>C*C))return;I()}if(!x()||!F){se(e);return}let a=b();P=ES(e,j),D=wC(aS(P,a,!1,[1,1]),n,c,F),ee||=(ie(),!0);let s=AC(e,{handle:D,connectionMode:t,fromNodeId:i,fromHandleId:r,fromType:o?`target`:`source`,isValidConnection:_,doc:T,lib:l,flowId:d,nodeLookup:c});re=s.handleDomNode,te=s.connection,ne=DC(!!D,s.isValid);let u=c.get(i),f=u?JS(u,F,Z.Left,!0):oe.from,p={...oe,from:f,isValid:ne,to:s.toHandle&&ne?oS({x:s.toHandle.x,y:s.toHandle.y},a):P,toHandle:s.toHandle,toPosition:ne&&s.toHandle?s.toHandle.position:kx[F.position],toNode:s.toHandle?c.get(s.toHandle.nodeId):null,pointer:P};y(p),oe=p}function se(e){if(!(`touches`in e&&e.touches.length>0)){if(M){(D||re)&&te&&ne&&h?.(te);let{inProgress:t,...n}=oe,r={...n,toPosition:oe.toHandle?oe.toPosition:null};g?.(e,r),a&&v?.(e,r)}p(),cancelAnimationFrame(E),ee=!1,ne=!1,te=null,re=null,T.removeEventListener(`mousemove`,L),T.removeEventListener(`mouseup`,se),T.removeEventListener(`touchmove`,L),T.removeEventListener(`touchend`,se)}}T.addEventListener(`mousemove`,L),T.addEventListener(`mouseup`,se),T.addEventListener(`touchmove`,L),T.addEventListener(`touchend`,se)}function AC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:i,fromType:a,doc:o,lib:s,flowId:c,isValidConnection:l=OC,nodeLookup:u}){let d=a===`target`,f=t?o.querySelector(`.${s}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:p,y:m}=ES(e),h=o.elementFromPoint(p,m),g=h?.classList.contains(`${s}-flow__handle`)?h:f,_={handleDomNode:g,isValid:!1,connection:null,toHandle:null};if(g){let e=EC(void 0,g),t=g.getAttribute(`data-nodeid`),a=g.getAttribute(`data-handleid`),o=g.classList.contains(`connectable`),s=g.classList.contains(`connectableend`);if(!t||!e)return _;let c={source:d?t:r,sourceHandle:d?a:i,target:d?r:t,targetHandle:d?i:a};_.connection=c,_.isValid=o&&s&&(n===Cx.Strict?d&&e===`source`||!d&&e===`target`:t!==r||a!==i)&&l(c),_.toHandle=TC(t,e,a,u,n,!0)}return _}var jC={onPointerDown:kC,isValid:AC};function MC({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){let i=V_(e);function a({translateExtent:e,width:a,height:o,zoomStep:s=1,pannable:c=!0,zoomable:l=!0,inversePan:u=!1}){let d=e=>{if(e.sourceEvent.type!==`wheel`||!t)return;let r=n(),i=e.sourceEvent.ctrlKey&&dS()?10:1,a=-e.sourceEvent.deltaY*(e.sourceEvent.deltaMode===1?.05:e.sourceEvent.deltaMode?1:.002)*s,o=r[2]*2**(a*i);t.scaleTo(o)},f=[0,0],p=vx().on(`start`,e=>{(e.sourceEvent.type===`mousedown`||e.sourceEvent.type===`touchstart`)&&(f=[e.sourceEvent.clientX??e.sourceEvent.touches[0].clientX,e.sourceEvent.clientY??e.sourceEvent.touches[0].clientY])}).on(`zoom`,c?i=>{let s=n();if(i.sourceEvent.type!==`mousemove`&&i.sourceEvent.type!==`touchmove`||!t)return;let c=[i.sourceEvent.clientX??i.sourceEvent.touches[0].clientX,i.sourceEvent.clientY??i.sourceEvent.touches[0].clientY],l=[c[0]-f[0],c[1]-f[1]];f=c;let d=r()*Math.max(s[2],Math.log(s[2]))*(u?-1:1),p={x:s[0]-l[0]*d,y:s[1]-l[1]*d},m=[[0,0],[a,o]];t.setViewportConstrained({x:p.x,y:p.y,zoom:s[2]},m,e)}:null).on(`zoom.wheel`,l?d:null);i.call(p,{})}function o(){i.on(`zoom`,null)}return{update:a,destroy:o,pointer:U_}}var NC=e=>({x:e.x,y:e.y,zoom:e.k}),PC=({x:e,y:t,zoom:n})=>cx.translate(e,t).scale(n),FC=(e,t)=>e.target.closest(`.${t}`),IC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),LC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,RC=(e,t=0,n=LC,r=()=>{})=>{let i=typeof t==`number`&&t>0;return i||r(),i?e.transition().duration(t).ease(n).on(`end`,r):e},zC=e=>{let t=e.ctrlKey&&dS()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function BC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:i,panOnScrollSpeed:a,zoomOnPinch:o,onPanZoomStart:s,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(FC(u,t))return u.ctrlKey&&u.preventDefault(),!1;u.preventDefault(),u.stopImmediatePropagation();let d=n.property(`__zoom`).k||1;if(u.ctrlKey&&o){let e=U_(u),t=d*2**zC(u);r.scaleTo(n,t,e,u);return}let f=u.deltaMode===1?20:1,p=i===wx.Vertical?0:u.deltaX*f,m=i===wx.Horizontal?0:u.deltaY*f;!dS()&&u.shiftKey&&i!==wx.Vertical&&(p=u.deltaY*f,m=0),r.translateBy(n,-(p/d)*a,-(m/d)*a,{internal:!0});let h=NC(n.property(`__zoom`));clearTimeout(e.panScrollTimeout),e.isPanScrolling?c?.(u,h):(e.isPanScrolling=!0,s?.(u,h)),e.panScrollTimeout=setTimeout(()=>{l?.(u,h),e.isPanScrolling=!1},150)}}function VC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,i){let a=r.type===`wheel`,o=!t&&a&&!r.ctrlKey,s=FC(r,e);if(r.ctrlKey&&a&&s&&r.preventDefault(),o||s)return null;r.preventDefault(),n.call(this,r,i)}}function HC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{if(r.sourceEvent?.internal)return;let i=NC(r.transform);e.mouseButton=r.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=i,r.sourceEvent?.type===`mousedown`&&t(!0),n&&n?.(r.sourceEvent,i)}}function UC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:i}){return a=>{e.usedRightMouseButton=!!(n&&IC(t,e.mouseButton??0)),a.sourceEvent?.sync||r([a.transform.x,a.transform.y,a.transform.k]),i&&!a.sourceEvent?.internal&&i?.(a.sourceEvent,NC(a.transform))}}function WC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:i,onPaneContextMenu:a}){return o=>{if(!o.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&IC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&o.sourceEvent&&a(o.sourceEvent),e.usedRightMouseButton=!1,r(!1),i)){let t=NC(o.transform);e.prevViewport=t,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{i?.(o.sourceEvent,t)},n?150:0)}}}function GC({panActivationKeyPressed:e,zoomActivationKeyPressed:t,zoomOnScroll:n,zoomOnPinch:r,panOnDrag:i,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:s,noWheelClassName:c,noPanClassName:l,lib:u,connectionInProgress:d}){return f=>{let p=t||n,m=r&&f.ctrlKey,h=f.type===`wheel`;if(f.button===1&&f.type===`mousedown`&&(FC(f,`${u}-flow__node`)||FC(f,`${u}-flow__edge`)||FC(f,`${u}-flow__selection`)||FC(f,`${u}-flow__nodesselection`)))return!0;if(!i&&!p&&!a&&!o&&!r||s||d&&!h||FC(f,c)&&h||FC(f,l)&&(!h||a&&h&&!t)||!r&&f.ctrlKey&&h)return!1;if(!r&&f.type===`touchstart`&&f.touches?.length>1)return f.preventDefault(),!1;if(!p&&!a&&!m&&h||!i&&(f.type===`mousedown`||f.type===`touchstart`)||Array.isArray(i)&&!i.includes(f.button)&&f.type===`mousedown`)return!1;let g=Array.isArray(i)&&i.includes(f.button)||!f.button||f.button<=1;return(!f.ctrlKey||h||e)&&g}}function KC({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:i,onPanZoom:a,onPanZoomStart:o,onPanZoomEnd:s,onDraggingChange:c}){let l={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},u=e.getBoundingClientRect(),d=[[0,0],[u.width,u.height]];(typeof ResizeObserver<`u`?new ResizeObserver(e=>{let t=e[0];t&&(d=[[0,0],[t.contentRect.width,t.contentRect.height]])}):null)?.observe(e);let f=vx().extent(()=>d).scaleExtent([t,n]).translateExtent(r),p=V_(e).call(f);y({x:i.x,y:i.y,zoom:Hx(i.zoom,t,n)},[[0,0],[u.width,u.height]],r);let m=p.on(`wheel.zoom`),h=p.on(`dblclick.zoom`);f.wheelDelta(zC);async function g(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ay:yy).transform(RC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function _({noWheelClassName:e,noPanClassName:t,onPaneContextMenu:n,userSelectionActive:r,panOnScroll:i,panOnDrag:u,panOnScrollMode:d,panOnScrollSpeed:g,preventScrolling:_,zoomOnPinch:y,zoomOnScroll:b,zoomOnDoubleClick:x,panActivationKeyPressed:S=!1,zoomActivationKeyPressed:C,lib:w,onTransformChange:T,connectionInProgress:E,paneClickDistance:D,selectionOnDrag:O}){r&&!l.isZoomingOrPanning&&v();let k=i&&!C&&!r;f.clickDistance(O?1/0:!nS(D)||D<0?0:D);let A=k?BC({zoomPanValues:l,noWheelClassName:e,d3Selection:p,d3Zoom:f,panOnScrollMode:d,panOnScrollSpeed:g,zoomOnPinch:y,onPanZoomStart:o,onPanZoom:a,onPanZoomEnd:s}):VC({noWheelClassName:e,preventScrolling:_,d3ZoomHandler:m});p.on(`wheel.zoom`,A,{passive:!1});let j=HC({zoomPanValues:l,onDraggingChange:c,onPanZoomStart:o});f.on(`start`,j);let M=UC({zoomPanValues:l,panOnDrag:u,onPaneContextMenu:!!n,onPanZoom:a,onTransformChange:T});f.on(`zoom`,M);let N=WC({zoomPanValues:l,panOnDrag:u,panOnScroll:i,onPaneContextMenu:n,onPanZoomEnd:s,onDraggingChange:c});f.on(`end`,N);let P=GC({panActivationKeyPressed:S,zoomActivationKeyPressed:C,panOnDrag:u,zoomOnScroll:b,panOnScroll:i,zoomOnDoubleClick:x,zoomOnPinch:y,userSelectionActive:r,noPanClassName:t,noWheelClassName:e,lib:w,connectionInProgress:E});f.filter(P),x?p.on(`dblclick.zoom`,h):p.on(`dblclick.zoom`,null)}function v(){f.on(`zoom`,null)}async function y(e,t,n){let r=PC(e),i=f?.constrain()(r,t,n);return i&&await g(i),i}async function b(e,t){let n=PC(e);return await g(n,t),n}function x(e){if(p){let t=PC(e),n=p.property(`__zoom`);(n.k!==e.zoom||n.x!==e.x||n.y!==e.y)&&f?.transform(p,t,null,{sync:!0})}}function S(){let e=p?lx(p.node()):{x:0,y:0,k:1};return{x:e.x,y:e.y,zoom:e.k}}async function C(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ay:yy).scaleTo(RC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}async function w(e,t){return p?new Promise(n=>{f?.interpolate(t?.interpolate===`linear`?ay:yy).scaleBy(RC(p,t?.duration,t?.ease,()=>n(!0)),e)}):!1}function T(e){f?.scaleExtent(e)}function E(e){f?.translateExtent(e)}function D(e){let t=!nS(e)||e<0?0:e;f?.clickDistance(t)}return{update:_,destroy:v,setViewport:b,setViewportConstrained:y,getViewport:S,scaleTo:C,scaleBy:w,setScaleExtent:T,setTranslateExtent:E,syncViewport:x,setClickDistance:D}}var qC;(function(e){e.Line=`line`,e.Handle=`handle`})(qC||={});function JC({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:i,affectsY:a}){let o=e-t,s=n-r,c=[o>0?1:o<0?-1:0,s>0?1:s<0?-1:0];return o&&i&&(c[0]*=-1),s&&a&&(c[1]*=-1),c}function YC(e){return{isHorizontal:e.includes(`right`)||e.includes(`left`),isVertical:e.includes(`bottom`)||e.includes(`top`),affectsX:e.includes(`left`),affectsY:e.includes(`top`)}}function XC(e,t){return Math.max(0,t-e)}function ZC(e,t){return Math.max(0,e-t)}function QC(e,t,n){return Math.max(0,t-e,e-n)}function $C(e,t){return e?!t:t}function ew(e,t,n,r,i,a,o,s){let{affectsX:c,affectsY:l}=t,{isHorizontal:u,isVertical:d}=t,f=u&&d,{xSnapped:p,ySnapped:m}=n,{minWidth:h,maxWidth:g,minHeight:_,maxHeight:v}=r,{x:y,y:b,width:x,height:S,aspectRatio:C}=e,w=Math.floor(u?p-e.pointerX:0),T=Math.floor(d?m-e.pointerY:0),E=x+(c?-w:w),D=S+(l?-T:T),O=-a[0]*x,k=-a[1]*S,A=QC(E,h,g),j=QC(D,_,v);if(o){let e=0,t=0;c&&w<0?e=XC(y+w+O,o[0][0]):!c&&w>0&&(e=ZC(y+E+O,o[1][0])),l&&T<0?t=XC(b+T+k,o[0][1]):!l&&T>0&&(t=ZC(b+D+k,o[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(s){let e=0,t=0;c&&w>0?e=ZC(y+w,s[0][0]):!c&&w<0&&(e=XC(y+E,s[1][0])),l&&T>0?t=ZC(b+T,s[0][1]):!l&&T<0&&(t=XC(b+D,s[1][1])),A=Math.max(A,e),j=Math.max(j,t)}if(i){if(u){let e=QC(E/C,_,v)*C;if(A=Math.max(A,e),o){let e=0;e=!c&&!l||c&&!l&&f?ZC(b+k+E/C,o[1][1])*C:XC(b+k+(c?w:-w)/C,o[0][1])*C,A=Math.max(A,e)}if(s){let e=0;e=!c&&!l||c&&!l&&f?XC(b+E/C,s[1][1])*C:ZC(b+(c?w:-w)/C,s[0][1])*C,A=Math.max(A,e)}}if(d){let e=QC(D*C,h,g)/C;if(j=Math.max(j,e),o){let e=0;e=!c&&!l||l&&!c&&f?ZC(y+D*C+O,o[1][0])/C:XC(y+(l?T:-T)*C+O,o[0][0])/C,j=Math.max(j,e)}if(s){let e=0;e=!c&&!l||l&&!c&&f?XC(y+D*C,s[1][0])/C:ZC(y+(l?T:-T)*C,s[0][0])/C,j=Math.max(j,e)}}}T+=T<0?j:-j,w+=w<0?A:-A,i&&(f?E>D*C?T=($C(c,l)?-w:w)/C:w=($C(c,l)?-T:T)*C:u?(T=w/C,l=c):(w=T*C,c=l));let M=c?y+w:y,N=l?b+T:b;return{width:x+(c?-w:w),height:S+(l?-T:T),x:a[0]*w*(c?-1:1)+M,y:a[1]*T*(l?-1:1)+N}}var tw={width:0,height:0,x:0,y:0},nw={...tw,pointerX:0,pointerY:0,aspectRatio:1};function rw(e,t,n){let r=t.position.x+e.position.x,i=t.position.y+e.position.y,a=e.measured.width??0,o=e.measured.height??0,s=n[0]*a,c=n[1]*o;return[[r-s,i-c],[r+a-s,i+o-c]]}function iw({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:i}){let a=V_(e),o={controlDirection:YC(`bottom-right`),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function s({controlPosition:e,boundaries:s,keepAspectRatio:c,resizeDirection:l,onResizeStart:u,onResize:d,onResizeEnd:f,shouldResize:p}){let m={...tw},h={...nw};o={boundaries:s,resizeDirection:l,keepAspectRatio:c,controlDirection:YC(e)};let g,_=null,v=[],y,b,x,S=!1,C=nv().on(`start`,e=>{let{nodeLookup:r,transform:i,snapGrid:a,snapToGrid:o,nodeOrigin:s,paneDomNode:c}=n();if(g=r.get(t),!g)return;_=c?.getBoundingClientRect()??null;let{xSnapped:l,ySnapped:d}=bS(e.sourceEvent,{transform:i,snapGrid:a,snapToGrid:o,containerBounds:_});m={width:g.measured.width??0,height:g.measured.height??0,x:g.position.x??0,y:g.position.y??0},h={...m,pointerX:l,pointerY:d,aspectRatio:m.width/m.height},y=void 0,b=fS(g.extent)?g.extent:void 0,g.parentId&&(g.extent===`parent`||g.expandParent)&&(y=r.get(g.parentId)),y&&g.extent===`parent`&&(b=[[0,0],[y.measured.width,y.measured.height]]),v=[],x=void 0;for(let[e,n]of r)if(n.parentId===t&&(v.push({id:e,position:{...n.position},extent:n.extent}),n.extent===`parent`||n.expandParent)){let e=rw(n,g,n.origin??s);x=x?[[Math.min(e[0][0],x[0][0]),Math.min(e[0][1],x[0][1])],[Math.max(e[1][0],x[1][0]),Math.max(e[1][1],x[1][1])]]:e}u?.(e,{...m})}).on(`drag`,e=>{let{transform:t,snapGrid:i,snapToGrid:a,nodeOrigin:s}=n(),c=bS(e.sourceEvent,{transform:t,snapGrid:i,snapToGrid:a,containerBounds:_}),l=[];if(!g)return;let{x:u,y:f,width:C,height:w}=m,T={},E=g.origin??s,{width:D,height:O,x:k,y:A}=ew(h,o.controlDirection,c,o.boundaries,o.keepAspectRatio,E,b,x),j=D!==C,M=O!==w,N=k!==u&&j,P=A!==f&&M;if(!N&&!P&&!j&&!M)return;if((N||P||E[0]===1||E[1]===1)&&(T.x=N?k:m.x,T.y=P?A:m.y,m.x=T.x,m.y=T.y,v.length>0)){let e=k-u,t=A-f;for(let n of v)n.position={x:n.position.x-e+E[0]*(D-C),y:n.position.y-t+E[1]*(O-w)},l.push(n)}if((j||M)&&(T.width=j&&(!o.resizeDirection||o.resizeDirection===`horizontal`)?D:m.width,T.height=M&&(!o.resizeDirection||o.resizeDirection===`vertical`)?O:m.height,m.width=T.width,m.height=T.height),y&&g.expandParent){let e=E[0]*(T.width??0);T.x&&T.x<e&&(m.x=e,h.x-=T.x-e);let t=E[1]*(T.height??0);T.y&&T.y<t&&(m.y=t,h.y-=T.y-t)}let ee=JC({width:m.width,prevWidth:C,height:m.height,prevHeight:w,affectsX:o.controlDirection.affectsX,affectsY:o.controlDirection.affectsY}),te={...m,direction:ee};p?.(e,te)!==!1&&(S=!0,d?.(e,te),r(T,l))}).on(`end`,e=>{S&&=(f?.(e,{...m}),i?.({...m}),!1)});a.call(C)}function c(){a.on(`.drag`,null)}return{update:s,destroy:c}}var aw=ye((e=>{var t=(h(),xe(S)),n=yo();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),ow=v(ye(((e,t)=>{t.exports=aw()}))(),1),sw=e=>{let t,n=new Set,r=(e,r)=>{let i=typeof e==`function`?e(t):e;if(!Object.is(i,t)){let e=t;t=r??(typeof i!=`object`||!i)?i:Object.assign({},t,i),n.forEach(n=>n(t,e))}},i=()=>t,a={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{n.clear()}},o=t=e(r,i,a);return a},cw=e=>e?sw(e):sw;h();var{useDebugValue:lw}=s,{useSyncExternalStoreWithSelector:uw}=ow.default,dw=e=>e;function fw(e,t=dw,n){let r=uw(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return lw(r),r}var pw=(e,t)=>{let n=cw(e),r=(e,r=t)=>fw(n,e,r);return Object.assign(r,n),r},mw=(e,t)=>e?pw(e,t):pw;function hw(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}let n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}ie(),h();var gw=fe(null),_w=gw.Provider,vw=yx.error001(`react`);function Q(e,t){let n=L(gw);if(n===null)throw Error(vw);return fw(n,e,t)}function yw(){let e=L(gw);if(e===null)throw Error(vw);return V(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}var bw={display:`none`},xw={position:`absolute`,width:1,height:1,margin:-1,border:0,padding:0,overflow:`hidden`,clip:`rect(0px, 0px, 0px, 0px)`,clipPath:`inset(100%)`},Sw=`react-flow__node-desc`,Cw=`react-flow__edge-desc`,ww=`react-flow__aria-live`,Tw=e=>e.ariaLiveMessage,Ew=e=>e.ariaLabelConfig;function Dw({rfId:e}){let t=Q(Tw);return p(`div`,{id:`${ww}-${e}`,"aria-live":`assertive`,"aria-atomic":`true`,style:xw,children:t})}function Ow({rfId:e,disableKeyboardA11y:t}){let n=Q(Ew);return p(ne,{children:[p(`div`,{id:`${Sw}-${e}`,style:bw,children:t?n[`node.a11yDescription.default`]:n[`node.a11yDescription.keyboardDisabled`]}),p(`div`,{id:`${Cw}-${e}`,style:bw,children:n[`edge.a11yDescription.default`]}),!t&&p(Dw,{rfId:e})]})}var kw=l(({position:e=`top-left`,children:t,className:n,style:r,...i},a)=>{let o=`${e}`.split(`-`);return p(`div`,{className:Ih([`react-flow__panel`,n,...o]),style:r,ref:a,...i,children:t})});kw.displayName=`Panel`;var Aw=`https://reactflow.dev?utm_source=attribution`;function jw({proOptions:e,position:t=`bottom-right`}){return O(()=>{},[]),e?.hideAttribution?null:p(kw,{position:t,className:`react-flow__attribution`,"data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Aw}`,children:p(`a`,{href:Aw,target:`_blank`,rel:`noopener noreferrer`,"aria-label":`React Flow attribution`,children:`React Flow`})})}var Mw=e=>{let t=[],n=[];for(let[,n]of e.nodeLookup)n.selected&&t.push(n.internals.userNode);for(let[,t]of e.edgeLookup)t.selected&&n.push(t);return{selectedNodes:t,selectedEdges:n}},Nw=e=>e.id;function Pw(e,t){return hw(e.selectedNodes.map(Nw),t.selectedNodes.map(Nw))&&hw(e.selectedEdges.map(Nw),t.selectedEdges.map(Nw))}function Fw({onSelectionChange:e}){let t=yw(),{selectedNodes:n,selectedEdges:r}=Q(Mw,Pw);return O(()=>{let i={nodes:n,edges:r};e?.(i),t.getState().onSelectionChangeHandlers.forEach(e=>e(i))},[n,r,e]),null}var Iw=e=>!!e.onSelectionChangeHandlers;function Lw({onSelectionChange:e}){let t=Q(Iw);return e||t?p(Fw,{onSelectionChange:e}):null}var Rw=[0,0],zw={x:0,y:0,zoom:1},Bw=[...`nodes.edges.defaultNodes.defaultEdges.onConnect.onConnectStart.onConnectEnd.onClickConnectStart.onClickConnectEnd.nodesDraggable.autoPanOnNodeFocus.nodesConnectable.nodesFocusable.edgesFocusable.edgesReconnectable.elevateNodesOnSelect.elevateEdgesOnSelect.minZoom.maxZoom.nodeExtent.onNodesChange.onEdgesChange.elementsSelectable.connectionMode.snapGrid.snapToGrid.translateExtent.connectOnClick.defaultEdgeOptions.fitView.fitViewOptions.onNodesDelete.onEdgesDelete.onDelete.onNodeDrag.onNodeDragStart.onNodeDragStop.onSelectionDrag.onSelectionDragStart.onSelectionDragStop.onMoveStart.onMove.onMoveEnd.noPanClassName.nodeOrigin.autoPanOnConnect.autoPanOnNodeDrag.onError.connectionRadius.isValidConnection.selectNodesOnDrag.nodeDragThreshold.connectionDragThreshold.onBeforeDelete.debug.autoPanSpeed.ariaLabelConfig.zIndexMode`.split(`.`),`rfId`],Vw=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Hw={translateExtent:bx,nodeOrigin:Rw,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:`nopan`,rfId:`1`};function Uw(e){let{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:i,setTranslateExtent:a,setNodeExtent:o,reset:s,setDefaultNodesAndEdges:c}=Q(Vw,hw),l=yw();O(()=>(c(e.defaultNodes,e.defaultEdges),()=>{u.current=Hw,s()}),[]);let u=R(Hw);return O(()=>{for(let s of Bw){let c=e[s];c!==u.current[s]&&e[s]!==void 0&&(s===`nodes`?t(c):s===`edges`?n(c):s===`minZoom`?r(c):s===`maxZoom`?i(c):s===`translateExtent`?a(c):s===`nodeExtent`?o(c):s===`ariaLabelConfig`?l.setState({ariaLabelConfig:vS(c)}):s===`fitView`?l.setState({fitViewQueued:c}):s===`fitViewOptions`?l.setState({fitViewOptions:c}):l.setState({[s]:c}))}u.current=e},Bw.map(t=>e[t])),null}function Ww(){return typeof window>`u`||!window.matchMedia?null:window.matchMedia(`(prefers-color-scheme: dark)`)}function Gw(e){let[t,n]=B(e===`system`?null:e);return O(()=>{if(e!==`system`){n(e);return}let t=Ww(),r=()=>n(t?.matches?`dark`:`light`);return r(),t?.addEventListener(`change`,r),()=>{t?.removeEventListener(`change`,r)}},[e]),t===null?Ww()?.matches?`dark`:`light`:t}var Kw=typeof document<`u`?document:null;function qw(e=null,t={target:Kw,actInsideInputWithModifier:!0}){let[n,r]=B(!1),i=R(!1),a=R(new Set([])),[o,s]=V(()=>{if(e!==null){let t=(Array.isArray(e)?e:[e]).filter(e=>typeof e==`string`).map(e=>e.replace(/\+/g,`
1126
1126
  `).replace(`
1127
1127
 
1128
1128
  `,`
1129
1129
  +`).split(`
1130
- `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return O(()=>{let n=t?.target??Vw,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&yS(e))return!1;let n=Ww(e.code,s);if(a.current.add(e[n]),Uw(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=Ww(e.code,s);Uw(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function Uw(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Ww(e,t){return t.includes(e)?`code`:`key`}var Gw=()=>{let e=mw();return V(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=aS(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return eS(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=tS(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function Kw(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)qw(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function qw(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function Jw(e,t){return Kw(e,t)}function Yw(e,t){return Kw(e,t)}function Xw(e,t){return{id:e,type:`select`,selected:t}}function Zw(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(Xw(a.id,e)))}return r}function Qw({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function $w(e){return{id:e.id,type:`remove`}}var eT=Qx(`React Flow`,`https://reactflow.dev/`);function tT(e,t,n={}){return MS(e,t,{...n,onError:n.onError??eT})}var nT=e=>Ex(e),rT=e=>Tx(e);function iT(e){return l(e)}var aT=typeof window<`u`?_e:O;function oT(e){let[t,n]=B(BigInt(0)),[r]=B(()=>sT(()=>n(e=>e+BigInt(1))));return aT(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function sT(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var cT=fe(null);function lT({children:e}){let t=mw(),n=oT(z(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=Qw({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=oT(z(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(Qw({items:s,lookup:o}))},[])),i=V(()=>({nodeQueue:n,edgeQueue:r}),[]);return p(cT.Provider,{value:i,children:e})}function uT(){let e=L(cT);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var dT=e=>!!e.panZoom;function fT(){let e=Gw(),t=mw(),n=uT(),r=Q(dT),i=V(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=nT(e)?e:n.get(e.id),a=i.parentId?uS(i.position,i.measured,i.parentId,n,r):i.position;return Gx({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&nT(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&rT(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Ix({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map($w);o?.(f),c(e)}if(m){let e=d.map($w);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=Xx(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=Gx(s?r:a),l=Yx(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=Xx(e)?e:a(e);if(!r)return!1;let i=Yx(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return kx(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??fS();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return V(()=>({...i,...e,viewportInitialized:r}),[r])}var pT=e=>e.selected,mT=typeof window<`u`?window:void 0;function hT({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=mw(),{deleteElements:r}=fT(),i=Hw(e,{actInsideInputWithModifier:!1}),a=Hw(t,{target:mT});O(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(pT),edges:e.filter(pT)}),n.setState({nodesSelectionActive:!1})}},[i]),O(()=>{n.setState({multiSelectionActive:a})},[a])}function gT(e){let t=mw();O(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=gS(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,mx.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var _T={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},vT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function yT({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=yx.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:m,preventScrolling:h=!0,children:g,noWheelClassName:_,noPanClassName:v,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=mw(),w=R(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=Q(vT,uw),k=Hw(m),A=R();gT(w);let j=z(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[y,b]);return O(()=>{if(w.current){A.current=VC({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=A.current.getViewport();return C.setState({panZoom:A.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{A.current?.destroy()}}},[]),O(()=>{A.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:k,preventScrolling:h,noPanClassName:v,userSelectionActive:T,noWheelClassName:_,lib:E,onTransformChange:j,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,k,h,v,T,_,E,j,D,S,x]),p(`div`,{className:`react-flow__renderer`,ref:w,style:_T,children:g})}var bT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function xT(){let{userSelectionActive:e,userSelectionRect:t}=Q(bT,uw);return e&&t?p(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var ST=(e,t)=>n=>{n.target===t.current&&e?.(n)},CT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function wT({isSelecting:e,selectionKeyPressed:t,selectionMode:n=bx.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:m,onPaneMouseLeave:h,children:g}){let _=R(0),v=mw(),{userSelectionActive:y,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=Q(CT,uw),w=b&&(e||y),T=R(null),E=R(),D=R(new Set),k=R(new Set),A=R(!1),j=R(!1),M=R({x:0,y:0}),N=R(!1),P=e=>{if(j.current||A.current||v.getState().connection.inProgress){j.current=!1,A.current=!1;return}l?.(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},ee=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},te=d?e=>d(e):void 0,ne=e=>{j.current&&=(e.stopPropagation(),!1)},re=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=v.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),j.current=!1;let{x:c,y:l}=xS(n.nativeEvent,E.current),u=eS({x:c,y:l},a);v.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function ie(e,t){let{userSelectionRect:r}=v.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=v.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=tS(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=k.current;D.current=new Set(jx(a,m,i,n===bx.Partial,!0).map(e=>e.id)),k.current=new Set;let _=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&k.current.add(e)}}dS(h,D.current)||c(Zw(a,D.current,!0)),dS(g,k.current)||l(Zw(o,k.current)),v.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!i||!E.current)return;let[e,t]=Vx(M.current,E.current,C);S({x:e,y:t}).then(e=>{if(!j.current||!e){_.current=requestAnimationFrame(F);return}let{x:t,y:n}=M.current;ie(t,n),_.current=requestAnimationFrame(F)})}let ae=()=>{cancelAnimationFrame(_.current),_.current=0,N.current=!1};O(()=>()=>ae(),[]);let oe=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=v.getState();if(!E.current||!n)return;let{x:o,y:c}=xS(e.nativeEvent,E.current);M.current={x:o,y:c};let l=tS({x:n.startX,y:n.startY},r);if(!j.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}j.current=!0,N.current||=(F(),!0),ie(o,c)},I=e=>{if(!w){e.target===T.current&&v.getState().connection.inProgress&&(A.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!y&&e.target===T.current&&v.getState().userSelectionRect&&P?.(e),v.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c?.(e),v.setState({nodesSelectionActive:D.current.size>0})),ae())},L=e=>{e.target?.releasePointerCapture?.(e.pointerId),ae()},se=r===!0||Array.isArray(r)&&r.includes(0);return p(`div`,{className:jh([`react-flow__pane`,{draggable:se,dragging:x,selection:e}]),onClick:w?void 0:ST(P,T),onContextMenu:ST(ee,T),onWheel:ST(te,T),onPointerEnter:w?void 0:f,onPointerMove:w?oe:m,onPointerUp:I,onPointerCancel:w?L:void 0,onPointerDownCapture:w?re:void 0,onClickCapture:w?ne:void 0,onPointerLeave:h,ref:T,style:_T,children:[g,p(xT,{})]})}function TT({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,mx.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function ET({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=mw(),[c,l]=B(!1),u=R();return O(()=>{if(!t)return u.current=gC({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{TT({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),O(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var DT=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function OT(){let e=mw();return z(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=DT(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=$x(t,i));let{position:a,positionAbsolute:s}=Fx({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var kT=fe(null),AT=kT.Provider;kT.Consumer;var jT=()=>L(kT),MT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),NT=fe(null);function PT({children:e}){let t=Q(MT,uw);return p(NT.Provider,{value:t,children:e})}function FT(){let e=L(NT);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var IT={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},LT=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return IT;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===vx.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function RT({type:e=`source`,position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},m){let h=o||null,g=e===`target`,_=mw(),v=jT(),{connectOnClick:y,noPanClassName:b,rfId:x}=FT(),{connectingFrom:S,connectingTo:C,clickConnecting:w,isPossibleEndHandle:T,connectionInProcess:E,clickConnectionInProcess:D,valid:O}=Q(LT(v,h,e),uw);v||_.getState().onError?.(`010`,mx.error010());let k=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=_.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=_.getState();t(tT(i,e,{onError:n}))}n?.(i),s?.(i)},A=e=>{if(!v)return;let t=bS(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=_.getState();EC.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:h,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>_.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>_.getState().isValidConnection?.(...e)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return p(`div`,{"data-handleid":h,"data-nodeid":v,"data-handlepos":t,"data-id":`${x}-${v}-${h}-${e}`,className:jh([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,b,l,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:a,clickconnecting:w,connectingfrom:S,connectingto:C,valid:O,connectionindicator:r&&(!E||T)&&(E||D?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:y?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=_.getState();if(!v||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:v,handleId:h,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:v,type:e,id:h}});return}let p=_S(t.target),m=n||c,{connection:g,isValid:y}=EC.isValid(t.nativeEvent,{handle:{nodeId:v,id:h,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:m,flowId:u,doc:p,lib:l,nodeLookup:d});y&&g&&k(g);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),_.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f,children:c})}var zT=b(iT(RT));function BT({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return p(ne,{children:[e?.label,p(zT,{type:`source`,position:n,isConnectable:t})]})}function VT({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return p(ne,{children:[p(zT,{type:`target`,position:n,isConnectable:t}),e?.label,p(zT,{type:`source`,position:r,isConnectable:t})]})}function HT(){return null}function UT({data:e,isConnectable:t,targetPosition:n=Z.Top}){return p(ne,{children:[p(zT,{type:`target`,position:n,isConnectable:t}),e?.label]})}var WT={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},GT={input:BT,default:VT,output:UT,group:HT};function KT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var qT=e=>{let{width:t,height:n,x:r,y:i}=Ax(e.nodeLookup,{filter:e=>!!e.selected});return{width:Zx(t)?t:null,height:Zx(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function JT({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=mw(),{width:i,height:a,transformString:o,userSelectionActive:s}=Q(qT,uw),c=OT(),l=R(null);O(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(ET({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return p(`div`,{className:jh([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:p(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(WT,e.key)&&(e.preventDefault(),c({direction:WT[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var YT=typeof window<`u`?window:void 0,XT=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ZT({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:_,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:T,autoPanOnSelection:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:P,disableKeyboardA11y:ee,onViewportChange:te,isControlledViewport:ne}){let{nodesSelectionActive:re,userSelectionActive:ie}=Q(XT,uw),F=Hw(l,{target:YT}),ae=Hw(g,{target:YT}),oe=ae||T,I=ae||x,L=u&&oe!==!0,se=F||ie||L;return hT({deleteKeyCode:c,multiSelectionKeyCode:h}),p(yT,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:I,panActivationKeyPressed:ae,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!F&&oe,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,zoomActivationKeyCode:_,preventScrolling:j,noWheelClassName:N,noPanClassName:P,onViewportChange:te,isControlledViewport:ne,paneClickDistance:s,selectionOnDrag:L,children:p(wT,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:oe,autoPanOnSelection:E,isSelecting:!!se,selectionMode:d,selectionKeyPressed:F,paneClickDistance:s,selectionOnDrag:L,children:[e,re&&p(JT,{onSelectionContextMenu:M,noPanClassName:P,disableKeyboardA11y:ee})]})})}ZT.displayName=`FlowRenderer`;var QT=b(ZT),$T=e=>t=>e?jx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function eE(e){return Q(z($T(e),[e]),uw)}var tE=e=>e.updateNodeInternals;function nE(){let e=Q(tE),[t]=B(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return O(()=>()=>{t?.disconnect()},[t]),t}function rE({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=mw(),a=R(null),o=R(null),s=R(e.sourcePosition),c=R(e.targetPosition),l=R(t),u=n&&!!e.internals.handleBounds;return O(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),O(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),O(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function iE({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:h,rfId:g,nodeTypes:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=Q(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},uw),C=b.type||`default`,w=_?.[C]||GT[C];w===void 0&&(y?.(`003`,mx.error003(C)),C=`default`,w=_?.default||GT.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),O=!!(b.focusable||u&&b.focusable===void 0),k=mw(),A=lS(b),j=rE({node:b,nodeType:C,hasDimensions:A,resizeObserver:d}),M=ET({nodeRef:j,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),N=OT();if(b.hidden)return null;let P=cS(b),ee=KT(b),te=E||T||t||n||r||i,ne=n?e=>n(e,{...x.userNode}):void 0,re=r?e=>r(e,{...x.userNode}):void 0,ie=i?e=>i(e,{...x.userNode}):void 0,F=a?e=>a(e,{...x.userNode}):void 0,ae=o?e=>o(e,{...x.userNode}):void 0,oe=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=k.getState();E&&(!r||!T||i>0)&&TT({id:e,store:k,nodeRef:j}),t&&t(n,{...x.userNode})},I=t=>{if(!(yS(t.nativeEvent)||h)){if(gx.includes(t.key)&&E){let n=t.key===`Escape`;TT({id:e,store:k,unselect:n,nodeRef:j})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(WT,t.key)){t.preventDefault();let{ariaLabelConfig:e}=k.getState();k.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),N({direction:WT[t.key],factor:t.shiftKey?4:1})}}},L=()=>{if(h||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=k.getState();i&&(jx(new Map([[e,b]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(b.position.x+P.width/2,b.position.y+P.height/2,{zoom:t[2]}))};return p(`div`,{className:jh([`react-flow__node`,`react-flow__node-${C}`,{[m]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:M}]),ref:j,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:te?`all`:`none`,visibility:A?`visible`:`hidden`,...b.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ne,onMouseMove:re,onMouseLeave:ie,onContextMenu:F,onClick:oe,onDoubleClick:ae,onKeyDown:O?I:void 0,tabIndex:O?0:void 0,onFocus:O?L:void 0,role:b.ariaRole??(O?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":h?void 0:`${_w}-${g}`,"aria-label":b.ariaLabel,...b.domAttributes,children:p(AT,{value:e,children:p(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected??!1,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:M,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...P})})})}var aE=b(iE),oE=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function sE(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=Q(oE,uw),a=eE(e.onlyRenderVisibleElements),o=nE();return p(`div`,{className:`react-flow__nodes`,style:_T,children:a.map(a=>p(aE,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}sE.displayName=`NodeRenderer`;var cE=b(sE);function lE(e){return Q(z(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&kS({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),uw)}var uE=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return p(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},dE=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return p(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},fE={[Cx.Arrow]:uE,[Cx.ArrowClosed]:dE};function pE(e){let t=mw();return V(()=>Object.prototype.hasOwnProperty.call(fE,e)?fE[e]:(t.getState().onError?.(`009`,mx.error009(e)),null),[e])}var mE=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=pE(t);return c?p(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:p(c,{color:n,strokeWidth:o})}):null},hE=({defaultColor:e,rfId:t})=>{let n=Q(e=>e.edges),r=Q(e=>e.defaultEdgeOptions),i=V(()=>KS(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?p(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:p(`defs`,{children:i.map(e=>p(mE,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};hE.displayName=`MarkerDefinitions`;var gE=b(hE);function _E({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=B({x:1,y:0,width:0,height:0}),m=jh([`react-flow__edge-textwrapper`,l]),h=R(null);return O(()=>{if(h.current){let e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?p(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:m,visibility:d.width?`visible`:`hidden`,...u,children:[i&&p(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),p(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:h,style:r,children:n}),c]}):null}_E.displayName=`EdgeText`;var vE=b(_E);function yE({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return p(ne,{children:[p(`path`,{...u,d:e,fill:`none`,className:jh([`react-flow__edge-path`,u.className])}),l?p(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&Zx(t)&&Zx(n)?p(vE,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function bE({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function xE({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top}){let[o,s]=bE({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=bE({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=CS({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function SE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:v})=>{let[y,b,x]=xE({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),S=e.isInternal?void 0:t;return p(yE,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:v})})}var CE=SE({isInternal:!1}),wE=SE({isInternal:!0});CE.displayName=`SimpleBezierEdge`,wE.displayName=`SimpleBezierEdgeInternal`;function TE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:m=Z.Bottom,targetPosition:h=Z.Top,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=zS({sourceX:n,sourceY:r,sourcePosition:m,targetX:i,targetY:a,targetPosition:h,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),C=e.isInternal?void 0:t;return p(yE,{id:C,path:b,labelX:x,labelY:S,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:_,interactionWidth:y})})}var EE=TE({isInternal:!1}),DE=TE({isInternal:!0});EE.displayName=`SmoothStepEdge`,DE.displayName=`SmoothStepEdgeInternal`;function OE(e){return b(({id:t,...n})=>{let r=e.isInternal?void 0:t;return p(EE,{...n,id:r,pathOptions:V(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var kE=OE({isInternal:!1}),AE=OE({isInternal:!0});kE.displayName=`StepEdge`,AE.displayName=`StepEdgeInternal`;function jE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:h,interactionWidth:g})=>{let[_,v,y]=NS({sourceX:n,sourceY:r,targetX:i,targetY:a}),b=e.isInternal?void 0:t;return p(yE,{id:b,path:_,labelX:v,labelY:y,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:h,interactionWidth:g})})}var ME=jE({isInternal:!1}),NE=jE({isInternal:!0});ME.displayName=`StraightEdge`,NE.displayName=`StraightEdgeInternal`;function PE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Z.Bottom,targetPosition:s=Z.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=ES({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:v?.curvature}),C=e.isInternal?void 0:t;return p(yE,{id:C,path:b,labelX:x,labelY:S,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:y})})}var FE=PE({isInternal:!1}),IE=PE({isInternal:!0});FE.displayName=`BezierEdge`,IE.displayName=`BezierEdgeInternal`;var LE={default:IE,straight:NE,step:AE,smoothstep:DE,simplebezier:wE},RE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},zE=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,BE=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,VE=`react-flow__edgeupdater`;function HE({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return p(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:jh([VE,`${VE}-${s}`]),cx:zE(t,r,e),cy:BE(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function UE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:m}){let h=mw(),g=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:m,rfId:g,panBy:_,updateConnection:v}=h.getState(),y=t.type===`target`;EC.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},_=e=>g(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),v=e=>g(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),y=()=>m(!0),b=()=>m(!1);return p(ne,{children:[(e===!0||e===`source`)&&p(HE,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:_,onMouseEnter:y,onMouseOut:b,type:`source`}),(e===!0||e===`target`)&&p(HE,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:y,onMouseOut:b,type:`target`})]})}function WE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,rfId:h,edgeTypes:g,noPanClassName:_,onError:v,disableKeyboardA11y:y}){let b=Q(t=>t.edgeLookup.get(e)),x=Q(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=g?.[S]||LE[S];C===void 0&&(v?.(`011`,mx.error011(S)),S=`default`,C=g?.default||LE.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=R(null),[O,k]=B(!1),[A,j]=B(!1),M=mw(),{zIndex:N=b.zIndex,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie}=Q(z(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return RE;let i=VS({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),a=OS({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||RE,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,v]),uw),F=V(()=>b.markerStart?`url('#${GS(b.markerStart,h)}')`:void 0,[b.markerStart,h]),ae=V(()=>b.markerEnd?`url('#${GS(b.markerEnd,h)}')`:void 0,[b.markerEnd,h]);if(b.hidden||P===null||ee===null||te===null||ne===null)return null;let oe=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},I=a?e=>{a(e,{...b})}:void 0,L=o?e=>{o(e,{...b})}:void 0,se=s?e=>{s(e,{...b})}:void 0,ce=c?e=>{c(e,{...b})}:void 0,le=l?e=>{l(e,{...b})}:void 0;return p(`svg`,{style:{zIndex:N},children:p(`g`,{className:jh([`react-flow__edge`,`react-flow__edge-${S}`,b.className,_,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:oe,onDoubleClick:I,onContextMenu:L,onMouseEnter:se,onMouseMove:ce,onMouseLeave:le,onKeyDown:w?t=>{if(!y&&gx.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${vw}-${h}`:void 0,ref:D,...b.domAttributes,children:[!A&&p(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:F,markerEnd:ae,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&p(UE,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie,setUpdateHover:k,setReconnecting:j})]})})}var GE=b(WE),KE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function qE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:g}){let{edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,onError:b}=Q(KE,uw),x=lE(t);return p(`div`,{className:`react-flow__edges`,children:[p(gE,{defaultColor:e,rfId:n}),x.map(e=>p(GE,{id:e,edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:g},e))]})}qE.displayName=`EdgeRenderer`;var JE=b(qE),YE=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function XE({children:e}){let t=mw(),n=R(null),[r]=B(()=>t.getState().transform);return aT(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=YE(r)))};return r(),t.subscribe(r)},[t]),p(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:YE(r)},children:e})}function ZE(e){let t=fT(),n=R(!1);O(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var QE=e=>e.panZoom?.syncViewport;function $E(e){let t=Q(QE),n=mw();return O(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function eD(e){return e.connection.inProgress?{...e.connection,to:eS(e.connection.to,e.transform)}:{...e.connection}}function tD(e){return e?t=>e(eD(t)):eD}function nD(e){return Q(tD(e),uw)}var rD=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function iD({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=Q(rD,uw);return a&&i&&c?p(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:p(`g`,{className:jh([`react-flow__connection`,mS(s)]),children:p(aD,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var aD=({style:e,type:t=Sx.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:m}=nD();if(!i)return;if(n)return p(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:mS(r),toNode:u,toHandle:d,pointer:m});let h=``,g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Sx.Bezier:[h]=ES(g);break;case Sx.SimpleBezier:[h]=xE(g);break;case Sx.Step:[h]=zS({...g,borderRadius:0});break;case Sx.SmoothStep:[h]=zS(g);break;default:[h]=NS(g)}return p(`path`,{d:h,fill:`none`,className:`react-flow__connection-path`,style:e})};aD.displayName=`ConnectionLine`;var oD={};function sD(e=oD){R(e),mw(),O(()=>{},[e])}function cD(){mw(),R(!1),O(()=>{},[])}function lD({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:_,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:T,onlyRenderVisibleElements:E,elementsSelectable:D,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:P,zoomOnPinch:ee,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,zoomOnDoubleClick:ie,panOnDrag:F,autoPanOnSelection:ae,onPaneClick:oe,onPaneMouseEnter:I,onPaneMouseMove:L,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:R,nodeClickDistance:ue,onEdgeContextMenu:z,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,onReconnect:he,onReconnectStart:ge,onReconnectEnd:B,noDragClassName:_e,noWheelClassName:ve,noPanClassName:V,disableKeyboardA11y:H,nodeExtent:ye,rfId:be,viewport:xe,onViewportChange:U,nodesDraggable:Se}){return sD(e),sD(t),cD(),ZE(n),$E(xe),p(QT,{onPaneClick:oe,onPaneMouseEnter:I,onPaneMouseMove:L,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:R,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:D,zoomOnScroll:P,zoomOnPinch:ee,zoomOnDoubleClick:ie,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,panOnDrag:F,autoPanOnSelection:ae,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:_e,noWheelClassName:ve,noPanClassName:V,disableKeyboardA11y:H,onViewportChange:U,isControlledViewport:!!xe,children:p(XE,{children:[p(JE,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:B,onlyRenderVisibleElements:E,onEdgeContextMenu:z,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,defaultMarkerColor:N,noPanClassName:V,disableKeyboardA11y:H,rfId:be}),p(iD,{style:g,type:h,component:_,containerStyle:v}),p(`div`,{className:`react-flow__edgelabel-renderer`}),p(cE,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ue,onlyRenderVisibleElements:E,noPanClassName:V,noDragClassName:_e,disableKeyboardA11y:H,nodeExtent:ye,rfId:be,nodesDraggable:Se}),p(`div`,{className:`react-flow__viewport-portal`})]})})}lD.displayName=`GraphView`;var uD=b(lD),dD=Qx(`React Flow`,`https://reactflow.dev/`),fD=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??hx;uC(h,g,_);let{nodesInitialized:x}=tC(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=aS(Ax(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:hx,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:vx.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...xx},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:dD,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:_x,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},pD=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>lw((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await Px({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{...fD({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=tC(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();uC(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=sC(e,n,r,i,a,o,l);d&&(QS(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=US(e,o.fromHandle,Z.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=oC(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n(Jw(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(Yw(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>Xw(e,!0)));return}i(Zw(r,new Set([...e]),!0)),a(Zw(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>Xw(e,!0)));return}a(Zw(n,new Set([...e]))),i(Zw(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(Xw(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(Xw(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,Xw(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,Xw(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(tC(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return cC({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...xx}})},updateConnection:e=>{p({connection:e})},reset:()=>p({...fD()})}},Object.is);function mD({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:m}){let[h]=B(()=>pD({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return p(fw,{value:h,children:p(lT,{children:p(PT,{children:m})})})}function hD({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m}){return L(dw)?p(ne,{children:e}):p(mD,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m,children:e})}var gD={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function _D({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:ee,onSelectionEnd:te,onBeforeDelete:ne,connectionMode:re,connectionLineType:ie=Sx.Bezier,connectionLineStyle:F,connectionLineComponent:ae,connectionLineContainerStyle:oe,deleteKeyCode:I=`Backspace`,selectionKeyCode:L=`Shift`,selectionOnDrag:se=!1,selectionMode:ce=bx.Full,panActivationKeyCode:le=`Space`,multiSelectionKeyCode:R=oS()?`Meta`:`Control`,zoomActivationKeyCode:ue=oS()?`Meta`:`Control`,snapToGrid:de,snapGrid:fe,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:me,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:B,nodesFocusable:_e,nodeOrigin:ve=Nw,edgesFocusable:V,edgesReconnectable:H,elementsSelectable:ye=!0,defaultViewport:be=Pw,minZoom:xe=.5,maxZoom:U=2,translateExtent:Se=hx,preventScrolling:Ce=!0,nodeExtent:we,defaultMarkerColor:Te=`#b1b1b7`,zoomOnScroll:Ee=!0,zoomOnPinch:De=!0,panOnScroll:Oe=!1,panOnScrollSpeed:ke=.5,panOnScrollMode:Ae=yx.Free,zoomOnDoubleClick:je=!0,panOnDrag:Me=!0,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze=1,nodeClickDistance:Be=0,children:Ve,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:We,onEdgeContextMenu:Ge,onEdgeDoubleClick:Ke,onEdgeMouseEnter:qe,onEdgeMouseMove:Je,onEdgeMouseLeave:Ye,reconnectRadius:Xe=10,onNodesChange:Ze,onEdgesChange:Qe,noDragClassName:$e=`nodrag`,noWheelClassName:et=`nowheel`,noPanClassName:tt=`nopan`,fitView:nt,fitViewOptions:rt,connectOnClick:it,attributionPosition:at,proOptions:ot,defaultEdgeOptions:st,elevateNodesOnSelect:ct=!0,elevateEdgesOnSelect:lt=!1,disableKeyboardA11y:ut=!1,autoPanOnConnect:dt,autoPanOnNodeDrag:ft,autoPanOnSelection:W=!0,autoPanSpeed:G,connectionRadius:pt,isValidConnection:mt,onError:ht,style:gt,id:K,nodeDragThreshold:_t,connectionDragThreshold:vt,viewport:yt,onViewportChange:bt,width:xt,height:St,colorMode:Ct=`light`,debug:wt,onScroll:Tt,ariaLabelConfig:Et,zIndexMode:Dt=`basic`,...Ot},kt){let At=K||`1`,jt=Bw(Ct),Mt=z(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Tt?.(e)},[Tt]);return p(`div`,{"data-testid":`rf__wrapper`,...Ot,onScroll:Mt,style:{...gt,...gD},ref:kt,className:jh([`react-flow`,i,jt]),id:K,role:`application`,children:p(hD,{nodes:e,edges:t,width:xt,height:St,fitView:nt,fitViewOptions:rt,minZoom:xe,maxZoom:U,nodeOrigin:ve,nodeExtent:we,zIndexMode:Dt,children:[p(Rw,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:v,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:B,nodesFocusable:_e,edgesFocusable:V,edgesReconnectable:H,elementsSelectable:ye,elevateNodesOnSelect:ct,elevateEdgesOnSelect:lt,minZoom:xe,maxZoom:U,nodeExtent:we,onNodesChange:Ze,onEdgesChange:Qe,snapToGrid:de,snapGrid:fe,connectionMode:re,translateExtent:Se,connectOnClick:it,defaultEdgeOptions:st,fitView:nt,fitViewOptions:rt,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:tt,nodeOrigin:ve,rfId:At,autoPanOnConnect:dt,autoPanOnNodeDrag:ft,autoPanSpeed:G,onError:ht,connectionRadius:pt,isValidConnection:mt,selectNodesOnDrag:me,nodeDragThreshold:_t,connectionDragThreshold:vt,onBeforeDelete:ne,debug:wt,ariaLabelConfig:Et,zIndexMode:Dt}),p(uD,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ie,connectionLineStyle:F,connectionLineComponent:ae,connectionLineContainerStyle:oe,selectionKeyCode:L,selectionOnDrag:se,selectionMode:ce,deleteKeyCode:I,multiSelectionKeyCode:R,panActivationKeyCode:le,zoomActivationKeyCode:ue,onlyRenderVisibleElements:pe,defaultViewport:be,translateExtent:Se,minZoom:xe,maxZoom:U,preventScrolling:Ce,zoomOnScroll:Ee,zoomOnPinch:De,zoomOnDoubleClick:je,panOnScroll:Oe,panOnScrollSpeed:ke,panOnScrollMode:Ae,panOnDrag:Me,autoPanOnSelection:W,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze,nodeClickDistance:Be,onSelectionContextMenu:P,onSelectionStart:ee,onSelectionEnd:te,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:We,onEdgeContextMenu:Ge,onEdgeDoubleClick:Ke,onEdgeMouseEnter:qe,onEdgeMouseMove:Je,onEdgeMouseLeave:Ye,reconnectRadius:Xe,defaultMarkerColor:Te,noDragClassName:$e,noWheelClassName:et,noPanClassName:tt,rfId:At,disableKeyboardA11y:ut,nodeExtent:we,viewport:yt,onViewportChange:bt,nodesDraggable:he}),p(Mw,{onSelectionChange:A}),Ve,p(Ew,{proOptions:ot,position:at}),p(Cw,{rfId:At,disableKeyboardA11y:ut})]})})}var vD=iT(_D);mx.error014();function yD({dimensions:e,lineWidth:t,variant:n,className:r}){return p(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:jh([`react-flow__background-pattern`,n,r])})}function bD({radius:e,className:t}){return p(`circle`,{cx:e,cy:e,r:e,className:jh([`react-flow__background-pattern`,`dots`,t])})}var xD;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(xD||={});var SD={[xD.Dots]:1,[xD.Lines]:1,[xD.Cross]:6},CD=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function wD({id:e,variant:t=xD.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=R(null),{transform:f,patternId:m}=Q(CD,uw),h=r||SD[t],g=t===xD.Dots,_=t===xD.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],b=h*f[2],x=Array.isArray(a)?a:[a,a],S=_?[b,b]:y,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${m}${e||``}`;return p(`svg`,{className:jh([`react-flow__background`,l]),style:{...c,..._T,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[p(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:g?p(bD,{radius:b/2,className:u}):p(yD,{dimensions:S,lineWidth:i,variant:t,className:u})}),p(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}wD.displayName=`Background`;var TD=b(wD);function ED(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:p(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function DD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:p(`path`,{d:`M0 0h32v4.2H0z`})})}function OD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:p(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function kD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:p(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function AD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:p(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function jD({children:e,className:t,...n}){return p(`button`,{type:`button`,className:jh([`react-flow__controls-button`,t]),...n,children:e})}var MD=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ND({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":m}){let h=mw(),{isInteractive:g,minZoomReached:_,maxZoomReached:v,ariaLabelConfig:y}=Q(MD,uw),{zoomIn:b,zoomOut:x,fitView:S}=fT();return p(ww,{className:jh([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":m??y[`controls.ariaLabel`],children:[t&&p(ne,{children:[p(jD,{onClick:()=>{b(),a?.()},className:`react-flow__controls-zoomin`,title:y[`controls.zoomIn.ariaLabel`],"aria-label":y[`controls.zoomIn.ariaLabel`],disabled:v,children:p(ED,{})}),p(jD,{onClick:()=>{x(),o?.()},className:`react-flow__controls-zoomout`,title:y[`controls.zoomOut.ariaLabel`],"aria-label":y[`controls.zoomOut.ariaLabel`],disabled:_,children:p(DD,{})})]}),n&&p(jD,{className:`react-flow__controls-fitview`,onClick:()=>{S(i),s?.()},title:y[`controls.fitView.ariaLabel`],"aria-label":y[`controls.fitView.ariaLabel`],children:p(OD,{})}),r&&p(jD,{className:`react-flow__controls-interactive`,onClick:()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},title:y[`controls.interactive.ariaLabel`],"aria-label":y[`controls.interactive.ariaLabel`],children:p(g?AD:kD,{})}),u]})}ND.displayName=`Controls`,b(ND);function PD({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:m}){let{background:h,backgroundColor:g}=a||{},_=o||h||g;return p(`rect`,{className:jh([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:_,stroke:s,strokeWidth:c},shapeRendering:d,onClick:m?t=>m(t,e):void 0})}var FD=b(PD),ID=e=>e.nodes.map(e=>e.id),LD=e=>e instanceof Function?e:()=>e;function RD({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=FD,onClick:o}){let s=Q(ID,uw),c=LD(t),l=LD(e),u=LD(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return p(ne,{children:s.map(e=>p(BD,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function zD({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:m}=Q(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=cS(r);return{node:r,x:i,y:a,width:o,height:s}},uw);return!l||l.hidden||!lS(l)?null:p(s,{x:u,y:d,width:f,height:m,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var BD=b(zD),VD=b(RD),HD=200,UD=150,WD=e=>!e.hidden,GD=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?qx(Ax(e.nodeLookup,{filter:WD}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},KD=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,qD=(e,t)=>KD(e.viewBB,t.viewBB)&&KD(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,JD=`react-flow__minimap-desc`;function YD({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:m,onNodeClick:h,pannable:g=!1,zoomable:_=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:x=5}){let S=mw(),C=R(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:k,flowWidth:A,flowHeight:j,ariaLabelConfig:M}=Q(GD,qD),N=e?.width??HD,P=e?.height??UD,ee=w.width/N,te=w.height/P,ne=Math.max(ee,te),re=ne*N,ie=ne*P,F=x*ne,ae=w.x-(re-w.width)/2-F,oe=w.y-(ie-w.height)/2-F,I=re+F*2,L=ie+F*2,se=`${JD}-${D}`,ce=R(0),le=R();ce.current=ne,O(()=>{let e=S.getState().panZoom;if(C.current&&e)return le.current=DC({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>ce.current}),()=>{le.current?.destroy()}},[T]),O(()=>{le.current?.update({translateExtent:k,width:A,height:j,inversePan:y,pannable:g,zoomStep:b,zoomable:_})},[g,_,y,b,k,A,j]);let ue=m?e=>{let[t,n]=le.current?.pointer(e)||[0,0];m(e,{x:t,y:n})}:void 0,de=z((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;h?.(e,n)},[h]),fe=h?de:void 0,pe=v??M[`minimap.ariaLabel`];return p(ww,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ne:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:jh([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:p(`svg`,{width:N,height:P,viewBox:`${ae} ${oe} ${I} ${L}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":se,ref:C,onClick:ue,children:[pe&&p(`title`,{id:se,children:pe}),p(VD,{onClick:fe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),p(`path`,{className:`react-flow__minimap-mask`,d:`M${ae-F},${oe-F}h${I+F*2}v${L+F*2}h${-I-F*2}z
1131
- M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}YD.displayName=`MiniMap`,b(YD);var XD=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,ZD={[HC.Line]:`right`,[HC.Handle]:`bottom-right`};function QD({nodeId:e,position:t,variant:n=HC.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:m=!0,shouldResize:h,onResizeStart:g,onResize:_,onResizeEnd:v}){let y=jT(),b=typeof e==`string`?e:y,x=mw(),S=R(null),C=n===HC.Handle,w=Q(z(XD(C&&m),[C,m]),uw),T=R(null),E=t??ZD[n];O(()=>{if(S.current&&b)return T.current||=$C({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=oC([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...uS({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:_,onResizeEnd:v,shouldResize:h}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,g,_,v,h]);let D=E.split(`-`);return p(`div`,{className:jh([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}b(QD);var $D=40,eO=280,tO=98,nO=24,rO=e=>{let t=e.split(/\s+/).filter(Boolean),n=[],r=``;for(let e of t){let t=r?`${r} ${e}`:e;if(t.length<=nO){r=t;continue}if(n.length===1)break;r&&n.push(r),r=e}r&&n.length<2&&n.push(r);let i=n.slice(0,2);return i.join(` `).length<e.length&&i.length&&(i[i.length-1]=`${i[i.length-1].slice(0,23)}…`),i.length?i:[e.slice(0,nO)]},iO=(e,t)=>{let n=ph(t.hover,e.edges),r=new Set(e.nodes.map(e=>e.uri)),i=e.nodes.map(e=>{let r=mh(e);return{id:e.uri,type:`work`,position:{x:$D+e.column*eO,y:$D+e.row*tO},width:190,height:74,draggable:!1,selectable:!1,data:{uri:e.uri,title:r,lines:rO(r),meta:[Ch(e.format),e.episodeCount?`${e.episodeCount} ep`:void 0].filter(Boolean).join(` · `),current:t.current.has(e.uri),lit:n.nodes.has(e.uri)}}}),a=e=>t.hover?.kind===`node`&&(e.from===t.hover.uri||e.to===t.hover.uri),o=e.chain.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>({id:`chain\u0000${e.from}\u0000${e.to}`,type:`chain`,source:e.from,target:e.to,data:{kind:`chain`,label:``,lit:a(e)}})),s=e.edges.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>{let t=fh(e);return{id:t,type:`relation`,source:e.from,target:e.to,data:{kind:`relation`,label:xh(e.relation).toUpperCase(),lit:n.edges.has(t)}}});return{nodes:i,edges:[...o,...s]}};j();var aO=x`
1130
+ `));return[t,t.reduce((e,t)=>e.concat(...t),[])]}return[[],[]]},[e]);return O(()=>{let n=t?.target??Kw,c=t?.actInsideInputWithModifier??!0;if(e!==null){let e=e=>{if(i.current=e.ctrlKey||e.metaKey||e.shiftKey||e.altKey,(!i.current||i.current&&!c)&&wS(e))return!1;let n=Yw(e.code,s);if(a.current.add(e[n]),Jw(o,a.current,!1)){let n=e.composedPath?.()?.[0]||e.target,a=n?.nodeName===`BUTTON`||n?.nodeName===`A`;t.preventDefault!==!1&&(i.current||!a)&&e.preventDefault(),r(!0)}},l=e=>{let t=Yw(e.code,s);Jw(o,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(e[t]),e.key===`Meta`&&a.current.clear(),i.current=!1},u=()=>{a.current.clear(),r(!1)};return n?.addEventListener(`keydown`,e),n?.addEventListener(`keyup`,l),window.addEventListener(`blur`,u),window.addEventListener(`contextmenu`,u),()=>{n?.removeEventListener(`keydown`,e),n?.removeEventListener(`keyup`,l),window.removeEventListener(`blur`,u),window.removeEventListener(`contextmenu`,u)}}},[e,r]),n}function Jw(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function Yw(e,t){return t.includes(e)?`code`:`key`}var Xw=()=>{let e=yw();return V(()=>({zoomIn:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{let{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{let{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{let{transform:[r,i,a],panZoom:o}=e.getState();return o?(await o.setViewport({x:t.x??r,y:t.y??i,zoom:t.zoom??a},n),!0):!1},getViewport:()=>{let[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{let{width:r,height:i,minZoom:a,maxZoom:o,panZoom:s}=e.getState(),c=uS(t,r,i,a,o,n?.padding??.1);return s?(await s.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{let{transform:r,snapGrid:i,snapToGrid:a,domNode:o}=e.getState();if(!o)return t;let{x:s,y:c}=o.getBoundingClientRect(),l={x:t.x-s,y:t.y-c},u=n.snapGrid??i;return aS(l,r,n.snapToGrid??a,u)},flowToScreenPosition:t=>{let{transform:n,domNode:r}=e.getState();if(!r)return t;let{x:i,y:a}=r.getBoundingClientRect(),o=oS(t,n);return{x:o.x+i,y:o.y+a}}}),[])};function Zw(e,t){let n=[],r=new Map,i=[];for(let t of e)if(t.type===`add`){i.push(t);continue}else if(t.type===`remove`||t.type===`replace`)r.set(t.id,[t]);else{let e=r.get(t.id);e?e.push(t):r.set(t.id,[t])}for(let e of t){let t=r.get(e.id);if(!t){n.push(e);continue}if(t[0].type===`remove`)continue;if(t[0].type===`replace`){n.push({...t[0].item});continue}let i={...e};for(let e of t)Qw(e,i);n.push(i)}return i.length&&i.forEach(e=>{e.index===void 0?n.push({...e.item}):n.splice(e.index,0,{...e.item})}),n}function Qw(e,t){switch(e.type){case`select`:t.selected=e.selected;break;case`position`:e.position!==void 0&&(t.position=e.position),e.dragging!==void 0&&(t.dragging=e.dragging);break;case`dimensions`:e.dimensions!==void 0&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes===`width`)&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes===`height`)&&(t.height=e.dimensions.height))),typeof e.resizing==`boolean`&&(t.resizing=e.resizing)}}function $w(e,t){return Zw(e,t)}function eT(e,t){return Zw(e,t)}function tT(e,t){return{id:e,type:`select`,selected:t}}function nT(e,t=new Set,n=!1){let r=[];for(let[i,a]of e){let e=t.has(i);(a.selected!==void 0||e)&&a.selected!==e&&(n&&(a.selected=e),r.push(tT(a.id,e)))}return r}function rT({items:e=[],lookup:t}){let n=[],r=new Map(e.map(e=>[e.id,e]));for(let[r,i]of e.entries()){let e=t.get(i.id),a=e?.internals?.userNode??e;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:`replace`}),a===void 0&&n.push({item:i,type:`add`,index:r})}for(let[e]of t)r.get(e)===void 0&&n.push({id:e,type:`remove`});return n}function iT(e){return{id:e.id,type:`remove`}}var aT=rS(`React Flow`,`https://reactflow.dev/`);function oT(e,t,n={}){return LS(e,t,{...n,onError:n.onError??aT})}var sT=e=>jx(e),cT=e=>Ax(e);function lT(e){return l(e)}var uT=typeof window<`u`?_e:O;function dT(e){let[t,n]=B(BigInt(0)),[r]=B(()=>fT(()=>n(e=>e+BigInt(1))));return uT(()=>{let t=r.get();t.length&&(e(t),r.reset())},[t]),r}function fT(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}var pT=fe(null);function mT({children:e}){let t=yw(),n=dT(z(e=>{let{nodes:n=[],setNodes:r,hasDefaultNodes:i,onNodesChange:a,nodeLookup:o,fitViewQueued:s,onNodesChangeMiddlewareMap:c}=t.getState(),l=n;for(let t of e)l=typeof t==`function`?t(l):t;let u=rT({items:l,lookup:o});for(let e of c.values())u=e(u);i&&r(l),u.length>0?a?.(u):s&&window.requestAnimationFrame(()=>{let{fitViewQueued:e,nodes:n,setNodes:r}=t.getState();e&&r(n)})},[])),r=dT(z(e=>{let{edges:n=[],setEdges:r,hasDefaultEdges:i,onEdgesChange:a,edgeLookup:o}=t.getState(),s=n;for(let t of e)s=typeof t==`function`?t(s):t;i?r(s):a&&a(rT({items:s,lookup:o}))},[])),i=V(()=>({nodeQueue:n,edgeQueue:r}),[]);return p(pT.Provider,{value:i,children:e})}function hT(){let e=L(pT);if(!e)throw Error(`useBatchContext must be used within a BatchProvider`);return e}var gT=e=>!!e.panZoom;function _T(){let e=Xw(),t=yw(),n=hT(),r=Q(gT),i=V(()=>{let e=e=>t.getState().nodeLookup.get(e),r=e=>{n.nodeQueue.push(e)},i=e=>{n.edgeQueue.push(e)},a=e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState(),i=sT(e)?e:n.get(e.id),a=i.parentId?hS(i.position,i.measured,i.parentId,n,r):i.position;return Xx({...i,position:a,width:i.measured?.width??i.width,height:i.measured?.height??i.height})},o=(e,t,n={replace:!1})=>{r(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&sT(e)?e:{...r,...e}}return r}))},s=(e,t,n={replace:!1})=>{i(r=>r.map(r=>{if(r.id===e){let e=typeof t==`function`?t(r):t;return n.replace&&cT(e)?e:{...r,...e}}return r}))};return{getNodes:()=>t.getState().nodes.map(e=>({...e})),getNode:t=>e(t)?.internals.userNode,getInternalNode:e,getEdges:()=>{let{edges:e=[]}=t.getState();return e.map(e=>({...e}))},getEdge:e=>t.getState().edgeLookup.get(e),setNodes:r,setEdges:i,addNodes:e=>{let t=Array.isArray(e)?e:[e];n.nodeQueue.push(e=>[...e,...t])},addEdges:e=>{let t=Array.isArray(e)?e:[e];n.edgeQueue.push(e=>[...e,...t])},toObject:()=>{let{nodes:e=[],edges:n=[],transform:r}=t.getState(),[i,a,o]=r;return{nodes:e.map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:i,y:a,zoom:o}}},deleteElements:async({nodes:e=[],edges:n=[]})=>{let{nodes:r,edges:i,onNodesDelete:a,onEdgesDelete:o,triggerNodeChanges:s,triggerEdgeChanges:c,onDelete:l,onBeforeDelete:u}=t.getState(),{nodes:d,edges:f}=await Vx({nodesToRemove:e,edgesToRemove:n,nodes:r,edges:i,onBeforeDelete:u}),p=f.length>0,m=d.length>0;if(p){let e=f.map(iT);o?.(f),c(e)}if(m){let e=d.map(iT);a?.(d),s(e)}return(m||p)&&l?.({nodes:d,edges:f}),{deletedNodes:d,deletedEdges:f}},getIntersectingNodes:(e,n=!0,r)=>{let i=tS(e),o=i?e:a(e),s=r!==void 0;return o?(r||t.getState().nodes).filter(r=>{let a=t.getState().nodeLookup.get(r.id);if(a&&!i&&(r.id===e.id||!a.internals.positionAbsolute))return!1;let c=Xx(s?r:a),l=eS(c,o);return n&&l>0||l>=c.width*c.height||l>=o.width*o.height}):[]},isNodeIntersecting:(e,t,n=!0)=>{let r=tS(e)?e:a(e);if(!r)return!1;let i=eS(r,t);return n&&i>0||i>=t.width*t.height||i>=r.width*r.height},updateNode:o,updateNodeData:(e,t,n={replace:!1})=>{o(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},updateEdge:s,updateEdgeData:(e,t,n={replace:!1})=>{s(e,e=>{let r=typeof t==`function`?t(e):t;return n.replace?{...e,data:r}:{...e,data:{...e.data,...r}}},n)},getNodesBounds:e=>{let{nodeLookup:n,nodeOrigin:r}=t.getState();return Px(e,{nodeLookup:n,nodeOrigin:r})},getHandleConnections:({type:e,id:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}-${e}${n?`-${n}`:``}`)?.values()??[]),getNodeConnections:({type:e,handleId:n,nodeId:r})=>Array.from(t.getState().connectionLookup.get(`${r}${e?n?`-${e}-${n}`:`-${e}`:``}`)?.values()??[]),fitView:async e=>{let r=t.getState().fitViewResolver??_S();return t.setState({fitViewQueued:!0,fitViewOptions:e,fitViewResolver:r}),n.nodeQueue.push(e=>[...e]),r.promise}}},[]);return V(()=>({...i,...e,viewportInitialized:r}),[r])}var vT=e=>e.selected,yT=typeof window<`u`?window:void 0;function bT({deleteKeyCode:e,multiSelectionKeyCode:t}){let n=yw(),{deleteElements:r}=_T(),i=qw(e,{actInsideInputWithModifier:!1}),a=qw(t,{target:yT});O(()=>{if(i){let{edges:e,nodes:t}=n.getState();r({nodes:t.filter(vT),edges:e.filter(vT)}),n.setState({nodesSelectionActive:!1})}},[i]),O(()=>{n.setState({multiSelectionActive:a})},[a])}function xT(e){let t=yw();O(()=>{let n=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;let n=xS(e.current);(n.height===0||n.width===0)&&t.getState().onError?.(`004`,yx.error004()),t.setState({width:n.width||500,height:n.height||500})};if(e.current){n(),window.addEventListener(`resize`,n);let t=new ResizeObserver(()=>n());return t.observe(e.current),()=>{window.removeEventListener(`resize`,n),t&&e.current&&t.unobserve(e.current)}}},[])}var ST={position:`absolute`,width:`100%`,height:`100%`,top:0,left:0},CT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function wT({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panActivationKeyPressed:i,panOnScrollSpeed:a=.5,panOnScrollMode:o=wx.Free,zoomOnDoubleClick:s=!0,panOnDrag:c=!0,defaultViewport:l,translateExtent:u,minZoom:d,maxZoom:f,zoomActivationKeyCode:m,preventScrolling:h=!0,children:g,noWheelClassName:_,noPanClassName:v,onViewportChange:y,isControlledViewport:b,paneClickDistance:x,selectionOnDrag:S}){let C=yw(),w=R(null),{userSelectionActive:T,lib:E,connectionInProgress:D}=Q(CT,hw),k=qw(m),A=R();xT(w);let j=z(e=>{y?.({x:e[0],y:e[1],zoom:e[2]}),b||C.setState({transform:e})},[y,b]);return O(()=>{if(w.current){A.current=KC({domNode:w.current,minZoom:d,maxZoom:f,translateExtent:u,viewport:l,onDraggingChange:e=>C.setState(t=>t.paneDragging===e?t:{paneDragging:e}),onPanZoomStart:(e,t)=>{let{onViewportChangeStart:n,onMoveStart:r}=C.getState();r?.(e,t),n?.(t)},onPanZoom:(e,t)=>{let{onViewportChange:n,onMove:r}=C.getState();r?.(e,t),n?.(t)},onPanZoomEnd:(e,t)=>{let{onViewportChangeEnd:n,onMoveEnd:r}=C.getState();r?.(e,t),n?.(t)}});let{x:e,y:t,zoom:n}=A.current.getViewport();return C.setState({panZoom:A.current,transform:[e,t,n],domNode:w.current.closest(`.react-flow`)}),()=>{A.current?.destroy()}}},[]),O(()=>{A.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panActivationKeyPressed:i,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:s,panOnDrag:c,zoomActivationKeyPressed:k,preventScrolling:h,noPanClassName:v,userSelectionActive:T,noWheelClassName:_,lib:E,onTransformChange:j,connectionInProgress:D,selectionOnDrag:S,paneClickDistance:x})},[e,t,n,r,i,a,o,s,c,k,h,v,T,_,E,j,D,S,x]),p(`div`,{className:`react-flow__renderer`,ref:w,style:ST,children:g})}var TT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function ET(){let{userSelectionActive:e,userSelectionRect:t}=Q(TT,hw);return e&&t?p(`div`,{className:`react-flow__selection react-flow__container`,style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}var DT=(e,t)=>n=>{n.target===t.current&&e?.(n)},OT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function kT({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Tx.Full,panOnDrag:r,autoPanOnSelection:i,paneClickDistance:a,selectionOnDrag:o,onSelectionStart:s,onSelectionEnd:c,onPaneClick:l,onPaneContextMenu:u,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:m,onPaneMouseLeave:h,children:g}){let _=R(0),v=yw(),{userSelectionActive:y,elementsSelectable:b,dragging:x,panBy:S,autoPanSpeed:C}=Q(OT,hw),w=b&&(e||y),T=R(null),E=R(),D=R(new Set),k=R(new Set),A=R(!1),j=R(!1),M=R({x:0,y:0}),N=R(!1),P=e=>{if(j.current||A.current||v.getState().connection.inProgress){j.current=!1,A.current=!1;return}l?.(e),v.getState().resetSelectedElements(),v.setState({nodesSelectionActive:!1})},ee=e=>{if(Array.isArray(r)&&r?.includes(2)){e.preventDefault();return}u?.(e)},te=d?e=>d(e):void 0,ne=e=>{j.current&&=(e.stopPropagation(),!1)},re=n=>{if(n.pointerType===`touch`&&r!==!1&&!t)return;let{domNode:i,transform:a}=v.getState();if(E.current=i?.getBoundingClientRect(),!E.current)return;let s=n.target===T.current;if(!s&&n.target.closest(`.nokey`)||!e||!(o&&s||t)||n.button!==0||!n.isPrimary)return;n.target?.setPointerCapture?.(n.pointerId),j.current=!1;let{x:c,y:l}=ES(n.nativeEvent,E.current),u=aS({x:c,y:l},a);v.setState({userSelectionRect:{width:0,height:0,startX:u.x,startY:u.y,x:c,y:l}}),s||(n.stopPropagation(),n.preventDefault())};function ie(e,t){let{userSelectionRect:r}=v.getState();if(!r)return;let{transform:i,nodeLookup:a,edgeLookup:o,connectionLookup:s,triggerNodeChanges:c,triggerEdgeChanges:l,defaultEdgeOptions:u}=v.getState(),d={x:r.startX,y:r.startY},{x:f,y:p}=oS(d,i),m={startX:d.x,startY:d.y,x:e<f?e:f,y:t<p?t:p,width:Math.abs(e-f),height:Math.abs(t-p)},h=D.current,g=k.current;D.current=new Set(Ix(a,m,i,n===Tx.Partial,!0).map(e=>e.id)),k.current=new Set;let _=u?.selectable??!0;for(let e of D.current){let t=s.get(e);if(t)for(let{edgeId:e}of t.values()){let t=o.get(e);t&&(t.selectable??_)&&k.current.add(e)}}gS(h,D.current)||c(nT(a,D.current,!0)),gS(g,k.current)||l(nT(o,k.current)),v.setState({userSelectionRect:m,userSelectionActive:!0,nodesSelectionActive:!1})}function F(){if(!i||!E.current)return;let[e,t]=Kx(M.current,E.current,C);S({x:e,y:t}).then(e=>{if(!j.current||!e){_.current=requestAnimationFrame(F);return}let{x:t,y:n}=M.current;ie(t,n),_.current=requestAnimationFrame(F)})}let ae=()=>{cancelAnimationFrame(_.current),_.current=0,N.current=!1};O(()=>()=>ae(),[]);let oe=e=>{let{userSelectionRect:n,transform:r,resetSelectedElements:i}=v.getState();if(!E.current||!n)return;let{x:o,y:c}=ES(e.nativeEvent,E.current);M.current={x:o,y:c};let l=oS({x:n.startX,y:n.startY},r);if(!j.current){let n=t?0:a;if(Math.hypot(o-l.x,c-l.y)<=n)return;i(),s?.(e)}j.current=!0,N.current||=(F(),!0),ie(o,c)},I=e=>{if(!w){e.target===T.current&&v.getState().connection.inProgress&&(A.current=!0);return}e.button===0&&(e.target?.releasePointerCapture?.(e.pointerId),!y&&e.target===T.current&&v.getState().userSelectionRect&&P?.(e),v.setState({userSelectionActive:!1,userSelectionRect:null}),j.current&&(c?.(e),v.setState({nodesSelectionActive:D.current.size>0})),ae())},L=e=>{e.target?.releasePointerCapture?.(e.pointerId),ae()},se=r===!0||Array.isArray(r)&&r.includes(0);return p(`div`,{className:Ih([`react-flow__pane`,{draggable:se,dragging:x,selection:e}]),onClick:w?void 0:DT(P,T),onContextMenu:DT(ee,T),onWheel:DT(te,T),onPointerEnter:w?void 0:f,onPointerMove:w?oe:m,onPointerUp:I,onPointerCancel:w?L:void 0,onPointerDownCapture:w?re:void 0,onClickCapture:w?ne:void 0,onPointerLeave:h,ref:T,style:ST,children:[g,p(ET,{})]})}function AT({id:e,store:t,unselect:n=!1,nodeRef:r}){let{addSelectedNodes:i,unselectNodesAndEdges:a,multiSelectionActive:o,nodeLookup:s,onError:c}=t.getState(),l=s.get(e);if(!l){c?.(`012`,yx.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&o)&&(a({nodes:[l],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):i([e])}function jT({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:i,isSelectable:a,nodeClickDistance:o}){let s=yw(),[c,l]=B(!1),u=R();return O(()=>{if(!t)return u.current=xC({getStoreItems:()=>s.getState(),onNodeMouseDown:t=>{AT({id:t,store:s,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}}),()=>{u.current?.destroy(),u.current=void 0}},[t,s,e]),O(()=>{!t&&e.current&&u.current&&u.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:i,nodeClickDistance:o})},[n,r,t,a,e,i,o]),c}var MT=e=>t=>t.selected&&(t.draggable||e&&t.draggable===void 0);function NT(){let e=yw();return z(t=>{let{nodeExtent:n,snapToGrid:r,snapGrid:i,nodesDraggable:a,onError:o,updateNodePositions:s,nodeLookup:c,nodeOrigin:l}=e.getState(),u=new Map,d=MT(a),f=r?i[0]:5,p=r?i[1]:5,m=t.direction.x*f*t.factor,h=t.direction.y*p*t.factor;for(let[,e]of c){if(!d(e))continue;let t={x:e.internals.positionAbsolute.x+m,y:e.internals.positionAbsolute.y+h};r&&(t=iS(t,i));let{position:a,positionAbsolute:s}=Bx({nodeId:e.id,nextPosition:t,nodeLookup:c,nodeExtent:n,nodeOrigin:l,onError:o});e.position=a,e.internals.positionAbsolute=s,u.set(e.id,e)}s(u)},[])}var PT=fe(null),FT=PT.Provider;PT.Consumer;var IT=()=>L(PT),LT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),RT=fe(null);function zT({children:e}){let t=Q(LT,hw);return p(RT.Provider,{value:t,children:e})}function BT(){let e=L(RT);if(!e)throw Error(`useHandleConfig must be used within a HandleConfigProvider`);return e}var VT={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},HT=(e,t,n)=>r=>{let{connectionClickStartHandle:i,connectionMode:a,connection:o}=r,{fromHandle:s,toHandle:c,isValid:l}=o;if(!s&&!i)return VT;let u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:s?.nodeId===e&&s?.id===t&&s?.type===n,connectingTo:u,clickConnecting:i?.nodeId===e&&i?.id===t&&i?.type===n,isPossibleEndHandle:a===Cx.Strict?s?.type!==n:e!==s?.nodeId||t!==s?.id,connectionInProcess:!!s,clickConnectionInProcess:!!i,valid:u&&l}};function UT({type:e=`source`,position:t=Z.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:o,onConnect:s,children:c,className:l,onMouseDown:u,onTouchStart:d,...f},m){let h=o||null,g=e===`target`,_=yw(),v=IT(),{connectOnClick:y,noPanClassName:b,rfId:x}=BT(),{connectingFrom:S,connectingTo:C,clickConnecting:w,isPossibleEndHandle:T,connectionInProcess:E,clickConnectionInProcess:D,valid:O}=Q(HT(v,h,e),hw);v||_.getState().onError?.(`010`,yx.error010());let k=e=>{let{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=_.getState(),i={...t,...e};if(r){let{edges:e,setEdges:t,onError:n}=_.getState();t(oT(i,e,{onError:n}))}n?.(i),s?.(i)},A=e=>{if(!v)return;let t=TS(e.nativeEvent);if(i&&(t&&e.button===0||!t)){let t=_.getState();jC.onPointerDown(e.nativeEvent,{handleDomNode:e.currentTarget,autoPanOnConnect:t.autoPanOnConnect,connectionMode:t.connectionMode,connectionRadius:t.connectionRadius,domNode:t.domNode,nodeLookup:t.nodeLookup,lib:t.lib,isTarget:g,handleId:h,nodeId:v,flowId:t.rfId,panBy:t.panBy,cancelConnection:t.cancelConnection,onConnectStart:t.onConnectStart,onConnectEnd:(...e)=>_.getState().onConnectEnd?.(...e),updateConnection:t.updateConnection,onConnect:k,isValidConnection:n||((...e)=>_.getState().isValidConnection?.(...e)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:t.autoPanSpeed,dragThreshold:t.connectionDragThreshold})}t?u?.(e):d?.(e)};return p(`div`,{"data-handleid":h,"data-nodeid":v,"data-handlepos":t,"data-id":`${x}-${v}-${h}-${e}`,className:Ih([`react-flow__handle`,`react-flow__handle-${t}`,`nodrag`,b,l,{source:!g,target:g,connectable:r,connectablestart:i,connectableend:a,clickconnecting:w,connectingfrom:S,connectingto:C,valid:O,connectionindicator:r&&(!E||T)&&(E||D?a:i)}]),onMouseDown:A,onTouchStart:A,onClick:y?t=>{let{onClickConnectStart:r,onClickConnectEnd:a,connectionClickStartHandle:o,connectionMode:s,isValidConnection:c,lib:l,rfId:u,nodeLookup:d,connection:f}=_.getState();if(!v||!o&&!i)return;if(!o){r?.(t.nativeEvent,{nodeId:v,handleId:h,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:v,type:e,id:h}});return}let p=SS(t.target),m=n||c,{connection:g,isValid:y}=jC.isValid(t.nativeEvent,{handle:{nodeId:v,id:h,type:e},connectionMode:s,fromNodeId:o.nodeId,fromHandleId:o.id||null,fromType:o.type,isValidConnection:m,flowId:u,doc:p,lib:l,nodeLookup:d});y&&g&&k(g);let b=structuredClone(f);delete b.inProgress,b.toPosition=b.toHandle?b.toHandle.position:null,a?.(t,b),_.setState({connectionClickStartHandle:null})}:void 0,ref:m,...f,children:c})}var WT=b(lT(UT));function GT({data:e,isConnectable:t,sourcePosition:n=Z.Bottom}){return p(ne,{children:[e?.label,p(WT,{type:`source`,position:n,isConnectable:t})]})}function KT({data:e,isConnectable:t,targetPosition:n=Z.Top,sourcePosition:r=Z.Bottom}){return p(ne,{children:[p(WT,{type:`target`,position:n,isConnectable:t}),e?.label,p(WT,{type:`source`,position:r,isConnectable:t})]})}function qT(){return null}function JT({data:e,isConnectable:t,targetPosition:n=Z.Top}){return p(ne,{children:[p(WT,{type:`target`,position:n,isConnectable:t}),e?.label]})}var YT={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},XT={input:GT,default:KT,output:JT,group:qT};function ZT(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}var QT=e=>{let{width:t,height:n,x:r,y:i}=Fx(e.nodeLookup,{filter:e=>!!e.selected});return{width:nS(t)?t:null,height:nS(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${i}px)`}};function $T({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){let r=yw(),{width:i,height:a,transformString:o,userSelectionActive:s}=Q(QT,hw),c=NT(),l=R(null);O(()=>{n||l.current?.focus({preventScroll:!0})},[n]);let u=!s&&i!==null&&a!==null;if(jT({nodeRef:l,disabled:!u}),!u)return null;let d=e?t=>{e(t,r.getState().nodes.filter(e=>e.selected))}:void 0;return p(`div`,{className:Ih([`react-flow__nodesselection`,`react-flow__container`,t]),style:{transform:o},children:p(`div`,{ref:l,className:`react-flow__nodesselection-rect`,onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:e=>{Object.prototype.hasOwnProperty.call(YT,e.key)&&(e.preventDefault(),c({direction:YT[e.key],factor:e.shiftKey?4:1}))},style:{width:i,height:a}})})}var eE=typeof window<`u`?window:void 0,tE=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function nE({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,paneClickDistance:s,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:d,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:h,panActivationKeyCode:g,zoomActivationKeyCode:_,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:x,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:T,autoPanOnSelection:E,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,preventScrolling:j,onSelectionContextMenu:M,noWheelClassName:N,noPanClassName:P,disableKeyboardA11y:ee,onViewportChange:te,isControlledViewport:ne}){let{nodesSelectionActive:re,userSelectionActive:ie}=Q(tE,hw),F=qw(l,{target:eE}),ae=qw(g,{target:eE}),oe=ae||T,I=ae||x,L=u&&oe!==!0,se=F||ie||L;return bT({deleteKeyCode:c,multiSelectionKeyCode:h}),p(wT,{onPaneContextMenu:a,elementsSelectable:v,zoomOnScroll:y,zoomOnPinch:b,panOnScroll:I,panActivationKeyPressed:ae,panOnScrollSpeed:S,panOnScrollMode:C,zoomOnDoubleClick:w,panOnDrag:!F&&oe,defaultViewport:D,translateExtent:O,minZoom:k,maxZoom:A,zoomActivationKeyCode:_,preventScrolling:j,noWheelClassName:N,noPanClassName:P,onViewportChange:te,isControlledViewport:ne,paneClickDistance:s,selectionOnDrag:L,children:p(kT,{onSelectionStart:f,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:i,onPaneContextMenu:a,onPaneScroll:o,panOnDrag:oe,autoPanOnSelection:E,isSelecting:!!se,selectionMode:d,selectionKeyPressed:F,paneClickDistance:s,selectionOnDrag:L,children:[e,re&&p($T,{onSelectionContextMenu:M,noPanClassName:P,disableKeyboardA11y:ee})]})})}nE.displayName=`FlowRenderer`;var rE=b(nE),iE=e=>t=>e?Ix(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(e=>e.id):Array.from(t.nodeLookup.keys());function aE(e){return Q(z(iE(e),[e]),hw)}var oE=e=>e.updateNodeInternals;function sE(){let e=Q(oE),[t]=B(()=>typeof ResizeObserver>`u`?null:new ResizeObserver(t=>{let n=new Map;t.forEach(e=>{let t=e.target.getAttribute(`data-id`);n.set(t,{id:t,nodeElement:e.target,force:!0})}),e(n)}));return O(()=>()=>{t?.disconnect()},[t]),t}function cE({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){let i=yw(),a=R(null),o=R(null),s=R(e.sourcePosition),c=R(e.targetPosition),l=R(t),u=n&&!!e.internals.handleBounds;return O(()=>{a.current&&!e.hidden&&(!u||o.current!==a.current)&&(o.current&&r?.unobserve(o.current),r?.observe(a.current),o.current=a.current)},[u,e.hidden]),O(()=>()=>{o.current&&=(r?.unobserve(o.current),null)},[]),O(()=>{if(a.current){let n=l.current!==t,r=s.current!==e.sourcePosition,o=c.current!==e.targetPosition;(n||r||o)&&(l.current=t,s.current=e.sourcePosition,c.current=e.targetPosition,i.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function lE({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:i,onContextMenu:a,onDoubleClick:o,nodesDraggable:s,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:d,noDragClassName:f,noPanClassName:m,disableKeyboardA11y:h,rfId:g,nodeTypes:_,nodeClickDistance:v,onError:y}){let{node:b,internals:x,isParent:S}=Q(t=>{let n=t.nodeLookup.get(e),r=t.parentLookup.has(e);return{node:n,internals:n.internals,isParent:r}},hw),C=b.type||`default`,w=_?.[C]||XT[C];w===void 0&&(y?.(`003`,yx.error003(C)),C=`default`,w=_?.default||XT.default);let T=!!(b.draggable||s&&b.draggable===void 0),E=!!(b.selectable||c&&b.selectable===void 0),D=!!(b.connectable||l&&b.connectable===void 0),O=!!(b.focusable||u&&b.focusable===void 0),k=yw(),A=mS(b),j=cE({node:b,nodeType:C,hasDimensions:A,resizeObserver:d}),M=jT({nodeRef:j,disabled:b.hidden||!T,noDragClassName:f,handleSelector:b.dragHandle,nodeId:e,isSelectable:E,nodeClickDistance:v}),N=NT();if(b.hidden)return null;let P=pS(b),ee=ZT(b),te=E||T||t||n||r||i,ne=n?e=>n(e,{...x.userNode}):void 0,re=r?e=>r(e,{...x.userNode}):void 0,ie=i?e=>i(e,{...x.userNode}):void 0,F=a?e=>a(e,{...x.userNode}):void 0,ae=o?e=>o(e,{...x.userNode}):void 0,oe=n=>{let{selectNodesOnDrag:r,nodeDragThreshold:i}=k.getState();E&&(!r||!T||i>0)&&AT({id:e,store:k,nodeRef:j}),t&&t(n,{...x.userNode})},I=t=>{if(!(wS(t.nativeEvent)||h)){if(xx.includes(t.key)&&E){let n=t.key===`Escape`;AT({id:e,store:k,unselect:n,nodeRef:j})}else if(T&&b.selected&&Object.prototype.hasOwnProperty.call(YT,t.key)){t.preventDefault();let{ariaLabelConfig:e}=k.getState();k.setState({ariaLiveMessage:e[`node.a11yDescription.ariaLiveMessage`]({direction:t.key.replace(`Arrow`,``).toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),N({direction:YT[t.key],factor:t.shiftKey?4:1})}}},L=()=>{if(h||!j.current?.matches(`:focus-visible`))return;let{transform:t,width:n,height:r,autoPanOnNodeFocus:i,setCenter:a}=k.getState();i&&(Ix(new Map([[e,b]]),{x:0,y:0,width:n,height:r},t,!0).length>0||a(b.position.x+P.width/2,b.position.y+P.height/2,{zoom:t[2]}))};return p(`div`,{className:Ih([`react-flow__node`,`react-flow__node-${C}`,{[m]:T},b.className,{selected:b.selected,selectable:E,parent:S,draggable:T,dragging:M}]),ref:j,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:te?`all`:`none`,visibility:A?`visible`:`hidden`,...b.style,...ee},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:ne,onMouseMove:re,onMouseLeave:ie,onContextMenu:F,onClick:oe,onDoubleClick:ae,onKeyDown:O?I:void 0,tabIndex:O?0:void 0,onFocus:O?L:void 0,role:b.ariaRole??(O?`group`:void 0),"aria-roledescription":`node`,"aria-describedby":h?void 0:`${Sw}-${g}`,"aria-label":b.ariaLabel,...b.domAttributes,children:p(FT,{value:e,children:p(w,{id:e,data:b.data,type:C,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:b.selected??!1,selectable:E,draggable:T,deletable:b.deletable??!0,isConnectable:D,sourcePosition:b.sourcePosition,targetPosition:b.targetPosition,dragging:M,dragHandle:b.dragHandle,zIndex:x.z,parentId:b.parentId,...P})})})}var uE=b(lE),dE=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function fE(e){let{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:i}=Q(dE,hw),a=aE(e.onlyRenderVisibleElements),o=sE();return p(`div`,{className:`react-flow__nodes`,style:ST,children:a.map(a=>p(uE,{id:a,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:o,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},a))})}fE.displayName=`NodeRenderer`;var pE=b(fE);function mE(e){return Q(z(t=>{if(!e)return t.edges.map(e=>e.id);let n=[];if(t.width&&t.height)for(let e of t.edges){let r=t.nodeLookup.get(e.source),i=t.nodeLookup.get(e.target);r&&i&&PS({sourceNode:r,targetNode:i,width:t.width,height:t.height,transform:t.transform})&&n.push(e.id)}return n},[e]),hw)}var hE=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e}};return p(`polyline`,{className:`arrow`,style:n,strokeLinecap:`round`,fill:`none`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4`})},gE=({color:e=`none`,strokeWidth:t=1})=>{let n={strokeWidth:t,...e&&{stroke:e,fill:e}};return p(`polyline`,{className:`arrowclosed`,style:n,strokeLinecap:`round`,strokeLinejoin:`round`,points:`-5,-4 0,0 -5,4 -5,-4`})},_E={[Ox.Arrow]:hE,[Ox.ArrowClosed]:gE};function vE(e){let t=yw();return V(()=>Object.prototype.hasOwnProperty.call(_E,e)?_E[e]:(t.getState().onError?.(`009`,yx.error009(e)),null),[e])}var yE=({id:e,type:t,color:n,width:r=12.5,height:i=12.5,markerUnits:a=`strokeWidth`,strokeWidth:o,orient:s=`auto-start-reverse`})=>{let c=vE(t);return c?p(`marker`,{className:`react-flow__arrowhead`,id:e,markerWidth:`${r}`,markerHeight:`${i}`,viewBox:`-10 -10 20 20`,markerUnits:a,orient:s,refX:`0`,refY:`0`,children:p(c,{color:n,strokeWidth:o})}):null},bE=({defaultColor:e,rfId:t})=>{let n=Q(e=>e.edges),r=Q(e=>e.defaultEdgeOptions),i=V(()=>ZS(n,{id:t,defaultColor:e,defaultMarkerStart:r?.markerStart,defaultMarkerEnd:r?.markerEnd}),[n,r,t,e]);return i.length?p(`svg`,{className:`react-flow__marker`,"aria-hidden":`true`,children:p(`defs`,{children:i.map(e=>p(yE,{id:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient},e.id))})}):null};bE.displayName=`MarkerDefinitions`;var xE=b(bE);function SE({x:e,y:t,label:n,labelStyle:r,labelShowBg:i=!0,labelBgStyle:a,labelBgPadding:o=[2,4],labelBgBorderRadius:s=2,children:c,className:l,...u}){let[d,f]=B({x:1,y:0,width:0,height:0}),m=Ih([`react-flow__edge-textwrapper`,l]),h=R(null);return O(()=>{if(h.current){let e=h.current.getBBox();f({x:e.x,y:e.y,width:e.width,height:e.height})}},[n]),n?p(`g`,{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:m,visibility:d.width?`visible`:`hidden`,...u,children:[i&&p(`rect`,{width:d.width+2*o[0],x:-o[0],y:-o[1],height:d.height+2*o[1],className:`react-flow__edge-textbg`,style:a,rx:s,ry:s}),p(`text`,{className:`react-flow__edge-text`,y:d.height/2,dy:`0.3em`,ref:h,style:r,children:n}),c]}):null}SE.displayName=`EdgeText`;var CE=b(SE);function wE({path:e,labelX:t,labelY:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return p(ne,{children:[p(`path`,{...u,d:e,fill:`none`,className:Ih([`react-flow__edge-path`,u.className])}),l?p(`path`,{d:e,fill:`none`,strokeOpacity:0,strokeWidth:l,className:`react-flow__edge-interaction`}):null,r&&nS(t)&&nS(n)?p(CE,{x:t,y:n,label:r,labelStyle:i,labelShowBg:a,labelBgStyle:o,labelBgPadding:s,labelBgBorderRadius:c}):null]})}function TE({pos:e,x1:t,y1:n,x2:r,y2:i}){return e===Z.Left||e===Z.Right?[.5*(t+r),n]:[t,.5*(n+i)]}function EE({sourceX:e,sourceY:t,sourcePosition:n=Z.Bottom,targetX:r,targetY:i,targetPosition:a=Z.Top}){let[o,s]=TE({pos:n,x1:e,y1:t,x2:r,y2:i}),[c,l]=TE({pos:a,x1:r,y1:i,x2:e,y2:t}),[u,d,f,p]=OS({sourceX:e,sourceY:t,targetX:r,targetY:i,sourceControlX:o,sourceControlY:s,targetControlX:c,targetControlY:l});return[`M${e},${t} C${o},${s} ${c},${l} ${r},${i}`,u,d,f,p]}function DE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o,targetPosition:s,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:v})=>{let[y,b,x]=EE({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s}),S=e.isInternal?void 0:t;return p(wE,{id:S,path:y,labelX:b,labelY:x,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:v})})}var OE=DE({isInternal:!1}),kE=DE({isInternal:!0});OE.displayName=`SimpleBezierEdge`,kE.displayName=`SimpleBezierEdgeInternal`;function AE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,sourcePosition:m=Z.Bottom,targetPosition:h=Z.Top,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=WS({sourceX:n,sourceY:r,sourcePosition:m,targetX:i,targetY:a,targetPosition:h,borderRadius:v?.borderRadius,offset:v?.offset,stepPosition:v?.stepPosition}),C=e.isInternal?void 0:t;return p(wE,{id:C,path:b,labelX:x,labelY:S,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:_,interactionWidth:y})})}var jE=AE({isInternal:!1}),ME=AE({isInternal:!0});jE.displayName=`SmoothStepEdge`,ME.displayName=`SmoothStepEdgeInternal`;function NE(e){return b(({id:t,...n})=>{let r=e.isInternal?void 0:t;return p(jE,{...n,id:r,pathOptions:V(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}var PE=NE({isInternal:!1}),FE=NE({isInternal:!0});PE.displayName=`StepEdge`,FE.displayName=`StepEdgeInternal`;function IE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:h,interactionWidth:g})=>{let[_,v,y]=RS({sourceX:n,sourceY:r,targetX:i,targetY:a}),b=e.isInternal?void 0:t;return p(wE,{id:b,path:_,labelX:v,labelY:y,label:o,labelStyle:s,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:d,style:f,markerEnd:m,markerStart:h,interactionWidth:g})})}var LE=IE({isInternal:!1}),RE=IE({isInternal:!0});LE.displayName=`StraightEdge`,RE.displayName=`StraightEdgeInternal`;function zE(e){return b(({id:t,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:o=Z.Bottom,targetPosition:s=Z.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,pathOptions:v,interactionWidth:y})=>{let[b,x,S]=jS({sourceX:n,sourceY:r,sourcePosition:o,targetX:i,targetY:a,targetPosition:s,curvature:v?.curvature}),C=e.isInternal?void 0:t;return p(wE,{id:C,path:b,labelX:x,labelY:S,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:m,style:h,markerEnd:g,markerStart:_,interactionWidth:y})})}var BE=zE({isInternal:!1}),VE=zE({isInternal:!0});BE.displayName=`BezierEdge`,VE.displayName=`BezierEdgeInternal`;var HE={default:VE,straight:RE,step:FE,smoothstep:ME,simplebezier:kE},UE={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},WE=(e,t,n)=>n===Z.Left?e-t:n===Z.Right?e+t:e,GE=(e,t,n)=>n===Z.Top?e-t:n===Z.Bottom?e+t:e,KE=`react-flow__edgeupdater`;function qE({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:i,onMouseEnter:a,onMouseOut:o,type:s}){return p(`circle`,{onMouseDown:i,onMouseEnter:a,onMouseOut:o,className:Ih([KE,`${KE}-${s}`]),cx:WE(t,r,e),cy:GE(n,r,e),r,stroke:`transparent`,fill:`transparent`})}function JE({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:i,targetX:a,targetY:o,sourcePosition:s,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:d,setReconnecting:f,setUpdateHover:m}){let h=yw(),g=(e,t)=>{if(e.button!==0)return;let{autoPanOnConnect:r,domNode:i,connectionMode:a,connectionRadius:o,lib:s,onConnectStart:c,cancelConnection:p,nodeLookup:m,rfId:g,panBy:_,updateConnection:v}=h.getState(),y=t.type===`target`;jC.onPointerDown(e.nativeEvent,{autoPanOnConnect:r,connectionMode:a,connectionRadius:o,domNode:i,handleId:t.id,nodeId:t.nodeId,nodeLookup:m,isTarget:y,edgeUpdaterType:t.type,lib:s,flowId:g,cancelConnection:p,panBy:_,isValidConnection:(...e)=>h.getState().isValidConnection?.(...e)??!0,onConnect:e=>l?.(n,e),onConnectStart:(r,i)=>{f(!0),u?.(e,n,t.type),c?.(r,i)},onConnectEnd:(...e)=>h.getState().onConnectEnd?.(...e),onReconnectEnd:(e,r)=>{f(!1),d?.(e,n,t.type,r)},updateConnection:v,getTransform:()=>h.getState().transform,getFromHandle:()=>h.getState().connection.fromHandle,dragThreshold:h.getState().connectionDragThreshold,handleDomNode:e.currentTarget})},_=e=>g(e,{nodeId:n.target,id:n.targetHandle??null,type:`target`}),v=e=>g(e,{nodeId:n.source,id:n.sourceHandle??null,type:`source`}),y=()=>m(!0),b=()=>m(!1);return p(ne,{children:[(e===!0||e===`source`)&&p(qE,{position:s,centerX:r,centerY:i,radius:t,onMouseDown:_,onMouseEnter:y,onMouseOut:b,type:`source`}),(e===!0||e===`target`)&&p(qE,{position:c,centerX:a,centerY:o,radius:t,onMouseDown:v,onMouseEnter:y,onMouseOut:b,type:`target`})]})}function YE({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:i,onDoubleClick:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,rfId:h,edgeTypes:g,noPanClassName:_,onError:v,disableKeyboardA11y:y}){let b=Q(t=>t.edgeLookup.get(e)),x=Q(e=>e.defaultEdgeOptions);b=x?{...x,...b}:b;let S=b.type||`default`,C=g?.[S]||HE[S];C===void 0&&(v?.(`011`,yx.error011(S)),S=`default`,C=g?.default||HE.default);let w=!!(b.focusable||t&&b.focusable===void 0),T=d!==void 0&&(b.reconnectable||n&&b.reconnectable===void 0),E=!!(b.selectable||r&&b.selectable===void 0),D=R(null),[O,k]=B(!1),[A,j]=B(!1),M=yw(),{zIndex:N=b.zIndex,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie}=Q(z(t=>{let n=t.nodeLookup.get(b.source),r=t.nodeLookup.get(b.target);if(!n||!r)return UE;let i=KS({id:e,sourceNode:n,targetNode:r,sourceHandle:b.sourceHandle||null,targetHandle:b.targetHandle||null,connectionMode:t.connectionMode,onError:v}),a=NS({selected:b.selected,zIndex:b.zIndex,sourceNode:n,targetNode:r,elevateOnSelect:t.elevateEdgesOnSelect,zIndexMode:t.zIndexMode});return{...i||UE,zIndex:a}},[b.source,b.target,b.sourceHandle,b.targetHandle,b.selected,b.zIndex,v]),hw),F=V(()=>b.markerStart?`url('#${XS(b.markerStart,h)}')`:void 0,[b.markerStart,h]),ae=V(()=>b.markerEnd?`url('#${XS(b.markerEnd,h)}')`:void 0,[b.markerEnd,h]);if(b.hidden||P===null||ee===null||te===null||ne===null)return null;let oe=t=>{let{addSelectedEdges:n,unselectNodesAndEdges:r,multiSelectionActive:a}=M.getState();E&&(M.setState({nodesSelectionActive:!1}),b.selected&&a?(r({nodes:[],edges:[b]}),D.current?.blur()):n([e])),i&&i(t,b)},I=a?e=>{a(e,{...b})}:void 0,L=o?e=>{o(e,{...b})}:void 0,se=s?e=>{s(e,{...b})}:void 0,ce=c?e=>{c(e,{...b})}:void 0,le=l?e=>{l(e,{...b})}:void 0;return p(`svg`,{style:{zIndex:N},children:p(`g`,{className:Ih([`react-flow__edge`,`react-flow__edge-${S}`,b.className,_,{selected:b.selected,animated:b.animated,inactive:!E&&!i,updating:O,selectable:E}]),onClick:oe,onDoubleClick:I,onContextMenu:L,onMouseEnter:se,onMouseMove:ce,onMouseLeave:le,onKeyDown:w?t=>{if(!y&&xx.includes(t.key)&&E){let{unselectNodesAndEdges:n,addSelectedEdges:r}=M.getState();t.key===`Escape`?(D.current?.blur(),n({edges:[b]})):r([e])}}:void 0,tabIndex:w?0:void 0,role:b.ariaRole??(w?`group`:`img`),"aria-roledescription":`edge`,"data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":b.ariaLabel===null?void 0:b.ariaLabel||`Edge from ${b.source} to ${b.target}`,"aria-describedby":w?`${Cw}-${h}`:void 0,ref:D,...b.domAttributes,children:[!A&&p(C,{id:e,source:b.source,target:b.target,type:b.type,selected:b.selected,animated:b.animated,selectable:E,deletable:b.deletable??!0,label:b.label,labelStyle:b.labelStyle,labelShowBg:b.labelShowBg,labelBgStyle:b.labelBgStyle,labelBgPadding:b.labelBgPadding,labelBgBorderRadius:b.labelBgBorderRadius,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie,data:b.data,style:b.style,sourceHandleId:b.sourceHandle,targetHandleId:b.targetHandle,markerStart:F,markerEnd:ae,pathOptions:`pathOptions`in b?b.pathOptions:void 0,interactionWidth:b.interactionWidth}),T&&p(JE,{edge:b,isReconnectable:T,reconnectRadius:u,onReconnect:d,onReconnectStart:f,onReconnectEnd:m,sourceX:P,sourceY:ee,targetX:te,targetY:ne,sourcePosition:re,targetPosition:ie,setUpdateHover:k,setReconnecting:j})]})})}var XE=b(YE),ZE=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function QE({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:i,onReconnect:a,onEdgeContextMenu:o,onEdgeMouseEnter:s,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,disableKeyboardA11y:g}){let{edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,onError:b}=Q(ZE,hw),x=mE(t);return p(`div`,{className:`react-flow__edges`,children:[p(xE,{defaultColor:e,rfId:n}),x.map(e=>p(XE,{id:e,edgesFocusable:_,edgesReconnectable:v,elementsSelectable:y,noPanClassName:i,onReconnect:a,onContextMenu:o,onMouseEnter:s,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:d,onDoubleClick:f,onReconnectStart:m,onReconnectEnd:h,rfId:n,onError:b,edgeTypes:r,disableKeyboardA11y:g},e))]})}QE.displayName=`EdgeRenderer`;var $E=b(QE),eD=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function tD({children:e}){let t=yw(),n=R(null),[r]=B(()=>t.getState().transform);return uT(()=>{let e=null,r=()=>{let r=t.getState().transform;e&&r[0]===e[0]&&r[1]===e[1]&&r[2]===e[2]||(e=r,n.current&&(n.current.style.transform=eD(r)))};return r(),t.subscribe(r)},[t]),p(`div`,{ref:n,className:`react-flow__viewport xyflow__viewport react-flow__container`,style:{transform:eD(r)},children:e})}function nD(e){let t=_T(),n=R(!1);O(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}var rD=e=>e.panZoom?.syncViewport;function iD(e){let t=Q(rD),n=yw();return O(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function aD(e){return e.connection.inProgress?{...e.connection,to:aS(e.connection.to,e.transform)}:{...e.connection}}function oD(e){return e?t=>e(aD(t)):aD}function sD(e){return Q(oD(e),hw)}var cD=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function lD({containerStyle:e,style:t,type:n,component:r}){let{nodesConnectable:i,width:a,height:o,isValid:s,inProgress:c}=Q(cD,hw);return a&&i&&c?p(`svg`,{style:e,width:a,height:o,className:`react-flow__connectionline react-flow__container`,children:p(`g`,{className:Ih([`react-flow__connection`,yS(s)]),children:p(uD,{style:t,type:n,CustomComponent:r,isValid:s})})}):null}var uD=({style:e,type:t=Dx.Bezier,CustomComponent:n,isValid:r})=>{let{inProgress:i,from:a,fromNode:o,fromHandle:s,fromPosition:c,to:l,toNode:u,toHandle:d,toPosition:f,pointer:m}=sD();if(!i)return;if(n)return p(n,{connectionLineType:t,connectionLineStyle:e,fromNode:o,fromHandle:s,fromX:a.x,fromY:a.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:f,connectionStatus:yS(r),toNode:u,toHandle:d,pointer:m});let h=``,g={sourceX:a.x,sourceY:a.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:f};switch(t){case Dx.Bezier:[h]=jS(g);break;case Dx.SimpleBezier:[h]=EE(g);break;case Dx.Step:[h]=WS({...g,borderRadius:0});break;case Dx.SmoothStep:[h]=WS(g);break;default:[h]=RS(g)}return p(`path`,{d:h,fill:`none`,className:`react-flow__connection-path`,style:e})};uD.displayName=`ConnectionLine`;var dD={};function fD(e=dD){R(e),yw(),O(()=>{},[e])}function pD(){yw(),R(!1),O(()=>{},[])}function mD({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:i,onNodeDoubleClick:a,onEdgeDoubleClick:o,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:m,connectionLineType:h,connectionLineStyle:g,connectionLineComponent:_,connectionLineContainerStyle:v,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,deleteKeyCode:T,onlyRenderVisibleElements:E,elementsSelectable:D,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,preventScrolling:M,defaultMarkerColor:N,zoomOnScroll:P,zoomOnPinch:ee,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,zoomOnDoubleClick:ie,panOnDrag:F,autoPanOnSelection:ae,onPaneClick:oe,onPaneMouseEnter:I,onPaneMouseMove:L,onPaneMouseLeave:se,onPaneScroll:ce,onPaneContextMenu:le,paneClickDistance:R,nodeClickDistance:ue,onEdgeContextMenu:z,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,onReconnect:he,onReconnectStart:ge,onReconnectEnd:B,noDragClassName:_e,noWheelClassName:ve,noPanClassName:V,disableKeyboardA11y:H,nodeExtent:ye,rfId:be,viewport:xe,onViewportChange:U,nodesDraggable:Se}){return fD(e),fD(t),pD(),nD(n),iD(xe),p(rE,{onPaneClick:oe,onPaneMouseEnter:I,onPaneMouseMove:L,onPaneMouseLeave:se,onPaneContextMenu:le,onPaneScroll:ce,paneClickDistance:R,deleteKeyCode:T,selectionKeyCode:y,selectionOnDrag:b,selectionMode:x,onSelectionStart:f,onSelectionEnd:m,multiSelectionKeyCode:S,panActivationKeyCode:C,zoomActivationKeyCode:w,elementsSelectable:D,zoomOnScroll:P,zoomOnPinch:ee,zoomOnDoubleClick:ie,panOnScroll:te,panOnScrollSpeed:ne,panOnScrollMode:re,panOnDrag:F,autoPanOnSelection:ae,defaultViewport:O,translateExtent:k,minZoom:A,maxZoom:j,onSelectionContextMenu:d,preventScrolling:M,noDragClassName:_e,noWheelClassName:ve,noPanClassName:V,disableKeyboardA11y:H,onViewportChange:U,isControlledViewport:!!xe,children:p(tD,{children:[p($E,{edgeTypes:t,onEdgeClick:i,onEdgeDoubleClick:o,onReconnect:he,onReconnectStart:ge,onReconnectEnd:B,onlyRenderVisibleElements:E,onEdgeContextMenu:z,onEdgeMouseEnter:de,onEdgeMouseMove:fe,onEdgeMouseLeave:pe,reconnectRadius:me,defaultMarkerColor:N,noPanClassName:V,disableKeyboardA11y:H,rfId:be}),p(lD,{style:g,type:h,component:_,containerStyle:v}),p(`div`,{className:`react-flow__edgelabel-renderer`}),p(pE,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:s,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:ue,onlyRenderVisibleElements:E,noPanClassName:V,noDragClassName:_e,disableKeyboardA11y:H,nodeExtent:ye,rfId:be,nodesDraggable:Se}),p(`div`,{className:`react-flow__viewport-portal`})]})})}mD.displayName=`GraphView`;var hD=b(mD),gD=rS(`React Flow`,`https://reactflow.dev/`),_D=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:d,zIndexMode:f=`basic`}={})=>{let p=new Map,m=new Map,h=new Map,g=new Map,_=r??t??[],v=n??e??[],y=u??[0,0],b=d??bx;hC(h,g,_);let{nodesInitialized:x}=oC(v,p,m,{nodeOrigin:y,nodeExtent:b,zIndexMode:f}),S=[0,0,1];if(o&&i&&a){let{x:e,y:t,zoom:n}=uS(Fx(p,{filter:e=>!(!e.width&&!e.initialWidth||!e.height&&!e.initialHeight)}),i,a,c,l,s?.padding??.1);S=[e,t,n]}return{rfId:`1`,width:i??0,height:a??0,transform:S,nodes:v,nodesInitialized:x,nodeLookup:p,parentLookup:m,edges:_,edgeLookup:g,connectionLookup:h,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:bx,nodeExtent:b,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Cx.Strict,domNode:null,paneDragging:!1,noPanClassName:`nopan`,nodeOrigin:y,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:o??!1,fitViewOptions:s,fitViewResolver:null,connection:{...Ex},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:``,autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:gD,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:`react`,debug:!1,ariaLabelConfig:Sx,zIndexMode:f,defaultEdgeOptions:void 0,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map,onNodesDelete:void 0,onEdgesDelete:void 0,onDelete:void 0,onBeforeDelete:void 0,onViewportChangeStart:void 0,onViewportChange:void 0,onViewportChangeEnd:void 0,onNodeDragStart:void 0,onNodeDrag:void 0,onNodeDragStop:void 0,onSelectionDragStart:void 0,onSelectionDrag:void 0,onSelectionDragStop:void 0,onMoveStart:void 0,onMove:void 0,onMoveEnd:void 0,onConnect:void 0,onConnectStart:void 0,onConnectEnd:void 0,onClickConnectStart:void 0,onClickConnectEnd:void 0}},vD=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f})=>mw((p,m)=>{async function h(){let{nodeLookup:e,panZoom:t,fitViewOptions:n,fitViewResolver:r,width:i,height:a,minZoom:o,maxZoom:s}=m();t&&(await zx({nodes:e,width:i,height:a,panZoom:t,minZoom:o,maxZoom:s},n),r?.resolve(!0),p({fitViewResolver:null}))}return{..._D({nodes:e,edges:t,width:i,height:a,fitView:o,fitViewOptions:s,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:e=>{let{nodeLookup:t,parentLookup:n,nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,fitViewQueued:o,zIndexMode:s,nodesSelectionActive:c}=m(),{nodesInitialized:l,hasSelectedNodes:u}=oC(e,t,n,{nodeOrigin:r,nodeExtent:i,elevateNodesOnSelect:a,checkEquality:!0,zIndexMode:s}),d=c&&u;o&&l?(h(),p({nodes:e,nodesInitialized:l,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:d})):p({nodes:e,nodesInitialized:l,nodesSelectionActive:d})},setEdges:e=>{let{connectionLookup:t,edgeLookup:n}=m();hC(t,n,e),p({edges:e})},setDefaultNodesAndEdges:(e,t)=>{if(e){let{setNodes:t}=m();t(e),p({hasDefaultNodes:!0})}if(t){let{setEdges:e}=m();e(t),p({hasDefaultEdges:!0})}},updateNodeInternals:e=>{let{triggerNodeChanges:t,nodeLookup:n,parentLookup:r,domNode:i,nodeOrigin:a,nodeExtent:o,debug:s,fitViewQueued:c,zIndexMode:l}=m(),{changes:u,updatedInternals:d}=fC(e,n,r,i,a,o,l);d&&(rC(n,r,{nodeOrigin:a,nodeExtent:o,zIndexMode:l}),c?(h(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),u?.length>0&&(s&&console.log(`React Flow: trigger node changes`,u),t?.(u)))},updateNodePositions:(e,t=!1)=>{let n=[],r=[],{nodeLookup:i,triggerNodeChanges:a,connection:o,updateConnection:s,onNodesChangeMiddlewareMap:c}=m();for(let[a,c]of e){let e=i.get(a),l=!!(e?.expandParent&&e?.parentId&&c?.position),u={id:a,type:`position`,position:l?{x:Math.max(0,c.position.x),y:Math.max(0,c.position.y)}:c.position,dragging:t};if(e&&o.inProgress&&o.fromNode.id===e.id){let t=JS(e,o.fromHandle,Z.Left,!0);s({...o,from:t})}l&&e.parentId&&n.push({id:a,parentId:e.parentId,rect:{...c.internals.positionAbsolute,width:c.measured.width??0,height:c.measured.height??0}}),r.push(u)}if(n.length>0){let{parentLookup:e,nodeOrigin:t}=m(),a=dC(n,i,e,t);r.push(...a)}for(let e of c.values())r=e(r);a(r)},triggerNodeChanges:e=>{let{onNodesChange:t,setNodes:n,nodes:r,hasDefaultNodes:i,debug:a}=m();e?.length&&(i&&n($w(e,r)),a&&console.log(`React Flow: trigger node changes`,e),t?.(e))},triggerEdgeChanges:e=>{let{onEdgesChange:t,setEdges:n,edges:r,hasDefaultEdges:i,debug:a}=m();e?.length&&(i&&n(eT(e,r)),a&&console.log(`React Flow: trigger edge changes`,e),t?.(e))},addSelectedNodes:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){i(e.map(e=>tT(e,!0)));return}i(nT(r,new Set([...e]),!0)),a(nT(n))},addSelectedEdges:e=>{let{multiSelectionActive:t,edgeLookup:n,nodeLookup:r,triggerNodeChanges:i,triggerEdgeChanges:a}=m();if(t){a(e.map(e=>tT(e,!0)));return}a(nT(n,new Set([...e]))),i(nT(r,new Set,!0))},unselectNodesAndEdges:({nodes:e,edges:t}={})=>{let{edges:n,nodes:r,nodeLookup:i,triggerNodeChanges:a,triggerEdgeChanges:o}=m(),s=e||r,c=t||n,l=[];for(let e of s){if(!e.selected)continue;let t=i.get(e.id);t&&(t.selected=!1),l.push(tT(e.id,!1))}let u=[];for(let e of c)e.selected&&u.push(tT(e.id,!1));a(l),o(u)},setMinZoom:e=>{let{panZoom:t,maxZoom:n}=m();t?.setScaleExtent([e,n]),p({minZoom:e})},setMaxZoom:e=>{let{panZoom:t,minZoom:n}=m();t?.setScaleExtent([n,e]),p({maxZoom:e})},setTranslateExtent:e=>{m().panZoom?.setTranslateExtent(e),p({translateExtent:e})},resetSelectedElements:()=>{let{edges:e,nodes:t,triggerNodeChanges:n,triggerEdgeChanges:r,elementsSelectable:i}=m();if(!i)return;let a=t.reduce((e,t)=>t.selected?[...e,tT(t.id,!1)]:e,[]),o=e.reduce((e,t)=>t.selected?[...e,tT(t.id,!1)]:e,[]);n(a),r(o)},setNodeExtent:e=>{let{nodes:t,nodeLookup:n,parentLookup:r,nodeOrigin:i,elevateNodesOnSelect:a,nodeExtent:o,zIndexMode:s}=m();(e[0][0]!==o[0][0]||e[0][1]!==o[0][1]||e[1][0]!==o[1][0]||e[1][1]!==o[1][1])&&(oC(t,n,r,{nodeOrigin:i,nodeExtent:e,elevateNodesOnSelect:a,checkEquality:!1,zIndexMode:s}),p({nodeExtent:e}))},panBy:e=>{let{transform:t,width:n,height:r,panZoom:i,translateExtent:a}=m();return pC({delta:e,panZoom:i,transform:t,translateExtent:a,width:n,height:r})},setCenter:async(e,t,n)=>{let{width:r,height:i,maxZoom:a,panZoom:o}=m();if(!o)return!1;let s=n?.zoom===void 0?a:n.zoom;return await o.setViewport({x:r/2-e*s,y:i/2-t*s,zoom:s},{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),!0},cancelConnection:()=>{p({connection:{...Ex}})},updateConnection:e=>{p({connection:e})},reset:()=>p({..._D()})}},Object.is);function yD({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:i,initialHeight:a,initialMinZoom:o,initialMaxZoom:s,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:d,zIndexMode:f,children:m}){let[h]=B(()=>vD({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:i,height:a,fitView:l,minZoom:o,maxZoom:s,fitViewOptions:c,nodeOrigin:u,nodeExtent:d,zIndexMode:f}));return p(_w,{value:h,children:p(mT,{children:p(zT,{children:m})})})}function bD({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:i,width:a,height:o,fitView:s,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m}){return L(gw)?p(ne,{children:e}):p(yD,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:i,initialWidth:a,initialHeight:o,fitView:s,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:d,nodeExtent:f,zIndexMode:m,children:e})}var xD={width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`,zIndex:0};function SD({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:i,nodeTypes:a,edgeTypes:o,onNodeClick:s,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:d,onMoveEnd:f,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:v,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onSelectionChange:A,onSelectionDragStart:j,onSelectionDrag:M,onSelectionDragStop:N,onSelectionContextMenu:P,onSelectionStart:ee,onSelectionEnd:te,onBeforeDelete:ne,connectionMode:re,connectionLineType:ie=Dx.Bezier,connectionLineStyle:F,connectionLineComponent:ae,connectionLineContainerStyle:oe,deleteKeyCode:I=`Backspace`,selectionKeyCode:L=`Shift`,selectionOnDrag:se=!1,selectionMode:ce=Tx.Full,panActivationKeyCode:le=`Space`,multiSelectionKeyCode:R=dS()?`Meta`:`Control`,zoomActivationKeyCode:ue=dS()?`Meta`:`Control`,snapToGrid:de,snapGrid:fe,onlyRenderVisibleElements:pe=!1,selectNodesOnDrag:me,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:B,nodesFocusable:_e,nodeOrigin:ve=Rw,edgesFocusable:V,edgesReconnectable:H,elementsSelectable:ye=!0,defaultViewport:be=zw,minZoom:xe=.5,maxZoom:U=2,translateExtent:Se=bx,preventScrolling:Ce=!0,nodeExtent:we,defaultMarkerColor:Te=`#b1b1b7`,zoomOnScroll:Ee=!0,zoomOnPinch:De=!0,panOnScroll:Oe=!1,panOnScrollSpeed:ke=.5,panOnScrollMode:Ae=wx.Free,zoomOnDoubleClick:je=!0,panOnDrag:Me=!0,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze=1,nodeClickDistance:Be=0,children:Ve,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:We,onEdgeContextMenu:Ge,onEdgeDoubleClick:Ke,onEdgeMouseEnter:qe,onEdgeMouseMove:Je,onEdgeMouseLeave:Ye,reconnectRadius:Xe=10,onNodesChange:Ze,onEdgesChange:Qe,noDragClassName:$e=`nodrag`,noWheelClassName:et=`nowheel`,noPanClassName:tt=`nopan`,fitView:nt,fitViewOptions:rt,connectOnClick:it,attributionPosition:at,proOptions:ot,defaultEdgeOptions:st,elevateNodesOnSelect:ct=!0,elevateEdgesOnSelect:lt=!1,disableKeyboardA11y:ut=!1,autoPanOnConnect:dt,autoPanOnNodeDrag:ft,autoPanOnSelection:pt=!0,autoPanSpeed:mt,connectionRadius:ht,isValidConnection:gt,onError:_t,style:W,id:G,nodeDragThreshold:vt,connectionDragThreshold:yt,viewport:bt,onViewportChange:xt,width:K,height:St,colorMode:Ct=`light`,debug:wt,onScroll:Tt,ariaLabelConfig:Et,zIndexMode:Dt=`basic`,...Ot},kt){let At=G||`1`,jt=Gw(Ct),Mt=z(e=>{e.currentTarget.scrollTo({top:0,left:0,behavior:`instant`}),Tt?.(e)},[Tt]);return p(`div`,{"data-testid":`rf__wrapper`,...Ot,onScroll:Mt,style:{...W,...xD},ref:kt,className:Ih([`react-flow`,i,jt]),id:G,role:`application`,children:p(bD,{nodes:e,edges:t,width:K,height:St,fitView:nt,fitViewOptions:rt,minZoom:xe,maxZoom:U,nodeOrigin:ve,nodeExtent:we,zIndexMode:Dt,children:[p(Uw,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:m,onConnectStart:h,onConnectEnd:g,onClickConnectStart:_,onClickConnectEnd:v,nodesDraggable:he,autoPanOnNodeFocus:ge,nodesConnectable:B,nodesFocusable:_e,edgesFocusable:V,edgesReconnectable:H,elementsSelectable:ye,elevateNodesOnSelect:ct,elevateEdgesOnSelect:lt,minZoom:xe,maxZoom:U,nodeExtent:we,onNodesChange:Ze,onEdgesChange:Qe,snapToGrid:de,snapGrid:fe,connectionMode:re,translateExtent:Se,connectOnClick:it,defaultEdgeOptions:st,fitView:nt,fitViewOptions:rt,onNodesDelete:D,onEdgesDelete:O,onDelete:k,onNodeDragStart:w,onNodeDrag:T,onNodeDragStop:E,onSelectionDrag:M,onSelectionDragStart:j,onSelectionDragStop:N,onMove:u,onMoveStart:d,onMoveEnd:f,noPanClassName:tt,nodeOrigin:ve,rfId:At,autoPanOnConnect:dt,autoPanOnNodeDrag:ft,autoPanSpeed:mt,onError:_t,connectionRadius:ht,isValidConnection:gt,selectNodesOnDrag:me,nodeDragThreshold:vt,connectionDragThreshold:yt,onBeforeDelete:ne,debug:wt,ariaLabelConfig:Et,zIndexMode:Dt}),p(hD,{onInit:l,onNodeClick:s,onEdgeClick:c,onNodeMouseEnter:y,onNodeMouseMove:b,onNodeMouseLeave:x,onNodeContextMenu:S,onNodeDoubleClick:C,nodeTypes:a,edgeTypes:o,connectionLineType:ie,connectionLineStyle:F,connectionLineComponent:ae,connectionLineContainerStyle:oe,selectionKeyCode:L,selectionOnDrag:se,selectionMode:ce,deleteKeyCode:I,multiSelectionKeyCode:R,panActivationKeyCode:le,zoomActivationKeyCode:ue,onlyRenderVisibleElements:pe,defaultViewport:be,translateExtent:Se,minZoom:xe,maxZoom:U,preventScrolling:Ce,zoomOnScroll:Ee,zoomOnPinch:De,zoomOnDoubleClick:je,panOnScroll:Oe,panOnScrollSpeed:ke,panOnScrollMode:Ae,panOnDrag:Me,autoPanOnSelection:pt,onPaneClick:Ne,onPaneMouseEnter:Pe,onPaneMouseMove:Fe,onPaneMouseLeave:Ie,onPaneScroll:Le,onPaneContextMenu:Re,paneClickDistance:ze,nodeClickDistance:Be,onSelectionContextMenu:P,onSelectionStart:ee,onSelectionEnd:te,onReconnect:He,onReconnectStart:Ue,onReconnectEnd:We,onEdgeContextMenu:Ge,onEdgeDoubleClick:Ke,onEdgeMouseEnter:qe,onEdgeMouseMove:Je,onEdgeMouseLeave:Ye,reconnectRadius:Xe,defaultMarkerColor:Te,noDragClassName:$e,noWheelClassName:et,noPanClassName:tt,rfId:At,disableKeyboardA11y:ut,nodeExtent:we,viewport:bt,onViewportChange:xt,nodesDraggable:he}),p(Lw,{onSelectionChange:A}),Ve,p(jw,{proOptions:ot,position:at}),p(Ow,{rfId:At,disableKeyboardA11y:ut})]})})}var CD=lT(SD);yx.error014();function wD({dimensions:e,lineWidth:t,variant:n,className:r}){return p(`path`,{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Ih([`react-flow__background-pattern`,n,r])})}function TD({radius:e,className:t}){return p(`circle`,{cx:e,cy:e,r:e,className:Ih([`react-flow__background-pattern`,`dots`,t])})}var ED;(function(e){e.Lines=`lines`,e.Dots=`dots`,e.Cross=`cross`})(ED||={});var DD={[ED.Dots]:1,[ED.Lines]:1,[ED.Cross]:6},OD=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function kD({id:e,variant:t=ED.Dots,gap:n=20,size:r,lineWidth:i=1,offset:a=0,color:o,bgColor:s,style:c,className:l,patternClassName:u}){let d=R(null),{transform:f,patternId:m}=Q(OD,hw),h=r||DD[t],g=t===ED.Dots,_=t===ED.Cross,v=Array.isArray(n)?n:[n,n],y=[v[0]*f[2]||1,v[1]*f[2]||1],b=h*f[2],x=Array.isArray(a)?a:[a,a],S=_?[b,b]:y,C=[x[0]*f[2]+S[0]/2,x[1]*f[2]+S[1]/2],w=`${m}${e||``}`;return p(`svg`,{className:Ih([`react-flow__background`,l]),style:{...c,...ST,"--xy-background-color-props":s,"--xy-background-pattern-color-props":o},ref:d,"data-testid":`rf__background`,children:[p(`pattern`,{id:w,x:f[0]%y[0],y:f[1]%y[1],width:y[0],height:y[1],patternUnits:`userSpaceOnUse`,patternTransform:`translate(-${C[0]},-${C[1]})`,children:g?p(TD,{radius:b/2,className:u}):p(wD,{dimensions:S,lineWidth:i,variant:t,className:u})}),p(`rect`,{x:`0`,y:`0`,width:`100%`,height:`100%`,fill:`url(#${w})`})]})}kD.displayName=`Background`;var AD=b(kD);function jD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 32`,children:p(`path`,{d:`M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z`})})}function MD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 5`,children:p(`path`,{d:`M0 0h32v4.2H0z`})})}function ND(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 32 30`,children:p(`path`,{d:`M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z`})})}function PD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:p(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z`})})}function FD(){return p(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 25 32`,children:p(`path`,{d:`M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z`})})}function ID({children:e,className:t,...n}){return p(`button`,{type:`button`,className:Ih([`react-flow__controls-button`,t]),...n,children:e})}var LD=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function RD({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:i,onZoomIn:a,onZoomOut:o,onFitView:s,onInteractiveChange:c,className:l,children:u,position:d=`bottom-left`,orientation:f=`vertical`,"aria-label":m}){let h=yw(),{isInteractive:g,minZoomReached:_,maxZoomReached:v,ariaLabelConfig:y}=Q(LD,hw),{zoomIn:b,zoomOut:x,fitView:S}=_T();return p(kw,{className:Ih([`react-flow__controls`,f===`horizontal`?`horizontal`:`vertical`,l]),position:d,style:e,"data-testid":`rf__controls`,"aria-label":m??y[`controls.ariaLabel`],children:[t&&p(ne,{children:[p(ID,{onClick:()=>{b(),a?.()},className:`react-flow__controls-zoomin`,title:y[`controls.zoomIn.ariaLabel`],"aria-label":y[`controls.zoomIn.ariaLabel`],disabled:v,children:p(jD,{})}),p(ID,{onClick:()=>{x(),o?.()},className:`react-flow__controls-zoomout`,title:y[`controls.zoomOut.ariaLabel`],"aria-label":y[`controls.zoomOut.ariaLabel`],disabled:_,children:p(MD,{})})]}),n&&p(ID,{className:`react-flow__controls-fitview`,onClick:()=>{S(i),s?.()},title:y[`controls.fitView.ariaLabel`],"aria-label":y[`controls.fitView.ariaLabel`],children:p(ND,{})}),r&&p(ID,{className:`react-flow__controls-interactive`,onClick:()=>{h.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},title:y[`controls.interactive.ariaLabel`],"aria-label":y[`controls.interactive.ariaLabel`],children:p(g?FD:PD,{})}),u]})}RD.displayName=`Controls`,b(RD);function zD({id:e,x:t,y:n,width:r,height:i,style:a,color:o,strokeColor:s,strokeWidth:c,className:l,borderRadius:u,shapeRendering:d,selected:f,onClick:m}){let{background:h,backgroundColor:g}=a||{},_=o||h||g;return p(`rect`,{className:Ih([`react-flow__minimap-node`,{selected:f},l]),x:t,y:n,rx:u,ry:u,width:r,height:i,style:{fill:_,stroke:s,strokeWidth:c},shapeRendering:d,onClick:m?t=>m(t,e):void 0})}var BD=b(zD),VD=e=>e.nodes.map(e=>e.id),HD=e=>e instanceof Function?e:()=>e;function UD({nodeStrokeColor:e,nodeColor:t,nodeClassName:n=``,nodeBorderRadius:r=5,nodeStrokeWidth:i,nodeComponent:a=BD,onClick:o}){let s=Q(VD,hw),c=HD(t),l=HD(e),u=HD(n),d=typeof window>`u`||window.chrome?`crispEdges`:`geometricPrecision`;return p(ne,{children:s.map(e=>p(GD,{id:e,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:i,NodeComponent:a,onClick:o,shapeRendering:d},e))})}function WD({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:i,nodeStrokeWidth:a,shapeRendering:o,NodeComponent:s,onClick:c}){let{node:l,x:u,y:d,width:f,height:m}=Q(t=>{let n=t.nodeLookup.get(e);if(!n)return{node:void 0,x:0,y:0,width:0,height:0};let r=n.internals.userNode,{x:i,y:a}=n.internals.positionAbsolute,{width:o,height:s}=pS(r);return{node:r,x:i,y:a,width:o,height:s}},hw);return!l||l.hidden||!mS(l)?null:p(s,{x:u,y:d,width:f,height:m,style:l.style,selected:!!l.selected,className:r(l),color:t(l),borderRadius:i,strokeColor:n(l),strokeWidth:a,shapeRendering:o,onClick:c,id:l.id})}var GD=b(WD),KD=b(UD),qD=200,JD=150,YD=e=>!e.hidden,XD=e=>{let t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]},n=!1;for(let t of e.nodeLookup.values())if(!t.hidden){n=!0;break}return{viewBB:t,boundingRect:n?Qx(Fx(e.nodeLookup,{filter:YD}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},ZD=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,QD=(e,t)=>ZD(e.viewBB,t.viewBB)&&ZD(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,$D=`react-flow__minimap-desc`;function eO({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:i=``,nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:s,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:d,position:f=`bottom-right`,onClick:m,onNodeClick:h,pannable:g=!1,zoomable:_=!1,ariaLabel:v,inversePan:y,zoomStep:b=1,offsetScale:x=5}){let S=yw(),C=R(null),{boundingRect:w,panZoom:T,viewBB:E,rfId:D,translateExtent:k,flowWidth:A,flowHeight:j,ariaLabelConfig:M}=Q(XD,QD),N=e?.width??qD,P=e?.height??JD,ee=w.width/N,te=w.height/P,ne=Math.max(ee,te),re=ne*N,ie=ne*P,F=x*ne,ae=w.x-(re-w.width)/2-F,oe=w.y-(ie-w.height)/2-F,I=re+F*2,L=ie+F*2,se=`${$D}-${D}`,ce=R(0),le=R();ce.current=ne,O(()=>{let e=S.getState().panZoom;if(C.current&&e)return le.current=MC({domNode:C.current,panZoom:e,getTransform:()=>S.getState().transform,getViewScale:()=>ce.current}),()=>{le.current?.destroy()}},[T]),O(()=>{le.current?.update({translateExtent:k,width:A,height:j,inversePan:y,pannable:g,zoomStep:b,zoomable:_})},[g,_,y,b,k,A,j]);let ue=m?e=>{let[t,n]=le.current?.pointer(e)||[0,0];m(e,{x:t,y:n})}:void 0,de=z((e,t)=>{let n=S.getState().nodeLookup.get(t).internals.userNode;h?.(e,n)},[h]),fe=h?de:void 0,pe=v??M[`minimap.ariaLabel`];return p(kw,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof c==`string`?c:void 0,"--xy-minimap-mask-background-color-props":typeof l==`string`?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u==`string`?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof d==`number`?d*ne:void 0,"--xy-minimap-node-background-color-props":typeof r==`string`?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n==`string`?n:void 0,"--xy-minimap-node-stroke-width-props":typeof o==`number`?o:void 0},className:Ih([`react-flow__minimap`,t]),"data-testid":`rf__minimap`,children:p(`svg`,{width:N,height:P,viewBox:`${ae} ${oe} ${I} ${L}`,className:`react-flow__minimap-svg`,role:`img`,"aria-labelledby":se,ref:C,onClick:ue,children:[pe&&p(`title`,{id:se,children:pe}),p(KD,{onClick:fe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:i,nodeStrokeWidth:o,nodeComponent:s}),p(`path`,{className:`react-flow__minimap-mask`,d:`M${ae-F},${oe-F}h${I+F*2}v${L+F*2}h${-I-F*2}z
1131
+ M${E.x},${E.y}h${E.width}v${E.height}h${-E.width}z`,fillRule:`evenodd`,pointerEvents:`none`})]})})}eO.displayName=`MiniMap`,b(eO);var tO=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,nO={[qC.Line]:`right`,[qC.Handle]:`bottom-right`};function rO({nodeId:e,position:t,variant:n=qC.Handle,className:r,style:i=void 0,children:a,color:o,minWidth:s=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:m=!0,shouldResize:h,onResizeStart:g,onResize:_,onResizeEnd:v}){let y=IT(),b=typeof e==`string`?e:y,x=yw(),S=R(null),C=n===qC.Handle,w=Q(z(tO(C&&m),[C,m]),hw),T=R(null),E=t??nO[n];O(()=>{if(S.current&&b)return T.current||=iw({domNode:S.current,nodeId:b,getStoreItems:()=>{let{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,domNode:a}=x.getState();return{nodeLookup:e,transform:t,snapGrid:n,snapToGrid:r,nodeOrigin:i,paneDomNode:a}},onChange:(e,t)=>{let{triggerNodeChanges:n,nodeLookup:r,parentLookup:i,nodeOrigin:a}=x.getState(),o=[],s={x:e.x,y:e.y},c=r.get(b);if(c&&c.expandParent&&c.parentId){let t=c.origin??a,n=e.width??c.measured.width??0,l=e.height??c.measured.height??0,u=dC([{id:c.id,parentId:c.parentId,rect:{width:n,height:l,...hS({x:e.x??c.position.x,y:e.y??c.position.y},{width:n,height:l},c.parentId,r,t)}}],r,i,a);o.push(...u),s.x=e.x?Math.max(t[0]*n,e.x):void 0,s.y=e.y?Math.max(t[1]*l,e.y):void 0}if(s.x!==void 0&&s.y!==void 0){let e={id:b,type:`position`,position:{...s}};o.push(e)}if(e.width!==void 0&&e.height!==void 0){let t={id:b,type:`dimensions`,resizing:!0,setAttributes:f?f===`horizontal`?`width`:`height`:!0,dimensions:{width:e.width,height:e.height}};o.push(t)}for(let e of t){let t={...e,type:`position`};o.push(t)}n(o)},onEnd:({width:e,height:t})=>{let n={id:b,type:`dimensions`,resizing:!1,dimensions:{width:e,height:t}};x.getState().triggerNodeChanges([n])}}),T.current.update({controlPosition:E,boundaries:{minWidth:s,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:_,onResizeEnd:v,shouldResize:h}),()=>{T.current?.destroy()}},[E,s,c,l,u,d,g,_,v,h]);let D=E.split(`-`);return p(`div`,{className:Ih([`react-flow__resize-control`,`nodrag`,...D,n,r]),ref:S,style:{...i,scale:w,...o&&{[C?`backgroundColor`:`borderColor`]:o}},children:a})}b(rO);var iO=40,aO=280,oO=98,sO=24,cO=e=>{let t=e.split(/\s+/).filter(Boolean),n=[],r=``;for(let e of t){let t=r?`${r} ${e}`:e;if(t.length<=sO){r=t;continue}if(n.length===1)break;r&&n.push(r),r=e}r&&n.length<2&&n.push(r);let i=n.slice(0,2);return i.join(` `).length<e.length&&i.length&&(i[i.length-1]=`${i[i.length-1].slice(0,23)}…`),i.length?i:[e.slice(0,sO)]},lO=(e,t)=>{let n=vh(t.hover,e.edges),r=new Set(e.nodes.map(e=>e.uri)),i=e.nodes.map(e=>{let r=yh(e);return{id:e.uri,type:`work`,position:{x:iO+e.column*aO,y:iO+e.row*oO},width:190,height:74,draggable:!1,selectable:!1,data:{uri:e.uri,title:r,lines:cO(r),meta:[Oh(e.format),e.episodeCount?`${e.episodeCount} ep`:void 0].filter(Boolean).join(` · `),current:t.current.has(e.uri),lit:n.nodes.has(e.uri)}}}),a=e=>t.hover?.kind===`node`&&(e.from===t.hover.uri||e.to===t.hover.uri),o=e.chain.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>({id:`chain\u0000${e.from}\u0000${e.to}`,type:`chain`,source:e.from,target:e.to,data:{kind:`chain`,label:``,lit:a(e)}})),s=e.edges.filter(e=>r.has(e.from)&&r.has(e.to)).map(e=>{let t=_h(e);return{id:t,type:`relation`,source:e.from,target:e.to,data:{kind:`relation`,label:Eh(e.relation).toUpperCase(),lit:n.edges.has(t)}}});return{nodes:i,edges:[...o,...s]}};j();var uO=x`
1132
1132
  display: inline-flex;
1133
1133
  align-items: center;
1134
1134
  gap: 0.6rem;
@@ -1150,13 +1150,13 @@ transition: max-height 0.3s ease-in-out;
1150
1150
  }
1151
1151
 
1152
1152
  svg { width: 1.5rem; height: 1.5rem; }
1153
- `,oO=x`
1153
+ `,dO=x`
1154
1154
  display: flex;
1155
1155
  align-items: center;
1156
1156
  justify-content: center;
1157
1157
  padding: 4rem;
1158
1158
  background: rgba(0, 0, 0, 0.75);
1159
- z-index: ${Ff.franchiseDialog};
1159
+ z-index: ${Bf.franchiseDialog};
1160
1160
 
1161
1161
  .sheet {
1162
1162
  position: relative;
@@ -1342,7 +1342,7 @@ transition: max-height 0.3s ease-in-out;
1342
1342
 
1343
1343
  /* the text alone is a thin target, so each label carries an invisible pad it can be caught by */
1344
1344
  .label-hit { fill: transparent; cursor: pointer; }
1345
- `,sO=fe(()=>{}),cO=({data:e})=>{let t=L(lO);return k(ts,{className:`work-node${e.current?` current`:``}${e.lit?` lit`:``}`,to:`${cs(J.MEDIA,{uri:ve(e.uri)})}${t}`,title:e.title,children:[U(zT,{type:`target`,position:Z.Left}),U(`div`,{className:`title`,children:e.lines.map(e=>U(`div`,{children:e},e))}),e.meta?U(`div`,{className:`meta`,children:e.meta}):void 0,U(zT,{type:`source`,position:Z.Right})]})},lO=fe(``),uO=(e,t,n,r)=>{let i=n>=e,a=Math.max(20,Math.abs(n-e)/2)*(i?1:-1);return`M ${e} ${t} C ${e+a} ${t}, ${n-a} ${r}, ${n} ${r}`},dO=({data:e,sourceX:t,sourceY:n,targetX:r,targetY:i})=>U(`path`,{className:`chain${e?.lit?` lit`:``}`,d:uO(t,n,r,i)}),fO=({id:e,data:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=L(sO),s=t?.label??``,c=t?.lit?` lit`:``,l=(e,t)=>e+(t-e)*.34,u=l(n,i),d=l(r,a)-6,f=s.length*6.4+12;return k(H,{children:[U(`path`,{className:`edge${c}`,d:uO(n,r,i,a)}),k(`g`,{className:`label`,onPointerEnter:()=>o({kind:`edge`,key:e}),onPointerLeave:()=>o(void 0),children:[U(`rect`,{className:`label-hit`,x:u-f/2,y:d-11,width:f,height:15}),U(`text`,{className:`edge-label${c}`,x:u,y:d,children:s})]})]})},pO={work:cO},mO={chain:dO,relation:fO},hO=({franchise:e,currentUris:t})=>{let n=$m(Jo()),r=V(()=>uh(e),[e]),[i,a]=B(()=>new Set(r.filter(lh))),o=[...i].every(lh)?`story`:`graph`,s=V(()=>_h(dh(e,e=>!e.format||i.has(e.format)),o),[e,i,o]),[c,l]=B(void 0),u=V(()=>new Set(t),[t]),{nodes:d,edges:f}=V(()=>iO(s,{current:u,hover:c}),[s,u,c]),p=z((e,t)=>l({kind:`node`,uri:t.id}),[]),m=z(()=>l(void 0),[]),h=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return k(H,{children:[U(`div`,{className:`bar`,children:U(`div`,{className:`title`,children:`Series`})}),k(`div`,{className:`canvas`,"data-canvas":!0,children:[r.length?k(`div`,{className:`kinds`,onPointerDown:e=>e.stopPropagation(),children:[U(`div`,{className:`legend`,children:`Show`}),r.map(e=>k(`label`,{className:i.has(e)?`on`:void 0,children:[U(`input`,{type:`checkbox`,checked:i.has(e),onChange:()=>h(e)}),U(`span`,{children:Ch(e)})]},e))]}):void 0,U(lO.Provider,{value:n,children:U(sO.Provider,{value:l,children:U(vD,{nodes:d,edges:f,nodeTypes:pO,edgeTypes:mO,onNodeMouseEnter:p,onNodeMouseLeave:m,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every work in this series, in order`,children:U(TD,{variant:xD.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.14)`})})})})]})]})},gO=({franchise:e,currentUris:t})=>{let[n,r]=B(!1),{refs:i,context:a}=mf({open:n,onOpenChange:r}),{getReferenceProps:o,getFloatingProps:s}=vf([cf(a),ff(a,{outsidePress:!0}),bf(a,{role:`dialog`})]);return!e||(e.nodes?.length??0)<2?null:k(H,{children:[k(`button`,{type:`button`,css:aO,ref:i.setReference,...o(),"data-franchise-open":!0,children:[U($c,{}),`See detailed relation graph`]}),n?U(Vd,{children:U(rf,{lockScroll:!0,css:oO,"data-franchise":!0,children:U(Qd,{context:a,children:k(`div`,{className:`sheet`,ref:i.setFloating,...s(),children:[U(hO,{franchise:e,currentUris:t}),U(`button`,{type:`button`,className:`close`,"aria-label":`Close`,onClick:()=>r(!1),children:U(hl,{})})]})})})}):void 0]})},_O=`stub.tracking.compact`,vO={targets:{}},yO=()=>{try{return globalThis.localStorage}catch{return}},bO=e=>{try{let t=JSON.parse(e??`null`);return{targets:Object.fromEntries(Object.entries(t?.targets??{}).filter(([,e])=>typeof e==`boolean`))}}catch{return vO}},xO=(e=yO())=>{let t;return{read:()=>{if(t)return t;try{return bO(e?.getItem(_O))}catch{return vO}},write:n=>{try{if(!e)throw Error(`No storage`);e.setItem(_O,JSON.stringify(n)),t=void 0}catch{t=n}}}},SO=[`mal`,`anilist`,`kitsu`,`anidb`],CO=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,TO.unregister(this),e}free(){let e=this.__destroy_into_raw();$.__wbg_haystacks_free(e,0)}bytesView(){return $.haystacks_bytesView(this.__wbg_ptr)}clear(){$.haystacks_clear(this.__wbg_ptr)}commit(e,t){let n=$.haystacks_commit(this.__wbg_ptr,e,t);if(n[1])throw IO(n[0])}get length(){return $.haystacks_length(this.__wbg_ptr)>>>0}constructor(e){var t=NO(e)?0:PO(e,$.__wbindgen_malloc),n=RO;let r=$.haystacks_new(t,n);return this.__wbg_ptr=r,TO.register(this,this.__wbg_ptr,this),this}offsetsView(){return $.haystacks_offsetsView(this.__wbg_ptr)}push(e){let t=PO(e,$.__wbindgen_malloc),n=RO;$.haystacks_push(this.__wbg_ptr,t,n)}reserve(e,t){$.haystacks_reserve(this.__wbg_ptr,e,t)}};Symbol.dispose&&(CO.prototype[Symbol.dispose]=CO.prototype.free);var wO=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,EO.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,EO.unregister(this),e}free(){let e=this.__destroy_into_raw();$.__wbg_matcher_free(e,0)}static fromPatterns(t,n){let r=$.matcher_fromPatterns(t,NO(n)?0:DO(n));if(r[2])throw IO(r[1]);return e.__wrap(r[0])}static fromQuery(t,n){let r=FO(t,$.__wbindgen_malloc,$.__wbindgen_realloc),i=RO,a=$.matcher_fromQuery(r,i,NO(n)?0:DO(n));if(a[2])throw IO(a[1]);return e.__wrap(a[0])}matchHaystacks(e){return OO(e,CO),$.matcher_matchHaystacks(this.__wbg_ptr,e.__wbg_ptr)}matchHaystacksIndices(e){return OO(e,CO),$.matcher_matchHaystacksIndices(this.__wbg_ptr,e.__wbg_ptr)}matchList(e){let t=PO(e,$.__wbindgen_malloc),n=RO;return $.matcher_matchList(this.__wbg_ptr,t,n)}matchListIndices(e){let t=PO(e,$.__wbindgen_malloc),n=RO;return $.matcher_matchListIndices(this.__wbg_ptr,t,n)}matchOne(e,t){let n=FO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=RO;return $.matcher_matchOne(this.__wbg_ptr,n,r,t)}matchOneIndices(e,t){let n=FO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=RO;return $.matcher_matchOneIndices(this.__wbg_ptr,n,r,t)}constructor(e,t){let n=FO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=RO,i=$.matcher_new(n,r,NO(t)?0:DO(t));if(i[2])throw IO(i[1]);return this.__wbg_ptr=i[0],EO.register(this,this.__wbg_ptr,this),this}setConfig(e){let t=$.matcher_setConfig(this.__wbg_ptr,e);if(t[1])throw IO(t[0])}setPattern(e){let t=$.matcher_setPattern(this.__wbg_ptr,e);if(t[1])throw IO(t[0])}setPatterns(e){let t=$.matcher_setPatterns(this.__wbg_ptr,e);if(t[1])throw IO(t[0])}};Symbol.dispose&&(wO.prototype[Symbol.dispose]=wO.prototype.free);var TO=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>$.__wbg_haystacks_free(e,1)),EO=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>$.__wbg_matcher_free(e,1));function DO(e){let t=$.__externref_table_alloc();return $.__wbindgen_externrefs.set(t,e),t}function OO(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}var kO=null;function AO(){return(kO===null||kO.buffer.detached===!0||kO.buffer.detached===void 0&&kO.buffer!==$.memory.buffer)&&(kO=new DataView($.memory.buffer)),kO}var jO=null;function MO(){return(jO===null||jO.byteLength===0)&&(jO=new Uint8Array($.memory.buffer)),jO}function NO(e){return e==null}function PO(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=DO(e[t]);AO().setUint32(n+4*t,r,!0)}return RO=e.length,n}function FO(e,t,n){if(n===void 0){let n=LO.encode(e),r=t(n.length,1)>>>0;return MO().subarray(r,r+n.length).set(n),RO=n.length,r}let r=e.length,i=t(r,1)>>>0,a=MO(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=MO().subarray(i+o,i+r),a=LO.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return RO=o,i}function IO(e){let t=$.__wbindgen_externrefs.get(e);return $.__externref_table_dealloc(e),t}new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode();var LO=new TextEncoder;`encodeInto`in LO||(LO.encodeInto=function(e,t){let n=LO.encode(e);return t.set(n),{read:e.length,written:n.length}});var RO=0,$,zO=new TextEncoder;function BO(e,t){let n=0;for(let e of t)n+=e.length*3;e.reserve(n,t.length);let r=e.bytesView(),i=e.offsetsView(),a=0;for(let e=0;e<t.length;e++)a+=zO.encodeInto(t[e],r.subarray(a)).written,i[e]=a;return e.commit(a,t.length),e}var VO=class extends CO{constructor(e){super(),e?.length&&BO(this,e)}push(e){BO(this,e)}},HO;function UO(e){return HO??=new VO,HO.clear(),BO(HO,e)}wO.prototype.matchList=function(e){return this.matchHaystacks(e instanceof CO?e:UO(e))},wO.prototype.matchListIndices=function(e){return this.matchHaystacksIndices(e instanceof CO?e:UO(e))};var WO=[`winter`,`spring`,`summer`,`fall`],GO=(e=new Date)=>({season:WO[Math.floor(e.getMonth()/3)],year:e.getFullYear()}),KO=e=>e.toUpperCase(),qO=(e=new Date)=>{let{season:t,year:n}=GO(e);return{season:KO(t),year:n}},JO=`\\u002d\\u2013\\u2014\\u007e\\uff5e\\u301c`;RegExp(`(?:^|\\s)([${JO}])\\s*[^${JO}]{2,}\\s*\\1\\s*$`),ms.Tv,ms.Movie,ms.Ova,ms.Ona,ms.Special,new Set(SO);var YO=`tracking/v1/`;`${YO}`;var XO=`FKN_E2E_LOCKED`,ZO=`FKN_STORAGE_NOT_FOUND`,QO=`FKN_ACCOUNT_CHANGED`,$O=`fkn:account-changed`,ek=`FKN_ACCOUNT_PIN_UNSUPPORTED`,tk=`FKN has to update before this list can reach your FKN account`,nk=e=>{let t=e?.code,n=e instanceof Error?e.message:String(e);return t===XO?{locked:!0}:t===ZO?{missing:!0}:t===QO||n.startsWith($O)?{changed:!0}:t===ek?{error:tk}:{error:n}};((e,{timeoutMs:t=8e3}={})=>{let n=(e,n)=>new Promise(r=>{let i=setTimeout(()=>r(n),t);new Promise(t=>t(e())).then(e=>{clearTimeout(i),r(e)},()=>{clearTimeout(i),r(n)})}),r=e=>new Promise(n=>{let r=setTimeout(()=>n({error:`FKN storage did not answer`}),t);new Promise(t=>t(e())).then(e=>{clearTimeout(r),n({ok:e})},e=>{clearTimeout(r),n(nk(e))})});return{availability:()=>n(()=>e.availability(),`unknown`),unlocked:()=>n(async()=>(await e.encryption()).unlocked===!0,!1),list:()=>r(async()=>(await e.list()).filter(e=>e.path.startsWith(YO)).map(({path:e,updatedAt:t})=>({path:e,updatedAt:t}))),read:t=>r(async()=>{let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}),write:(t,n)=>r(async()=>(await e.writeFile(t,n),!0))}})({availability:Ee,list:Le,encryption:Re,readFile:e=>we.readFile(e,{encoding:`utf8`}),writeFile:(e,t)=>we.writeFile(e,t)});var rk=()=>ze().catch(()=>!1);j();var ik=x`
1345
+ `,fO=fe(()=>{}),pO=({data:e})=>{let t=L(mO);return k(os,{className:`work-node${e.current?` current`:``}${e.lit?` lit`:``}`,to:`${ps(J.MEDIA,{uri:ve(e.uri)})}${t}`,title:e.title,children:[U(WT,{type:`target`,position:Z.Left}),U(`div`,{className:`title`,children:e.lines.map(e=>U(`div`,{children:e},e))}),e.meta?U(`div`,{className:`meta`,children:e.meta}):void 0,U(WT,{type:`source`,position:Z.Right})]})},mO=fe(``),hO=(e,t,n,r)=>{let i=n>=e,a=Math.max(20,Math.abs(n-e)/2)*(i?1:-1);return`M ${e} ${t} C ${e+a} ${t}, ${n-a} ${r}, ${n} ${r}`},gO=({data:e,sourceX:t,sourceY:n,targetX:r,targetY:i})=>U(`path`,{className:`chain${e?.lit?` lit`:``}`,d:hO(t,n,r,i)}),_O=({id:e,data:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=L(fO),s=t?.label??``,c=t?.lit?` lit`:``,l=(e,t)=>e+(t-e)*.34,u=l(n,i),d=l(r,a)-6,f=s.length*6.4+12;return k(H,{children:[U(`path`,{className:`edge${c}`,d:hO(n,r,i,a)}),k(`g`,{className:`label`,onPointerEnter:()=>o({kind:`edge`,key:e}),onPointerLeave:()=>o(void 0),children:[U(`rect`,{className:`label-hit`,x:u-f/2,y:d-11,width:f,height:15}),U(`text`,{className:`edge-label${c}`,x:u,y:d,children:s})]})]})},vO={work:pO},yO={chain:gO,relation:_O},bO=({franchise:e,currentUris:t})=>{let n=ih($o()),r=V(()=>hh(e),[e]),[i,a]=B(()=>new Set(r.filter(mh))),o=[...i].every(mh)?`story`:`graph`,s=V(()=>Sh(gh(e,e=>!e.format||i.has(e.format)),o),[e,i,o]),[c,l]=B(void 0),u=V(()=>new Set(t),[t]),{nodes:d,edges:f}=V(()=>lO(s,{current:u,hover:c}),[s,u,c]),p=z((e,t)=>l({kind:`node`,uri:t.id}),[]),m=z(()=>l(void 0),[]),h=e=>a(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return k(H,{children:[U(`div`,{className:`bar`,children:U(`div`,{className:`title`,children:`Series`})}),k(`div`,{className:`canvas`,"data-canvas":!0,children:[r.length?k(`div`,{className:`kinds`,onPointerDown:e=>e.stopPropagation(),children:[U(`div`,{className:`legend`,children:`Show`}),r.map(e=>k(`label`,{className:i.has(e)?`on`:void 0,children:[U(`input`,{type:`checkbox`,checked:i.has(e),onChange:()=>h(e)}),U(`span`,{children:Oh(e)})]},e))]}):void 0,U(mO.Provider,{value:n,children:U(fO.Provider,{value:l,children:U(CD,{nodes:d,edges:f,nodeTypes:vO,edgeTypes:yO,onNodeMouseEnter:p,onNodeMouseLeave:m,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!1,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every work in this series, in order`,children:U(AD,{variant:ED.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.14)`})})})})]})]})},xO=({franchise:e,currentUris:t})=>{let[n,r]=B(!1),{refs:i,context:a}=yf({open:n,onOpenChange:r}),{getReferenceProps:o,getFloatingProps:s}=Cf([pf(a),_f(a,{outsidePress:!0}),Tf(a,{role:`dialog`})]);return!e||(e.nodes?.length??0)<2?null:k(H,{children:[k(`button`,{type:`button`,css:uO,ref:i.setReference,...o(),"data-franchise-open":!0,children:[U(il,{}),`See detailed relation graph`]}),n?U(Kd,{children:U(lf,{lockScroll:!0,css:dO,"data-franchise":!0,children:U(rf,{context:a,children:k(`div`,{className:`sheet`,ref:i.setFloating,...s(),children:[U(bO,{franchise:e,currentUris:t}),U(`button`,{type:`button`,className:`close`,"aria-label":`Close`,onClick:()=>r(!1),children:U(bl,{})})]})})})}):void 0]})},SO=`stub.tracking.compact`,CO={targets:{}},wO=()=>{try{return globalThis.localStorage}catch{return}},TO=e=>{try{let t=JSON.parse(e??`null`);return{targets:Object.fromEntries(Object.entries(t?.targets??{}).filter(([,e])=>typeof e==`boolean`))}}catch{return CO}},EO=(e=wO())=>{let t;return{read:()=>{if(t)return t;try{return TO(e?.getItem(SO))}catch{return CO}},write:n=>{try{if(!e)throw Error(`No storage`);e.setItem(SO,JSON.stringify(n)),t=void 0}catch{t=n}}}},DO=[`mal`,`anilist`,`kitsu`,`anidb`],OO=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,AO.unregister(this),e}free(){let e=this.__destroy_into_raw();$.__wbg_haystacks_free(e,0)}bytesView(){return $.haystacks_bytesView(this.__wbg_ptr)}clear(){$.haystacks_clear(this.__wbg_ptr)}commit(e,t){let n=$.haystacks_commit(this.__wbg_ptr,e,t);if(n[1])throw VO(n[0])}get length(){return $.haystacks_length(this.__wbg_ptr)>>>0}constructor(e){var t=RO(e)?0:zO(e,$.__wbindgen_malloc),n=UO;let r=$.haystacks_new(t,n);return this.__wbg_ptr=r,AO.register(this,this.__wbg_ptr,this),this}offsetsView(){return $.haystacks_offsetsView(this.__wbg_ptr)}push(e){let t=zO(e,$.__wbindgen_malloc),n=UO;$.haystacks_push(this.__wbg_ptr,t,n)}reserve(e,t){$.haystacks_reserve(this.__wbg_ptr,e,t)}};Symbol.dispose&&(OO.prototype[Symbol.dispose]=OO.prototype.free);var kO=class e{static __wrap(t){let n=Object.create(e.prototype);return n.__wbg_ptr=t,jO.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,jO.unregister(this),e}free(){let e=this.__destroy_into_raw();$.__wbg_matcher_free(e,0)}static fromPatterns(t,n){let r=$.matcher_fromPatterns(t,RO(n)?0:MO(n));if(r[2])throw VO(r[1]);return e.__wrap(r[0])}static fromQuery(t,n){let r=BO(t,$.__wbindgen_malloc,$.__wbindgen_realloc),i=UO,a=$.matcher_fromQuery(r,i,RO(n)?0:MO(n));if(a[2])throw VO(a[1]);return e.__wrap(a[0])}matchHaystacks(e){return NO(e,OO),$.matcher_matchHaystacks(this.__wbg_ptr,e.__wbg_ptr)}matchHaystacksIndices(e){return NO(e,OO),$.matcher_matchHaystacksIndices(this.__wbg_ptr,e.__wbg_ptr)}matchList(e){let t=zO(e,$.__wbindgen_malloc),n=UO;return $.matcher_matchList(this.__wbg_ptr,t,n)}matchListIndices(e){let t=zO(e,$.__wbindgen_malloc),n=UO;return $.matcher_matchListIndices(this.__wbg_ptr,t,n)}matchOne(e,t){let n=BO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=UO;return $.matcher_matchOne(this.__wbg_ptr,n,r,t)}matchOneIndices(e,t){let n=BO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=UO;return $.matcher_matchOneIndices(this.__wbg_ptr,n,r,t)}constructor(e,t){let n=BO(e,$.__wbindgen_malloc,$.__wbindgen_realloc),r=UO,i=$.matcher_new(n,r,RO(t)?0:MO(t));if(i[2])throw VO(i[1]);return this.__wbg_ptr=i[0],jO.register(this,this.__wbg_ptr,this),this}setConfig(e){let t=$.matcher_setConfig(this.__wbg_ptr,e);if(t[1])throw VO(t[0])}setPattern(e){let t=$.matcher_setPattern(this.__wbg_ptr,e);if(t[1])throw VO(t[0])}setPatterns(e){let t=$.matcher_setPatterns(this.__wbg_ptr,e);if(t[1])throw VO(t[0])}};Symbol.dispose&&(kO.prototype[Symbol.dispose]=kO.prototype.free);var AO=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>$.__wbg_haystacks_free(e,1)),jO=typeof FinalizationRegistry>`u`?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>$.__wbg_matcher_free(e,1));function MO(e){let t=$.__externref_table_alloc();return $.__wbindgen_externrefs.set(t,e),t}function NO(e,t){if(!(e instanceof t))throw Error(`expected instance of ${t.name}`)}var PO=null;function FO(){return(PO===null||PO.buffer.detached===!0||PO.buffer.detached===void 0&&PO.buffer!==$.memory.buffer)&&(PO=new DataView($.memory.buffer)),PO}var IO=null;function LO(){return(IO===null||IO.byteLength===0)&&(IO=new Uint8Array($.memory.buffer)),IO}function RO(e){return e==null}function zO(e,t){let n=t(e.length*4,4)>>>0;for(let t=0;t<e.length;t++){let r=MO(e[t]);FO().setUint32(n+4*t,r,!0)}return UO=e.length,n}function BO(e,t,n){if(n===void 0){let n=HO.encode(e),r=t(n.length,1)>>>0;return LO().subarray(r,r+n.length).set(n),UO=n.length,r}let r=e.length,i=t(r,1)>>>0,a=LO(),o=0;for(;o<r;o++){let t=e.charCodeAt(o);if(t>127)break;a[i+o]=t}if(o!==r){o!==0&&(e=e.slice(o)),i=n(i,r,r=o+e.length*3,1)>>>0;let t=LO().subarray(i+o,i+r),a=HO.encodeInto(e,t);o+=a.written,i=n(i,r,o,1)>>>0}return UO=o,i}function VO(e){let t=$.__wbindgen_externrefs.get(e);return $.__externref_table_dealloc(e),t}new TextDecoder(`utf-8`,{ignoreBOM:!0,fatal:!0}).decode();var HO=new TextEncoder;`encodeInto`in HO||(HO.encodeInto=function(e,t){let n=HO.encode(e);return t.set(n),{read:e.length,written:n.length}});var UO=0,$,WO=new TextEncoder;function GO(e,t){let n=0;for(let e of t)n+=e.length*3;e.reserve(n,t.length);let r=e.bytesView(),i=e.offsetsView(),a=0;for(let e=0;e<t.length;e++)a+=WO.encodeInto(t[e],r.subarray(a)).written,i[e]=a;return e.commit(a,t.length),e}var KO=class extends OO{constructor(e){super(),e?.length&&GO(this,e)}push(e){GO(this,e)}},qO;function JO(e){return qO??=new KO,qO.clear(),GO(qO,e)}kO.prototype.matchList=function(e){return this.matchHaystacks(e instanceof OO?e:JO(e))},kO.prototype.matchListIndices=function(e){return this.matchHaystacksIndices(e instanceof OO?e:JO(e))};var YO=[`winter`,`spring`,`summer`,`fall`],XO=(e=new Date)=>({season:YO[Math.floor(e.getMonth()/3)],year:e.getFullYear()}),ZO=e=>e.toUpperCase(),QO=(e=new Date)=>{let{season:t,year:n}=XO(e);return{season:ZO(t),year:n}},$O=`\\u002d\\u2013\\u2014\\u007e\\uff5e\\u301c`;RegExp(`(?:^|\\s)([${$O}])\\s*[^${$O}]{2,}\\s*\\1\\s*$`),ys.Tv,ys.Movie,ys.Ova,ys.Ona,ys.Special,new Set(DO);var ek=`tracking/v1/`;`${ek}`;var tk=`FKN_E2E_LOCKED`,nk=`FKN_STORAGE_NOT_FOUND`,rk=`FKN_ACCOUNT_CHANGED`,ik=`fkn:account-changed`,ak=`FKN_ACCOUNT_PIN_UNSUPPORTED`,ok=`FKN has to update before this list can reach your FKN account`,sk=e=>{let t=e?.code,n=e instanceof Error?e.message:String(e);return t===tk?{locked:!0}:t===nk?{missing:!0}:t===rk||n.startsWith(ik)?{changed:!0}:t===ak?{error:ok}:{error:n}};((e,{timeoutMs:t=8e3}={})=>{let n=(e,n)=>new Promise(r=>{let i=setTimeout(()=>r(n),t);new Promise(t=>t(e())).then(e=>{clearTimeout(i),r(e)},()=>{clearTimeout(i),r(n)})}),r=e=>new Promise(n=>{let r=setTimeout(()=>n({error:`FKN storage did not answer`}),t);new Promise(t=>t(e())).then(e=>{clearTimeout(r),n({ok:e})},e=>{clearTimeout(r),n(sk(e))})});return{availability:()=>n(()=>e.availability(),`unknown`),unlocked:()=>n(async()=>(await e.encryption()).unlocked===!0,!1),list:()=>r(async()=>(await e.list()).filter(e=>e.path.startsWith(ek)).map(({path:e,updatedAt:t})=>({path:e,updatedAt:t}))),read:t=>r(async()=>{let n=await e.readFile(t);return typeof n==`string`?n:new TextDecoder().decode(n)}),write:(t,n)=>r(async()=>(await e.writeFile(t,n),!0))}})({availability:Ee,list:Le,encryption:Re,readFile:e=>we.readFile(e,{encoding:`utf8`}),writeFile:(e,t)=>we.writeFile(e,t)});var ck=()=>ze().catch(()=>!1);j();var lk=x`
1346
1346
  display: flex;
1347
1347
  flex-direction: column;
1348
1348
  gap: 0.8rem;
@@ -1369,7 +1369,7 @@ transition: max-height 0.3s ease-in-out;
1369
1369
  &:hover { background: rgba(255, 255, 255, 0.08); }
1370
1370
  &:disabled { opacity: 0.5; cursor: default; }
1371
1371
  }
1372
- `,ak=e=>e===1?`1 entry`:`${e} entries`,ok=({storage:e,onUnlock:t,onAdd:n})=>{let[r,i]=B(!1);if(!e)return null;let a=e=>async()=>{i(!0);try{await e()}finally{i(!1)}},o=e.location===`ACCOUNT`,s=e.signedIn===!0&&e.locked,c=e.held===1,l=[s?k(`div`,{className:`line`,children:[k(`span`,{children:[`Stub: your FKN account's list is locked on this device`,o?`, and changes wait here until it opens.`:`, so this device keeps its own list for now.`]}),U(`button`,{type:`button`,disabled:r,onClick:a(t),children:`Unlock`})]},`locked`):void 0,o&&!s&&e.held>0?k(`div`,{className:`line`,children:[k(`span`,{children:[`Stub: `,ak(e.held),` saved on this device before you signed in `,c?`stays`:`stay`,` on this device, apart from your FKN account's list, and `,c?`comes`:`come`,` back if you sign out.`]}),U(`button`,{type:`button`,disabled:r,onClick:a(n),children:`Add to my FKN account`})]},`held`):void 0,o&&!s&&e.waiting?U(`div`,{className:`line`,children:`Stub: some changes have not reached your FKN account yet.`},`waiting`):void 0,e.error?k(`div`,{className:`line problem`,children:[`Stub: `,e.error]},`error`):void 0].filter(Boolean);return l.length?U(`div`,{css:ik,className:`stub-list-notice`,role:`status`,children:l}):null},sk={WATCHING:`Watching`,REWATCHING:`Rewatching`,PLANNING:`Plan to watch`,COMPLETED:`Completed`,PAUSED:`Paused`,DROPPED:`Dropped`},ck=new Set([`LISTED`,`NOT_LISTED`]),lk=e=>e.tracker.canWrite&&ck.has(e.state),uk=(e,t)=>{let n=e?.summary;return{status:n?.status??null,progress:n?.progress??0,score:wr(n?.score)?n.score:null,total:n?.episodeCount??t??null,differs:[...e?.disagreements??[]]}},dk=e=>e.entry?.episodeCount??e.episodeCount,fk=(e,t)=>({status:e.entry?.status??null,progress:e.entry?.progress??0,score:wr(e.entry?.score)?e.entry.score:null,total:dk(e)??t,differs:[]}),pk=(e,t={})=>({...e,...t.status===void 0?{}:{status:t.status},...t.progress===void 0?{}:{progress:t.progress},...t.score===void 0?{}:{score:t.score}}),mk=(e,t)=>{let n={...e};return n.status===t.status&&delete n.status,n.progress===t.progress&&delete n.progress,n.score!==void 0&&(n.score??null)===t.score&&delete n.score,n},hk=(e,t)=>{switch(e.state){case`SIGNED_OUT`:return{kind:`login`};case`NO_ID`:return{kind:`cannot`,reason:`Has no id for this media`};case`AMBIGUOUS`:return{kind:`cannot`,reason:`Names ${e.candidates.join(` and `)}, cannot tell which`}}if(!e.tracker.canWrite)return{kind:`cannot`,reason:`Is read only`};let n=t??!0;return{kind:`check`,checked:n,sendable:n&&lk(e)}},gk=(e,t)=>{let n=dk(e);return n!=null&&t!=null&&n!==t},_k=(e,t,n)=>{if(t.remove)return e.state===`LISTED`?{remove:!0}:void 0;let r=`score`in t?t.score:n.score,i=e.state===`LISTED`?{...t}:{status:t.status??n.status??`WATCHING`,progress:t.progress??n.progress,...wr(r)?{score:r}:{}};return i.progress!==void 0&&(gk(e,n.total)?delete i.progress:i.progress=Math.max(0,Math.min(n.total??1/0,i.progress))),Object.keys(i).length?i:void 0},vk={POINT_3:[30,50,85],POINT_5:[20,40,60,80,100],POINT_10:[10,20,30,40,50,60,70,80,90,100],POINT_10_DECIMAL:[10,20,30,40,50,60,70,80,90,100],POINT_100:[10,20,30,40,50,60,70,80,90,100]},yk=e=>{if(!e.length)return;let t=e.map(e=>e&&vk[e]?e:`POINT_100`);return{scale:t.reduce((e,t)=>Dr(e,t)??`POINT_100`,`POINT_100`),mixed:new Set(t).size>1}},bk=(e,t)=>Er(e,t),xk=(e,t)=>t?e?.remove||t.remove?t:{...e,...t}:e??{},Sk=({send:e,onChange:t=()=>{},delay:n=1e3,timers:r={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)}})=>{let i=new Map,a=new Map,o=new Set,s=new Map,c=new Map,l=new Map,u,d=n=>{let r=i.get(n);if(!r||!o.has(n)||s.has(n))return;i.delete(n),a.delete(n),o.delete(n),s.set(n,r);let u=(e,a)=>{if(s.delete(n),e===`SAVED`||e===`QUEUED`)c.delete(n);else if(e===`REFUSED`)l.set(n,a??`Refused`);else{c.set(n,{fields:r,error:a??`Did not save`});let e=i.get(n);e&&i.set(n,xk(r,e))}t({tracker:n,outcome:e,fields:r,error:a}),d(n)};e(n,r).then(({outcome:e,error:t})=>u(e,t),e=>u(`FAILED`,e instanceof Error?e.message:String(e))),t()},f=()=>{u!==void 0&&r.clear(u),u=void 0;for(let e of i.keys())o.add(e);for(let e of[...o])d(e)};return{stage:(e,o,s=!1)=>{for(let[t,n]of Object.entries(e)){let e=c.get(t)?.fields;c.delete(t),l.delete(t),i.set(t,xk(xk(e,i.get(t)),n)),s&&a.set(t,xk(a.get(t),n))}o?f():(u!==void 0&&r.clear(u),u=r.set(f,n),t())},flush:f,fail:(e,n,r)=>{c.set(e,{fields:xk(c.get(e)?.fields,n),error:r}),t({tracker:e,outcome:`FAILED`,fields:n,error:r})},retry:e=>{let n=c.get(e);n&&(c.delete(e),i.set(e,xk(n.fields,i.get(e))),o.add(e),d(e),t())},drop:e=>{let n=a.get(e);n?i.set(e,n):(i.delete(e),o.delete(e)),c.delete(e),l.delete(e),t()},dismiss:e=>{l.delete(e),t()},state:e=>({busy:s.has(e)||i.has(e),failed:c.get(e),refused:l.get(e)}),idle:()=>!s.size&&!i.size}};j();var Ck=[Wc,Xc,sl],wk=[`bad`,`neutral`,`good`],Tk={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10,POINT_100:100},Ek=x`
1372
+ `,uk=e=>e===1?`1 entry`:`${e} entries`,dk=({storage:e,onUnlock:t,onAdd:n})=>{let[r,i]=B(!1);if(!e)return null;let a=e=>async()=>{i(!0);try{await e()}finally{i(!1)}},o=e.location===`ACCOUNT`,s=e.signedIn===!0&&e.locked,c=e.held===1,l=[s?k(`div`,{className:`line`,children:[k(`span`,{children:[`Stub: your FKN account's list is locked on this device`,o?`, and changes wait here until it opens.`:`, so this device keeps its own list for now.`]}),U(`button`,{type:`button`,disabled:r,onClick:a(t),children:`Unlock`})]},`locked`):void 0,o&&!s&&e.held>0?k(`div`,{className:`line`,children:[k(`span`,{children:[`Stub: `,uk(e.held),` saved on this device before you signed in `,c?`stays`:`stay`,` on this device, apart from your FKN account's list, and `,c?`comes`:`come`,` back if you sign out.`]}),U(`button`,{type:`button`,disabled:r,onClick:a(n),children:`Add to my FKN account`})]},`held`):void 0,o&&!s&&e.waiting?U(`div`,{className:`line`,children:`Stub: some changes have not reached your FKN account yet.`},`waiting`):void 0,e.error?k(`div`,{className:`line problem`,children:[`Stub: `,e.error]},`error`):void 0].filter(Boolean);return l.length?U(`div`,{css:lk,className:`stub-list-notice`,role:`status`,children:l}):null},fk={WATCHING:`Watching`,REWATCHING:`Rewatching`,PLANNING:`Plan to watch`,COMPLETED:`Completed`,PAUSED:`Paused`,DROPPED:`Dropped`},pk=new Set([`LISTED`,`NOT_LISTED`]),mk=e=>e.tracker.canWrite&&pk.has(e.state),hk=(e,t)=>{let n=e?.summary;return{status:n?.status??null,progress:n?.progress??0,score:kr(n?.score)?n.score:null,total:n?.episodeCount??t??null,differs:[...e?.disagreements??[]]}},gk=e=>e.entry?.episodeCount??e.episodeCount,_k=(e,t)=>({status:e.entry?.status??null,progress:e.entry?.progress??0,score:kr(e.entry?.score)?e.entry.score:null,total:gk(e)??t,differs:[]}),vk=(e,t={})=>({...e,...t.status===void 0?{}:{status:t.status},...t.progress===void 0?{}:{progress:t.progress},...t.score===void 0?{}:{score:t.score}}),yk=(e,t)=>{let n={...e};return n.status===t.status&&delete n.status,n.progress===t.progress&&delete n.progress,n.score!==void 0&&(n.score??null)===t.score&&delete n.score,n},bk=(e,t)=>{switch(e.state){case`SIGNED_OUT`:return{kind:`login`};case`NO_ID`:return{kind:`cannot`,reason:`Has no id for this media`};case`AMBIGUOUS`:return{kind:`cannot`,reason:`Names ${e.candidates.join(` and `)}, cannot tell which`}}if(!e.tracker.canWrite)return{kind:`cannot`,reason:`Is read only`};let n=t??!0;return{kind:`check`,checked:n,sendable:n&&mk(e)}},xk=(e,t)=>{let n=gk(e);return n!=null&&t!=null&&n!==t},Sk=(e,t,n)=>{if(t.remove)return e.state===`LISTED`?{remove:!0}:void 0;let r=`score`in t?t.score:n.score,i=e.state===`LISTED`?{...t}:{status:t.status??n.status??`WATCHING`,progress:t.progress??n.progress,...kr(r)?{score:r}:{}};return i.progress!==void 0&&(xk(e,n.total)?delete i.progress:i.progress=Math.max(0,Math.min(n.total??1/0,i.progress))),Object.keys(i).length?i:void 0},Ck={POINT_3:[30,50,85],POINT_5:[20,40,60,80,100],POINT_10:[10,20,30,40,50,60,70,80,90,100],POINT_10_DECIMAL:[10,20,30,40,50,60,70,80,90,100],POINT_100:[10,20,30,40,50,60,70,80,90,100]},wk=e=>{if(!e.length)return;let t=e.map(e=>e&&Ck[e]?e:`POINT_100`);return{scale:t.reduce((e,t)=>Mr(e,t)??`POINT_100`,`POINT_100`),mixed:new Set(t).size>1}},Tk=(e,t)=>jr(e,t),Ek=(e,t)=>t?e?.remove||t.remove?t:{...e,...t}:e??{},Dk=({send:e,onChange:t=()=>{},delay:n=1e3,timers:r={set:(e,t)=>setTimeout(e,t),clear:e=>clearTimeout(e)}})=>{let i=new Map,a=new Map,o=new Set,s=new Map,c=new Map,l=new Map,u,d=n=>{let r=i.get(n);if(!r||!o.has(n)||s.has(n))return;i.delete(n),a.delete(n),o.delete(n),s.set(n,r);let u=(e,a)=>{if(s.delete(n),e===`SAVED`||e===`QUEUED`)c.delete(n);else if(e===`REFUSED`)l.set(n,a??`Refused`);else{c.set(n,{fields:r,error:a??`Did not save`});let e=i.get(n);e&&i.set(n,Ek(r,e))}t({tracker:n,outcome:e,fields:r,error:a}),d(n)};e(n,r).then(({outcome:e,error:t})=>u(e,t),e=>u(`FAILED`,e instanceof Error?e.message:String(e))),t()},f=()=>{u!==void 0&&r.clear(u),u=void 0;for(let e of i.keys())o.add(e);for(let e of[...o])d(e)};return{stage:(e,o,s=!1)=>{for(let[t,n]of Object.entries(e)){let e=c.get(t)?.fields;c.delete(t),l.delete(t),i.set(t,Ek(Ek(e,i.get(t)),n)),s&&a.set(t,Ek(a.get(t),n))}o?f():(u!==void 0&&r.clear(u),u=r.set(f,n),t())},flush:f,fail:(e,n,r)=>{c.set(e,{fields:Ek(c.get(e)?.fields,n),error:r}),t({tracker:e,outcome:`FAILED`,fields:n,error:r})},retry:e=>{let n=c.get(e);n&&(c.delete(e),i.set(e,Ek(n.fields,i.get(e))),o.add(e),d(e),t())},drop:e=>{let n=a.get(e);n?i.set(e,n):(i.delete(e),o.delete(e)),c.delete(e),l.delete(e),t()},dismiss:e=>{l.delete(e),t()},state:e=>({busy:s.has(e)||i.has(e),failed:c.get(e),refused:l.get(e)}),idle:()=>!s.size&&!i.size}};j();var Ok=[Yc,tl,fl],kk=[`bad`,`neutral`,`good`],Ak={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10,POINT_100:100},jk=x`
1373
1373
  position: relative;
1374
1374
  display: flex;
1375
1375
 
@@ -1394,7 +1394,7 @@ transition: max-height 0.3s ease-in-out;
1394
1394
  .caption { font-size: 1.2rem; color: rgba(255, 255, 255, 0.6); }
1395
1395
  .exact { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; color: rgba(255, 255, 255, 0.6); }
1396
1396
  .exact input { width: 7rem; }
1397
- `,Dk=({score:e,scale:t,size:n=16})=>{let r=Tr(e,t);if(t===`POINT_3`){let e=Ck[r-1]??Xc;return U(e,{size:n,"aria-hidden":`true`})}return U(`span`,{className:`value`,children:r})},Ok=(e,t)=>{let n=Tr(e,t);return t===`POINT_3`?`${n} out of 3 (${wk[n-1]})`:`${n} out of ${Tk[t]??100}`},kk=({score:e,scale:t,mixed:n,disabled:r,disabledTitle:i,onPick:a})=>{let[o,s]=B(!1),[c,l]=B(``),u=R(null),d=R(null),{refs:f,floatingStyles:p}=mf({open:o,placement:`bottom-start`,whileElementsMounted:_,middleware:[Wu(6),Ku({padding:8})]}),m=Ju([d,f.setReference]),h=wr(e),g=h?Tr(e,t):void 0,v=()=>{s(!1),d.current?.focus()},y=e=>{a(e),v()};O(()=>{if(!o)return;u.current?.querySelector(`.menu button[aria-pressed="true"], .menu button`)?.focus();let e=e=>{u.current?.contains(e.target)||s(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[o]);let b=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),v();return}let t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(!t||e.target.tagName===`INPUT`)return;let n=[...u.current.querySelectorAll(`.menu button, .menu input`)];n[(n.indexOf(document.activeElement)+t+n.length)%n.length]?.focus(),e.preventDefault()},x=t===`POINT_10_DECIMAL`,S=()=>{let e=Number(c);c!==``&&Number.isFinite(e)&&y(bk(Math.min(100,Math.max(1,Math.round(x?e*10:e))),t))};return k(`span`,{css:Ek,ref:u,children:[k(`button`,{ref:m,type:`button`,className:`star`,"aria-label":`Score, ${h?Ok(e,t):`none`}`,"aria-haspopup":`dialog`,"aria-expanded":o,title:r?i:void 0,disabled:r,onClick:()=>s(e=>!e),children:[U(cl,{size:18,"aria-hidden":`true`,fill:h?`#facc15`:`none`,color:h?`#facc15`:`rgba(255, 255, 255, 0.45)`}),h?U(Dk,{score:e,scale:t}):void 0]}),o?k(`div`,{ref:f.setFloating,style:p,className:`menu`,role:`dialog`,"aria-label":`Score`,onKeyDown:b,children:[U(`div`,{className:`grid${t===`POINT_3`?` faces`:``}`,children:vk[t].map((e,n)=>{let r=Tr(e,t),i=Ck[n];return U(`button`,{type:`button`,"aria-label":Ok(e,t),"aria-pressed":g===r,onClick:()=>y(bk(e,t)),children:t===`POINT_3`&&i?U(i,{size:16,"aria-hidden":`true`}):t===`POINT_100`?e/10:r},e)})}),t===`POINT_100`||x?k(`label`,{className:`exact`,children:[`Exact`,U(`input`,{type:`number`,name:`score-exact`,min:x?.1:1,max:x?10:100,step:x?.1:1,value:c,onInput:e=>l(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&S()}})]}):void 0,n?k(`span`,{className:`caption`,children:[`Out of `,Tk[t],`, the finest scale every checked list keeps`]}):void 0,h?U(`button`,{type:`button`,onClick:()=>y(null),children:`No score`}):void 0]}):void 0]})};j();var Ak={blocked:()=>`The browser blocked the sign-in window. Allow pop-ups for this page and press Log in again.`,unsupported:e=>`Sign in to ${e} in this browser, then press Log in again.`},jk=x`
1397
+ `,Mk=({score:e,scale:t,size:n=16})=>{let r=Ar(e,t);if(t===`POINT_3`){let e=Ok[r-1]??tl;return U(e,{size:n,"aria-hidden":`true`})}return U(`span`,{className:`value`,children:r})},Nk=(e,t)=>{let n=Ar(e,t);return t===`POINT_3`?`${n} out of 3 (${kk[n-1]})`:`${n} out of ${Ak[t]??100}`},Pk=({score:e,scale:t,mixed:n,disabled:r,disabledTitle:i,onPick:a})=>{let[o,s]=B(!1),[c,l]=B(``),u=R(null),d=R(null),{refs:f,floatingStyles:p}=yf({open:o,placement:`bottom-start`,whileElementsMounted:_,middleware:[Yu(6),Zu({padding:8})]}),m=$u([d,f.setReference]),h=kr(e),g=h?Ar(e,t):void 0,v=()=>{s(!1),d.current?.focus()},y=e=>{a(e),v()};O(()=>{if(!o)return;u.current?.querySelector(`.menu button[aria-pressed="true"], .menu button`)?.focus();let e=e=>{u.current?.contains(e.target)||s(!1)};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[o]);let b=e=>{if(e.key===`Escape`){e.preventDefault(),e.stopPropagation(),v();return}let t={ArrowRight:1,ArrowDown:1,ArrowLeft:-1,ArrowUp:-1}[e.key];if(!t||e.target.tagName===`INPUT`)return;let n=[...u.current.querySelectorAll(`.menu button, .menu input`)];n[(n.indexOf(document.activeElement)+t+n.length)%n.length]?.focus(),e.preventDefault()},x=t===`POINT_10_DECIMAL`,S=()=>{let e=Number(c);c!==``&&Number.isFinite(e)&&y(Tk(Math.min(100,Math.max(1,Math.round(x?e*10:e))),t))};return k(`span`,{css:jk,ref:u,children:[k(`button`,{ref:m,type:`button`,className:`star`,"aria-label":`Score, ${h?Nk(e,t):`none`}`,"aria-haspopup":`dialog`,"aria-expanded":o,title:r?i:void 0,disabled:r,onClick:()=>s(e=>!e),children:[U(pl,{size:18,"aria-hidden":`true`,fill:h?`#facc15`:`none`,color:h?`#facc15`:`rgba(255, 255, 255, 0.45)`}),h?U(Mk,{score:e,scale:t}):void 0]}),o?k(`div`,{ref:f.setFloating,style:p,className:`menu`,role:`dialog`,"aria-label":`Score`,onKeyDown:b,children:[U(`div`,{className:`grid${t===`POINT_3`?` faces`:``}`,children:Ck[t].map((e,n)=>{let r=Ar(e,t),i=Ok[n];return U(`button`,{type:`button`,"aria-label":Nk(e,t),"aria-pressed":g===r,onClick:()=>y(Tk(e,t)),children:t===`POINT_3`&&i?U(i,{size:16,"aria-hidden":`true`}):t===`POINT_100`?e/10:r},e)})}),t===`POINT_100`||x?k(`label`,{className:`exact`,children:[`Exact`,U(`input`,{type:`number`,name:`score-exact`,min:x?.1:1,max:x?10:100,step:x?.1:1,value:c,onInput:e=>l(e.currentTarget.value),onKeyDown:e=>{e.key===`Enter`&&S()}})]}):void 0,n?k(`span`,{className:`caption`,children:[`Out of `,Ak[t],`, the finest scale every checked list keeps`]}):void 0,h?U(`button`,{type:`button`,onClick:()=>y(null),children:`No score`}):void 0]}):void 0]})};j();var Fk={blocked:()=>`The browser blocked the sign-in window. Allow pop-ups for this page and press Log in again.`,unsupported:e=>`Sign in to ${e} in this browser, then press Log in again.`},Ik=x`
1398
1398
  margin-top: 2rem;
1399
1399
  display: flex;
1400
1400
  flex-direction: column;
@@ -1528,7 +1528,7 @@ transition: max-height 0.3s ease-in-out;
1528
1528
  .chip > label { margin: 0 -0.4rem; padding: 0 0.4rem; }
1529
1529
  .chip .login-button { padding: 0 0.6rem; }
1530
1530
  }
1531
- `,Mk={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10},Nk=(e,t)=>{let n=t??`POINT_100`;return`${Tr(e,n)} / ${Mk[n]??100}`},Pk=e=>e.error||(e.state===`PAUSED`?`Paused for a while`:`Could not answer`),Fk=`REMOVE`,Ik=``,Lk=e=>e.remove?`the removal`:[e.status===void 0?void 0:`the status`,e.progress===void 0?void 0:`episode ${e.progress}`,e.score===void 0?void 0:`the score`].filter(Boolean).join(` and `),Rk=({answer:e})=>U(`span`,{className:`logo`,style:e.tracker.color?{color:e.tracker.color}:void 0,children:e.tracker.icon?U(`img`,{src:e.tracker.icon,alt:``}):e.tracker.name.slice(0,1)}),zk=({name:e,shown:t,scale:n,mixed:r,disabled:i,disabledTitle:a,listed:o,removable:s,onChange:c,dots:l={}})=>{let[u,d]=B(),f=R(void 0),p=R(()=>{}),m=t.total,h=()=>{if(clearTimeout(f.current),u===void 0)return;let e=Number(u);if(d(void 0),u.trim()===``||!Number.isFinite(e))return;let n=Math.max(0,Math.min(m??1/0,Math.floor(e)));n!==t.progress&&c({progress:n},!0)};return p.current=h,k(`div`,{className:`group edit`,children:[U(kk,{score:t.score,scale:n,mixed:r,disabled:i||!o&&!t.status&&!t.progress,disabledTitle:i?a:`Pick a status or add an episode first`,onPick:e=>c({score:e},!0)}),l.SCORE,k(`select`,{name:`${e}-status`,"aria-label":`Status`,value:t.status??``,disabled:i,onChange:e=>{let t=e.currentTarget.value;c(t===Fk?{remove:!0}:{status:t},!0)},children:[t.status?void 0:U(`option`,{value:``,disabled:!0,children:`Add to list`}),Object.entries(sk).map(([e,t])=>U(`option`,{value:e,children:t},e)),s?U(`option`,{value:Fk,children:`Remove from list`}):void 0]}),l.STATUS,k(`span`,{className:`progress-field`,children:[U(`label`,{for:`${e}-progress`,className:`word`,children:`Episodes`}),U(`input`,{id:`${e}-progress`,type:`number`,inputMode:`numeric`,name:`${e}-progress`,min:0,max:m??void 0,disabled:i,value:u??t.progress,onInput:e=>{d(e.currentTarget.value),clearTimeout(f.current),f.current=setTimeout(()=>p.current(),1e3)},onBlur:h,onKeyDown:e=>{e.key===`Enter`&&h(),e.key===`Escape`&&(clearTimeout(f.current),d(void 0),e.stopPropagation())}}),m?k(`span`,{className:`of`,children:[`/ `,m]}):void 0,l.PROGRESS,U(`button`,{type:`button`,className:`more`,"aria-label":`One episode more`,disabled:i||m!=null&&t.progress>=m,onClick:()=>c({progress:t.progress+1},!1),children:U(nl,{size:14,"aria-hidden":`true`})})]}),!i&&m&&t.progress===m&&t.status!==`COMPLETED`?U(`button`,{type:`button`,onClick:()=>c({status:`COMPLETED`},!0),children:`Mark completed`}):void 0,!i&&m&&t.status===`COMPLETED`&&t.progress<m?k(`button`,{type:`button`,onClick:()=>c({progress:m},!0),children:[`Set `,m,` / `,m]}):void 0]})},Bk=({answer:e,className:t,busy:n,open:r,onOpen:i,card:a,children:o})=>{let s=R(null),{refs:c,floatingStyles:l,context:u}=mf({open:r,onOpenChange:(e,t,n)=>{let r=c.floating.current?.contains(document.activeElement)??!1;(e||!r||n!==`hover`&&n!==`safe-polygon`)&&(e&&n===`hover`&&document.activeElement?.closest(`[data-card]`)||(!e&&r&&n===`escape-key`&&s.current?.focus(),i(e)))},placement:`bottom-end`,strategy:`fixed`,whileElementsMounted:_,middleware:[Wu(8),Ku({padding:8}),Gu({padding:8})]}),d=cf(u),{getReferenceProps:f,getFloatingProps:p}=vf([bd(u,{mouseOnly:!0,delay:{open:100},handleClose:kf()}),gf(u),ff(u)]),m=e.tracker.name;return k(`span`,{ref:c.setReference,className:t,"data-chip":e.tracker.id,"aria-busy":n?`true`:void 0,...f(),children:[U(`button`,{ref:s,type:`button`,className:`logo-button`,"aria-label":`${m} entry`,"aria-haspopup":`dialog`,"aria-expanded":r,...d.reference,children:U(Rk,{answer:e})}),o,r?U(`div`,{ref:c.setFloating,style:l,className:`card`,role:`dialog`,"aria-label":`${m} entry`,"data-card":e.tracker.id,...p(),children:a()}):void 0]})},Vk=({tracking:e,episodeCount:t,onSaveFields:n,onRemove:r,signIns:i={},prefs:a,onPrefs:o})=>{let[,s]=B(0),[c,l]=B({}),[u,d]=B(``),[f,p]=B(new Set),[m,h]=B({}),[g,_]=B(),v=R({onSaveFields:n,onRemove:r,tracking:e});v.current={onSaveFields:n,onRemove:r,tracking:e};let y=V(()=>Sk({send:async(e,t)=>{let n=await(t.remove?v.current.onRemove([e]):v.current.onSaveFields([e],t));return n.find(t=>t.tracker===e)??n[0]??{outcome:`FAILED`,error:`The write did not reach the trackers`}},onChange:e=>{if(s(e=>e+1),!e)return;let t=v.current.tracking?.answers.find(t=>t.tracker.id===e.tracker)?.tracker.name??e.tracker,n=e.outcome===`SAVED`||e.outcome===`QUEUED`;d(n?`${e.fields.remove?`Removed from`:`Saved to`} ${t}`:`${t} did not save: ${e.error??e.outcome.toLowerCase()}`),!n&&y.idle()&&l({})}}),[]);O(()=>{let e=()=>{document.visibilityState===`hidden`&&y.flush()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),y.flush()}},[]);let b=uk(e,t),x=t=>{let n=e?.answers.find(e=>e.tracker.id===t);return n&&fk(n,b.total)};if(O(()=>{l(e=>y.idle()?{}:Object.fromEntries(Object.entries(e).flatMap(([e,t])=>{let n=e===Ik?b:x(e);return n?[[e,mk(t,n)]]:[]})))},[e]),!e?.answers.length)return null;let S=pk(b,c[Ik]),C=e.answers,w=C.map(e=>({answer:e,target:hk(e,a.targets[e.tracker.id])})),T=w.filter(({target:e})=>e.kind===`check`&&e.sendable).map(({answer:e})=>e),E=!T.length,D=yk(T.map(e=>e.tracker.scoreScale)),A=(e,t)=>{t.remove||l(n=>({...n,[e]:{...n[e],...t}}))},j=(e,t)=>{A(Ik,e);let n={...S,...e},r={};for(let{answer:t,target:i}of w){if(i.kind!==`check`||!i.checked)continue;let a=t.tracker.id;if(!lk(t)){y.fail(a,e,Pk(t));continue}let o=_k(t,e,n);o&&(r[a]=o)}y.stage(r,t)},M=(e,t,n)=>{let r=e.tracker.id,i=pk(fk(e,b.total),c[r]);A(r,t);let a=_k(e,t,{...i,...t});a&&y.stage({[r]:a},n,!0)},N=e=>{let t=y.state(e.tracker.id);return t.failed?.fields.remove&&e.state===`NOT_LISTED`?{...t,failed:void 0}:t},P=(e,t)=>{t||y.drop(e),o({...a,targets:{...a.targets,[e]:t}})},ee=e=>{let t=i[e.tracker.id],n=e.tracker.id;if(!t||f.has(n))return;let r=t();p(e=>new Set(e).add(n)),h(({[n]:e,...t})=>t),r.then(t=>Ak[t]?.(e.tracker.name),e=>e instanceof Error?e.message:String(e)).then(e=>{e&&h(t=>({...t,[n]:e})),p(e=>{let t=new Set(e);return t.delete(n),t})})},te=(e,t)=>U(`button`,{type:`button`,className:t,"aria-label":`Log in to ${e.tracker.name}`,disabled:!i[e.tracker.id]||f.has(e.tracker.id),onClick:()=>ee(e),children:f.has(e.tracker.id)?`Logging in`:`Log in`}),ne=e=>`${e.tracker.name} counts ${fk(e,b.total).total} episodes, so the row leaves its progress alone`,re=(e,t)=>{let n=e.tracker.id,r=e.tracker.name,i=k(`div`,{className:`head`,children:[U(Rk,{answer:e}),r,e.tracker.account?U(`span`,{className:`account`,children:e.tracker.account}):void 0]});if(t.kind===`login`)return k(H,{children:[i,U(`span`,{className:`why`,children:`Signed out`}),te(e)]});if(t.kind===`cannot`)return k(H,{children:[i,k(`span`,{className:`why`,children:[r,` cannot track this media: `,t.reason]})]});let a=lk(e),o=fk(e,b.total),s=yk([e.tracker.scoreScale]);return k(H,{children:[i,U(zk,{name:`card-${n}`,shown:pk(o,c[n]),scale:s.scale,mixed:!1,disabled:!a,disabledTitle:Pk(e),listed:e.state===`LISTED`,removable:a&&e.state===`LISTED`,onChange:(t,n)=>M(e,t,n)}),a?void 0:U(`span`,{className:`why`,children:Pk(e)}),e.tracker.writeNotice?U(`span`,{className:`why`,children:e.tracker.writeNotice}):void 0,gk(e,b.total)?k(`span`,{className:`why`,children:[ne(e),`: set it here.`]}):void 0]})},ie=e=>C.filter(e=>e.state===`LISTED`).map(t=>`${t.tracker.name} ${e(t)??`none`}`).join(`, `),F=(e,t)=>b.differs.includes(e)?U(`span`,{className:`differs`,"data-differs":e,title:ie(t)}):void 0;return k(`section`,{css:jk,className:`tracking-compact`,"aria-label":`Quick tracking`,children:[k(`div`,{className:`row`,children:[U(zk,{name:`compact`,shown:S,scale:D?.scale??`POINT_100`,mixed:D?.mixed??!1,disabled:E,disabledTitle:`Check a list to save to`,listed:C.some(e=>e.state===`LISTED`),removable:T.some(e=>e.state===`LISTED`),onChange:j,dots:{SCORE:F(`SCORE`,e=>wr(e.entry?.score)?Nk(e.entry.score,e.tracker.scoreScale):void 0),STATUS:F(`STATUS`,e=>e.entry?.status?sk[e.entry.status]:void 0),PROGRESS:F(`PROGRESS`,e=>e.entry?.progress==null?void 0:String(e.entry.progress))}}),U(`div`,{className:`group platforms`,children:w.map(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,i={answer:e,open:g===n,onOpen:e=>_(t=>e?n:t===n?void 0:t),card:()=>re(e,t)};if(t.kind===`login`)return U(Bk,{...i,className:`chip login`,children:te(e,`login-button`)},n);if(t.kind===`cannot`)return U(Bk,{...i,className:`chip cannot`,children:U(`span`,{className:`slot`,role:`img`,"aria-label":`${r} cannot track this media: ${t.reason}`,children:U(Qc,{size:14,"aria-hidden":`true`})})},n);let{busy:a,failed:o}=N(e),s=e.state===`PAUSED`||e.state===`ERROR`?Pk(e):void 0;return k(Bk,{...i,className:`chip${t.checked?``:` off`}`,busy:a,children:[k(`label`,{children:[U(`input`,{type:`checkbox`,className:`sr-only`,name:`compact-target-${n}`,"aria-label":`Save to ${r}`,"aria-describedby":s?`compact-hint-${n}`:void 0,checked:t.checked,onChange:e=>P(n,e.currentTarget.checked)}),U(`span`,{className:`slot`,children:a?U(Jc,{size:14,className:`spin`,"aria-hidden":`true`}):t.checked?U(`span`,{className:`check`,children:U(Rc,{size:11,"aria-hidden":`true`})}):U(`span`,{className:`ring`})})]}),o||e.state===`ERROR`?U(`span`,{className:`badge red`,"data-badge":`red`}):e.state===`PAUSED`?U(`span`,{className:`badge amber`,"data-badge":`amber`}):void 0,s?U(`span`,{id:`compact-hint-${n}`,className:`sr-only`,children:s}):void 0]},n)})})]}),U(`div`,{className:`notes`,children:w.flatMap(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,{failed:i,refused:a}=N(e);return[m[n]&&e.state===`SIGNED_OUT`?U(`div`,{className:`note`,"data-note":n,children:m[n]},`${n}-sign-in`):void 0,i?k(`div`,{className:`note problem`,"data-note":n,children:[r,` did not save `,Lk(i.fields),`: `,i.error,U(`button`,{type:`button`,disabled:!lk(e),onClick:()=>y.retry(n),children:`Retry`})]},`${n}-failed`):void 0,a?k(`div`,{className:`note problem`,"data-note":n,children:[r,` did not save: `,a,U(`button`,{type:`button`,onClick:()=>y.dismiss(n),children:`Dismiss`})]},`${n}-refused`):void 0,t.kind===`check`&&t.sendable&&gk(e,b.total)?k(`div`,{className:`note`,"data-note":n,children:[ne(e),`: set it on `,r,`'s card, from its logo.`]},`${n}-count`):void 0].filter(Boolean)})}),U(`div`,{className:`sr-only`,role:`status`,children:u})]})};j();var Hk=Bp(`
1531
+ `,Lk={POINT_3:3,POINT_5:5,POINT_10:10,POINT_10_DECIMAL:10},Rk=(e,t)=>{let n=t??`POINT_100`;return`${Ar(e,n)} / ${Lk[n]??100}`},zk=e=>e.error||(e.state===`PAUSED`?`Paused for a while`:`Could not answer`),Bk=`REMOVE`,Vk=``,Hk=e=>e.remove?`the removal`:[e.status===void 0?void 0:`the status`,e.progress===void 0?void 0:`episode ${e.progress}`,e.score===void 0?void 0:`the score`].filter(Boolean).join(` and `),Uk=({answer:e})=>U(`span`,{className:`logo`,style:e.tracker.color?{color:e.tracker.color}:void 0,children:e.tracker.icon?U(`img`,{src:e.tracker.icon,alt:``}):e.tracker.name.slice(0,1)}),Wk=({name:e,shown:t,scale:n,mixed:r,disabled:i,disabledTitle:a,listed:o,removable:s,onChange:c,dots:l={}})=>{let[u,d]=B(),f=R(void 0),p=R(()=>{}),m=t.total,h=()=>{if(clearTimeout(f.current),u===void 0)return;let e=Number(u);if(d(void 0),u.trim()===``||!Number.isFinite(e))return;let n=Math.max(0,Math.min(m??1/0,Math.floor(e)));n!==t.progress&&c({progress:n},!0)};return p.current=h,k(`div`,{className:`group edit`,children:[U(Pk,{score:t.score,scale:n,mixed:r,disabled:i||!o&&!t.status&&!t.progress,disabledTitle:i?a:`Pick a status or add an episode first`,onPick:e=>c({score:e},!0)}),l.SCORE,k(`select`,{name:`${e}-status`,"aria-label":`Status`,value:t.status??``,disabled:i,onChange:e=>{let t=e.currentTarget.value;c(t===Bk?{remove:!0}:{status:t},!0)},children:[t.status?void 0:U(`option`,{value:``,disabled:!0,children:`Add to list`}),Object.entries(fk).map(([e,t])=>U(`option`,{value:e,children:t},e)),s?U(`option`,{value:Bk,children:`Remove from list`}):void 0]}),l.STATUS,k(`span`,{className:`progress-field`,children:[U(`label`,{for:`${e}-progress`,className:`word`,children:`Episodes`}),U(`input`,{id:`${e}-progress`,type:`number`,inputMode:`numeric`,name:`${e}-progress`,min:0,max:m??void 0,disabled:i,value:u??t.progress,onInput:e=>{d(e.currentTarget.value),clearTimeout(f.current),f.current=setTimeout(()=>p.current(),1e3)},onBlur:h,onKeyDown:e=>{e.key===`Enter`&&h(),e.key===`Escape`&&(clearTimeout(f.current),d(void 0),e.stopPropagation())}}),m?k(`span`,{className:`of`,children:[`/ `,m]}):void 0,l.PROGRESS,U(`button`,{type:`button`,className:`more`,"aria-label":`One episode more`,disabled:i||m!=null&&t.progress>=m,onClick:()=>c({progress:t.progress+1},!1),children:U(sl,{size:14,"aria-hidden":`true`})})]}),!i&&m&&t.progress===m&&t.status!==`COMPLETED`?U(`button`,{type:`button`,onClick:()=>c({status:`COMPLETED`},!0),children:`Mark completed`}):void 0,!i&&m&&t.status===`COMPLETED`&&t.progress<m?k(`button`,{type:`button`,onClick:()=>c({progress:m},!0),children:[`Set `,m,` / `,m]}):void 0]})},Gk=({answer:e,className:t,busy:n,open:r,onOpen:i,card:a,children:o})=>{let s=R(null),{refs:c,floatingStyles:l,context:u}=yf({open:r,onOpenChange:(e,t,n)=>{let r=c.floating.current?.contains(document.activeElement)??!1;(e||!r||n!==`hover`&&n!==`safe-polygon`)&&(e&&n===`hover`&&document.activeElement?.closest(`[data-card]`)||(!e&&r&&n===`escape-key`&&s.current?.focus(),i(e)))},placement:`bottom-end`,strategy:`fixed`,whileElementsMounted:_,middleware:[Yu(8),Zu({padding:8}),Xu({padding:8})]}),d=pf(u),{getReferenceProps:f,getFloatingProps:p}=Cf([Td(u,{mouseOnly:!0,delay:{open:100},handleClose:Pf()}),xf(u),_f(u)]),m=e.tracker.name;return k(`span`,{ref:c.setReference,className:t,"data-chip":e.tracker.id,"aria-busy":n?`true`:void 0,...f(),children:[U(`button`,{ref:s,type:`button`,className:`logo-button`,"aria-label":`${m} entry`,"aria-haspopup":`dialog`,"aria-expanded":r,...d.reference,children:U(Uk,{answer:e})}),o,r?U(`div`,{ref:c.setFloating,style:l,className:`card`,role:`dialog`,"aria-label":`${m} entry`,"data-card":e.tracker.id,...p(),children:a()}):void 0]})},Kk=({tracking:e,episodeCount:t,onSaveFields:n,onRemove:r,signIns:i={},prefs:a,onPrefs:o})=>{let[,s]=B(0),[c,l]=B({}),[u,d]=B(``),[f,p]=B(new Set),[m,h]=B({}),[g,_]=B(),v=R({onSaveFields:n,onRemove:r,tracking:e});v.current={onSaveFields:n,onRemove:r,tracking:e};let y=V(()=>Dk({send:async(e,t)=>{let n=await(t.remove?v.current.onRemove([e]):v.current.onSaveFields([e],t));return n.find(t=>t.tracker===e)??n[0]??{outcome:`FAILED`,error:`The write did not reach the trackers`}},onChange:e=>{if(s(e=>e+1),!e)return;let t=v.current.tracking?.answers.find(t=>t.tracker.id===e.tracker)?.tracker.name??e.tracker,n=e.outcome===`SAVED`||e.outcome===`QUEUED`;d(n?`${e.fields.remove?`Removed from`:`Saved to`} ${t}`:`${t} did not save: ${e.error??e.outcome.toLowerCase()}`),!n&&y.idle()&&l({})}}),[]);O(()=>{let e=()=>{document.visibilityState===`hidden`&&y.flush()};return document.addEventListener(`visibilitychange`,e),()=>{document.removeEventListener(`visibilitychange`,e),y.flush()}},[]);let b=hk(e,t),x=t=>{let n=e?.answers.find(e=>e.tracker.id===t);return n&&_k(n,b.total)};if(O(()=>{l(e=>y.idle()?{}:Object.fromEntries(Object.entries(e).flatMap(([e,t])=>{let n=e===Vk?b:x(e);return n?[[e,yk(t,n)]]:[]})))},[e]),!e?.answers.length)return null;let S=vk(b,c[Vk]),C=e.answers,w=C.map(e=>({answer:e,target:bk(e,a.targets[e.tracker.id])})),T=w.filter(({target:e})=>e.kind===`check`&&e.sendable).map(({answer:e})=>e),E=!T.length,D=wk(T.map(e=>e.tracker.scoreScale)),A=(e,t)=>{t.remove||l(n=>({...n,[e]:{...n[e],...t}}))},j=(e,t)=>{A(Vk,e);let n={...S,...e},r={};for(let{answer:t,target:i}of w){if(i.kind!==`check`||!i.checked)continue;let a=t.tracker.id;if(!mk(t)){y.fail(a,e,zk(t));continue}let o=Sk(t,e,n);o&&(r[a]=o)}y.stage(r,t)},M=(e,t,n)=>{let r=e.tracker.id,i=vk(_k(e,b.total),c[r]);A(r,t);let a=Sk(e,t,{...i,...t});a&&y.stage({[r]:a},n,!0)},N=e=>{let t=y.state(e.tracker.id);return t.failed?.fields.remove&&e.state===`NOT_LISTED`?{...t,failed:void 0}:t},P=(e,t)=>{t||y.drop(e),o({...a,targets:{...a.targets,[e]:t}})},ee=e=>{let t=i[e.tracker.id],n=e.tracker.id;if(!t||f.has(n))return;let r=t();p(e=>new Set(e).add(n)),h(({[n]:e,...t})=>t),r.then(t=>Fk[t]?.(e.tracker.name),e=>e instanceof Error?e.message:String(e)).then(e=>{e&&h(t=>({...t,[n]:e})),p(e=>{let t=new Set(e);return t.delete(n),t})})},te=(e,t)=>U(`button`,{type:`button`,className:t,"aria-label":`Log in to ${e.tracker.name}`,disabled:!i[e.tracker.id]||f.has(e.tracker.id),onClick:()=>ee(e),children:f.has(e.tracker.id)?`Logging in`:`Log in`}),ne=e=>`${e.tracker.name} counts ${_k(e,b.total).total} episodes, so the row leaves its progress alone`,re=(e,t)=>{let n=e.tracker.id,r=e.tracker.name,i=k(`div`,{className:`head`,children:[U(Uk,{answer:e}),r,e.tracker.account?U(`span`,{className:`account`,children:e.tracker.account}):void 0]});if(t.kind===`login`)return k(H,{children:[i,U(`span`,{className:`why`,children:`Signed out`}),te(e)]});if(t.kind===`cannot`)return k(H,{children:[i,k(`span`,{className:`why`,children:[r,` cannot track this media: `,t.reason]})]});let a=mk(e),o=_k(e,b.total),s=wk([e.tracker.scoreScale]);return k(H,{children:[i,U(Wk,{name:`card-${n}`,shown:vk(o,c[n]),scale:s.scale,mixed:!1,disabled:!a,disabledTitle:zk(e),listed:e.state===`LISTED`,removable:a&&e.state===`LISTED`,onChange:(t,n)=>M(e,t,n)}),a?void 0:U(`span`,{className:`why`,children:zk(e)}),e.tracker.writeNotice?U(`span`,{className:`why`,children:e.tracker.writeNotice}):void 0,xk(e,b.total)?k(`span`,{className:`why`,children:[ne(e),`: set it here.`]}):void 0]})},ie=e=>C.filter(e=>e.state===`LISTED`).map(t=>`${t.tracker.name} ${e(t)??`none`}`).join(`, `),F=(e,t)=>b.differs.includes(e)?U(`span`,{className:`differs`,"data-differs":e,title:ie(t)}):void 0;return k(`section`,{css:Ik,className:`tracking-compact`,"aria-label":`Quick tracking`,children:[k(`div`,{className:`row`,children:[U(Wk,{name:`compact`,shown:S,scale:D?.scale??`POINT_100`,mixed:D?.mixed??!1,disabled:E,disabledTitle:`Check a list to save to`,listed:C.some(e=>e.state===`LISTED`),removable:T.some(e=>e.state===`LISTED`),onChange:j,dots:{SCORE:F(`SCORE`,e=>kr(e.entry?.score)?Rk(e.entry.score,e.tracker.scoreScale):void 0),STATUS:F(`STATUS`,e=>e.entry?.status?fk[e.entry.status]:void 0),PROGRESS:F(`PROGRESS`,e=>e.entry?.progress==null?void 0:String(e.entry.progress))}}),U(`div`,{className:`group platforms`,children:w.map(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,i={answer:e,open:g===n,onOpen:e=>_(t=>e?n:t===n?void 0:t),card:()=>re(e,t)};if(t.kind===`login`)return U(Gk,{...i,className:`chip login`,children:te(e,`login-button`)},n);if(t.kind===`cannot`)return U(Gk,{...i,className:`chip cannot`,children:U(`span`,{className:`slot`,role:`img`,"aria-label":`${r} cannot track this media: ${t.reason}`,children:U(rl,{size:14,"aria-hidden":`true`})})},n);let{busy:a,failed:o}=N(e),s=e.state===`PAUSED`||e.state===`ERROR`?zk(e):void 0;return k(Gk,{...i,className:`chip${t.checked?``:` off`}`,busy:a,children:[k(`label`,{children:[U(`input`,{type:`checkbox`,className:`sr-only`,name:`compact-target-${n}`,"aria-label":`Save to ${r}`,"aria-describedby":s?`compact-hint-${n}`:void 0,checked:t.checked,onChange:e=>P(n,e.currentTarget.checked)}),U(`span`,{className:`slot`,children:a?U($c,{size:14,className:`spin`,"aria-hidden":`true`}):t.checked?U(`span`,{className:`check`,children:U(Uc,{size:11,"aria-hidden":`true`})}):U(`span`,{className:`ring`})})]}),o||e.state===`ERROR`?U(`span`,{className:`badge red`,"data-badge":`red`}):e.state===`PAUSED`?U(`span`,{className:`badge amber`,"data-badge":`amber`}):void 0,s?U(`span`,{id:`compact-hint-${n}`,className:`sr-only`,children:s}):void 0]},n)})})]}),U(`div`,{className:`notes`,children:w.flatMap(({answer:e,target:t})=>{let n=e.tracker.id,r=e.tracker.name,{failed:i,refused:a}=N(e);return[m[n]&&e.state===`SIGNED_OUT`?U(`div`,{className:`note`,"data-note":n,children:m[n]},`${n}-sign-in`):void 0,i?k(`div`,{className:`note problem`,"data-note":n,children:[r,` did not save `,Hk(i.fields),`: `,i.error,U(`button`,{type:`button`,disabled:!mk(e),onClick:()=>y.retry(n),children:`Retry`})]},`${n}-failed`):void 0,a?k(`div`,{className:`note problem`,"data-note":n,children:[r,` did not save: `,a,U(`button`,{type:`button`,onClick:()=>y.dismiss(n),children:`Dismiss`})]},`${n}-refused`):void 0,t.kind===`check`&&t.sendable&&xk(e,b.total)?k(`div`,{className:`note`,"data-note":n,children:[ne(e),`: set it on `,r,`'s card, from its logo.`]},`${n}-count`):void 0].filter(Boolean)})}),U(`div`,{className:`sr-only`,role:`status`,children:u})]})};j();var qk=Gp(`
1532
1532
  subscription MediaTracking($input: TrackingInput!) {
1533
1533
  tracking(input: $input) {
1534
1534
  _id
@@ -1566,7 +1566,7 @@ transition: max-height 0.3s ease-in-out;
1566
1566
  }
1567
1567
  }
1568
1568
  }
1569
- `),Uk=Bp(`
1569
+ `),Jk=Gp(`
1570
1570
  mutation SaveListEntry($input: SaveListEntryInput!) {
1571
1571
  saveListEntry(input: $input) {
1572
1572
  tracker
@@ -1581,7 +1581,7 @@ transition: max-height 0.3s ease-in-out;
1581
1581
  }
1582
1582
  }
1583
1583
  }
1584
- `),Wk=Bp(`
1584
+ `),Yk=Gp(`
1585
1585
  mutation DeleteListEntry($input: DeleteListEntryInput!) {
1586
1586
  deleteListEntry(input: $input) {
1587
1587
  tracker
@@ -1589,7 +1589,7 @@ transition: max-height 0.3s ease-in-out;
1589
1589
  error
1590
1590
  }
1591
1591
  }
1592
- `),Gk=Bp(`
1592
+ `),Xk=Gp(`
1593
1593
  subscription StubTrackerStorage {
1594
1594
  stubTrackerStorage {
1595
1595
  location
@@ -1600,7 +1600,7 @@ transition: max-height 0.3s ease-in-out;
1600
1600
  error
1601
1601
  }
1602
1602
  }
1603
- `),Kk=Bp(`
1603
+ `),Zk=Gp(`
1604
1604
  mutation AddHeldStubEntries {
1605
1605
  addHeldStubEntries {
1606
1606
  location
@@ -1611,7 +1611,7 @@ transition: max-height 0.3s ease-in-out;
1611
1611
  error
1612
1612
  }
1613
1613
  }
1614
- `),qk=xO(),Jk=e=>[{tracker:``,outcome:`FAILED`,error:e??`The write did not reach the trackers`}],Yk=({uri:e,title:t,cover:n,episodeCount:r,prefsStore:i=qk})=>{let[{data:a}]=yr({query:Hk,variables:{input:{uri:e}},pause:!e}),[,o]=_r(Uk),[,s]=_r(Wk),[{data:c}]=yr({query:Gk}),[,l]=_r(Kk),[u,d]=B(i.read),f=a?.tracking?.answers;return O(()=>{f&&Me(f,ke,Ye)},[f]),O(()=>{let e=e=>{e.key===`stub.tracking.compact`&&d(i.read())};return globalThis.addEventListener?.(`storage`,e),()=>globalThis.removeEventListener?.(`storage`,e)},[i]),k(H,{children:[U(Vk,{tracking:a?.tracking,episodeCount:r,onSaveFields:async(i,a)=>{let s=await o({input:{uri:e,trackers:i,entry:a,title:t??null,cover:n??null,episodeCount:r??null}});return s.data?.saveListEntry??Jk(s.error?.message)},onRemove:async t=>{let n=await s({input:{uri:e,trackers:t}});return n.data?.deleteListEntry??Jk(n.error?.message)},signIns:ot,prefs:u,onPrefs:e=>{i.write(e),d(e)}}),U(ok,{storage:c?.stubTrackerStorage,onUnlock:async()=>{await rk()&&await Je()},onAdd:()=>l({})})]})},Xk=({onClose:e,children:t,...n})=>{let{refs:r,context:i}=mf({open:!0,onOpenChange:(t,n)=>{n?.target===r.reference.current&&e()}}),{getReferenceProps:a,getFloatingProps:o}=vf([cf(i,{keyboardHandlers:!1})]);return U(Vd,{children:U(rf,{lockScroll:!0,...n,ref:r.setReference,...a(),children:U(Qd,{context:i,children:U(`div`,{className:`modal`,ref:r.setFloating,...o(),children:t})})})})},Zk=x`
1614
+ `),Qk=EO(),$k=e=>[{tracker:``,outcome:`FAILED`,error:e??`The write did not reach the trackers`}],eA=({uri:e,title:t,cover:n,episodeCount:r,prefsStore:i=Qk})=>{let[{data:a}]=wr({query:qk,variables:{input:{uri:e}},pause:!e}),[,o]=Sr(Jk),[,s]=Sr(Yk),[{data:c}]=wr({query:Xk}),[,l]=Sr(Zk),[u,d]=B(i.read),f=a?.tracking?.answers;return O(()=>{f&&Me(f,ke,pt)},[f]),O(()=>{let e=e=>{e.key===`stub.tracking.compact`&&d(i.read())};return globalThis.addEventListener?.(`storage`,e),()=>globalThis.removeEventListener?.(`storage`,e)},[i]),k(H,{children:[U(Kk,{tracking:a?.tracking,episodeCount:r,onSaveFields:async(i,a)=>{let s=await o({input:{uri:e,trackers:i,entry:a,title:t??null,cover:n??null,episodeCount:r??null}});return s.data?.saveListEntry??$k(s.error?.message)},onRemove:async t=>{let n=await s({input:{uri:e,trackers:t}});return n.data?.deleteListEntry??$k(n.error?.message)},signIns:Ve,prefs:u,onPrefs:e=>{i.write(e),d(e)}}),U(dk,{storage:c?.stubTrackerStorage,onUnlock:async()=>{await ck()&&await Ze()},onAdd:()=>l({})})]})},tA=({onClose:e,children:t,...n})=>{let{refs:r,context:i}=yf({open:!0,onOpenChange:(t,n)=>{n?.target===r.reference.current&&e()}}),{getReferenceProps:a,getFloatingProps:o}=Cf([pf(i,{keyboardHandlers:!1})]);return U(Kd,{children:U(lf,{lockScroll:!0,...n,ref:r.setReference,...a(),children:U(rf,{context:i,children:U(`div`,{className:`modal`,ref:r.setFloating,...o(),children:t})})})})},nA=x`
1615
1615
  font-size: 1.2rem;
1616
1616
  padding: 0.15rem 0.6rem;
1617
1617
  border: 1px solid rgba(255, 255, 255, 0.25);
@@ -1619,10 +1619,10 @@ transition: max-height 0.3s ease-in-out;
1619
1619
  white-space: nowrap;
1620
1620
 
1621
1621
  &:hover { border-color: rgba(255, 255, 255, 0.5); }
1622
- `,Qk=({uri:e})=>{let t=ih(Jo());return!e||!Ve(`?${t}`,`http://d/`)?null:U(ts,{css:Zk,"data-trace-link":e,href:Qm({uri:e,search:t}),title:`what the graph holds for this uri`,children:`graph trace`})},$k=e=>e?se(e)?P(e)?.handleUris??[]:re(e)?[e]:[]:[],eA=(e,t)=>{let n=$k(e);if(!n.length)return!1;let r=new Set($k(t));return n.some(e=>r.has(e))},tA=(e,t)=>t?.find(t=>eA(t.uri,e)),nA=(e,t)=>e?.find(e=>!t.has(e.url))?.url,rA=/^\d{4}-\d{2}-\d{2}$/,iA=1900,aA=e=>{if(!e)return;let t=new Date(e);if(!Number.isNaN(t.getTime())&&!(t.getUTCFullYear()<iA))return t},oA=(e,{locale:t}={})=>{let n=aA(e);if(n)try{return new Intl.DateTimeFormat(t,{year:`numeric`,month:`short`,day:`numeric`,...rA.test(e)?{timeZone:`UTC`}:{}}).format(n)}catch{return}},sA=(e,t)=>t?Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()):Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),cA=864e5,lA=(e,{locale:t,now:n=new Date}={})=>{let r=aA(e);if(!r)return;let i=Math.round((sA(n,!1)-sA(r,rA.test(e)))/cA);return i===0?`today`:i===1?`yesterday`:i>1&&i<30?`${i} days ago`:oA(e,{locale:t})},uA=e=>{let t=aA(e);if(t)return rA.test(e)?e:t.toISOString()},dA=new Set([`cr`,`nf`]),fA=e=>dA.has(e);j();var pA=x`
1622
+ `,rA=({uri:e})=>{let t=lh($o());return!e||!tt(`?${t}`,`http://d/`)?null:U(os,{css:nA,"data-trace-link":e,href:rh({uri:e,search:t}),title:`what the graph holds for this uri`,children:`graph trace`})},iA=e=>e?se(e)?P(e)?.handleUris??[]:re(e)?[e]:[]:[],aA=(e,t)=>{let n=iA(e);if(!n.length)return!1;let r=new Set(iA(t));return n.some(e=>r.has(e))},oA=(e,t)=>t?.find(t=>aA(t.uri,e)),sA=(e,t)=>e?.find(e=>!t.has(e.url))?.url,cA=/^\d{4}-\d{2}-\d{2}$/,lA=1900,uA=e=>{if(!e)return;let t=new Date(e);if(!Number.isNaN(t.getTime())&&!(t.getUTCFullYear()<lA))return t},dA=(e,{locale:t}={})=>{let n=uA(e);if(n)try{return new Intl.DateTimeFormat(t,{year:`numeric`,month:`short`,day:`numeric`,...cA.test(e)?{timeZone:`UTC`}:{}}).format(n)}catch{return}},fA=(e,t)=>t?Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()):Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()),pA=864e5,mA=(e,{locale:t,now:n=new Date}={})=>{let r=uA(e);if(!r)return;let i=Math.round((fA(n,!1)-fA(r,cA.test(e)))/pA);return i===0?`today`:i===1?`yesterday`:i>1&&i<30?`${i} days ago`:dA(e,{locale:t})},hA=e=>{let t=uA(e);if(t)return cA.test(e)?e:t.toISOString()},gA=new Set([`cr`,`nf`]),_A=e=>gA.has(e)&&!Qe().includes(e);j();var vA=x`
1623
1623
  position: fixed;
1624
1624
  inset: 0;
1625
- z-index: ${Ff.sourcePopup};
1625
+ z-index: ${Bf.sourcePopup};
1626
1626
  display: flex;
1627
1627
  align-items: center;
1628
1628
  justify-content: center;
@@ -1687,7 +1687,7 @@ transition: max-height 0.3s ease-in-out;
1687
1687
  color: rgba(255, 255, 255, 0.55);
1688
1688
  font-size: 1.4rem;
1689
1689
  }
1690
- `,mA=({pluginUri:e,origin:t,name:n,uris:r,onPick:i,onClose:a})=>{let o=R(null),[s,c]=B(``);return O(()=>{let n=o.current;if(!n)return;let s=!1,l;return(async()=>{try{l=await Oe.show(e,{element:n})}catch(e){c(e instanceof Error?e.message:String(e));return}let o=await Qe(t,r);s||(o?i(o):a())})(),()=>{s=!0,l?.hide(),Oe.hide(e,{element:n}).catch(()=>{})}},[e,t,r.join(`,`)]),O(()=>{let e=e=>{e.key===`Escape`&&a()};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[a]),U(`div`,{css:pA,role:`dialog`,"aria-modal":`true`,"aria-label":`Choose a source from ${n}`,onClick:a,children:k(`div`,{className:`wrap`,onClick:e=>e.stopPropagation(),children:[k(`div`,{className:`bar`,children:[U(`span`,{children:n}),U(`span`,{className:`spacer`}),U(`button`,{type:`button`,className:`close`,onClick:a,children:`Close`})]}),s?k(`div`,{className:`fallback`,children:[`This source could not open its picker. `,s]}):U(`div`,{className:`slot`,ref:o})]})})};j();var hA={cr:`#f47521`,nf:`#e50914`,jw:`#fcd53f`,disney:`#0063e5`,amazon:`#00a8e1`,appletv:`#e8e8ed`,hulu:`#1ce783`,hbo:`#7b5cff`,peacock:`#069de0`,paramount:`#0064ff`,fubo:`#fa4616`},gA=`#9aa0a6`,_A=e=>e.color||hA[e.id]||gA,vA=x`
1690
+ `,yA=({pluginUri:e,origin:t,name:n,uris:r,onPick:i,onClose:a})=>{let o=R(null),[s,c]=B(``);return O(()=>{let n=o.current;if(!n)return;let s=!1,l;return(async()=>{try{l=await Oe.show(e,{element:n})}catch(e){c(e instanceof Error?e.message:String(e));return}let o=await rt(t,r);s||(o?i(o):a())})(),()=>{s=!0,l?.hide(),Oe.hide(e,{element:n}).catch(()=>{})}},[e,t,r.join(`,`)]),O(()=>{let e=e=>{e.key===`Escape`&&a()};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},[a]),U(`div`,{css:vA,role:`dialog`,"aria-modal":`true`,"aria-label":`Choose a source from ${n}`,onClick:a,children:k(`div`,{className:`wrap`,onClick:e=>e.stopPropagation(),children:[k(`div`,{className:`bar`,children:[U(`span`,{children:n}),U(`span`,{className:`spacer`}),U(`button`,{type:`button`,className:`close`,onClick:a,children:`Close`})]}),s?k(`div`,{className:`fallback`,children:[`This source could not open its picker. `,s]}):U(`div`,{className:`slot`,ref:o})]})})};j();var bA={cr:`#f47521`,nf:`#e50914`,jw:`#fcd53f`,disney:`#0063e5`,amazon:`#00a8e1`,appletv:`#e8e8ed`,hulu:`#1ce783`,hbo:`#7b5cff`,peacock:`#069de0`,paramount:`#0064ff`,fubo:`#fa4616`},xA=`#9aa0a6`,SA=e=>e.color||bA[e.id]||xA,CA=x`
1691
1691
  display: flex;
1692
1692
  flex-direction: column;
1693
1693
  gap: 1.1rem;
@@ -1707,7 +1707,7 @@ transition: max-height 0.3s ease-in-out;
1707
1707
  }
1708
1708
 
1709
1709
  .source {
1710
- --brand: ${gA};
1710
+ --brand: ${xA};
1711
1711
  position: relative;
1712
1712
  display: flex;
1713
1713
  align-items: center;
@@ -1918,13 +1918,13 @@ transition: max-height 0.3s ease-in-out;
1918
1918
  0%, 100% { transform: scaleY(0.35); }
1919
1919
  50% { transform: scaleY(1); }
1920
1920
  }
1921
- `,yA=x`
1921
+ `,wA=x`
1922
1922
  display: flex;
1923
1923
  align-items: center;
1924
1924
  gap: 0.7rem;
1925
1925
 
1926
1926
  .src {
1927
- --brand: ${gA};
1927
+ --brand: ${xA};
1928
1928
  display: flex;
1929
1929
  text-decoration: none;
1930
1930
  border-radius: 0.6rem;
@@ -1964,8 +1964,8 @@ transition: max-height 0.3s ease-in-out;
1964
1964
  background: color-mix(in srgb, var(--brand) 30%, rgba(255, 255, 255, 0.05));
1965
1965
  }
1966
1966
  }
1967
- `,bA=({source:e})=>{let[t,n]=B(!1);return U(`span`,{className:`icon`,children:e.icon&&!t?U(`img`,{src:e.icon,alt:``,onError:()=>n(!0)}):e.name.charAt(0)})},xA=({sources:e,compact:t=!1,onPickRelease:n})=>{let[r,i]=B(null);return e.length?t?U(`div`,{css:yA,children:e.map(e=>U(`a`,{className:`src`,style:{"--brand":_A(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:`Watch on ${e.name}`,children:U(bA,{source:e})},e.id))}):k(`div`,{css:vA,children:[U(`div`,{className:`label`,children:`Watch on`}),U(`div`,{className:`list`,children:e.map(e=>e.releases&&e.releases.length>1?U(SA,{source:e,onOpenPicker:()=>i(e)},e.id):k(`a`,{className:`source${e.active?` active`:``}`,style:{"--brand":_A(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.name,children:[U(bA,{source:e}),U(`span`,{className:`name`,children:e.name}),e.active?k(`span`,{className:`playing`,children:[U(`i`,{}),U(`i`,{}),U(`i`,{})]}):e.external?U(`span`,{className:`ext`,children:`↗`}):U(`span`,{className:`play`,children:`▶`})]},e.id))}),r?.picker?U(mA,{pluginUri:r.picker.pluginUri,origin:r.id,name:r.name,uris:(r.releases??[]).map(e=>e.uri),onPick:e=>{i(null),n?.(e)},onClose:()=>i(null)}):void 0]}):null},SA=({source:e,onOpenPicker:t})=>{let n=e.releases??[],[r,i]=B(n.some(e=>e.active)),a=!!e.picker;return k(`div`,{className:`source-group`,style:{"--brand":_A(e)},children:[k(`button`,{type:`button`,className:`source${e.active?` active`:``}`,style:{"--brand":_A(e)},onClick:()=>a?t():i(e=>!e),title:`${n.length} releases on ${e.name}`,"aria-expanded":a?void 0:r,"aria-haspopup":a?`dialog`:void 0,children:[U(bA,{source:e}),U(`span`,{className:`name`,children:e.name}),U(`span`,{className:`count`,children:n.length}),U(`span`,{className:`chevron`,children:a?`›`:r?`▾`:`▸`})]}),!a&&r?U(`div`,{className:`releases`,children:n.map(e=>k(`a`,{className:`release${e.active?` active`:``}`,href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.label,children:[U(`span`,{className:`release-label`,children:e.label}),e.active?k(`span`,{className:`playing`,children:[U(`i`,{}),U(`i`,{}),U(`i`,{})]}):e.external?U(`span`,{className:`ext`,children:`↗`}):U(`span`,{className:`play`,children:`▶`})]},e.uri))}):void 0]})},CA=e=>[...new Set((e?.handles??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node.origin))];j();var wA=x`
1968
- z-index: ${Ff.mediaModal};
1967
+ `,TA=({source:e})=>{let[t,n]=B(!1);return U(`span`,{className:`icon`,children:e.icon&&!t?U(`img`,{src:e.icon,alt:``,onError:()=>n(!0)}):e.name.charAt(0)})},EA=({sources:e,compact:t=!1,onPickRelease:n})=>{let[r,i]=B(null);return e.length?t?U(`div`,{css:wA,children:e.map(e=>U(`a`,{className:`src`,style:{"--brand":SA(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:`Watch on ${e.name}`,children:U(TA,{source:e})},e.id))}):k(`div`,{css:CA,children:[U(`div`,{className:`label`,children:`Watch on`}),U(`div`,{className:`list`,children:e.map(e=>e.releases&&e.releases.length>1?U(DA,{source:e,onOpenPicker:()=>i(e)},e.id):k(`a`,{className:`source${e.active?` active`:``}`,style:{"--brand":SA(e)},href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.name,children:[U(TA,{source:e}),U(`span`,{className:`name`,children:e.name}),e.active?k(`span`,{className:`playing`,children:[U(`i`,{}),U(`i`,{}),U(`i`,{})]}):e.external?U(`span`,{className:`ext`,children:`↗`}):U(`span`,{className:`play`,children:`▶`})]},e.id))}),r?.picker?U(yA,{pluginUri:r.picker.pluginUri,origin:r.id,name:r.name,uris:(r.releases??[]).map(e=>e.uri),onPick:e=>{i(null),n?.(e)},onClose:()=>i(null)}):void 0]}):null},DA=({source:e,onOpenPicker:t})=>{let n=e.releases??[],[r,i]=B(n.some(e=>e.active)),a=!!e.picker;return k(`div`,{className:`source-group`,style:{"--brand":SA(e)},children:[k(`button`,{type:`button`,className:`source${e.active?` active`:``}`,style:{"--brand":SA(e)},onClick:()=>a?t():i(e=>!e),title:`${n.length} releases on ${e.name}`,"aria-expanded":a?void 0:r,"aria-haspopup":a?`dialog`:void 0,children:[U(TA,{source:e}),U(`span`,{className:`name`,children:e.name}),U(`span`,{className:`count`,children:n.length}),U(`span`,{className:`chevron`,children:a?`›`:r?`▾`:`▸`})]}),!a&&r?U(`div`,{className:`releases`,children:n.map(e=>k(`a`,{className:`release${e.active?` active`:``}`,href:e.href,target:e.external?`_blank`:void 0,rel:e.external?`noreferrer`:void 0,title:e.label,children:[U(`span`,{className:`release-label`,children:e.label}),e.active?k(`span`,{className:`playing`,children:[U(`i`,{}),U(`i`,{}),U(`i`,{})]}):e.external?U(`span`,{className:`ext`,children:`↗`}):U(`span`,{className:`play`,children:`▶`})]},e.uri))}):void 0]})},OA=e=>[...new Set((e?.handles??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node.origin))];j();var kA=x`
1968
+ z-index: ${Bf.mediaModal};
1969
1969
  padding: 5rem 1rem;
1970
1970
  background-color: hsla(0, 0%, 0%, 0.439);
1971
1971
  animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
@@ -2246,7 +2246,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2246
2246
  }
2247
2247
  }
2248
2248
  }
2249
- `,TA=Bp(`
2249
+ `,AA=Gp(`
2250
2250
  subscription GetMediaModal($input: MediaInput!, $descriptionInput: MediaDescriptionInput!) {
2251
2251
  media(input: $input) {
2252
2252
  ...MediaFragment
@@ -2368,7 +2368,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2368
2368
  episodeCount
2369
2369
  }
2370
2370
  }
2371
- `),EA=Bp(`
2371
+ `),jA=Gp(`
2372
2372
  subscription GetMediaModalOrigins($input: OriginPageInput!) {
2373
2373
  originPage(input: $input) {
2374
2374
  nodes {
@@ -2376,7 +2376,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2376
2376
  }
2377
2377
  }
2378
2378
  }
2379
- `),DA=({episode:e,index:t,mediaUri:n,isMovie:r})=>{let[i,a]=B(()=>new Set),o=nA(e.thumbnails,i),s=e.releaseDate??e.handles?.find(e=>e.node.releaseDate)?.node.releaseDate,c=lA(s),l=CA(e),[{data:u}]=yr({query:EA,variables:{input:{ids:l,filters:[hs.IsNotApiOnly]}},pause:!l}),d=(u?.originPage?.nodes??[]).map(t=>{let r=(e?.handles??[]).filter(e=>e.relation===`SAME_AS`&&e.node.origin===t.id).map(e=>e.node),i=r.at(0),a=i?.uri,o=!!(fA(t.id)&&i?.url),s=e.uri?r.length>1?cs(J.WATCH,{mediaUri:n,episodeUri:e.uri}):a?cs(J.WATCH,{mediaUri:n,episodeUri:e.uri,sourceUri:a}):void 0:void 0,c=r.length>1;return{id:t.id,name:t.name??t.id,icon:t.icon,color:t.color,href:c||o?s:i?.url??void 0,external:!c&&!o,active:!1}}).filter(e=>e.href).sort((e,t)=>Number(e.external)-Number(t.external)).slice(0,5);return k(`div`,{className:`episode`,children:[e.uri?U(ts,{className:`episode-link`,href:cs(J.WATCH,{mediaUri:n,episodeUri:e.uri})}):void 0,r?void 0:U(`div`,{className:`number`,children:e.episodeNumber}),o?U(`img`,{className:`thumbnail`,src:o,onError:()=>a(e=>new Set(e).add(o))}):U(`div`,{className:`thumbnail`}),r?U(`div`,{className:`content`,children:k(`div`,{className:`header`,children:[U(`div`,{className:`title`,children:`Play`}),U(`span`,{className:`origins`,children:U(xA,{compact:!0,sources:d})})]})}):e.titles?.length?k(`div`,{className:`content`,children:[k(`div`,{className:`header`,children:[U(`div`,{className:`title`,children:e.titles.at(0)?.title}),U(`span`,{className:`origins`,children:U(xA,{compact:!0,sources:d})})]}),e.shortDescriptions?.at(0)?U(`div`,{className:`description`,children:U(tm,{className:`ellipsis`,children:e.shortDescriptions?.at(0)?.shortDescription})}):void 0]}):U(`div`,{className:`content`,children:U(`div`,{className:`header`,children:k(`div`,{className:`title`,children:[`Episode `,t+1]})})}),U(`div`,{className:`side`,children:c?U(`time`,{className:`date`,dateTime:uA(s),children:c}):void 0})]})},OA=({mediaNodes:e})=>{let t=Go(),n={...t,uri:M(t.uri)},[,r]=qo(),i=tA(n.uri,e),[a,o]=B(n.uri);O(()=>{o(e=>e&&te(ve(e),ve(n.uri??``))?e:n.uri)},[n.uri]);let[{data:s}]=yr({query:TA,variables:{input:{uri:a},descriptionInput:{type:us.Html}},pause:!a}),c=s?.media??i,l=s?.media?.uri?P(s.media.uri)?.handleUrisValues:void 0,u=[...new Set([...l?.map(e=>e.origin)??[],...c?.handles?.map(e=>e.node.origin)??[]])],[{data:d}]=yr({query:EA,variables:{input:{ids:u,filters:[hs.IsNotApiOnly]}},pause:!u}),f=V(()=>c?.titles?.at(0)?.title,[c]),p=V(()=>c&&`descriptions`in c&&c.descriptions.sort((e,t)=>t.description.length-e.description.length)?.at(0)?.description,[c]),m=dm(c?.covers),[h,g]=B([]),[_,v]=B(),y=V(()=>{let e=(c?.trailers??[]).filter(e=>!h.includes(e.uri));return e.find(e=>e.uri===_)??e.at(0)},[c?.trailers,h,_]);O(()=>{y?.uri&&y.uri!==_&&v(y.uri)},[y?.uri,_]);let b=z(()=>{y&&g([...h,y.uri])},[y,h]),[x,S]=B(!0),[C,w]=B(!1),[E,D]=B(!0),[A,j]=B(.25);return O(()=>{T(c?.uri,n.uri)&&r(`${cs(J.MEDIA,{uri:c.uri})}${location.search}`,{replace:!0})},[c?.uri,n.uri]),x?k(Xk,{"data-party-scroll":!0,css:wA,onClose:()=>S(!1),children:[k(`div`,{className:`trailer`,style:!y?.url&&m?{backgroundImage:`url(${m})`}:{},children:[y?.url?U(Xp,{url:y.url,className:`player`,onError:b,paused:C,volume:E?0:A},y.url):void 0,k(`div`,{className:`player-controls ${y?.url?``:`hidden`}`,children:[k(`span`,{className:`playback`,children:[C?U(tl,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>w(!1)}):U(el,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>w(!0)}),C?U(tl,{className:`icon-body`,size:30,onClick:()=>w(!1)}):U(el,{className:`icon-body`,size:30,onClick:()=>w(!0)})]}),U($p,{defaultMuted:E,onMutedUpdate:D,defaultVolume:A,onVolumeUpdate:e=>j(e)})]})]}),k(`div`,{className:`content`,children:[k(`div`,{className:`header`,children:[U(`span`,{className:`title`,children:f}),U(Qk,{uri:c?.uri}),U(`span`,{className:`origins`,children:d?.originPage?.nodes?.map(e=>{let t=c?.handles.filter(t=>t.node.origin===e.id&&t.node.url)??[],n=(t.find(e=>e.relation===`SAME_AS`)??t.at(0))?.node.url;if(e.icon)return n?U(`a`,{className:`origin`,href:n,target:`_blank`,rel:`noreferrer`,title:e.name,children:U(`img`,{src:e.icon})}):U(`div`,{className:`origin`,children:U(`img`,{src:e.icon})})}).filter(Boolean)})]}),U(Yk,{uri:s?.media?.uri,title:f,cover:m,episodeCount:s?.media?.episodeCount}),p?U(Km,{collapsedHeight:200,className:`description`,children:U(`div`,{dangerouslySetInnerHTML:{__html:p}})}):void 0,U(Ah,{relations:c&&`relations`in c?c.relations??[]:[],action:U(gO,{franchise:c&&`franchise`in c?c.franchise:void 0,currentUris:c?.handles?.map(e=>e.node.uri)??[]})}),U(`div`,{className:`episodes`,children:c&&`episodes`in c&&c.episodes?.map((e,t)=>U(DA,{episode:e,index:t,mediaUri:c.uri,isMovie:`categories`in c&&c.categories?.includes(ls.Movie)},e.episodeNumber??e.uri??t))})]})]}):U(is,{to:`/`})},kA=[{label:`All`,value:null},{label:`Anime`,value:ls.Anime},{label:`Series`,value:ls.Series},{label:`Movies`,value:ls.Movie}],AA=x`
2379
+ `),MA=({episode:e,index:t,mediaUri:n,isMovie:r})=>{let[i,a]=B(()=>new Set),o=sA(e.thumbnails,i),s=e.releaseDate??e.handles?.find(e=>e.node.releaseDate)?.node.releaseDate,c=mA(s),l=OA(e),[{data:u}]=wr({query:jA,variables:{input:{ids:l,filters:[bs.IsNotApiOnly]}},pause:!l}),d=(u?.originPage?.nodes??[]).map(t=>{let r=(e?.handles??[]).filter(e=>e.relation===`SAME_AS`&&e.node.origin===t.id).map(e=>e.node),i=r.at(0),a=i?.uri,o=!!(_A(t.id)&&i?.url),s=e.uri?r.length>1?ps(J.WATCH,{mediaUri:n,episodeUri:e.uri}):a?ps(J.WATCH,{mediaUri:n,episodeUri:e.uri,sourceUri:a}):void 0:void 0,c=r.length>1;return{id:t.id,name:t.name??t.id,icon:t.icon,color:t.color,href:c||o?s:i?.url??void 0,external:!c&&!o,active:!1}}).filter(e=>e.href).sort((e,t)=>Number(e.external)-Number(t.external)).slice(0,5);return k(`div`,{className:`episode`,children:[e.uri?U(os,{className:`episode-link`,href:ps(J.WATCH,{mediaUri:n,episodeUri:e.uri})}):void 0,r?void 0:U(`div`,{className:`number`,children:e.episodeNumber}),o?U(`img`,{className:`thumbnail`,src:o,onError:()=>a(e=>new Set(e).add(o))}):U(`div`,{className:`thumbnail`}),r?U(`div`,{className:`content`,children:k(`div`,{className:`header`,children:[U(`div`,{className:`title`,children:`Play`}),U(`span`,{className:`origins`,children:U(EA,{compact:!0,sources:d})})]})}):e.titles?.length?k(`div`,{className:`content`,children:[k(`div`,{className:`header`,children:[U(`div`,{className:`title`,children:e.titles.at(0)?.title}),U(`span`,{className:`origins`,children:U(EA,{compact:!0,sources:d})})]}),e.shortDescriptions?.at(0)?U(`div`,{className:`description`,children:U(om,{className:`ellipsis`,children:e.shortDescriptions?.at(0)?.shortDescription})}):void 0]}):U(`div`,{className:`content`,children:U(`div`,{className:`header`,children:k(`div`,{className:`title`,children:[`Episode `,t+1]})})}),U(`div`,{className:`side`,children:c?U(`time`,{className:`date`,dateTime:hA(s),children:c}):void 0})]})},NA=({mediaNodes:e})=>{let t=Xo(),n={...t,uri:M(t.uri)},[,r]=Qo(),i=oA(n.uri,e),[a,o]=B(n.uri);O(()=>{o(e=>e&&te(ve(e),ve(n.uri??``))?e:n.uri)},[n.uri]);let[{data:s}]=wr({query:AA,variables:{input:{uri:a},descriptionInput:{type:hs.Html}},pause:!a}),c=s?.media??i,l=s?.media?.uri?P(s.media.uri)?.handleUrisValues:void 0,u=[...new Set([...l?.map(e=>e.origin)??[],...c?.handles?.map(e=>e.node.origin)??[]])],[{data:d}]=wr({query:jA,variables:{input:{ids:u,filters:[bs.IsNotApiOnly]}},pause:!u}),f=V(()=>c?.titles?.at(0)?.title,[c]),p=V(()=>c&&`descriptions`in c&&c.descriptions.sort((e,t)=>t.description.length-e.description.length)?.at(0)?.description,[c]),m=gm(c?.covers),[h,g]=B([]),[_,v]=B(),y=V(()=>{let e=(c?.trailers??[]).filter(e=>!h.includes(e.uri));return e.find(e=>e.uri===_)??e.at(0)},[c?.trailers,h,_]);O(()=>{y?.uri&&y.uri!==_&&v(y.uri)},[y?.uri,_]);let b=z(()=>{y&&g([...h,y.uri])},[y,h]),[x,S]=B(!0),[C,w]=B(!1),[E,D]=B(!0),[A,j]=B(.25);return O(()=>{T(c?.uri,n.uri)&&r(`${ps(J.MEDIA,{uri:c.uri})}${location.search}`,{replace:!0})},[c?.uri,n.uri]),x?k(tA,{"data-party-scroll":!0,css:kA,onClose:()=>S(!1),children:[k(`div`,{className:`trailer`,style:!y?.url&&m?{backgroundImage:`url(${m})`}:{},children:[y?.url?U(tm,{url:y.url,className:`player`,onError:b,paused:C,volume:E?0:A},y.url):void 0,k(`div`,{className:`player-controls ${y?.url?``:`hidden`}`,children:[k(`span`,{className:`playback`,children:[C?U(ol,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>w(!1)}):U(al,{className:`icon-outline`,size:30,strokeWidth:3,color:`black`,onClick:()=>w(!0)}),C?U(ol,{className:`icon-body`,size:30,onClick:()=>w(!1)}):U(al,{className:`icon-body`,size:30,onClick:()=>w(!0)})]}),U(im,{defaultMuted:E,onMutedUpdate:D,defaultVolume:A,onVolumeUpdate:e=>j(e)})]})]}),k(`div`,{className:`content`,children:[k(`div`,{className:`header`,children:[U(`span`,{className:`title`,children:f}),U(rA,{uri:c?.uri}),U(`span`,{className:`origins`,children:d?.originPage?.nodes?.map(e=>{let t=c?.handles.filter(t=>t.node.origin===e.id&&t.node.url)??[],n=(t.find(e=>e.relation===`SAME_AS`)??t.at(0))?.node.url;if(e.icon)return n?U(`a`,{className:`origin`,href:n,target:`_blank`,rel:`noreferrer`,title:e.name,children:U(`img`,{src:e.icon})}):U(`div`,{className:`origin`,children:U(`img`,{src:e.icon})})}).filter(Boolean)})]}),U(eA,{uri:s?.media?.uri,title:f,cover:m,episodeCount:s?.media?.episodeCount}),p?U(Zm,{collapsedHeight:200,className:`description`,children:U(`div`,{dangerouslySetInnerHTML:{__html:p}})}):void 0,U(Fh,{relations:c&&`relations`in c?c.relations??[]:[],action:U(xO,{franchise:c&&`franchise`in c?c.franchise:void 0,currentUris:c?.handles?.map(e=>e.node.uri)??[]})}),U(`div`,{className:`episodes`,children:c&&`episodes`in c&&c.episodes?.map((e,t)=>U(MA,{episode:e,index:t,mediaUri:c.uri,isMovie:`categories`in c&&c.categories?.includes(ms.Movie)},e.episodeNumber??e.uri??t))})]})]}):U(ls,{to:`/`})},PA=[{label:`All`,value:null},{label:`Anime`,value:ms.Anime},{label:`Series`,value:ms.Series},{label:`Movies`,value:ms.Movie}],FA=x`
2380
2380
  display: flex;
2381
2381
  gap: 0.6rem;
2382
2382
 
@@ -2398,7 +2398,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2398
2398
  color: #000;
2399
2399
  border-color: #fff;
2400
2400
  }
2401
- `,jA=({value:e,onChange:t})=>U(`div`,{css:AA,children:kA.map(n=>U(`button`,{className:e===n.value?`tab active`:`tab`,onClick:()=>t(n.value),children:n.label},n.label))}),MA=e=>e._id??e.uri??``,NA=(e,t)=>{let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(MA(t))?r:i).push(t);return r.sort((e,t)=>n.get(MA(e))-n.get(MA(t))),[...r,...i]},PA=e=>e.map(MA).filter(Boolean);j();var FA=Bp(`
2401
+ `,IA=({value:e,onChange:t})=>U(`div`,{css:FA,children:PA.map(n=>U(`button`,{className:e===n.value?`tab active`:`tab`,onClick:()=>t(n.value),children:n.label},n.label))}),LA=e=>e._id??e.uri??``,RA=(e,t)=>{let n=new Map(t.map((e,t)=>[e,t])),r=[],i=[];for(let t of e)(n.has(LA(t))?r:i).push(t);return r.sort((e,t)=>n.get(LA(e))-n.get(LA(t))),[...r,...i]},zA=e=>e.map(LA).filter(Boolean);j();var BA=Gp(`
2402
2402
  subscription GetReleasingMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
2403
2403
  mediaPage(input: $input) {
2404
2404
  nodes {
@@ -2433,13 +2433,13 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2433
2433
  }
2434
2434
  }
2435
2435
  }
2436
- `),IA=x`
2436
+ `),VA=x`
2437
2437
  .category-bar {
2438
2438
  position: relative;
2439
- z-index: ${Ff.categoryBar};
2439
+ z-index: ${Bf.categoryBar};
2440
2440
  padding: 1.5rem 3rem 0.5rem;
2441
2441
  }
2442
- `,LA=qO(),RA={season:Bs(LA.season),year:LA.year},zA=Qs(RA),BA=()=>{let[e]=Xo(ss(J.MEDIA)),[t,n]=B(null),[{data:r}]=yr({query:FA,variables:{input:{season:RA.season,seasonYear:RA.year,sorts:[fs.PopularityDesc],...t?{categories:[t]}:{}},shortDescriptionInput:{count:1}}}),i=r?.mediaPage?.nodes,a=R([]),o=V(()=>{if(!i?.length)return i||[];let e=NA(i,a.current);return a.current=PA(e),e},[i]);return k(`div`,{css:IA,children:[U(pm,{mediaNodes:o}),U(`div`,{className:`category-bar`,children:U(jA,{value:t,onChange:n})}),U(Wm,{title:`Current season`,titleTo:zA,mediaNodes:o}),e&&U(OA,{mediaNodes:o})]})},VA=(e,t)=>{let n=e.nextAiringEpisode?.airingAt;if(!n)return;let r=new Date(n).getTime();return Number.isFinite(r)?r-t:void 0},HA=e=>e==null?void 0:`${e} episode${e===1?``:`s`}`,UA=(e,t)=>{if(!e)return;let n=e.trim().replace(/^#/,``),r=n.length===3?n.split(``).map(e=>e+e).join(``):n.length===6?n:void 0;if(!r||!/^[0-9a-f]{6}$/i.test(r))return;let i=parseInt(r,16);return`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, ${t})`},WA=e=>({"--accent":UA(e,1)??`rgba(255, 255, 255, 0.75)`,"--accent-soft":UA(e,.18)??`rgba(255, 255, 255, 0.08)`,"--accent-wash":UA(e,.07)??`rgba(255, 255, 255, 0.03)`}),GA=(e,t=2)=>{if(!Number.isFinite(e)||e<=0)return;let n=[],r=e;for(let e of KA){let i=Math.floor(r/e.ms);if(r-=i*e.ms,i&&(n.push(`${i} ${i===1?e.singular:e.plural}`),n.length>=t))break}return n.length?n.join(`, `):void 0},KA=[{ms:864e5,singular:`day`,plural:`days`},{ms:36e5,singular:`hour`,plural:`hours`},{ms:6e4,singular:`min`,plural:`mins`},{ms:1e3,singular:`sec`,plural:`secs`}];j();var qA=3e4,JA=new Set,YA,XA=()=>{let[e,t]=B(()=>Date.now());return O(()=>(JA.add(t),YA??=setInterval(()=>{let e=Date.now();for(let t of JA)t(e)},qA),()=>{JA.delete(t),!JA.size&&YA&&(clearInterval(YA),YA=void 0)}),[]),e},ZA=e=>e>=75?`good`:e>=60?`mixed`:`poor`,QA={good:sl,mixed:Xc,poor:Wc},$A={good:`#4ade80`,mixed:`#fb923c`,poor:`#f87171`},ej=x`
2442
+ `,HA=QO(),UA={season:Gs(HA.season),year:HA.year},WA=rc(UA),GA=()=>{let[e]=ts(fs(J.MEDIA)),[t,n]=B(null),[{data:r}]=wr({query:BA,variables:{input:{season:UA.season,seasonYear:UA.year,sorts:[_s.PopularityDesc],...t?{categories:[t]}:{}},shortDescriptionInput:{count:1}}}),i=r?.mediaPage?.nodes,a=R([]),o=V(()=>{if(!i?.length)return i||[];let e=RA(i,a.current);return a.current=zA(e),e},[i]);return k(`div`,{css:VA,children:[U(vm,{mediaNodes:o}),U(`div`,{className:`category-bar`,children:U(IA,{value:t,onChange:n})}),U(Ym,{title:`Current season`,titleTo:WA,mediaNodes:o}),e&&U(NA,{mediaNodes:o})]})},KA=(e,t)=>{let n=e.nextAiringEpisode?.airingAt;if(!n)return;let r=new Date(n).getTime();return Number.isFinite(r)?r-t:void 0},qA=e=>e==null?void 0:`${e} episode${e===1?``:`s`}`,JA=(e,t)=>{if(!e)return;let n=e.trim().replace(/^#/,``),r=n.length===3?n.split(``).map(e=>e+e).join(``):n.length===6?n:void 0;if(!r||!/^[0-9a-f]{6}$/i.test(r))return;let i=parseInt(r,16);return`rgba(${i>>16&255}, ${i>>8&255}, ${i&255}, ${t})`},YA=e=>({"--accent":JA(e,1)??`rgba(255, 255, 255, 0.75)`,"--accent-soft":JA(e,.18)??`rgba(255, 255, 255, 0.08)`,"--accent-wash":JA(e,.07)??`rgba(255, 255, 255, 0.03)`}),XA=(e,t=2)=>{if(!Number.isFinite(e)||e<=0)return;let n=[],r=e;for(let e of ZA){let i=Math.floor(r/e.ms);if(r-=i*e.ms,i&&(n.push(`${i} ${i===1?e.singular:e.plural}`),n.length>=t))break}return n.length?n.join(`, `):void 0},ZA=[{ms:864e5,singular:`day`,plural:`days`},{ms:36e5,singular:`hour`,plural:`hours`},{ms:6e4,singular:`min`,plural:`mins`},{ms:1e3,singular:`sec`,plural:`secs`}];j();var QA=3e4,$A=new Set,ej,tj=()=>{let[e,t]=B(()=>Date.now());return O(()=>($A.add(t),ej??=setInterval(()=>{let e=Date.now();for(let t of $A)t(e)},QA),()=>{$A.delete(t),!$A.size&&ej&&(clearInterval(ej),ej=void 0)}),[]),e},nj=e=>e>=75?`good`:e>=60?`mixed`:`poor`,rj={good:fl,mixed:tl,poor:Yc},ij={good:`#4ade80`,mixed:`#fb923c`,poor:`#f87171`},aj=x`
2443
2443
  display: inline-flex;
2444
2444
  align-items: center;
2445
2445
  gap: 0.6rem;
@@ -2448,7 +2448,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2448
2448
  .face {
2449
2449
  display: flex;
2450
2450
  }
2451
- `,tj=({percent:e,size:t=18})=>{let n=QA[ZA(e)];return k(`span`,{css:ej,"aria-label":`Rated ${e} percent`,children:[U(`span`,{className:`face`,style:{color:$A[ZA(e)]},children:U(n,{size:t})}),k(`span`,{className:`value`,children:[e,`%`]})]})},nj=x`
2451
+ `,oj=({percent:e,size:t=18})=>{let n=rj[nj(e)];return k(`span`,{css:aj,"aria-label":`Rated ${e} percent`,children:[U(`span`,{className:`face`,style:{color:ij[nj(e)]},children:U(n,{size:t})}),k(`span`,{className:`value`,children:[e,`%`]})]})},sj=x`
2452
2452
  display: grid;
2453
2453
  grid-template-columns: 15rem minmax(0, 1fr);
2454
2454
  height: 23rem;
@@ -2568,7 +2568,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2568
2568
  .description { -webkit-line-clamp: 3; }
2569
2569
  .chips { display: none; }
2570
2570
  }
2571
- `,rj=({media:e,to:t})=>{let n=XA(),r=dm(e.covers),i=e.covers?.find(e=>e.color)?.color,a=GA(VA(e,n)??0),o=e.nextAiringEpisode?.episodeNumber,s=ec(e.type),c=nc(e.season,e.seasonYear),l=[s,HA(e.episodeCount)].filter(Boolean).join(` • `);return k(ts,{to:t,css:nj,style:WA(i),children:[U(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0,children:k(`div`,{className:`cover-text`,children:[U(`div`,{className:`title`,children:e.titles?.at(0)?.title}),c&&U(`div`,{className:`season`,children:c})]})}),k(`div`,{className:`detail`,children:[k(`div`,{className:`detail-top`,children:[U(`div`,{children:a&&o!=null?k(H,{children:[k(`div`,{className:`airing-label`,children:[`Ep `,o,` airing in`]}),U(`div`,{className:`airing-value airing`,children:a})]}):U(`div`,{className:`airing-value`,children:tc(e.status)??`Unknown status`})}),e.averageScore!=null&&U(tj,{percent:e.averageScore})]}),l&&U(`div`,{className:`meta`,children:l}),U(`div`,{className:`description`,children:e.shortDescriptions?.at(0)?.shortDescription}),U(`div`,{className:`chips`,children:e.genres?.slice(0,2).map(e=>U(`span`,{className:`chip`,children:e.toLowerCase()},e))})]})]})},ij=x`
2571
+ `,cj=({media:e,to:t})=>{let n=tj(),r=gm(e.covers),i=e.covers?.find(e=>e.color)?.color,a=XA(KA(e,n)??0),o=e.nextAiringEpisode?.episodeNumber,s=ac(e.type),c=sc(e.season,e.seasonYear),l=[s,qA(e.episodeCount)].filter(Boolean).join(` • `);return k(os,{to:t,css:sj,style:YA(i),children:[U(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0,children:k(`div`,{className:`cover-text`,children:[U(`div`,{className:`title`,children:e.titles?.at(0)?.title}),c&&U(`div`,{className:`season`,children:c})]})}),k(`div`,{className:`detail`,children:[k(`div`,{className:`detail-top`,children:[U(`div`,{children:a&&o!=null?k(H,{children:[k(`div`,{className:`airing-label`,children:[`Ep `,o,` airing in`]}),U(`div`,{className:`airing-value airing`,children:a})]}):U(`div`,{className:`airing-value`,children:oc(e.status)??`Unknown status`})}),e.averageScore!=null&&U(oj,{percent:e.averageScore})]}),l&&U(`div`,{className:`meta`,children:l}),U(`div`,{className:`description`,children:e.shortDescriptions?.at(0)?.shortDescription}),U(`div`,{className:`chips`,children:e.genres?.slice(0,2).map(e=>U(`span`,{className:`chip`,children:e.toLowerCase()},e))})]})]})},lj=x`
2572
2572
  display: grid;
2573
2573
  grid-template-columns: 5rem minmax(0, 1fr) 11rem 11rem 17rem;
2574
2574
  align-items: center;
@@ -2647,7 +2647,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2647
2647
  .score { display: none; }
2648
2648
  .chips { display: none; }
2649
2649
  }
2650
- `,aj=({media:e,to:t})=>{let n=XA(),r=dm(e.covers),i=e.covers?.find(e=>e.color)?.color,a=GA(VA(e,n)??0,1),o=e.nextAiringEpisode?.episodeNumber;return k(ts,{to:t,css:ij,style:WA(i),children:[U(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0}),k(`div`,{className:`heading`,children:[U(`div`,{className:`title`,children:e.titles?.at(0)?.title}),U(`div`,{className:`chips`,children:e.genres?.slice(0,5).map(e=>U(`span`,{className:`chip`,children:e.toLowerCase()},e))})]}),k(`div`,{className:`column score`,children:[e.averageScore!=null&&U(tj,{percent:e.averageScore,size:17}),e.popularity!=null&&k(`span`,{className:`secondary`,children:[e.popularity.toLocaleString(),` users`]})]}),k(`div`,{className:`column format`,children:[U(`span`,{children:ec(e.type)}),e.episodeCount!=null&&U(`span`,{className:`secondary`,children:HA(e.episodeCount)})]}),k(`div`,{className:`column`,children:[U(`span`,{children:tc(e.status)}),a&&o!=null&&k(`span`,{className:`secondary airing`,children:[`Ep `,o,` airing in `,a]})]})]})},oj=[{value:`grid`,label:`Covers`},{value:`card`,label:`Cards`},{value:`list`,label:`List`}],sj=`grid`,cj=`stub-search-display-mode`,lj=oj.map(e=>e.value),uj=e=>lj.includes(e)?e:sj,dj=()=>{try{return globalThis.localStorage}catch{return}},fj=(e=dj())=>{try{return uj(e?.getItem(cj))}catch{return sj}},pj=(e,t=dj())=>{try{t?.setItem(cj,e)}catch{}},mj={grid:Kc,card:Gc,list:qc},hj=x`
2650
+ `,uj=({media:e,to:t})=>{let n=tj(),r=gm(e.covers),i=e.covers?.find(e=>e.color)?.color,a=XA(KA(e,n)??0,1),o=e.nextAiringEpisode?.episodeNumber;return k(os,{to:t,css:lj,style:YA(i),children:[U(`div`,{className:`cover`,style:r?{backgroundImage:`url(${r})`}:void 0}),k(`div`,{className:`heading`,children:[U(`div`,{className:`title`,children:e.titles?.at(0)?.title}),U(`div`,{className:`chips`,children:e.genres?.slice(0,5).map(e=>U(`span`,{className:`chip`,children:e.toLowerCase()},e))})]}),k(`div`,{className:`column score`,children:[e.averageScore!=null&&U(oj,{percent:e.averageScore,size:17}),e.popularity!=null&&k(`span`,{className:`secondary`,children:[e.popularity.toLocaleString(),` users`]})]}),k(`div`,{className:`column format`,children:[U(`span`,{children:ac(e.type)}),e.episodeCount!=null&&U(`span`,{className:`secondary`,children:qA(e.episodeCount)})]}),k(`div`,{className:`column`,children:[U(`span`,{children:oc(e.status)}),a&&o!=null&&k(`span`,{className:`secondary airing`,children:[`Ep `,o,` airing in `,a]})]})]})},dj=[{value:`grid`,label:`Covers`},{value:`card`,label:`Cards`},{value:`list`,label:`List`}],fj=`grid`,pj=`stub-search-display-mode`,mj=dj.map(e=>e.value),hj=e=>mj.includes(e)?e:fj,gj=()=>{try{return globalThis.localStorage}catch{return}},_j=(e=gj())=>{try{return hj(e?.getItem(pj))}catch{return fj}},vj=(e,t=gj())=>{try{t?.setItem(pj,e)}catch{}},yj={grid:Zc,card:Xc,list:Qc},bj=x`
2651
2651
  display: inline-flex;
2652
2652
  gap: 0.4rem;
2653
2653
  padding: 0.4rem;
@@ -2674,7 +2674,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2674
2674
  background: rgba(255, 255, 255, 0.12);
2675
2675
  color: #fff;
2676
2676
  }
2677
- `,gj=({mode:e,onChange:t})=>U(`div`,{css:hj,role:`group`,"aria-label":`Result layout`,children:oj.map(n=>{let r=mj[n.value];return U(`button`,{type:`button`,title:n.label,"aria-label":n.label,"aria-pressed":e===n.value,onClick:()=>t(n.value),children:U(r,{size:18})},n.value)})});j();var _j=x`
2677
+ `,xj=({mode:e,onChange:t})=>U(`div`,{css:bj,role:`group`,"aria-label":`Result layout`,children:dj.map(n=>{let r=yj[n.value];return U(`button`,{type:`button`,title:n.label,"aria-label":n.label,"aria-pressed":e===n.value,onClick:()=>t(n.value),children:U(r,{size:18})},n.value)})});j();var Sj=x`
2678
2678
  display: flex;
2679
2679
  flex-direction: column;
2680
2680
  gap: 0.7rem;
@@ -2723,8 +2723,8 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2723
2723
  }
2724
2724
 
2725
2725
  .control.open .chevron { transform: rotate(180deg); }
2726
- `,vj=x`
2727
- z-index: ${Ff.filterMenu};
2726
+ `,Cj=x`
2727
+ z-index: ${Bf.filterMenu};
2728
2728
  width: max-content;
2729
2729
  min-width: 22rem;
2730
2730
  max-width: 34rem;
@@ -2797,7 +2797,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2797
2797
  font-size: 1.4rem;
2798
2798
  color: rgba(255, 255, 255, 0.4);
2799
2799
  }
2800
- `,yj=({label:e,placeholder:t=`Any`,options:n,selected:r,onChange:i,multiple:a=!1,searchable:o=!1,allowCustom:s=!1})=>{let[c,l]=B(!1),[u,d]=B(``),f=`filter-${e.toLowerCase().replace(/[^a-z]+/g,`-`)}`,{refs:p,floatingStyles:m,context:h}=mf({open:c,onOpenChange:e=>{l(e),e||d(``)},placement:`bottom-start`,whileElementsMounted:_,middleware:[Wu(6),Ku({padding:8}),Gu({padding:8}),qu({padding:8,apply:({availableHeight:e,elements:t})=>{t.floating.style.maxHeight=`${Math.max(160,e)}px`}})]}),{getReferenceProps:g,getFloatingProps:v}=vf([cf(h),ff(h),bf(h,{role:`listbox`})]),y=r.map(e=>n.find(t=>t.value===e)?.label??e).join(`, `),b=V(()=>{let e=u.trim().toLowerCase(),t=e?n.filter(t=>t.label.toLowerCase().includes(e)):n;return!s||!e||t.some(t=>t.label.toLowerCase()===e)?t:[{value:u.trim(),label:u.trim()},...t]},[n,u,s]),x=e=>{if(!a){i(r.includes(e)?[]:[e]),l(!1),d(``);return}i(r.includes(e)?r.filter(t=>t!==e):[...r,e])};return k(`div`,{css:_j,children:[U(`span`,{className:`label`,id:f,children:e}),k(`button`,{ref:p.setReference,type:`button`,className:c?`control open`:`control`,"aria-labelledby":f,...g(),children:[U(`span`,{className:r.length?`value`:`value any`,children:r.length?y:t}),U(zc,{size:16,className:`chevron`})]}),c&&U(Vd,{children:U(Qd,{context:h,modal:!1,initialFocus:o?0:-1,children:k(`div`,{ref:p.setFloating,css:vj,style:m,...v(),children:[o&&k(`div`,{className:`filter`,children:[U(il,{size:15}),U(`input`,{type:`text`,value:u,placeholder:`Filter ${e.toLowerCase()}`,"aria-label":`Filter ${e.toLowerCase()}`,onInput:e=>d(e.currentTarget.value)})]}),U(`div`,{className:`options`,children:b.length?b.map(e=>k(`button`,{type:`button`,role:`option`,"aria-selected":r.includes(e.value),className:r.includes(e.value)?`option selected`:`option`,onClick:()=>x(e.value),children:[U(Rc,{size:16,className:r.includes(e.value)?`tick`:`tick hidden`}),U(`span`,{children:e.label})]},e.value)):k(`div`,{className:`empty`,children:[`Nothing matches “`,u,`”.`]})})]})})})]})},bj=({label:e,children:t})=>k(`div`,{css:_j,children:[U(`span`,{className:`label`,children:e}),t]});j();var xj=Bp(`
2800
+ `,wj=({label:e,placeholder:t=`Any`,options:n,selected:r,onChange:i,multiple:a=!1,searchable:o=!1,allowCustom:s=!1})=>{let[c,l]=B(!1),[u,d]=B(``),f=`filter-${e.toLowerCase().replace(/[^a-z]+/g,`-`)}`,{refs:p,floatingStyles:m,context:h}=yf({open:c,onOpenChange:e=>{l(e),e||d(``)},placement:`bottom-start`,whileElementsMounted:_,middleware:[Yu(6),Zu({padding:8}),Xu({padding:8}),Qu({padding:8,apply:({availableHeight:e,elements:t})=>{t.floating.style.maxHeight=`${Math.max(160,e)}px`}})]}),{getReferenceProps:g,getFloatingProps:v}=Cf([pf(h),_f(h),Tf(h,{role:`listbox`})]),y=r.map(e=>n.find(t=>t.value===e)?.label??e).join(`, `),b=V(()=>{let e=u.trim().toLowerCase(),t=e?n.filter(t=>t.label.toLowerCase().includes(e)):n;return!s||!e||t.some(t=>t.label.toLowerCase()===e)?t:[{value:u.trim(),label:u.trim()},...t]},[n,u,s]),x=e=>{if(!a){i(r.includes(e)?[]:[e]),l(!1),d(``);return}i(r.includes(e)?r.filter(t=>t!==e):[...r,e])};return k(`div`,{css:Sj,children:[U(`span`,{className:`label`,id:f,children:e}),k(`button`,{ref:p.setReference,type:`button`,className:c?`control open`:`control`,"aria-labelledby":f,...g(),children:[U(`span`,{className:r.length?`value`:`value any`,children:r.length?y:t}),U(Wc,{size:16,className:`chevron`})]}),c&&U(Kd,{children:U(rf,{context:h,modal:!1,initialFocus:o?0:-1,children:k(`div`,{ref:p.setFloating,css:Cj,style:m,...v(),children:[o&&k(`div`,{className:`filter`,children:[U(ll,{size:15}),U(`input`,{type:`text`,value:u,placeholder:`Filter ${e.toLowerCase()}`,"aria-label":`Filter ${e.toLowerCase()}`,onInput:e=>d(e.currentTarget.value)})]}),U(`div`,{className:`options`,children:b.length?b.map(e=>k(`button`,{type:`button`,role:`option`,"aria-selected":r.includes(e.value),className:r.includes(e.value)?`option selected`:`option`,onClick:()=>x(e.value),children:[U(Uc,{size:16,className:r.includes(e.value)?`tick`:`tick hidden`}),U(`span`,{children:e.label})]},e.value)):k(`div`,{className:`empty`,children:[`Nothing matches “`,u,`”.`]})})]})})})]})},Tj=({label:e,children:t})=>k(`div`,{css:Sj,children:[U(`span`,{className:`label`,children:e}),t]});j();var Ej=Gp(`
2801
2801
  subscription SearchMediaPage($input: MediaPageInput!, $shortDescriptionInput: MediaShortDescriptionInput!) {
2802
2802
  mediaPage(input: $input) {
2803
2803
  nodes {
@@ -2844,7 +2844,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2844
2844
  }
2845
2845
  }
2846
2846
  }
2847
- `),Sj=x`
2847
+ `),Dj=x`
2848
2848
  padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
2849
2849
  min-height: 100vh;
2850
2850
 
@@ -2981,7 +2981,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
2981
2981
  gap: 1.2rem;
2982
2982
  }
2983
2983
  }
2984
- `,Cj=(()=>{let e=[];for(let t=Ks();t>=Gs;t--)e.push({value:String(t),label:String(t)});return e})(),wj=e=>({...e.query?{search:e.query}:{sorts:[fs.PopularityDesc]},...e.category?{categories:[e.category]}:{},...e.status?{status:e.status}:{},...e.season?{season:e.season}:{},...e.year?{seasonYear:e.year}:{},...e.formats.length?{formats:e.formats}:{},...e.genres.length?{genres:e.genres}:{},...e.tags.length?{tags:e.tags}:{}}),Tj=()=>{let e=Jo(),[,t]=qo(),n=V(()=>Js(e),[e]),r=rc(n),i=ic(n),a=e=>t(Qs({...n,...e}),{replace:!0}),[o,s]=B(n.query),c=R(null);O(()=>{document.activeElement!==c.current&&s(e=>e.trim()===n.query?e:n.query)},[n.query]),O(()=>{if(o.trim()===n.query)return;let e=setTimeout(()=>a({query:o}),350);return()=>clearTimeout(e)},[o,e]);let l=V(()=>wj(n),[n]),[{data:u}]=yr({query:xj,variables:{input:l,shortDescriptionInput:{count:1}},pause:!i}),[d,f]=B(fj),p=e=>{f(e),pj(e)},[m,h]=B(!1);O(()=>{h(!1);let e=setTimeout(()=>h(!0),5e3);return()=>clearTimeout(e)},[e]);let g=R(u),_=R(l);u!==g.current&&(g.current=u,_.current=l);let v=i&&_.current===l?u?.mediaPage?.nodes??[]:[],{genreOptions:y,tagOptions:b,genreKeys:x}=V(()=>{let e=new Map(Fs.map(e=>[e.toLowerCase(),e])),t=new Map;for(let t of n.genres)e.set(t.toLowerCase(),t);for(let e of n.tags)t.set(e.toLowerCase(),e);for(let n of v){for(let t of n.genres??[])e.has(t.toLowerCase())||e.set(t.toLowerCase(),t);for(let r of n.tags??[])!e.has(r.toLowerCase())&&!t.has(r.toLowerCase())&&t.set(r.toLowerCase(),r)}let r=(e,t)=>e.localeCompare(t);return{genreKeys:new Set(e.keys()),genreOptions:[...e.values()].sort(r).map(e=>({value:e,label:e})),tagOptions:[...t.values()].sort(r).map(e=>({value:e,label:e}))}},[v,n.genres,n.tags]),S=[...n.genres,...n.tags],C=e=>x.has(e.toLowerCase())||Ls(e),w=e=>a({genres:e.filter(C),tags:e.filter(e=>!C(e))}),T={grid:{className:`grid`,item:e=>U(Lm,{media:e,to:cs(J.MEDIA,{uri:e.uri}),ellipsis:!1},e._id)},card:{className:`cards`,item:e=>U(rj,{media:e,to:cs(J.MEDIA,{uri:e.uri})},e._id)},list:{className:`rows`,item:e=>U(aj,{media:e,to:cs(J.MEDIA,{uri:e.uri})},e._id)}}[d],E=[...n.year?[{key:`year`,label:String(n.year),clear:{year:null}}]:[],...n.season?[{key:`season`,label:Ns.find(e=>e.value===n.season).label,clear:{season:null}}]:[],...n.status?[{key:`status`,label:Ms.find(e=>e.value===n.status).label,clear:{status:null}}]:[],...n.category?[{key:`category`,label:Ps.find(e=>e.value===n.category).label,clear:{category:null}}]:[],...n.formats.map(e=>({key:`format:${e}`,label:js.find(t=>t.value===e).label,clear:{formats:n.formats.filter(t=>t!==e)}})),...n.genres.map(e=>({key:`genre:${e}`,label:e,clear:{genres:n.genres.filter(t=>t!==e)}})),...n.tags.map(e=>({key:`tag:${e}`,label:e,clear:{tags:n.tags.filter(t=>t!==e)}}))];return k(`div`,{css:Sj,children:[k(`div`,{className:`heading-row`,children:[U(`div`,{className:`heading`,children:$s(n)}),U(gj,{mode:d,onChange:p})]}),k(`div`,{className:`filters`,children:[U(bj,{label:`Search`,children:k(`div`,{className:`text-field`,children:[U(il,{size:17}),U(`input`,{ref:c,type:`text`,value:o,placeholder:`Any title`,"aria-label":`Search by title`,onInput:e=>s(e.currentTarget.value)})]})}),U(yj,{label:`Genres & Tags`,options:[...y,...b],selected:S,onChange:w,multiple:!0,searchable:!0,allowCustom:!0}),U(yj,{label:`Year`,options:Cj,selected:n.year?[String(n.year)]:[],onChange:e=>a({year:e.length?Number(e[0]):null}),searchable:!0}),U(yj,{label:`Season`,options:Ns,selected:n.season?[n.season]:[],onChange:e=>a({season:e[0]??null})}),U(yj,{label:`Format`,options:js,selected:n.formats,onChange:e=>a({formats:e}),multiple:!0}),U(yj,{label:`Airing Status`,options:Ms,selected:n.status?[n.status]:[],onChange:e=>a({status:e[0]??null})}),U(yj,{label:`Category`,options:Ps,selected:n.category?[n.category]:[],onChange:e=>a({category:e[0]??null})})]}),k(`div`,{className:`chips`,children:[E.map(e=>k(`button`,{type:`button`,className:`chip`,"aria-label":`Remove ${e.label}`,onClick:()=>a(e.clear),children:[e.label,U(hl,{size:14})]},e.key)),E.length>1&&U(`button`,{type:`button`,className:`chip-clear`,onClick:()=>a({category:null,status:null,season:null,year:null,formats:[],genres:[],tags:[]}),children:`Clear filters`})]}),v.length?U(`div`,{className:T.className,children:v.map(T.item)}):i?U(`div`,{className:`status`,children:m?`No results found.`:`Searching…`}):r?U(`div`,{className:`status`,children:`Add a title, a season, a year, a format or a genre to browse.`}):U(`div`,{className:`status`,children:`Search by title, or pick a filter to browse.`})]})},Ej=x`
2984
+ `,Oj=(()=>{let e=[];for(let t=Zs();t>=Xs;t--)e.push({value:String(t),label:String(t)});return e})(),kj=e=>({...e.query?{search:e.query}:{sorts:[_s.PopularityDesc]},...e.category?{categories:[e.category]}:{},...e.status?{status:e.status}:{},...e.season?{season:e.season}:{},...e.year?{seasonYear:e.year}:{},...e.formats.length?{formats:e.formats}:{},...e.genres.length?{genres:e.genres}:{},...e.tags.length?{tags:e.tags}:{}}),Aj=()=>{let e=$o(),[,t]=Qo(),n=V(()=>$s(e),[e]),r=cc(n),i=lc(n),a=e=>t(rc({...n,...e}),{replace:!0}),[o,s]=B(n.query),c=R(null);O(()=>{document.activeElement!==c.current&&s(e=>e.trim()===n.query?e:n.query)},[n.query]),O(()=>{if(o.trim()===n.query)return;let e=setTimeout(()=>a({query:o}),350);return()=>clearTimeout(e)},[o,e]);let l=V(()=>kj(n),[n]),[{data:u}]=wr({query:Ej,variables:{input:l,shortDescriptionInput:{count:1}},pause:!i}),[d,f]=B(_j),p=e=>{f(e),vj(e)},[m,h]=B(!1);O(()=>{h(!1);let e=setTimeout(()=>h(!0),5e3);return()=>clearTimeout(e)},[e]);let g=R(u),_=R(l);u!==g.current&&(g.current=u,_.current=l);let v=i&&_.current===l?u?.mediaPage?.nodes??[]:[],{genreOptions:y,tagOptions:b,genreKeys:x}=V(()=>{let e=new Map(Bs.map(e=>[e.toLowerCase(),e])),t=new Map;for(let t of n.genres)e.set(t.toLowerCase(),t);for(let e of n.tags)t.set(e.toLowerCase(),e);for(let n of v){for(let t of n.genres??[])e.has(t.toLowerCase())||e.set(t.toLowerCase(),t);for(let r of n.tags??[])!e.has(r.toLowerCase())&&!t.has(r.toLowerCase())&&t.set(r.toLowerCase(),r)}let r=(e,t)=>e.localeCompare(t);return{genreKeys:new Set(e.keys()),genreOptions:[...e.values()].sort(r).map(e=>({value:e,label:e})),tagOptions:[...t.values()].sort(r).map(e=>({value:e,label:e}))}},[v,n.genres,n.tags]),S=[...n.genres,...n.tags],C=e=>x.has(e.toLowerCase())||Hs(e),w=e=>a({genres:e.filter(C),tags:e.filter(e=>!C(e))}),T={grid:{className:`grid`,item:e=>U(Hm,{media:e,to:ps(J.MEDIA,{uri:e.uri}),ellipsis:!1},e._id)},card:{className:`cards`,item:e=>U(cj,{media:e,to:ps(J.MEDIA,{uri:e.uri})},e._id)},list:{className:`rows`,item:e=>U(uj,{media:e,to:ps(J.MEDIA,{uri:e.uri})},e._id)}}[d],E=[...n.year?[{key:`year`,label:String(n.year),clear:{year:null}}]:[],...n.season?[{key:`season`,label:Rs.find(e=>e.value===n.season).label,clear:{season:null}}]:[],...n.status?[{key:`status`,label:Ls.find(e=>e.value===n.status).label,clear:{status:null}}]:[],...n.category?[{key:`category`,label:zs.find(e=>e.value===n.category).label,clear:{category:null}}]:[],...n.formats.map(e=>({key:`format:${e}`,label:Is.find(t=>t.value===e).label,clear:{formats:n.formats.filter(t=>t!==e)}})),...n.genres.map(e=>({key:`genre:${e}`,label:e,clear:{genres:n.genres.filter(t=>t!==e)}})),...n.tags.map(e=>({key:`tag:${e}`,label:e,clear:{tags:n.tags.filter(t=>t!==e)}}))];return k(`div`,{css:Dj,children:[k(`div`,{className:`heading-row`,children:[U(`div`,{className:`heading`,children:ic(n)}),U(xj,{mode:d,onChange:p})]}),k(`div`,{className:`filters`,children:[U(Tj,{label:`Search`,children:k(`div`,{className:`text-field`,children:[U(ll,{size:17}),U(`input`,{ref:c,type:`text`,value:o,placeholder:`Any title`,"aria-label":`Search by title`,onInput:e=>s(e.currentTarget.value)})]})}),U(wj,{label:`Genres & Tags`,options:[...y,...b],selected:S,onChange:w,multiple:!0,searchable:!0,allowCustom:!0}),U(wj,{label:`Year`,options:Oj,selected:n.year?[String(n.year)]:[],onChange:e=>a({year:e.length?Number(e[0]):null}),searchable:!0}),U(wj,{label:`Season`,options:Rs,selected:n.season?[n.season]:[],onChange:e=>a({season:e[0]??null})}),U(wj,{label:`Format`,options:Is,selected:n.formats,onChange:e=>a({formats:e}),multiple:!0}),U(wj,{label:`Airing Status`,options:Ls,selected:n.status?[n.status]:[],onChange:e=>a({status:e[0]??null})}),U(wj,{label:`Category`,options:zs,selected:n.category?[n.category]:[],onChange:e=>a({category:e[0]??null})})]}),k(`div`,{className:`chips`,children:[E.map(e=>k(`button`,{type:`button`,className:`chip`,"aria-label":`Remove ${e.label}`,onClick:()=>a(e.clear),children:[e.label,U(bl,{size:14})]},e.key)),E.length>1&&U(`button`,{type:`button`,className:`chip-clear`,onClick:()=>a({category:null,status:null,season:null,year:null,formats:[],genres:[],tags:[]}),children:`Clear filters`})]}),v.length?U(`div`,{className:T.className,children:v.map(T.item)}):i?U(`div`,{className:`status`,children:m?`No results found.`:`Searching…`}):r?U(`div`,{className:`status`,children:`Add a title, a season, a year, a format or a genre to browse.`}):U(`div`,{className:`status`,children:`Search by title, or pick a filter to browse.`})]})},jj=x`
2985
2985
  max-width: 72rem;
2986
2986
  margin: 0 auto;
2987
2987
  padding: calc(var(--stub-header-height) + 3rem) 3rem 6rem;
@@ -3020,7 +3020,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3020
3020
  color: #ff8a3d;
3021
3021
  }
3022
3022
  }
3023
- `,Dj=({children:e})=>U(`div`,{css:Ej,children:e}),Oj=()=>k(Dj,{children:[U(`h1`,{children:`Legal & Terms`}),U(`div`,{className:`updated`,children:`Last updated 1 June 2026`}),U(`p`,{children:`stub is an independent, non-commercial personal project, provided “as is” without warranties of any kind.`}),U(`h2`,{children:`No hosted content`}),U(`p`,{children:`stub hosts, stores, and distributes no media of its own. All titles, descriptions, artwork, ratings, and playback streams are retrieved on demand from third-party services (including AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix) and remain the property of their respective owners. You access those services with your own accounts and are responsible for complying with their terms.`}),U(`h2`,{children:`Personal use`}),U(`p`,{children:`stub is a technical showcase of in-browser media aggregation, intended for personal, non-commercial use. It is not a content provider.`}),U(`h2`,{children:`Privacy`}),k(`p`,{children:[`stub keeps no accounts and stores no personal data. See the`,` `,U(ts,{href:cs(J.PRIVACY),children:`Privacy page`}),` for what is and isn’t handled when you use it.`]}),U(`h2`,{children:`Rights holders`}),k(`p`,{children:[`stub stores no content itself; anything you see lives on the third-party service it came from. If you are a rights holder with a concern, you can reach the maintainer through the project repository at`,` `,U(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]}),U(`h2`,{children:`Liability`}),U(`p`,{children:`stub is provided without warranty of any kind. The maintainer is not liable for any damages arising from its use, or for the availability, accuracy, or legality of any third-party service it connects to.`})]}),kj=`This browser, in its storage for stub at this address`,Aj=`This tab, in its storage for stub`,jj=[{id:`added-sources`,title:`Added sources`,what:`The source packages you added from npm, installed for stub through FKN.`,where:kj,lasts:`Until you remove them`,keys:{store:`local`,names:[kr]}},{id:`search-layout`,title:`Search layout`,what:`Whether search shows covers, cards or a list.`,where:kj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[cj]}},{id:`quick-tracking`,title:`Quick tracking choices`,what:`The trackers you chose not to save to from the tracking row.`,where:kj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[_O]}},{id:`connected-sites`,title:`Connected tracking sites`,what:`Which of AniList and MyAnimeList you signed in to through stub on this device, so stub reaches only those.`,where:kj,lasts:`Until you sign out of them`,keys:{store:`local`,names:[Ke]}},{id:`site-status`,title:`Site sign-in states`,what:`Whether you were signed in to Crunchyroll, AniList and MyAnimeList when stub last learned it, and when. Never your name there.`,where:kj,lasts:`Until stub learns it again, or you clear this site's data in your browser`,keys:{store:`local`,names:[Ie]}},{id:`party-name`,title:`Party name`,what:`The name you gave yourself in a watch party.`,where:Aj,lasts:`Until you close the tab`,keys:{store:`session`,names:[up]}},{id:`party-invite`,title:`Party you are in`,what:`The watch party this tab is in, so a reload rejoins it.`,where:Aj,lasts:`Until you leave the party or close the tab`,keys:{store:`session`,names:[lp]}},{id:`stub-list`,title:`Stub's list`,what:`What you track with stub's own tracker: status, progress, score and dates, with each title's name and cover. Signed in to FKN, stub uses your account's list instead, encrypted in this browser before it is stored.`,where:`The browser's private files for stub at this address, on this device only, and your FKN account's storage once you use its list`,lasts:`As long as the list: a removed entry stays in it, with its title and last values, as a record that it was removed`},{id:`site-sign-ins`,title:`Site sign-ins`,what:`Your Crunchyroll, AniList and MyAnimeList sessions, which stub plays and tracks with.`,where:`Without the FKN extension, FKN keeps them for every fkn.app app. With it, your browser does.`,lasts:`Until you sign out, or the site ends the session`},{id:`fkn-account`,title:`FKN account`,what:`Which FKN account you are signed in with.`,where:`FKN, not stub`,lasts:`Until you disconnect`},{id:`player`,title:`Player volume`,what:`The volume you last left the episode player at, and whether it was muted, so the next episode starts the same. Speed and captions are not kept.`,where:kj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[A]}},{id:`fetched`,title:`Titles, artwork and streams`,what:`What stub fetched to show you.`,where:`Memory, in this tab`,lasts:`Until you refresh or close the tab`}],Mj=x`
3023
+ `,Mj=({children:e})=>U(`div`,{css:jj,children:e}),Nj=()=>k(Mj,{children:[U(`h1`,{children:`Legal & Terms`}),U(`div`,{className:`updated`,children:`Last updated 1 June 2026`}),U(`p`,{children:`stub is an independent, non-commercial personal project, provided “as is” without warranties of any kind.`}),U(`h2`,{children:`No hosted content`}),U(`p`,{children:`stub hosts, stores, and distributes no media of its own. All titles, descriptions, artwork, ratings, and playback streams are retrieved on demand from third-party services (including AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix) and remain the property of their respective owners. You access those services with your own accounts and are responsible for complying with their terms.`}),U(`h2`,{children:`Personal use`}),U(`p`,{children:`stub is a technical showcase of in-browser media aggregation, intended for personal, non-commercial use. It is not a content provider.`}),U(`h2`,{children:`Privacy`}),k(`p`,{children:[`stub keeps no accounts and stores no personal data. See the`,` `,U(os,{href:ps(J.PRIVACY),children:`Privacy page`}),` for what is and isn’t handled when you use it.`]}),U(`h2`,{children:`Rights holders`}),k(`p`,{children:[`stub stores no content itself; anything you see lives on the third-party service it came from. If you are a rights holder with a concern, you can reach the maintainer through the project repository at`,` `,U(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]}),U(`h2`,{children:`Liability`}),U(`p`,{children:`stub is provided without warranty of any kind. The maintainer is not liable for any damages arising from its use, or for the availability, accuracy, or legality of any third-party service it connects to.`})]}),Pj=`This browser, in its storage for stub at this address`,Fj=`This tab, in its storage for stub`,Ij=[{id:`added-sources`,title:`Added sources`,what:`The source packages you added from npm, installed for stub through FKN.`,where:Pj,lasts:`Until you remove them`,keys:{store:`local`,names:[Pr]}},{id:`turned-off-sources`,title:`Sources turned off`,what:`Which of the sources stub ships with you turned off, so stub does not ask them.`,where:Pj,lasts:`Until you turn them back on`,keys:{store:`local`,names:[$e]}},{id:`search-layout`,title:`Search layout`,what:`Whether search shows covers, cards or a list.`,where:Pj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[pj]}},{id:`quick-tracking`,title:`Quick tracking choices`,what:`The trackers you chose not to save to from the tracking row.`,where:Pj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[SO]}},{id:`connected-sites`,title:`Connected tracking sites`,what:`Which of AniList and MyAnimeList you signed in to through stub on this device, so stub reaches only those.`,where:Pj,lasts:`Until you sign out of them`,keys:{store:`local`,names:[Ke]}},{id:`site-status`,title:`Site sign-in states`,what:`Whether you were signed in to Crunchyroll, AniList and MyAnimeList when stub last learned it, and when. Never your name there.`,where:Pj,lasts:`Until stub learns it again, or you clear this site's data in your browser`,keys:{store:`local`,names:[Ie]}},{id:`party-name`,title:`Party name`,what:`The name you gave yourself in a watch party.`,where:Fj,lasts:`Until you close the tab`,keys:{store:`session`,names:[hp]}},{id:`party-invite`,title:`Party you are in`,what:`The watch party this tab is in, so a reload rejoins it.`,where:Fj,lasts:`Until you leave the party or close the tab`,keys:{store:`session`,names:[mp]}},{id:`stub-list`,title:`Stub's list`,what:`What you track with stub's own tracker: status, progress, score and dates, with each title's name and cover. Signed in to FKN, stub uses your account's list instead, encrypted in this browser before it is stored.`,where:`The browser's private files for stub at this address, on this device only, and your FKN account's storage once you use its list`,lasts:`As long as the list: a removed entry stays in it, with its title and last values, as a record that it was removed`},{id:`site-sign-ins`,title:`Site sign-ins`,what:`Your Crunchyroll, AniList and MyAnimeList sessions, which stub plays and tracks with.`,where:`Without the FKN extension, FKN keeps them for every fkn.app app. With it, your browser does.`,lasts:`Until you sign out, or the site ends the session`},{id:`fkn-account`,title:`FKN account`,what:`Which FKN account you are signed in with.`,where:`FKN, not stub`,lasts:`Until you disconnect`},{id:`player`,title:`Player volume`,what:`The volume you last left the episode player at, and whether it was muted, so the next episode starts the same. Speed and captions are not kept.`,where:Pj,lasts:`Until you clear this site's data in your browser`,keys:{store:`local`,names:[A]}},{id:`fetched`,title:`Titles, artwork and streams`,what:`What stub fetched to show you.`,where:`Memory, in this tab`,lasts:`Until you refresh or close the tab`}],Lj=x`
3024
3024
  display: flex;
3025
3025
  flex-direction: column;
3026
3026
  gap: 1rem;
@@ -3035,7 +3035,107 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3035
3035
 
3036
3036
  strong { color: #fff; }
3037
3037
  .facts { color: rgba(255, 255, 255, 0.55); }
3038
- `,Nj=e=>e.endsWith(`.`)?e:`${e}.`,Pj=()=>k(Dj,{children:[U(`h1`,{children:`Privacy`}),U(`div`,{className:`updated`,children:`Last updated 10 October 2026`}),U(`p`,{children:`stub is an independent, non-commercial personal project. In short: it has no accounts and no server of its own, runs no analytics, and keeps your settings and your watch list in your browser, or in your own FKN account when you choose to.`}),U(`h2`,{children:`What stub keeps`}),k(`p`,{children:[`stub sets no advertising or tracking cookies and runs no analytics or telemetry. This is everything it keeps, where, and for how long. You sign out of a site in`,` `,U(ts,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, and remove a source you added in`,` `,U(ts,{to:`/settings#sources`,children:`Settings, under Sources`}),`. Clearing this site's data in your browser removes everything stub keeps in this browser.`]}),U(`ul`,{css:Mj,children:jj.map(e=>k(`li`,{children:[k(`strong`,{children:[e.title,`.`]}),` `,e.what,` `,k(`span`,{className:`facts`,children:[`Where: `,Nj(e.where),` How long: `,Nj(e.lasts)]})]},e.id))}),U(`p`,{children:`About stub's list: signed out, it is saved in your browser's storage for stub, on this device only. Signed in to an FKN account, stub uses that account's list instead: your changes are saved on the device and in the account's storage, encrypted in your browser before they leave the device, so every device signed in to the same account shows them. A list you kept before signing in is added to the account only if you choose to. When you sign out, the account's list is removed from the device. Removing an entry keeps a record that it was removed, with the entry's title and last values, so that every device using the list removes it too. There is no way to clear these records yet.`}),U(`h2`,{children:`Sign-ins to other sites`}),k(`p`,{children:[`stub plays Crunchyroll and tracks your AniList and MyAnimeList lists with your own accounts on those sites. Without the FKN browser extension, you sign in on each site's own page, in an FKN window, and the cookies that sign-in sets are kept by FKN, in a cookie jar every fkn.app app shares, and not by stub. Signing out in `,U(ts,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, removes that site's cookies from FKN. The site itself is not told, so its session stays valid there until it expires, held by nobody.`]}),U(`p`,{children:`With the extension, stub uses your browser's own sessions for these sites and for Netflix. Those stay in your browser, and you sign in and out of them on the sites themselves.`}),U(`h2`,{children:`Network requests & third parties`}),k(`p`,{children:[`To fetch titles, artwork, and streams, stub sends requests through the FKN platform proxy, which then reaches third-party services such as AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix. The proxy requires no account. It uses your IP address to rate-limit requests, and it keeps a copy of each answer for a while, under a key made from the whole request (its address, headers and body), so only an identical request is answered from that copy. How the FKN platform handles that data is described in the`,` `,U(`a`,{href:`https://fkn.app/privacy`,target:`_blank`,rel:`noreferrer noopener`,children:`FKN platform privacy policy`}),`. Each third-party service receives the requests made to it and applies its own privacy policy, especially when you sign in to one (for example Crunchyroll) to watch.`]}),U(`h2`,{children:`The optional browser extension`}),U(`p`,{children:`If you install the FKN browser extension, it works with your own already-logged-in sessions locally on your device so you can play content you have access to. Those credentials stay in your browser; stub never receives them.`}),U(`h2`,{children:`Your control`}),U(`p`,{children:`Disconnecting from FKN, in the account menu at the top right, takes your account's list off the device. Your party name and the party you are in go when you close the tab. If you use the browser extension, you can review and revoke its access at any time from the extension itself.`}),U(`h2`,{children:`Contact`}),k(`p`,{children:[`Questions about privacy can be raised through the project repository at`,` `,U(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]})]});j();var Fj=({label:e,name:t=e,confirmLabel:n,busyLabel:r,question:i,onConfirm:a,home:o})=>{let[s,c]=B(!1),[l,u]=B(!1),d=R(null),f=R(null),p=R(null),m=R(!1),h=R(!0),g=he(),_=()=>{let e=document.activeElement;return!e||e===document.body||!!p.current?.contains(e)};return O(()=>()=>{h.current=!1,p.current&&_()&&o?.current?.focus()},[]),_e(()=>{s?f.current?.focus():m.current&&d.current?.focus(),m.current=!1},[s]),s?k(`div`,{ref:p,className:`confirm`,role:`group`,"aria-label":t,children:[U(`p`,{id:g,children:i}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`danger`,"aria-describedby":g,disabled:l,onClick:()=>{u(!0),Promise.resolve().then(a).catch(()=>{}).finally(()=>{if(!h.current)return;let e=_();u(!1),c(!1),e&&(o?.current?o.current.focus():m.current=!0)})},children:l?r:n}),U(`button`,{ref:f,type:`button`,className:`secondary`,"aria-describedby":g,disabled:l,onClick:()=>{m.current=!0,c(!1)},children:`Cancel`})]})]}):U(`button`,{ref:d,type:`button`,className:`secondary`,"aria-label":t===e?void 0:t,onClick:()=>c(!0),children:e})};j();var Ij=e=>e instanceof Error?e.message:String(e),Lj=(e,t)=>{switch(t){case`authed`:return{text:`Signed in to ${e}.`};case`closed`:return{text:`The sign-in window closed. If you finished signing in there, stub reads it from now on.`};case`blocked`:return{text:`The browser blocked the sign-in window. Allow pop-ups for this page and try again.`,error:!0};case`unsupported`:return{text:`Connected to your browser's own ${e} session.`}}},Rj={"signed-in":`Signed in`,"signed-out":`Signed out`},zj=(e,t)=>{let n=GA(t-e.checkedAt,1);return`${Rj[e.state]}, checked ${n?`${n} ago`:`just now`}`},Bj=(e,t)=>{let[,n]=B(0);return O(()=>e.watch(t,()=>n(e=>e+1)),[e,t]),e.read(t)},Vj=({site:e,name:t,backend:n,status:r,onNote:i})=>{let[a,o]=B(!1),s=Wj();return U(`button`,{type:`button`,className:`secondary`,disabled:a,"aria-label":`Check whether you are signed in to ${t}`,onClick:()=>{o(!0),i(void 0),r.check(e,n).catch(e=>{s.current&&i({text:`stub could not tell whether you are signed in to ${t}: ${Ij(e)}`,error:!0})}).finally(()=>{s.current&&o(!1)})},children:a?`Checking...`:`Check now`})},Hj=({id:e,title:t,state:n,on:r,heading:i,children:a})=>k(`div`,{className:`row account`,"data-account":e,children:[k(`div`,{className:`head`,children:[U(`h3`,{ref:i,tabIndex:-1,children:t}),n?U(`span`,{className:`state${r?` on`:``}`,children:n}):void 0]}),a]}),Uj=({note:e})=>U(`p`,{className:`note${e?.error?` error`:``}`,role:`status`,children:e?.text}),Wj=()=>{let e=R(!0);return O(()=>()=>{e.current=!1},[]),e},Gj=`Without the FKN extension, the session is kept by FKN, in the cookie jar every fkn.app app shares, and not by stub.`,Kj=e=>`${e} itself is not told, so the session stays valid there until it expires, held by nobody.`,qj=({backend:e,crunchyroll:t,status:n,now:r})=>{let[i,a]=B(!1),[o,s]=B(),c=Wj(),l=R(null),u=Bj(n,`crunchyroll`),d=e?U(Vj,{site:`crunchyroll`,name:`Crunchyroll`,backend:e,status:n,onNote:s}):void 0;return k(Hj,{id:`crunchyroll`,title:`Crunchyroll`,state:u?zj(u,r()):`Not checked yet`,on:u?.state===`signed-in`,heading:l,children:[U(`p`,{children:`Plays Crunchyroll episodes on your own Crunchyroll account.`}),e===`cloud`?k(H,{children:[k(`p`,{children:[Gj,` Check now asks Crunchyroll whether that session is signed in, without loading a Crunchyroll page.`]}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,disabled:i,onClick:()=>{let e=t.signIn();a(!0),s(void 0),e.then(e=>{c.current&&s(Lj(`Crunchyroll`,e))}).catch(e=>{c.current&&s({text:Ij(e),error:!0})}).finally(()=>{c.current&&a(!1)})},children:i?`Signing in...`:`Sign in`}),U(Fj,{label:`Sign out`,name:`Sign out of Crunchyroll`,home:l,confirmLabel:`Yes, sign out`,busyLabel:`Signing out...`,question:`Sign out of Crunchyroll? This removes its cookies from FKN's jar, which signs every fkn.app app out of Crunchyroll. ${Kj(`Crunchyroll`)}`,onConfirm:()=>t.signOut().then(()=>{c.current&&s({text:`Signed out. FKN no longer holds a Crunchyroll session for fkn.app apps.`})},e=>{c.current&&s({text:`FKN could not remove the Crunchyroll cookies: ${Ij(e)}. Try again.`,error:!0})})}),d]})]}):e===`extension`?k(H,{children:[U(`p`,{children:`With the FKN extension, stub plays it on your browser's own crunchyroll.com session and keeps nothing of it. Sign in and out on crunchyroll.com.`}),k(`div`,{className:`actions`,children:[U(`a`,{className:`link`,href:`https://www.crunchyroll.com`,target:`_blank`,rel:`noreferrer`,children:`Open crunchyroll.com`}),d]})]}):U(`p`,{children:`Checking whether the FKN extension runs here...`}),U(Uj,{note:o})]})},Jj=[{site:`anilist`,name:`AniList`,host:`anilist.co`},{site:`mal`,name:`MyAnimeList`,host:`myanimelist.net`}],Yj=({site:e,name:t,host:n,backend:r,sites:i,status:a,now:o})=>{let[s,c]=B(()=>i.isConnected(e)),[l,u]=B(!1),[d,f]=B(),p=Wj(),m=R(null),h=Bj(a,e);O(()=>(c(i.isConnected(e)),i.watch(e,()=>{p.current&&c(i.isConnected(e))})),[i,e]);let g=()=>{p.current&&c(i.isConnected(e))},_=()=>{let n=i.signIn(e);u(!0),f(void 0),n.then(e=>{p.current&&f(Lj(t,e))}).catch(e=>{p.current&&f({text:Ij(e),error:!0})}).finally(()=>{p.current&&u(!1),g()})},v=r=>i.signOut(e,r).then(()=>{p.current&&f({text:r===`cloud`?`Signed out. stub no longer uses ${t} on this device, and FKN no longer holds its session.`:`Disconnected. To sign out of ${t} itself, sign out on ${n}.`}),g()},e=>{p.current&&f({text:`Disconnected on this device, but FKN could not remove the ${t} cookies: ${Ij(e)}. Sign in and out again to retry.`,error:!0}),g()});return k(Hj,{id:e,title:t,state:s?h?zj(h,o()):`Connected on this device`:`Not connected`,on:s&&h?.state!==`signed-out`,heading:m,children:[k(`p`,{children:[`Tracks your `,t,` list with your own `,n,` session.`,` `,r===`cloud`?Gj:r===`extension`?`With the FKN extension, stub uses your browser's own ${n} session.`:``]}),r?k(`div`,{className:`actions`,children:[s?U(Fj,{label:r===`cloud`?`Sign out`:`Disconnect`,name:r===`cloud`?`Sign out of ${t}`:`Disconnect ${t}`,home:m,confirmLabel:r===`cloud`?`Yes, sign out`:`Yes, disconnect`,busyLabel:r===`cloud`?`Signing out...`:`Disconnecting...`,question:r===`cloud`?`Sign out of ${t}? stub stops using it on this device, and its cookies leave FKN's jar, which signs every fkn.app app out of ${t}. ${Kj(t)}`:`Disconnect ${t}? stub stops using your ${n} session on this device. You stay signed in on ${n}.`,onConfirm:()=>v(r)}):U(`button`,{type:`button`,disabled:l,onClick:_,children:l?`Signing in...`:r===`cloud`?`Sign in`:`Connect`}),s?U(Vj,{site:e,name:t,backend:r,status:a,onNote:f}):void 0]}):void 0,U(Uj,{note:d})]})},Xj=({backend:e})=>U(Hj,{id:`netflix`,title:`Netflix`,children:e===`extension`?k(H,{children:[U(`p`,{children:`stub plays Netflix on your browser's own netflix.com session, through the FKN extension, and keeps nothing of it. Sign in and out on netflix.com.`}),U(`div`,{className:`actions`,children:U(`a`,{className:`link`,href:`https://www.netflix.com`,target:`_blank`,rel:`noreferrer`,children:`Open netflix.com`})})]}):U(`p`,{children:`Netflix needs the FKN browser extension: stub plays it on your browser's own netflix.com session, and keeps nothing of it.`})}),Zj=({backend:e,crunchyroll:t,sites:n,status:r,now:i=Date.now})=>k(`div`,{className:`rows`,children:[U(qj,{backend:e,crunchyroll:t,status:r,now:i}),Jj.map(t=>U(Yj,{...t,backend:e,sites:n,status:r,now:i},t.site)),U(Xj,{backend:e})]}),Qj=[{id:`accounts`,title:`Accounts`,intro:`The sites where stub uses your own account, what each one is for, and how to sign out.`},{id:`sources`,title:`Sources`,intro:`Community-made sources, published on npm. FKN installs them for stub, and each one runs isolated from stub.`}],$j=e=>Qj.find(t=>`#${t.id}`===e)?.id??`accounts`;j();var eM=x`
3038
+ `,Rj=e=>e.endsWith(`.`)?e:`${e}.`,zj=()=>k(Mj,{children:[U(`h1`,{children:`Privacy`}),U(`div`,{className:`updated`,children:`Last updated 10 October 2026`}),U(`p`,{children:`stub is an independent, non-commercial personal project. In short: it has no accounts and no server of its own, runs no analytics, and keeps your settings and your watch list in your browser, or in your own FKN account when you choose to.`}),U(`h2`,{children:`What stub keeps`}),k(`p`,{children:[`stub sets no advertising or tracking cookies and runs no analytics or telemetry. This is everything it keeps, where, and for how long. You sign out of a site in`,` `,U(os,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, and remove a source you added in`,` `,U(os,{to:`/settings#sources`,children:`Settings, under Sources`}),`. Clearing this site's data in your browser removes everything stub keeps in this browser.`]}),U(`ul`,{css:Lj,children:Ij.map(e=>k(`li`,{children:[k(`strong`,{children:[e.title,`.`]}),` `,e.what,` `,k(`span`,{className:`facts`,children:[`Where: `,Rj(e.where),` How long: `,Rj(e.lasts)]})]},e.id))}),U(`p`,{children:`About stub's list: signed out, it is saved in your browser's storage for stub, on this device only. Signed in to an FKN account, stub uses that account's list instead: your changes are saved on the device and in the account's storage, encrypted in your browser before they leave the device, so every device signed in to the same account shows them. A list you kept before signing in is added to the account only if you choose to. When you sign out, the account's list is removed from the device. Removing an entry keeps a record that it was removed, with the entry's title and last values, so that every device using the list removes it too. There is no way to clear these records yet.`}),U(`h2`,{children:`Sign-ins to other sites`}),k(`p`,{children:[`stub plays Crunchyroll and tracks your AniList and MyAnimeList lists with your own accounts on those sites. Without the FKN browser extension, you sign in on each site's own page, in an FKN window, and the cookies that sign-in sets are kept by FKN, in a cookie jar every fkn.app app shares, and not by stub. Signing out in `,U(os,{to:`/settings#accounts`,children:`Settings, under Accounts`}),`, removes that site's cookies from FKN. The site itself is not told, so its session stays valid there until it expires, held by nobody.`]}),U(`p`,{children:`With the extension, stub uses your browser's own sessions for these sites and for Netflix. Those stay in your browser, and you sign in and out of them on the sites themselves.`}),U(`h2`,{children:`Network requests & third parties`}),k(`p`,{children:[`To fetch titles, artwork, and streams, stub sends requests through the FKN platform proxy, which then reaches third-party services such as AniList, MyAnimeList, Crunchyroll, JustWatch, and Netflix. The proxy requires no account. It uses your IP address to rate-limit requests, and it keeps a copy of each answer for a while, under a key made from the whole request (its address, headers and body), so only an identical request is answered from that copy. How the FKN platform handles that data is described in the`,` `,U(`a`,{href:`https://fkn.app/privacy`,target:`_blank`,rel:`noreferrer noopener`,children:`FKN platform privacy policy`}),`. Each third-party service receives the requests made to it and applies its own privacy policy, especially when you sign in to one (for example Crunchyroll) to watch.`]}),U(`h2`,{children:`The optional browser extension`}),U(`p`,{children:`If you install the FKN browser extension, it works with your own already-logged-in sessions locally on your device so you can play content you have access to. Those credentials stay in your browser; stub never receives them.`}),U(`h2`,{children:`Your control`}),U(`p`,{children:`Disconnecting from FKN, in the account menu at the top right, takes your account's list off the device. Your party name and the party you are in go when you close the tab. If you use the browser extension, you can review and revoke its access at any time from the extension itself.`}),U(`h2`,{children:`Contact`}),k(`p`,{children:[`Questions about privacy can be raised through the project repository at`,` `,U(`a`,{href:`https://github.com/banou26/stub`,target:`_blank`,rel:`noreferrer noopener`,children:`github.com/banou26/stub`}),`.`]})]});j();var Bj=({label:e,name:t=e,confirmLabel:n,busyLabel:r,question:i,onConfirm:a,home:o})=>{let[s,c]=B(!1),[l,u]=B(!1),d=R(null),f=R(null),p=R(null),m=R(!1),h=R(!0),g=he(),_=()=>{let e=document.activeElement;return!e||e===document.body||!!p.current?.contains(e)};return O(()=>()=>{h.current=!1,p.current&&_()&&o?.current?.focus()},[]),_e(()=>{s?f.current?.focus():m.current&&d.current?.focus(),m.current=!1},[s]),s?k(`div`,{ref:p,className:`confirm`,role:`group`,"aria-label":t,children:[U(`p`,{id:g,children:i}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,className:`danger`,"aria-describedby":g,disabled:l,onClick:()=>{u(!0),Promise.resolve().then(a).catch(()=>{}).finally(()=>{if(!h.current)return;let e=_();u(!1),c(!1),e&&(o?.current?o.current.focus():m.current=!0)})},children:l?r:n}),U(`button`,{ref:f,type:`button`,className:`secondary`,"aria-describedby":g,disabled:l,onClick:()=>{m.current=!0,c(!1)},children:`Cancel`})]})]}):U(`button`,{ref:d,type:`button`,className:`secondary`,"aria-label":t===e?void 0:t,onClick:()=>c(!0),children:e})};j();var Vj=e=>e instanceof Error?e.message:String(e),Hj=(e,t)=>{switch(t){case`authed`:return{text:`Signed in to ${e}.`};case`closed`:return{text:`The sign-in window closed. If you finished signing in there, stub reads it from now on.`};case`blocked`:return{text:`The browser blocked the sign-in window. Allow pop-ups for this page and try again.`,error:!0};case`unsupported`:return{text:`Connected to your browser's own ${e} session.`}}},Uj={"signed-in":`Signed in`,"signed-out":`Signed out`},Wj=(e,t)=>{let n=XA(t-e.checkedAt,1);return`${Uj[e.state]}, checked ${n?`${n} ago`:`just now`}`},Gj=(e,t)=>{let[,n]=B(0);return O(()=>e.watch(t,()=>n(e=>e+1)),[e,t]),e.read(t)},Kj=({site:e,name:t,backend:n,status:r,onNote:i})=>{let[a,o]=B(!1),s=Yj();return U(`button`,{type:`button`,className:`secondary`,disabled:a,"aria-label":`Check whether you are signed in to ${t}`,onClick:()=>{o(!0),i(void 0),r.check(e,n).catch(e=>{s.current&&i({text:`stub could not tell whether you are signed in to ${t}: ${Vj(e)}`,error:!0})}).finally(()=>{s.current&&o(!1)})},children:a?`Checking...`:`Check now`})},qj=({id:e,title:t,state:n,on:r,heading:i,children:a})=>k(`div`,{className:`row account`,"data-account":e,children:[k(`div`,{className:`head`,children:[U(`h3`,{ref:i,tabIndex:-1,children:t}),n?U(`span`,{className:`state${r?` on`:``}`,children:n}):void 0]}),a]}),Jj=({note:e})=>U(`p`,{className:`note${e?.error?` error`:``}`,role:`status`,children:e?.text}),Yj=()=>{let e=R(!0);return O(()=>()=>{e.current=!1},[]),e},Xj=`Without the FKN extension, the session is kept by FKN, in the cookie jar every fkn.app app shares, and not by stub.`,Zj=e=>`${e} itself is not told, so the session stays valid there until it expires, held by nobody.`,Qj=({backend:e,crunchyroll:t,status:n,now:r})=>{let[i,a]=B(!1),[o,s]=B(),c=Yj(),l=R(null),u=Gj(n,`crunchyroll`),d=e?U(Kj,{site:`crunchyroll`,name:`Crunchyroll`,backend:e,status:n,onNote:s}):void 0;return k(qj,{id:`crunchyroll`,title:`Crunchyroll`,state:u?Wj(u,r()):`Not checked yet`,on:u?.state===`signed-in`,heading:l,children:[U(`p`,{children:`Plays Crunchyroll episodes on your own Crunchyroll account.`}),e===`cloud`?k(H,{children:[k(`p`,{children:[Xj,` Check now asks Crunchyroll whether that session is signed in, without loading a Crunchyroll page.`]}),k(`div`,{className:`actions`,children:[u?.state===`signed-in`?void 0:U(`button`,{type:`button`,disabled:i,onClick:()=>{let e=t.signIn();a(!0),s(void 0),e.then(e=>{c.current&&s(Hj(`Crunchyroll`,e))}).catch(e=>{c.current&&s({text:Vj(e),error:!0})}).finally(()=>{c.current&&a(!1)})},children:i?`Signing in...`:`Sign in`}),u?.state===`signed-out`?void 0:U(Bj,{label:`Sign out`,name:`Sign out of Crunchyroll`,home:l,confirmLabel:`Yes, sign out`,busyLabel:`Signing out...`,question:`Sign out of Crunchyroll? This removes its cookies from FKN's jar, which signs every fkn.app app out of Crunchyroll. ${Zj(`Crunchyroll`)}`,onConfirm:()=>t.signOut().then(()=>{c.current&&s({text:`Signed out. FKN no longer holds a Crunchyroll session for fkn.app apps.`})},e=>{c.current&&s({text:`FKN could not remove the Crunchyroll cookies: ${Vj(e)}. Try again.`,error:!0})})}),d]})]}):e===`extension`?k(H,{children:[U(`p`,{children:`With the FKN extension, stub plays it on your browser's own crunchyroll.com session and keeps nothing of it. Sign in and out on crunchyroll.com.`}),k(`div`,{className:`actions`,children:[U(`a`,{className:`link`,href:`https://www.crunchyroll.com`,target:`_blank`,rel:`noreferrer`,children:`Open crunchyroll.com`}),d]})]}):U(`p`,{children:`Checking whether the FKN extension runs here...`}),U(Jj,{note:o})]})},$j=[{site:`anilist`,name:`AniList`,host:`anilist.co`},{site:`mal`,name:`MyAnimeList`,host:`myanimelist.net`}],eM=({site:e,name:t,host:n,backend:r,sites:i,status:a,now:o})=>{let[s,c]=B(()=>i.isConnected(e)),[l,u]=B(!1),[d,f]=B(),p=Yj(),m=R(null),h=Gj(a,e);O(()=>(c(i.isConnected(e)),i.watch(e,()=>{p.current&&c(i.isConnected(e))})),[i,e]);let g=()=>{p.current&&c(i.isConnected(e))},_=()=>{let n=i.signIn(e);u(!0),f(void 0),n.then(e=>{p.current&&f(Hj(t,e))}).catch(e=>{p.current&&f({text:Vj(e),error:!0})}).finally(()=>{p.current&&u(!1),g()})},v=r=>i.signOut(e,r).then(()=>{p.current&&f({text:r===`cloud`?`Signed out. stub no longer uses ${t} on this device, and FKN no longer holds its session.`:`Disconnected. To sign out of ${t} itself, sign out on ${n}.`}),g()},e=>{p.current&&f({text:`Disconnected on this device, but FKN could not remove the ${t} cookies: ${Vj(e)}. Sign in and out again to retry.`,error:!0}),g()});return k(qj,{id:e,title:t,state:s?h?Wj(h,o()):`Connected on this device`:`Not connected`,on:s&&h?.state!==`signed-out`,heading:m,children:[k(`p`,{children:[`Tracks your `,t,` list with your own `,n,` session.`,` `,r===`cloud`?Xj:r===`extension`?`With the FKN extension, stub uses your browser's own ${n} session.`:``]}),r?k(`div`,{className:`actions`,children:[s?U(Bj,{label:r===`cloud`?`Sign out`:`Disconnect`,name:r===`cloud`?`Sign out of ${t}`:`Disconnect ${t}`,home:m,confirmLabel:r===`cloud`?`Yes, sign out`:`Yes, disconnect`,busyLabel:r===`cloud`?`Signing out...`:`Disconnecting...`,question:r===`cloud`?`Sign out of ${t}? stub stops using it on this device, and its cookies leave FKN's jar, which signs every fkn.app app out of ${t}. ${Zj(t)}`:`Disconnect ${t}? stub stops using your ${n} session on this device. You stay signed in on ${n}.`,onConfirm:()=>v(r)}):U(`button`,{type:`button`,disabled:l,onClick:_,children:l?`Signing in...`:r===`cloud`?`Sign in`:`Connect`}),s?U(Kj,{site:e,name:t,backend:r,status:a,onNote:f}):void 0]}):void 0,U(Jj,{note:d})]})},tM=({backend:e})=>U(qj,{id:`netflix`,title:`Netflix`,children:e===`extension`?k(H,{children:[U(`p`,{children:`stub plays Netflix on your browser's own netflix.com session, through the FKN extension, and keeps nothing of it. Sign in and out on netflix.com.`}),U(`div`,{className:`actions`,children:U(`a`,{className:`link`,href:`https://www.netflix.com`,target:`_blank`,rel:`noreferrer`,children:`Open netflix.com`})})]}):U(`p`,{children:`Netflix needs the FKN browser extension: stub plays it on your browser's own netflix.com session, and keeps nothing of it.`})}),nM=({backend:e,crunchyroll:t,sites:n,status:r,now:i=Date.now})=>k(`div`,{className:`rows`,children:[U(Qj,{backend:e,crunchyroll:t,status:r,now:i}),$j.map(t=>U(eM,{...t,backend:e,sites:n,status:r,now:i},t.site)),U(tM,{backend:e})]}),rM=[{id:`accounts`,title:`Accounts`,intro:`The sites where stub uses your own account, what each one is for, and how to sign out.`},{id:`sources`,title:`Sources`,intro:`Where stub gets titles, artwork and streams: the sources it ships with, and the ones you add.`}],iM=e=>rM.find(t=>`#${t.id}`===e)?.id??`accounts`,aM=[{origin:`mal`,name:`MyAnimeList`,url:`https://myanimelist.net`},{origin:`anilist`,name:`AniList`,url:`https://anilist.co`},{origin:`anizip`,name:`AniZip`,url:`https://api.ani.zip/`},{origin:`cr`,name:`Crunchyroll`,url:`https://www.crunchyroll.com`},{origin:`nf`,name:`Netflix`,url:`https://www.netflix.com`},{origin:`jw`,name:`JustWatch`,url:`https://www.justwatch.com`},{origin:`appletv`,name:`Apple TV+`,url:`https://tv.apple.com`},{origin:`paramount`,name:`Paramount+`,url:`https://www.paramountplus.com`},{origin:`disney`,name:`Disney+`,url:`https://www.disneyplus.com`},{origin:`amazon`,name:`Prime Video`,url:`https://www.primevideo.com`},{origin:`hulu`,name:`Hulu`,url:`https://www.hulu.com`},{origin:`peacock`,name:`Peacock`,url:`https://www.peacocktv.com`},{origin:`hbo`,name:`Max`,url:`https://www.max.com`},{origin:`fubo`,name:`Fubo`,url:`https://www.fubo.tv`},{origin:`tmdb`,name:`TMDB`,url:`https://www.themoviedb.org`},{origin:`tvmaze`,name:`TVmaze`,url:`https://www.tvmaze.com`},{origin:`kitsu`,name:`Kitsu`,url:`https://kitsu.io`},{origin:`omdb`,name:`IMDb`,url:`https://www.imdb.com`},{origin:`trakt`,name:`Trakt`,url:`https://trakt.tv`},{origin:`simkl`,name:`Simkl`,url:`https://simkl.com`},{origin:`tvdb`,name:`TheTVDB`,url:`https://www.thetvdb.com`},{origin:`offline`,name:`Offline database`,url:`https://github.com/manami-project/anime-offline-database`},{origin:`watchmode`,name:`Watchmode`,url:`https://www.watchmode.com`}];j();var oM=x`
3039
+ h3.part {
3040
+ font-size: 1.3rem;
3041
+ font-weight: 700;
3042
+ letter-spacing: 0.06em;
3043
+ text-transform: uppercase;
3044
+ color: rgba(255, 255, 255, 0.5);
3045
+ margin: 0 0 0.6rem;
3046
+ }
3047
+
3048
+ h3.part ~ h3.part, .part-head ~ h3.part { margin-top: 3.2rem; }
3049
+
3050
+ .part-head {
3051
+ display: flex;
3052
+ flex-wrap: wrap;
3053
+ align-items: baseline;
3054
+ gap: 0.4rem 1.2rem;
3055
+ margin-bottom: 0.6rem;
3056
+ }
3057
+
3058
+ .part-head h3.part { margin: 0; }
3059
+ .part-head .count { font-size: 1.3rem; color: rgba(255, 255, 255, 0.5); }
3060
+ .part-head .link-button { margin-left: auto; }
3061
+
3062
+ .part-intro {
3063
+ margin-bottom: 1.2rem;
3064
+ font-size: 1.4rem;
3065
+ line-height: 1.55;
3066
+ color: rgba(255, 255, 255, 0.6);
3067
+ max-width: 72ch;
3068
+ }
3069
+
3070
+ .built-in {
3071
+ display: grid;
3072
+ grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
3073
+ gap: 0.8rem;
3074
+ }
3075
+
3076
+ .built-in label {
3077
+ display: flex;
3078
+ align-items: center;
3079
+ gap: 1.2rem;
3080
+ padding: 1rem 1.2rem;
3081
+ border: 1px solid rgba(255, 255, 255, 0.1);
3082
+ border-radius: 0.8rem;
3083
+ background: rgba(255, 255, 255, 0.02);
3084
+ cursor: pointer;
3085
+ transition: border-color 0.15s;
3086
+ }
3087
+
3088
+ .built-in label:hover { border-color: rgba(255, 255, 255, 0.25); }
3089
+ .built-in .source { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; margin-right: auto; }
3090
+ .built-in .source-name { font-size: 1.5rem; font-weight: 600; color: #fff; overflow-wrap: anywhere; transition: color 0.15s; }
3091
+ .built-in .host { font-size: 1.2rem; color: rgba(255, 255, 255, 0.45); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
3092
+ .built-in label.off .source-name { color: rgba(255, 255, 255, 0.5); }
3093
+
3094
+ input[role='switch'] {
3095
+ appearance: none;
3096
+ flex: none;
3097
+ position: relative;
3098
+ width: 3.6rem;
3099
+ height: 2rem;
3100
+ margin: 0;
3101
+ border-radius: 1rem;
3102
+ background: rgba(255, 255, 255, 0.18);
3103
+ cursor: pointer;
3104
+ transition: background 0.15s;
3105
+ }
3106
+
3107
+ input[role='switch']::before {
3108
+ content: '';
3109
+ position: absolute;
3110
+ top: 0.2rem;
3111
+ left: 0.2rem;
3112
+ width: 1.6rem;
3113
+ height: 1.6rem;
3114
+ border-radius: 50%;
3115
+ background: #fff;
3116
+ transition: transform 0.15s;
3117
+ }
3118
+
3119
+ input[role='switch']:checked { background: #4ade80; }
3120
+ input[role='switch']:checked::before { transform: translateX(1.6rem); }
3121
+ input[role='switch']:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.8); outline-offset: 2px; }
3122
+
3123
+ @media (prefers-reduced-motion: reduce) {
3124
+ input[role='switch'], input[role='switch']::before, .built-in .source-name { transition: none; }
3125
+ }
3126
+
3127
+ button.link-button {
3128
+ padding: 0;
3129
+ border: none;
3130
+ background: none;
3131
+ color: #f47521;
3132
+ font-size: 1.4rem;
3133
+ font-weight: 500;
3134
+ }
3135
+
3136
+ button.link-button:hover:not([aria-disabled='true']) { color: #ff8a3d; }
3137
+ button.link-button[aria-disabled='true'] { color: rgba(255, 255, 255, 0.35); cursor: default; }
3138
+
3039
3139
  .row.plugin {
3040
3140
  display: grid;
3041
3141
  grid-template-columns: minmax(0, 1fr) auto auto;
@@ -3178,7 +3278,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3178
3278
 
3179
3279
  .hint { font-size: 1.25rem; color: rgba(255, 255, 255, 0.5); }
3180
3280
  .by-address .note { font-size: 1.35rem; overflow-wrap: anywhere; }
3181
- `,tM={connected:`Connected`,connecting:`Connecting`,error:`Error`},nM=e=>e instanceof Error?e.message:String(e),rM=({plugin:e,onRemove:t})=>{let n=e.sources??[],r=n.length?n.map(e=>e.name).join(`, `):e.uri.replace(/^npm:/,``);return k(`li`,{className:`row plugin`,"data-plugin":e.uri,children:[k(`div`,{className:`info`,children:[U(`span`,{className:`name`,children:r}),n.length?k(`span`,{className:`meta`,children:[U(`span`,{className:`uri`,children:e.uri}),n.length>1?` · ${n.length} sources`:``,e.rejected?.length?` · ${e.rejected.length} unavailable`:``]}):void 0]}),k(`span`,{className:`pill`,"data-state":e.state,children:[U(`span`,{className:`dot`,"aria-hidden":`true`}),tM[e.state]]}),U(`button`,{type:`button`,className:`secondary small`,"aria-label":`Remove ${r}`,onClick:t,children:`Remove`}),e.state===`error`?U(`p`,{className:`failure`,children:e.error??`stub could not connect to it.`}):void 0]})},iM=()=>{let[e,t]=B(Rr),[n,r]=B(``),[i,a]=B(!1),[o,s]=B(``),c=he(),l=()=>t(Rr());return O(()=>(l(),Lr(l)),[]),k(`div`,{css:eM,children:[e.length?U(`ul`,{className:`rows`,children:e.map(e=>U(rM,{plugin:e,onRemove:()=>{Qr(e.uri).then(l)}},e.uri))}):U(`p`,{className:`row empty`,children:`No sources added yet.`}),k(`div`,{className:`add`,children:[k(`div`,{className:`browse`,children:[U(`button`,{type:`button`,onClick:()=>{$r().finally(l)},children:`Browse sources`}),U(`span`,{children:`Pick from the sources published for stub.`})]}),k(`form`,{className:`by-address`,onSubmit:e=>{e.preventDefault();let t=n.trim();t&&!i&&(a(!0),s(``),Xr(t).then(e=>{e&&r(``)}).catch(e=>s(nM(e))).finally(()=>{a(!1),l()}))},children:[U(`label`,{for:`${c}-address`,children:`Or add one by its address`}),k(`div`,{className:`group${o?` invalid`:``}`,children:[U(`input`,{id:`${c}-address`,type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`npm:@scope/package`,"aria-invalid":o?!0:void 0,"aria-describedby":`${c}-error ${c}-hint`,value:n,onInput:e=>r(e.target.value)}),U(`button`,{type:`submit`,disabled:i,children:i?`Adding...`:`Add`})]}),U(`p`,{className:`note error`,id:`${c}-error`,role:`alert`,children:o}),U(`p`,{className:`hint`,id:`${c}-hint`,children:`An npm package, or a local dev address such as localhost:4599.`})]})]})]})},aM=x`
3281
+ `,sM={connected:`Connected`,connecting:`Connecting`,error:`Error`},cM=e=>e instanceof Error?e.message:String(e),lM=({plugin:e,onRemove:t})=>{let n=e.sources??[],r=n.length?n.map(e=>e.name).join(`, `):e.uri.replace(/^npm:/,``);return k(`li`,{className:`row plugin`,"data-plugin":e.uri,children:[k(`div`,{className:`info`,children:[U(`span`,{className:`name`,children:r}),n.length?k(`span`,{className:`meta`,children:[U(`span`,{className:`uri`,children:e.uri}),n.length>1?` · ${n.length} sources`:``,e.rejected?.length?` · ${e.rejected.length} unavailable`:``]}):void 0]}),k(`span`,{className:`pill`,"data-state":e.state,children:[U(`span`,{className:`dot`,"aria-hidden":`true`}),sM[e.state]]}),U(`button`,{type:`button`,className:`secondary small`,"aria-label":`Remove ${r}`,onClick:t,children:`Remove`}),e.state===`error`?U(`p`,{className:`failure`,children:e.error??`stub could not connect to it.`}):void 0]})},uM=e=>{let{host:t,pathname:n}=new URL(e);return t.replace(/^www\./,``)+n.replace(/\/$/,``)},dM=()=>{let[e,t]=B(()=>new Set(Qe()));O(()=>mt(()=>t(new Set(Qe()))),[]);let n=aM.filter(t=>e.has(t.origin)).length;return k(H,{children:[k(`div`,{className:`part-head`,children:[U(`h3`,{className:`part`,children:`Built in`}),U(`span`,{className:`count`,children:n?`${aM.length-n} of ${aM.length} on`:`All ${aM.length} on`}),U(`button`,{type:`button`,className:`link-button`,"aria-disabled":!n||void 0,onClick:()=>{n&&dt()},children:`Turn all on`})]}),U(`p`,{className:`part-intro`,children:`A source you turn off is skipped from the next page or search you open, and what it already answered is gone after a reload. Tracking your AniList or MyAnimeList list is not affected.`}),U(`ul`,{className:`built-in`,children:aM.map(t=>{let n=!e.has(t.origin);return U(`li`,{"data-source":t.origin,children:k(`label`,{className:n?void 0:`off`,children:[k(`span`,{className:`source`,children:[U(`span`,{className:`source-name`,children:t.name}),U(`span`,{className:`host`,children:uM(t.url)})]}),U(`input`,{type:`checkbox`,role:`switch`,"aria-label":t.name,checked:n,onChange:e=>qe(t.origin,e.target.checked)})]})},t.origin)})})]})},fM=()=>{let[e,t]=B(Ur),[n,r]=B(``),[i,a]=B(!1),[o,s]=B(``),c=he(),l=()=>t(Ur());return O(()=>(l(),Hr(l)),[]),k(`div`,{css:oM,children:[U(dM,{}),U(`h3`,{className:`part`,children:`Added`}),U(`p`,{className:`part-intro`,children:`Community-made sources, published on npm. FKN installs them for stub, and each one runs isolated from stub.`}),e.length?U(`ul`,{className:`rows`,children:e.map(e=>U(lM,{plugin:e,onRemove:()=>{ri(e.uri).then(l)}},e.uri))}):U(`p`,{className:`row empty`,children:`No sources added yet.`}),k(`div`,{className:`add`,children:[k(`div`,{className:`browse`,children:[U(`button`,{type:`button`,onClick:()=>{ii().finally(l)},children:`Browse sources`}),U(`span`,{children:`Pick from the sources published for stub.`})]}),k(`form`,{className:`by-address`,onSubmit:e=>{e.preventDefault();let t=n.trim();t&&!i&&(a(!0),s(``),ti(t).then(e=>{e&&r(``)}).catch(e=>s(cM(e))).finally(()=>{a(!1),l()}))},children:[U(`label`,{for:`${c}-address`,children:`Or add one by its address`}),k(`div`,{className:`group${o?` invalid`:``}`,children:[U(`input`,{id:`${c}-address`,type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`npm:@scope/package`,"aria-invalid":o?!0:void 0,"aria-describedby":`${c}-error ${c}-hint`,value:n,onInput:e=>r(e.target.value)}),U(`button`,{type:`submit`,disabled:i,children:i?`Adding...`:`Add`})]}),U(`p`,{className:`note error`,id:`${c}-error`,role:`alert`,children:o}),U(`p`,{className:`hint`,id:`${c}-hint`,children:`An npm package, or a local dev address such as localhost:4599.`})]})]})]})},pM=x`
3182
3282
  min-width: 0;
3183
3283
 
3184
3284
  & > h2 {
@@ -3311,7 +3411,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3311
3411
  }
3312
3412
 
3313
3413
  .confirm p { color: rgba(255, 255, 255, 0.9); }
3314
- `,oM={url:`${me}/auth/v1/token`,authorization:`Basic ${btoa(`${ue}:`)}`,deviceType:`stub on FKN`},sM=async({url:e,authorization:t,deviceType:n},r=fetch)=>{let i=globalThis.location?.origin===new URL(e).origin?globalThis.document?.cookie??``:``,a=/(?:^|;\s*)device_id=([^;]+)/.exec(i)?.[1]??crypto.randomUUID(),o=await r(`${e}?_=${crypto.randomUUID()}`,{method:`POST`,credentials:`include`,headers:{authorization:t,"content-type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`etp_rt_cookie`,device_id:a,device_type:n}).toString()}),s=await o.json().catch(()=>null);return{status:o.status,body:o.ok?null:s}},cM=e=>(e?.context??[]).some(e=>e.field===`etp_rt`&&e.code===`auth.obtain_access_token.missing_required_field`),lM=({status:e,body:t})=>{if(e===200)return`signed-in`;if(e===400&&cM(t))return`signed-out`;throw Error(`Crunchyroll answered ${e}`)},uM=`Ask crunchyroll.com whether you are signed in, without loading any of its pages`,dM=async(e,{attach:t,mount:n,fetch:r,settle:i=()=>new Promise(e=>setTimeout(e,2e3))})=>{if(e===`extension`)return lM(await sM(oM,r));let{iframe:a,remove:o}=n();try{let e=await(await t({iframe:a,blank:{url:`${me}/`},cookies:`persistent`,permissions:[{category:`evaluation`,reason:uM}]})).evaluate(sM,oM);return e.status===200&&await i(),lM(e)}finally{o()}},fM={signIn:()=>Te({url:D,domains:F,isSignedIn:ge}).then(Pe(ke,`crunchyroll`)),signOut:()=>ct(F).then(()=>ke.record(`crunchyroll`,`signed-out`))},pM={isConnected:Ye,watch:lt,signIn:e=>ot[e](),signOut:We},mM={read:ke.read,watch:ke.watch,check:async(e,t)=>{let n=e===`crunchyroll`?await dM(t,{attach:Ae,mount:()=>He(`Sign-in check`),fetch:je}):await Xe(e);return ke.record(e,n),n}};j();var hM=x`
3414
+ `,mM={url:`${me}/auth/v1/token`,authorization:`Basic ${btoa(`${ue}:`)}`,deviceType:`stub on FKN`},hM=async({url:e,authorization:t,deviceType:n},r=fetch)=>{let i=globalThis.location?.origin===new URL(e).origin?globalThis.document?.cookie??``:``,a=/(?:^|;\s*)device_id=([^;]+)/.exec(i)?.[1]??crypto.randomUUID(),o=await r(`${e}?_=${crypto.randomUUID()}`,{method:`POST`,credentials:`include`,headers:{authorization:t,"content-type":`application/x-www-form-urlencoded`},body:new URLSearchParams({grant_type:`etp_rt_cookie`,device_id:a,device_type:n}).toString()}),s=await o.json().catch(()=>null);return{status:o.status,body:o.ok?null:s}},gM=e=>(e?.context??[]).some(e=>e.field===`etp_rt`&&e.code===`auth.obtain_access_token.missing_required_field`),_M=({status:e,body:t})=>{if(e===200)return`signed-in`;if(e===400&&gM(t))return`signed-out`;throw Error(`Crunchyroll answered ${e}`)},vM=`Ask crunchyroll.com whether you are signed in, without loading any of its pages`,yM=async(e,{attach:t,mount:n,fetch:r,settle:i=()=>new Promise(e=>setTimeout(e,2e3))})=>{if(e===`extension`)return _M(await hM(mM,r));let{iframe:a,remove:o}=n();try{let e=await(await t({iframe:a,blank:{url:`${me}/`},cookies:`persistent`,permissions:[{category:`evaluation`,reason:vM}]})).evaluate(hM,mM);return e.status===200&&await i(),_M(e)}finally{o()}},bM={signIn:()=>Te({url:D,domains:F,isSignedIn:ge}).then(Pe(ke,`crunchyroll`)),signOut:()=>Ue(F).then(()=>ke.record(`crunchyroll`,`signed-out`))},xM={isConnected:pt,watch:ft,signIn:e=>Ve[e](),signOut:Ge},SM={read:ke.read,watch:ke.watch,check:async(e,t)=>{let n=e===`crunchyroll`?await yM(t,{attach:Ae,mount:()=>He(`Sign-in check`),fetch:je}):await Ye(e);return ke.record(e,n),n}};j();var CM=x`
3315
3415
  display: grid;
3316
3416
  grid-template-columns: 17rem minmax(0, 1fr);
3317
3417
  column-gap: 4rem;
@@ -3372,7 +3472,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3372
3472
 
3373
3473
  .index a[aria-current='true'] { background: #fff; color: #000; border-color: #fff; }
3374
3474
  }
3375
- `,gM=()=>location.hash,_M=()=>{let[e,t]=B(),n=$j(To(gM)),r=Qj.find(e=>e.id===n);return O(()=>{let e=!1;return Fe().then(n=>{e||t(n)}),()=>{e=!0}},[]),k(`div`,{css:hM,children:[U(`h1`,{children:`Settings`}),U(`nav`,{className:`index`,"aria-label":`Settings categories`,children:Qj.map(e=>U(`a`,{href:`#${e.id}`,"aria-current":r===e?`true`:void 0,onClick:vl,children:e.title},e.id))}),k(`section`,{css:aM,"data-section":r.id,"aria-labelledby":`settings-section-title`,children:[U(`h2`,{id:`settings-section-title`,children:r.title}),U(`p`,{className:`intro`,children:r.intro}),r.id===`accounts`?U(Zj,{backend:e,crunchyroll:fM,sites:pM,status:mM}):U(iM,{})]})]})},vM=e=>{let{onPlayback:t,applyPlayback:n}=e;if(!t||!n)return;let r=new Set,i=!1,a=e=>{if(!i&&Qf(e))for(let t of r)t(e)},o=()=>{t(a).catch(()=>{})};return o(),{apply:e=>{n(e).catch(()=>{})},onReport:e=>(r.add(e),o(),()=>{r.delete(e)}),dispose:()=>{i=!0,r.clear()}}};j();var yM=x`
3475
+ `,wM=()=>location.hash,TM=()=>{let[e,t]=B(),n=iM(Ao(wM)),r=rM.find(e=>e.id===n);return O(()=>{let e=!1;return Fe().then(n=>{e||t(n)}),()=>{e=!0}},[]),k(`div`,{css:CM,children:[U(`h1`,{children:`Settings`}),U(`nav`,{className:`index`,"aria-label":`Settings categories`,children:rM.map(e=>U(`a`,{href:`#${e.id}`,"aria-current":r===e?`true`:void 0,onClick:Cl,children:e.title},e.id))}),k(`section`,{css:pM,"data-section":r.id,"aria-labelledby":`settings-section-title`,children:[U(`h2`,{id:`settings-section-title`,children:r.title}),U(`p`,{className:`intro`,children:r.intro}),r.id===`accounts`?U(nM,{backend:e,crunchyroll:bM,sites:xM,status:SM}):U(fM,{})]})]})},EM=e=>{let{onPlayback:t,applyPlayback:n}=e;if(!t||!n)return;let r=new Set,i=!1,a=e=>{if(!i&&rp(e))for(let t of r)t(e)},o=()=>{t(a).catch(()=>{})};return o(),{apply:e=>{n(e).catch(()=>{})},onReport:e=>(r.add(e),o(),()=>{r.delete(e)}),dispose:()=>{i=!0,r.clear()}}};j();var DM=x`
3376
3476
  position: relative;
3377
3477
  width: 100%;
3378
3478
  flex: 1;
@@ -3398,7 +3498,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3398
3498
  color: rgba(255, 255, 255, 0.55);
3399
3499
  font-size: 1.4rem;
3400
3500
  }
3401
- `,bM=({pluginUri:e,release:t,onUnplayable:n,onPlayback:r})=>{let i=R(null),[a,o]=B(``),s=R({onUnplayable:n,onPlayback:r});return s.current={onUnplayable:n,onPlayback:r},O(()=>{let n=i.current;if(!n)return;let r=!1,a,c;return o(``),(async()=>{try{let i=await Oe.mount(e,{iframe:n,protocol:Or});if(r){i.unmount();return}a=i;let{origin:o}=de(t.uri),l=i.remote,u=l.sources?.find(e=>e.origin===o)??l,d=await u.play?.({uri:t.uri,url:t.url});if(r)return;if(!d){i.unmount(),a=void 0,s.current.onUnplayable();return}c=vM(u),c&&s.current.onPlayback?.(c)}catch(e){if(r)return;o(e instanceof Error?e.message:String(e))}})(),()=>{r=!0,c&&(c.dispose(),s.current.onPlayback?.(void 0)),a?.unmount()}},[e,t.uri,t.url]),k(`div`,{css:yM,children:[U(`iframe`,{ref:i,sandbox:`allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox`,allow:`fullscreen; autoplay; encrypted-media; cross-origin-isolated`}),a?k(`div`,{className:`failed`,children:[`This source could not start playback. `,a]}):null]})};j();var xM=({link:e})=>{let t=Tp(),n=t.status===`active`?t.role:void 0,r=R(void 0);return O(()=>{if(r.current=void 0,!e||!n)return;let t=e.onReport(t=>{n===`host`?(X.setPlayback(t),X.send({t:`playback`,s:t})):r.current&&e.apply(ip(r.current.state,r.current.receivedAt,Date.now()),r.current.measured)});return()=>{t(),n===`host`&&X.setPlayback(void 0)}},[n,e]),Ep(t=>{if(n!==`guest`)return;let i=t.t===`playback`||t.t===`state`?t.s:void 0;if(!i)return;let a=location.pathname+location.search;if(X.hostPath()!==a)return;let o=X.hostClock(),s=o?{...i,at:sp(i.at,o.offset)}:i;r.current={state:s,receivedAt:Date.now(),measured:!!o},e?.apply(s,!!o)}),null},SM=[`play`,`pause`,`seeked`,`ratechange`],CM=e=>({paused:e.paused,time:e.currentTime,rate:e.playbackRate??1,at:Date.now()}),wM=(e,t=()=>{})=>{let n=new Set,r=()=>{let t=CM(e);for(let e of n)e(t)};for(let t of SM)e.addEventListener(t,r);let i=setInterval(()=>{e.paused||r()},ep);return{apply:(t,n)=>{let r=rp(CM(e),t,Date.now(),n);r.seek!==void 0&&(e.currentTime=r.seek),r.rate!==void 0&&(e.playbackRate=r.rate),r.pause&&e.pause(),r.play&&(e.autoplay?e.autoplay():e.play()).catch(()=>{})},onReport:e=>(n.add(e),queueMicrotask(r),()=>{n.delete(e)}),dispose:()=>{for(let t of SM)e.removeEventListener(t,r);clearInterval(i),n.clear(),t()}}},TM=e=>{let t=ut(e,{origin:location.origin});return wM(t,()=>t.destroy())},EM=(e,t)=>t?`${e==null?``:`E${e} - `}${t}`:e==null?void 0:`Episode ${e}`;j();var DM=e=>(e??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node),OM=Bp(`
3501
+ `,OM=({pluginUri:e,release:t,onUnplayable:n,onPlayback:r})=>{let i=R(null),[a,o]=B(``),s=R({onUnplayable:n,onPlayback:r});return s.current={onUnplayable:n,onPlayback:r},O(()=>{let n=i.current;if(!n)return;let r=!1,a,c;return o(``),(async()=>{try{let i=await Oe.mount(e,{iframe:n,protocol:Nr});if(r){i.unmount();return}a=i;let{origin:o}=de(t.uri),l=i.remote,u=l.sources?.find(e=>e.origin===o)??l,d=await u.play?.({uri:t.uri,url:t.url});if(r)return;if(!d){i.unmount(),a=void 0,s.current.onUnplayable();return}c=EM(u),c&&s.current.onPlayback?.(c)}catch(e){if(r)return;o(e instanceof Error?e.message:String(e))}})(),()=>{r=!0,c&&(c.dispose(),s.current.onPlayback?.(void 0)),a?.unmount()}},[e,t.uri,t.url]),k(`div`,{css:DM,children:[U(`iframe`,{ref:i,sandbox:`allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox`,allow:`fullscreen; autoplay; encrypted-media; cross-origin-isolated`}),a?k(`div`,{className:`failed`,children:[`This source could not start playback. `,a]}):null]})};j();var kM=({link:e})=>{let t=Ap(),n=t.status===`active`?t.role:void 0,r=R(void 0);return O(()=>{if(r.current=void 0,!e||!n)return;let t=e.onReport(t=>{n===`host`?(X.setPlayback(t),X.send({t:`playback`,s:t})):r.current&&e.apply(lp(r.current.state,r.current.receivedAt,Date.now()),r.current.measured)});return()=>{t(),n===`host`&&X.setPlayback(void 0)}},[n,e]),jp(t=>{if(n!==`guest`)return;let i=t.t===`playback`||t.t===`state`?t.s:void 0;if(!i)return;let a=location.pathname+location.search;if(X.hostPath()!==a)return;let o=X.hostClock(),s=o?{...i,at:fp(i.at,o.offset)}:i;r.current={state:s,receivedAt:Date.now(),measured:!!o},e?.apply(s,!!o)}),null},AM=[`play`,`pause`,`seeked`,`ratechange`],jM=e=>({paused:e.paused,time:e.currentTime,rate:e.playbackRate??1,at:Date.now()}),MM=(e,t=()=>{})=>{let n=new Set,r=()=>{let t=jM(e);for(let e of n)e(t)};for(let t of AM)e.addEventListener(t,r);let i=setInterval(()=>{e.paused||r()},ap);return{apply:(t,n)=>{let r=cp(jM(e),t,Date.now(),n);r.seek!==void 0&&(e.currentTime=r.seek),r.rate!==void 0&&(e.playbackRate=r.rate),r.pause&&e.pause(),r.play&&(e.autoplay?e.autoplay():e.play()).catch(()=>{})},onReport:e=>(n.add(e),queueMicrotask(r),()=>{n.delete(e)}),dispose:()=>{for(let t of AM)e.removeEventListener(t,r);clearInterval(i),n.clear(),t()}}},NM=e=>{let t=ht(e,{origin:location.origin});return MM(t,()=>t.destroy())},PM=(e,t)=>t?`${e==null?``:`E${e} - `}${t}`:e==null?void 0:`Episode ${e}`;j();var FM=e=>(e??[]).filter(e=>e.relation===`SAME_AS`).map(e=>e.node),IM=Gp(`
3402
3502
  subscription GetWatchMedia($input: MediaInput!) {
3403
3503
  media(input: $input) {
3404
3504
  _id
@@ -3459,7 +3559,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3459
3559
  }
3460
3560
  }
3461
3561
  }
3462
- `),kM=Bp(`
3562
+ `),LM=Gp(`
3463
3563
  subscription GetWatchOrigins($input: OriginPageInput!) {
3464
3564
  originPage(input: $input) {
3465
3565
  nodes {
@@ -3472,7 +3572,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3472
3572
  }
3473
3573
  }
3474
3574
  }
3475
- `),AM=x`
3575
+ `),RM=x`
3476
3576
  display: flex;
3477
3577
  flex-direction: column;
3478
3578
  height: 100vh;
@@ -3534,13 +3634,13 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3534
3634
  opacity: 0.6;
3535
3635
  }
3536
3636
  }
3537
- `,jM=()=>{let e=Go(),t={...e,mediaUri:M(e.mediaUri),episodeUri:M(e.episodeUri),sourceUri:M(e.sourceUri)},[,n]=qo(),r=R(null),[i,a]=B(void 0),[{data:o}]=yr({query:OM,variables:{input:{uri:t.mediaUri}},pause:!t.mediaUri}),s=o?.media,c=V(()=>s?.episodes?.find(e=>e.uri&&t.episodeUri?te(ve(e.uri),ve(t.episodeUri)):!1),[s?.episodes,t.episodeUri]),l=V(()=>c?.uri?P(c.uri)?.handleUrisValues:void 0,[c?.uri]),u=V(()=>l&&[...new Set(l.map(e=>e.origin))],[l]),[{data:d}]=yr({query:kM,variables:{input:{ids:u,filters:[hs.IsNotApiOnly]}},pause:!u}),f=t.sourceUri,p=s?.titles?.at(0)?.title,m=c?.titles?.at(0)?.title,h=c?.episodeNumber,g=EM(h,m),_=V(()=>{if(!f)return;let e=DM(c?.handles).find(e=>e.uri===f);if(!e)return;if(e.embedUrl)return e.embedUrl;let{origin:n}=de(f);if(!fA(n)||!e.url)return;let r=new URLSearchParams({mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:f,url:e.url});return`${new URL(`../embed.html`,import.meta.url).href}?${r}`},[f,c?.handles,t.mediaUri,t.episodeUri]),v=(d?.originPage?.nodes??[]).map(e=>e.id).join(`,`),[y,b]=B({}),[S,C]=B({});O(()=>{let e=!1,t=v?v.split(`,`):[],n=async e=>Object.fromEntries((await Promise.all(t.map(async t=>[t,(await e(t))?.pluginUri]))).filter(e=>!!e[1]));return Promise.all([n(it),n(qe)]).then(([t,n])=>{e||(b(t),C(n))}).catch(()=>{}),()=>{e=!0}},[v]);let w=V(()=>{if(!f)return;let{origin:e}=de(f),t=S[e];if(!t)return;let n=DM(c?.handles).find(e=>e.uri===f);return{pluginUri:t,release:{uri:f,url:n?.url??void 0}}},[f,S,c?.handles]),[T,E]=B();O(()=>{E(void 0)},[f]);let D=!!(w&&T!==f);O(()=>{let e=r.current;if(D||!_||!e)return;let t=TM(e);return a(t),()=>{t.dispose(),a(void 0)}},[D,_]),O(()=>{let e=r.current;if(!D&&_&&e&&g)return le(e,g)},[D,_,g]);let A=V(()=>(d?.originPage?.nodes??[]).map(e=>{let n=DM(c?.handles).filter(t=>t.origin===e.id),r=!!S[e.id],i=t=>!!(t?.embedUrl||r||fA(e.id)&&t?.url),a=e=>cs(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}),o=n.map(e=>({uri:e.uri,label:e.shortDescriptions?.at(0)?.shortDescription??e.titles?.at(0)?.title??de(e.uri).id,href:i(e)?a(e.uri):e.url??void 0,external:!i(e),active:f===e.uri})),s=n.at(0);return{id:e.id,name:e.name??e.id,icon:e.icon,color:e.color,href:s?o.at(0)?.href:void 0,external:!s||!i(s),active:o.some(e=>e.active),releases:o.length>1?o:void 0,picker:y[e.id]?{pluginUri:y[e.id]}:void 0}}),[d,c?.handles,t.mediaUri,t.episodeUri,f,y,S]);return U(`div`,{css:AM,children:k(`div`,{className:`watch-container`,children:[D&&w?U(bM,{pluginUri:w.pluginUri,release:w.release,onUnplayable:()=>E(f),onPlayback:a}):_?U(`iframe`,{ref:r,src:_,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`,css:x`
3637
+ `,zM=()=>{let e=Xo(),t={...e,mediaUri:M(e.mediaUri),episodeUri:M(e.episodeUri),sourceUri:M(e.sourceUri)},[,n]=Qo(),r=R(null),[i,a]=B(void 0),[{data:o}]=wr({query:IM,variables:{input:{uri:t.mediaUri}},pause:!t.mediaUri}),s=o?.media,c=V(()=>s?.episodes?.find(e=>e.uri&&t.episodeUri?te(ve(e.uri),ve(t.episodeUri)):!1),[s?.episodes,t.episodeUri]),l=V(()=>c?.uri?P(c.uri)?.handleUrisValues:void 0,[c?.uri]),u=V(()=>l&&[...new Set(l.map(e=>e.origin))],[l]),[{data:d}]=wr({query:LM,variables:{input:{ids:u,filters:[bs.IsNotApiOnly]}},pause:!u}),f=t.sourceUri,p=s?.titles?.at(0)?.title,m=c?.titles?.at(0)?.title,h=c?.episodeNumber,g=PM(h,m),_=V(()=>{if(!f)return;let e=FM(c?.handles).find(e=>e.uri===f);if(!e)return;if(e.embedUrl)return e.embedUrl;let{origin:n}=de(f);if(!_A(n)||!e.url)return;let r=new URLSearchParams({mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:f,url:e.url});return`${new URL(`../embed.html`,import.meta.url).href}?${r}`},[f,c?.handles,t.mediaUri,t.episodeUri]),v=(d?.originPage?.nodes??[]).map(e=>e.id).join(`,`),[y,b]=B({}),[S,C]=B({});O(()=>{let e=!1,t=v?v.split(`,`):[],n=async e=>Object.fromEntries((await Promise.all(t.map(async t=>[t,(await e(t))?.pluginUri]))).filter(e=>!!e[1]));return Promise.all([n(lt),n(Xe)]).then(([t,n])=>{e||(b(t),C(n))}).catch(()=>{}),()=>{e=!0}},[v]);let w=V(()=>{if(!f)return;let{origin:e}=de(f),t=S[e];if(!t)return;let n=FM(c?.handles).find(e=>e.uri===f);return{pluginUri:t,release:{uri:f,url:n?.url??void 0}}},[f,S,c?.handles]),[T,E]=B();O(()=>{E(void 0)},[f]);let D=!!(w&&T!==f);O(()=>{let e=r.current;if(D||!_||!e)return;let t=NM(e);return a(t),()=>{t.dispose(),a(void 0)}},[D,_]),O(()=>{let e=r.current;if(!D&&_&&e&&g)return le(e,g)},[D,_,g]);let A=V(()=>(d?.originPage?.nodes??[]).map(e=>{let n=FM(c?.handles).filter(t=>t.origin===e.id),r=!!S[e.id],i=t=>!!(t?.embedUrl||r||_A(e.id)&&t?.url),a=e=>ps(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}),o=n.map(e=>({uri:e.uri,label:e.shortDescriptions?.at(0)?.shortDescription??e.titles?.at(0)?.title??de(e.uri).id,href:i(e)?a(e.uri):e.url??void 0,external:!i(e),active:f===e.uri})),s=n.at(0);return{id:e.id,name:e.name??e.id,icon:e.icon,color:e.color,href:s?o.at(0)?.href:void 0,external:!s||!i(s),active:o.some(e=>e.active),releases:o.length>1?o:void 0,picker:y[e.id]?{pluginUri:y[e.id]}:void 0}}),[d,c?.handles,t.mediaUri,t.episodeUri,f,y,S]);return U(`div`,{css:RM,children:k(`div`,{className:`watch-container`,children:[D&&w?U(OM,{pluginUri:w.pluginUri,release:w.release,onUnplayable:()=>E(f),onPlayback:a}):_?U(`iframe`,{ref:r,src:_,referrerPolicy:`no-referrer`,allow:`encrypted-media; autoplay; fullscreen;`,css:x`
3538
3638
  width: 100%;
3539
3639
  border: none;
3540
3640
  background: #000;
3541
3641
  flex: 1;
3542
3642
  min-height: 0;
3543
- `}):void 0,U(xM,{link:i}),k(`div`,{className:`watch-info`,children:[k(`div`,{className:`episode-info`,children:[U(`div`,{className:`episode-title`,children:g??t.episodeUri}),p?U(`div`,{className:`media-title`,children:p}):void 0]}),U(xA,{sources:A,onPickRelease:e=>n(cs(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}))})]})]})})};j();var MM=x`
3643
+ `}):void 0,U(kM,{link:i}),k(`div`,{className:`watch-info`,children:[k(`div`,{className:`episode-info`,children:[U(`div`,{className:`episode-title`,children:g??t.episodeUri}),p?U(`div`,{className:`media-title`,children:p}):void 0]}),U(EA,{sources:A,onPickRelease:e=>n(ps(J.WATCH,{mediaUri:t.mediaUri,episodeUri:t.episodeUri,sourceUri:e}))})]})]})})};j();var BM=x`
3544
3644
  padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
3545
3645
  min-height: 100vh;
3546
3646
  max-width: 72rem;
@@ -3654,10 +3754,10 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3654
3754
  }
3655
3755
 
3656
3756
  .field input:focus { border-color: rgba(255, 255, 255, 0.4); }
3657
- `,NM={"not-found":`That party has ended.`,"bad-key":`The invite link is not valid.`,invalid:`The invite link is broken.`,full:`The party is full.`,blocked:`You cannot join this party.`,unavailable:`Parties are not available right now. Is FKN connected?`},PM=()=>{let e=Tp(),[t]=B(()=>yp(location.hash,location.origin)),[n]=B(()=>location.hash.length>1&&!yp(location.hash,location.origin)),[r,i]=B([]),[a,o]=B(()=>X.name()??``),[s,c]=B(!1),l=e.status===`active`;O(()=>{if(!t)return;let e=X.getState();(e.status!==`joining`&&e.status!==`active`||e.invite!==t)&&X.join(t)},[t]);let u=l?e.members:0;O(()=>{if(!l){i([]);return}let e=!1;return X.roster().then(t=>{e||i(t)}),()=>{e=!0}},[l,u]),Ep(e=>{e.t===`name`&&X.roster().then(i)}),O(()=>{if(!s)return;let e=setTimeout(()=>c(!1),1500);return()=>clearTimeout(e)},[s]);let d=l?vp(location.origin,e.invite):void 0,f=async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0)}catch{}};return k(`div`,{css:MM,children:[U(`div`,{className:`heading`,children:`Watch together`}),k(`div`,{className:`status`,children:[n?U(H,{children:`This invite link is broken. Ask the host for a new one.`}):!t&&!l&&e.status!==`joining`?e.status===`failed`?k(H,{children:[`Could not join. `,NM[e.code]??`Something went wrong.`]}):e.status===`ended`?U(H,{children:`The party ended.`}):U(H,{children:`You are not in a party. Start one from the header, or open an invite link.`}):!t&&e.status===`joining`?U(H,{children:`Joining the party…`}):t&&!l?e.status===`joining`?U(H,{children:`Joining the party…`}):e.status===`failed`?k(H,{children:[`Could not join. `,NM[e.code]??`Something went wrong.`]}):e.status===`ended`?U(H,{children:`The party ended.`}):U(H,{children:`This invite link is broken. Ask the host for a new one.`}):l&&e.role===`guest`&&t?U(H,{children:`You are in. Waiting for the host…`}):l&&e.role===`guest`?k(H,{children:[`You are following the host. `,U(ts,{to:cs(J.HOME),children:`Go home`}),` and Catch up from the header to rejoin them.`]}):U(H,{children:`You are hosting. Everyone here follows you, and you decide who stays.`}),!t&&!l&&e.status!==`joining`&&(e.status===`failed`||e.status===`ended`)?k(H,{children:[` `,U(`button`,{type:`button`,className:`action`,onClick:()=>X.dismiss(),children:`OK`})]}):null]}),l&&k(H,{children:[k(`div`,{className:`section`,children:[U(`div`,{className:`label`,children:`Your name`}),k(`form`,{className:`field`,onSubmit:e=>{e.preventDefault(),X.setName(Kf(a))},children:[U(`input`,{value:a,maxLength:32,placeholder:`What the party should call you`,"aria-label":`Your name`,onInput:e=>o(e.currentTarget.value)}),k(`button`,{type:`submit`,className:`action`,children:[U(Rc,{size:14}),` Save`]})]})]}),k(`div`,{className:`section`,children:[U(`div`,{className:`label`,children:`Invite link`}),k(`div`,{className:`field`,children:[U(`input`,{readOnly:!0,value:d,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),k(`button`,{type:`button`,className:`action`,onClick:()=>{f()},children:[U(s?Rc:Hc,{size:14}),` Copy`]})]})]}),k(`div`,{className:`section`,children:[k(`div`,{className:`label`,children:[`In the party (`,r.length,`)`]}),r.map(t=>k(`div`,{className:`row`,"data-member":t.id,children:[t.name?U(`span`,{className:`name`,children:t.name}):null,U(`span`,{className:`id`,title:t.id,children:t.id}),t.host&&U(`span`,{className:`badge`,children:`host`}),t.self&&U(`span`,{className:`badge you`,children:`you`}),e.role===`host`&&!t.self&&k(H,{children:[k(`button`,{type:`button`,className:`action danger`,onClick:()=>{X.kick(t.id)},children:[U(ll,{size:14}),` Kick`]}),k(`button`,{type:`button`,className:`action danger`,onClick:()=>{X.ban(t.id)},children:[U(Lc,{size:14}),` Ban`]})]})]},t.id))]}),U(`div`,{className:`section`,children:k(`button`,{type:`button`,className:`action`,onClick:()=>{X.leave()},children:[U(Yc,{size:14}),` `,e.role===`host`?`End party`:`Leave party`]})})]})]})},FM=e=>e.owned?`owned`:`placeholder`,IM=e=>{let t=[],n=new Set;for(let r of e.members??[])r.uri&&!n.has(r.uri)&&(n.add(r.uri),t.push({uri:r.uri,kind:FM(r),origin:r.origin,scope:r.scope,title:r.title,episodeCount:r.episodeCount,startDate:r.startDate,member:r}));let r=[...(e.links??[]).flatMap(e=>[e.fromUri,e.toUri]),...(e.claims??[]).flatMap(e=>[e.fromUri,e.toUri])];for(let e of r)e&&!n.has(e)&&(n.add(e),t.push({uri:e,kind:`named`,origin:null,scope:null,title:null,episodeCount:null,startDate:null,member:null}));return t},LM=e=>{let t=IM(e),n=_h({nodes:t.map(e=>({uri:e.uri,titles:[{title:e.title??e.uri}],startDate:e.startDate})),edges:(e.links??[]).map(e=>({from:e.fromUri,to:e.toUri,relation:e.kind}))},`graph`),r=new Map(n.nodes.map(e=>[e.uri,e]));return{nodes:t.map(e=>({...e,column:r.get(e.uri)?.column??0,row:r.get(e.uri)?.row??0})),columns:n.columns,rows:n.rows}},RM=(e,t)=>[e,t].sort().join(` `),zM=e=>{let t=new Map;for(let n of e){let e=RM(n.fromUri,n.toUri),r=t.get(e)??[];r.push(n.key),t.set(e,r)}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,{lane:r,lanes:e.length}));return n},BM=e=>{let t=new Map;for(let n of e.links??[])t.set(n.key,{kind:`link`,row:n});for(let n of e.claims??[])t.set(n.key,{kind:`claim`,row:n});for(let n of e.episodeLinks??[])t.set(n.key,{kind:`episode-link`,row:n});for(let n of e.episodeClaims??[])t.set(n.key,{kind:`episode-claim`,row:n});for(let n of e.episodeSources??[])t.set(n.key,{kind:`episode-source`,row:n});return t},VM=/^[0-9a-f]{64}$/,HM=(e,t)=>(t??[]).map(t=>{let n=e.get(t)??null;return{key:t,ref:n,gap:n?null:VM.test(t)?`missing`:`not-an-edge-key`}}),UM=(e,t)=>(e.answers??[]).find(e=>e.seq===t)??null,WM=e=>e===null?null:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),GM=e=>{if(e==null||e===``)return{kind:`absent`};let t;try{t=JSON.parse(e)}catch{return{kind:`raw`,raw:e}}return t===null?{kind:`fields`,fields:[{field:`value`,value:null}]}:typeof t==`object`&&!Array.isArray(t)?{kind:`fields`,fields:Object.entries(t).map(([e,t])=>({field:e,value:WM(t)}))}:{kind:`fields`,fields:[{field:Array.isArray(t)?`values`:`value`,value:WM(t)}]}},KM=e=>e===`not-enabled`?`The graph engine is switched off for this page, so there is nothing to read. Reloading with ?graph=1 turns it on, and this page then asks the sources about the uri itself. The only way a page gets here now is ?store=legacy, which pins it to the old store; dropping that flag puts the whole app back on the graph, which is the default.`:e===`graph-empty`?`The engine is on and the graph is empty. A graph is built inside one tab and never outlives it, so a link opened cold always starts here: what fills it is a page asking the sources, which is what this page does with the uri it was given.`:e===`no-row`?`No media row exists for that uri, so there is nothing to cluster. Either no source has answered for it in this tab yet, or the uri is not one any source recognises.`:e===`no-cluster`?`A media row exists for that uri, but no cluster holds it yet: either a pass has not run since it arrived, or it is a placeholder no pass will ever cluster on its own.`:`That uri reached no cluster, and the bundle carries no reason for it.`,qM=e=>e===`active`,JM=async(e,t,n={},r={})=>{let i=r.settleMs??2e4,a=await e(`http://d/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json, text/event-stream`},body:JSON.stringify({query:t,variables:n})});if(!(a.headers.get(`content-type`)??``).includes(`event-stream`)){let e=await a.json();return r.onPayload?.(e,1),{payloads:1,last:e}}let o=a.body.getReader(),s=new TextDecoder,c=Date.now()+i,l=``,u=0,d,f=!1;for(;!f&&Date.now()<c;){let e=await Promise.race([o.read(),new Promise(e=>setTimeout(()=>e({done:!0,value:void 0}),Math.max(0,c-Date.now())))]);if(e.done)break;l+=s.decode(e.value,{stream:!0});let t=l.split(`
3757
+ `,VM={"not-found":`That party has ended.`,"bad-key":`The invite link is not valid.`,invalid:`The invite link is broken.`,full:`The party is full.`,blocked:`You cannot join this party.`,unavailable:`Parties are not available right now. Is FKN connected?`},HM=()=>{let e=Ap(),[t]=B(()=>wp(location.hash,location.origin)),[n]=B(()=>location.hash.length>1&&!wp(location.hash,location.origin)),[r,i]=B([]),[a,o]=B(()=>X.name()??``),[s,c]=B(!1),l=e.status===`active`;O(()=>{if(!t)return;let e=X.getState();(e.status!==`joining`&&e.status!==`active`||e.invite!==t)&&X.join(t)},[t]);let u=l?e.members:0;O(()=>{if(!l){i([]);return}let e=!1;return X.roster().then(t=>{e||i(t)}),()=>{e=!0}},[l,u]),jp(e=>{e.t===`name`&&X.roster().then(i)}),O(()=>{if(!s)return;let e=setTimeout(()=>c(!1),1500);return()=>clearTimeout(e)},[s]);let d=l?Cp(location.origin,e.invite):void 0,f=async()=>{if(d)try{await navigator.clipboard.writeText(d),c(!0)}catch{}};return k(`div`,{css:BM,children:[U(`div`,{className:`heading`,children:`Watch together`}),k(`div`,{className:`status`,children:[n?U(H,{children:`This invite link is broken. Ask the host for a new one.`}):!t&&!l&&e.status!==`joining`?e.status===`failed`?k(H,{children:[`Could not join. `,VM[e.code]??`Something went wrong.`]}):e.status===`ended`?U(H,{children:`The party ended.`}):U(H,{children:`You are not in a party. Start one from the header, or open an invite link.`}):!t&&e.status===`joining`?U(H,{children:`Joining the party…`}):t&&!l?e.status===`joining`?U(H,{children:`Joining the party…`}):e.status===`failed`?k(H,{children:[`Could not join. `,VM[e.code]??`Something went wrong.`]}):e.status===`ended`?U(H,{children:`The party ended.`}):U(H,{children:`This invite link is broken. Ask the host for a new one.`}):l&&e.role===`guest`&&t?U(H,{children:`You are in. Waiting for the host…`}):l&&e.role===`guest`?k(H,{children:[`You are following the host. `,U(os,{to:ps(J.HOME),children:`Go home`}),` and Catch up from the header to rejoin them.`]}):U(H,{children:`You are hosting. Everyone here follows you, and you decide who stays.`}),!t&&!l&&e.status!==`joining`&&(e.status===`failed`||e.status===`ended`)?k(H,{children:[` `,U(`button`,{type:`button`,className:`action`,onClick:()=>X.dismiss(),children:`OK`})]}):null]}),l&&k(H,{children:[k(`div`,{className:`section`,children:[U(`div`,{className:`label`,children:`Your name`}),k(`form`,{className:`field`,onSubmit:e=>{e.preventDefault(),X.setName(Zf(a))},children:[U(`input`,{value:a,maxLength:32,placeholder:`What the party should call you`,"aria-label":`Your name`,onInput:e=>o(e.currentTarget.value)}),k(`button`,{type:`submit`,className:`action`,children:[U(Uc,{size:14}),` Save`]})]})]}),k(`div`,{className:`section`,children:[U(`div`,{className:`label`,children:`Invite link`}),k(`div`,{className:`field`,children:[U(`input`,{readOnly:!0,value:d,"aria-label":`Invite link`,onFocus:e=>e.currentTarget.select()}),k(`button`,{type:`button`,className:`action`,onClick:()=>{f()},children:[U(s?Uc:qc,{size:14}),` Copy`]})]})]}),k(`div`,{className:`section`,children:[k(`div`,{className:`label`,children:[`In the party (`,r.length,`)`]}),r.map(t=>k(`div`,{className:`row`,"data-member":t.id,children:[t.name?U(`span`,{className:`name`,children:t.name}):null,U(`span`,{className:`id`,title:t.id,children:t.id}),t.host&&U(`span`,{className:`badge`,children:`host`}),t.self&&U(`span`,{className:`badge you`,children:`you`}),e.role===`host`&&!t.self&&k(H,{children:[k(`button`,{type:`button`,className:`action danger`,onClick:()=>{X.kick(t.id)},children:[U(ml,{size:14}),` Kick`]}),k(`button`,{type:`button`,className:`action danger`,onClick:()=>{X.ban(t.id)},children:[U(Hc,{size:14}),` Ban`]})]})]},t.id))]}),U(`div`,{className:`section`,children:k(`button`,{type:`button`,className:`action`,onClick:()=>{X.leave()},children:[U(el,{size:14}),` `,e.role===`host`?`End party`:`Leave party`]})})]})]})},UM=e=>e.owned?`owned`:`placeholder`,WM=e=>{let t=[],n=new Set;for(let r of e.members??[])r.uri&&!n.has(r.uri)&&(n.add(r.uri),t.push({uri:r.uri,kind:UM(r),origin:r.origin,scope:r.scope,title:r.title,episodeCount:r.episodeCount,startDate:r.startDate,member:r}));let r=[...(e.links??[]).flatMap(e=>[e.fromUri,e.toUri]),...(e.claims??[]).flatMap(e=>[e.fromUri,e.toUri])];for(let e of r)e&&!n.has(e)&&(n.add(e),t.push({uri:e,kind:`named`,origin:null,scope:null,title:null,episodeCount:null,startDate:null,member:null}));return t},GM=e=>{let t=WM(e),n=Sh({nodes:t.map(e=>({uri:e.uri,titles:[{title:e.title??e.uri}],startDate:e.startDate})),edges:(e.links??[]).map(e=>({from:e.fromUri,to:e.toUri,relation:e.kind}))},`graph`),r=new Map(n.nodes.map(e=>[e.uri,e]));return{nodes:t.map(e=>({...e,column:r.get(e.uri)?.column??0,row:r.get(e.uri)?.row??0})),columns:n.columns,rows:n.rows}},KM=(e,t)=>[e,t].sort().join(` `),qM=e=>{let t=new Map;for(let n of e){let e=KM(n.fromUri,n.toUri),r=t.get(e)??[];r.push(n.key),t.set(e,r)}let n=new Map;for(let e of t.values())e.forEach((t,r)=>n.set(t,{lane:r,lanes:e.length}));return n},JM=e=>{let t=new Map;for(let n of e.links??[])t.set(n.key,{kind:`link`,row:n});for(let n of e.claims??[])t.set(n.key,{kind:`claim`,row:n});for(let n of e.episodeLinks??[])t.set(n.key,{kind:`episode-link`,row:n});for(let n of e.episodeClaims??[])t.set(n.key,{kind:`episode-claim`,row:n});for(let n of e.episodeSources??[])t.set(n.key,{kind:`episode-source`,row:n});return t},YM=/^[0-9a-f]{64}$/,XM=(e,t)=>(t??[]).map(t=>{let n=e.get(t)??null;return{key:t,ref:n,gap:n?null:YM.test(t)?`missing`:`not-an-edge-key`}}),ZM=(e,t)=>(e.answers??[]).find(e=>e.seq===t)??null,QM=e=>e===null?null:typeof e==`string`?e:typeof e==`number`||typeof e==`boolean`?String(e):JSON.stringify(e),$M=e=>{if(e==null||e===``)return{kind:`absent`};let t;try{t=JSON.parse(e)}catch{return{kind:`raw`,raw:e}}return t===null?{kind:`fields`,fields:[{field:`value`,value:null}]}:typeof t==`object`&&!Array.isArray(t)?{kind:`fields`,fields:Object.entries(t).map(([e,t])=>({field:e,value:QM(t)}))}:{kind:`fields`,fields:[{field:Array.isArray(t)?`values`:`value`,value:QM(t)}]}},eN=e=>e===`not-enabled`?`The graph engine is switched off for this page, so there is nothing to read. Reloading with ?graph=1 turns it on, and this page then asks the sources about the uri itself. The only way a page gets here now is ?store=legacy, which pins it to the old store; dropping that flag puts the whole app back on the graph, which is the default.`:e===`graph-empty`?`The engine is on and the graph is empty. A graph is built inside one tab and never outlives it, so a link opened cold always starts here: what fills it is a page asking the sources, which is what this page does with the uri it was given.`:e===`no-row`?`No media row exists for that uri, so there is nothing to cluster. Either no source has answered for it in this tab yet, or the uri is not one any source recognises.`:e===`no-cluster`?`A media row exists for that uri, but no cluster holds it yet: either a pass has not run since it arrived, or it is a placeholder no pass will ever cluster on its own.`:`That uri reached no cluster, and the bundle carries no reason for it.`,tN=e=>e===`active`,nN=async(e,t,n={},r={})=>{let i=r.settleMs??2e4,a=await e(`http://d/graphql`,{method:`POST`,headers:{"content-type":`application/json`,accept:`application/json, text/event-stream`},body:JSON.stringify({query:t,variables:n})});if(!(a.headers.get(`content-type`)??``).includes(`event-stream`)){let e=await a.json();return r.onPayload?.(e,1),{payloads:1,last:e}}let o=a.body.getReader(),s=new TextDecoder,c=Date.now()+i,l=``,u=0,d,f=!1;for(;!f&&Date.now()<c;){let e=await Promise.race([o.read(),new Promise(e=>setTimeout(()=>e({done:!0,value:void 0}),Math.max(0,c-Date.now())))]);if(e.done)break;l+=s.decode(e.value,{stream:!0});let t=l.split(`
3658
3758
 
3659
3759
  `);l=t.pop()??``;for(let e of t){let t=e.split(`
3660
- `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t){try{d=JSON.parse(t),u+=1}catch{continue}if(r.onPayload?.(d,u),r.done?.(d,u)){f=!0;break}}}}return o.cancel().catch(()=>{}),{payloads:u,last:d}},YM=`
3760
+ `).filter(e=>e.startsWith(`data:`)).map(e=>e.slice(5).trim()).join(``);if(t){try{d=JSON.parse(t),u+=1}catch{continue}if(r.onPayload?.(d,u),r.done?.(d,u)){f=!0;break}}}}return o.cancel().catch(()=>{}),{payloads:u,last:d}},rN=`
3661
3761
  subscription TraceWarm($input: MediaInput!) {
3662
3762
  media(input: $input) {
3663
3763
  _id
@@ -3691,12 +3791,12 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3691
3791
  }
3692
3792
  }
3693
3793
  }
3694
- `,XM=(e,t)=>{let n=e?.data?.media;return{payloads:t,uri:typeof n?.uri==`string`?n.uri:null,handles:Array.isArray(n?.handles)?n.handles.length:0,episodes:Array.isArray(n?.episodes)?n.episodes.length:0}},ZM=async(e,{onProgress:t,settleMs:n=25e3}={})=>{let r={payloads:0,uri:null,handles:0,episodes:0};if(!e)return r;try{let i=await Ne(()=>import(`./worker-HiPGVuwy.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url);if(typeof i.handleRequest!=`function`)return r;await JM(i.handleRequest,YM,{input:{uri:e}},{settleMs:n,onPayload:(e,n)=>{r=XM(e,n),t?.(r)}})}catch(e){console.error(Error(`graph trace: the warm could not ask the sources`,{cause:e}))}return r},QM=x`
3794
+ `,iN=(e,t)=>{let n=e?.data?.media;return{payloads:t,uri:typeof n?.uri==`string`?n.uri:null,handles:Array.isArray(n?.handles)?n.handles.length:0,episodes:Array.isArray(n?.episodes)?n.episodes.length:0}},aN=async(e,{onProgress:t,settleMs:n=25e3}={})=>{let r={payloads:0,uri:null,handles:0,episodes:0};if(!e)return r;try{let i=await Ne(()=>import(`./worker-BqPITUlQ.js`),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url);if(typeof i.handleRequest!=`function`)return r;await nN(i.handleRequest,rN,{input:{uri:e}},{settleMs:n,onPayload:(e,n)=>{r=iN(e,n),t?.(r)}})}catch(e){console.error(Error(`graph trace: the warm could not ask the sources`,{cause:e}))}return r},oN=x`
3695
3795
  &.nothing {
3696
3796
  color: rgb(250, 204, 21);
3697
3797
  font-style: italic;
3698
3798
  }
3699
- `,$M=({value:e})=>e===null?U(`span`,{css:QM,className:`nothing`,children:`null`}):e===void 0?U(`span`,{css:QM,className:`nothing`,children:`absent`}):e===``?U(`span`,{css:QM,className:`nothing`,children:`empty`}):U(`span`,{css:QM,children:String(e)}),eN=x`
3799
+ `,sN=({value:e})=>e===null?U(`span`,{css:oN,className:`nothing`,children:`null`}):e===void 0?U(`span`,{css:oN,className:`nothing`,children:`absent`}):e===``?U(`span`,{css:oN,className:`nothing`,children:`empty`}):U(`span`,{css:oN,children:String(e)}),cN=x`
3700
3800
  .fields {
3701
3801
  width: 100%;
3702
3802
  border-collapse: collapse;
@@ -3729,7 +3829,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3729
3829
  white-space: pre-wrap;
3730
3830
  overflow-wrap: anywhere;
3731
3831
  }
3732
- `,tN=({blob:e,label:t})=>k(`div`,{css:eN,className:`blob`,"data-blob":t,children:[e.kind===`absent`&&U(`div`,{className:`absent`,children:U($M,{value:null})}),e.kind===`raw`&&k(H,{children:[U(`div`,{className:`note`,children:`not JSON, shown as it is stored`}),U(`pre`,{className:`raw`,children:e.raw})]}),e.kind===`fields`&&U(`table`,{className:`fields`,children:U(`tbody`,{children:e.fields.map(e=>k(`tr`,{"data-field":e.field,children:[U(`th`,{scope:`row`,children:e.field}),U(`td`,{children:U($M,{value:e.value})})]},e.field))})})]}),nN=88,rN=20,iN=36,aN=266,oN=76,sN=e=>[e.member?`${e.kind} ${e.member.via===`member`?`member`:`claimed`}`:`named by an edge`,e.origin??`no origin`,e.scope??`no scope`].join(` · `),cN=(e,t)=>{let n=e.find(e=>e.key===t);return new Set(n?[n.fromUri,n.toUri]:[])},lN=(e,t)=>{let n=LM(e),r=e.links??[],i=zM(r),a=cN(r,t),o=new Set(n.nodes.map(e=>e.uri));return{nodes:n.nodes.map(e=>({id:e.uri,type:`trace`,position:{x:iN+e.column*aN,y:iN+e.row*oN},width:178,height:56,draggable:!1,selectable:!1,data:{uri:e.uri,kind:e.kind,title:e.title,meta:sN(e),lit:a.has(e.uri)}})),edges:r.filter(e=>o.has(e.fromUri)&&o.has(e.toUri)).map(e=>{let n=i.get(e.key)??{lane:0,lanes:1};return{id:e.key,type:`trace`,source:e.fromUri,target:e.toUri,selected:e.key===t,data:{spread:(n.lane-(n.lanes-1)/2)*26,active:qM(e.status),status:e.status,label:e.kind,tooltip:`${e.kind} ${e.status} by ${e.by}: ${e.reason}`}}}),width:Math.max(1,n.columns)*aN-nN+72,height:Math.max(1,n.rows)*oN-rN+72}};j();var uN=x`
3832
+ `,lN=({blob:e,label:t})=>k(`div`,{css:cN,className:`blob`,"data-blob":t,children:[e.kind===`absent`&&U(`div`,{className:`absent`,children:U(sN,{value:null})}),e.kind===`raw`&&k(H,{children:[U(`div`,{className:`note`,children:`not JSON, shown as it is stored`}),U(`pre`,{className:`raw`,children:e.raw})]}),e.kind===`fields`&&U(`table`,{className:`fields`,children:U(`tbody`,{children:e.fields.map(e=>k(`tr`,{"data-field":e.field,children:[U(`th`,{scope:`row`,children:e.field}),U(`td`,{children:U(sN,{value:e.value})})]},e.field))})})]}),uN=88,dN=20,fN=36,pN=266,mN=76,hN=e=>[e.member?`${e.kind} ${e.member.via===`member`?`member`:`claimed`}`:`named by an edge`,e.origin??`no origin`,e.scope??`no scope`].join(` · `),gN=(e,t)=>{let n=e.find(e=>e.key===t);return new Set(n?[n.fromUri,n.toUri]:[])},_N=(e,t)=>{let n=GM(e),r=e.links??[],i=qM(r),a=gN(r,t),o=new Set(n.nodes.map(e=>e.uri));return{nodes:n.nodes.map(e=>({id:e.uri,type:`trace`,position:{x:fN+e.column*pN,y:fN+e.row*mN},width:178,height:56,draggable:!1,selectable:!1,data:{uri:e.uri,kind:e.kind,title:e.title,meta:hN(e),lit:a.has(e.uri)}})),edges:r.filter(e=>o.has(e.fromUri)&&o.has(e.toUri)).map(e=>{let n=i.get(e.key)??{lane:0,lanes:1};return{id:e.key,type:`trace`,source:e.fromUri,target:e.toUri,selected:e.key===t,data:{spread:(n.lane-(n.lanes-1)/2)*26,active:tN(e.status),status:e.status,label:e.kind,tooltip:`${e.kind} ${e.status} by ${e.by}: ${e.reason}`}}}),width:Math.max(1,n.columns)*pN-uN+72,height:Math.max(1,n.rows)*mN-dN+72}};j();var vN=x`
3733
3833
  position: relative;
3734
3834
  height: 46rem;
3735
3835
  border: 1px solid rgba(255, 255, 255, 0.12);
@@ -3801,7 +3901,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3801
3901
  .edge-label.active { fill: rgb(134, 239, 172); }
3802
3902
  .edge-label.refused { fill: rgb(252, 165, 165); }
3803
3903
  .cross { stroke: rgb(248, 113, 113); stroke-width: 1.5; }
3804
- `,dN=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,fN=({data:e})=>k(`div`,{className:`trace-node ${e.kind}${e.lit?` lit`:``}`,"data-node":e.uri,"data-kind":e.kind,title:`${e.uri} (${e.kind})`,children:[U(zT,{type:`target`,position:Z.Left}),U(`div`,{className:`uri`,children:dN(e.uri,26)}),U(`div`,{children:e.title===null?`no title`:dN(e.title,28)}),U(`div`,{className:`meta`,children:dN(e.meta,34)}),U(zT,{type:`source`,position:Z.Right})]}),pN=({data:e,selected:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=e?.spread??0,s=e?.active?`active`:`refused`,c=i>=n,l=Math.max(20,Math.abs(i-n)/2)*(c?1:-1),u=`M ${n} ${r} C ${n+l} ${r+o}, ${i-l} ${a+o}, ${i} ${a}`,d=(n+i)/2,f=(r+a)/2+o*.75;return k(H,{children:[U(`path`,{className:`edge ${s}${t?` selected`:``}`,d:u}),U(`path`,{className:`edge-hit`,d:u,children:U(`title`,{children:e?.tooltip})}),s===`refused`?k(`g`,{className:`cross-mark`,children:[U(`path`,{className:`cross`,d:`M ${d-5} ${f-5} L ${d+5} ${f+5}`}),U(`path`,{className:`cross`,d:`M ${d+5} ${f-5} L ${d-5} ${f+5}`})]}):null,U(`text`,{className:`edge-label ${s}`,x:d,y:f-9,textAnchor:`middle`,children:dN(e?.label??``,22)})]})},mN={trace:fN},hN={trace:pN},gN=({bundle:e,selected:t,onSelect:n})=>{let{nodes:r,edges:i}=V(()=>lN(e,t),[e,t]),a=z((e,t)=>n(t.id),[n]);return k(`div`,{css:uN,"data-trace-graph":!0,children:[k(`div`,{className:`legend`,children:[k(`div`,{children:[U(`b`,{children:`solid`}),` owned: its origin described it`]}),k(`div`,{children:[U(`b`,{children:`dashed yellow`}),` placeholder: no origin has`]}),k(`div`,{children:[U(`b`,{children:`dotted`}),` named by an edge only`]}),k(`div`,{children:[U(`b`,{children:`green line`}),` active link`]}),k(`div`,{children:[U(`b`,{children:`red dashed, crossed`}),` refused link`]})]}),U(vD,{nodes:r,edges:i,nodeTypes:mN,edgeTypes:hN,onEdgeClick:a,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every uri this cluster names, and every link between them`,children:U(TD,{variant:xD.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.12)`})})]})};j();var _N=x`
3904
+ `,yN=(e,t)=>e.length>t?`${e.slice(0,t-1)}…`:e,bN=({data:e})=>k(`div`,{className:`trace-node ${e.kind}${e.lit?` lit`:``}`,"data-node":e.uri,"data-kind":e.kind,title:`${e.uri} (${e.kind})`,children:[U(WT,{type:`target`,position:Z.Left}),U(`div`,{className:`uri`,children:yN(e.uri,26)}),U(`div`,{children:e.title===null?`no title`:yN(e.title,28)}),U(`div`,{className:`meta`,children:yN(e.meta,34)}),U(WT,{type:`source`,position:Z.Right})]}),xN=({data:e,selected:t,sourceX:n,sourceY:r,targetX:i,targetY:a})=>{let o=e?.spread??0,s=e?.active?`active`:`refused`,c=i>=n,l=Math.max(20,Math.abs(i-n)/2)*(c?1:-1),u=`M ${n} ${r} C ${n+l} ${r+o}, ${i-l} ${a+o}, ${i} ${a}`,d=(n+i)/2,f=(r+a)/2+o*.75;return k(H,{children:[U(`path`,{className:`edge ${s}${t?` selected`:``}`,d:u}),U(`path`,{className:`edge-hit`,d:u,children:U(`title`,{children:e?.tooltip})}),s===`refused`?k(`g`,{className:`cross-mark`,children:[U(`path`,{className:`cross`,d:`M ${d-5} ${f-5} L ${d+5} ${f+5}`}),U(`path`,{className:`cross`,d:`M ${d+5} ${f-5} L ${d-5} ${f+5}`})]}):null,U(`text`,{className:`edge-label ${s}`,x:d,y:f-9,textAnchor:`middle`,children:yN(e?.label??``,22)})]})},SN={trace:bN},CN={trace:xN},wN=({bundle:e,selected:t,onSelect:n})=>{let{nodes:r,edges:i}=V(()=>_N(e,t),[e,t]),a=z((e,t)=>n(t.id),[n]);return k(`div`,{css:vN,"data-trace-graph":!0,children:[k(`div`,{className:`legend`,children:[k(`div`,{children:[U(`b`,{children:`solid`}),` owned: its origin described it`]}),k(`div`,{children:[U(`b`,{children:`dashed yellow`}),` placeholder: no origin has`]}),k(`div`,{children:[U(`b`,{children:`dotted`}),` named by an edge only`]}),k(`div`,{children:[U(`b`,{children:`green line`}),` active link`]}),k(`div`,{children:[U(`b`,{children:`red dashed, crossed`}),` refused link`]})]}),U(CD,{nodes:r,edges:i,nodeTypes:SN,edgeTypes:CN,onEdgeClick:a,nodesDraggable:!1,nodesConnectable:!1,elementsSelectable:!0,fitView:!0,minZoom:.05,maxZoom:20,"aria-label":`Every uri this cluster names, and every link between them`,children:U(AD,{variant:ED.Dots,gap:24,size:1,color:`rgba(255, 255, 255, 0.12)`})})]})};j();var TN=x`
3805
3905
  border: 1px solid rgba(255, 255, 255, 0.12);
3806
3906
  border-radius: 0.5rem;
3807
3907
  padding: 1rem 1.2rem;
@@ -3901,7 +4001,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3901
4001
  }
3902
4002
 
3903
4003
  .empty { color: rgba(255, 255, 255, 0.5); }
3904
- `,vN=e=>e.kind===`link`?`link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`episode-link`?`episode link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`claim`?`claim ${e.row.kind} from ${e.row.claimer}`:e.kind===`episode-source`?`episode list from ${e.row.claimer}`:`episode claim ${e.row.kind} from ${e.row.claimer}`,yN=e=>e===`not-an-edge-key`?`not an edge key`:`not in this bundle`,bN=e=>{if(e==null)return``;if(typeof e==`string`)return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(typeof e==`object`&&typeof e.raw==`string`)return e.raw;try{return JSON.stringify(e,null,2)}catch{return String(e)}},xN=({rows:e})=>U(`table`,{className:`facts`,children:U(`tbody`,{children:e.map(([e,t])=>k(`tr`,{"data-fact":e,children:[U(`th`,{scope:`row`,children:e}),U(`td`,{children:U($M,{value:t})})]},e))})}),SN=({bundle:e,seq:t,answer:n,onLoad:r})=>{let i=UM(e,t);return k(H,{children:[k(`h4`,{children:[`answer `,t]}),i?U(xN,{rows:[[`uri`,i.uri],[`origin`,i.origin],[`operation`,i.operation],[`bytes`,i.bytes]]}):U(`p`,{className:`empty`,"data-no-answer-row":!0,children:`The bundle lists no answer with that sequence.`}),U(`button`,{type:`button`,className:`load`,onClick:()=>r(t),children:`Load answer bytes`}),n?.seq===t&&k(`div`,{className:`answer`,"data-answer":!0,children:[n.state===`loading`&&U(`p`,{className:`empty`,children:`loading…`}),n.state===`failed`&&U(`p`,{className:`failed`,children:n.text}),n.state===`done`&&(n.text===``?U(`p`,{className:`empty`,children:`nothing came back for that sequence.`}):U(`pre`,{children:n.text}))]})]})},CN=({bundle:e,index:t,trail:n,onFollow:r,onTrailTo:i,loadAnswerBytes:a})=>{let[o,s]=B(void 0),c=n[n.length-1],l=c===void 0?void 0:t.get(c),u=HM(t,l&&(l.kind===`link`||l.kind===`episode-link`)?l.row.supports:[]),d=e=>{s({seq:e,state:`loading`,text:``}),a(e).then(t=>s({seq:e,state:`done`,text:bN(t)})).catch(t=>s({seq:e,state:`failed`,text:t instanceof Error?t.message:String(t)}))};return k(`div`,{css:_N,"data-inspector":!0,children:[U(`h3`,{children:`Edge inspector`}),c===void 0?U(`p`,{className:`empty`,children:`Select a link in the graph, or any row in the tables below.`}):k(H,{children:[k(`div`,{className:`trail`,children:[n.slice(0,-1).map((e,n)=>U(`button`,{type:`button`,onClick:()=>i(n),children:t.get(e)?vN(t.get(e)):e},e)),U(`span`,{className:`here`,children:l?vN(l):c})]}),l===void 0?k(`p`,{className:`empty`,"data-unknown-row":!0,children:[`The bundle carries no row with the key `,U(`code`,{children:c}),`.`]}):k(H,{children:[(l.kind===`link`||l.kind===`episode-link`)&&k(H,{children:[U(xN,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`written by`,l.row.by],[`rule`,l.row.reason]]}),k(`p`,{children:[`status`,` `,U(`span`,{className:`status ${qM(l.row.status)?`active`:`refused`}`,children:l.row.status})]}),U(xN,{rows:l.kind===`link`?[[`confidence`,l.row.confidence],[`version`,l.row.version]]:[[`from number`,l.row.fromNumber],[`to number`,l.row.toNumber]]}),U(`h4`,{children:`evidence`}),U(tN,{blob:GM(l.row.evidence),label:`evidence`}),l.kind===`link`&&k(H,{children:[U(`h4`,{children:`gates`}),U(tN,{blob:GM(l.row.gates),label:`gates`})]})]}),(l.kind===`claim`||l.kind===`episode-claim`)&&k(H,{children:[U(xN,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`claimed by`,l.row.claimer],[`provenance`,l.row.provenance],[`answer seq`,l.row.answerSeq],...l.kind===`claim`?[[`target scope`,l.row.targetScope]]:[]]}),U(SN,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),l.kind===`episode-source`&&k(H,{children:[U(xN,{rows:[[`media`,l.row.fromUri],[`episode`,l.row.toUri],[`listed by`,l.row.claimer],[`answer seq`,l.row.answerSeq]]}),U(SN,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),U(`h4`,{children:`supports`}),l.kind===`claim`||l.kind===`episode-claim`||l.kind===`episode-source`?U(`p`,{className:`empty`,children:`This row is source truth: it is derived from nothing.`}):u.length===0?U(`p`,{className:`empty`,children:`This row names no supports.`}):U(`div`,{className:`supports`,children:u.map(e=>k(`div`,{className:`support`,"data-gap":e.gap??void 0,children:[e.ref?U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Follow`}):U(`span`,{className:`unresolved`,children:yN(e.gap)}),U(`span`,{className:`what`,children:e.ref?vN(e.ref):`unresolved`}),U(`span`,{className:`key`,children:e.key})]},e.key))})]})]})]})},wN=x`
4004
+ `,EN=e=>e.kind===`link`?`link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`episode-link`?`episode link ${e.row.kind} ${e.row.status} by ${e.row.by}`:e.kind===`claim`?`claim ${e.row.kind} from ${e.row.claimer}`:e.kind===`episode-source`?`episode list from ${e.row.claimer}`:`episode claim ${e.row.kind} from ${e.row.claimer}`,DN=e=>e===`not-an-edge-key`?`not an edge key`:`not in this bundle`,ON=e=>{if(e==null)return``;if(typeof e==`string`)return e;if(e instanceof Uint8Array)return new TextDecoder().decode(e);if(e instanceof ArrayBuffer)return new TextDecoder().decode(new Uint8Array(e));if(typeof e==`object`&&typeof e.raw==`string`)return e.raw;try{return JSON.stringify(e,null,2)}catch{return String(e)}},kN=({rows:e})=>U(`table`,{className:`facts`,children:U(`tbody`,{children:e.map(([e,t])=>k(`tr`,{"data-fact":e,children:[U(`th`,{scope:`row`,children:e}),U(`td`,{children:U(sN,{value:t})})]},e))})}),AN=({bundle:e,seq:t,answer:n,onLoad:r})=>{let i=ZM(e,t);return k(H,{children:[k(`h4`,{children:[`answer `,t]}),i?U(kN,{rows:[[`uri`,i.uri],[`origin`,i.origin],[`operation`,i.operation],[`bytes`,i.bytes]]}):U(`p`,{className:`empty`,"data-no-answer-row":!0,children:`The bundle lists no answer with that sequence.`}),U(`button`,{type:`button`,className:`load`,onClick:()=>r(t),children:`Load answer bytes`}),n?.seq===t&&k(`div`,{className:`answer`,"data-answer":!0,children:[n.state===`loading`&&U(`p`,{className:`empty`,children:`loading…`}),n.state===`failed`&&U(`p`,{className:`failed`,children:n.text}),n.state===`done`&&(n.text===``?U(`p`,{className:`empty`,children:`nothing came back for that sequence.`}):U(`pre`,{children:n.text}))]})]})},jN=({bundle:e,index:t,trail:n,onFollow:r,onTrailTo:i,loadAnswerBytes:a})=>{let[o,s]=B(void 0),c=n[n.length-1],l=c===void 0?void 0:t.get(c),u=XM(t,l&&(l.kind===`link`||l.kind===`episode-link`)?l.row.supports:[]),d=e=>{s({seq:e,state:`loading`,text:``}),a(e).then(t=>s({seq:e,state:`done`,text:ON(t)})).catch(t=>s({seq:e,state:`failed`,text:t instanceof Error?t.message:String(t)}))};return k(`div`,{css:TN,"data-inspector":!0,children:[U(`h3`,{children:`Edge inspector`}),c===void 0?U(`p`,{className:`empty`,children:`Select a link in the graph, or any row in the tables below.`}):k(H,{children:[k(`div`,{className:`trail`,children:[n.slice(0,-1).map((e,n)=>U(`button`,{type:`button`,onClick:()=>i(n),children:t.get(e)?EN(t.get(e)):e},e)),U(`span`,{className:`here`,children:l?EN(l):c})]}),l===void 0?k(`p`,{className:`empty`,"data-unknown-row":!0,children:[`The bundle carries no row with the key `,U(`code`,{children:c}),`.`]}):k(H,{children:[(l.kind===`link`||l.kind===`episode-link`)&&k(H,{children:[U(kN,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`written by`,l.row.by],[`rule`,l.row.reason]]}),k(`p`,{children:[`status`,` `,U(`span`,{className:`status ${tN(l.row.status)?`active`:`refused`}`,children:l.row.status})]}),U(kN,{rows:l.kind===`link`?[[`confidence`,l.row.confidence],[`version`,l.row.version]]:[[`from number`,l.row.fromNumber],[`to number`,l.row.toNumber]]}),U(`h4`,{children:`evidence`}),U(lN,{blob:$M(l.row.evidence),label:`evidence`}),l.kind===`link`&&k(H,{children:[U(`h4`,{children:`gates`}),U(lN,{blob:$M(l.row.gates),label:`gates`})]})]}),(l.kind===`claim`||l.kind===`episode-claim`)&&k(H,{children:[U(kN,{rows:[[`from`,l.row.fromUri],[`to`,l.row.toUri],[`kind`,l.row.kind],[`claimed by`,l.row.claimer],[`provenance`,l.row.provenance],[`answer seq`,l.row.answerSeq],...l.kind===`claim`?[[`target scope`,l.row.targetScope]]:[]]}),U(AN,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),l.kind===`episode-source`&&k(H,{children:[U(kN,{rows:[[`media`,l.row.fromUri],[`episode`,l.row.toUri],[`listed by`,l.row.claimer],[`answer seq`,l.row.answerSeq]]}),U(AN,{bundle:e,seq:l.row.answerSeq,answer:o,onLoad:d})]}),U(`h4`,{children:`supports`}),l.kind===`claim`||l.kind===`episode-claim`||l.kind===`episode-source`?U(`p`,{className:`empty`,children:`This row is source truth: it is derived from nothing.`}):u.length===0?U(`p`,{className:`empty`,children:`This row names no supports.`}):U(`div`,{className:`supports`,children:u.map(e=>k(`div`,{className:`support`,"data-gap":e.gap??void 0,children:[e.ref?U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Follow`}):U(`span`,{className:`unresolved`,children:DN(e.gap)}),U(`span`,{className:`what`,children:e.ref?EN(e.ref):`unresolved`}),U(`span`,{className:`key`,children:e.key})]},e.key))})]})]})]})},MN=x`
3905
4005
  table {
3906
4006
  width: 100%;
3907
4007
  border-collapse: collapse;
@@ -3954,7 +4054,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
3954
4054
  .status.active { color: rgb(74, 222, 128); }
3955
4055
  .status.refused { color: rgb(248, 113, 113); }
3956
4056
  .empty { color: rgba(255, 255, 255, 0.5); font-size: 1.2rem; }
3957
- `,TN=({fill:e,index:t,onSelect:n})=>{let r=HM(t,e.supports);return r.length===0?U(`div`,{className:`proof`,children:U(`span`,{className:`missing`,"data-no-proof":!0,children:`${e.via} names no proving pair`})}):U(H,{children:r.map(e=>{let t=e.ref?.kind===`episode-link`?e.ref.row:void 0;return k(`div`,{className:`proof`,children:[U(`button`,{type:`button`,onClick:()=>n(e.key),children:`Inspect`}),t?U(`span`,{className:`pair`,children:`${t.fromUri} #${t.fromNumber??`null`} to ${t.toUri} #${t.toNumber??`null`}`}):U(`span`,{className:`pair`,children:e.ref?`${vN(e.ref)} ${e.key}`:U(`span`,{className:`missing`,children:`${e.key}: ${yN(e.gap)}`})}),t&&U(`span`,{className:`status ${qM(t.status)?`active`:`refused`}`,children:t.status})]},e.key)})})},EN=({bundle:e,index:t,selected:n,onSelect:r})=>k(`div`,{css:wN,"data-episodes":!0,children:[(e.episodes??[]).length===0?U(`p`,{className:`empty`,children:`This cluster holds no slots.`}):k(`table`,{"data-slots":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`slot`}),U(`th`,{children:`number`}),U(`th`,{children:`title`}),U(`th`,{children:`fills`})]})}),U(`tbody`,{children:e.episodes.map(e=>k(`tr`,{"data-slot":e.slotId,children:[U(`td`,{className:`slot`,children:e.slotId}),U(`td`,{children:U($M,{value:e.number})}),U(`td`,{children:U($M,{value:e.title})}),U(`td`,{children:e.fills.length===0?U(`span`,{className:`empty`,children:`nothing fills this slot`}):e.fills.map(e=>k(`div`,{"data-fill":e.episodeUri,children:[k(`div`,{className:`fill`,children:[U(`span`,{className:`uri`,children:e.episodeUri}),k(`span`,{children:[`#`,U($M,{value:e.number})]}),U(`span`,{children:e.origin}),U(`span`,{className:`via`,children:e.via}),U(`span`,{className:`by`,children:e.by})]}),U(TN,{fill:e,index:t,onSelect:r})]},`${e.episodeUri}\u0000${e.via}`))})]},e.slotId))})]}),U(`h3`,{children:`Episode edges`}),(e.episodeLinks??[]).length===0?U(`p`,{className:`empty`,children:`No episode links, refused or otherwise.`}):k(`table`,{"data-episode-links":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`status`}),U(`th`,{children:`by`}),U(`th`,{children:`rule`}),U(`th`,{})]})}),U(`tbody`,{children:e.episodeLinks.map(e=>k(`tr`,{"data-episode-link":e.key,"data-status":e.status,className:n===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:`${e.fromUri} #${e.fromNumber??`null`}`}),U(`td`,{className:`uri`,children:`${e.toUri} #${e.toNumber??`null`}`}),U(`td`,{children:e.kind}),U(`td`,{children:U(`span`,{className:`status ${qM(e.status)?`active`:`refused`}`,children:e.status})}),U(`td`,{children:e.by}),U(`td`,{children:e.reason}),U(`td`,{children:U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Episode claims`}),(e.episodeClaims??[]).length===0?U(`p`,{className:`empty`,children:`no episode level claims`}):k(`table`,{"data-episode-claims":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`claimer`}),U(`th`,{children:`provenance`}),U(`th`,{children:`answer`}),U(`th`,{})]})}),U(`tbody`,{children:e.episodeClaims.map(e=>k(`tr`,{"data-episode-claim":e.key,className:n===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:e.claimer}),U(`td`,{children:e.provenance}),U(`td`,{children:e.answerSeq}),U(`td`,{children:U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]})]});j();var DN=x`
4057
+ `,NN=({fill:e,index:t,onSelect:n})=>{let r=XM(t,e.supports);return r.length===0?U(`div`,{className:`proof`,children:U(`span`,{className:`missing`,"data-no-proof":!0,children:`${e.via} names no proving pair`})}):U(H,{children:r.map(e=>{let t=e.ref?.kind===`episode-link`?e.ref.row:void 0;return k(`div`,{className:`proof`,children:[U(`button`,{type:`button`,onClick:()=>n(e.key),children:`Inspect`}),t?U(`span`,{className:`pair`,children:`${t.fromUri} #${t.fromNumber??`null`} to ${t.toUri} #${t.toNumber??`null`}`}):U(`span`,{className:`pair`,children:e.ref?`${EN(e.ref)} ${e.key}`:U(`span`,{className:`missing`,children:`${e.key}: ${DN(e.gap)}`})}),t&&U(`span`,{className:`status ${tN(t.status)?`active`:`refused`}`,children:t.status})]},e.key)})})},PN=({bundle:e,index:t,selected:n,onSelect:r})=>k(`div`,{css:MN,"data-episodes":!0,children:[(e.episodes??[]).length===0?U(`p`,{className:`empty`,children:`This cluster holds no slots.`}):k(`table`,{"data-slots":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`slot`}),U(`th`,{children:`number`}),U(`th`,{children:`title`}),U(`th`,{children:`fills`})]})}),U(`tbody`,{children:e.episodes.map(e=>k(`tr`,{"data-slot":e.slotId,children:[U(`td`,{className:`slot`,children:e.slotId}),U(`td`,{children:U(sN,{value:e.number})}),U(`td`,{children:U(sN,{value:e.title})}),U(`td`,{children:e.fills.length===0?U(`span`,{className:`empty`,children:`nothing fills this slot`}):e.fills.map(e=>k(`div`,{"data-fill":e.episodeUri,children:[k(`div`,{className:`fill`,children:[U(`span`,{className:`uri`,children:e.episodeUri}),k(`span`,{children:[`#`,U(sN,{value:e.number})]}),U(`span`,{children:e.origin}),U(`span`,{className:`via`,children:e.via}),U(`span`,{className:`by`,children:e.by})]}),U(NN,{fill:e,index:t,onSelect:r})]},`${e.episodeUri}\u0000${e.via}`))})]},e.slotId))})]}),U(`h3`,{children:`Episode edges`}),(e.episodeLinks??[]).length===0?U(`p`,{className:`empty`,children:`No episode links, refused or otherwise.`}):k(`table`,{"data-episode-links":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`status`}),U(`th`,{children:`by`}),U(`th`,{children:`rule`}),U(`th`,{})]})}),U(`tbody`,{children:e.episodeLinks.map(e=>k(`tr`,{"data-episode-link":e.key,"data-status":e.status,className:n===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:`${e.fromUri} #${e.fromNumber??`null`}`}),U(`td`,{className:`uri`,children:`${e.toUri} #${e.toNumber??`null`}`}),U(`td`,{children:e.kind}),U(`td`,{children:U(`span`,{className:`status ${tN(e.status)?`active`:`refused`}`,children:e.status})}),U(`td`,{children:e.by}),U(`td`,{children:e.reason}),U(`td`,{children:U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Episode claims`}),(e.episodeClaims??[]).length===0?U(`p`,{className:`empty`,children:`no episode level claims`}):k(`table`,{"data-episode-claims":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`claimer`}),U(`th`,{children:`provenance`}),U(`th`,{children:`answer`}),U(`th`,{})]})}),U(`tbody`,{children:e.episodeClaims.map(e=>k(`tr`,{"data-episode-claim":e.key,className:n===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:e.claimer}),U(`td`,{children:e.provenance}),U(`td`,{children:e.answerSeq}),U(`td`,{children:U(`button`,{type:`button`,onClick:()=>r(e.key),children:`Inspect`})})]},e.key))})]})]});j();var FN=x`
3958
4058
  max-width: 150rem;
3959
4059
  margin: calc(var(--stub-header-height) + 2rem) auto 6rem;
3960
4060
  padding: 0 1.5rem;
@@ -4064,11 +4164,11 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4064
4164
 
4065
4165
  .columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
4066
4166
  @media (max-width: 900px) { .columns { grid-template-columns: 1fr; } }
4067
- `,ON=1500,kN=({label:e,value:t})=>k(`div`,{children:[U(`span`,{className:`label`,children:e}),U(`code`,{children:U($M,{value:t})})]}),AN=({reason:e})=>e===`null`?U(`code`,{className:`token`,"data-token-reason":!0,children:`"null"`}):U($M,{value:e}),jN=({load:e=Ym,loadAnswerBytes:t=Xm,warm:n=ZM})=>{let r=Jo(),[,i]=qo(),a=ah(r),[o,s]=B(a),[c,l]=B({kind:`idle`}),[u,d]=B(0),[f,p]=B({kind:`off`}),[m,h]=B([]),g=R(``),_=R(void 0);O(()=>{s(a),h([]),p({kind:`off`}),g.current=``,_.current!==void 0&&clearTimeout(_.current),_.current=void 0},[a]),O(()=>{if(!a){l({kind:`idle`});return}let t=!0;return l(e=>e.kind===`done`?e:{kind:`loading`}),e(a).then(e=>{t&&l({kind:`done`,bundle:e})}).catch(e=>{t&&l({kind:`failed`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[a,u]);let v=c.kind===`done`?c.bundle:void 0,y=V(()=>v?BM(v):new Map,[v]),b=m[m.length-1],x=!(!v||v.resolved||v.reason===`not-enabled`);return O(()=>{if(!a||!x||g.current===a)return;g.current=a;let e=a,t=()=>g.current===e,r=()=>{_.current===void 0&&(_.current=setTimeout(()=>{_.current=void 0,t()&&d(e=>e+1)},ON))};p({kind:`asking`,progress:{payloads:0,uri:null,handles:0,episodes:0}}),n(a,{onProgress:e=>{t()&&(p({kind:`asking`,progress:e}),r())}}).then(e=>{t()&&(p({kind:`done`,progress:e}),d(e=>e+1))}).catch(()=>{t()&&p({kind:`off`})})},[a,x]),O(()=>()=>{g.current=``,_.current!==void 0&&clearTimeout(_.current)},[]),k(`div`,{css:DN,"data-debug-trace":!0,children:[U(`h1`,{children:`Graph trace`}),U(`p`,{className:`intro`,children:`Everything the graph holds for one cluster: its members, every link between them including the refused ones, the episodes it resolved to, and the answer each edge came from. Nothing here is derived, and a value the graph does not carry shows as null. The graph is built inside this tab, so a uri nothing has asked about yet is asked about here first, which is what makes this url worth pasting into a bug report.`}),k(`form`,{className:`ask`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(d(e=>e+1),i(Qm({uri:t})))},children:[U(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`ag:(mal:39535,anilist:101280), or a member uri like mal:39535, or a cluster id like cl:...`,value:o,onInput:e=>s(e.target.value)}),U(`button`,{type:`submit`,children:`Trace`})]}),c.kind===`idle`&&U(`p`,{className:`empty`,children:`Give it a uri. It rides in the url, so this page can be linked into a bug report.`}),f.kind!==`off`&&U(`p`,{className:f.kind===`asking`?`warming`:`warming done`,"data-warming":f.kind,"data-answered":f.progress.payloads,children:f.kind===`asking`?`asking the sources about ${a}: ${f.progress.payloads} answer(s) so far, ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). All 24 sources are asked, so a cold graph takes tens of seconds. The panel fills as they answer and stops waiting on its own.`:f.progress.payloads===0?`nothing answered about ${a}. All 24 sources were asked and none returned a row, so the graph stayed empty: either no source recognises that uri, or every one of them refused it. Nothing is still loading.`:`the sources have stopped answering about ${a}: ${f.progress.payloads} answer(s), ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). What is below is what that produced.`}),c.kind===`loading`&&k(`p`,{className:`empty`,"data-loading":!0,children:[`tracing `,a,`…`]}),c.kind===`failed`&&U(`p`,{className:`failed`,"data-failed":!0,children:c.error}),v&&k(H,{children:[v.resolved?k(`div`,{className:`resolved`,"data-resolved":!0,children:[k(`div`,{className:`pairs`,children:[U(kN,{label:`asked`,value:v.asked}),U(kN,{label:`cluster`,value:v.resolved.clusterId}),U(kN,{label:`aggregate`,value:v.resolved.aggUri}),U(kN,{label:`scope`,value:v.resolved.scope}),U(kN,{label:`kind`,value:v.resolved.kind})]}),(v.resolved.otherClusters??[]).length>0&&k(`div`,{className:`split`,"data-other-clusters":!0,children:[`This address also reaches`,` `,v.resolved.otherClusters.length,` other cluster(s), whose members are not below:`,` `,v.resolved.otherClusters.map(e=>U(`a`,{href:Qm({uri:e,search:r}),children:U(`code`,{children:e})},e))]})]}):k(`div`,{className:`unresolved`,"data-unresolved":!0,"data-reason":v.reason??`none`,children:[U(`div`,{className:`why`,children:KM(v.reason)}),v.reason===`not-enabled`&&k(`div`,{className:`advice`,children:[U(`a`,{"data-reload-graph":!0,href:eh(r),children:`Reload with ?graph=1`}),` or `,U(`a`,{"data-reload-store":!0,href:th(r),children:`drop ?store=legacy`}),`, keeping this uri.`]}),k(`div`,{className:`pairs`,children:[U(kN,{label:`asked`,value:v.asked}),U(kN,{label:`reason`,value:v.reason??null})]})]}),k(`div`,{className:`pairs`,"data-run-length":!0,children:[U(kN,{label:`run length`,value:v.runLength?.value??null}),U(kN,{label:`from`,value:v.runLength?.from??null}),U(kN,{label:`tier`,value:v.runLength?.tier??null}),U(kN,{label:`witnesses`,value:v.runLength?.witnesses??null})]}),k(`div`,{className:`pairs`,"data-cost":!0,children:[U(kN,{label:`statements`,value:v.cost?.statements??null}),U(kN,{label:`ms to build`,value:v.cost?.ms??null})]}),U(`h3`,{children:`Graph counts`}),U(`div`,{className:`chips`,"data-counts":!0,children:Object.entries(v.counts??{}).length===0?U(`span`,{className:`empty`,children:`the bundle carries no counts`}):Object.entries(v.counts).map(([e,t])=>U(`span`,{className:`chip`,children:`${e} ${t}`},e))}),k(`div`,{className:`columns`,children:[k(`div`,{children:[U(`h3`,{children:`Anomalies`}),(v.anomalies??[]).length===0?U(`p`,{className:`empty`,children:`no rule complained`}):U(`table`,{"data-anomalies":!0,children:U(`tbody`,{children:v.anomalies.map((e,t)=>k(`tr`,{children:[U(`td`,{children:e.rule}),U(`td`,{children:e.detail})]},`${e.rule} ${e.detail} ${t}`))})})]}),k(`div`,{children:[U(`h3`,{children:`Asks`}),(v.asks??[]).length===0?U(`p`,{className:`empty`,children:`nothing was asked of any origin`}):k(`table`,{"data-asks":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`seq`}),U(`th`,{children:`origin`}),U(`th`,{children:`outcome`}),U(`th`,{children:`reason`})]})}),U(`tbody`,{children:v.asks.map((e,t)=>k(`tr`,{"data-ask":e.origin,children:[U(`td`,{children:U($M,{value:e.seq??null})}),U(`td`,{children:e.origin}),U(`td`,{children:e.outcome}),U(`td`,{children:U(AN,{reason:e.reason})})]},`${e.origin} ${e.seq??t}`))})]})]})]}),U(`h2`,{children:`Media graph`}),U(gN,{bundle:v,selected:b,onSelect:e=>h([e])}),U(`h3`,{children:`Links`}),(v.links??[]).length===0?U(`p`,{className:`empty`,children:`no links, refused or otherwise`}):k(`table`,{"data-links":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`status`}),U(`th`,{children:`by`}),U(`th`,{children:`rule`}),U(`th`,{children:`confidence`}),U(`th`,{})]})}),U(`tbody`,{children:v.links.map(e=>k(`tr`,{"data-link":e.key,"data-status":e.status,className:b===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:U(`span`,{className:`status ${qM(e.status)?`active`:`refused`}`,children:e.status})}),U(`td`,{children:e.by}),U(`td`,{children:e.reason}),U(`td`,{children:U($M,{value:e.confidence})}),U(`td`,{children:U(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Claims`}),(v.claims??[]).length===0?U(`p`,{className:`empty`,children:`no claims between the uris this bundle names`}):k(`table`,{"data-claims":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`claimer`}),U(`th`,{children:`provenance`}),U(`th`,{children:`answer`}),U(`th`,{children:`target scope`}),U(`th`,{})]})}),U(`tbody`,{children:v.claims.map(e=>k(`tr`,{"data-claim":e.key,className:b===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:e.claimer}),U(`td`,{children:e.provenance}),U(`td`,{children:e.answerSeq}),U(`td`,{children:U($M,{value:e.targetScope})}),U(`td`,{children:U(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Attachments`}),(v.attachments??[]).length===0?U(`p`,{className:`empty`,children:`no run is attached to a container here`}):k(`table`,{"data-attachments":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`run`}),U(`th`,{children:`container`}),U(`th`,{children:`via`}),U(`th`,{children:`by`}),U(`th`,{children:`evidence`}),U(`th`,{children:`supports`})]})}),U(`tbody`,{children:v.attachments.map(e=>k(`tr`,{children:[U(`td`,{className:`uri`,children:e.runUri}),U(`td`,{className:`uri`,children:e.containerUri}),U(`td`,{children:e.via}),U(`td`,{children:e.by}),U(`td`,{className:`uri`,children:U($M,{value:e.evidence})}),U(`td`,{children:(e.supports??[]).length===0?U($M,{value:null}):e.supports.map(e=>U(`button`,{type:`button`,className:`inspect`,"data-attachment-support":e,onClick:()=>h([e]),children:e},e))})]},`${e.runUri} ${e.containerUri} ${e.via} ${e.by}`))})]}),U(`h2`,{children:`Episodes`}),U(EN,{bundle:v,index:y,selected:b,onSelect:e=>h([e])}),U(`h2`,{children:`Inspector`}),U(CN,{bundle:v,index:y,trail:m,onFollow:e=>h(t=>[...t,e]),onTrailTo:e=>h(t=>t.slice(0,e+1)),loadAnswerBytes:t})]})]})},MN=`[data-party-scroll]`,NN=()=>{let e=document.querySelectorAll(MN);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.scrollHeight-n.clientHeight>0)return n}},PN=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):0,FN=()=>{let e=NN();return e?Math.max(0,e.scrollHeight-e.clientHeight):Math.max(0,document.documentElement.scrollHeight-window.innerHeight)},IN=()=>{let e=NN();return e?PN(e.scrollTop,e.scrollHeight-e.clientHeight):PN(window.scrollY,document.documentElement.scrollHeight-window.innerHeight)},LN=()=>{try{return window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0}catch{return!1}},RN=(e,t,n)=>!e||LN()?`instant`:t<=n*2?`smooth`:`instant`,zN=(e,{smooth:t}={})=>{let n=NN();if(n){let r=n.scrollHeight-n.clientHeight,i=r>0?e*r:0;n.scrollTo({top:i,behavior:RN(t,Math.abs(i-n.scrollTop),n.clientHeight)});return}let r=document.documentElement.scrollHeight-window.innerHeight,i=r>0?e*r:0;window.scrollTo({top:i,behavior:RN(t,Math.abs(i-window.scrollY),window.innerHeight)})};j();var BN=2,VN=8e3,HN=[`wheel`,`touchstart`,`keydown`,`pointerdown`],UN=60,WN=()=>{let e=Tp(),[t,n]=qo(),r=Jo(),i=r?`${t}?${r}`:t,a=e.status===`active`?e.role:void 0,o=t===_p;O(()=>{a!==`host`||o||(X.setLocation(i,IN()),X.send({t:`nav`,path:i}))},[a,i,o]),O(()=>{if(a!==`host`||o)return;let e=0,t,n=()=>{t=void 0,e=Date.now();let n=IN();X.setLocation(i,n),X.send({t:`scroll`,y:n})},r=()=>{if(t)return;let r=Math.max(0,1e3/BN-(Date.now()-e));t=setTimeout(n,r)};return document.addEventListener(`scroll`,r,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,r,{capture:!0}),t&&clearTimeout(t)}},[a,i]);let s=R(void 0),c=R(0);O(()=>{if(s.current===void 0)return;let e=s.current;s.current=void 0;let t=0,n=-1,r=0,i=!1,a=c.current,o=Date.now()+VN,l=()=>{i=!0};for(let e of HN)document.addEventListener(e,l,{passive:!0});let u=()=>{cancelAnimationFrame(t);for(let e of HN)document.removeEventListener(e,l)};if(xl(),e===0)return zN(0),u;let d=()=>{let s=FN();s===n?r+=1:(r=0,n=s);let l=s>0&&r>=UN;if(i||c.current!==a||l||Date.now()>o)return u();zN(e),t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),u},[i]);let l=R(!1),u=e.status===`active`?e.invite:void 0;O(()=>{l.current=!1},[u]);let d=(e,t)=>{l.current=!0,e===i?(xl(),c.current+=1,zN(t,{smooth:!0})):(s.current=t,n(e))};return Ep((e,{replayed:t})=>{if(a===`guest`)switch(e.t){case`nav`:l.current=!0,e.path!==i&&n(e.path);return;case`scroll`:X.hostPath()===i&&(xl(),c.current+=1,zN(e.y,{smooth:!0}));return;case`state`:(!l.current||t)&&d(e.path,e.y);return}}),null};j();var GN=4,KN=2500,qN=x`
4167
+ `,IN=1500,LN=({label:e,value:t})=>k(`div`,{children:[U(`span`,{className:`label`,children:e}),U(`code`,{children:U(sN,{value:t})})]}),RN=({reason:e})=>e===`null`?U(`code`,{className:`token`,"data-token-reason":!0,children:`"null"`}):U(sN,{value:e}),zN=({load:e=eh,loadAnswerBytes:t=th,warm:n=aN})=>{let r=$o(),[,i]=Qo(),a=uh(r),[o,s]=B(a),[c,l]=B({kind:`idle`}),[u,d]=B(0),[f,p]=B({kind:`off`}),[m,h]=B([]),g=R(``),_=R(void 0);O(()=>{s(a),h([]),p({kind:`off`}),g.current=``,_.current!==void 0&&clearTimeout(_.current),_.current=void 0},[a]),O(()=>{if(!a){l({kind:`idle`});return}let t=!0;return l(e=>e.kind===`done`?e:{kind:`loading`}),e(a).then(e=>{t&&l({kind:`done`,bundle:e})}).catch(e=>{t&&l({kind:`failed`,error:e instanceof Error?e.message:String(e)})}),()=>{t=!1}},[a,u]);let v=c.kind===`done`?c.bundle:void 0,y=V(()=>v?JM(v):new Map,[v]),b=m[m.length-1],x=!(!v||v.resolved||v.reason===`not-enabled`);return O(()=>{if(!a||!x||g.current===a)return;g.current=a;let e=a,t=()=>g.current===e,r=()=>{_.current===void 0&&(_.current=setTimeout(()=>{_.current=void 0,t()&&d(e=>e+1)},IN))};p({kind:`asking`,progress:{payloads:0,uri:null,handles:0,episodes:0}}),n(a,{onProgress:e=>{t()&&(p({kind:`asking`,progress:e}),r())}}).then(e=>{t()&&(p({kind:`done`,progress:e}),d(e=>e+1))}).catch(()=>{t()&&p({kind:`off`})})},[a,x]),O(()=>()=>{g.current=``,_.current!==void 0&&clearTimeout(_.current)},[]),k(`div`,{css:FN,"data-debug-trace":!0,children:[U(`h1`,{children:`Graph trace`}),U(`p`,{className:`intro`,children:`Everything the graph holds for one cluster: its members, every link between them including the refused ones, the episodes it resolved to, and the answer each edge came from. Nothing here is derived, and a value the graph does not carry shows as null. The graph is built inside this tab, so a uri nothing has asked about yet is asked about here first, which is what makes this url worth pasting into a bug report.`}),k(`form`,{className:`ask`,onSubmit:e=>{e.preventDefault();let t=o.trim();t&&(d(e=>e+1),i(rh({uri:t})))},children:[U(`input`,{type:`text`,autoComplete:`off`,spellcheck:!1,placeholder:`ag:(mal:39535,anilist:101280), or a member uri like mal:39535, or a cluster id like cl:...`,value:o,onInput:e=>s(e.target.value)}),U(`button`,{type:`submit`,children:`Trace`})]}),c.kind===`idle`&&U(`p`,{className:`empty`,children:`Give it a uri. It rides in the url, so this page can be linked into a bug report.`}),f.kind!==`off`&&U(`p`,{className:f.kind===`asking`?`warming`:`warming done`,"data-warming":f.kind,"data-answered":f.progress.payloads,children:f.kind===`asking`?`asking the sources about ${a}: ${f.progress.payloads} answer(s) so far, ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). All 24 sources are asked, so a cold graph takes tens of seconds. The panel fills as they answer and stops waiting on its own.`:f.progress.payloads===0?`nothing answered about ${a}. All 24 sources were asked and none returned a row, so the graph stayed empty: either no source recognises that uri, or every one of them refused it. Nothing is still loading.`:`the sources have stopped answering about ${a}: ${f.progress.payloads} answer(s), ${f.progress.handles} handle(s), ${f.progress.episodes} episode(s). What is below is what that produced.`}),c.kind===`loading`&&k(`p`,{className:`empty`,"data-loading":!0,children:[`tracing `,a,`…`]}),c.kind===`failed`&&U(`p`,{className:`failed`,"data-failed":!0,children:c.error}),v&&k(H,{children:[v.resolved?k(`div`,{className:`resolved`,"data-resolved":!0,children:[k(`div`,{className:`pairs`,children:[U(LN,{label:`asked`,value:v.asked}),U(LN,{label:`cluster`,value:v.resolved.clusterId}),U(LN,{label:`aggregate`,value:v.resolved.aggUri}),U(LN,{label:`scope`,value:v.resolved.scope}),U(LN,{label:`kind`,value:v.resolved.kind})]}),(v.resolved.otherClusters??[]).length>0&&k(`div`,{className:`split`,"data-other-clusters":!0,children:[`This address also reaches`,` `,v.resolved.otherClusters.length,` other cluster(s), whose members are not below:`,` `,v.resolved.otherClusters.map(e=>U(`a`,{href:rh({uri:e,search:r}),children:U(`code`,{children:e})},e))]})]}):k(`div`,{className:`unresolved`,"data-unresolved":!0,"data-reason":v.reason??`none`,children:[U(`div`,{className:`why`,children:eN(v.reason)}),v.reason===`not-enabled`&&k(`div`,{className:`advice`,children:[U(`a`,{"data-reload-graph":!0,href:ah(r),children:`Reload with ?graph=1`}),` or `,U(`a`,{"data-reload-store":!0,href:oh(r),children:`drop ?store=legacy`}),`, keeping this uri.`]}),k(`div`,{className:`pairs`,children:[U(LN,{label:`asked`,value:v.asked}),U(LN,{label:`reason`,value:v.reason??null})]})]}),k(`div`,{className:`pairs`,"data-run-length":!0,children:[U(LN,{label:`run length`,value:v.runLength?.value??null}),U(LN,{label:`from`,value:v.runLength?.from??null}),U(LN,{label:`tier`,value:v.runLength?.tier??null}),U(LN,{label:`witnesses`,value:v.runLength?.witnesses??null})]}),k(`div`,{className:`pairs`,"data-cost":!0,children:[U(LN,{label:`statements`,value:v.cost?.statements??null}),U(LN,{label:`ms to build`,value:v.cost?.ms??null})]}),U(`h3`,{children:`Graph counts`}),U(`div`,{className:`chips`,"data-counts":!0,children:Object.entries(v.counts??{}).length===0?U(`span`,{className:`empty`,children:`the bundle carries no counts`}):Object.entries(v.counts).map(([e,t])=>U(`span`,{className:`chip`,children:`${e} ${t}`},e))}),k(`div`,{className:`columns`,children:[k(`div`,{children:[U(`h3`,{children:`Anomalies`}),(v.anomalies??[]).length===0?U(`p`,{className:`empty`,children:`no rule complained`}):U(`table`,{"data-anomalies":!0,children:U(`tbody`,{children:v.anomalies.map((e,t)=>k(`tr`,{children:[U(`td`,{children:e.rule}),U(`td`,{children:e.detail})]},`${e.rule} ${e.detail} ${t}`))})})]}),k(`div`,{children:[U(`h3`,{children:`Asks`}),(v.asks??[]).length===0?U(`p`,{className:`empty`,children:`nothing was asked of any origin`}):k(`table`,{"data-asks":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`seq`}),U(`th`,{children:`origin`}),U(`th`,{children:`outcome`}),U(`th`,{children:`reason`})]})}),U(`tbody`,{children:v.asks.map((e,t)=>k(`tr`,{"data-ask":e.origin,children:[U(`td`,{children:U(sN,{value:e.seq??null})}),U(`td`,{children:e.origin}),U(`td`,{children:e.outcome}),U(`td`,{children:U(RN,{reason:e.reason})})]},`${e.origin} ${e.seq??t}`))})]})]})]}),U(`h2`,{children:`Media graph`}),U(wN,{bundle:v,selected:b,onSelect:e=>h([e])}),U(`h3`,{children:`Links`}),(v.links??[]).length===0?U(`p`,{className:`empty`,children:`no links, refused or otherwise`}):k(`table`,{"data-links":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`status`}),U(`th`,{children:`by`}),U(`th`,{children:`rule`}),U(`th`,{children:`confidence`}),U(`th`,{})]})}),U(`tbody`,{children:v.links.map(e=>k(`tr`,{"data-link":e.key,"data-status":e.status,className:b===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:U(`span`,{className:`status ${tN(e.status)?`active`:`refused`}`,children:e.status})}),U(`td`,{children:e.by}),U(`td`,{children:e.reason}),U(`td`,{children:U(sN,{value:e.confidence})}),U(`td`,{children:U(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Claims`}),(v.claims??[]).length===0?U(`p`,{className:`empty`,children:`no claims between the uris this bundle names`}):k(`table`,{"data-claims":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`from`}),U(`th`,{children:`to`}),U(`th`,{children:`kind`}),U(`th`,{children:`claimer`}),U(`th`,{children:`provenance`}),U(`th`,{children:`answer`}),U(`th`,{children:`target scope`}),U(`th`,{})]})}),U(`tbody`,{children:v.claims.map(e=>k(`tr`,{"data-claim":e.key,className:b===e.key?`selected`:void 0,children:[U(`td`,{className:`uri`,children:e.fromUri}),U(`td`,{className:`uri`,children:e.toUri}),U(`td`,{children:e.kind}),U(`td`,{children:e.claimer}),U(`td`,{children:e.provenance}),U(`td`,{children:e.answerSeq}),U(`td`,{children:U(sN,{value:e.targetScope})}),U(`td`,{children:U(`button`,{type:`button`,className:`inspect`,onClick:()=>h([e.key]),children:`Inspect`})})]},e.key))})]}),U(`h3`,{children:`Attachments`}),(v.attachments??[]).length===0?U(`p`,{className:`empty`,children:`no run is attached to a container here`}):k(`table`,{"data-attachments":!0,children:[U(`thead`,{children:k(`tr`,{children:[U(`th`,{children:`run`}),U(`th`,{children:`container`}),U(`th`,{children:`via`}),U(`th`,{children:`by`}),U(`th`,{children:`evidence`}),U(`th`,{children:`supports`})]})}),U(`tbody`,{children:v.attachments.map(e=>k(`tr`,{children:[U(`td`,{className:`uri`,children:e.runUri}),U(`td`,{className:`uri`,children:e.containerUri}),U(`td`,{children:e.via}),U(`td`,{children:e.by}),U(`td`,{className:`uri`,children:U(sN,{value:e.evidence})}),U(`td`,{children:(e.supports??[]).length===0?U(sN,{value:null}):e.supports.map(e=>U(`button`,{type:`button`,className:`inspect`,"data-attachment-support":e,onClick:()=>h([e]),children:e},e))})]},`${e.runUri} ${e.containerUri} ${e.via} ${e.by}`))})]}),U(`h2`,{children:`Episodes`}),U(PN,{bundle:v,index:y,selected:b,onSelect:e=>h([e])}),U(`h2`,{children:`Inspector`}),U(jN,{bundle:v,index:y,trail:m,onFollow:e=>h(t=>[...t,e]),onTrailTo:e=>h(t=>t.slice(0,e+1)),loadAnswerBytes:t})]})]})},BN=`[data-party-scroll]`,VN=()=>{let e=document.querySelectorAll(BN);for(let t=e.length-1;t>=0;t--){let n=e[t];if(n.scrollHeight-n.clientHeight>0)return n}},HN=(e,t)=>t>0?Math.min(1,Math.max(0,e/t)):0,UN=()=>{let e=VN();return e?Math.max(0,e.scrollHeight-e.clientHeight):Math.max(0,document.documentElement.scrollHeight-window.innerHeight)},WN=()=>{let e=VN();return e?HN(e.scrollTop,e.scrollHeight-e.clientHeight):HN(window.scrollY,document.documentElement.scrollHeight-window.innerHeight)},GN=()=>{try{return window.matchMedia?.(`(prefers-reduced-motion: reduce)`)?.matches===!0}catch{return!1}},KN=(e,t,n)=>!e||GN()?`instant`:t<=n*2?`smooth`:`instant`,qN=(e,{smooth:t}={})=>{let n=VN();if(n){let r=n.scrollHeight-n.clientHeight,i=r>0?e*r:0;n.scrollTo({top:i,behavior:KN(t,Math.abs(i-n.scrollTop),n.clientHeight)});return}let r=document.documentElement.scrollHeight-window.innerHeight,i=r>0?e*r:0;window.scrollTo({top:i,behavior:KN(t,Math.abs(i-window.scrollY),window.innerHeight)})};j();var JN=2,YN=8e3,XN=[`wheel`,`touchstart`,`keydown`,`pointerdown`],ZN=60,QN=()=>{let e=Ap(),[t,n]=Qo(),r=$o(),i=r?`${t}?${r}`:t,a=e.status===`active`?e.role:void 0,o=t===Sp;O(()=>{a!==`host`||o||(X.setLocation(i,WN()),X.send({t:`nav`,path:i}))},[a,i,o]),O(()=>{if(a!==`host`||o)return;let e=0,t,n=()=>{t=void 0,e=Date.now();let n=WN();X.setLocation(i,n),X.send({t:`scroll`,y:n})},r=()=>{if(t)return;let r=Math.max(0,1e3/JN-(Date.now()-e));t=setTimeout(n,r)};return document.addEventListener(`scroll`,r,{passive:!0,capture:!0}),()=>{document.removeEventListener(`scroll`,r,{capture:!0}),t&&clearTimeout(t)}},[a,i]);let s=R(void 0),c=R(0);O(()=>{if(s.current===void 0)return;let e=s.current;s.current=void 0;let t=0,n=-1,r=0,i=!1,a=c.current,o=Date.now()+YN,l=()=>{i=!0};for(let e of XN)document.addEventListener(e,l,{passive:!0});let u=()=>{cancelAnimationFrame(t);for(let e of XN)document.removeEventListener(e,l)};if(El(),e===0)return qN(0),u;let d=()=>{let s=UN();s===n?r+=1:(r=0,n=s);let l=s>0&&r>=ZN;if(i||c.current!==a||l||Date.now()>o)return u();qN(e),t=requestAnimationFrame(d)};return t=requestAnimationFrame(d),u},[i]);let l=R(!1),u=e.status===`active`?e.invite:void 0;O(()=>{l.current=!1},[u]);let d=(e,t)=>{l.current=!0,e===i?(El(),c.current+=1,qN(t,{smooth:!0})):(s.current=t,n(e))};return jp((e,{replayed:t})=>{if(a===`guest`)switch(e.t){case`nav`:l.current=!0,e.path!==i&&n(e.path);return;case`scroll`:X.hostPath()===i&&(El(),c.current+=1,qN(e.y,{smooth:!0}));return;case`state`:(!l.current||t)&&d(e.path,e.y);return}}),null};j();var $N=4,eP=2500,tP=x`
4068
4168
  position: fixed;
4069
4169
  left: 0;
4070
4170
  top: 0;
4071
- z-index: ${Ff.partyCursor};
4171
+ z-index: ${Bf.partyCursor};
4072
4172
  pointer-events: none;
4073
4173
  display: flex;
4074
4174
  align-items: flex-start;
@@ -4091,11 +4191,11 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4091
4191
  font-weight: 600;
4092
4192
  white-space: nowrap;
4093
4193
  }
4094
- `,JN=()=>{let e=Tp(),t=e.status===`active`?e.role:void 0,[n]=qo(),r=Jo(),i=r?`${n}?${r}`:n;O(()=>{if(t!==`host`)return;let e=0,n,r,i=()=>{n=void 0,r&&!X.playing()&&(e=Date.now(),X.send({t:`cursor`,x:r.x,y:r.y}))},a=t=>{r={x:Math.min(1,Math.max(0,t.clientX/window.innerWidth)),y:Math.min(1,Math.max(0,t.clientY/window.innerHeight))},!n&&(n=setTimeout(i,Math.max(0,1e3/GN-(Date.now()-e))))};return window.addEventListener(`pointermove`,a,{passive:!0}),()=>{window.removeEventListener(`pointermove`,a),n&&clearTimeout(n)}},[t]);let[a,o]=B(void 0),[s,c]=B(()=>Date.now()),l=R(!1);if(Ep(e=>{if(t===`guest`){if(e.t===`playback`||e.t===`state`&&e.s){let t=(e.t,e.s);l.current=!t.paused,l.current&&o(void 0);return}e.t!==`cursor`||l.current||X.hostPath()===i&&o({x:e.x,y:e.y,at:Date.now()})}}),O(()=>{if(!a)return;let e=setInterval(()=>c(Date.now()),500);return()=>clearInterval(e)},[a]),t!==`guest`||!a||s-a.at>KN)return null;let u=e.status===`active`?X.nameOf(e.owner):void 0;return k(`div`,{css:qN,style:{"--x":`${a.x*100}vw`,"--y":`${a.y*100}vh`},"aria-hidden":`true`,children:[U(`svg`,{width:`18`,height:`22`,viewBox:`0 0 18 22`,fill:`none`,children:U(`path`,{d:`M2 2 L2 17 L6.5 13 L9.5 20 L12 19 L9 12.5 L15 12 Z`,fill:`#4ade80`,stroke:`#06120a`,strokeWidth:`1.2`,strokeLinejoin:`round`})}),U(`span`,{className:`tag`,children:u??`host`})]})};j();var YN=x`
4194
+ `,nP=()=>{let e=Ap(),t=e.status===`active`?e.role:void 0,[n]=Qo(),r=$o(),i=r?`${n}?${r}`:n;O(()=>{if(t!==`host`)return;let e=0,n,r,i=()=>{n=void 0,r&&!X.playing()&&(e=Date.now(),X.send({t:`cursor`,x:r.x,y:r.y}))},a=t=>{r={x:Math.min(1,Math.max(0,t.clientX/window.innerWidth)),y:Math.min(1,Math.max(0,t.clientY/window.innerHeight))},!n&&(n=setTimeout(i,Math.max(0,1e3/$N-(Date.now()-e))))};return window.addEventListener(`pointermove`,a,{passive:!0}),()=>{window.removeEventListener(`pointermove`,a),n&&clearTimeout(n)}},[t]);let[a,o]=B(void 0),[s,c]=B(()=>Date.now()),l=R(!1);if(jp(e=>{if(t===`guest`){if(e.t===`playback`||e.t===`state`&&e.s){let t=(e.t,e.s);l.current=!t.paused,l.current&&o(void 0);return}e.t!==`cursor`||l.current||X.hostPath()===i&&o({x:e.x,y:e.y,at:Date.now()})}}),O(()=>{if(!a)return;let e=setInterval(()=>c(Date.now()),500);return()=>clearInterval(e)},[a]),t!==`guest`||!a||s-a.at>eP)return null;let u=e.status===`active`?X.nameOf(e.owner):void 0;return k(`div`,{css:tP,style:{"--x":`${a.x*100}vw`,"--y":`${a.y*100}vh`},"aria-hidden":`true`,children:[U(`svg`,{width:`18`,height:`22`,viewBox:`0 0 18 22`,fill:`none`,children:U(`path`,{d:`M2 2 L2 17 L6.5 13 L9.5 20 L12 19 L9 12.5 L15 12 Z`,fill:`#4ade80`,stroke:`#06120a`,strokeWidth:`1.2`,strokeLinejoin:`round`})}),U(`span`,{className:`tag`,children:u??`host`})]})};j();var rP=x`
4095
4195
  position: fixed;
4096
4196
  right: 2rem;
4097
4197
  bottom: 2rem;
4098
- z-index: ${Ff.headerPopup};
4198
+ z-index: ${Bf.headerPopup};
4099
4199
  display: flex;
4100
4200
  flex-direction: column;
4101
4201
  align-items: flex-end;
@@ -4218,7 +4318,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4218
4318
  color: #fff;
4219
4319
  cursor: pointer;
4220
4320
  }
4221
- `,XN=(e,t)=>e.self?`you`:e.name??(e.from===t?`host`:e.from.slice(0,6)),ZN=()=>{let e=Tp(),t=e.status===`active`,[n,r]=B(!1),[i,a]=B(()=>X.chat()),[o,s]=B(0),[c,l]=B(``),u=R(null);if(Ep((e,t)=>{(e.t===`chat`||e.t===`name`)&&(a(X.chat()),e.t===`chat`&&!n&&!t.self&&s(e=>e+1))}),O(()=>{n&&s(0)},[n]),O(()=>{t||(a([]),s(0),r(!1))},[t]),O(()=>{u.current?.scrollTo({top:u.current.scrollHeight})},[i,n]),!t)return null;let d=e.owner;return k(`div`,{css:YN,children:[n&&k(`div`,{className:`panel`,role:`dialog`,"aria-label":`Party chat`,children:[k(`div`,{className:`head`,children:[U(`span`,{children:`Party chat`}),U(`button`,{type:`button`,"aria-label":`Close chat`,onClick:()=>r(!1),children:U(hl,{size:16})})]}),k(`div`,{className:`lines`,ref:u,children:[i.length===0&&U(`div`,{className:`empty`,children:`Nothing said yet.`}),i.map(e=>k(`div`,{className:`line${e.self?` self`:``}`,children:[U(`span`,{className:`who`,children:XN(e,d)}),U(`span`,{className:`text`,children:e.text})]},e.seq))]}),k(`form`,{onSubmit:e=>{e.preventDefault();let t=Gf(c);t&&(X.send({t:`chat`,text:t}),l(``))},children:[U(`input`,{value:c,placeholder:`Say something`,"aria-label":`Chat message`,maxLength:500,onInput:e=>l(e.currentTarget.value)}),U(`button`,{type:`submit`,"aria-label":`Send`,children:U(al,{size:16})})]})]}),k(`button`,{type:`button`,className:`toggle`,"aria-label":n?`Hide chat`:`Show chat`,onClick:()=>r(e=>!e),children:[U(Zc,{size:20}),o>0&&U(`span`,{className:`unread`,children:o})]})]})};j();var QN=()=>({pathname:location.pathname,search:location.search}),$N=[[`pushState`,`push`],[`replaceState`,`replace`],[`popstate`,`pop`]],eP=()=>{let e=R(QN());return O(()=>{let t=$N.map(([t,n])=>{let r=()=>{let t={from:e.current,to:QN(),kind:n,asked:wl()};e.current=t.to,_l(t)&&bl()};return addEventListener(t,r),()=>removeEventListener(t,r)});return()=>{xl();for(let e of t)e()}},[]),null};j();var tP=()=>{let{query:e}=Go();return U(is,{to:Qs({query:Zs(e)}),replace:!0})},nP=()=>(O(()=>{globalThis.close()},[]),U(`div`,{children:`Logging in... this window will close automatically.`})),rP=x`
4321
+ `,iP=(e,t)=>e.self?`you`:e.name??(e.from===t?`host`:e.from.slice(0,6)),aP=()=>{let e=Ap(),t=e.status===`active`,[n,r]=B(!1),[i,a]=B(()=>X.chat()),[o,s]=B(0),[c,l]=B(``),u=R(null);if(jp((e,t)=>{(e.t===`chat`||e.t===`name`)&&(a(X.chat()),e.t===`chat`&&!n&&!t.self&&s(e=>e+1))}),O(()=>{n&&s(0)},[n]),O(()=>{t||(a([]),s(0),r(!1))},[t]),O(()=>{u.current?.scrollTo({top:u.current.scrollHeight})},[i,n]),!t)return null;let d=e.owner;return k(`div`,{css:rP,children:[n&&k(`div`,{className:`panel`,role:`dialog`,"aria-label":`Party chat`,children:[k(`div`,{className:`head`,children:[U(`span`,{children:`Party chat`}),U(`button`,{type:`button`,"aria-label":`Close chat`,onClick:()=>r(!1),children:U(bl,{size:16})})]}),k(`div`,{className:`lines`,ref:u,children:[i.length===0&&U(`div`,{className:`empty`,children:`Nothing said yet.`}),i.map(e=>k(`div`,{className:`line${e.self?` self`:``}`,children:[U(`span`,{className:`who`,children:iP(e,d)}),U(`span`,{className:`text`,children:e.text})]},e.seq))]}),k(`form`,{onSubmit:e=>{e.preventDefault();let t=Xf(c);t&&(X.send({t:`chat`,text:t}),l(``))},children:[U(`input`,{value:c,placeholder:`Say something`,"aria-label":`Chat message`,maxLength:500,onInput:e=>l(e.currentTarget.value)}),U(`button`,{type:`submit`,"aria-label":`Send`,children:U(ul,{size:16})})]})]}),k(`button`,{type:`button`,className:`toggle`,"aria-label":n?`Hide chat`:`Show chat`,onClick:()=>r(e=>!e),children:[U(nl,{size:20}),o>0&&U(`span`,{className:`unread`,children:o})]})]})};j();var oP=()=>({pathname:location.pathname,search:location.search}),sP=[[`pushState`,`push`],[`replaceState`,`replace`],[`popstate`,`pop`]],cP=()=>{let e=R(oP());return O(()=>{let t=sP.map(([t,n])=>{let r=()=>{let t={from:e.current,to:oP(),kind:n,asked:kl()};e.current=t.to,Sl(t)&&Tl()};return addEventListener(t,r),()=>removeEventListener(t,r)});return()=>{El();for(let e of t)e()}},[]),null};j();var lP=()=>{let{query:e}=Xo();return U(ls,{to:rc({query:nc(e)}),replace:!0})},uP=()=>(O(()=>{globalThis.close()},[]),U(`div`,{children:`Logging in... this window will close automatically.`})),dP=x`
4222
4322
  display: flex;
4223
4323
  flex-direction: column;
4224
4324
  min-height: 100vh;
@@ -4226,9 +4326,9 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4226
4326
  & > .content {
4227
4327
  flex: 1;
4228
4328
  }
4229
- `,iP=x`
4329
+ `,fP=x`
4230
4330
  padding: calc(var(--stub-header-height) + 3rem) 3rem 4rem;
4231
- `,aP=()=>U(Zo,{hrefs:Dc,children:k(`div`,{css:rP,children:[U(Np,{}),U(`div`,{className:`content`,children:k(rs,{children:[U(es,{path:ss(J.HOME),component:BA}),U(es,{path:ss(J.MEDIA),component:BA}),U(es,{path:ss(J.SEARCH),component:Tj}),U(es,{path:ss(J.SEARCH_LEGACY),component:tP}),U(es,{path:ss(J.LEGAL),component:Oj}),U(es,{path:ss(J.PRIVACY),component:Pj}),U(es,{path:ss(J.SETTINGS),component:_M}),U(es,{path:ss(J.WATCH),component:jM}),U(es,{path:ss(J.PARTY),component:PM}),U(es,{path:ss(J.DEBUG_TRACE),component:jN}),U(es,{path:ss(J.LOGIN_CALLBACK),component:nP}),U(es,{component:()=>U(`div`,{css:iP,children:`404 No page found`})})]})}),U(Fp,{}),U(Rp,{}),U(WN,{}),U(JN,{}),U(ZN,{}),U(eP,{})]})});ie(),j();var oP=x`
4331
+ `,pP=()=>U(ns,{hrefs:Mc,children:k(`div`,{css:dP,children:[U(Rp,{}),U(`div`,{className:`content`,children:k(cs,{children:[U(as,{path:fs(J.HOME),component:GA}),U(as,{path:fs(J.MEDIA),component:GA}),U(as,{path:fs(J.SEARCH),component:Aj}),U(as,{path:fs(J.SEARCH_LEGACY),component:lP}),U(as,{path:fs(J.LEGAL),component:Nj}),U(as,{path:fs(J.PRIVACY),component:zj}),U(as,{path:fs(J.SETTINGS),component:TM}),U(as,{path:fs(J.WATCH),component:zM}),U(as,{path:fs(J.PARTY),component:HM}),U(as,{path:fs(J.DEBUG_TRACE),component:zN}),U(as,{path:fs(J.LOGIN_CALLBACK),component:uP}),U(as,{component:()=>U(`div`,{css:fP,children:`404 No page found`})})]})}),U(Bp,{}),U(Up,{}),U(QN,{}),U(nP,{}),U(aP,{}),U(cP,{})]})});ie(),j();var mP=x`
4232
4332
  display: flex;
4233
4333
  align-items: center;
4234
4334
  justify-content: center;
@@ -4277,7 +4377,7 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4277
4377
  background: rgba(255, 255, 255, 0.08);
4278
4378
  }
4279
4379
  }
4280
- `,sP=(e,t)=>`route: ${t}\nmessage: ${e.message}\nstack: ${e.stack??`(no stack)`}`,cP=({error:e,route:t})=>{let[n,r]=B(!1);return U(`div`,{css:oP,children:k(`div`,{className:`panel`,children:[U(`h2`,{children:`This page failed to render`}),U(`p`,{className:`message`,children:e.message||`No message was given.`}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,onClick:()=>globalThis.location?.reload(),children:`Reload`}),U(`button`,{type:`button`,onClick:()=>{let n=navigator.clipboard?.writeText(sP(e,t));n&&n.then(()=>r(!0)).catch(e=>console.error(Error(`the failure details could not be copied`,{cause:e})))},children:n?`Copied`:`Copy details`})]})]})})},lP=class extends E{state={error:null,route:this.props.route};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}static getDerivedStateFromProps(e,t){return e.route===t.route?null:{error:null,route:e.route}}componentDidCatch(e){console.error(Error(`the ${this.props.route} route failed to render`,{cause:e}))}render(){return this.state.error?U(cP,{error:this.state.error,route:this.props.route}):this.props.children}},uP=({children:e})=>{let[t]=qo();return U(lP,{route:t,children:e})};st(location.href)&&(window.__stubExportStore=e=>rt(e??{excludeOrigins:[]}));var dP=async(e,t={},n={})=>JM(Ge,e,t,{settleMs:n.settleMs});Be(location.href)&&(window.__stubExportAnswers=()=>at(),window.__stubExportAsks=()=>et(),window.__stubGraphCounts=()=>Ze()),Ue(location.href)&&(window.__stubGraphQL=(e,t,n)=>dP(e,t,n));var fP=`stub.apikeys`;ie(),((e=()=>localStorage)=>{try{e().removeItem(fP)}catch{}})(),(({check:e,focused:t,page:n=globalThis,document:r=globalThis.document,intervalMs:i=6e4})=>{let a=e=>()=>{e().catch(e=>console.warn(`tracking: account link`,e))},o=()=>r?.visibilityState!==`hidden`,s=a(e),c=a(t);s(),n.addEventListener(`online`,s),n.addEventListener(`focus`,c),r?.addEventListener(`visibilitychange`,()=>{o()&&c()});let l=setInterval(()=>{o()&&c()},i);return()=>clearInterval(l)})({check:Je,focused:nt});var pP=x`
4380
+ `,hP=(e,t)=>`route: ${t}\nmessage: ${e.message}\nstack: ${e.stack??`(no stack)`}`,gP=({error:e,route:t})=>{let[n,r]=B(!1);return U(`div`,{css:mP,children:k(`div`,{className:`panel`,children:[U(`h2`,{children:`This page failed to render`}),U(`p`,{className:`message`,children:e.message||`No message was given.`}),k(`div`,{className:`actions`,children:[U(`button`,{type:`button`,onClick:()=>globalThis.location?.reload(),children:`Reload`}),U(`button`,{type:`button`,onClick:()=>{let n=navigator.clipboard?.writeText(hP(e,t));n&&n.then(()=>r(!0)).catch(e=>console.error(Error(`the failure details could not be copied`,{cause:e})))},children:n?`Copied`:`Copy details`})]})]})})},_P=class extends E{state={error:null,route:this.props.route};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}static getDerivedStateFromProps(e,t){return e.route===t.route?null:{error:null,route:e.route}}componentDidCatch(e){console.error(Error(`the ${this.props.route} route failed to render`,{cause:e}))}render(){return this.state.error?U(gP,{error:this.state.error,route:this.props.route}):this.props.children}},vP=({children:e})=>{let[t]=Qo();return U(_P,{route:t,children:e})};nt(location.href)&&(window.__stubExportStore=e=>ct(e??{excludeOrigins:[]}));var yP=async(e,t={},n={})=>nN(Je,e,t,{settleMs:n.settleMs});We(location.href)&&(window.__stubExportAnswers=()=>ut(),window.__stubExportAsks=()=>at(),window.__stubGraphCounts=()=>et()),Be(location.href)&&(window.__stubGraphQL=(e,t,n)=>yP(e,t,n));var bP=`stub.apikeys`;ie(),((e=()=>localStorage)=>{try{e().removeItem(bP)}catch{}})(),(({check:e,focused:t,page:n=globalThis,document:r=globalThis.document,intervalMs:i=6e4})=>{let a=e=>()=>{e().catch(e=>console.warn(`tracking: account link`,e))},o=()=>r?.visibilityState!==`hidden`,s=a(e),c=a(t);s(),n.addEventListener(`online`,s),n.addEventListener(`focus`,c),r?.addEventListener(`visibilitychange`,()=>{o()&&c()});let l=setInterval(()=>{o()&&c()},i);return()=>clearInterval(l)})({check:Ze,focused:st});var xP=x`
4281
4381
  @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');
4282
4382
 
4283
4383
  :root {
@@ -4337,4 +4437,4 @@ animation: overlayShow 150ms cubic-bezier(0.16, 1, 0.3, 1);
4337
4437
  .hidden {
4338
4438
  display: none !important;
4339
4439
  }
4340
- `;X.resume();var mP=document.createElement(`div`);mP.id=`stub-root`,ee(k(ur,{value:uo,children:[U(n,{styles:pP}),U(uP,{children:U(aP,{})})]}),document.body.appendChild(mP));
4440
+ `;X.resume();var SP=document.createElement(`div`);SP.id=`stub-root`,ee(k(hr,{value:go,children:[U(n,{styles:xP}),U(vP,{children:U(pP,{})})]}),document.body.appendChild(SP));