@telepath-computer/television 1.3.3 → 1.3.4

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,9 +1,9 @@
1
- var p_=Object.defineProperty;var xg=n=>{throw TypeError(n)};var f_=(n,t,e)=>t in n?p_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var C=(n,t,e)=>f_(n,typeof t!="symbol"?t+"":t,e),Ad=(n,t,e)=>t.has(n)||xg("Cannot "+e);var o=(n,t,e)=>(Ad(n,t,"read from private field"),e?e.call(n):t.get(n)),g=(n,t,e)=>t.has(n)?xg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),d=(n,t,e,r)=>(Ad(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),h=(n,t,e)=>(Ad(n,t,"access private method"),e);var Nc=(n,t,e,r)=>({set _(i){d(n,t,i,e)},get _(){return o(n,t,r)}});import{i as m_,a as g_,b as v_,c as y_,d as w_,e as b_,f as S_,g as __,U as A_,A as k_,h as E_}from"./artifact-bridge-BEUWXKq7.js";import{m as C_,a as $_,b as T_}from"./missing-artifact-page-DVzJ41AE.js";var Si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function R_(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var e=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),e}var Pg=Object.prototype.toString,q1=function(t){var e=Pg.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Pg.call(t.callee)==="[object Function]"),r},kd,Lg;function I_(){if(Lg)return kd;Lg=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=q1,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(v){var y=v.constructor;return y&&y.prototype===v},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if(typeof window>"u")return!1;for(var v in window)try{if(!u["$"+v]&&t.call(window,v)&&window[v]!==null&&typeof window[v]=="object")try{c(window[v])}catch{return!0}}catch{return!0}return!1}(),m=function(v){if(typeof window>"u"||!p)return c(v);try{return c(v)}catch{return!1}};n=function(y){var k=y!==null&&typeof y=="object",A=e.call(y)==="[object Function]",x=r(y),L=k&&e.call(y)==="[object String]",D=[];if(!k&&!A&&!x)throw new TypeError("Object.keys called on a non-object");var V=a&&A;if(L&&y.length>0&&!t.call(y,0))for(var F=0;F<y.length;++F)D.push(String(F));if(x&&y.length>0)for(var G=0;G<y.length;++G)D.push(String(G));else for(var z in y)!(V&&z==="prototype")&&t.call(y,z)&&D.push(String(z));if(s)for(var J=m(y),re=0;re<l.length;++re)!(J&&l[re]==="constructor")&&t.call(y,l[re])&&D.push(l[re]);return D}}return kd=n,kd}var x_=Array.prototype.slice,P_=q1,Dg=Object.keys,au=Dg?function(t){return Dg(t)}:I_(),Og=Object.keys;au.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(r){return P_(r)?Og(x_.call(r)):Og(r)})}else Object.keys=au;return Object.keys||au};var L_=au,lu=Object.defineProperty||!1;if(lu)try{lu({},"a",{value:1})}catch{lu=!1}var fc=lu,gr=SyntaxError,te=TypeError,D_=Object.getOwnPropertyDescriptor,cu=D_;if(cu)try{cu([],"length")}catch{cu=null}var ra=cu,Mg=fc,O_=gr,Ps=te,Ng=ra,j1=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Ps("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ps("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ps("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ps("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ps("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ps("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!Ng&&Ng(t,e);if(Mg)Mg(t,e,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(l||!i&&!s&&!a)t[e]=r;else throw new O_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},mp=fc,W1=function(){return!!mp};W1.hasArrayLengthDefineBug=function(){if(!mp)return null;try{return mp([],"length",{value:1}).length!==1}catch{return!0}};var Hh=W1,M_=L_,N_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",z_=Object.prototype.toString,U_=Array.prototype.concat,zg=j1,F_=function(n){return typeof n=="function"&&z_.call(n)==="[object Function]"},G1=Hh(),Z_=function(n,t,e,r){if(t in n){if(r===!0){if(n[t]===e)return}else if(!F_(r)||!r())return}G1?zg(n,t,e,!0):zg(n,t,e)},Y1=function(n,t){var e=arguments.length>2?arguments[2]:{},r=M_(t);N_&&(r=U_.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)Z_(n,r[i],t[r[i]],e[r[i]])};Y1.supportsDescriptors=!!G1;var Ss=Y1,uu={exports:{}};typeof self<"u"?uu.exports=self:typeof window<"u"?uu.exports=window:uu.exports=Function("return this")();var J1=uu.exports,H_=J1,K1=function(){return typeof Si!="object"||!Si||Si.Math!==Math||Si.Array!==Array?H_:Si},V_=Ss,B_=ra,q_=K1,j_=function(){var t=q_();if(V_.supportsDescriptors){var e=B_(t,"globalThis");(!e||e.configurable&&(e.enumerable||!e.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},W_=Ss,G_=J1,X1=K1,Y_=j_,J_=X1(),Q1=function(){return J_};W_(Q1,{getPolyfill:X1,implementation:G_,shim:Y_});var nm=Q1,vr=function(t){return!!t&&(typeof t=="function"||typeof t=="object")},rm=Object,ey=Error,K_=EvalError,X_=RangeError,im=ReferenceError,Q_=URIError,e6=Math.abs,t6=Math.floor,n6=Math.max,r6=Math.min,i6=Math.pow,s6=Math.round,sm=Number.isNaN||function(t){return t!==t},o6=sm,a6=function(t){return o6(t)||t===0?t:t<0?-1:1},ia=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==i||l.enumerable!==!0)return!1}return!0},Ug=typeof Symbol<"u"&&Symbol,l6=ia,om=function(){return typeof Ug!="function"||typeof Symbol!="function"||typeof Ug("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:l6()},ty=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,c6=rm,ny=c6.getPrototypeOf||null,u6="Function.prototype.bind called on incompatible ",h6=Object.prototype.toString,d6=Math.max,p6="[object Function]",Fg=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r},f6=function(t,e){for(var r=[],i=e,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},m6=function(n,t){for(var e="",r=0;r<n.length;r+=1)e+=n[r],r+1<n.length&&(e+=t);return e},g6=function(t){var e=this;if(typeof e!="function"||h6.apply(e)!==p6)throw new TypeError(u6+e);for(var r=f6(arguments,1),i,s=function(){if(this instanceof i){var p=e.apply(this,Fg(r,arguments));return Object(p)===p?p:this}return e.apply(t,Fg(r,arguments))},a=d6(0,e.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+m6(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,i.prototype=new u,u.prototype=null}return i},v6=g6,mc=Function.prototype.bind||v6,am=Function.prototype.call,lm=Function.prototype.apply,y6=typeof Reflect<"u"&&Reflect&&Reflect.apply,w6=mc,b6=lm,S6=am,_6=y6,ry=_6||w6.call(S6,b6),A6=mc,k6=te,E6=am,C6=ry,Vh=function(t){if(t.length<1||typeof t[0]!="function")throw new k6("a function is required");return C6(A6,E6,t)},$6=Vh,Zg=ra,iy;try{iy=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var Ed=!!iy&&Zg&&Zg(Object.prototype,"__proto__"),sy=Object,Hg=sy.getPrototypeOf,T6=Ed&&typeof Ed.get=="function"?$6([Ed.get]):typeof Hg=="function"?function(t){return Hg(t==null?t:sy(t))}:!1,Vg=ty,Bg=ny,qg=T6,oy=Vg?function(t){return Vg(t)}:Bg?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Bg(t)}:qg?function(t){return qg(t)}:null,R6=Function.prototype.call,I6=Object.prototype.hasOwnProperty,x6=mc,yr=x6.call(R6,I6),Q,P6=rm,L6=ey,D6=K_,O6=X_,M6=im,Ko=gr,no=te,N6=Q_,z6=e6,U6=t6,F6=n6,Z6=r6,H6=i6,V6=s6,B6=a6,ay=Function,Cd=function(n){try{return ay('"use strict"; return ('+n+").constructor;")()}catch{}},il=ra,q6=fc,$d=function(){throw new no},j6=il?function(){try{return arguments.callee,$d}catch{try{return il(arguments,"callee").get}catch{return $d}}}():$d,Ls=om(),De=oy,W6=ny,G6=ty,ly=lm,gc=am,Ns={},Y6=typeof Uint8Array>"u"||!De?Q:De(Uint8Array),gs={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Q:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Q:ArrayBuffer,"%ArrayIteratorPrototype%":Ls&&De?De([][Symbol.iterator]()):Q,"%AsyncFromSyncIteratorPrototype%":Q,"%AsyncFunction%":Ns,"%AsyncGenerator%":Ns,"%AsyncGeneratorFunction%":Ns,"%AsyncIteratorPrototype%":Ns,"%Atomics%":typeof Atomics>"u"?Q:Atomics,"%BigInt%":typeof BigInt>"u"?Q:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Q:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Q:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Q:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":L6,"%eval%":eval,"%EvalError%":D6,"%Float16Array%":typeof Float16Array>"u"?Q:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Q:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Q:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Q:FinalizationRegistry,"%Function%":ay,"%GeneratorFunction%":Ns,"%Int8Array%":typeof Int8Array>"u"?Q:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Q:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Q:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ls&&De?De(De([][Symbol.iterator]())):Q,"%JSON%":typeof JSON=="object"?JSON:Q,"%Map%":typeof Map>"u"?Q:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ls||!De?Q:De(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":P6,"%Object.getOwnPropertyDescriptor%":il,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Q:Promise,"%Proxy%":typeof Proxy>"u"?Q:Proxy,"%RangeError%":O6,"%ReferenceError%":M6,"%Reflect%":typeof Reflect>"u"?Q:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Q:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ls||!De?Q:De(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Q:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ls&&De?De(""[Symbol.iterator]()):Q,"%Symbol%":Ls?Symbol:Q,"%SyntaxError%":Ko,"%ThrowTypeError%":j6,"%TypedArray%":Y6,"%TypeError%":no,"%Uint8Array%":typeof Uint8Array>"u"?Q:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Q:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Q:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Q:Uint32Array,"%URIError%":N6,"%WeakMap%":typeof WeakMap>"u"?Q:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Q:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Q:WeakSet,"%Function.prototype.call%":gc,"%Function.prototype.apply%":ly,"%Object.defineProperty%":q6,"%Object.getPrototypeOf%":W6,"%Math.abs%":z6,"%Math.floor%":U6,"%Math.max%":F6,"%Math.min%":Z6,"%Math.pow%":H6,"%Math.round%":V6,"%Math.sign%":B6,"%Reflect.getPrototypeOf%":G6};if(De)try{null.error}catch(n){var J6=De(De(n));gs["%Error.prototype%"]=J6}var K6=function n(t){var e;if(t==="%AsyncFunction%")e=Cd("async function () {}");else if(t==="%GeneratorFunction%")e=Cd("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Cd("async function* () {}");else if(t==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&De&&(e=De(i.prototype))}return gs[t]=e,e},jg={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vc=mc,Bu=yr,X6=vc.call(gc,Array.prototype.concat),Q6=vc.call(ly,Array.prototype.splice),Wg=vc.call(gc,String.prototype.replace),qu=vc.call(gc,String.prototype.slice),e8=vc.call(gc,RegExp.prototype.exec),t8=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,n8=/\\(\\)?/g,r8=function(t){var e=qu(t,0,1),r=qu(t,-1);if(e==="%"&&r!=="%")throw new Ko("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&e!=="%")throw new Ko("invalid intrinsic syntax, expected opening `%`");var i=[];return Wg(t,t8,function(s,a,l,c){i[i.length]=l?Wg(c,n8,"$1"):a||s}),i},i8=function(t,e){var r=t,i;if(Bu(jg,r)&&(i=jg[r],r="%"+i[0]+"%"),Bu(gs,r)){var s=gs[r];if(s===Ns&&(s=K6(r)),typeof s>"u"&&!e)throw new no("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Ko("intrinsic "+t+" does not exist!")},Mt=function(t,e){if(typeof t!="string"||t.length===0)throw new no("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new no('"allowMissing" argument must be a boolean');if(e8(/^%?[^%]*%?$/,t)===null)throw new Ko("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=r8(t),i=r.length>0?r[0]:"",s=i8("%"+i+"%",e),a=s.name,l=s.value,c=!1,u=s.alias;u&&(i=u[0],Q6(r,X6([0,1],u)));for(var p=1,m=!0;p<r.length;p+=1){var v=r[p],y=qu(v,0,1),k=qu(v,-1);if((y==='"'||y==="'"||y==="`"||k==='"'||k==="'"||k==="`")&&y!==k)throw new Ko("property names with quotes must have matching quotes");if((v==="constructor"||!m)&&(c=!0),i+="."+v,a="%"+i+"%",Bu(gs,a))l=gs[a];else if(l!=null){if(!(v in l)){if(!e)throw new no("base intrinsic for "+t+" exists, but the property is not available.");return}if(il&&p+1>=r.length){var A=il(l,v);m=!!A,m&&"get"in A&&!("originalValue"in A.get)?l=A.get:l=l[v]}else m=Bu(l,v),l=l[v];m&&!c&&(gs[a]=l)}}return l},Td,Gg;function ui(){if(Gg)return Td;Gg=1;var n=Mt,t=Vh,e=t([n("%String.prototype.indexOf%")]);return Td=function(i,s){var a=n(i,!!s);return typeof a=="function"&&e(i,".prototype.")>-1?t([a]):a},Td}var Rd,Yg;function cm(){if(Yg)return Rd;Yg=1;var n=Mt,t=n("%Array%"),e=!t.isArray&&ui()("Object.prototype.toString");return Rd=t.isArray||function(i){return e(i)==="[object Array]"},Rd}var s8=Hh,Jg=fc,cy=s8.hasArrayLengthDefineBug(),o8=cy&&cm(),a8=ui(),l8=a8("Object.prototype.propertyIsEnumerable"),um=function(t,e,r,i,s,a){if(!Jg){if(!t(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||s in i&&l8(i,s)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[s]=l,e(i[s],l)}return cy&&s==="length"&&"[[Value]]"in a&&o8(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(Jg(i,s,r(a)),!0)},c8=te,ba=yr,u8={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},sa=function(t){if(!t||typeof t!="object")return!1;for(var e in t)if(ba(t,e)&&!u8[e])return!1;var r=ba(t,"[[Value]]")||ba(t,"[[Writable]]"),i=ba(t,"[[Get]]")||ba(t,"[[Set]]");if(r&&i)throw new c8("Property Descriptors may not be both accessor and data descriptors");return!0},uy=function(t){if(typeof t>"u")return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e},h8=te,d8=sa,p8=uy,hy=function(t){if(typeof t<"u"&&!d8(t))throw new h8("Assertion failed: `Desc` must be a Property Descriptor");return p8(t)},f8=te,Kg=yr,m8=sa,dy=function(t){if(typeof t>"u")return!1;if(!m8(t))throw new f8("Assertion failed: `Desc` must be a Property Descriptor");return!(!Kg(t,"[[Value]]")&&!Kg(t,"[[Writable]]"))},oa=function(t){return typeof t=="string"||typeof t=="symbol"},Xg=sm,py=function(t,e){return t===e?t===0?1/t===1/e:!0:Xg(t)&&Xg(e)},Qg=te,g8=vr,v8=um,y8=hy,w8=dy,b8=oa,S8=py,hm=function(t,e,r){if(!g8(t))throw new Qg("Assertion failed: Type(O) is not Object");if(!b8(e))throw new Qg("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return v8(w8,S8,y8,t,e,i)},fy=Function.prototype.toString,Ks=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,gp,hu;if(typeof Ks=="function"&&typeof Object.defineProperty=="function")try{gp=Object.defineProperty({},"length",{get:function(){throw hu}}),hu={},Ks(function(){throw 42},null,gp)}catch(n){n!==hu&&(Ks=null)}else Ks=null;var _8=/^\s*class\b/,vp=function(t){try{var e=fy.call(t);return _8.test(e)}catch{return!1}},Id=function(t){try{return vp(t)?!1:(fy.call(t),!0)}catch{return!1}},du=Object.prototype.toString,A8="[object Object]",k8="[object Function]",E8="[object GeneratorFunction]",C8="[object HTMLAllCollection]",$8="[object HTML document.all class]",T8="[object HTMLCollection]",R8=typeof Symbol=="function"&&!!Symbol.toStringTag,I8=!(0 in[,]),yp=function(){return!1};if(typeof document=="object"){var x8=document.all;du.call(x8)===du.call(document.all)&&(yp=function(t){if((I8||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=du.call(t);return(e===C8||e===$8||e===T8||e===A8)&&t("")==null}catch{}return!1})}var my=Ks?function(t){if(yp(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Ks(t,null,gp)}catch(e){if(e!==hu)return!1}return!vp(t)&&Id(t)}:function(t){if(yp(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(R8)return Id(t);if(vp(t))return!1;var e=du.call(t);return e!==k8&&e!==E8&&!/^\[object HTML/.test(e)?!1:Id(t)},P8=my,L8=function(t){return!!t},en=yr,zc=te,D8=vr,e0=P8,xd=L8,O8=function(t){if(!D8(t))throw new zc("ToPropertyDescriptor requires an object");var e={};if(en(t,"enumerable")&&(e["[[Enumerable]]"]=xd(t.enumerable)),en(t,"configurable")&&(e["[[Configurable]]"]=xd(t.configurable)),en(t,"value")&&(e["[[Value]]"]=t.value),en(t,"writable")&&(e["[[Writable]]"]=xd(t.writable)),en(t,"get")){var r=t.get;if(typeof r<"u"&&!e0(r))throw new zc("getter must be a function");e["[[Get]]"]=r}if(en(t,"set")){var i=t.set;if(typeof i<"u"&&!e0(i))throw new zc("setter must be a function");e["[[Set]]"]=i}if((en(e,"[[Get]]")||en(e,"[[Set]]"))&&(en(e,"[[Value]]")||en(e,"[[Writable]]")))throw new zc("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},Pd=te,M8=vr,t0=sa,N8=um,z8=hy,U8=dy,F8=oa,Z8=py,H8=O8,V8=function(t,e,r){if(!M8(t))throw new Pd("Assertion failed: Type(O) is not Object");if(!F8(e))throw new Pd("Assertion failed: P is not a Property Key");var i=t0(r)?r:H8(r);if(!t0(i))throw new Pd("Assertion failed: Desc is not a valid Property Descriptor");return N8(U8,Z8,z8,t,e,i)},n0=te,B8=vr,q8=V8,j8=oa,W8=function(t,e,r){if(!B8(t))throw new n0("Assertion failed: Type(O) is not Object");if(!j8(e))throw new n0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return q8(t,e,i)},G8=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,Y8=rm,J8=Y8.setPrototypeOf||null,K8=Vh,r0=ra,X8=te,gy={};try{gy.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var Q8=!("toString"in gy),Ld=r0&&r0(Object.prototype,"__proto__"),eA=Q8&&(!!Ld&&typeof Ld.set=="function"&&K8([Ld.set])||function(t,e){if(t==null)throw new X8("set Object.prototype.__proto__ called on null or undefined");return t.__proto__=e,e}),i0=G8,tA=J8,s0=eA,nA=te,rA=i0?function(t,e){if(i0(t,e))return t;throw new nA("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:tA||(s0?function(t,e){return s0(t,e),t}:null),o0=te,iA=vr,a0=oy,sA=function(t){if(!iA(t))throw new o0("Assertion failed: O must be an Object");if(!a0)throw new o0("This environment does not support fetching prototypes.");return a0(t)},oA=te,aA=rA,lA=vr,cA=sA,uA=function(t,e){if(e!==null&&!lA(e))throw new oA("Assertion failed: V must be Object or Null");try{aA(t,e)}catch{return!1}return cA(t)===e},Dd=hm,l0=W8,vy=uA,hA=Hh(),dm=ey;function yc(n,t,e){var r=new dm(e);return vy(r,pu),delete r.constructor,l0(r,"error",n),l0(r,"suppressed",t),r}hA&&Object.defineProperty(yc,"prototype",{writable:!1});var pu=yc.prototype;if(!Dd(pu,"constructor",yc)||!Dd(pu,"message","")||!Dd(pu,"name","SuppressedError"))throw new dm("unable to install SuppressedError.prototype properties; please report this!");vy(yc.prototype,dm.prototype);var dA=yc,pA=dA,yy=function(){return typeof SuppressedError=="function"?SuppressedError:pA},fA=Ss,c0=nm(),mA=yy,gA=function(){var t=mA();return fA(c0,{SuppressedError:t},{SuppressedError:function(){return c0.SuppressedError!==t}}),t};gA();var vA=te,yA=sa,wA=uy,bA=function(t){if(typeof t<"u"&&!yA(t))throw new vA("Assertion failed: `Desc` must be a Property Descriptor");return wA(t)},SA=te,u0=yr,_A=sa,AA=function(t){if(typeof t>"u")return!1;if(!_A(t))throw new SA("Assertion failed: `Desc` must be a Property Descriptor");return!(!u0(t,"[[Value]]")&&!u0(t,"[[Writable]]"))},h0=sm,kA=function(t,e){return t===e?t===0?1/t===1/e:!0:h0(t)&&h0(e)},aa=my,EA=function(t){return!!t},tn=yr,Uc=te,CA=vr,d0=aa,Od=EA,$A=function(t){if(!CA(t))throw new Uc("ToPropertyDescriptor requires an object");var e={};if(tn(t,"enumerable")&&(e["[[Enumerable]]"]=Od(t.enumerable)),tn(t,"configurable")&&(e["[[Configurable]]"]=Od(t.configurable)),tn(t,"value")&&(e["[[Value]]"]=t.value),tn(t,"writable")&&(e["[[Writable]]"]=Od(t.writable)),tn(t,"get")){var r=t.get;if(typeof r<"u"&&!d0(r))throw new Uc("getter must be a function");e["[[Get]]"]=r}if(tn(t,"set")){var i=t.set;if(typeof i<"u"&&!d0(i))throw new Uc("setter must be a function");e["[[Set]]"]=i}if((tn(e,"[[Get]]")||tn(e,"[[Set]]"))&&(tn(e,"[[Value]]")||tn(e,"[[Writable]]")))throw new Uc("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},Md=te,TA=vr,p0=sa,RA=um,IA=bA,xA=AA,PA=oa,LA=kA,DA=$A,wc=function(t,e,r){if(!TA(t))throw new Md("Assertion failed: Type(O) is not Object");if(!PA(e))throw new Md("Assertion failed: P is not a Property Key");var i=p0(r)?r:DA(r);if(!p0(i))throw new Md("Assertion failed: Desc is not a valid Property Descriptor");return RA(xA,LA,IA,t,e,i)},OA=ia(),MA=OA?Symbol.dispose||Symbol("Symbol.dispose"):null,NA=ia,zA=MA,pm=function(){return NA()&&Symbol.dispose||zA},UA=om,FA=wc,ZA=pm,HA=function(){var t=ZA();return UA()&&FA(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},VA=ia(),BA=VA?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,qA=ia,jA=BA,fm=function(){return qA()&&Symbol.asyncDispose||jA},WA=om,GA=wc,YA=fm,JA=function(){var t=YA();return WA()&&GA(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},KA=cm(),XA=Mt,QA=ui(),ek=te,tk=KA,nk=XA("%Reflect.apply%",!0)||QA("Function.prototype.apply"),Bh=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!tk(r))throw new ek("Assertion failed: optional `argumentsList`, if provided, must be a List");return nk(t,e,r)};const rk={},ik=Object.freeze(Object.defineProperty({__proto__:null,default:rk},Symbol.toStringTag,{value:"Module"})),sk=R_(ik);var mm=typeof Map=="function"&&Map.prototype,Nd=Object.getOwnPropertyDescriptor&&mm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ju=mm&&Nd&&typeof Nd.get=="function"?Nd.get:null,f0=mm&&Map.prototype.forEach,gm=typeof Set=="function"&&Set.prototype,zd=Object.getOwnPropertyDescriptor&&gm?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wu=gm&&zd&&typeof zd.get=="function"?zd.get:null,m0=gm&&Set.prototype.forEach,ok=typeof WeakMap=="function"&&WeakMap.prototype,Xa=ok?WeakMap.prototype.has:null,ak=typeof WeakSet=="function"&&WeakSet.prototype,Qa=ak?WeakSet.prototype.has:null,lk=typeof WeakRef=="function"&&WeakRef.prototype,g0=lk?WeakRef.prototype.deref:null,ck=Boolean.prototype.valueOf,uk=Object.prototype.toString,hk=Function.prototype.toString,dk=String.prototype.match,vm=String.prototype.slice,ni=String.prototype.replace,pk=String.prototype.toUpperCase,v0=String.prototype.toLowerCase,wy=RegExp.prototype.test,y0=Array.prototype.concat,Rn=Array.prototype.join,fk=Array.prototype.slice,w0=Math.floor,wp=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ud=Object.getOwnPropertySymbols,bp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",el=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Xo||!0)?Symbol.toStringTag:null,by=Object.prototype.propertyIsEnumerable,b0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function S0(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||wy.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-w0(-n):w0(n);if(r!==n){var i=String(r),s=vm.call(t,i.length+1);return ni.call(i,e,"$&_")+"."+ni.call(ni.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ni.call(t,e,"$&_")}var Sp=sk,_0=Sp.custom,A0=Ay(_0)?_0:null,Sy={__proto__:null,double:'"',single:"'"},mk={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},la=function n(t,e,r,i){var s=e||{};if(Zn(s,"quoteStyle")&&!Zn(Sy,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Zn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Zn(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Zn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Zn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Ey(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?S0(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return l?S0(t,u):u}var p=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=p&&p>0&&typeof t=="object")return _p(t)?"[Array]":"[Object]";var m=Lk(s,r);if(typeof i>"u")i=[];else if(ky(i,t)>=0)return"[Circular]";function v(tt,Ut,Es){if(Ut&&(i=fk.call(i),i.push(Ut)),Es){var Tc={depth:s.depth};return Zn(s,"quoteStyle")&&(Tc.quoteStyle=s.quoteStyle),n(tt,Tc,r+1,i)}return n(tt,s,r+1,i)}if(typeof t=="function"&&!k0(t)){var y=kk(t),k=Fc(t,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(k.length>0?" { "+Rn.call(k,", ")+" }":"")}if(Ay(t)){var A=Xo?ni.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):bp.call(t);return typeof t=="object"&&!Xo?Sa(A):A}if(Ik(t)){for(var x="<"+v0.call(String(t.nodeName)),L=t.attributes||[],D=0;D<L.length;D++)x+=" "+L[D].name+"="+_y(gk(L[D].value),"double",s);return x+=">",t.childNodes&&t.childNodes.length&&(x+="..."),x+="</"+v0.call(String(t.nodeName))+">",x}if(_p(t)){if(t.length===0)return"[]";var V=Fc(t,v);return m&&!Pk(V)?"["+Ap(V,m)+"]":"[ "+Rn.call(V,", ")+" ]"}if(yk(t)){var F=Fc(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!by.call(t,"cause")?"{ ["+String(t)+"] "+Rn.call(y0.call("[cause]: "+v(t.cause),F),", ")+" }":F.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Rn.call(F,", ")+" }"}if(typeof t=="object"&&a){if(A0&&typeof t[A0]=="function"&&Sp)return Sp(t,{depth:p-r});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Ek(t)){var G=[];return f0&&f0.call(t,function(tt,Ut){G.push(v(Ut,t,!0)+" => "+v(tt,t))}),E0("Map",ju.call(t),G,m)}if(Tk(t)){var z=[];return m0&&m0.call(t,function(tt){z.push(v(tt,t))}),E0("Set",Wu.call(t),z,m)}if(Ck(t))return Fd("WeakMap");if(Rk(t))return Fd("WeakSet");if($k(t))return Fd("WeakRef");if(bk(t))return Sa(v(Number(t)));if(_k(t))return Sa(v(wp.call(t)));if(Sk(t))return Sa(ck.call(t));if(wk(t))return Sa(v(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Si<"u"&&t===Si)return"{ [object globalThis] }";if(!vk(t)&&!k0(t)){var J=Fc(t,v),re=b0?b0(t)===Object.prototype:t instanceof Object||t.constructor===Object,_t=t instanceof Object?"":"null prototype",Me=!re&&el&&Object(t)===t&&el in t?vm.call(hi(t),8,-1):_t?"Object":"",he=re||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Ne=he+(Me||_t?"["+Rn.call(y0.call([],Me||[],_t||[]),": ")+"] ":"");return J.length===0?Ne+"{}":m?Ne+"{"+Ap(J,m)+"}":Ne+"{ "+Rn.call(J,", ")+" }"}return String(t)};function _y(n,t,e){var r=e.quoteStyle||t,i=Sy[r];return i+n+i}function gk(n){return ni.call(String(n),/"/g,"&quot;")}function _s(n){return!el||!(typeof n=="object"&&(el in n||typeof n[el]<"u"))}function _p(n){return hi(n)==="[object Array]"&&_s(n)}function vk(n){return hi(n)==="[object Date]"&&_s(n)}function k0(n){return hi(n)==="[object RegExp]"&&_s(n)}function yk(n){return hi(n)==="[object Error]"&&_s(n)}function wk(n){return hi(n)==="[object String]"&&_s(n)}function bk(n){return hi(n)==="[object Number]"&&_s(n)}function Sk(n){return hi(n)==="[object Boolean]"&&_s(n)}function Ay(n){if(Xo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!bp)return!1;try{return bp.call(n),!0}catch{}return!1}function _k(n){if(!n||typeof n!="object"||!wp)return!1;try{return wp.call(n),!0}catch{}return!1}var Ak=Object.prototype.hasOwnProperty||function(n){return n in this};function Zn(n,t){return Ak.call(n,t)}function hi(n){return uk.call(n)}function kk(n){if(n.name)return n.name;var t=dk.call(hk.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function ky(n,t){if(n.indexOf)return n.indexOf(t);for(var e=0,r=n.length;e<r;e++)if(n[e]===t)return e;return-1}function Ek(n){if(!ju||!n||typeof n!="object")return!1;try{ju.call(n);try{Wu.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Ck(n){if(!Xa||!n||typeof n!="object")return!1;try{Xa.call(n,Xa);try{Qa.call(n,Qa)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function $k(n){if(!g0||!n||typeof n!="object")return!1;try{return g0.call(n),!0}catch{}return!1}function Tk(n){if(!Wu||!n||typeof n!="object")return!1;try{Wu.call(n);try{ju.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Rk(n){if(!Qa||!n||typeof n!="object")return!1;try{Qa.call(n,Qa);try{Xa.call(n,Xa)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Ik(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function Ey(n,t){if(n.length>t.maxStringLength){var e=n.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return Ey(vm.call(n,0,t.maxStringLength),t)+r}var i=mk[t.quoteStyle||"single"];i.lastIndex=0;var s=ni.call(ni.call(n,i,"\\$1"),/[\x00-\x1f]/g,xk);return _y(s,"single",t)}function xk(n){var t=n.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+pk.call(t.toString(16))}function Sa(n){return"Object("+n+")"}function Fd(n){return n+" { ? }"}function E0(n,t,e,r){var i=r?Ap(e,r):Rn.call(e,", ");return n+" ("+t+") {"+i+"}"}function Pk(n){for(var t=0;t<n.length;t++)if(ky(n[t],`
2
- `)>=0)return!1;return!0}function Lk(n,t){var e;if(n.indent===" ")e=" ";else if(typeof n.indent=="number"&&n.indent>0)e=Rn.call(Array(n.indent+1)," ");else return null;return{base:e,prev:Rn.call(Array(t+1),e)}}function Ap(n,t){if(n.length===0)return"";var e=`
1
+ var v_=Object.defineProperty;var Lg=n=>{throw TypeError(n)};var y_=(n,t,e)=>t in n?v_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var C=(n,t,e)=>y_(n,typeof t!="symbol"?t+"":t,e),Ad=(n,t,e)=>t.has(n)||Lg("Cannot "+e);var o=(n,t,e)=>(Ad(n,t,"read from private field"),e?e.call(n):t.get(n)),g=(n,t,e)=>t.has(n)?Lg("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),d=(n,t,e,r)=>(Ad(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),h=(n,t,e)=>(Ad(n,t,"access private method"),e);var Nc=(n,t,e,r)=>({set _(i){d(n,t,i,e)},get _(){return o(n,t,r)}});import{i as w_,a as b_,b as S_,c as __,d as A_,e as k_,f as E_,g as C_,U as $_,A as T_,h as R_}from"./artifact-bridge-BEUWXKq7.js";import{m as I_,a as x_,b as P_}from"./missing-artifact-page-DVzJ41AE.js";var Si=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function L_(n){if(n.__esModule)return n;var t=n.default;if(typeof t=="function"){var e=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};e.prototype=t.prototype}else e={};return Object.defineProperty(e,"__esModule",{value:!0}),Object.keys(n).forEach(function(r){var i=Object.getOwnPropertyDescriptor(n,r);Object.defineProperty(e,r,i.get?i:{enumerable:!0,get:function(){return n[r]}})}),e}var Dg=Object.prototype.toString,Y1=function(t){var e=Dg.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&Dg.call(t.callee)==="[object Function]"),r},kd,Og;function D_(){if(Og)return kd;Og=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=Y1,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(v){var y=v.constructor;return y&&y.prototype===v},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},p=function(){if(typeof window>"u")return!1;for(var v in window)try{if(!u["$"+v]&&t.call(window,v)&&window[v]!==null&&typeof window[v]=="object")try{c(window[v])}catch{return!0}}catch{return!0}return!1}(),m=function(v){if(typeof window>"u"||!p)return c(v);try{return c(v)}catch{return!1}};n=function(y){var k=y!==null&&typeof y=="object",A=e.call(y)==="[object Function]",x=r(y),L=k&&e.call(y)==="[object String]",D=[];if(!k&&!A&&!x)throw new TypeError("Object.keys called on a non-object");var V=a&&A;if(L&&y.length>0&&!t.call(y,0))for(var F=0;F<y.length;++F)D.push(String(F));if(x&&y.length>0)for(var G=0;G<y.length;++G)D.push(String(G));else for(var z in y)!(V&&z==="prototype")&&t.call(y,z)&&D.push(String(z));if(s)for(var J=m(y),re=0;re<l.length;++re)!(J&&l[re]==="constructor")&&t.call(y,l[re])&&D.push(l[re]);return D}}return kd=n,kd}var O_=Array.prototype.slice,M_=Y1,Mg=Object.keys,au=Mg?function(t){return Mg(t)}:D_(),Ng=Object.keys;au.shim=function(){if(Object.keys){var t=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);t||(Object.keys=function(r){return M_(r)?Ng(O_.call(r)):Ng(r)})}else Object.keys=au;return Object.keys||au};var N_=au,lu=Object.defineProperty||!1;if(lu)try{lu({},"a",{value:1})}catch{lu=!1}var fc=lu,gr=SyntaxError,te=TypeError,z_=Object.getOwnPropertyDescriptor,cu=z_;if(cu)try{cu([],"length")}catch{cu=null}var ra=cu,zg=fc,U_=gr,Ps=te,Ug=ra,J1=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new Ps("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ps("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ps("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ps("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ps("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ps("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!Ug&&Ug(t,e);if(zg)zg(t,e,{configurable:a===null&&c?c.configurable:!a,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(l||!i&&!s&&!a)t[e]=r;else throw new U_("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},vp=fc,K1=function(){return!!vp};K1.hasArrayLengthDefineBug=function(){if(!vp)return null;try{return vp([],"length",{value:1}).length!==1}catch{return!0}};var Hh=K1,F_=N_,Z_=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",H_=Object.prototype.toString,V_=Array.prototype.concat,Fg=J1,B_=function(n){return typeof n=="function"&&H_.call(n)==="[object Function]"},X1=Hh(),q_=function(n,t,e,r){if(t in n){if(r===!0){if(n[t]===e)return}else if(!B_(r)||!r())return}X1?Fg(n,t,e,!0):Fg(n,t,e)},Q1=function(n,t){var e=arguments.length>2?arguments[2]:{},r=F_(t);Z_&&(r=V_.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)q_(n,r[i],t[r[i]],e[r[i]])};Q1.supportsDescriptors=!!X1;var Ss=Q1,uu={exports:{}};typeof self<"u"?uu.exports=self:typeof window<"u"?uu.exports=window:uu.exports=Function("return this")();var ey=uu.exports,j_=ey,ty=function(){return typeof Si!="object"||!Si||Si.Math!==Math||Si.Array!==Array?j_:Si},W_=Ss,G_=ra,Y_=ty,J_=function(){var t=Y_();if(W_.supportsDescriptors){var e=G_(t,"globalThis");(!e||e.configurable&&(e.enumerable||!e.writable||globalThis!==t))&&Object.defineProperty(t,"globalThis",{configurable:!0,enumerable:!1,value:t,writable:!0})}else(typeof globalThis!="object"||globalThis!==t)&&(t.globalThis=t);return t},K_=Ss,X_=ey,ny=ty,Q_=J_,e6=ny(),ry=function(){return e6};K_(ry,{getPolyfill:ny,implementation:X_,shim:Q_});var im=ry,vr=function(t){return!!t&&(typeof t=="function"||typeof t=="object")},sm=Object,iy=Error,t6=EvalError,n6=RangeError,om=ReferenceError,r6=URIError,i6=Math.abs,s6=Math.floor,o6=Math.max,a6=Math.min,l6=Math.pow,c6=Math.round,am=Number.isNaN||function(t){return t!==t},u6=am,h6=function(t){return u6(t)||t===0?t:t<0?-1:1},ia=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;var i=42;t[e]=i;for(var s in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==i||l.enumerable!==!0)return!1}return!0},Zg=typeof Symbol<"u"&&Symbol,d6=ia,lm=function(){return typeof Zg!="function"||typeof Symbol!="function"||typeof Zg("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:d6()},Ed,Hg;function sy(){return Hg||(Hg=1,Ed=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Ed}var Cd,Vg;function oy(){if(Vg)return Cd;Vg=1;var n=sm;return Cd=n.getPrototypeOf||null,Cd}var p6="Function.prototype.bind called on incompatible ",f6=Object.prototype.toString,m6=Math.max,g6="[object Function]",Bg=function(t,e){for(var r=[],i=0;i<t.length;i+=1)r[i]=t[i];for(var s=0;s<e.length;s+=1)r[s+t.length]=e[s];return r},v6=function(t,e){for(var r=[],i=e,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},y6=function(n,t){for(var e="",r=0;r<n.length;r+=1)e+=n[r],r+1<n.length&&(e+=t);return e},w6=function(t){var e=this;if(typeof e!="function"||f6.apply(e)!==g6)throw new TypeError(p6+e);for(var r=v6(arguments,1),i,s=function(){if(this instanceof i){var p=e.apply(this,Bg(r,arguments));return Object(p)===p?p:this}return e.apply(t,Bg(r,arguments))},a=m6(0,e.length-r.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(i=Function("binder","return function ("+y6(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,i.prototype=new u,u.prototype=null}return i},b6=w6,mc=Function.prototype.bind||b6,cm=Function.prototype.call,um=Function.prototype.apply,S6=typeof Reflect<"u"&&Reflect&&Reflect.apply,_6=mc,A6=um,k6=cm,E6=S6,ay=E6||_6.call(k6,A6),C6=mc,$6=te,T6=cm,R6=ay,Vh=function(t){if(t.length<1||typeof t[0]!="function")throw new $6("a function is required");return R6(C6,T6,t)},I6=Vh,qg=ra,ly;try{ly=[].__proto__===Array.prototype}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var $d=!!ly&&qg&&qg(Object.prototype,"__proto__"),cy=Object,jg=cy.getPrototypeOf,x6=$d&&typeof $d.get=="function"?I6([$d.get]):typeof jg=="function"?function(t){return jg(t==null?t:cy(t))}:!1,Wg=sy(),Gg=oy(),Yg=x6,uy=Wg?function(t){return Wg(t)}:Gg?function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return Gg(t)}:Yg?function(t){return Yg(t)}:null,P6=Function.prototype.call,L6=Object.prototype.hasOwnProperty,D6=mc,yr=D6.call(P6,L6),Q,O6=sm,M6=iy,N6=t6,z6=n6,U6=om,Ko=gr,no=te,F6=r6,Z6=i6,H6=s6,V6=o6,B6=a6,q6=l6,j6=c6,W6=h6,hy=Function,Td=function(n){try{return hy('"use strict"; return ('+n+").constructor;")()}catch{}},il=ra,G6=fc,Rd=function(){throw new no},Y6=il?function(){try{return arguments.callee,Rd}catch{try{return il(arguments,"callee").get}catch{return Rd}}}():Rd,Ls=lm(),De=uy,J6=oy(),K6=sy(),dy=um,gc=cm,Ns={},X6=typeof Uint8Array>"u"||!De?Q:De(Uint8Array),gs={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Q:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Q:ArrayBuffer,"%ArrayIteratorPrototype%":Ls&&De?De([][Symbol.iterator]()):Q,"%AsyncFromSyncIteratorPrototype%":Q,"%AsyncFunction%":Ns,"%AsyncGenerator%":Ns,"%AsyncGeneratorFunction%":Ns,"%AsyncIteratorPrototype%":Ns,"%Atomics%":typeof Atomics>"u"?Q:Atomics,"%BigInt%":typeof BigInt>"u"?Q:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Q:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Q:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Q:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":M6,"%eval%":eval,"%EvalError%":N6,"%Float16Array%":typeof Float16Array>"u"?Q:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Q:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Q:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Q:FinalizationRegistry,"%Function%":hy,"%GeneratorFunction%":Ns,"%Int8Array%":typeof Int8Array>"u"?Q:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Q:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Q:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ls&&De?De(De([][Symbol.iterator]())):Q,"%JSON%":typeof JSON=="object"?JSON:Q,"%Map%":typeof Map>"u"?Q:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ls||!De?Q:De(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":O6,"%Object.getOwnPropertyDescriptor%":il,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Q:Promise,"%Proxy%":typeof Proxy>"u"?Q:Proxy,"%RangeError%":z6,"%ReferenceError%":U6,"%Reflect%":typeof Reflect>"u"?Q:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Q:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ls||!De?Q:De(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Q:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ls&&De?De(""[Symbol.iterator]()):Q,"%Symbol%":Ls?Symbol:Q,"%SyntaxError%":Ko,"%ThrowTypeError%":Y6,"%TypedArray%":X6,"%TypeError%":no,"%Uint8Array%":typeof Uint8Array>"u"?Q:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Q:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Q:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Q:Uint32Array,"%URIError%":F6,"%WeakMap%":typeof WeakMap>"u"?Q:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Q:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Q:WeakSet,"%Function.prototype.call%":gc,"%Function.prototype.apply%":dy,"%Object.defineProperty%":G6,"%Object.getPrototypeOf%":J6,"%Math.abs%":Z6,"%Math.floor%":H6,"%Math.max%":V6,"%Math.min%":B6,"%Math.pow%":q6,"%Math.round%":j6,"%Math.sign%":W6,"%Reflect.getPrototypeOf%":K6};if(De)try{null.error}catch(n){var Q6=De(De(n));gs["%Error.prototype%"]=Q6}var e8=function n(t){var e;if(t==="%AsyncFunction%")e=Td("async function () {}");else if(t==="%GeneratorFunction%")e=Td("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Td("async function* () {}");else if(t==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&De&&(e=De(i.prototype))}return gs[t]=e,e},Jg={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},vc=mc,Bu=yr,t8=vc.call(gc,Array.prototype.concat),n8=vc.call(dy,Array.prototype.splice),Kg=vc.call(gc,String.prototype.replace),qu=vc.call(gc,String.prototype.slice),r8=vc.call(gc,RegExp.prototype.exec),i8=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,s8=/\\(\\)?/g,o8=function(t){var e=qu(t,0,1),r=qu(t,-1);if(e==="%"&&r!=="%")throw new Ko("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&e!=="%")throw new Ko("invalid intrinsic syntax, expected opening `%`");var i=[];return Kg(t,i8,function(s,a,l,c){i[i.length]=l?Kg(c,s8,"$1"):a||s}),i},a8=function(t,e){var r=t,i;if(Bu(Jg,r)&&(i=Jg[r],r="%"+i[0]+"%"),Bu(gs,r)){var s=gs[r];if(s===Ns&&(s=e8(r)),typeof s>"u"&&!e)throw new no("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Ko("intrinsic "+t+" does not exist!")},Mt=function(t,e){if(typeof t!="string"||t.length===0)throw new no("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new no('"allowMissing" argument must be a boolean');if(r8(/^%?[^%]*%?$/,t)===null)throw new Ko("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=o8(t),i=r.length>0?r[0]:"",s=a8("%"+i+"%",e),a=s.name,l=s.value,c=!1,u=s.alias;u&&(i=u[0],n8(r,t8([0,1],u)));for(var p=1,m=!0;p<r.length;p+=1){var v=r[p],y=qu(v,0,1),k=qu(v,-1);if((y==='"'||y==="'"||y==="`"||k==='"'||k==="'"||k==="`")&&y!==k)throw new Ko("property names with quotes must have matching quotes");if((v==="constructor"||!m)&&(c=!0),i+="."+v,a="%"+i+"%",Bu(gs,a))l=gs[a];else if(l!=null){if(!(v in l)){if(!e)throw new no("base intrinsic for "+t+" exists, but the property is not available.");return}if(il&&p+1>=r.length){var A=il(l,v);m=!!A,m&&"get"in A&&!("originalValue"in A.get)?l=A.get:l=l[v]}else m=Bu(l,v),l=l[v];m&&!c&&(gs[a]=l)}}return l},Id,Xg;function ui(){if(Xg)return Id;Xg=1;var n=Mt,t=Vh,e=t([n("%String.prototype.indexOf%")]);return Id=function(i,s){var a=n(i,!!s);return typeof a=="function"&&e(i,".prototype.")>-1?t([a]):a},Id}var xd,Qg;function hm(){if(Qg)return xd;Qg=1;var n=Mt,t=n("%Array%"),e=!t.isArray&&ui()("Object.prototype.toString");return xd=t.isArray||function(i){return e(i)==="[object Array]"},xd}var l8=Hh,e0=fc,py=l8.hasArrayLengthDefineBug(),c8=py&&hm(),u8=ui(),h8=u8("Object.prototype.propertyIsEnumerable"),dm=function(t,e,r,i,s,a){if(!e0){if(!t(a)||!a["[[Configurable]]"]||!a["[[Writable]]"]||s in i&&h8(i,s)!==!!a["[[Enumerable]]"])return!1;var l=a["[[Value]]"];return i[s]=l,e(i[s],l)}return py&&s==="length"&&"[[Value]]"in a&&c8(i)&&i.length!==a["[[Value]]"]?(i.length=a["[[Value]]"],i.length===a["[[Value]]"]):(e0(i,s,r(a)),!0)},d8=te,ba=yr,p8={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},sa=function(t){if(!t||typeof t!="object")return!1;for(var e in t)if(ba(t,e)&&!p8[e])return!1;var r=ba(t,"[[Value]]")||ba(t,"[[Writable]]"),i=ba(t,"[[Get]]")||ba(t,"[[Set]]");if(r&&i)throw new d8("Property Descriptors may not be both accessor and data descriptors");return!0},fy=function(t){if(typeof t>"u")return t;var e={};return"[[Value]]"in t&&(e.value=t["[[Value]]"]),"[[Writable]]"in t&&(e.writable=!!t["[[Writable]]"]),"[[Get]]"in t&&(e.get=t["[[Get]]"]),"[[Set]]"in t&&(e.set=t["[[Set]]"]),"[[Enumerable]]"in t&&(e.enumerable=!!t["[[Enumerable]]"]),"[[Configurable]]"in t&&(e.configurable=!!t["[[Configurable]]"]),e},f8=te,m8=sa,g8=fy,my=function(t){if(typeof t<"u"&&!m8(t))throw new f8("Assertion failed: `Desc` must be a Property Descriptor");return g8(t)},v8=te,t0=yr,y8=sa,gy=function(t){if(typeof t>"u")return!1;if(!y8(t))throw new v8("Assertion failed: `Desc` must be a Property Descriptor");return!(!t0(t,"[[Value]]")&&!t0(t,"[[Writable]]"))},oa=function(t){return typeof t=="string"||typeof t=="symbol"},n0=am,vy=function(t,e){return t===e?t===0?1/t===1/e:!0:n0(t)&&n0(e)},r0=te,w8=vr,b8=dm,S8=my,_8=gy,A8=oa,k8=vy,pm=function(t,e,r){if(!w8(t))throw new r0("Assertion failed: Type(O) is not Object");if(!A8(e))throw new r0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return b8(_8,k8,S8,t,e,i)},yy=Function.prototype.toString,Ks=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,yp,hu;if(typeof Ks=="function"&&typeof Object.defineProperty=="function")try{yp=Object.defineProperty({},"length",{get:function(){throw hu}}),hu={},Ks(function(){throw 42},null,yp)}catch(n){n!==hu&&(Ks=null)}else Ks=null;var E8=/^\s*class\b/,wp=function(t){try{var e=yy.call(t);return E8.test(e)}catch{return!1}},Pd=function(t){try{return wp(t)?!1:(yy.call(t),!0)}catch{return!1}},du=Object.prototype.toString,C8="[object Object]",$8="[object Function]",T8="[object GeneratorFunction]",R8="[object HTMLAllCollection]",I8="[object HTML document.all class]",x8="[object HTMLCollection]",P8=typeof Symbol=="function"&&!!Symbol.toStringTag,L8=!(0 in[,]),bp=function(){return!1};if(typeof document=="object"){var D8=document.all;du.call(D8)===du.call(document.all)&&(bp=function(t){if((L8||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=du.call(t);return(e===R8||e===I8||e===x8||e===C8)&&t("")==null}catch{}return!1})}var wy=Ks?function(t){if(bp(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Ks(t,null,yp)}catch(e){if(e!==hu)return!1}return!wp(t)&&Pd(t)}:function(t){if(bp(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(P8)return Pd(t);if(wp(t))return!1;var e=du.call(t);return e!==$8&&e!==T8&&!/^\[object HTML/.test(e)?!1:Pd(t)},O8=wy,M8=function(t){return!!t},en=yr,zc=te,N8=vr,i0=O8,Ld=M8,z8=function(t){if(!N8(t))throw new zc("ToPropertyDescriptor requires an object");var e={};if(en(t,"enumerable")&&(e["[[Enumerable]]"]=Ld(t.enumerable)),en(t,"configurable")&&(e["[[Configurable]]"]=Ld(t.configurable)),en(t,"value")&&(e["[[Value]]"]=t.value),en(t,"writable")&&(e["[[Writable]]"]=Ld(t.writable)),en(t,"get")){var r=t.get;if(typeof r<"u"&&!i0(r))throw new zc("getter must be a function");e["[[Get]]"]=r}if(en(t,"set")){var i=t.set;if(typeof i<"u"&&!i0(i))throw new zc("setter must be a function");e["[[Set]]"]=i}if((en(e,"[[Get]]")||en(e,"[[Set]]"))&&(en(e,"[[Value]]")||en(e,"[[Writable]]")))throw new zc("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},Dd=te,U8=vr,s0=sa,F8=dm,Z8=my,H8=gy,V8=oa,B8=vy,q8=z8,j8=function(t,e,r){if(!U8(t))throw new Dd("Assertion failed: Type(O) is not Object");if(!V8(e))throw new Dd("Assertion failed: P is not a Property Key");var i=s0(r)?r:q8(r);if(!s0(i))throw new Dd("Assertion failed: Desc is not a valid Property Descriptor");return F8(H8,B8,Z8,t,e,i)},o0=te,W8=vr,G8=j8,Y8=oa,J8=function(t,e,r){if(!W8(t))throw new o0("Assertion failed: Type(O) is not Object");if(!Y8(e))throw new o0("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return G8(t,e,i)},K8=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,X8=sm,Q8=X8.setPrototypeOf||null,eA=Vh,a0=ra,tA=te,by={};try{by.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var nA=!("toString"in by),Od=a0&&a0(Object.prototype,"__proto__"),rA=nA&&(!!Od&&typeof Od.set=="function"&&eA([Od.set])||function(t,e){if(t==null)throw new tA("set Object.prototype.__proto__ called on null or undefined");return t.__proto__=e,e}),l0=K8,iA=Q8,c0=rA,sA=te,oA=l0?function(t,e){if(l0(t,e))return t;throw new sA("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:iA||(c0?function(t,e){return c0(t,e),t}:null),u0=te,aA=vr,h0=uy,lA=function(t){if(!aA(t))throw new u0("Assertion failed: O must be an Object");if(!h0)throw new u0("This environment does not support fetching prototypes.");return h0(t)},cA=te,uA=oA,hA=vr,dA=lA,pA=function(t,e){if(e!==null&&!hA(e))throw new cA("Assertion failed: V must be Object or Null");try{uA(t,e)}catch{return!1}return dA(t)===e},Md=pm,d0=J8,Sy=pA,fA=Hh(),fm=iy;function yc(n,t,e){var r=new fm(e);return Sy(r,pu),delete r.constructor,d0(r,"error",n),d0(r,"suppressed",t),r}fA&&Object.defineProperty(yc,"prototype",{writable:!1});var pu=yc.prototype;if(!Md(pu,"constructor",yc)||!Md(pu,"message","")||!Md(pu,"name","SuppressedError"))throw new fm("unable to install SuppressedError.prototype properties; please report this!");Sy(yc.prototype,fm.prototype);var mA=yc,gA=mA,_y=function(){return typeof SuppressedError=="function"?SuppressedError:gA},vA=Ss,p0=im(),yA=_y,wA=function(){var t=yA();return vA(p0,{SuppressedError:t},{SuppressedError:function(){return p0.SuppressedError!==t}}),t};wA();var bA=te,SA=sa,_A=fy,AA=function(t){if(typeof t<"u"&&!SA(t))throw new bA("Assertion failed: `Desc` must be a Property Descriptor");return _A(t)},kA=te,f0=yr,EA=sa,CA=function(t){if(typeof t>"u")return!1;if(!EA(t))throw new kA("Assertion failed: `Desc` must be a Property Descriptor");return!(!f0(t,"[[Value]]")&&!f0(t,"[[Writable]]"))},m0=am,$A=function(t,e){return t===e?t===0?1/t===1/e:!0:m0(t)&&m0(e)},aa=wy,TA=function(t){return!!t},tn=yr,Uc=te,RA=vr,g0=aa,Nd=TA,IA=function(t){if(!RA(t))throw new Uc("ToPropertyDescriptor requires an object");var e={};if(tn(t,"enumerable")&&(e["[[Enumerable]]"]=Nd(t.enumerable)),tn(t,"configurable")&&(e["[[Configurable]]"]=Nd(t.configurable)),tn(t,"value")&&(e["[[Value]]"]=t.value),tn(t,"writable")&&(e["[[Writable]]"]=Nd(t.writable)),tn(t,"get")){var r=t.get;if(typeof r<"u"&&!g0(r))throw new Uc("getter must be a function");e["[[Get]]"]=r}if(tn(t,"set")){var i=t.set;if(typeof i<"u"&&!g0(i))throw new Uc("setter must be a function");e["[[Set]]"]=i}if((tn(e,"[[Get]]")||tn(e,"[[Set]]"))&&(tn(e,"[[Value]]")||tn(e,"[[Writable]]")))throw new Uc("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},zd=te,xA=vr,v0=sa,PA=dm,LA=AA,DA=CA,OA=oa,MA=$A,NA=IA,wc=function(t,e,r){if(!xA(t))throw new zd("Assertion failed: Type(O) is not Object");if(!OA(e))throw new zd("Assertion failed: P is not a Property Key");var i=v0(r)?r:NA(r);if(!v0(i))throw new zd("Assertion failed: Desc is not a valid Property Descriptor");return PA(DA,MA,LA,t,e,i)},zA=ia(),UA=zA?Symbol.dispose||Symbol("Symbol.dispose"):null,FA=ia,ZA=UA,mm=function(){return FA()&&Symbol.dispose||ZA},HA=lm,VA=wc,BA=mm,qA=function(){var t=BA();return HA()&&VA(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},jA=ia(),WA=jA?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,GA=ia,YA=WA,gm=function(){return GA()&&Symbol.asyncDispose||YA},JA=lm,KA=wc,XA=gm,QA=function(){var t=XA();return JA()&&KA(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},ek=hm(),tk=Mt,nk=ui(),rk=te,ik=ek,sk=tk("%Reflect.apply%",!0)||nk("Function.prototype.apply"),Bh=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!ik(r))throw new rk("Assertion failed: optional `argumentsList`, if provided, must be a List");return sk(t,e,r)};const ok={},ak=Object.freeze(Object.defineProperty({__proto__:null,default:ok},Symbol.toStringTag,{value:"Module"})),lk=L_(ak);var vm=typeof Map=="function"&&Map.prototype,Ud=Object.getOwnPropertyDescriptor&&vm?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ju=vm&&Ud&&typeof Ud.get=="function"?Ud.get:null,y0=vm&&Map.prototype.forEach,ym=typeof Set=="function"&&Set.prototype,Fd=Object.getOwnPropertyDescriptor&&ym?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Wu=ym&&Fd&&typeof Fd.get=="function"?Fd.get:null,w0=ym&&Set.prototype.forEach,ck=typeof WeakMap=="function"&&WeakMap.prototype,Xa=ck?WeakMap.prototype.has:null,uk=typeof WeakSet=="function"&&WeakSet.prototype,Qa=uk?WeakSet.prototype.has:null,hk=typeof WeakRef=="function"&&WeakRef.prototype,b0=hk?WeakRef.prototype.deref:null,dk=Boolean.prototype.valueOf,pk=Object.prototype.toString,fk=Function.prototype.toString,mk=String.prototype.match,wm=String.prototype.slice,ni=String.prototype.replace,gk=String.prototype.toUpperCase,S0=String.prototype.toLowerCase,Ay=RegExp.prototype.test,_0=Array.prototype.concat,Rn=Array.prototype.join,vk=Array.prototype.slice,A0=Math.floor,Sp=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Zd=Object.getOwnPropertySymbols,_p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Xo=typeof Symbol=="function"&&typeof Symbol.iterator=="object",el=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Xo||!0)?Symbol.toStringTag:null,ky=Object.prototype.propertyIsEnumerable,k0=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function E0(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Ay.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-A0(-n):A0(n);if(r!==n){var i=String(r),s=wm.call(t,i.length+1);return ni.call(i,e,"$&_")+"."+ni.call(ni.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return ni.call(t,e,"$&_")}var Ap=lk,C0=Ap.custom,$0=$y(C0)?C0:null,Ey={__proto__:null,double:'"',single:"'"},yk={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},la=function n(t,e,r,i){var s=e||{};if(Zn(s,"quoteStyle")&&!Zn(Ey,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Zn(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=Zn(s,"customInspect")?s.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Zn(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Zn(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=s.numericSeparator;if(typeof t>"u")return"undefined";if(t===null)return"null";if(typeof t=="boolean")return t?"true":"false";if(typeof t=="string")return Ry(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return l?E0(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return l?E0(t,u):u}var p=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=p&&p>0&&typeof t=="object")return kp(t)?"[Array]":"[Object]";var m=Mk(s,r);if(typeof i>"u")i=[];else if(Ty(i,t)>=0)return"[Circular]";function v(tt,Ut,Es){if(Ut&&(i=vk.call(i),i.push(Ut)),Es){var Tc={depth:s.depth};return Zn(s,"quoteStyle")&&(Tc.quoteStyle=s.quoteStyle),n(tt,Tc,r+1,i)}return n(tt,s,r+1,i)}if(typeof t=="function"&&!T0(t)){var y=$k(t),k=Fc(t,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(k.length>0?" { "+Rn.call(k,", ")+" }":"")}if($y(t)){var A=Xo?ni.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):_p.call(t);return typeof t=="object"&&!Xo?Sa(A):A}if(Lk(t)){for(var x="<"+S0.call(String(t.nodeName)),L=t.attributes||[],D=0;D<L.length;D++)x+=" "+L[D].name+"="+Cy(wk(L[D].value),"double",s);return x+=">",t.childNodes&&t.childNodes.length&&(x+="..."),x+="</"+S0.call(String(t.nodeName))+">",x}if(kp(t)){if(t.length===0)return"[]";var V=Fc(t,v);return m&&!Ok(V)?"["+Ep(V,m)+"]":"[ "+Rn.call(V,", ")+" ]"}if(Sk(t)){var F=Fc(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!ky.call(t,"cause")?"{ ["+String(t)+"] "+Rn.call(_0.call("[cause]: "+v(t.cause),F),", ")+" }":F.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+Rn.call(F,", ")+" }"}if(typeof t=="object"&&a){if($0&&typeof t[$0]=="function"&&Ap)return Ap(t,{depth:p-r});if(a!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(Tk(t)){var G=[];return y0&&y0.call(t,function(tt,Ut){G.push(v(Ut,t,!0)+" => "+v(tt,t))}),R0("Map",ju.call(t),G,m)}if(xk(t)){var z=[];return w0&&w0.call(t,function(tt){z.push(v(tt,t))}),R0("Set",Wu.call(t),z,m)}if(Rk(t))return Hd("WeakMap");if(Pk(t))return Hd("WeakSet");if(Ik(t))return Hd("WeakRef");if(Ak(t))return Sa(v(Number(t)));if(Ek(t))return Sa(v(Sp.call(t)));if(kk(t))return Sa(dk.call(t));if(_k(t))return Sa(v(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Si<"u"&&t===Si)return"{ [object globalThis] }";if(!bk(t)&&!T0(t)){var J=Fc(t,v),re=k0?k0(t)===Object.prototype:t instanceof Object||t.constructor===Object,_t=t instanceof Object?"":"null prototype",Me=!re&&el&&Object(t)===t&&el in t?wm.call(hi(t),8,-1):_t?"Object":"",he=re||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",Ne=he+(Me||_t?"["+Rn.call(_0.call([],Me||[],_t||[]),": ")+"] ":"");return J.length===0?Ne+"{}":m?Ne+"{"+Ep(J,m)+"}":Ne+"{ "+Rn.call(J,", ")+" }"}return String(t)};function Cy(n,t,e){var r=e.quoteStyle||t,i=Ey[r];return i+n+i}function wk(n){return ni.call(String(n),/"/g,"&quot;")}function _s(n){return!el||!(typeof n=="object"&&(el in n||typeof n[el]<"u"))}function kp(n){return hi(n)==="[object Array]"&&_s(n)}function bk(n){return hi(n)==="[object Date]"&&_s(n)}function T0(n){return hi(n)==="[object RegExp]"&&_s(n)}function Sk(n){return hi(n)==="[object Error]"&&_s(n)}function _k(n){return hi(n)==="[object String]"&&_s(n)}function Ak(n){return hi(n)==="[object Number]"&&_s(n)}function kk(n){return hi(n)==="[object Boolean]"&&_s(n)}function $y(n){if(Xo)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!_p)return!1;try{return _p.call(n),!0}catch{}return!1}function Ek(n){if(!n||typeof n!="object"||!Sp)return!1;try{return Sp.call(n),!0}catch{}return!1}var Ck=Object.prototype.hasOwnProperty||function(n){return n in this};function Zn(n,t){return Ck.call(n,t)}function hi(n){return pk.call(n)}function $k(n){if(n.name)return n.name;var t=mk.call(fk.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function Ty(n,t){if(n.indexOf)return n.indexOf(t);for(var e=0,r=n.length;e<r;e++)if(n[e]===t)return e;return-1}function Tk(n){if(!ju||!n||typeof n!="object")return!1;try{ju.call(n);try{Wu.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function Rk(n){if(!Xa||!n||typeof n!="object")return!1;try{Xa.call(n,Xa);try{Qa.call(n,Qa)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function Ik(n){if(!b0||!n||typeof n!="object")return!1;try{return b0.call(n),!0}catch{}return!1}function xk(n){if(!Wu||!n||typeof n!="object")return!1;try{Wu.call(n);try{ju.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function Pk(n){if(!Qa||!n||typeof n!="object")return!1;try{Qa.call(n,Qa);try{Xa.call(n,Xa)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function Lk(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function Ry(n,t){if(n.length>t.maxStringLength){var e=n.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return Ry(wm.call(n,0,t.maxStringLength),t)+r}var i=yk[t.quoteStyle||"single"];i.lastIndex=0;var s=ni.call(ni.call(n,i,"\\$1"),/[\x00-\x1f]/g,Dk);return Cy(s,"single",t)}function Dk(n){var t=n.charCodeAt(0),e={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return e?"\\"+e:"\\x"+(t<16?"0":"")+gk.call(t.toString(16))}function Sa(n){return"Object("+n+")"}function Hd(n){return n+" { ? }"}function R0(n,t,e,r){var i=r?Ep(e,r):Rn.call(e,", ");return n+" ("+t+") {"+i+"}"}function Ok(n){for(var t=0;t<n.length;t++)if(Ty(n[t],`
2
+ `)>=0)return!1;return!0}function Mk(n,t){var e;if(n.indent===" ")e=" ";else if(typeof n.indent=="number"&&n.indent>0)e=Rn.call(Array(n.indent+1)," ");else return null;return{base:e,prev:Rn.call(Array(t+1),e)}}function Ep(n,t){if(n.length===0)return"";var e=`
3
3
  `+t.prev+t.base;return e+Rn.call(n,","+e)+`
4
- `+t.prev}function Fc(n,t){var e=_p(n),r=[];if(e){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Zn(n,i)?t(n[i],n):""}var s=typeof Ud=="function"?Ud(n):[],a;if(Xo){a={};for(var l=0;l<s.length;l++)a["$"+s[l]]=s[l]}for(var c in n)Zn(n,c)&&(e&&String(Number(c))===c&&c<n.length||Xo&&a["$"+c]instanceof Symbol||(wy.call(/[^\w$]/,c)?r.push(t(c,n)+": "+t(n[c],n)):r.push(c+": "+t(n[c],n))));if(typeof Ud=="function")for(var u=0;u<s.length;u++)by.call(n,s[u])&&r.push("["+t(s[u])+"]: "+t(n[s[u]],n));return r}var Dk=la,Ok=te,qh=function(n,t,e){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,e||(i.next=n.next,n.next=i),i},Mk=function(n,t){if(n){var e=qh(n,t);return e&&e.value}},Nk=function(n,t,e){var r=qh(n,t);r?r.value=e:n.next={key:t,next:n.next,value:e}},zk=function(n,t){return n?!!qh(n,t):!1},Uk=function(n,t){if(n)return qh(n,t,!0)},Fk=function(){var t,e={assert:function(r){if(!e.has(r))throw new Ok("Side channel does not contain "+Dk(r))},delete:function(r){var i=Uk(t,r);return i&&t&&!t.next&&(t=void 0),!!i},get:function(r){return Mk(t,r)},has:function(r){return zk(t,r)},set:function(r,i){t||(t={next:void 0}),Nk(t,r,i)}};return e},Zk=Mt,bc=ui(),Hk=la,Vk=te,C0=Zk("%Map%",!0),Bk=bc("Map.prototype.get",!0),qk=bc("Map.prototype.set",!0),jk=bc("Map.prototype.has",!0),Wk=bc("Map.prototype.delete",!0),Gk=bc("Map.prototype.size",!0),Cy=!!C0&&function(){var t,e={assert:function(r){if(!e.has(r))throw new Vk("Side channel does not contain "+Hk(r))},delete:function(r){if(t){var i=Wk(t,r);return Gk(t)===0&&(t=void 0),i}return!1},get:function(r){if(t)return Bk(t,r)},has:function(r){return t?jk(t,r):!1},set:function(r,i){t||(t=new C0),qk(t,r,i)}};return e},Yk=Mt,jh=ui(),Jk=la,Zc=Cy,Kk=te,Ds=Yk("%WeakMap%",!0),Xk=jh("WeakMap.prototype.get",!0),Qk=jh("WeakMap.prototype.set",!0),eE=jh("WeakMap.prototype.has",!0),tE=jh("WeakMap.prototype.delete",!0),nE=Ds?function(){var t,e,r={assert:function(i){if(!r.has(i))throw new Kk("Side channel does not contain "+Jk(i))},delete:function(i){if(Ds&&i&&(typeof i=="object"||typeof i=="function")){if(t)return tE(t,i)}else if(Zc&&e)return e.delete(i);return!1},get:function(i){return Ds&&i&&(typeof i=="object"||typeof i=="function")&&t?Xk(t,i):e&&e.get(i)},has:function(i){return Ds&&i&&(typeof i=="object"||typeof i=="function")&&t?eE(t,i):!!e&&e.has(i)},set:function(i,s){Ds&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Ds),Qk(t,i,s)):Zc&&(e||(e=Zc()),e.set(i,s))}};return r}:Zc,rE=te,iE=la,sE=Fk,oE=Cy,aE=nE,lE=aE||oE||sE,cE=function(){var t,e={assert:function(r){if(!e.has(r)){var i=r&&Object(r)===r?"the given object key":iE(r);throw new rE("Side channel does not contain "+i)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,i){t||(t=lE()),t.set(r,i)}};return e},uE=yr,_a=cE(),Nn=te,ym={assert:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");if(_a.assert(n),!ym.has(n,t))throw new Nn("`"+t+"` is not present on `O`")},get:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var e=_a.get(n);return e&&e["$"+t]},has:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var e=_a.get(n);return!!e&&uE(e,"$"+t)},set:function(n,t,e){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var r=_a.get(n);r||(r={},_a.set(n,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(ym);var wm=ym,$y=gr,si=wm,Sc=function n(t,e){if(!(this instanceof n))return new n(t,e);if(t!=="normal"&&t!=="break"&&t!=="continue"&&t!=="return"&&t!=="throw")throw new $y('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');si.set(this,"[[Type]]",t),si.set(this,"[[Value]]",e)};Sc.prototype.type=function(){return si.get(this,"[[Type]]")};Sc.prototype.value=function(){return si.get(this,"[[Value]]")};Sc.prototype["?"]=function(){var t=si.get(this,"[[Type]]"),e=si.get(this,"[[Value]]");if(t==="throw")throw e;return e};Sc.prototype["!"]=function(){var t=si.get(this,"[[Type]]");if(t!=="normal")throw new $y('Assertion failed: Completion Record is not of type "normal"');return si.get(this,"[[Value]]")};var bm=Sc,hE=bm,Sm=function(t){return new hE("normal",t)},Zd,$0;function dE(){if($0)return Zd;$0=1;var n=ia;return Zd=function(){return n()&&!!Symbol.toStringTag},Zd}var pE=Mt,T0=pE("%Object.defineProperty%",!0),fE=dE()(),mE=yr,gE=te,Hc=fE?Symbol.toStringTag:null,Ty=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new gE("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Hc&&(r||!mE(t,Hc))&&(T0?T0(t,Hc,{configurable:!i,enumerable:!1,value:e,writable:!1}):t[Hc]=e)},Ry={exports:{}},vE=Mt,R0=j1,yE=Hh(),I0=ra,x0=te,wE=vE("%Math.floor%"),bE=function(t,e){if(typeof t!="function")throw new x0("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||wE(e)!==e)throw new x0("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&I0){var a=I0(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(s=!1)}return(i||s||!r)&&(yE?R0(t,"length",e,!0,!0):R0(t,"length",e)),t},SE=mc,_E=lm,AE=ry,kE=function(){return AE(SE,_E,arguments)};(function(n){var t=bE,e=fc,r=Vh,i=kE;n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return t(l,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(Ry);var _m=Ry.exports,EE=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0},CE=Object,$E=function(t){return t&&typeof t=="object"&&(typeof t["[[ResourceValue]]"]>"u"||CE(t["[[ResourceValue]]"])===t["[[ResourceValue]]"])&&(t["[[Hint]]"]==="SYNC-DISPOSE"||t["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof t["[[DisposeMethod]]"]=="function"||typeof t["[[DisposeMethod]]"]>"u")},TE=yr,RE=cm(),IE=EE,xE=$E,PE=function(t){return t&&typeof t=="object"&&TE(t,"[[DisposableResourceStack]]")&&RE(t["[[DisposableResourceStack]]"])&&(t["[[DisposableResourceStack]]"].length===0||IE(t["[[DisposableResourceStack]]"],xE))},LE=vr,DE=function(t){if(t===null)return"Null";if(typeof t>"u")return"Undefined";if(LE(t))return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"},OE=DE,Am=function(t){return typeof t=="symbol"?"Symbol":typeof t=="bigint"?"BigInt":OE(t)},ME=te,NE=la,zE=oa,UE=function(t,e){if(!zE(e))throw new ME("Assertion failed: P is not a Property Key, got "+NE(e));return t[e]},P0=te,FE=UE,ZE=aa,HE=oa,L0=la,VE=function(t,e){if(!HE(e))throw new P0("Assertion failed: P is not a Property Key");var r=FE(t,e);if(r!=null){if(!ZE(r))throw new P0(L0(e)+" is not a function: "+L0(r));return r}},kp={exports:{}},BE=Mt,qE=BE,D0=qE("%Reflect.construct%",!0),Gu=wc;try{Gu({},"",{"[[Get]]":function(){}})}catch{Gu=null}if(Gu&&D0){var O0={},M0={};Gu(M0,"length",{"[[Get]]":function(){throw O0},"[[Enumerable]]":!0}),kp.exports=function(t){try{D0(t,M0)}catch(e){return e===O0}}}else kp.exports=function(t){return typeof t=="function"&&!!t.prototype};var jE=kp.exports,Hd=te,N0=aa,WE=jE,GE=function(t){if(!WE(t))throw new Hd("C must be a constructor");var e={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new t(function(i,s){if(typeof e["[[Resolve]]"]<"u"||typeof e["[[Reject]]"]<"u")throw new Hd("executor has already been called");e["[[Resolve]]"]=i,e["[[Reject]]"]=s});if(!N0(e["[[Resolve]]"])||!N0(e["[[Reject]]"]))throw new Hd("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":e["[[Resolve]]"],"[[Reject]]":e["[[Reject]]"]}},z0=gr,YE=te,Vd=Bh,U0=VE,JE=GE,KE=Am,F0=pm(),Z0=fm(),XE=function(t,e){if(KE(t)!=="Object")throw new YE("`V` must be an Object");if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new z0("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(e==="ASYNC-DISPOSE"&&Z0&&(r=U0(t,Z0)),!r){if(!F0)throw new z0("`Symbol.dispose` is not supported");if(r=U0(t,F0),typeof r<"u")return function(){var i=this;if(e==="ASYNC-DISPOSE"){var s=JE(Promise);try{Vd(r,i),Vd(s["[[Resolve]]"],void 0,[void 0])}catch(a){s["[[Reject]]"](a)}return s["[[Promise]]"]}Vd(r,i)}}return r},QE=gr,Bd=te,e4=aa,t4=Am,n4=XE,r4=function(t,e){if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new QE("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(t==null)t=void 0,r=void 0;else{if(typeof t<"u"&&t4(t)!=="Object")throw new Bd("`V` must be an Object, or `null` or `undefined`");if(r=n4(t,e),typeof r>"u")throw new Bd("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!e4(r))throw new Bd("`method`, when provided, must be a function");return{"[[ResourceValue]]":t,"[[Hint]]":e,"[[DisposeMethod]]":r}},i4=gr,Vc=te,s4=PE,H0=r4,o4=ui(),a4=o4("Array.prototype.push"),Iy=function(t,e,r){if(!s4(t))throw new Vc("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new i4("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var i=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof i!="function")throw new Vc("Assertion failed: `method`, when present, must be a function");if(!t["[[DisposableResourceStack]]"])throw new Vc("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(e==null&&r==="SYNC_DISPOSE")return"UNUSED";s=H0(e,r)}else{if(typeof e<"u")throw new Vc("Assertion failed: `V` must be undefined when `method` is present");s=H0(void 0,r,i)}return a4(t["[[DisposableResourceStack]]"],s),"UNUSED"},qd,V0;function km(){if(V0)return qd;V0=1;var n=Mt,t=_m,e=gr,r=n("%Promise.resolve%",!0),i=r&&t(r);return qd=function(a,l){if(!i)throw new e("This environment does not support Promises.");return i(a,l)},qd}var jd,B0;function l4(){if(B0)return jd;B0=1;var n=Mt,t=gr,e=n("%Promise%",!0),r=Bh,i=km(),s=Am;return jd=function(l,c,u){if(typeof l<"u"&&s(l)!=="Object")throw new t("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new t("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new t("Assertion failed: `method` must be `undefined` or a function");var p=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(e,p)},jd}var Wd,q0;function c4(){if(q0)return Wd;q0=1;var n=bm;return Wd=function(e){return new n("throw",e)},Wd}var u4=Mt,Gd=gr,j0=te,h4=u4("%Promise%",!0),d4=ui(),W0=d4("Promise.prototype.then",!0),p4=bm,G0=l4(),f4=Sm,m4=km(),Y0=c4(),g4=yy(),xy=function(t,e){if(!(e instanceof p4))throw new j0("`completion` must be a Completion Record");var r=t["[[DisposableResourceStack]]"];if(!r)throw new j0("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,s=r.length-1;s>=0;s-=1)if(!i)i=r[s]["[[Hint]]"];else if(i!==r[s]["[[Hint]]"])throw new Gd("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&m4(h4,e),l=function(v){if(e.type()==="throw"){var y=e.value(),k=new g4(v,y);e=Y0(k)}else e=Y0(v)},c=i==="ASYNC-DISPOSE"&&function(y){return W0(a,function(){var k=G0(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!k)throw new Gd("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return W0(k,f4)},l)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")a=c(r[u]);else{var p=r[u];try{var m=G0(p["[[ResourceValue]]"],p["[[Hint]]"],p["[[DisposeMethod]]"]);if(m)throw new Gd("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(v){l(v)}}return t["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:e},Py=function(){var t=[];return{"[[DisposableResourceStack]]":t}},Wh=im,Em=te,v4=Bh,ca=hm,y4=wc,Ly=aa,w4=Sm,at=wm,b4=Ty,Dy=Ss.supportsDescriptors,S4=_m,Cm=Iy,_4=xy,Oy=Py,J0=pm(),Lt=function n(){if(!(this instanceof n)||at.has(this,"[[DisposableState]]")||at.has(this,"[[DisposeCapability]]"))throw new Em("can only be used with new");at.set(this,"[[DisposableState]]","PENDING"),at.set(this,"[[DisposeCapability]]",Oy())},My=function(){var t=this;return at.assert(t,"[[DisposableState]]"),at.get(t,"[[DisposableState]]")==="DISPOSED"},_c=S4(My);Dy?y4(Lt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":My}):Lt.prototype.disposed=!1;var Ny=function(t){at.set(t,"[[DisposableState]]","DISPOSED"),Dy||(t.disposed=!0)};ca(Lt.prototype,"dispose",function(){var t=this;if(!_c(t))return Ny(t),_4(at.get(t,"[[DisposeCapability]]"),w4())["?"]()});ca(Lt.prototype,"use",function(t){var e=this;if(_c(e))throw new Wh("a disposed stack can not use anything new");return Cm(at.get(e,"[[DisposeCapability]]"),t,"SYNC-DISPOSE"),t});ca(Lt.prototype,"adopt",function(t,e){var r=this;if(_c(r))throw new Wh("a disposed stack can not use anything new");if(!Ly(e))throw new Em("`onDispose` must be a function");var i=function(){return v4(e,void 0,[t])};return Cm(at.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),t});ca(Lt.prototype,"defer",function(t){var e=this;if(_c(e))throw new Wh("a disposed stack can not defer anything new");if(!Ly(t))throw new Em("`onDispose` must be a function");Cm(at.get(e,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",t)});ca(Lt.prototype,"move",function(){var t=this;if(_c(t))throw new Wh("a disposed stack can not use anything new");var e=new Lt;return at.set(e,"[[DisposeCapability]]",at.get(t,"[[DisposeCapability]]")),at.set(t,"[[DisposeCapability]]",Oy()),Ny(t),e});J0&&ca(Lt.prototype,J0,Lt.prototype.dispose);b4(Lt.prototype,"DisposableStack");var A4=Lt,k4=A4,E4=function(){return typeof DisposableStack=="function"?DisposableStack:k4},C4=Ss,$4=nm(),T4=E4,R4=function(){var t=T4();return C4($4,{DisposableStack:t},{DisposableStack:!0}),t},I4=Mt,Gh=im,$m=te,K0=I4("%Promise%",!0),Tm=Iy,x4=Bh,ua=hm,P4=wc,L4=xy,zy=aa,Uy=Py,D4=Sm,X0=km(),lt=wm,O4=Ty,Fy=Ss.supportsDescriptors,M4=_m,N4=ui(),z4=N4("Promise.prototype.then",!0),Q0=fm(),Dt=function n(){if(!(this instanceof n)||lt.has(this,"[[AsyncDisposableState]]")||lt.has(this,"[[DisposeCapability]]"))throw new $m("can only be used with new");lt.set(this,"[[AsyncDisposableState]]","pending"),lt.set(this,"[[DisposeCapability]]",Uy())},Zy=function(){var t=this;return lt.assert(t,"[[AsyncDisposableState]]"),lt.get(t,"[[AsyncDisposableState]]")==="disposed"},Ac=M4(Zy);Fy?P4(Dt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Zy}):Dt.prototype.disposed=!1;var Hy=function(t){lt.set(t,"[[AsyncDisposableState]]","disposed"),Fy||(t.disposed=!0)};ua(Dt.prototype,"disposeAsync",function(){var t=this;return Ac(t)?X0(K0):(Hy(t),z4(X0(K0,L4(lt.get(t,"[[DisposeCapability]]"),D4())),function(e){return e["?"]()}))});ua(Dt.prototype,"use",function(t){var e=this;if(Ac(e))throw new Gh("a disposed stack can not use anything new");return Tm(lt.get(e,"[[DisposeCapability]]"),t,"ASYNC-DISPOSE"),t});ua(Dt.prototype,"adopt",function(t,e){var r=this;if(Ac(r))throw new Gh("a disposed stack can not use anything new");if(!zy(e))throw new $m("`onDisposeAsync` must be a function");var i=function(){return x4(e,void 0,[t])};return i.value=t,Tm(lt.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),t});ua(Dt.prototype,"defer",function(t){var e=this;if(Ac(e))throw new Gh("a disposed stack can not defer anything new");if(!zy(t))throw new $m("`onDispose` must be a function");Tm(lt.get(e,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",t)});ua(Dt.prototype,"move",function(){var t=this;if(Ac(t))throw new Gh("a disposed stack can not use anything new");var e=new Dt;return lt.set(e,"[[DisposeCapability]]",lt.get(t,"[[DisposeCapability]]")),lt.set(t,"[[DisposeCapability]]",Uy()),Hy(t),e});Q0&&ua(Dt.prototype,Q0,Dt.prototype.disposeAsync);O4(Dt.prototype,"AsyncDisposableStack");var U4=Dt,F4=U4,Z4=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:F4},H4=Ss,V4=nm(),B4=Z4,q4=function(){var t=B4();return H4(V4,{AsyncDisposableStack:t},{AsyncDisposableStack:!0}),t},j4=HA,W4=JA,G4=R4,Y4=q4,J4=function(){j4(),W4(),G4(),Y4()};J4();const ev=new WeakMap;function K4(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function Os(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function tv(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function X4(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class Q4{constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw tv();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw tv();if(e.constructor.name==="AsyncFunction")throw X4();this.storeFactory(t,e)}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.factory)!==void 0}resolve(t){return this.resolveAny(t)}storeFactory(t,e){const r=this.getOrCreateEntry(t);r.factory=e,r.instance=void 0,r.error=void 0}validateClassRegistration(t){const e=ev.get(t);if(e){if(t.length!==e.length)throw new Error(`${Os(t)} cannot be registered with register(Class). @injectable(...) declared ${e.length} dependencies but constructor arity is ${t.length}. Use register(Key, () => value) instead.`);return}if(t.length!==0)throw new Error(`${Os(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=ev.get(t);if(!e)return new t;const r=e.map(i=>this.resolveAny(i));return new t(...r)}resolveAny(t){return this.getOrCreateEntry(t).proxy}getOrCreateEntry(t){let e=this.entries.get(t);return e||(e={key:t},e.proxy=this.createProxy(e),this.entries.set(t,e),e)}createProxy(t){return new Proxy({},{get:(e,r)=>{if(r==="then")return;const i=this.getInstance(t),s=Reflect.get(i,r,i);return typeof s=="function"?s.bind(i):s},set:(e,r,i)=>{const s=this.getInstance(t);return Reflect.set(s,r,i,s)},has:(e,r)=>{const i=this.getInstance(t);return r in i}})}getInstance(t){if(t.instance)return t.instance;if(t.error)throw t.error;if(!t.factory)throw new Error(`${Os(t.key)} was resolved but never registered`);const e=this.constructionStack.indexOf(t.key);if(e!==-1){const r=[...this.constructionStack.slice(e),t.key].map(i=>Os(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if(K4(r))throw new Error(`Factory for ${Os(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${Os(t.key)} returned a non-object value. Wrap primitives in an object.`);return t.instance=r,r}catch(r){throw t.error=r,r}finally{this.constructionStack.pop()}}}const Vy=new Q4,eC=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function tC(n){for(const t of Object.keys(n))if(eC.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function nC(n,t){tC(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Nt(){class n extends Event{constructor(e,r){const{type:i,bubbles:s,cancelable:a,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(e,{bubbles:s,cancelable:a,composed:l}),nC(this,c)}}return n}class di extends globalThis.EventTarget{}const rC="X-Television-Client-Meta",iC="telemetry-activity",sC="telemetry-signal",By={kind:"single",full_screen:!1},qy={width:560,height:740};function oC(n){return n.layout.flatMap(t=>t.artifactIds)}function aC(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const t=[];for(const[e,r]of n.entries())lC(r,e,t);return{valid:t.length===0,errors:t}}function sl(n){return n.flatMap(t=>t.artifactIds)}function Ep(n,t){return n.flatMap(e=>{if(!e.artifactIds.includes(t))return[e];const r=e.artifactIds.filter(i=>i!==t);return r.length===0?[]:[{...e,artifactIds:r}]})}function lC(n,t,e){if(!Yd(n)){e.push(`Page ${t} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&e.push(`Page ${t} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?e.push(`Page ${t} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&e.push(`Page ${t} artifact ids must be non-empty strings`),!Yd(n.geometry)){e.push(`Page ${t} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&e.push(`Page ${t} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){e.push(`Page ${t} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&e.push(`Page ${t} single geometry must include a boolean full_screen`),!Yd(n.size)){e.push(`Page ${t} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&e.push(`Page ${t} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&e.push(`Page ${t} size ${r} must be a finite positive number`)}}function Yd(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const xt=Nt(),fu=Nt(),nv=Nt(),cC=Nt(),uC=Nt(),hC=Nt();function jy(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const ha=jy("RequestError"),rv=jy("ValidationError"),dC=200,pC=300,Bc=401;class fC{constructor(t,e){C(this,"serverURL");C(this,"token");C(this,"onUnauthorized");C(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){var a;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),s=await mC(i);if(!i.ok||i.status<dC||i.status>=pC)throw i.status===Bc&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof s.error=="string"?s.error:i.statusText,i.status);return s}async requestVoid(t,e,r){var s;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Bc&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Jd(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===Bc&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Jd(r,r.statusText),r.status);return r.text()}async requestRawVoid(t,e,r){var s;const i=await this.request(t,e,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Bc&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Jd(i,i.statusText),i.status)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new ha(t,r)}async request(t,e,r,i){const s=`${this.serverURL}${e}`;try{return await fetch(s,{method:t,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[rC]=JSON.stringify(this.telemetryMeta)),Object.keys(e).length>0?e:void 0}}async function mC(n){try{return await n.json()}catch{const t=await n.text().catch(()=>"");return t?{message:t}:{}}}async function Jd(n,t){try{const e=await n.json();if(typeof e.error=="string")return e.error;if(typeof e.message=="string")return e.message}catch{}return t}function gC(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var Vn,dh,Wy;class vC{constructor(t){g(this,dh);g(this,Vn);d(this,Vn,t)}list(){return o(this,Vn).requestJSON("GET","/channels")}async get(t={}){const e=await h(this,dh,Wy).call(this,t.channelID);return o(this,Vn).requestJSON("GET",`/channels/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),o(this,Vn).requestJSON("POST","/channels",e)}update(t){const{channelID:e,...r}=t;return o(this,Vn).requestJSON("PATCH",`/channels/${encodeURIComponent(e)}`,r)}remove(t){return o(this,Vn).requestJSON("DELETE",`/channels/${encodeURIComponent(t.channelID)}`)}}Vn=new WeakMap,dh=new WeakSet,Wy=async function(t){if(t!==void 0)return t;const{channels:e}=await this.list();if(e.length===1)return e[0].id;throw e.length===0?new rv("channelID is required, but no channels exist."):new rv(`channelID is required when multiple channels exist. Available channels: ${gC(e)}`)};var Bn;class yC{constructor(t){g(this,Bn);d(this,Bn,t)}create(t){const e={kind:t.kind,title:t.title};switch(t.kind){case"path":e.path=t.path;break;case"url":e.url=t.url;break}return e.channelID=t.channelID,o(this,Bn).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.channelID!==void 0&&e.set("channelID",t.channelID);const r=e.toString();return o(this,Bn).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return o(this,Bn).requestJSON("GET",`/artifacts/${encodeURIComponent(t.artifactID)}`)}update(t){const e={};return t.title!==void 0&&(e.title=t.title),t.path!==void 0&&(e.path=t.path),t.url!==void 0&&(e.url=t.url),o(this,Bn).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return o(this,Bn).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}}Bn=new WeakMap;var so;class wC{constructor(t){g(this,so);d(this,so,t)}list(){return o(this,so).requestJSON("GET","/themes")}refresh(){return o(this,so).requestJSON("POST","/themes/refresh")}}so=new WeakMap;var oo;class bC{constructor(t){g(this,oo);d(this,oo,t)}get(t){return o(this,oo).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return o(this,oo).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}oo=new WeakMap;var Ci;class SC{constructor(t){g(this,Ci);d(this,Ci,t)}status(){return o(this,Ci).requestJSON("GET","/telemetry")}enable(){return o(this,Ci).requestJSON("POST","/telemetry/enable")}disable(){return o(this,Ci).requestJSON("POST","/telemetry/disable")}}Ci=new WeakMap;var $i;class _C{constructor(t){g(this,$i);d(this,$i,t)}get(){return o(this,$i).requestJSON("GET","/display")}patch(t){const e={};return t.focusedChannelId!==void 0&&(e.focusedChannelId=t.focusedChannelId),t.pinnedChannelIds!==void 0&&(e.pinnedChannelIds=t.pinnedChannelIds),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),t.appearanceMode!==void 0&&(e.appearanceMode=t.appearanceMode),t.themeJavaScriptConsentIds!==void 0&&(e.themeJavaScriptConsentIds=t.themeJavaScriptConsentIds),o(this,$i).requestVoid("PATCH","/display",e)}focus(t){return o(this,$i).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}$i=new WeakMap;var Ft;class AC{constructor(t,e={}){C(this,"channels");C(this,"artifacts");C(this,"display");C(this,"themes");C(this,"markdown");C(this,"telemetry");g(this,Ft);d(this,Ft,new fC(t,e)),this.channels=new vC(o(this,Ft)),this.artifacts=new yC(o(this,Ft)),this.display=new _C(o(this,Ft)),this.themes=new wC(o(this,Ft)),this.markdown=new bC(o(this,Ft)),this.telemetry=new SC(o(this,Ft))}health(){return o(this,Ft).requestJSON("GET","/health")}}Ft=new WeakMap;const Yu="0.0.0",kC=/^\d+\.\d+\.\d+$/,EC=3;function Yh(n){return kC.test(n)}function Rm(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<EC;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function CC(n,t){return n===Yu||t===Yu?!1:n!==t}const $C=400,TC=404,Gy=500,RC=600,IC={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ee,hl,dl,qn,Ce,le,Ti,Cr,Ri,jn,dt,ao,pl,P,nn,Cp,zs,Yy,$p,Jy,mu,Tp,Ky,Us,Xy,Un,Rp,Qy,Ee;class xC extends di{constructor(e){super();g(this,P);g(this,ee);g(this,hl);g(this,dl);g(this,qn,new Set);C(this,"pendingPageWrites",new Map);g(this,Ce,new Map);g(this,le,DC());g(this,Ti);g(this,Cr,!1);g(this,Ri,!1);g(this,jn,0);g(this,dt,!1);g(this,ao,()=>{if(o(this,dt))return;const e=o(this,ee).connection.status==="connected";e&&!o(this,Ri)?(d(this,Ri,!0),h(this,P,Xy).call(this)):!e&&o(this,Ri)&&(d(this,Ri,!1),d(this,jn,o(this,jn)+1)),h(this,P,Un).call(this)});g(this,pl,e=>{if(o(this,dt)||e.serverURL!==o(this,ee).connection.url)return;for(const i of o(this,qn))i.push(e.event);const r=e.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new nv("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){o(this,Cr)&&Ju(o(this,le),o(this,Ce),r.channelID,r.artifactID)&&h(this,P,Un).call(this),this.dispatchEvent(new cC("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new uC("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new hC("appearance-changed",{appearanceMode:r.appearanceMode})),o(this,Cr)&&(qc(o(this,le),r,this.pendingPageWrites,o(this,Ce)),Kd(o(this,le),o(this,Ce)),h(this,P,Un).call(this))});d(this,ee,e.connectionOwner),d(this,hl,e.navigationKeyHandler),d(this,dl,e.retainedGateHalted??(()=>!1)),d(this,Ti,h(this,P,Rp).call(this)),o(this,ee).addEventListener("change",o(this,ao)),o(this,ee).addEventListener("server-event",o(this,pl)),o(this,ao).call(this)}get snapshot(){return o(this,Ti)}handleNavigationKey(e){var r;h(this,P,Ee).call(this),(r=o(this,hl))==null||r.call(this,e)}authenticate(e){return h(this,P,Ee).call(this),o(this,ee).authenticate(e)}async createChannel(e){h(this,P,Ee).call(this);const{channel:r}=await h(this,P,nn).call(this,o(this,ee).connection.client.channels.create({name:e}),()=>h(this,P,Yy).call(this));return r}focusChannel(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({focusedChannelId:e}),()=>h(this,P,zs).call(this))}setPinnedChannelIds(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({pinnedChannelIds:[...e]}),()=>h(this,P,zs).call(this))}listThemes(){return h(this,P,Ee).call(this),o(this,ee).connection.client.themes.list()}refreshThemes(){return h(this,P,Ee).call(this),o(this,ee).connection.client.themes.refresh()}setActiveTheme(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({activeThemeName:e}),()=>h(this,P,zs).call(this))}setAppearanceMode(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({appearanceMode:e}),()=>h(this,P,zs).call(this))}setThemeJavaScriptConsent(e,r){h(this,P,Ee).call(this);const i=o(this,le).display.themeJavaScriptConsentIds,s=r?i.includes(e)?[...i]:[...i,e]:i.filter(a=>a!==e);return h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({themeJavaScriptConsentIds:s}),()=>h(this,P,zs).call(this))}selectPage(e,r){h(this,P,Ee).call(this),Ju(o(this,le),o(this,Ce),e,r)&&h(this,P,Un).call(this)}async renameChannel(e,r){h(this,P,Ee).call(this),await h(this,P,nn).call(this,o(this,ee).connection.client.channels.update({channelID:e,name:r}),()=>h(this,P,$p).call(this,e))}async deleteChannel(e){h(this,P,Ee).call(this),await h(this,P,nn).call(this,o(this,ee).connection.client.channels.remove({channelID:e}),()=>h(this,P,Jy).call(this,e))}updateChannelPages(e,r){h(this,P,Ee).call(this);const i=aC(r),s=o(this,le).channels.get(e);if(!i.valid||!s)return Promise.resolve();const a=Ai(r),l=Ai(s.channel.layout),c={previousPages:l};return vs(o(this,Ce),e,l,a),s.channel={...s.channel,layout:a},this.pendingPageWrites.set(e,c),h(this,P,Un).call(this),o(this,ee).connection.client.channels.update({channelID:e,layout:Ai(a)}).then(()=>{this.pendingPageWrites.get(e)===c&&this.pendingPageWrites.delete(e)},async u=>{if(o(this,dt))throw u;const p=this.pendingPageWrites.get(e)===c;if(p&&this.pendingPageWrites.delete(e),sv(u))throw await h(this,P,Cp).call(this,()=>h(this,P,$p).call(this,e)),u;if(!p||!UC(u))throw u;const m=o(this,le).channels.get(e);if(!m)throw u;const v=Ai(c.previousPages);throw vs(o(this,Ce),e,m.channel.layout,v),m.channel={...m.channel,layout:v},h(this,P,Un).call(this),u})}async deleteArtifact(e){h(this,P,Ee).call(this);const r=ov(o(this,le),e);await h(this,P,nn).call(this,o(this,ee).connection.client.artifacts.delete({artifactID:e}),()=>h(this,P,Ky).call(this,e,r))}readMarkdown(e){return h(this,P,Ee).call(this),o(this,ee).connection.client.markdown.get({artifactID:e})}writeMarkdown(e,r){return h(this,P,Ee).call(this),o(this,ee).connection.client.markdown.update({artifactID:e,content:r})}getArtifactViewURL(e){return h(this,P,Ee).call(this),o(this,ee).connection.getViewURL(e)}getArtifactContentURL(e){return h(this,P,Ee).call(this),o(this,ee).connection.getContentURL(e)}dispose(){o(this,dt)||(d(this,dt,!0),d(this,jn,o(this,jn)+1),o(this,qn).clear(),this.pendingPageWrites.clear(),o(this,Ce).clear(),o(this,ee).removeEventListener("change",o(this,ao)),o(this,ee).removeEventListener("server-event",o(this,pl)))}}ee=new WeakMap,hl=new WeakMap,dl=new WeakMap,qn=new WeakMap,Ce=new WeakMap,le=new WeakMap,Ti=new WeakMap,Cr=new WeakMap,Ri=new WeakMap,jn=new WeakMap,dt=new WeakMap,ao=new WeakMap,pl=new WeakMap,P=new WeakSet,nn=async function(e,r){try{return await e}catch(i){throw!o(this,dt)&&sv(i)&&await h(this,P,Cp).call(this,r),i}},Cp=async function(e){try{await e()}catch{}},zs=function(){const e=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>e.display.get(),r=>h(this,P,mu).call(this,r))},Yy=function(){const e=o(this,ee).connection.client;return h(this,P,Us).call(this,async()=>{const[{channels:r},i]=await Promise.all([e.channels.list(),e.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const s=new Set(r.map(({id:a})=>a));for(const a of o(this,le).channels.keys())s.has(a)||(this.pendingPageWrites.delete(a),o(this,Ce).delete(a),o(this,le).channels.delete(a));for(const a of r)o(this,le).channels.has(a.id)||o(this,le).channels.set(a.id,{channel:ro(a),artifacts:new Map});h(this,P,mu).call(this,i)})},$p=function(e){const r=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>Xd(()=>r.channels.get({channelID:e})),i=>h(this,P,Tp).call(this,e,i))},Jy=function(e){const r=o(this,ee).connection.client;return h(this,P,Us).call(this,async()=>{const[i,s]=await Promise.all([Xd(()=>r.channels.get({channelID:e})),r.display.get()]);return{detail:i,display:s}},({detail:i,display:s})=>{h(this,P,Tp).call(this,e,i),h(this,P,mu).call(this,s)})},mu=function(e){o(this,le).display=xp(e),o(this,ee).connection.acpClient.setEnabled(e.acpEnabled)},Tp=function(e,r){this.pendingPageWrites.delete(e);const i=o(this,le).channels.get(e);if(r===null){o(this,Ce).delete(e),o(this,le).channels.delete(e);return}vs(o(this,Ce),e,(i==null?void 0:i.channel.layout)??[],r.channel.layout),o(this,le).channels.set(e,{channel:ro(r.channel),artifacts:new Map(r.artifacts.map(s=>[s.id,structuredClone(s)]))})},Ky=function(e,r){const i=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>Xd(()=>i.artifacts.get({artifactID:e})),s=>{const a=ov(o(this,le),e)??r;if(s===null){a!==null&&qc(o(this,le),{type:"artifact-removed",channelID:a,artifactID:e},this.pendingPageWrites,o(this,Ce));return}const l=a===null?void 0:o(this,le).channels.get(a);l==null||l.artifacts.set(e,structuredClone(s.artifact))})},Us=async function(e,r){const i=o(this,jn),s=[];o(this,qn).add(s);try{const a=await e();if(o(this,dt)||i!==o(this,jn))return;r(a);for(const l of s)qc(o(this,le),l,this.pendingPageWrites,o(this,Ce));Kd(o(this,le),o(this,Ce)),h(this,P,Un).call(this)}finally{o(this,qn).delete(s)}},Xy=async function(){const e=++Nc(this,jn)._,r=o(this,ee).connection,i=r.client,s=[];o(this,qn).add(s);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:m})=>i.channels.get({channelID:m})));if(o(this,dt)||e!==o(this,jn))return;const u={channels:new Map,display:xp(l)};for(const m of c)u.channels.set(m.channel.id,{channel:ro(m.channel),artifacts:new Map(m.artifacts.map(v=>[v.id,structuredClone(v)]))});OC(o(this,Ce),o(this,le),u);for(const m of s)qc(u,m,this.pendingPageWrites,o(this,Ce));Kd(u,o(this,Ce));const p=o(this,Cr)?PC(o(this,le),u):[];this.pendingPageWrites.clear(),d(this,le,u),d(this,Cr,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,P,Un).call(this);for(const m of p)this.dispatchEvent(new nv("artifact-content-changed",{artifactID:m}))}catch{}finally{o(this,qn).delete(s)}},Un=function(){o(this,dt)||(d(this,Ti,h(this,P,Rp).call(this)),h(this,P,Qy).call(this),this.dispatchEvent(new xt("change")))},Rp=function(){var s;const e=[...o(this,le).channels.values()].map(a=>NC(a,o(this,Ce).get(a.channel.id))),r=e.find(({id:a})=>a===o(this,le).display.focusedChannelId)??null,i=o(this,ee).connection;return Object.freeze({ready:o(this,Cr),channels:Object.freeze(e),display:zC(o(this,le).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||o(this,dl).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:o(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:LC(((s=i.updateState)==null?void 0:s.desktop)??null)})})},Qy=function(){const e=o(this,Ti).focusedChannel;o(this,ee).connection.acpClient.setChannelContext(e?{channelID:e.id,channelName:e.name}:null)},Ee=function(){if(o(this,dt))throw new Error("ApplicationService is disposed")};function PC(n,t){const e=t.display.focusedChannelId;if(e===null||n.display.focusedChannelId!==e)return[];const r=n.channels.get(e),i=t.channels.get(e);if(!r||!i)return[];const s=new Set(sl(r.channel.layout));return sl(i.channel.layout).filter(a=>{var l,c;return s.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function LC(n){return n===null?null:Object.freeze({...n})}function DC(){return{channels:new Map,display:xp(IC)}}function qc(n,t,e,r){switch(t.type){case"channel-created":r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ro(t.channel),artifacts:new Map});return;case"channel-updated":{e.delete(t.channel.id);const i=n.channels.get(t.channel.id);if(!i){r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ro(t.channel),artifacts:new Map});return}vs(r,t.channel.id,i.channel.layout,t.channel.layout);const s=new Set(sl(t.channel.layout));i.channel=ro(t.channel);for(const a of i.artifacts.keys())s.has(a)||i.artifacts.delete(a);return}case"channel-removed":e.delete(t.channelID),r.delete(t.channelID),n.channels.delete(t.channelID);return;case"channel-changed":n.display.focusedChannelId=t.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...t.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=t.themeName,n.display.activeThemeColorScheme=t.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...t.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=t.appearanceMode;return;case"artifact-created":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);if(s&&(s.previousPages=iv(s.previousPages,t.artifact.id)),!sl(i.channel.layout).includes(t.artifact.id)){const a=i.channel.layout,l=iv(a,t.artifact.id);vs(r,t.channelID,a,l),i.channel={...i.channel,layout:l}}i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(t.artifact.id)){i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}return;case"artifact-removed":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);s&&(s.previousPages=Ep(s.previousPages,t.artifactID)),i.artifacts.delete(t.artifactID);const a=i.channel.layout,l=Ep(a,t.artifactID);vs(r,t.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Ju(n,r,t.channelID,t.artifactID);return;case"artifact-content-changed":return;default:return FC(t)}}function OC(n,t,e){var r;for(const i of n.keys())e.channels.has(i)||n.delete(i);for(const[i,s]of e.channels)vs(n,i,((r=t.channels.get(i))==null?void 0:r.channel.layout)??[],s.channel.layout)}function vs(n,t,e,r){const i=n.get(t);if(i===void 0)return;if(r.length===0){n.delete(t);return}const s=Ip(r,i);if(s!==-1){n.set(t,[...r[s].artifactIds]);return}const a=Ip(e,i),l=a===-1?0:Math.min(a,r.length-1);n.set(t,[...r[l].artifactIds])}function Ju(n,t,e,r){const i=n.channels.get(e),s=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!s)return!1;const a=t.get(e);return a&&MC(a,s.artifactIds)?!1:(t.set(e,[...s.artifactIds]),!0)}function Kd(n,t){var i,s;const e=n.display.focusedChannelId;if(e===null||t.has(e))return;const r=(s=(i=n.channels.get(e))==null?void 0:i.channel.layout[0])==null?void 0:s.artifactIds[0];r!==void 0&&Ju(n,t,e,r)}function Ip(n,t){const e=new Set(t);return n.findIndex(r=>r.artifactIds.some(i=>e.has(i)))}function MC(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function NC(n,t){const e=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=t===void 0?0:Ip(n.channel.layout,t),i=e[r]??e[0]??null,s=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:e,selectedPage:i,artifacts:s};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function zC(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function iv(n,t){return sl(n).includes(t)?Ai(n):[...Ai(n),{artifactIds:[t],geometry:{...By},size:{...qy}}]}function UC(n){return n instanceof ha&&n.status!==void 0&&n.status>=$C&&n.status<Gy}function sv(n){return n instanceof ha&&(n.status===void 0||n.status>=Gy&&n.status<RC)}async function Xd(n){try{return await n()}catch(t){if(t instanceof ha&&t.status===TC)return null;throw t}}function ov(n,t){for(const[e,r]of n.channels)if(r.artifacts.has(t))return e;return null}function Ai(n){return n.map(t=>({artifactIds:[...t.artifactIds],geometry:{...t.geometry},size:{...t.size}}))}function ro(n){return{id:n.id,name:n.name,layout:Ai(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function xp(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function FC(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function ZC(n,t){var c;const e=n.snapshot,r=e.focusedChannel;if(t==="ArrowLeft"||t==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),p=u+(t==="ArrowLeft"?-1:1),m=(c=r.pages[p])==null?void 0:c.artifactIds[0];return u===-1||m===void 0?!1:(av(),n.selectPage(r.id,m),!0)}const i=HC(e),s=r===null?-1:i.indexOf(r.id),a=s+(t==="ArrowUp"?-1:1),l=i[a];return s===-1||l===void 0?!1:(av(),n.focusChannel(l).catch(()=>{}),!0)}function HC(n){const t=new Map(n.channels.map(s=>[s.id,s])),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,a)=>a.localeCompare(s));return[...e,...i]}function av(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const ew="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ku=32,VC=16,tw=10,lv=0xffffffffffff;var ki;(function(n){n.Base32IncorrectEncoding="B32_ENC_INVALID",n.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",n.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",n.EncodeTimeNegative="ENC_TIME_NEG",n.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",n.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",n.PRNGDetectFailure="PRNG_DETECT",n.ULIDInvalid="ULID_INVALID",n.Unexpected="UNEXPECTED",n.UUIDInvalid="UUID_INVALID"})(ki||(ki={}));class Oa extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function BC(n){const t=Math.floor(n()*Ku)%Ku;return ew.charAt(t)}function qC(n){const t=jC(),e=t&&(t.crypto||t.msCrypto)||null;if(typeof(e==null?void 0:e.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]/256};if(typeof(e==null?void 0:e.randomBytes)=="function")return()=>e.randomBytes(1).readUInt8()/256;throw new Oa(ki.PRNGDetectFailure,"Failed to find a reliable PRNG")}function jC(){return YC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function WC(n,t){let e="";for(;n>0;n--)e=BC(t)+e;return e}function GC(n,t=tw){if(isNaN(n))throw new Oa(ki.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>lv)throw new Oa(ki.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${lv}: ${n}`);if(n<0)throw new Oa(ki.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Oa(ki.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%Ku,r=ew.charAt(e)+r,n=(n-e)/Ku;return r}function YC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Im(n,t){const e=qC(),r=Date.now();return GC(r,tw)+WC(VC,e)}const Ma=Nt(),nw=Nt(),rw=Nt(),JC=Nt(),Qd=Nt(),KC="store-";function oi(n){return new URL(n).origin}function XC(){return{authTokens:{}}}var Ii,xi,Pi;class QC extends di{constructor(e,r,i={}){super();g(this,Ii);g(this,xi);g(this,Pi);d(this,Ii,`${KC}${e}`),d(this,xi,i.storage??t$());const s=o(this,xi).getItem(o(this,Ii));s===null?(d(this,Pi,r),o(this,xi).setItem(o(this,Ii),JSON.stringify(r))):d(this,Pi,n$(JSON.parse(s),r))}get(){return o(this,Pi)}set(e){d(this,Pi,e),o(this,xi).setItem(o(this,Ii),JSON.stringify(e)),this.dispatchEvent(new xt("change"))}}Ii=new WeakMap,xi=new WeakMap,Pi=new WeakMap;function cv(n,t){return n.authTokens[oi(t)]??null}function uv(n,t,e){return{authTokens:{...n.authTokens,[oi(t)]:e}}}function e$(n,t){const e=oi(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{authTokens:r}}function t$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function n$(n,t){if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n.authTokens;if(typeof e!="object"||e===null||Array.isArray(e))return t;const r={};for(const[i,s]of Object.entries(e))if(typeof s=="string")try{r[oi(i)]=s}catch{}return{authTokens:r}}function E(n,t,e){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),t(l,c);const u=a.prototype,p=Object.keys(u);for(let m=0;m<p.length;m++){const v=p[m];v in l||(l[v]=u[v].bind(l))}}const i=(e==null?void 0:e.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function a(l){var c;const u=e!=null&&e.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,u;return e!=null&&e.Parent&&l instanceof e.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class io extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class iw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const sw={};function ai(n){return sw}function ow(n){const t=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Pp(n,t){return typeof t=="bigint"?t.toString():t}function Jh(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function xm(n){return n==null}function Pm(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function r$(n,t){const e=(n.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=e>i?e:i,a=Number.parseInt(n.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return a%l/10**s}const hv=Symbol("evaluating");function ce(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==hv)return r===void 0&&(r=hv,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function As(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function pi(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function dv(n){return JSON.stringify(n)}function i$(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const aw="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function ol(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const s$=Jh(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Qo(n){if(ol(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(ol(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function lw(n){return Qo(n)?{...n}:Array.isArray(n)?[...n]:n}const o$=new Set(["string","number","symbol"]);function ea(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fi(n,t,e){const r=new n._zod.constr(t??n._zod.def);return(!t||e!=null&&e.parent)&&(r._zod.parent=n),r}function U(n){const t=n;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function a$(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const l$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function c$(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=pi(n._zod.def,{get shape(){const a={};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=e.shape[l])}return As(this,"shape",a),a},checks:[]});return fi(n,s)}function u$(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=pi(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return As(this,"shape",a),a},checks:[]});return fi(n,s)}function h$(n,t){if(!Qo(t))throw new Error("Invalid input to extend: expected a plain object");const e=n._zod.def.checks;if(e&&e.length>0){const s=n._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=pi(n._zod.def,{get shape(){const s={...n._zod.def.shape,...t};return As(this,"shape",s),s}});return fi(n,i)}function d$(n,t){if(!Qo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=pi(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return As(this,"shape",r),r}});return fi(n,e)}function p$(n,t){const e=pi(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return As(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return fi(n,e)}function f$(n,t,e){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=pi(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(e)for(const u in e){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return As(this,"shape",c),c},checks:[]});return fi(t,a)}function m$(n,t,e){const r=pi(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(e)for(const a in e){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new n({type:"nonoptional",innerType:i[a]});return As(this,"shape",s),s}});return fi(t,r)}function Xs(n,t=0){var e;if(n.aborted===!0)return!0;for(let r=t;r<n.issues.length;r++)if(((e=n.issues[r])==null?void 0:e.continue)!==!0)return!0;return!1}function Qs(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function jc(n){return typeof n=="string"?n:n==null?void 0:n.message}function li(n,t,e){var i,s,a,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const p=jc((a=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,n))??jc((l=t==null?void 0:t.error)==null?void 0:l.call(t,n))??jc((c=e.customError)==null?void 0:c.call(e,n))??jc((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=p}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Lm(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function al(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const cw=(n,t)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:t,enumerable:!1}),n.message=JSON.stringify(t,Pp,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},uw=E("$ZodError",cw),hw=E("$ZodError",cw,{Parent:Error});function g$(n,t=e=>e.message){const e={},r=[];for(const i of n.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}function v$(n,t=e=>e.message){const e={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)e._errors.push(t(s));else{let a=e,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),e}const Dm=n=>(t,e,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:e,issues:[]},s);if(a instanceof Promise)throw new io;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>li(c,s,ai())));throw aw(l,i==null?void 0:i.callee),l}return a.value},Om=n=>async(t,e,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:e,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>li(c,s,ai())));throw aw(l,i==null?void 0:i.callee),l}return a.value},Kh=n=>(t,e,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:e,issues:[]},i);if(s instanceof Promise)throw new io;return s.issues.length?{success:!1,error:new(n??uw)(s.issues.map(a=>li(a,i,ai())))}:{success:!0,data:s.value}},y$=Kh(hw),Xh=n=>async(t,e,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:e,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new n(s.issues.map(a=>li(a,i,ai())))}:{success:!0,data:s.value}},w$=Xh(hw),b$=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Dm(n)(t,e,i)},S$=n=>(t,e,r)=>Dm(n)(t,e,r),_$=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Om(n)(t,e,i)},A$=n=>async(t,e,r)=>Om(n)(t,e,r),k$=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Kh(n)(t,e,i)},E$=n=>(t,e,r)=>Kh(n)(t,e,r),C$=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xh(n)(t,e,i)},$$=n=>async(t,e,r)=>Xh(n)(t,e,r),T$=/^[cC][^\s-]{8,}$/,R$=/^[0-9a-z]+$/,I$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,x$=/^[0-9a-vA-V]{20}$/,P$=/^[A-Za-z0-9]{27}$/,L$=/^[a-zA-Z0-9_-]{21}$/,D$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,O$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,pv=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,M$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,N$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function z$(){return new RegExp(N$,"u")}const U$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,F$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Z$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,H$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,dw=/^[A-Za-z0-9_-]*$/,B$=/^\+[1-9]\d{6,14}$/,pw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",q$=new RegExp(`^${pw}$`);function fw(n){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${t}`:n.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${n.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function j$(n){return new RegExp(`^${fw(n)}$`)}function W$(n){const t=fw({precision:n.precision}),e=["Z"];n.local&&e.push(""),n.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${e.join("|")})`;return new RegExp(`^${pw}T(?:${r})$`)}const G$=n=>{const t=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},Y$=/^-?\d+$/,mw=/^-?\d+(?:\.\d+)?$/,J$=/^(?:true|false)$/i,K$=/^[^A-Z]*$/,X$=/^[^a-z]*$/,ut=E("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),gw={number:"number",bigint:"bigint",object:"date"},vw=E("$ZodCheckLessThan",(n,t)=>{ut.init(n,t);const e=gw[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:e,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),yw=E("$ZodCheckGreaterThan",(n,t)=>{ut.init(n,t);const e=gw[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:e,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),Q$=E("$ZodCheckMultipleOf",(n,t)=>{ut.init(n,t),n._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),n._zod.check=e=>{if(typeof e.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof e.value=="bigint"?e.value%t.value===BigInt(0):r$(e.value,t.value)===0)||e.issues.push({origin:typeof e.value,code:"not_multiple_of",divisor:t.value,input:e.value,inst:n,continue:!t.abort})}}),eT=E("$ZodCheckNumberFormat",(n,t)=>{var a;ut.init(n,t),t.format=t.format||"float64";const e=(a=t.format)==null?void 0:a.includes("int"),r=e?"int":"number",[i,s]=l$[t.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,e&&(c.pattern=Y$)}),n._zod.check=l=>{const c=l.value;if(e){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!t.abort})}}),tT=E("$ZodCheckMaxLength",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!xm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=Lm(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),nT=E("$ZodCheckMinLength",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!xm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=Lm(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),rT=E("$ZodCheckLengthEquals",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!xm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),n._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const a=Lm(i),l=s>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),Qh=E("$ZodCheckStringFormat",(n,t)=>{var e,r;ut.init(n,t),n._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(e=n._zod).check??(e.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:n,continue:!t.abort})}):(r=n._zod).check??(r.check=()=>{})}),iT=E("$ZodCheckRegex",(n,t)=>{Qh.init(n,t),n._zod.check=e=>{t.pattern.lastIndex=0,!t.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:"regex",input:e.value,pattern:t.pattern.toString(),inst:n,continue:!t.abort})}}),sT=E("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=K$),Qh.init(n,t)}),oT=E("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=X$),Qh.init(n,t)}),aT=E("$ZodCheckIncludes",(n,t)=>{ut.init(n,t);const e=ea(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${e}`:e);t.pattern=r,n._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),n._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:n,continue:!t.abort})}}),lT=E("$ZodCheckStartsWith",(n,t)=>{ut.init(n,t);const e=new RegExp(`^${ea(t.prefix)}.*`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:n,continue:!t.abort})}}),cT=E("$ZodCheckEndsWith",(n,t)=>{ut.init(n,t);const e=new RegExp(`.*${ea(t.suffix)}$`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:n,continue:!t.abort})}}),uT=E("$ZodCheckOverwrite",(n,t)=>{ut.init(n,t),n._zod.check=e=>{e.value=t.tx(e.value)}});class hT{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
4
+ `+t.prev}function Fc(n,t){var e=kp(n),r=[];if(e){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=Zn(n,i)?t(n[i],n):""}var s=typeof Zd=="function"?Zd(n):[],a;if(Xo){a={};for(var l=0;l<s.length;l++)a["$"+s[l]]=s[l]}for(var c in n)Zn(n,c)&&(e&&String(Number(c))===c&&c<n.length||Xo&&a["$"+c]instanceof Symbol||(Ay.call(/[^\w$]/,c)?r.push(t(c,n)+": "+t(n[c],n)):r.push(c+": "+t(n[c],n))));if(typeof Zd=="function")for(var u=0;u<s.length;u++)ky.call(n,s[u])&&r.push("["+t(s[u])+"]: "+t(n[s[u]],n));return r}var Nk=la,zk=te,qh=function(n,t,e){for(var r=n,i;(i=r.next)!=null;r=i)if(i.key===t)return r.next=i.next,e||(i.next=n.next,n.next=i),i},Uk=function(n,t){if(n){var e=qh(n,t);return e&&e.value}},Fk=function(n,t,e){var r=qh(n,t);r?r.value=e:n.next={key:t,next:n.next,value:e}},Zk=function(n,t){return n?!!qh(n,t):!1},Hk=function(n,t){if(n)return qh(n,t,!0)},Vk=function(){var t,e={assert:function(r){if(!e.has(r))throw new zk("Side channel does not contain "+Nk(r))},delete:function(r){var i=Hk(t,r);return i&&t&&!t.next&&(t=void 0),!!i},get:function(r){return Uk(t,r)},has:function(r){return Zk(t,r)},set:function(r,i){t||(t={next:void 0}),Fk(t,r,i)}};return e},Bk=Mt,bc=ui(),qk=la,jk=te,I0=Bk("%Map%",!0),Wk=bc("Map.prototype.get",!0),Gk=bc("Map.prototype.set",!0),Yk=bc("Map.prototype.has",!0),Jk=bc("Map.prototype.delete",!0),Kk=bc("Map.prototype.size",!0),Iy=!!I0&&function(){var t,e={assert:function(r){if(!e.has(r))throw new jk("Side channel does not contain "+qk(r))},delete:function(r){if(t){var i=Jk(t,r);return Kk(t)===0&&(t=void 0),i}return!1},get:function(r){if(t)return Wk(t,r)},has:function(r){return t?Yk(t,r):!1},set:function(r,i){t||(t=new I0),Gk(t,r,i)}};return e},Xk=Mt,jh=ui(),Qk=la,Zc=Iy,eE=te,Ds=Xk("%WeakMap%",!0),tE=jh("WeakMap.prototype.get",!0),nE=jh("WeakMap.prototype.set",!0),rE=jh("WeakMap.prototype.has",!0),iE=jh("WeakMap.prototype.delete",!0),sE=Ds?function(){var t,e,r={assert:function(i){if(!r.has(i))throw new eE("Side channel does not contain "+Qk(i))},delete:function(i){if(Ds&&i&&(typeof i=="object"||typeof i=="function")){if(t)return iE(t,i)}else if(Zc&&e)return e.delete(i);return!1},get:function(i){return Ds&&i&&(typeof i=="object"||typeof i=="function")&&t?tE(t,i):e&&e.get(i)},has:function(i){return Ds&&i&&(typeof i=="object"||typeof i=="function")&&t?rE(t,i):!!e&&e.has(i)},set:function(i,s){Ds&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Ds),nE(t,i,s)):Zc&&(e||(e=Zc()),e.set(i,s))}};return r}:Zc,oE=te,aE=la,lE=Vk,cE=Iy,uE=sE,hE=uE||cE||lE,dE=function(){var t,e={assert:function(r){if(!e.has(r)){var i=r&&Object(r)===r?"the given object key":aE(r);throw new oE("Side channel does not contain "+i)}},delete:function(r){return!!t&&t.delete(r)},get:function(r){return t&&t.get(r)},has:function(r){return!!t&&t.has(r)},set:function(r,i){t||(t=hE()),t.set(r,i)}};return e},pE=yr,_a=dE(),Nn=te,bm={assert:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");if(_a.assert(n),!bm.has(n,t))throw new Nn("`"+t+"` is not present on `O`")},get:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var e=_a.get(n);return e&&e["$"+t]},has:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var e=_a.get(n);return!!e&&pE(e,"$"+t)},set:function(n,t,e){if(!n||typeof n!="object"&&typeof n!="function")throw new Nn("`O` is not an object");if(typeof t!="string")throw new Nn("`slot` must be a string");var r=_a.get(n);r||(r={},_a.set(n,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(bm);var Sm=bm,xy=gr,si=Sm,Sc=function n(t,e){if(!(this instanceof n))return new n(t,e);if(t!=="normal"&&t!=="break"&&t!=="continue"&&t!=="return"&&t!=="throw")throw new xy('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');si.set(this,"[[Type]]",t),si.set(this,"[[Value]]",e)};Sc.prototype.type=function(){return si.get(this,"[[Type]]")};Sc.prototype.value=function(){return si.get(this,"[[Value]]")};Sc.prototype["?"]=function(){var t=si.get(this,"[[Type]]"),e=si.get(this,"[[Value]]");if(t==="throw")throw e;return e};Sc.prototype["!"]=function(){var t=si.get(this,"[[Type]]");if(t!=="normal")throw new xy('Assertion failed: Completion Record is not of type "normal"');return si.get(this,"[[Value]]")};var _m=Sc,fE=_m,Am=function(t){return new fE("normal",t)},Vd,x0;function mE(){if(x0)return Vd;x0=1;var n=ia;return Vd=function(){return n()&&!!Symbol.toStringTag},Vd}var gE=Mt,P0=gE("%Object.defineProperty%",!0),vE=mE()(),yE=yr,wE=te,Hc=vE?Symbol.toStringTag:null,Py=function(t,e){var r=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof r<"u"&&typeof r!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new wE("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Hc&&(r||!yE(t,Hc))&&(P0?P0(t,Hc,{configurable:!i,enumerable:!1,value:e,writable:!1}):t[Hc]=e)},Ly={exports:{}},bE=Mt,L0=J1,SE=Hh(),D0=ra,O0=te,_E=bE("%Math.floor%"),AE=function(t,e){if(typeof t!="function")throw new O0("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||_E(e)!==e)throw new O0("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&D0){var a=D0(t,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(s=!1)}return(i||s||!r)&&(SE?L0(t,"length",e,!0,!0):L0(t,"length",e)),t},kE=mc,EE=um,CE=ay,$E=function(){return CE(kE,EE,arguments)};(function(n){var t=AE,e=fc,r=Vh,i=$E;n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return t(l,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(Ly);var km=Ly.exports,TE=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0},RE=Object,IE=function(t){return t&&typeof t=="object"&&(typeof t["[[ResourceValue]]"]>"u"||RE(t["[[ResourceValue]]"])===t["[[ResourceValue]]"])&&(t["[[Hint]]"]==="SYNC-DISPOSE"||t["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof t["[[DisposeMethod]]"]=="function"||typeof t["[[DisposeMethod]]"]>"u")},xE=yr,PE=hm(),LE=TE,DE=IE,OE=function(t){return t&&typeof t=="object"&&xE(t,"[[DisposableResourceStack]]")&&PE(t["[[DisposableResourceStack]]"])&&(t["[[DisposableResourceStack]]"].length===0||LE(t["[[DisposableResourceStack]]"],DE))},ME=vr,NE=function(t){if(t===null)return"Null";if(typeof t>"u")return"Undefined";if(ME(t))return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"},zE=NE,Em=function(t){return typeof t=="symbol"?"Symbol":typeof t=="bigint"?"BigInt":zE(t)},UE=te,FE=la,ZE=oa,HE=function(t,e){if(!ZE(e))throw new UE("Assertion failed: P is not a Property Key, got "+FE(e));return t[e]},M0=te,VE=HE,BE=aa,qE=oa,N0=la,jE=function(t,e){if(!qE(e))throw new M0("Assertion failed: P is not a Property Key");var r=VE(t,e);if(r!=null){if(!BE(r))throw new M0(N0(e)+" is not a function: "+N0(r));return r}},Cp={exports:{}},WE=Mt,GE=WE,z0=GE("%Reflect.construct%",!0),Gu=wc;try{Gu({},"",{"[[Get]]":function(){}})}catch{Gu=null}if(Gu&&z0){var U0={},F0={};Gu(F0,"length",{"[[Get]]":function(){throw U0},"[[Enumerable]]":!0}),Cp.exports=function(t){try{z0(t,F0)}catch(e){return e===U0}}}else Cp.exports=function(t){return typeof t=="function"&&!!t.prototype};var YE=Cp.exports,Bd=te,Z0=aa,JE=YE,KE=function(t){if(!JE(t))throw new Bd("C must be a constructor");var e={"[[Resolve]]":void 0,"[[Reject]]":void 0},r=new t(function(i,s){if(typeof e["[[Resolve]]"]<"u"||typeof e["[[Reject]]"]<"u")throw new Bd("executor has already been called");e["[[Resolve]]"]=i,e["[[Reject]]"]=s});if(!Z0(e["[[Resolve]]"])||!Z0(e["[[Reject]]"]))throw new Bd("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":e["[[Resolve]]"],"[[Reject]]":e["[[Reject]]"]}},H0=gr,XE=te,qd=Bh,V0=jE,QE=KE,e4=Em,B0=mm(),q0=gm(),t4=function(t,e){if(e4(t)!=="Object")throw new XE("`V` must be an Object");if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new H0("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(e==="ASYNC-DISPOSE"&&q0&&(r=V0(t,q0)),!r){if(!B0)throw new H0("`Symbol.dispose` is not supported");if(r=V0(t,B0),typeof r<"u")return function(){var i=this;if(e==="ASYNC-DISPOSE"){var s=QE(Promise);try{qd(r,i),qd(s["[[Resolve]]"],void 0,[void 0])}catch(a){s["[[Reject]]"](a)}return s["[[Promise]]"]}qd(r,i)}}return r},n4=gr,jd=te,r4=aa,i4=Em,s4=t4,o4=function(t,e){if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new n4("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(arguments.length<3)if(t==null)t=void 0,r=void 0;else{if(typeof t<"u"&&i4(t)!=="Object")throw new jd("`V` must be an Object, or `null` or `undefined`");if(r=s4(t,e),typeof r>"u")throw new jd("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!r4(r))throw new jd("`method`, when provided, must be a function");return{"[[ResourceValue]]":t,"[[Hint]]":e,"[[DisposeMethod]]":r}},a4=gr,Vc=te,l4=OE,j0=o4,c4=ui(),u4=c4("Array.prototype.push"),Dy=function(t,e,r){if(!l4(t))throw new Vc("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new a4("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var i=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof i!="function")throw new Vc("Assertion failed: `method`, when present, must be a function");if(!t["[[DisposableResourceStack]]"])throw new Vc("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(e==null&&r==="SYNC_DISPOSE")return"UNUSED";s=j0(e,r)}else{if(typeof e<"u")throw new Vc("Assertion failed: `V` must be undefined when `method` is present");s=j0(void 0,r,i)}return u4(t["[[DisposableResourceStack]]"],s),"UNUSED"},Wd,W0;function Cm(){if(W0)return Wd;W0=1;var n=Mt,t=km,e=gr,r=n("%Promise.resolve%",!0),i=r&&t(r);return Wd=function(a,l){if(!i)throw new e("This environment does not support Promises.");return i(a,l)},Wd}var Gd,G0;function h4(){if(G0)return Gd;G0=1;var n=Mt,t=gr,e=n("%Promise%",!0),r=Bh,i=Cm(),s=Em;return Gd=function(l,c,u){if(typeof l<"u"&&s(l)!=="Object")throw new t("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new t("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new t("Assertion failed: `method` must be `undefined` or a function");var p=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(e,p)},Gd}var Yd,Y0;function d4(){if(Y0)return Yd;Y0=1;var n=_m;return Yd=function(e){return new n("throw",e)},Yd}var p4=Mt,Jd=gr,J0=te,f4=p4("%Promise%",!0),m4=ui(),K0=m4("Promise.prototype.then",!0),g4=_m,X0=h4(),v4=Am,y4=Cm(),Q0=d4(),w4=_y(),Oy=function(t,e){if(!(e instanceof g4))throw new J0("`completion` must be a Completion Record");var r=t["[[DisposableResourceStack]]"];if(!r)throw new J0("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var i,s=r.length-1;s>=0;s-=1)if(!i)i=r[s]["[[Hint]]"];else if(i!==r[s]["[[Hint]]"])throw new Jd("mixed hint stacks are not supported");for(var a=i==="ASYNC-DISPOSE"&&y4(f4,e),l=function(v){if(e.type()==="throw"){var y=e.value(),k=new w4(v,y);e=Q0(k)}else e=Q0(v)},c=i==="ASYNC-DISPOSE"&&function(y){return K0(a,function(){var k=X0(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!k)throw new Jd("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return K0(k,v4)},l)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")a=c(r[u]);else{var p=r[u];try{var m=X0(p["[[ResourceValue]]"],p["[[Hint]]"],p["[[DisposeMethod]]"]);if(m)throw new Jd("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(v){l(v)}}return t["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?a:e},My=function(){var t=[];return{"[[DisposableResourceStack]]":t}},Wh=om,$m=te,b4=Bh,ca=pm,S4=wc,Ny=aa,_4=Am,at=Sm,A4=Py,zy=Ss.supportsDescriptors,k4=km,Tm=Dy,E4=Oy,Uy=My,ev=mm(),Lt=function n(){if(!(this instanceof n)||at.has(this,"[[DisposableState]]")||at.has(this,"[[DisposeCapability]]"))throw new $m("can only be used with new");at.set(this,"[[DisposableState]]","PENDING"),at.set(this,"[[DisposeCapability]]",Uy())},Fy=function(){var t=this;return at.assert(t,"[[DisposableState]]"),at.get(t,"[[DisposableState]]")==="DISPOSED"},_c=k4(Fy);zy?S4(Lt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":Fy}):Lt.prototype.disposed=!1;var Zy=function(t){at.set(t,"[[DisposableState]]","DISPOSED"),zy||(t.disposed=!0)};ca(Lt.prototype,"dispose",function(){var t=this;if(!_c(t))return Zy(t),E4(at.get(t,"[[DisposeCapability]]"),_4())["?"]()});ca(Lt.prototype,"use",function(t){var e=this;if(_c(e))throw new Wh("a disposed stack can not use anything new");return Tm(at.get(e,"[[DisposeCapability]]"),t,"SYNC-DISPOSE"),t});ca(Lt.prototype,"adopt",function(t,e){var r=this;if(_c(r))throw new Wh("a disposed stack can not use anything new");if(!Ny(e))throw new $m("`onDispose` must be a function");var i=function(){return b4(e,void 0,[t])};return Tm(at.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),t});ca(Lt.prototype,"defer",function(t){var e=this;if(_c(e))throw new Wh("a disposed stack can not defer anything new");if(!Ny(t))throw new $m("`onDispose` must be a function");Tm(at.get(e,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",t)});ca(Lt.prototype,"move",function(){var t=this;if(_c(t))throw new Wh("a disposed stack can not use anything new");var e=new Lt;return at.set(e,"[[DisposeCapability]]",at.get(t,"[[DisposeCapability]]")),at.set(t,"[[DisposeCapability]]",Uy()),Zy(t),e});ev&&ca(Lt.prototype,ev,Lt.prototype.dispose);A4(Lt.prototype,"DisposableStack");var C4=Lt,$4=C4,T4=function(){return typeof DisposableStack=="function"?DisposableStack:$4},R4=Ss,I4=im(),x4=T4,P4=function(){var t=x4();return R4(I4,{DisposableStack:t},{DisposableStack:!0}),t},L4=Mt,Gh=om,Rm=te,tv=L4("%Promise%",!0),Im=Dy,D4=Bh,ua=pm,O4=wc,M4=Oy,Hy=aa,Vy=My,N4=Am,nv=Cm(),lt=Sm,z4=Py,By=Ss.supportsDescriptors,U4=km,F4=ui(),Z4=F4("Promise.prototype.then",!0),rv=gm(),Dt=function n(){if(!(this instanceof n)||lt.has(this,"[[AsyncDisposableState]]")||lt.has(this,"[[DisposeCapability]]"))throw new Rm("can only be used with new");lt.set(this,"[[AsyncDisposableState]]","pending"),lt.set(this,"[[DisposeCapability]]",Vy())},qy=function(){var t=this;return lt.assert(t,"[[AsyncDisposableState]]"),lt.get(t,"[[AsyncDisposableState]]")==="disposed"},Ac=U4(qy);By?O4(Dt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":qy}):Dt.prototype.disposed=!1;var jy=function(t){lt.set(t,"[[AsyncDisposableState]]","disposed"),By||(t.disposed=!0)};ua(Dt.prototype,"disposeAsync",function(){var t=this;return Ac(t)?nv(tv):(jy(t),Z4(nv(tv,M4(lt.get(t,"[[DisposeCapability]]"),N4())),function(e){return e["?"]()}))});ua(Dt.prototype,"use",function(t){var e=this;if(Ac(e))throw new Gh("a disposed stack can not use anything new");return Im(lt.get(e,"[[DisposeCapability]]"),t,"ASYNC-DISPOSE"),t});ua(Dt.prototype,"adopt",function(t,e){var r=this;if(Ac(r))throw new Gh("a disposed stack can not use anything new");if(!Hy(e))throw new Rm("`onDisposeAsync` must be a function");var i=function(){return D4(e,void 0,[t])};return i.value=t,Im(lt.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),t});ua(Dt.prototype,"defer",function(t){var e=this;if(Ac(e))throw new Gh("a disposed stack can not defer anything new");if(!Hy(t))throw new Rm("`onDispose` must be a function");Im(lt.get(e,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",t)});ua(Dt.prototype,"move",function(){var t=this;if(Ac(t))throw new Gh("a disposed stack can not use anything new");var e=new Dt;return lt.set(e,"[[DisposeCapability]]",lt.get(t,"[[DisposeCapability]]")),lt.set(t,"[[DisposeCapability]]",Vy()),jy(t),e});rv&&ua(Dt.prototype,rv,Dt.prototype.disposeAsync);z4(Dt.prototype,"AsyncDisposableStack");var H4=Dt,V4=H4,B4=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:V4},q4=Ss,j4=im(),W4=B4,G4=function(){var t=W4();return q4(j4,{AsyncDisposableStack:t},{AsyncDisposableStack:!0}),t},Y4=qA,J4=QA,K4=P4,X4=G4,Q4=function(){Y4(),J4(),K4(),X4()};Q4();const iv=new WeakMap;function eC(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function Os(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function sv(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function tC(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class nC{constructor(){C(this,"entries",new Map);C(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw sv();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw sv();if(e.constructor.name==="AsyncFunction")throw tC();this.storeFactory(t,e)}has(t){var e;return((e=this.entries.get(t))==null?void 0:e.factory)!==void 0}resolve(t){return this.resolveAny(t)}storeFactory(t,e){const r=this.getOrCreateEntry(t);r.factory=e,r.instance=void 0,r.error=void 0}validateClassRegistration(t){const e=iv.get(t);if(e){if(t.length!==e.length)throw new Error(`${Os(t)} cannot be registered with register(Class). @injectable(...) declared ${e.length} dependencies but constructor arity is ${t.length}. Use register(Key, () => value) instead.`);return}if(t.length!==0)throw new Error(`${Os(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=iv.get(t);if(!e)return new t;const r=e.map(i=>this.resolveAny(i));return new t(...r)}resolveAny(t){return this.getOrCreateEntry(t).proxy}getOrCreateEntry(t){let e=this.entries.get(t);return e||(e={key:t},e.proxy=this.createProxy(e),this.entries.set(t,e),e)}createProxy(t){return new Proxy({},{get:(e,r)=>{if(r==="then")return;const i=this.getInstance(t),s=Reflect.get(i,r,i);return typeof s=="function"?s.bind(i):s},set:(e,r,i)=>{const s=this.getInstance(t);return Reflect.set(s,r,i,s)},has:(e,r)=>{const i=this.getInstance(t);return r in i}})}getInstance(t){if(t.instance)return t.instance;if(t.error)throw t.error;if(!t.factory)throw new Error(`${Os(t.key)} was resolved but never registered`);const e=this.constructionStack.indexOf(t.key);if(e!==-1){const r=[...this.constructionStack.slice(e),t.key].map(i=>Os(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if(eC(r))throw new Error(`Factory for ${Os(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${Os(t.key)} returned a non-object value. Wrap primitives in an object.`);return t.instance=r,r}catch(r){throw t.error=r,r}finally{this.constructionStack.pop()}}}const Wy=new nC,rC=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function iC(n){for(const t of Object.keys(n))if(rC.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function sC(n,t){iC(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Nt(){class n extends Event{constructor(e,r){const{type:i,bubbles:s,cancelable:a,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(e,{bubbles:s,cancelable:a,composed:l}),sC(this,c)}}return n}class di extends globalThis.EventTarget{}const oC="X-Television-Client-Meta",aC="telemetry-activity",lC="telemetry-signal",Gy={kind:"single",full_screen:!1},Yy={width:560,height:740};function cC(n){return n.layout.flatMap(t=>t.artifactIds)}function uC(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const t=[];for(const[e,r]of n.entries())hC(r,e,t);return{valid:t.length===0,errors:t}}function sl(n){return n.flatMap(t=>t.artifactIds)}function $p(n,t){return n.flatMap(e=>{if(!e.artifactIds.includes(t))return[e];const r=e.artifactIds.filter(i=>i!==t);return r.length===0?[]:[{...e,artifactIds:r}]})}function hC(n,t,e){if(!Kd(n)){e.push(`Page ${t} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&e.push(`Page ${t} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?e.push(`Page ${t} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&e.push(`Page ${t} artifact ids must be non-empty strings`),!Kd(n.geometry)){e.push(`Page ${t} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&e.push(`Page ${t} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){e.push(`Page ${t} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&e.push(`Page ${t} single geometry must include a boolean full_screen`),!Kd(n.size)){e.push(`Page ${t} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&e.push(`Page ${t} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&e.push(`Page ${t} size ${r} must be a finite positive number`)}}function Kd(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const xt=Nt(),fu=Nt(),ov=Nt(),dC=Nt(),pC=Nt(),fC=Nt();function Jy(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const ha=Jy("RequestError"),av=Jy("ValidationError"),mC=200,gC=300,Bc=401;class vC{constructor(t,e){C(this,"serverURL");C(this,"token");C(this,"onUnauthorized");C(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){var a;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0),s=await yC(i);if(!i.ok||i.status<mC||i.status>=gC)throw i.status===Bc&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof s.error=="string"?s.error:i.statusText,i.status);return s}async requestVoid(t,e,r){var s;const i=await this.request(t,e,r!==void 0?JSON.stringify(r):void 0,r!==void 0?{"content-type":"application/json"}:void 0);if(!i.ok)throw i.status===Bc&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Xd(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===Bc&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await Xd(r,r.statusText),r.status);return r.text()}async requestRawVoid(t,e,r){var s;const i=await this.request(t,e,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===Bc&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await Xd(i,i.statusText),i.status)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new ha(t,r)}async request(t,e,r,i){const s=`${this.serverURL}${e}`;try{return await fetch(s,{method:t,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[oC]=JSON.stringify(this.telemetryMeta)),Object.keys(e).length>0?e:void 0}}async function yC(n){try{return await n.json()}catch{const t=await n.text().catch(()=>"");return t?{message:t}:{}}}async function Xd(n,t){try{const e=await n.json();if(typeof e.error=="string")return e.error;if(typeof e.message=="string")return e.message}catch{}return t}function wC(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var Vn,dh,Ky;class bC{constructor(t){g(this,dh);g(this,Vn);d(this,Vn,t)}list(){return o(this,Vn).requestJSON("GET","/channels")}async get(t={}){const e=await h(this,dh,Ky).call(this,t.channelID);return o(this,Vn).requestJSON("GET",`/channels/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),o(this,Vn).requestJSON("POST","/channels",e)}update(t){const{channelID:e,...r}=t;return o(this,Vn).requestJSON("PATCH",`/channels/${encodeURIComponent(e)}`,r)}remove(t){return o(this,Vn).requestJSON("DELETE",`/channels/${encodeURIComponent(t.channelID)}`)}}Vn=new WeakMap,dh=new WeakSet,Ky=async function(t){if(t!==void 0)return t;const{channels:e}=await this.list();if(e.length===1)return e[0].id;throw e.length===0?new av("channelID is required, but no channels exist."):new av(`channelID is required when multiple channels exist. Available channels: ${wC(e)}`)};var Bn;class SC{constructor(t){g(this,Bn);d(this,Bn,t)}create(t){const e={kind:t.kind,title:t.title};switch(t.kind){case"path":e.path=t.path;break;case"url":e.url=t.url;break}return e.channelID=t.channelID,o(this,Bn).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.channelID!==void 0&&e.set("channelID",t.channelID);const r=e.toString();return o(this,Bn).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return o(this,Bn).requestJSON("GET",`/artifacts/${encodeURIComponent(t.artifactID)}`)}update(t){const e={};return t.title!==void 0&&(e.title=t.title),t.path!==void 0&&(e.path=t.path),t.url!==void 0&&(e.url=t.url),o(this,Bn).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return o(this,Bn).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}}Bn=new WeakMap;var so;class _C{constructor(t){g(this,so);d(this,so,t)}list(){return o(this,so).requestJSON("GET","/themes")}refresh(){return o(this,so).requestJSON("POST","/themes/refresh")}}so=new WeakMap;var oo;class AC{constructor(t){g(this,oo);d(this,oo,t)}get(t){return o(this,oo).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return o(this,oo).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}oo=new WeakMap;var Ci;class kC{constructor(t){g(this,Ci);d(this,Ci,t)}status(){return o(this,Ci).requestJSON("GET","/telemetry")}enable(){return o(this,Ci).requestJSON("POST","/telemetry/enable")}disable(){return o(this,Ci).requestJSON("POST","/telemetry/disable")}}Ci=new WeakMap;var $i;class EC{constructor(t){g(this,$i);d(this,$i,t)}get(){return o(this,$i).requestJSON("GET","/display")}patch(t){const e={};return t.focusedChannelId!==void 0&&(e.focusedChannelId=t.focusedChannelId),t.pinnedChannelIds!==void 0&&(e.pinnedChannelIds=t.pinnedChannelIds),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),t.appearanceMode!==void 0&&(e.appearanceMode=t.appearanceMode),t.themeJavaScriptConsentIds!==void 0&&(e.themeJavaScriptConsentIds=t.themeJavaScriptConsentIds),o(this,$i).requestVoid("PATCH","/display",e)}focus(t){return o(this,$i).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}$i=new WeakMap;var Ft;class CC{constructor(t,e={}){C(this,"channels");C(this,"artifacts");C(this,"display");C(this,"themes");C(this,"markdown");C(this,"telemetry");g(this,Ft);d(this,Ft,new vC(t,e)),this.channels=new bC(o(this,Ft)),this.artifacts=new SC(o(this,Ft)),this.display=new EC(o(this,Ft)),this.themes=new _C(o(this,Ft)),this.markdown=new AC(o(this,Ft)),this.telemetry=new kC(o(this,Ft))}health(){return o(this,Ft).requestJSON("GET","/health")}}Ft=new WeakMap;const Yu="0.0.0",$C=/^\d+\.\d+\.\d+$/,TC=3;function Yh(n){return $C.test(n)}function xm(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<TC;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function RC(n,t){return n===Yu||t===Yu?!1:n!==t}const IC=400,xC=404,Xy=500,PC=600,LC={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var ee,hl,dl,qn,Ce,le,Ti,Cr,Ri,jn,dt,ao,pl,P,nn,Tp,zs,Qy,Rp,ew,mu,Ip,tw,Us,nw,Un,xp,rw,Ee;class DC extends di{constructor(e){super();g(this,P);g(this,ee);g(this,hl);g(this,dl);g(this,qn,new Set);C(this,"pendingPageWrites",new Map);g(this,Ce,new Map);g(this,le,NC());g(this,Ti);g(this,Cr,!1);g(this,Ri,!1);g(this,jn,0);g(this,dt,!1);g(this,ao,()=>{if(o(this,dt))return;const e=o(this,ee).connection.status==="connected";e&&!o(this,Ri)?(d(this,Ri,!0),h(this,P,nw).call(this)):!e&&o(this,Ri)&&(d(this,Ri,!1),d(this,jn,o(this,jn)+1)),h(this,P,Un).call(this)});g(this,pl,e=>{if(o(this,dt)||e.serverURL!==o(this,ee).connection.url)return;for(const i of o(this,qn))i.push(e.event);const r=e.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new ov("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){o(this,Cr)&&Ju(o(this,le),o(this,Ce),r.channelID,r.artifactID)&&h(this,P,Un).call(this),this.dispatchEvent(new dC("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new pC("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new fC("appearance-changed",{appearanceMode:r.appearanceMode})),o(this,Cr)&&(qc(o(this,le),r,this.pendingPageWrites,o(this,Ce)),Qd(o(this,le),o(this,Ce)),h(this,P,Un).call(this))});d(this,ee,e.connectionOwner),d(this,hl,e.navigationKeyHandler),d(this,dl,e.retainedGateHalted??(()=>!1)),d(this,Ti,h(this,P,xp).call(this)),o(this,ee).addEventListener("change",o(this,ao)),o(this,ee).addEventListener("server-event",o(this,pl)),o(this,ao).call(this)}get snapshot(){return o(this,Ti)}handleNavigationKey(e){var r;h(this,P,Ee).call(this),(r=o(this,hl))==null||r.call(this,e)}authenticate(e){return h(this,P,Ee).call(this),o(this,ee).authenticate(e)}async createChannel(e){h(this,P,Ee).call(this);const{channel:r}=await h(this,P,nn).call(this,o(this,ee).connection.client.channels.create({name:e}),()=>h(this,P,Qy).call(this));return r}focusChannel(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({focusedChannelId:e}),()=>h(this,P,zs).call(this))}setPinnedChannelIds(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({pinnedChannelIds:[...e]}),()=>h(this,P,zs).call(this))}listThemes(){return h(this,P,Ee).call(this),o(this,ee).connection.client.themes.list()}refreshThemes(){return h(this,P,Ee).call(this),o(this,ee).connection.client.themes.refresh()}setActiveTheme(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({activeThemeName:e}),()=>h(this,P,zs).call(this))}setAppearanceMode(e){return h(this,P,Ee).call(this),h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({appearanceMode:e}),()=>h(this,P,zs).call(this))}setThemeJavaScriptConsent(e,r){h(this,P,Ee).call(this);const i=o(this,le).display.themeJavaScriptConsentIds,s=r?i.includes(e)?[...i]:[...i,e]:i.filter(a=>a!==e);return h(this,P,nn).call(this,o(this,ee).connection.client.display.patch({themeJavaScriptConsentIds:s}),()=>h(this,P,zs).call(this))}selectPage(e,r){h(this,P,Ee).call(this),Ju(o(this,le),o(this,Ce),e,r)&&h(this,P,Un).call(this)}async renameChannel(e,r){h(this,P,Ee).call(this),await h(this,P,nn).call(this,o(this,ee).connection.client.channels.update({channelID:e,name:r}),()=>h(this,P,Rp).call(this,e))}async deleteChannel(e){h(this,P,Ee).call(this),await h(this,P,nn).call(this,o(this,ee).connection.client.channels.remove({channelID:e}),()=>h(this,P,ew).call(this,e))}updateChannelPages(e,r){h(this,P,Ee).call(this);const i=uC(r),s=o(this,le).channels.get(e);if(!i.valid||!s)return Promise.resolve();const a=Ai(r),l=Ai(s.channel.layout),c={previousPages:l};return vs(o(this,Ce),e,l,a),s.channel={...s.channel,layout:a},this.pendingPageWrites.set(e,c),h(this,P,Un).call(this),o(this,ee).connection.client.channels.update({channelID:e,layout:Ai(a)}).then(()=>{this.pendingPageWrites.get(e)===c&&this.pendingPageWrites.delete(e)},async u=>{if(o(this,dt))throw u;const p=this.pendingPageWrites.get(e)===c;if(p&&this.pendingPageWrites.delete(e),cv(u))throw await h(this,P,Tp).call(this,()=>h(this,P,Rp).call(this,e)),u;if(!p||!HC(u))throw u;const m=o(this,le).channels.get(e);if(!m)throw u;const v=Ai(c.previousPages);throw vs(o(this,Ce),e,m.channel.layout,v),m.channel={...m.channel,layout:v},h(this,P,Un).call(this),u})}async deleteArtifact(e){h(this,P,Ee).call(this);const r=uv(o(this,le),e);await h(this,P,nn).call(this,o(this,ee).connection.client.artifacts.delete({artifactID:e}),()=>h(this,P,tw).call(this,e,r))}readMarkdown(e){return h(this,P,Ee).call(this),o(this,ee).connection.client.markdown.get({artifactID:e})}writeMarkdown(e,r){return h(this,P,Ee).call(this),o(this,ee).connection.client.markdown.update({artifactID:e,content:r})}getArtifactViewURL(e){return h(this,P,Ee).call(this),o(this,ee).connection.getViewURL(e)}getArtifactContentURL(e){return h(this,P,Ee).call(this),o(this,ee).connection.getContentURL(e)}dispose(){o(this,dt)||(d(this,dt,!0),d(this,jn,o(this,jn)+1),o(this,qn).clear(),this.pendingPageWrites.clear(),o(this,Ce).clear(),o(this,ee).removeEventListener("change",o(this,ao)),o(this,ee).removeEventListener("server-event",o(this,pl)))}}ee=new WeakMap,hl=new WeakMap,dl=new WeakMap,qn=new WeakMap,Ce=new WeakMap,le=new WeakMap,Ti=new WeakMap,Cr=new WeakMap,Ri=new WeakMap,jn=new WeakMap,dt=new WeakMap,ao=new WeakMap,pl=new WeakMap,P=new WeakSet,nn=async function(e,r){try{return await e}catch(i){throw!o(this,dt)&&cv(i)&&await h(this,P,Tp).call(this,r),i}},Tp=async function(e){try{await e()}catch{}},zs=function(){const e=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>e.display.get(),r=>h(this,P,mu).call(this,r))},Qy=function(){const e=o(this,ee).connection.client;return h(this,P,Us).call(this,async()=>{const[{channels:r},i]=await Promise.all([e.channels.list(),e.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{const s=new Set(r.map(({id:a})=>a));for(const a of o(this,le).channels.keys())s.has(a)||(this.pendingPageWrites.delete(a),o(this,Ce).delete(a),o(this,le).channels.delete(a));for(const a of r)o(this,le).channels.has(a.id)||o(this,le).channels.set(a.id,{channel:ro(a),artifacts:new Map});h(this,P,mu).call(this,i)})},Rp=function(e){const r=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>ep(()=>r.channels.get({channelID:e})),i=>h(this,P,Ip).call(this,e,i))},ew=function(e){const r=o(this,ee).connection.client;return h(this,P,Us).call(this,async()=>{const[i,s]=await Promise.all([ep(()=>r.channels.get({channelID:e})),r.display.get()]);return{detail:i,display:s}},({detail:i,display:s})=>{h(this,P,Ip).call(this,e,i),h(this,P,mu).call(this,s)})},mu=function(e){o(this,le).display=Lp(e),o(this,ee).connection.acpClient.setEnabled(e.acpEnabled)},Ip=function(e,r){this.pendingPageWrites.delete(e);const i=o(this,le).channels.get(e);if(r===null){o(this,Ce).delete(e),o(this,le).channels.delete(e);return}vs(o(this,Ce),e,(i==null?void 0:i.channel.layout)??[],r.channel.layout),o(this,le).channels.set(e,{channel:ro(r.channel),artifacts:new Map(r.artifacts.map(s=>[s.id,structuredClone(s)]))})},tw=function(e,r){const i=o(this,ee).connection.client;return h(this,P,Us).call(this,()=>ep(()=>i.artifacts.get({artifactID:e})),s=>{const a=uv(o(this,le),e)??r;if(s===null){a!==null&&qc(o(this,le),{type:"artifact-removed",channelID:a,artifactID:e},this.pendingPageWrites,o(this,Ce));return}const l=a===null?void 0:o(this,le).channels.get(a);l==null||l.artifacts.set(e,structuredClone(s.artifact))})},Us=async function(e,r){const i=o(this,jn),s=[];o(this,qn).add(s);try{const a=await e();if(o(this,dt)||i!==o(this,jn))return;r(a);for(const l of s)qc(o(this,le),l,this.pendingPageWrites,o(this,Ce));Qd(o(this,le),o(this,Ce)),h(this,P,Un).call(this)}finally{o(this,qn).delete(s)}},nw=async function(){const e=++Nc(this,jn)._,r=o(this,ee).connection,i=r.client,s=[];o(this,qn).add(s);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:m})=>i.channels.get({channelID:m})));if(o(this,dt)||e!==o(this,jn))return;const u={channels:new Map,display:Lp(l)};for(const m of c)u.channels.set(m.channel.id,{channel:ro(m.channel),artifacts:new Map(m.artifacts.map(v=>[v.id,structuredClone(v)]))});zC(o(this,Ce),o(this,le),u);for(const m of s)qc(u,m,this.pendingPageWrites,o(this,Ce));Qd(u,o(this,Ce));const p=o(this,Cr)?OC(o(this,le),u):[];this.pendingPageWrites.clear(),d(this,le,u),d(this,Cr,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,P,Un).call(this);for(const m of p)this.dispatchEvent(new ov("artifact-content-changed",{artifactID:m}))}catch{}finally{o(this,qn).delete(s)}},Un=function(){o(this,dt)||(d(this,Ti,h(this,P,xp).call(this)),h(this,P,rw).call(this),this.dispatchEvent(new xt("change")))},xp=function(){var s;const e=[...o(this,le).channels.values()].map(a=>FC(a,o(this,Ce).get(a.channel.id))),r=e.find(({id:a})=>a===o(this,le).display.focusedChannelId)??null,i=o(this,ee).connection;return Object.freeze({ready:o(this,Cr),channels:Object.freeze(e),display:ZC(o(this,le).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,authorizationRejected:i.hasAuthTokenRejected,gateHalted:i.bootState==="halted"||o(this,dl).call(this),status:i.status,hasEverConnected:i.hasEverConnected,firstConnectError:i.hasEverConnected?null:o(this,ee).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:MC(((s=i.updateState)==null?void 0:s.desktop)??null)})})},rw=function(){const e=o(this,Ti).focusedChannel;o(this,ee).connection.acpClient.setChannelContext(e?{channelID:e.id,channelName:e.name}:null)},Ee=function(){if(o(this,dt))throw new Error("ApplicationService is disposed")};function OC(n,t){const e=t.display.focusedChannelId;if(e===null||n.display.focusedChannelId!==e)return[];const r=n.channels.get(e),i=t.channels.get(e);if(!r||!i)return[];const s=new Set(sl(r.channel.layout));return sl(i.channel.layout).filter(a=>{var l,c;return s.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function MC(n){return n===null?null:Object.freeze({...n})}function NC(){return{channels:new Map,display:Lp(LC)}}function qc(n,t,e,r){switch(t.type){case"channel-created":r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ro(t.channel),artifacts:new Map});return;case"channel-updated":{e.delete(t.channel.id);const i=n.channels.get(t.channel.id);if(!i){r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ro(t.channel),artifacts:new Map});return}vs(r,t.channel.id,i.channel.layout,t.channel.layout);const s=new Set(sl(t.channel.layout));i.channel=ro(t.channel);for(const a of i.artifacts.keys())s.has(a)||i.artifacts.delete(a);return}case"channel-removed":e.delete(t.channelID),r.delete(t.channelID),n.channels.delete(t.channelID);return;case"channel-changed":n.display.focusedChannelId=t.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...t.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=t.themeName,n.display.activeThemeColorScheme=t.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...t.themeJavaScriptConsentIds];return;case"appearance-changed":n.display.appearanceMode=t.appearanceMode;return;case"artifact-created":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);if(s&&(s.previousPages=lv(s.previousPages,t.artifact.id)),!sl(i.channel.layout).includes(t.artifact.id)){const a=i.channel.layout,l=lv(a,t.artifact.id);vs(r,t.channelID,a,l),i.channel={...i.channel,layout:l}}i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(t.artifact.id)){i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}return;case"artifact-removed":{const i=n.channels.get(t.channelID);if(!i)return;const s=e.get(t.channelID);s&&(s.previousPages=$p(s.previousPages,t.artifactID)),i.artifacts.delete(t.artifactID);const a=i.channel.layout,l=$p(a,t.artifactID);vs(r,t.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":Ju(n,r,t.channelID,t.artifactID);return;case"artifact-content-changed":return;default:return VC(t)}}function zC(n,t,e){var r;for(const i of n.keys())e.channels.has(i)||n.delete(i);for(const[i,s]of e.channels)vs(n,i,((r=t.channels.get(i))==null?void 0:r.channel.layout)??[],s.channel.layout)}function vs(n,t,e,r){const i=n.get(t);if(i===void 0)return;if(r.length===0){n.delete(t);return}const s=Pp(r,i);if(s!==-1){n.set(t,[...r[s].artifactIds]);return}const a=Pp(e,i),l=a===-1?0:Math.min(a,r.length-1);n.set(t,[...r[l].artifactIds])}function Ju(n,t,e,r){const i=n.channels.get(e),s=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!s)return!1;const a=t.get(e);return a&&UC(a,s.artifactIds)?!1:(t.set(e,[...s.artifactIds]),!0)}function Qd(n,t){var i,s;const e=n.display.focusedChannelId;if(e===null||t.has(e))return;const r=(s=(i=n.channels.get(e))==null?void 0:i.channel.layout[0])==null?void 0:s.artifactIds[0];r!==void 0&&Ju(n,t,e,r)}function Pp(n,t){const e=new Set(t);return n.findIndex(r=>r.artifactIds.some(i=>e.has(i)))}function UC(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function FC(n,t){const e=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=t===void 0?0:Pp(n.channel.layout,t),i=e[r]??e[0]??null,s=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:e,selectedPage:i,artifacts:s};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function ZC(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function lv(n,t){return sl(n).includes(t)?Ai(n):[...Ai(n),{artifactIds:[t],geometry:{...Gy},size:{...Yy}}]}function HC(n){return n instanceof ha&&n.status!==void 0&&n.status>=IC&&n.status<Xy}function cv(n){return n instanceof ha&&(n.status===void 0||n.status>=Xy&&n.status<PC)}async function ep(n){try{return await n()}catch(t){if(t instanceof ha&&t.status===xC)return null;throw t}}function uv(n,t){for(const[e,r]of n.channels)if(r.artifacts.has(t))return e;return null}function Ai(n){return n.map(t=>({artifactIds:[...t.artifactIds],geometry:{...t.geometry},size:{...t.size}}))}function ro(n){return{id:n.id,name:n.name,layout:Ai(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function Lp(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function VC(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function BC(n,t){var c;const e=n.snapshot,r=e.focusedChannel;if(t==="ArrowLeft"||t==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),p=u+(t==="ArrowLeft"?-1:1),m=(c=r.pages[p])==null?void 0:c.artifactIds[0];return u===-1||m===void 0?!1:(hv(),n.selectPage(r.id,m),!0)}const i=qC(e),s=r===null?-1:i.indexOf(r.id),a=s+(t==="ArrowUp"?-1:1),l=i[a];return s===-1||l===void 0?!1:(hv(),n.focusChannel(l).catch(()=>{}),!0)}function qC(n){const t=new Map(n.channels.map(s=>[s.id,s])),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,a)=>a.localeCompare(s));return[...e,...i]}function hv(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const iw="0123456789ABCDEFGHJKMNPQRSTVWXYZ",Ku=32,jC=16,sw=10,dv=0xffffffffffff;var ki;(function(n){n.Base32IncorrectEncoding="B32_ENC_INVALID",n.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",n.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",n.EncodeTimeNegative="ENC_TIME_NEG",n.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",n.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",n.PRNGDetectFailure="PRNG_DETECT",n.ULIDInvalid="ULID_INVALID",n.Unexpected="UNEXPECTED",n.UUIDInvalid="UUID_INVALID"})(ki||(ki={}));class Oa extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function WC(n){const t=Math.floor(n()*Ku)%Ku;return iw.charAt(t)}function GC(n){const t=YC(),e=t&&(t.crypto||t.msCrypto)||null;if(typeof(e==null?void 0:e.getRandomValues)=="function")return()=>{const r=new Uint8Array(1);return e.getRandomValues(r),r[0]/256};if(typeof(e==null?void 0:e.randomBytes)=="function")return()=>e.randomBytes(1).readUInt8()/256;throw new Oa(ki.PRNGDetectFailure,"Failed to find a reliable PRNG")}function YC(){return XC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function JC(n,t){let e="";for(;n>0;n--)e=WC(t)+e;return e}function KC(n,t=sw){if(isNaN(n))throw new Oa(ki.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>dv)throw new Oa(ki.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${dv}: ${n}`);if(n<0)throw new Oa(ki.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new Oa(ki.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%Ku,r=iw.charAt(e)+r,n=(n-e)/Ku;return r}function XC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Pm(n,t){const e=GC(),r=Date.now();return KC(r,sw)+JC(jC,e)}const Ma=Nt(),ow=Nt(),aw=Nt(),QC=Nt(),tp=Nt(),e$="store-";function oi(n){return new URL(n).origin}function t$(){return{authTokens:{}}}var Ii,xi,Pi;class n$ extends di{constructor(e,r,i={}){super();g(this,Ii);g(this,xi);g(this,Pi);d(this,Ii,`${e$}${e}`),d(this,xi,i.storage??i$());const s=o(this,xi).getItem(o(this,Ii));s===null?(d(this,Pi,r),o(this,xi).setItem(o(this,Ii),JSON.stringify(r))):d(this,Pi,s$(JSON.parse(s),r))}get(){return o(this,Pi)}set(e){d(this,Pi,e),o(this,xi).setItem(o(this,Ii),JSON.stringify(e)),this.dispatchEvent(new xt("change"))}}Ii=new WeakMap,xi=new WeakMap,Pi=new WeakMap;function pv(n,t){return n.authTokens[oi(t)]??null}function fv(n,t,e){return{authTokens:{...n.authTokens,[oi(t)]:e}}}function r$(n,t){const e=oi(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{authTokens:r}}function i$(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function s$(n,t){if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n.authTokens;if(typeof e!="object"||e===null||Array.isArray(e))return t;const r={};for(const[i,s]of Object.entries(e))if(typeof s=="string")try{r[oi(i)]=s}catch{}return{authTokens:r}}function E(n,t,e){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),t(l,c);const u=a.prototype,p=Object.keys(u);for(let m=0;m<p.length;m++){const v=p[m];v in l||(l[v]=u[v].bind(l))}}const i=(e==null?void 0:e.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function a(l){var c;const u=e!=null&&e.Parent?new s:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const p of u._zod.deferred)p();return u}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,u;return e!=null&&e.Parent&&l instanceof e.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class io extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class lw extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const cw={};function ai(n){return cw}function uw(n){const t=Object.values(n).filter(r=>typeof r=="number");return Object.entries(n).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function Dp(n,t){return typeof t=="bigint"?t.toString():t}function Jh(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function Lm(n){return n==null}function Dm(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function o$(n,t){const e=(n.toString().split(".")[1]||"").length,r=t.toString();let i=(r.split(".")[1]||"").length;if(i===0&&/\d?e-\d?/.test(r)){const c=r.match(/\d?e-(\d?)/);c!=null&&c[1]&&(i=Number.parseInt(c[1]))}const s=e>i?e:i,a=Number.parseInt(n.toFixed(s).replace(".","")),l=Number.parseInt(t.toFixed(s).replace(".",""));return a%l/10**s}const mv=Symbol("evaluating");function ce(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==mv)return r===void 0&&(r=mv,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function As(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function pi(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function gv(n){return JSON.stringify(n)}function a$(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const hw="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function ol(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const l$=Jh(()=>{var n;if(typeof navigator<"u"&&((n=navigator==null?void 0:navigator.userAgent)!=null&&n.includes("Cloudflare")))return!1;try{const t=Function;return new t(""),!0}catch{return!1}});function Qo(n){if(ol(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(ol(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function dw(n){return Qo(n)?{...n}:Array.isArray(n)?[...n]:n}const c$=new Set(["string","number","symbol"]);function ea(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fi(n,t,e){const r=new n._zod.constr(t??n._zod.def);return(!t||e!=null&&e.parent)&&(r._zod.parent=n),r}function U(n){const t=n;if(!t)return{};if(typeof t=="string")return{error:()=>t};if((t==null?void 0:t.message)!==void 0){if((t==null?void 0:t.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function u$(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const h$={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function d$(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=pi(n._zod.def,{get shape(){const a={};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=e.shape[l])}return As(this,"shape",a),a},checks:[]});return fi(n,s)}function p$(n,t){const e=n._zod.def,r=e.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=pi(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return As(this,"shape",a),a},checks:[]});return fi(n,s)}function f$(n,t){if(!Qo(t))throw new Error("Invalid input to extend: expected a plain object");const e=n._zod.def.checks;if(e&&e.length>0){const s=n._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(s,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=pi(n._zod.def,{get shape(){const s={...n._zod.def.shape,...t};return As(this,"shape",s),s}});return fi(n,i)}function m$(n,t){if(!Qo(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=pi(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return As(this,"shape",r),r}});return fi(n,e)}function g$(n,t){const e=pi(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return As(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return fi(n,e)}function v$(n,t,e){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=pi(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(e)for(const u in e){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return As(this,"shape",c),c},checks:[]});return fi(t,a)}function y$(n,t,e){const r=pi(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(e)for(const a in e){if(!(a in s))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(s[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)s[a]=new n({type:"nonoptional",innerType:i[a]});return As(this,"shape",s),s}});return fi(t,r)}function Xs(n,t=0){var e;if(n.aborted===!0)return!0;for(let r=t;r<n.issues.length;r++)if(((e=n.issues[r])==null?void 0:e.continue)!==!0)return!0;return!1}function Qs(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function jc(n){return typeof n=="string"?n:n==null?void 0:n.message}function li(n,t,e){var i,s,a,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const p=jc((a=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:a.call(s,n))??jc((l=t==null?void 0:t.error)==null?void 0:l.call(t,n))??jc((c=e.customError)==null?void 0:c.call(e,n))??jc((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=p}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Om(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function al(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const pw=(n,t)=>{n.name="$ZodError",Object.defineProperty(n,"_zod",{value:n._zod,enumerable:!1}),Object.defineProperty(n,"issues",{value:t,enumerable:!1}),n.message=JSON.stringify(t,Dp,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},fw=E("$ZodError",pw),mw=E("$ZodError",pw,{Parent:Error});function w$(n,t=e=>e.message){const e={},r=[];for(const i of n.issues)i.path.length>0?(e[i.path[0]]=e[i.path[0]]||[],e[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:e}}function b$(n,t=e=>e.message){const e={_errors:[]},r=i=>{for(const s of i.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map(a=>r({issues:a}));else if(s.code==="invalid_key")r({issues:s.issues});else if(s.code==="invalid_element")r({issues:s.issues});else if(s.path.length===0)e._errors.push(t(s));else{let a=e,l=0;for(;l<s.path.length;){const c=s.path[l];l===s.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(s))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),e}const Mm=n=>(t,e,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:e,issues:[]},s);if(a instanceof Promise)throw new io;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>li(c,s,ai())));throw hw(l,i==null?void 0:i.callee),l}return a.value},Nm=n=>async(t,e,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:e,issues:[]},s);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>li(c,s,ai())));throw hw(l,i==null?void 0:i.callee),l}return a.value},Kh=n=>(t,e,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:e,issues:[]},i);if(s instanceof Promise)throw new io;return s.issues.length?{success:!1,error:new(n??fw)(s.issues.map(a=>li(a,i,ai())))}:{success:!0,data:s.value}},S$=Kh(mw),Xh=n=>async(t,e,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let s=t._zod.run({value:e,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new n(s.issues.map(a=>li(a,i,ai())))}:{success:!0,data:s.value}},_$=Xh(mw),A$=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Mm(n)(t,e,i)},k$=n=>(t,e,r)=>Mm(n)(t,e,r),E$=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Nm(n)(t,e,i)},C$=n=>async(t,e,r)=>Nm(n)(t,e,r),$$=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Kh(n)(t,e,i)},T$=n=>(t,e,r)=>Kh(n)(t,e,r),R$=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Xh(n)(t,e,i)},I$=n=>async(t,e,r)=>Xh(n)(t,e,r),x$=/^[cC][^\s-]{8,}$/,P$=/^[0-9a-z]+$/,L$=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,D$=/^[0-9a-vA-V]{20}$/,O$=/^[A-Za-z0-9]{27}$/,M$=/^[a-zA-Z0-9_-]{21}$/,N$=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,z$=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vv=n=>n?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${n}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,U$=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,F$="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function Z$(){return new RegExp(F$,"u")}const H$=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,V$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,B$=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,q$=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,j$=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gw=/^[A-Za-z0-9_-]*$/,W$=/^\+[1-9]\d{6,14}$/,vw="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",G$=new RegExp(`^${vw}$`);function yw(n){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof n.precision=="number"?n.precision===-1?`${t}`:n.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${n.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Y$(n){return new RegExp(`^${yw(n)}$`)}function J$(n){const t=yw({precision:n.precision}),e=["Z"];n.local&&e.push(""),n.offset&&e.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${e.join("|")})`;return new RegExp(`^${vw}T(?:${r})$`)}const K$=n=>{const t=n?`[\\s\\S]{${(n==null?void 0:n.minimum)??0},${(n==null?void 0:n.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},X$=/^-?\d+$/,ww=/^-?\d+(?:\.\d+)?$/,Q$=/^(?:true|false)$/i,eT=/^[^A-Z]*$/,tT=/^[^a-z]*$/,ut=E("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),bw={number:"number",bigint:"bigint",object:"date"},Sw=E("$ZodCheckLessThan",(n,t)=>{ut.init(n,t);const e=bw[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:e,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),_w=E("$ZodCheckGreaterThan",(n,t)=>{ut.init(n,t);const e=bw[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),n._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:e,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:n,continue:!t.abort})}}),nT=E("$ZodCheckMultipleOf",(n,t)=>{ut.init(n,t),n._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),n._zod.check=e=>{if(typeof e.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof e.value=="bigint"?e.value%t.value===BigInt(0):o$(e.value,t.value)===0)||e.issues.push({origin:typeof e.value,code:"not_multiple_of",divisor:t.value,input:e.value,inst:n,continue:!t.abort})}}),rT=E("$ZodCheckNumberFormat",(n,t)=>{var a;ut.init(n,t),t.format=t.format||"float64";const e=(a=t.format)==null?void 0:a.includes("int"),r=e?"int":"number",[i,s]=h$[t.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,e&&(c.pattern=X$)}),n._zod.check=l=>{const c=l.value;if(e){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>s&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!t.abort})}}),iT=E("$ZodCheckMaxLength",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Lm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=Om(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),sT=E("$ZodCheckMinLength",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Lm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=Om(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),oT=E("$ZodCheckLengthEquals",(n,t)=>{var e;ut.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Lm(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),n._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const a=Om(i),l=s>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),Qh=E("$ZodCheckStringFormat",(n,t)=>{var e,r;ut.init(n,t),n._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(e=n._zod).check??(e.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:n,continue:!t.abort})}):(r=n._zod).check??(r.check=()=>{})}),aT=E("$ZodCheckRegex",(n,t)=>{Qh.init(n,t),n._zod.check=e=>{t.pattern.lastIndex=0,!t.pattern.test(e.value)&&e.issues.push({origin:"string",code:"invalid_format",format:"regex",input:e.value,pattern:t.pattern.toString(),inst:n,continue:!t.abort})}}),lT=E("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=eT),Qh.init(n,t)}),cT=E("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=tT),Qh.init(n,t)}),uT=E("$ZodCheckIncludes",(n,t)=>{ut.init(n,t);const e=ea(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${e}`:e);t.pattern=r,n._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),n._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:n,continue:!t.abort})}}),hT=E("$ZodCheckStartsWith",(n,t)=>{ut.init(n,t);const e=new RegExp(`^${ea(t.prefix)}.*`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:n,continue:!t.abort})}}),dT=E("$ZodCheckEndsWith",(n,t)=>{ut.init(n,t);const e=new RegExp(`.*${ea(t.suffix)}$`);t.pattern??(t.pattern=e),n._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(e)}),n._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:n,continue:!t.abort})}}),pT=E("$ZodCheckOverwrite",(n,t)=>{ut.init(n,t),n._zod.check=e=>{e.value=t.tx(e.value)}});class fT{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
5
5
  `).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),s=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of s)this.content.push(a)}compile(){const t=Function,e=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(s=>` ${s}`)];return new t(...e,i.join(`
6
- `))}}const dT={major:4,minor:3,patch:6},we=E("$ZodType",(n,t)=>{var i;var e;n??(n={}),n._zod.def=t,n._zod.bag=n._zod.bag||{},n._zod.version=dT;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const s of r)for(const a of s._zod.onattach)a(n);if(r.length===0)(e=n._zod).deferred??(e.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const s=(l,c,u)=>{let p=Xs(l),m;for(const v of c){if(v._zod.def.when){if(!v._zod.def.when(l))continue}else if(p)continue;const y=l.issues.length,k=v._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new io;if(m||k instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await k,l.issues.length!==y&&(p||(p=Xs(l,y)))});else{if(l.issues.length===y)continue;p||(p=Xs(l,y))}}return m?m.then(()=>l):l},a=(l,c,u)=>{if(Xs(l))return l.aborted=!0,l;const p=s(c,r,u);if(p instanceof Promise){if(u.async===!1)throw new io;return p.then(m=>n._zod.parse(m,u))}return n._zod.parse(p,u)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const p=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return p instanceof Promise?p.then(m=>a(m,l,c)):a(p,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new io;return u.then(p=>s(p,r,c))}return s(u,r,c)}}ce(n,"~standard",()=>({validate:s=>{var a;try{const l=y$(n,s);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return w$(n,s).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),Mm=E("$ZodString",(n,t)=>{var e;we.init(n,t),n._zod.pattern=[...((e=n==null?void 0:n._zod.bag)==null?void 0:e.patterns)??[]].pop()??G$(n._zod.bag),n._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),ve=E("$ZodStringFormat",(n,t)=>{Qh.init(n,t),Mm.init(n,t)}),pT=E("$ZodGUID",(n,t)=>{t.pattern??(t.pattern=O$),ve.init(n,t)}),fT=E("$ZodUUID",(n,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=pv(r))}else t.pattern??(t.pattern=pv());ve.init(n,t)}),mT=E("$ZodEmail",(n,t)=>{t.pattern??(t.pattern=M$),ve.init(n,t)}),gT=E("$ZodURL",(n,t)=>{ve.init(n,t),n._zod.check=e=>{try{const r=e.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:e.value,inst:n,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:e.value,inst:n,continue:!t.abort})),t.normalize?e.value=i.href:e.value=r;return}catch{e.issues.push({code:"invalid_format",format:"url",input:e.value,inst:n,continue:!t.abort})}}}),vT=E("$ZodEmoji",(n,t)=>{t.pattern??(t.pattern=z$()),ve.init(n,t)}),yT=E("$ZodNanoID",(n,t)=>{t.pattern??(t.pattern=L$),ve.init(n,t)}),wT=E("$ZodCUID",(n,t)=>{t.pattern??(t.pattern=T$),ve.init(n,t)}),bT=E("$ZodCUID2",(n,t)=>{t.pattern??(t.pattern=R$),ve.init(n,t)}),ST=E("$ZodULID",(n,t)=>{t.pattern??(t.pattern=I$),ve.init(n,t)}),_T=E("$ZodXID",(n,t)=>{t.pattern??(t.pattern=x$),ve.init(n,t)}),AT=E("$ZodKSUID",(n,t)=>{t.pattern??(t.pattern=P$),ve.init(n,t)}),kT=E("$ZodISODateTime",(n,t)=>{t.pattern??(t.pattern=W$(t)),ve.init(n,t)}),ET=E("$ZodISODate",(n,t)=>{t.pattern??(t.pattern=q$),ve.init(n,t)}),CT=E("$ZodISOTime",(n,t)=>{t.pattern??(t.pattern=j$(t)),ve.init(n,t)}),$T=E("$ZodISODuration",(n,t)=>{t.pattern??(t.pattern=D$),ve.init(n,t)}),TT=E("$ZodIPv4",(n,t)=>{t.pattern??(t.pattern=U$),ve.init(n,t),n._zod.bag.format="ipv4"}),RT=E("$ZodIPv6",(n,t)=>{t.pattern??(t.pattern=F$),ve.init(n,t),n._zod.bag.format="ipv6",n._zod.check=e=>{try{new URL(`http://[${e.value}]`)}catch{e.issues.push({code:"invalid_format",format:"ipv6",input:e.value,inst:n,continue:!t.abort})}}}),IT=E("$ZodCIDRv4",(n,t)=>{t.pattern??(t.pattern=Z$),ve.init(n,t)}),xT=E("$ZodCIDRv6",(n,t)=>{t.pattern??(t.pattern=H$),ve.init(n,t),n._zod.check=e=>{const r=e.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{e.issues.push({code:"invalid_format",format:"cidrv6",input:e.value,inst:n,continue:!t.abort})}}});function ww(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const PT=E("$ZodBase64",(n,t)=>{t.pattern??(t.pattern=V$),ve.init(n,t),n._zod.bag.contentEncoding="base64",n._zod.check=e=>{ww(e.value)||e.issues.push({code:"invalid_format",format:"base64",input:e.value,inst:n,continue:!t.abort})}});function LT(n){if(!dw.test(n))return!1;const t=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),e=t.padEnd(Math.ceil(t.length/4)*4,"=");return ww(e)}const DT=E("$ZodBase64URL",(n,t)=>{t.pattern??(t.pattern=dw),ve.init(n,t),n._zod.bag.contentEncoding="base64url",n._zod.check=e=>{LT(e.value)||e.issues.push({code:"invalid_format",format:"base64url",input:e.value,inst:n,continue:!t.abort})}}),OT=E("$ZodE164",(n,t)=>{t.pattern??(t.pattern=B$),ve.init(n,t)});function MT(n,t=null){try{const e=n.split(".");if(e.length!==3)return!1;const[r]=e;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const NT=E("$ZodJWT",(n,t)=>{ve.init(n,t),n._zod.check=e=>{MT(e.value,t.alg)||e.issues.push({code:"invalid_format",format:"jwt",input:e.value,inst:n,continue:!t.abort})}}),bw=E("$ZodNumber",(n,t)=>{we.init(n,t),n._zod.pattern=n._zod.bag.pattern??mw,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=Number(e.value)}catch{}const i=e.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return e;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return e.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...s?{received:s}:{}}),e}}),zT=E("$ZodNumberFormat",(n,t)=>{eT.init(n,t),bw.init(n,t)}),UT=E("$ZodBoolean",(n,t)=>{we.init(n,t),n._zod.pattern=J$,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=!!e.value}catch{}const i=e.value;return typeof i=="boolean"||e.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),e}}),FT=E("$ZodUnknown",(n,t)=>{we.init(n,t),n._zod.parse=e=>e}),ZT=E("$ZodNever",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:n}),e)});function fv(n,t,e){n.issues.length&&t.issues.push(...Qs(e,n.issues)),t.value[e]=n.value}const HT=E("$ZodArray",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Array.isArray(i))return e.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),e;e.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const l=i[a],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(u=>fv(u,e,a))):fv(c,e,a)}return s.length?Promise.all(s).then(()=>e):e}});function Xu(n,t,e,r,i){if(n.issues.length){if(i&&!(e in r))return;t.issues.push(...Qs(e,n.issues))}n.value===void 0?e in r&&(t.value[e]=void 0):t.value[e]=n.value}function Sw(n){var r,i,s,a;const t=Object.keys(n.shape);for(const l of t)if(!((a=(s=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const e=a$(n.shape);return{...n,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(e)}}function _w(n,t,e,r,i,s){const a=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,p=c.optout==="optional";for(const m in t){if(l.has(m))continue;if(u==="never"){a.push(m);continue}const v=c.run({value:t[m],issues:[]},r);v instanceof Promise?n.push(v.then(y=>Xu(y,e,m,t,p))):Xu(v,e,m,t,p)}return a.length&&e.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),n.length?Promise.all(n).then(()=>e):e}const VT=E("$ZodObject",(n,t)=>{we.init(n,t);const e=Object.getOwnPropertyDescriptor(t,"shape");if(!(e!=null&&e.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Jh(()=>Sw(t));ce(n._zod,"propValues",()=>{const l=t.shape,c={};for(const u in l){const p=l[u]._zod;if(p.values){c[u]??(c[u]=new Set);for(const m of p.values)c[u].add(m)}}return c});const i=ol,s=t.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const p=[],m=a.shape;for(const v of a.keys){const y=m[v],k=y._zod.optout==="optional",A=y._zod.run({value:u[v],issues:[]},c);A instanceof Promise?p.push(A.then(x=>Xu(x,l,v,u,k))):Xu(A,l,v,u,k)}return s?_w(p,u,l,c,r.value,n):p.length?Promise.all(p).then(()=>l):l}}),BT=E("$ZodObjectJIT",(n,t)=>{VT.init(n,t);const e=n._zod.parse,r=Jh(()=>Sw(t)),i=v=>{var V;const y=new hT(["shape","payload","ctx"]),k=r.value,A=F=>{const G=dv(F);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};y.write("const input = payload.value;");const x=Object.create(null);let L=0;for(const F of k.keys)x[F]=`key_${L++}`;y.write("const newResult = {};");for(const F of k.keys){const G=x[F],z=dv(F),J=v[F],re=((V=J==null?void 0:J._zod)==null?void 0:V.optout)==="optional";y.write(`const ${G} = ${A(F)};`),re?y.write(`
6
+ `))}}const mT={major:4,minor:3,patch:6},we=E("$ZodType",(n,t)=>{var i;var e;n??(n={}),n._zod.def=t,n._zod.bag=n._zod.bag||{},n._zod.version=mT;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const s of r)for(const a of s._zod.onattach)a(n);if(r.length===0)(e=n._zod).deferred??(e.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const s=(l,c,u)=>{let p=Xs(l),m;for(const v of c){if(v._zod.def.when){if(!v._zod.def.when(l))continue}else if(p)continue;const y=l.issues.length,k=v._zod.check(l);if(k instanceof Promise&&(u==null?void 0:u.async)===!1)throw new io;if(m||k instanceof Promise)m=(m??Promise.resolve()).then(async()=>{await k,l.issues.length!==y&&(p||(p=Xs(l,y)))});else{if(l.issues.length===y)continue;p||(p=Xs(l,y))}}return m?m.then(()=>l):l},a=(l,c,u)=>{if(Xs(l))return l.aborted=!0,l;const p=s(c,r,u);if(p instanceof Promise){if(u.async===!1)throw new io;return p.then(m=>n._zod.parse(m,u))}return n._zod.parse(p,u)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const p=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return p instanceof Promise?p.then(m=>a(m,l,c)):a(p,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new io;return u.then(p=>s(p,r,c))}return s(u,r,c)}}ce(n,"~standard",()=>({validate:s=>{var a;try{const l=S$(n,s);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return _$(n,s).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),zm=E("$ZodString",(n,t)=>{var e;we.init(n,t),n._zod.pattern=[...((e=n==null?void 0:n._zod.bag)==null?void 0:e.patterns)??[]].pop()??K$(n._zod.bag),n._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),ve=E("$ZodStringFormat",(n,t)=>{Qh.init(n,t),zm.init(n,t)}),gT=E("$ZodGUID",(n,t)=>{t.pattern??(t.pattern=z$),ve.init(n,t)}),vT=E("$ZodUUID",(n,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=vv(r))}else t.pattern??(t.pattern=vv());ve.init(n,t)}),yT=E("$ZodEmail",(n,t)=>{t.pattern??(t.pattern=U$),ve.init(n,t)}),wT=E("$ZodURL",(n,t)=>{ve.init(n,t),n._zod.check=e=>{try{const r=e.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:e.value,inst:n,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:e.value,inst:n,continue:!t.abort})),t.normalize?e.value=i.href:e.value=r;return}catch{e.issues.push({code:"invalid_format",format:"url",input:e.value,inst:n,continue:!t.abort})}}}),bT=E("$ZodEmoji",(n,t)=>{t.pattern??(t.pattern=Z$()),ve.init(n,t)}),ST=E("$ZodNanoID",(n,t)=>{t.pattern??(t.pattern=M$),ve.init(n,t)}),_T=E("$ZodCUID",(n,t)=>{t.pattern??(t.pattern=x$),ve.init(n,t)}),AT=E("$ZodCUID2",(n,t)=>{t.pattern??(t.pattern=P$),ve.init(n,t)}),kT=E("$ZodULID",(n,t)=>{t.pattern??(t.pattern=L$),ve.init(n,t)}),ET=E("$ZodXID",(n,t)=>{t.pattern??(t.pattern=D$),ve.init(n,t)}),CT=E("$ZodKSUID",(n,t)=>{t.pattern??(t.pattern=O$),ve.init(n,t)}),$T=E("$ZodISODateTime",(n,t)=>{t.pattern??(t.pattern=J$(t)),ve.init(n,t)}),TT=E("$ZodISODate",(n,t)=>{t.pattern??(t.pattern=G$),ve.init(n,t)}),RT=E("$ZodISOTime",(n,t)=>{t.pattern??(t.pattern=Y$(t)),ve.init(n,t)}),IT=E("$ZodISODuration",(n,t)=>{t.pattern??(t.pattern=N$),ve.init(n,t)}),xT=E("$ZodIPv4",(n,t)=>{t.pattern??(t.pattern=H$),ve.init(n,t),n._zod.bag.format="ipv4"}),PT=E("$ZodIPv6",(n,t)=>{t.pattern??(t.pattern=V$),ve.init(n,t),n._zod.bag.format="ipv6",n._zod.check=e=>{try{new URL(`http://[${e.value}]`)}catch{e.issues.push({code:"invalid_format",format:"ipv6",input:e.value,inst:n,continue:!t.abort})}}}),LT=E("$ZodCIDRv4",(n,t)=>{t.pattern??(t.pattern=B$),ve.init(n,t)}),DT=E("$ZodCIDRv6",(n,t)=>{t.pattern??(t.pattern=q$),ve.init(n,t),n._zod.check=e=>{const r=e.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const a=Number(s);if(`${a}`!==s)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{e.issues.push({code:"invalid_format",format:"cidrv6",input:e.value,inst:n,continue:!t.abort})}}});function Aw(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const OT=E("$ZodBase64",(n,t)=>{t.pattern??(t.pattern=j$),ve.init(n,t),n._zod.bag.contentEncoding="base64",n._zod.check=e=>{Aw(e.value)||e.issues.push({code:"invalid_format",format:"base64",input:e.value,inst:n,continue:!t.abort})}});function MT(n){if(!gw.test(n))return!1;const t=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),e=t.padEnd(Math.ceil(t.length/4)*4,"=");return Aw(e)}const NT=E("$ZodBase64URL",(n,t)=>{t.pattern??(t.pattern=gw),ve.init(n,t),n._zod.bag.contentEncoding="base64url",n._zod.check=e=>{MT(e.value)||e.issues.push({code:"invalid_format",format:"base64url",input:e.value,inst:n,continue:!t.abort})}}),zT=E("$ZodE164",(n,t)=>{t.pattern??(t.pattern=W$),ve.init(n,t)});function UT(n,t=null){try{const e=n.split(".");if(e.length!==3)return!1;const[r]=e;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const FT=E("$ZodJWT",(n,t)=>{ve.init(n,t),n._zod.check=e=>{UT(e.value,t.alg)||e.issues.push({code:"invalid_format",format:"jwt",input:e.value,inst:n,continue:!t.abort})}}),kw=E("$ZodNumber",(n,t)=>{we.init(n,t),n._zod.pattern=n._zod.bag.pattern??ww,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=Number(e.value)}catch{}const i=e.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return e;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return e.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...s?{received:s}:{}}),e}}),ZT=E("$ZodNumberFormat",(n,t)=>{rT.init(n,t),kw.init(n,t)}),HT=E("$ZodBoolean",(n,t)=>{we.init(n,t),n._zod.pattern=Q$,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=!!e.value}catch{}const i=e.value;return typeof i=="boolean"||e.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),e}}),VT=E("$ZodUnknown",(n,t)=>{we.init(n,t),n._zod.parse=e=>e}),BT=E("$ZodNever",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:n}),e)});function yv(n,t,e){n.issues.length&&t.issues.push(...Qs(e,n.issues)),t.value[e]=n.value}const qT=E("$ZodArray",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Array.isArray(i))return e.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),e;e.value=Array(i.length);const s=[];for(let a=0;a<i.length;a++){const l=i[a],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(u=>yv(u,e,a))):yv(c,e,a)}return s.length?Promise.all(s).then(()=>e):e}});function Xu(n,t,e,r,i){if(n.issues.length){if(i&&!(e in r))return;t.issues.push(...Qs(e,n.issues))}n.value===void 0?e in r&&(t.value[e]=void 0):t.value[e]=n.value}function Ew(n){var r,i,s,a;const t=Object.keys(n.shape);for(const l of t)if(!((a=(s=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:s.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const e=u$(n.shape);return{...n,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(e)}}function Cw(n,t,e,r,i,s){const a=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,p=c.optout==="optional";for(const m in t){if(l.has(m))continue;if(u==="never"){a.push(m);continue}const v=c.run({value:t[m],issues:[]},r);v instanceof Promise?n.push(v.then(y=>Xu(y,e,m,t,p))):Xu(v,e,m,t,p)}return a.length&&e.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:s}),n.length?Promise.all(n).then(()=>e):e}const jT=E("$ZodObject",(n,t)=>{we.init(n,t);const e=Object.getOwnPropertyDescriptor(t,"shape");if(!(e!=null&&e.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Jh(()=>Ew(t));ce(n._zod,"propValues",()=>{const l=t.shape,c={};for(const u in l){const p=l[u]._zod;if(p.values){c[u]??(c[u]=new Set);for(const m of p.values)c[u].add(m)}}return c});const i=ol,s=t.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const p=[],m=a.shape;for(const v of a.keys){const y=m[v],k=y._zod.optout==="optional",A=y._zod.run({value:u[v],issues:[]},c);A instanceof Promise?p.push(A.then(x=>Xu(x,l,v,u,k))):Xu(A,l,v,u,k)}return s?Cw(p,u,l,c,r.value,n):p.length?Promise.all(p).then(()=>l):l}}),WT=E("$ZodObjectJIT",(n,t)=>{jT.init(n,t);const e=n._zod.parse,r=Jh(()=>Ew(t)),i=v=>{var V;const y=new fT(["shape","payload","ctx"]),k=r.value,A=F=>{const G=gv(F);return`shape[${G}]._zod.run({ value: input[${G}], issues: [] }, ctx)`};y.write("const input = payload.value;");const x=Object.create(null);let L=0;for(const F of k.keys)x[F]=`key_${L++}`;y.write("const newResult = {};");for(const F of k.keys){const G=x[F],z=gv(F),J=v[F],re=((V=J==null?void 0:J._zod)==null?void 0:V.optout)==="optional";y.write(`const ${G} = ${A(F)};`),re?y.write(`
7
7
  if (${G}.issues.length) {
8
8
  if (${z} in input) {
9
9
  payload.issues = payload.issues.concat(${G}.issues.map(iss => ({
@@ -37,10 +37,10 @@ var p_=Object.defineProperty;var xg=n=>{throw TypeError(n)};var f_=(n,t,e)=>t in
37
37
  newResult[${z}] = ${G}.value;
38
38
  }
39
39
 
40
- `)}y.write("payload.value = newResult;"),y.write("return payload;");const D=y.compile();return(F,G)=>D(v,F,G)};let s;const a=ol,l=!sw.jitless,u=l&&s$.value,p=t.catchall;let m;n._zod.parse=(v,y)=>{m??(m=r.value);const k=v.value;return a(k)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),p?_w([],k,v,y,m,n):v):e(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:k,inst:n}),v)}});function mv(n,t,e,r){for(const s of n)if(s.issues.length===0)return t.value=s.value,t;const i=n.filter(s=>!Xs(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:e,errors:n.map(s=>s.issues.map(a=>li(a,r,ai())))}),t)}const Aw=E("$ZodUnion",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ce(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ce(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ce(n._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Pm(s.source)).join("|")})$`)}});const e=t.options.length===1,r=t.options[0]._zod.run;n._zod.parse=(i,s)=>{if(e)return r(i,s);let a=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>mv(c,i,n,s)):mv(l,i,n,s)}}),qT=E("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,Aw.init(n,t);const e=n._zod.parse;ce(n._zod,"propValues",()=>{const i={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Jh(()=>{var a;const i=t.options,s=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,l)}}return s});n._zod.parse=(i,s)=>{const a=i.value;if(!ol(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback?e(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:n}),i)}}),jT=E("$ZodIntersection",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,s=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>gv(e,c,u)):gv(e,s,a)}});function Lp(n,t){if(n===t)return{valid:!0,data:n};if(n instanceof Date&&t instanceof Date&&+n==+t)return{valid:!0,data:n};if(Qo(n)&&Qo(t)){const e=Object.keys(t),r=Object.keys(n).filter(s=>e.indexOf(s)!==-1),i={...n,...t};for(const s of r){const a=Lp(n[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return{valid:!1,mergeErrorPath:[]};const e=[];for(let r=0;r<n.length;r++){const i=n[r],s=t[r],a=Lp(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};e.push(a.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function gv(n,t,e){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of e.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&n.issues.push({...i,keys:s}),Xs(n))return n;const a=Lp(t.value,e.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const WT=E("$ZodRecord",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Qo(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const s=[],a=t.keyType._zod.values;if(a){e.value={};const l=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&e.issues.push(...Qs(u,m.issues)),e.value[u]=m.value})):(p.issues.length&&e.issues.push(...Qs(u,p.issues)),e.value[u]=p.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&e.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{e.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&mw.test(l)&&c.issues.length){const m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(c=m)}if(c.issues.length){t.mode==="loose"?e.value[l]=i[l]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(m=>li(m,r,ai())),input:l,path:[l],inst:n});continue}const p=t.valueType._zod.run({value:i[l],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&e.issues.push(...Qs(l,m.issues)),e.value[c.value]=m.value})):(p.issues.length&&e.issues.push(...Qs(l,p.issues)),e.value[c.value]=p.value)}}return s.length?Promise.all(s).then(()=>e):e}}),GT=E("$ZodEnum",(n,t)=>{we.init(n,t);const e=ow(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>o$.has(typeof i)).map(i=>typeof i=="string"?ea(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:e,input:a,inst:n}),i}}),YT=E("$ZodLiteral",(n,t)=>{if(we.init(n,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const e=new Set(t.values);n._zod.values=e,n._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ea(r):r?ea(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const s=r.value;return e.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:n}),r}}),JT=E("$ZodTransform",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new iw(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(e.value=a,e));if(i instanceof Promise)throw new io;return e.value=i,e}});function vv(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const kw=E("$ZodOptional",(n,t)=>{we.init(n,t),n._zod.optin="optional",n._zod.optout="optional",ce(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ce(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Pm(e.source)})?$`):void 0}),n._zod.parse=(e,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>vv(s,e.value)):vv(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),KT=E("$ZodExactOptional",(n,t)=>{kw.init(n,t),ce(n._zod,"values",()=>t.innerType._zod.values),ce(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),XT=E("$ZodNullable",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.innerType._zod.optin),ce(n._zod,"optout",()=>t.innerType._zod.optout),ce(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Pm(e.source)}|null)$`):void 0}),ce(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),n._zod.parse=(e,r)=>e.value===null?e:t.innerType._zod.run(e,r)}),QT=E("$ZodDefault",(n,t)=>{we.init(n,t),n._zod.optin="optional",ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);if(e.value===void 0)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>yv(s,t)):yv(i,t)}});function yv(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const eR=E("$ZodPrefault",(n,t)=>{we.init(n,t),n._zod.optin="optional",ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>(r.direction==="backward"||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),tR=E("$ZodNonOptional",(n,t)=>{we.init(n,t),ce(n._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(r=>r!==void 0)):void 0}),n._zod.parse=(e,r)=>{const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>wv(s,n)):wv(i,n)}});function wv(n,t){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:t}),n}const nR=E("$ZodCatch",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.innerType._zod.optin),ce(n._zod,"optout",()=>t.innerType._zod.optout),ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(a=>li(a,r,ai()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(s=>li(s,r,ai()))},input:e.value}),e.issues=[]),e)}}),rR=E("$ZodPipe",(n,t)=>{we.init(n,t),ce(n._zod,"values",()=>t.in._zod.values),ce(n._zod,"optin",()=>t.in._zod.optin),ce(n._zod,"optout",()=>t.out._zod.optout),ce(n._zod,"propValues",()=>t.in._zod.propValues),n._zod.parse=(e,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(e,r);return s instanceof Promise?s.then(a=>Wc(a,t.in,r)):Wc(s,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(s=>Wc(s,t.out,r)):Wc(i,t.out,r)}});function Wc(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const iR=E("$ZodReadonly",(n,t)=>{we.init(n,t),ce(n._zod,"propValues",()=>t.innerType._zod.propValues),ce(n._zod,"values",()=>t.innerType._zod.values),ce(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),ce(n._zod,"optout",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optout}),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(bv):bv(i)}});function bv(n){return n.value=Object.freeze(n.value),n}const sR=E("$ZodCustom",(n,t)=>{ut.init(n,t),we.init(n,t),n._zod.parse=(e,r)=>e,n._zod.check=e=>{const r=e.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>Sv(s,e,r,n));Sv(i,e,r,n)}});function Sv(n,t,e,r){if(!n){const i={code:"custom",input:e,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(al(i))}}var _v;class oR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function aR(){return new oR}(_v=globalThis).__zod_globalRegistry??(_v.__zod_globalRegistry=aR());const Na=globalThis.__zod_globalRegistry;function lR(n,t){return new n({type:"string",...U(t)})}function cR(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...U(t)})}function Av(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...U(t)})}function uR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...U(t)})}function hR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(t)})}function dR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(t)})}function pR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(t)})}function fR(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...U(t)})}function mR(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...U(t)})}function gR(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(t)})}function vR(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...U(t)})}function yR(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(t)})}function wR(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...U(t)})}function bR(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...U(t)})}function SR(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(t)})}function _R(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(t)})}function AR(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(t)})}function kR(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(t)})}function ER(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(t)})}function CR(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...U(t)})}function $R(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...U(t)})}function TR(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...U(t)})}function RR(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...U(t)})}function IR(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(t)})}function xR(n,t){return new n({type:"string",format:"date",check:"string_format",...U(t)})}function PR(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...U(t)})}function LR(n,t){return new n({type:"string",format:"duration",check:"string_format",...U(t)})}function DR(n,t){return new n({type:"number",checks:[],...U(t)})}function OR(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...U(t)})}function MR(n,t){return new n({type:"boolean",...U(t)})}function NR(n){return new n({type:"unknown"})}function zR(n,t){return new n({type:"never",...U(t)})}function kv(n,t){return new vw({check:"less_than",...U(t),value:n,inclusive:!1})}function ep(n,t){return new vw({check:"less_than",...U(t),value:n,inclusive:!0})}function Ev(n,t){return new yw({check:"greater_than",...U(t),value:n,inclusive:!1})}function tp(n,t){return new yw({check:"greater_than",...U(t),value:n,inclusive:!0})}function Cv(n,t){return new Q$({check:"multiple_of",...U(t),value:n})}function Ew(n,t){return new tT({check:"max_length",...U(t),maximum:n})}function Qu(n,t){return new nT({check:"min_length",...U(t),minimum:n})}function Cw(n,t){return new rT({check:"length_equals",...U(t),length:n})}function UR(n,t){return new iT({check:"string_format",format:"regex",...U(t),pattern:n})}function FR(n){return new sT({check:"string_format",format:"lowercase",...U(n)})}function ZR(n){return new oT({check:"string_format",format:"uppercase",...U(n)})}function HR(n,t){return new aT({check:"string_format",format:"includes",...U(t),includes:n})}function VR(n,t){return new lT({check:"string_format",format:"starts_with",...U(t),prefix:n})}function BR(n,t){return new cT({check:"string_format",format:"ends_with",...U(t),suffix:n})}function da(n){return new uT({check:"overwrite",tx:n})}function qR(n){return da(t=>t.normalize(n))}function jR(){return da(n=>n.trim())}function WR(){return da(n=>n.toLowerCase())}function GR(){return da(n=>n.toUpperCase())}function YR(){return da(n=>i$(n))}function JR(n,t,e){return new n({type:"array",element:t,...U(e)})}function KR(n,t,e){return new n({type:"custom",check:"custom",fn:t,...U(e)})}function XR(n){const t=QR(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(al(r,e.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=e.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),e.issues.push(al(i))}},n(e.value,e)));return t}function QR(n,t){const e=new ut({check:"custom",...U(t)});return e._zod.check=n,e}function $w(n){let t=(n==null?void 0:n.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??Na,target:t,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Te(n,t,e={path:[],schemaPath:[]}){var p,m;var r;const i=n._zod.def,s=t.seen.get(n);if(s)return s.count++,e.schemaPath.includes(n)&&(s.cycle=e.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,a);const l=(m=(p=n._zod).toJSONSchema)==null?void 0:m.call(p);if(l)a.schema=l;else{const v={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,a.schema,v);else{const k=a.schema,A=t.processors[i.type];if(!A)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);A(n,t,k,v)}const y=n._zod.parent;y&&(a.ref||(a.ref=y),Te(y,t,v),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),t.io==="input"&&je(n)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(n).schema}function Tw(n,t){var a,l,c,u;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const p of n.seen.entries()){const m=(a=n.metadataRegistry.get(p[0]))==null?void 0:a.id;if(m){const v=r.get(m);if(v&&v!==p[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,p[0])}}const i=p=>{var A;const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(A=n.external.registry.get(p[0]))==null?void 0:A.id,L=n.external.uri??(V=>V);if(x)return{ref:L(x)};const D=p[1].defId??p[1].schema.id??`schema${n.counter++}`;return p[1].defId=D,{defId:D,ref:`${L("__shared")}#/${m}/${D}`}}if(p[1]===e)return{ref:"#"};const y=`#/${m}/`,k=p[1].schema.id??`__schema${n.counter++}`;return{defId:k,ref:y+k}},s=p=>{if(p[1].schema.$ref)return;const m=p[1],{ref:v,defId:y}=i(p);m.def={...m.schema},y&&(m.defId=y);const k=m.schema;for(const A in k)delete k[A];k.$ref=v};if(n.cycles==="throw")for(const p of n.seen.entries()){const m=p[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.cycle)==null?void 0:l.join("/")}/<root>
40
+ `)}y.write("payload.value = newResult;"),y.write("return payload;");const D=y.compile();return(F,G)=>D(v,F,G)};let s;const a=ol,l=!cw.jitless,u=l&&l$.value,p=t.catchall;let m;n._zod.parse=(v,y)=>{m??(m=r.value);const k=v.value;return a(k)?l&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),p?Cw([],k,v,y,m,n):v):e(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:k,inst:n}),v)}});function wv(n,t,e,r){for(const s of n)if(s.issues.length===0)return t.value=s.value,t;const i=n.filter(s=>!Xs(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:e,errors:n.map(s=>s.issues.map(a=>li(a,r,ai())))}),t)}const $w=E("$ZodUnion",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ce(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ce(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ce(n._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(s=>s._zod.pattern);return new RegExp(`^(${i.map(s=>Dm(s.source)).join("|")})$`)}});const e=t.options.length===1,r=t.options[0]._zod.run;n._zod.parse=(i,s)=>{if(e)return r(i,s);let a=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>wv(c,i,n,s)):wv(l,i,n,s)}}),GT=E("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,$w.init(n,t);const e=n._zod.parse;ce(n._zod,"propValues",()=>{const i={};for(const s of t.options){const a=s._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Jh(()=>{var a;const i=t.options,s=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,l)}}return s});n._zod.parse=(i,s)=>{const a=i.value;if(!ol(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback?e(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:n}),i)}}),YT=E("$ZodIntersection",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,s=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||a instanceof Promise?Promise.all([s,a]).then(([c,u])=>bv(e,c,u)):bv(e,s,a)}});function Op(n,t){if(n===t)return{valid:!0,data:n};if(n instanceof Date&&t instanceof Date&&+n==+t)return{valid:!0,data:n};if(Qo(n)&&Qo(t)){const e=Object.keys(t),r=Object.keys(n).filter(s=>e.indexOf(s)!==-1),i={...n,...t};for(const s of r){const a=Op(n[s],t[s]);if(!a.valid)return{valid:!1,mergeErrorPath:[s,...a.mergeErrorPath]};i[s]=a.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return{valid:!1,mergeErrorPath:[]};const e=[];for(let r=0;r<n.length;r++){const i=n[r],s=t[r],a=Op(i,s);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};e.push(a.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function bv(n,t,e){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of e.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&n.issues.push({...i,keys:s}),Xs(n))return n;const a=Op(t.value,e.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const JT=E("$ZodRecord",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Qo(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const s=[],a=t.keyType._zod.values;if(a){e.value={};const l=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const p=t.valueType._zod.run({value:i[u],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&e.issues.push(...Qs(u,m.issues)),e.value[u]=m.value})):(p.issues.length&&e.issues.push(...Qs(u,p.issues)),e.value[u]=p.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&e.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{e.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&ww.test(l)&&c.issues.length){const m=t.keyType._zod.run({value:Number(l),issues:[]},r);if(m instanceof Promise)throw new Error("Async schemas not supported in object keys currently");m.issues.length===0&&(c=m)}if(c.issues.length){t.mode==="loose"?e.value[l]=i[l]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(m=>li(m,r,ai())),input:l,path:[l],inst:n});continue}const p=t.valueType._zod.run({value:i[l],issues:[]},r);p instanceof Promise?s.push(p.then(m=>{m.issues.length&&e.issues.push(...Qs(l,m.issues)),e.value[c.value]=m.value})):(p.issues.length&&e.issues.push(...Qs(l,p.issues)),e.value[c.value]=p.value)}}return s.length?Promise.all(s).then(()=>e):e}}),KT=E("$ZodEnum",(n,t)=>{we.init(n,t);const e=uw(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>c$.has(typeof i)).map(i=>typeof i=="string"?ea(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:e,input:a,inst:n}),i}}),XT=E("$ZodLiteral",(n,t)=>{if(we.init(n,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const e=new Set(t.values);n._zod.values=e,n._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?ea(r):r?ea(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const s=r.value;return e.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:n}),r}}),QT=E("$ZodTransform",(n,t)=>{we.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new lw(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(e.value=a,e));if(i instanceof Promise)throw new io;return e.value=i,e}});function Sv(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const Tw=E("$ZodOptional",(n,t)=>{we.init(n,t),n._zod.optin="optional",n._zod.optout="optional",ce(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ce(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Dm(e.source)})?$`):void 0}),n._zod.parse=(e,r)=>{if(t.innerType._zod.optin==="optional"){const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>Sv(s,e.value)):Sv(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),eR=E("$ZodExactOptional",(n,t)=>{Tw.init(n,t),ce(n._zod,"values",()=>t.innerType._zod.values),ce(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),tR=E("$ZodNullable",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.innerType._zod.optin),ce(n._zod,"optout",()=>t.innerType._zod.optout),ce(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${Dm(e.source)}|null)$`):void 0}),ce(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),n._zod.parse=(e,r)=>e.value===null?e:t.innerType._zod.run(e,r)}),nR=E("$ZodDefault",(n,t)=>{we.init(n,t),n._zod.optin="optional",ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);if(e.value===void 0)return e.value=t.defaultValue,e;const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>_v(s,t)):_v(i,t)}});function _v(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const rR=E("$ZodPrefault",(n,t)=>{we.init(n,t),n._zod.optin="optional",ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>(r.direction==="backward"||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),iR=E("$ZodNonOptional",(n,t)=>{we.init(n,t),ce(n._zod,"values",()=>{const e=t.innerType._zod.values;return e?new Set([...e].filter(r=>r!==void 0)):void 0}),n._zod.parse=(e,r)=>{const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>Av(s,n)):Av(i,n)}});function Av(n,t){return!n.issues.length&&n.value===void 0&&n.issues.push({code:"invalid_type",expected:"nonoptional",input:n.value,inst:t}),n}const sR=E("$ZodCatch",(n,t)=>{we.init(n,t),ce(n._zod,"optin",()=>t.innerType._zod.optin),ce(n._zod,"optout",()=>t.innerType._zod.optout),ce(n._zod,"values",()=>t.innerType._zod.values),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(s=>(e.value=s.value,s.issues.length&&(e.value=t.catchValue({...e,error:{issues:s.issues.map(a=>li(a,r,ai()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(s=>li(s,r,ai()))},input:e.value}),e.issues=[]),e)}}),oR=E("$ZodPipe",(n,t)=>{we.init(n,t),ce(n._zod,"values",()=>t.in._zod.values),ce(n._zod,"optin",()=>t.in._zod.optin),ce(n._zod,"optout",()=>t.out._zod.optout),ce(n._zod,"propValues",()=>t.in._zod.propValues),n._zod.parse=(e,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(e,r);return s instanceof Promise?s.then(a=>Wc(a,t.in,r)):Wc(s,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(s=>Wc(s,t.out,r)):Wc(i,t.out,r)}});function Wc(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const aR=E("$ZodReadonly",(n,t)=>{we.init(n,t),ce(n._zod,"propValues",()=>t.innerType._zod.propValues),ce(n._zod,"values",()=>t.innerType._zod.values),ce(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),ce(n._zod,"optout",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optout}),n._zod.parse=(e,r)=>{if(r.direction==="backward")return t.innerType._zod.run(e,r);const i=t.innerType._zod.run(e,r);return i instanceof Promise?i.then(kv):kv(i)}});function kv(n){return n.value=Object.freeze(n.value),n}const lR=E("$ZodCustom",(n,t)=>{ut.init(n,t),we.init(n,t),n._zod.parse=(e,r)=>e,n._zod.check=e=>{const r=e.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>Ev(s,e,r,n));Ev(i,e,r,n)}});function Ev(n,t,e,r){if(!n){const i={code:"custom",input:e,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(al(i))}}var Cv;class cR{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...e){const r=e[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const e=this._map.get(t);return e&&typeof e=="object"&&"id"in e&&this._idmap.delete(e.id),this._map.delete(t),this}get(t){const e=t._zod.parent;if(e){const r={...this.get(e)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function uR(){return new cR}(Cv=globalThis).__zod_globalRegistry??(Cv.__zod_globalRegistry=uR());const Na=globalThis.__zod_globalRegistry;function hR(n,t){return new n({type:"string",...U(t)})}function dR(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...U(t)})}function $v(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...U(t)})}function pR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...U(t)})}function fR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...U(t)})}function mR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...U(t)})}function gR(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...U(t)})}function vR(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...U(t)})}function yR(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...U(t)})}function wR(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...U(t)})}function bR(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...U(t)})}function SR(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...U(t)})}function _R(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...U(t)})}function AR(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...U(t)})}function kR(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...U(t)})}function ER(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...U(t)})}function CR(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...U(t)})}function $R(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...U(t)})}function TR(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...U(t)})}function RR(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...U(t)})}function IR(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...U(t)})}function xR(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...U(t)})}function PR(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...U(t)})}function LR(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...U(t)})}function DR(n,t){return new n({type:"string",format:"date",check:"string_format",...U(t)})}function OR(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...U(t)})}function MR(n,t){return new n({type:"string",format:"duration",check:"string_format",...U(t)})}function NR(n,t){return new n({type:"number",checks:[],...U(t)})}function zR(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...U(t)})}function UR(n,t){return new n({type:"boolean",...U(t)})}function FR(n){return new n({type:"unknown"})}function ZR(n,t){return new n({type:"never",...U(t)})}function Tv(n,t){return new Sw({check:"less_than",...U(t),value:n,inclusive:!1})}function np(n,t){return new Sw({check:"less_than",...U(t),value:n,inclusive:!0})}function Rv(n,t){return new _w({check:"greater_than",...U(t),value:n,inclusive:!1})}function rp(n,t){return new _w({check:"greater_than",...U(t),value:n,inclusive:!0})}function Iv(n,t){return new nT({check:"multiple_of",...U(t),value:n})}function Rw(n,t){return new iT({check:"max_length",...U(t),maximum:n})}function Qu(n,t){return new sT({check:"min_length",...U(t),minimum:n})}function Iw(n,t){return new oT({check:"length_equals",...U(t),length:n})}function HR(n,t){return new aT({check:"string_format",format:"regex",...U(t),pattern:n})}function VR(n){return new lT({check:"string_format",format:"lowercase",...U(n)})}function BR(n){return new cT({check:"string_format",format:"uppercase",...U(n)})}function qR(n,t){return new uT({check:"string_format",format:"includes",...U(t),includes:n})}function jR(n,t){return new hT({check:"string_format",format:"starts_with",...U(t),prefix:n})}function WR(n,t){return new dT({check:"string_format",format:"ends_with",...U(t),suffix:n})}function da(n){return new pT({check:"overwrite",tx:n})}function GR(n){return da(t=>t.normalize(n))}function YR(){return da(n=>n.trim())}function JR(){return da(n=>n.toLowerCase())}function KR(){return da(n=>n.toUpperCase())}function XR(){return da(n=>a$(n))}function QR(n,t,e){return new n({type:"array",element:t,...U(e)})}function eI(n,t,e){return new n({type:"custom",check:"custom",fn:t,...U(e)})}function tI(n){const t=nI(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(al(r,e.value,t._zod.def));else{const i=r;i.fatal&&(i.continue=!1),i.code??(i.code="custom"),i.input??(i.input=e.value),i.inst??(i.inst=t),i.continue??(i.continue=!t._zod.def.abort),e.issues.push(al(i))}},n(e.value,e)));return t}function nI(n,t){const e=new ut({check:"custom",...U(t)});return e._zod.check=n,e}function xw(n){let t=(n==null?void 0:n.target)??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:n.processors??{},metadataRegistry:(n==null?void 0:n.metadata)??Na,target:t,unrepresentable:(n==null?void 0:n.unrepresentable)??"throw",override:(n==null?void 0:n.override)??(()=>{}),io:(n==null?void 0:n.io)??"output",counter:0,seen:new Map,cycles:(n==null?void 0:n.cycles)??"ref",reused:(n==null?void 0:n.reused)??"inline",external:(n==null?void 0:n.external)??void 0}}function Te(n,t,e={path:[],schemaPath:[]}){var p,m;var r;const i=n._zod.def,s=t.seen.get(n);if(s)return s.count++,e.schemaPath.includes(n)&&(s.cycle=e.path),s.schema;const a={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,a);const l=(m=(p=n._zod).toJSONSchema)==null?void 0:m.call(p);if(l)a.schema=l;else{const v={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,a.schema,v);else{const k=a.schema,A=t.processors[i.type];if(!A)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);A(n,t,k,v)}const y=n._zod.parent;y&&(a.ref||(a.ref=y),Te(y,t,v),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),t.io==="input"&&je(n)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(n).schema}function Pw(n,t){var a,l,c,u;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const p of n.seen.entries()){const m=(a=n.metadataRegistry.get(p[0]))==null?void 0:a.id;if(m){const v=r.get(m);if(v&&v!==p[0])throw new Error(`Duplicate schema id "${m}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(m,p[0])}}const i=p=>{var A;const m=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const x=(A=n.external.registry.get(p[0]))==null?void 0:A.id,L=n.external.uri??(V=>V);if(x)return{ref:L(x)};const D=p[1].defId??p[1].schema.id??`schema${n.counter++}`;return p[1].defId=D,{defId:D,ref:`${L("__shared")}#/${m}/${D}`}}if(p[1]===e)return{ref:"#"};const y=`#/${m}/`,k=p[1].schema.id??`__schema${n.counter++}`;return{defId:k,ref:y+k}},s=p=>{if(p[1].schema.$ref)return;const m=p[1],{ref:v,defId:y}=i(p);m.def={...m.schema},y&&(m.defId=y);const k=m.schema;for(const A in k)delete k[A];k.$ref=v};if(n.cycles==="throw")for(const p of n.seen.entries()){const m=p[1];if(m.cycle)throw new Error(`Cycle detected: #/${(l=m.cycle)==null?void 0:l.join("/")}/<root>
41
41
 
42
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of n.seen.entries()){const m=p[1];if(t===p[0]){s(p);continue}if(n.external){const y=(c=n.external.registry.get(p[0]))==null?void 0:c.id;if(t!==p[0]&&y){s(p);continue}}if((u=n.metadataRegistry.get(p[0]))==null?void 0:u.id){s(p);continue}if(m.cycle){s(p);continue}if(m.count>1&&n.reused==="ref"){s(p);continue}}}function Rw(n,t){var a,l,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const p=n.seen.get(u);if(p.ref===null)return;const m=p.def??p.schema,v={...m},y=p.ref;if(p.ref=null,y){r(y);const A=n.seen.get(y),x=A.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,v),u._zod.parent===y)for(const D in m)D==="$ref"||D==="allOf"||D in v||delete m[D];if(x.$ref&&A.def)for(const D in m)D==="$ref"||D==="allOf"||D in A.def&&JSON.stringify(m[D])===JSON.stringify(A.def[D])&&delete m[D]}const k=u._zod.parent;if(k&&k!==y){r(k);const A=n.seen.get(k);if(A!=null&&A.schema.$ref&&(m.$ref=A.schema.$ref,A.def))for(const x in m)x==="$ref"||x==="allOf"||x in A.def&&JSON.stringify(m[x])===JSON.stringify(A.def[x])&&delete m[x]}n.override({zodSchema:u,jsonSchema:m,path:p.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(a=n.external)!=null&&a.uri){const u=(l=n.external.registry.get(t))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,e.def??e.schema);const s=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const p=u[1];p.def&&p.defId&&(s[p.defId]=p.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:eh(t,"input",n.processors),output:eh(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function je(n,t){const e=t??{seen:new Set};if(e.seen.has(n))return!1;e.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return je(r.element,e);if(r.type==="set")return je(r.valueType,e);if(r.type==="lazy")return je(r.getter(),e);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return je(r.innerType,e);if(r.type==="intersection")return je(r.left,e)||je(r.right,e);if(r.type==="record"||r.type==="map")return je(r.keyType,e)||je(r.valueType,e);if(r.type==="pipe")return je(r.in,e)||je(r.out,e);if(r.type==="object"){for(const i in r.shape)if(je(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(je(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(je(i,e))return!0;return!!(r.rest&&je(r.rest,e))}return!1}const eI=(n,t={})=>e=>{const r=$w({...e,processors:t});return Te(n,r),Tw(r,n),Rw(r,n)},eh=(n,t,e={})=>r=>{const{libraryOptions:i,target:s}=r??{},a=$w({...i??{},target:s,io:t,processors:e});return Te(n,a),Tw(a,n),Rw(a,n)},tI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},nI=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:s,maximum:a,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),l&&(i.format=tI[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const p=[...c];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},rI=(n,t,e,r)=>{const i=e,{minimum:s,maximum:a,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:p}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof s=="number"&&(i.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},iI=(n,t,e,r)=>{e.type="boolean"},sI=(n,t,e,r)=>{e.not={}},oI=(n,t,e,r)=>{},aI=(n,t,e,r)=>{const i=n._zod.def,s=ow(i.entries);s.every(a=>typeof a=="number")&&(e.type="number"),s.every(a=>typeof a=="string")&&(e.type="string"),e.enum=s},lI=(n,t,e,r)=>{const i=n._zod.def,s=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];e.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[a]:e.const=a}else s.every(a=>typeof a=="number")&&(e.type="number"),s.every(a=>typeof a=="string")&&(e.type="string"),s.every(a=>typeof a=="boolean")&&(e.type="boolean"),s.every(a=>a===null)&&(e.type="null"),e.enum=s},cI=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},uI=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},hI=(n,t,e,r)=>{const i=e,s=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Te(s.element,t,{...r,path:[...r.path,"items"]})},dI=(n,t,e,r)=>{var u;const i=e,s=n._zod.def;i.type="object",i.properties={};const a=s.shape;for(const p in a)i.properties[p]=Te(a[p],t,{...r,path:[...r.path,"properties",p]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(p=>{const m=s.shape[p]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Te(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},pI=(n,t,e,r)=>{const i=n._zod.def,s=i.inclusive===!1,a=i.options.map((l,c)=>Te(l,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?e.oneOf=a:e.anyOf=a},fI=(n,t,e,r)=>{const i=n._zod.def,s=Te(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=Te(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(s)?s.allOf:[s],...l(a)?a.allOf:[a]];e.allOf=c},mI=(n,t,e,r)=>{const i=e,s=n._zod.def;i.type="object";const a=s.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const p=Te(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of c)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Te(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Te(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=a._zod.values;if(u){const p=[...u].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},gI=(n,t,e,r)=>{const i=n._zod.def,s=Te(i.innerType,t,r),a=t.seen.get(n);t.target==="openapi-3.0"?(a.ref=i.innerType,e.nullable=!0):e.anyOf=[s,{type:"null"}]},vI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},yI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},wI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,t.io==="input"&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},bI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=a},SI=(n,t,e,r)=>{const i=n._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Te(s,t,r);const a=t.seen.get(n);a.ref=s},_I=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.readOnly=!0},Iw=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},AI=E("ZodISODateTime",(n,t)=>{kT.init(n,t),Se.init(n,t)});function kI(n){return IR(AI,n)}const EI=E("ZodISODate",(n,t)=>{ET.init(n,t),Se.init(n,t)});function CI(n){return xR(EI,n)}const $I=E("ZodISOTime",(n,t)=>{CT.init(n,t),Se.init(n,t)});function TI(n){return PR($I,n)}const RI=E("ZodISODuration",(n,t)=>{$T.init(n,t),Se.init(n,t)});function II(n){return LR(RI,n)}const xw=(n,t)=>{uw.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>v$(n,e)},flatten:{value:e=>g$(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,Pp,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,Pp,2)}},isEmpty:{get(){return n.issues.length===0}}})},$v=E("ZodError",xw),zt=E("ZodError",xw,{Parent:Error}),xI=Dm(zt),PI=Om(zt),LI=Kh(zt),DI=Xh(zt),OI=b$(zt),MI=S$(zt),NI=_$(zt),zI=A$(zt),UI=k$(zt),FI=E$(zt),ZI=C$(zt),HI=$$(zt),be=E("ZodType",(n,t)=>(we.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:eh(n,"input"),output:eh(n,"output")}}),n.toJSONSchema=eI(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone(pi(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(e,r)=>fi(n,e,r),n.brand=()=>n,n.register=(e,r)=>(e.add(n,r),n),n.parse=(e,r)=>xI(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>LI(n,e,r),n.parseAsync=async(e,r)=>PI(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>DI(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>OI(n,e,r),n.decode=(e,r)=>MI(n,e,r),n.encodeAsync=async(e,r)=>NI(n,e,r),n.decodeAsync=async(e,r)=>zI(n,e,r),n.safeEncode=(e,r)=>UI(n,e,r),n.safeDecode=(e,r)=>FI(n,e,r),n.safeEncodeAsync=async(e,r)=>ZI(n,e,r),n.safeDecodeAsync=async(e,r)=>HI(n,e,r),n.refine=(e,r)=>n.check(D3(e,r)),n.superRefine=e=>n.check(O3(e)),n.overwrite=e=>n.check(da(e)),n.optional=()=>Iv(n),n.exactOptional=()=>S3(n),n.nullable=()=>xv(n),n.nullish=()=>Iv(xv(n)),n.nonoptional=e=>$3(n,e),n.array=()=>M(n),n.or=e=>K([n,e]),n.and=e=>ed(n,e),n.transform=e=>Pv(n,w3(e)),n.default=e=>k3(n,e),n.prefault=e=>C3(n,e),n.catch=e=>R3(n,e),n.pipe=e=>Pv(n,e),n.readonly=()=>P3(n),n.describe=e=>{const r=n.clone();return Na.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=Na.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return Na.get(n);const r=n.clone();return Na.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),Pw=E("_ZodString",(n,t)=>{Mm.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>nI(n,r,i);const e=n._zod.bag;n.format=e.format??null,n.minLength=e.minimum??null,n.maxLength=e.maximum??null,n.regex=(...r)=>n.check(UR(...r)),n.includes=(...r)=>n.check(HR(...r)),n.startsWith=(...r)=>n.check(VR(...r)),n.endsWith=(...r)=>n.check(BR(...r)),n.min=(...r)=>n.check(Qu(...r)),n.max=(...r)=>n.check(Ew(...r)),n.length=(...r)=>n.check(Cw(...r)),n.nonempty=(...r)=>n.check(Qu(1,...r)),n.lowercase=r=>n.check(FR(r)),n.uppercase=r=>n.check(ZR(r)),n.trim=()=>n.check(jR()),n.normalize=(...r)=>n.check(qR(...r)),n.toLowerCase=()=>n.check(WR()),n.toUpperCase=()=>n.check(GR()),n.slugify=()=>n.check(YR())}),VI=E("ZodString",(n,t)=>{Mm.init(n,t),Pw.init(n,t),n.email=e=>n.check(cR(BI,e)),n.url=e=>n.check(fR(qI,e)),n.jwt=e=>n.check(RR(o3,e)),n.emoji=e=>n.check(mR(jI,e)),n.guid=e=>n.check(Av(Tv,e)),n.uuid=e=>n.check(uR(Gc,e)),n.uuidv4=e=>n.check(hR(Gc,e)),n.uuidv6=e=>n.check(dR(Gc,e)),n.uuidv7=e=>n.check(pR(Gc,e)),n.nanoid=e=>n.check(gR(WI,e)),n.guid=e=>n.check(Av(Tv,e)),n.cuid=e=>n.check(vR(GI,e)),n.cuid2=e=>n.check(yR(YI,e)),n.ulid=e=>n.check(wR(JI,e)),n.base64=e=>n.check(CR(r3,e)),n.base64url=e=>n.check($R(i3,e)),n.xid=e=>n.check(bR(KI,e)),n.ksuid=e=>n.check(SR(XI,e)),n.ipv4=e=>n.check(_R(QI,e)),n.ipv6=e=>n.check(AR(e3,e)),n.cidrv4=e=>n.check(kR(t3,e)),n.cidrv6=e=>n.check(ER(n3,e)),n.e164=e=>n.check(TR(s3,e)),n.datetime=e=>n.check(kI(e)),n.date=e=>n.check(CI(e)),n.time=e=>n.check(TI(e)),n.duration=e=>n.check(II(e))});function f(n){return lR(VI,n)}const Se=E("ZodStringFormat",(n,t)=>{ve.init(n,t),Pw.init(n,t)}),BI=E("ZodEmail",(n,t)=>{mT.init(n,t),Se.init(n,t)}),Tv=E("ZodGUID",(n,t)=>{pT.init(n,t),Se.init(n,t)}),Gc=E("ZodUUID",(n,t)=>{fT.init(n,t),Se.init(n,t)}),qI=E("ZodURL",(n,t)=>{gT.init(n,t),Se.init(n,t)}),jI=E("ZodEmoji",(n,t)=>{vT.init(n,t),Se.init(n,t)}),WI=E("ZodNanoID",(n,t)=>{yT.init(n,t),Se.init(n,t)}),GI=E("ZodCUID",(n,t)=>{wT.init(n,t),Se.init(n,t)}),YI=E("ZodCUID2",(n,t)=>{bT.init(n,t),Se.init(n,t)}),JI=E("ZodULID",(n,t)=>{ST.init(n,t),Se.init(n,t)}),KI=E("ZodXID",(n,t)=>{_T.init(n,t),Se.init(n,t)}),XI=E("ZodKSUID",(n,t)=>{AT.init(n,t),Se.init(n,t)}),QI=E("ZodIPv4",(n,t)=>{TT.init(n,t),Se.init(n,t)}),e3=E("ZodIPv6",(n,t)=>{RT.init(n,t),Se.init(n,t)}),t3=E("ZodCIDRv4",(n,t)=>{IT.init(n,t),Se.init(n,t)}),n3=E("ZodCIDRv6",(n,t)=>{xT.init(n,t),Se.init(n,t)}),r3=E("ZodBase64",(n,t)=>{PT.init(n,t),Se.init(n,t)}),i3=E("ZodBase64URL",(n,t)=>{DT.init(n,t),Se.init(n,t)}),s3=E("ZodE164",(n,t)=>{OT.init(n,t),Se.init(n,t)}),o3=E("ZodJWT",(n,t)=>{NT.init(n,t),Se.init(n,t)}),Lw=E("ZodNumber",(n,t)=>{bw.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>rI(n,r,i),n.gt=(r,i)=>n.check(Ev(r,i)),n.gte=(r,i)=>n.check(tp(r,i)),n.min=(r,i)=>n.check(tp(r,i)),n.lt=(r,i)=>n.check(kv(r,i)),n.lte=(r,i)=>n.check(ep(r,i)),n.max=(r,i)=>n.check(ep(r,i)),n.int=r=>n.check(Rv(r)),n.safe=r=>n.check(Rv(r)),n.positive=r=>n.check(Ev(0,r)),n.nonnegative=r=>n.check(tp(0,r)),n.negative=r=>n.check(kv(0,r)),n.nonpositive=r=>n.check(ep(0,r)),n.multipleOf=(r,i)=>n.check(Cv(r,i)),n.step=(r,i)=>n.check(Cv(r,i)),n.finite=()=>n;const e=n._zod.bag;n.minValue=Math.max(e.minimum??Number.NEGATIVE_INFINITY,e.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(e.maximum??Number.POSITIVE_INFINITY,e.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(e.format??"").includes("int")||Number.isSafeInteger(e.multipleOf??.5),n.isFinite=!0,n.format=e.format??null});function W(n){return DR(Lw,n)}const a3=E("ZodNumberFormat",(n,t)=>{zT.init(n,t),Lw.init(n,t)});function Rv(n){return OR(a3,n)}const l3=E("ZodBoolean",(n,t)=>{UT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>iI(n,e,r)});function Oe(n){return MR(l3,n)}const c3=E("ZodUnknown",(n,t)=>{FT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>oI()});function S(){return NR(c3)}const u3=E("ZodNever",(n,t)=>{ZT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>sI(n,e,r)});function h3(n){return zR(u3,n)}const d3=E("ZodArray",(n,t)=>{HT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>hI(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(Qu(e,r)),n.nonempty=e=>n.check(Qu(1,e)),n.max=(e,r)=>n.check(Ew(e,r)),n.length=(e,r)=>n.check(Cw(e,r)),n.unwrap=()=>n.element});function M(n,t){return JR(d3,n,t)}const Dw=E("ZodObject",(n,t)=>{BT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>dI(n,e,r,i),ce(n,"shape",()=>t.shape),n.keyof=()=>Nw(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:S()}),n.loose=()=>n.clone({...n._zod.def,catchall:S()}),n.strict=()=>n.clone({...n._zod.def,catchall:h3()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>h$(n,e),n.safeExtend=e=>d$(n,e),n.merge=e=>p$(n,e),n.pick=e=>c$(n,e),n.omit=e=>u$(n,e),n.partial=(...e)=>f$(zw,n,e[0]),n.required=(...e)=>m$(Uw,n,e[0])});function Ow(n,t){const e={type:"object",shape:n??{},...U(t)};return new Dw(e)}function w(n,t){return new Dw({type:"object",shape:n,catchall:S(),...U(t)})}const Mw=E("ZodUnion",(n,t)=>{Aw.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>pI(n,e,r,i),n.options=t.options});function K(n,t){return new Mw({type:"union",options:n,...U(t)})}const p3=E("ZodDiscriminatedUnion",(n,t)=>{Mw.init(n,t),qT.init(n,t)});function f3(n,t,e){return new p3({type:"union",options:t,discriminator:n,...U(e)})}const m3=E("ZodIntersection",(n,t)=>{jT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>fI(n,e,r,i)});function ed(n,t){return new m3({type:"intersection",left:n,right:t})}const g3=E("ZodRecord",(n,t)=>{WT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>mI(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function _(n,t,e){return new g3({type:"record",keyType:n,valueType:t,...U(e)})}const Dp=E("ZodEnum",(n,t)=>{GT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>aI(n,r,i),n.enum=t.entries,n.options=Object.values(t.entries);const e=new Set(Object.keys(t.entries));n.extract=(r,i)=>{const s={};for(const a of r)if(e.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Dp({...t,checks:[],...U(i),entries:s})},n.exclude=(r,i)=>{const s={...t.entries};for(const a of r)if(e.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Dp({...t,checks:[],...U(i),entries:s})}});function Nw(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new Dp({type:"enum",entries:e,...U(t)})}const v3=E("ZodLiteral",(n,t)=>{YT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>lI(n,e,r),n.values=new Set(t.values),Object.defineProperty(n,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(n,t){return new v3({type:"literal",values:Array.isArray(n)?n:[n],...U(t)})}const y3=E("ZodTransform",(n,t)=>{JT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>uI(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new iw(n.constructor.name);e.addIssue=s=>{if(typeof s=="string")e.issues.push(al(s,e.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=e.value),a.inst??(a.inst=n),e.issues.push(al(a))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(s=>(e.value=s,e)):(e.value=i,e)}});function w3(n){return new y3({type:"transform",transform:n})}const zw=E("ZodOptional",(n,t)=>{kw.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Iw(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function Iv(n){return new zw({type:"optional",innerType:n})}const b3=E("ZodExactOptional",(n,t)=>{KT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Iw(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function S3(n){return new b3({type:"optional",innerType:n})}const _3=E("ZodNullable",(n,t)=>{XT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>gI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function xv(n){return new _3({type:"nullable",innerType:n})}const A3=E("ZodDefault",(n,t)=>{QT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>yI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function k3(n,t){return new A3({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():lw(t)}})}const E3=E("ZodPrefault",(n,t)=>{eR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>wI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function C3(n,t){return new E3({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():lw(t)}})}const Uw=E("ZodNonOptional",(n,t)=>{tR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>vI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function $3(n,t){return new Uw({type:"nonoptional",innerType:n,...U(t)})}const T3=E("ZodCatch",(n,t)=>{nR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>bI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function R3(n,t){return new T3({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const I3=E("ZodPipe",(n,t)=>{rR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>SI(n,e,r,i),n.in=t.in,n.out=t.out});function Pv(n,t){return new I3({type:"pipe",in:n,out:t})}const x3=E("ZodReadonly",(n,t)=>{iR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>_I(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function P3(n){return new x3({type:"readonly",innerType:n})}const L3=E("ZodCustom",(n,t)=>{sR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>cI(n,e)});function D3(n,t={}){return KR(L3,n,t)}function O3(n){return XR(n)}const M3=[".md",".markdown"];function Fw(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function Zw(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function N3(n){return Zw(n).toLowerCase()}function z3(n,t){const e=N3(n);return t.some(r=>e.endsWith(r))}function Op(n){return!Fw(n)&&z3(n,M3)}function U3(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function Hn(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const F3=Ow({id:f().min(1),kind:$("path"),title:f(),path:f()}).strict(),Z3=Ow({id:f().min(1),kind:$("url"),title:f(),url:f().refine(U3,{message:"url must be an http(s) URL"})}).strict();f3("kind",[F3,Z3]);const H3=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function V3(n,t){try{const e=new URL(t),r=new URL(n,e);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:H3.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Lv(n,t){return V3(n,t).kind==="web"}const B3="/views/markdown/",q3="/views/url-unsupported/";function Hw(n){return`/artifact/${encodeURIComponent(n)}`}function j3(n,t){return`${Hw(n)}/${encodeURIComponent(t)}`}function W3(n){return`/markdown/${encodeURIComponent(n)}`}function Mp(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Hn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:q3,contentURL:null};if(Op(n.path)){const r={viewURL:B3,contentURL:W3(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=Fw(n.path)?`${Hw(n.id)}/`:j3(n.id,Zw(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const G3="serverURL",Y3="token",J3="mode",K3="desktopAppVersion",X3="electron";function Q3(n=window.location.search,t=window.location.origin){const r=new URLSearchParams(n).get(G3);return r?new URL(r).origin:new URL(t).origin}function ex(n=window.location.search){return new URLSearchParams(n).get(Y3)}function dr(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(J3)===X3}function Vw(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(K3)}const Dv="tv.telemetry.clientId",tx=5,nx=60,rx=1e3,ix=tx*nx*rx,Ov=["pointerdown","scroll","keydown"],Mv=["focus"],Nv=["visibilitychange"],sx="hidden";function ox(n,t=hx){const e=n.getItem(Dv);if(e)return e;const r=t();return n.setItem(Dv,r),r}function ax(n){return{clientId:ox(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function lx(n){const t=new URLSearchParams;return t.set("clientId",n.clientId),t.set("userAgent",n.userAgent),t.set("clientApp",n.clientApp),n.desktopAppVersion&&t.set("desktopAppVersion",n.desktopAppVersion),t}function cx(n){return new ux(n)}var fl,Wn,$r,ml,gl,At,Li,vl,ph,Bw;class ux{constructor(t){g(this,ph);g(this,fl);g(this,Wn);g(this,$r);g(this,ml);g(this,gl);g(this,At);g(this,Li,!1);g(this,vl,Number.NEGATIVE_INFINITY);d(this,fl,t.meta),d(this,Wn,t.documentTarget),d(this,$r,t.windowTarget),d(this,ml,t.send),d(this,gl,t.nowMs??Date.now),d(this,At,()=>h(this,ph,Bw).call(this))}start(){if(!o(this,Li)){d(this,Li,!0);for(const t of Ov)o(this,$r).addEventListener(t,o(this,At)),o(this,Wn).addEventListener(t,o(this,At));for(const t of Mv)o(this,$r).addEventListener(t,o(this,At));for(const t of Nv)o(this,Wn).addEventListener(t,o(this,At))}}stop(){if(o(this,Li)){d(this,Li,!1);for(const t of Ov)o(this,$r).removeEventListener(t,o(this,At)),o(this,Wn).removeEventListener(t,o(this,At));for(const t of Mv)o(this,$r).removeEventListener(t,o(this,At));for(const t of Nv)o(this,Wn).removeEventListener(t,o(this,At))}}}fl=new WeakMap,Wn=new WeakMap,$r=new WeakMap,ml=new WeakMap,gl=new WeakMap,At=new WeakMap,Li=new WeakMap,vl=new WeakMap,ph=new WeakSet,Bw=function(){if(o(this,Wn).visibilityState===sx)return;const t=o(this,gl).call(this);t-o(this,vl)<ix||(d(this,vl,t),o(this,ml).call(this,{type:iC,clientId:o(this,fl).clientId}))};function hx(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Im().toLowerCase()}const me={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},zn={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},dx=1,px=w({_meta:_(f(),S()).nullish(),terminal:Oe().optional().default(!1)}),fx=w({_meta:_(f(),S()).nullish(),label:f().nullish(),name:f(),optional:Oe().optional().default(!1),secret:Oe().optional().default(!0)}),mx=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:f(),name:f()}),gx=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:f(),link:f().nullish(),name:f(),vars:M(fx)}),vx=w({_meta:_(f(),S()).nullish(),args:M(f()).optional(),description:f().nullish(),env:_(f(),f()).optional(),id:f(),name:f()}),yx=K([gx.and(w({type:$("env_var")})),vx.and(w({type:$("terminal")})),mx]),wx=w({_meta:_(f(),S()).nullish(),methodId:f()}),bx=w({_meta:_(f(),S()).nullish()}),Sx=w({_meta:_(f(),S()).nullish(),blob:f(),mimeType:f().nullish(),uri:f()}),_x=w({default:Oe().nullish(),description:f().nullish(),title:f().nullish()}),Ax=w({_meta:_(f(),S()).nullish()}),kx=w({_meta:_(f(),S()).nullish()}),Ex=w({amount:W(),currency:f()}),Cx=w({_meta:_(f(),S()).nullish(),terminalId:f()}),$x=w({_meta:_(f(),S()).nullish(),newText:f(),oldText:f().nullish(),path:f()}),Tx=K([f(),W(),W(),Oe(),M(f())]),Rx=w({content:_(f(),Tx).nullish()}),Ix=K([Rx.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),xx=w({_meta:_(f(),S()).nullish()}),qw=f(),Px=w({_meta:_(f(),S()).nullish(),elicitationId:qw}),Lx=w({_meta:_(f(),S()).nullish(),action:Ix}),Dx=$("object"),Ox=$("string"),Mx=w({_meta:_(f(),S()).nullish()}),Nx=w({_meta:_(f(),S()).nullish(),form:xx.nullish(),url:Mx.nullish()}),zx=w({elicitationId:qw,url:f().url()}),jw=w({const:f(),title:f()}),Ww=w({_meta:_(f(),S()).nullish(),name:f(),value:f()}),Ux=K([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),W().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),Gw=w({code:Ux,data:S().optional(),message:f()}),Yw=S(),Jw=S(),Kw=S(),Fx=w({_meta:_(f(),S()).nullish(),readTextFile:Oe().optional().default(!1),writeTextFile:Oe().optional().default(!1)}),Xw=w({_meta:_(f(),S()).nullish(),name:f(),value:f()}),Qw=w({_meta:_(f(),S()).nullish(),name:f(),title:f().nullish(),version:f()}),Zx=w({default:W().nullish(),description:f().nullish(),maximum:W().nullish(),minimum:W().nullish(),title:f().nullish()}),Hx=w({_meta:_(f(),S()).nullish()}),Vx=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cursor:f().nullish(),cwd:f().nullish()}),Bx=w({_meta:_(f(),S()).nullish()}),qx=w({_meta:_(f(),S()).nullish(),logout:Bx.nullish()}),jx=w({_meta:_(f(),S()).nullish()}),Wx=w({_meta:_(f(),S()).nullish()}),Gx=w({_meta:_(f(),S()).nullish(),http:Oe().optional().default(!1),sse:Oe().optional().default(!1)}),Yx=w({_meta:_(f(),S()).nullish(),headers:M(Xw),name:f(),url:f()}),Jx=w({_meta:_(f(),S()).nullish(),headers:M(Xw),name:f(),url:f()}),Kx=w({_meta:_(f(),S()).nullish(),args:M(f()),command:f(),env:M(Ww),name:f()}),td=K([Yx.and(w({type:$("http")})),Jx.and(w({type:$("sse")})),Kx]),Nm=f(),Xx=w({_meta:_(f(),S()).nullish(),description:f().nullish(),modelId:Nm,name:f()}),Qx=K([$("error"),$("warning"),$("information"),$("hint")]),eP=w({_meta:_(f(),S()).nullish()}),tP=w({_meta:_(f(),S()).nullish()}),nP=w({_meta:_(f(),S()).nullish()}),rP=w({_meta:_(f(),S()).nullish()}),iP=w({_meta:_(f(),S()).nullish()}),sP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),oP=w({diff:f(),uri:f()}),aP=w({endLine:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:f()}),lP=w({_meta:_(f(),S()).nullish()}),cP=w({_meta:_(f(),S()).nullish()}),uP=w({languageId:f(),text:f(),uri:f()}),hP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),dP=K([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),pP=w({excerpts:M(aP),uri:f()}),fP=w({_meta:_(f(),S()).nullish()}),mP=w({_meta:_(f(),S()).nullish()}),gP=w({name:f(),owner:f(),remoteUrl:f()}),vP=w({_meta:_(f(),S()).nullish()}),yP=w({_meta:_(f(),S()).nullish(),jump:lP.nullish(),rename:mP.nullish(),searchAndReplace:vP.nullish()}),wP=w({id:f(),isRegex:Oe().nullish(),replace:f(),search:f(),uri:f()}),bP=K([$("automatic"),$("diagnostic"),$("manual")]),SP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),_P=w({_meta:_(f(),S()).nullish(),diagnostics:eP.nullish(),editHistory:sP.nullish(),openFiles:cP.nullish(),recentFiles:hP.nullish(),relatedSnippets:fP.nullish(),userActions:SP.nullish()}),AP=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td)}),kP=w({default:W().nullish(),description:f().nullish(),maximum:W().nullish(),minimum:W().nullish(),title:f().nullish()}),eb=f(),EP=K([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),CP=w({_meta:_(f(),S()).nullish(),kind:EP,name:f(),optionId:eb}),$P=K([$("high"),$("medium"),$("low")]),TP=K([$("pending"),$("in_progress"),$("completed")]),RP=w({_meta:_(f(),S()).nullish(),content:f(),priority:$P,status:TP}),IP=w({_meta:_(f(),S()).nullish(),entries:M(RP)}),ci=w({character:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),xP=w({id:f(),position:ci,uri:f()}),PP=w({id:f(),newName:f(),position:ci,uri:f()}),LP=w({action:f(),position:ci,timestampMs:W(),uri:f()}),tb=K([$("utf-16"),$("utf-32"),$("utf-8")]),DP=w({_meta:_(f(),S()).nullish(),auth:px.optional().default({terminal:!1}),elicitation:Nx.nullish(),fs:Fx.optional().default({readTextFile:!1,writeTextFile:!1}),nes:yP.nullish(),positionEncodings:M(tb).optional(),terminal:Oe().optional().default(!1)}),OP=w({_meta:_(f(),S()).nullish(),audio:Oe().optional().default(!1),embeddedContext:Oe().optional().default(!1),image:Oe().optional().default(!1)}),nb=W().int().gte(0).lte(65535),MP=w({_meta:_(f(),S()).nullish(),clientCapabilities:DP.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:Qw.nullish(),protocolVersion:nb}),pa=w({end:ci,start:ci}),NP=w({message:f(),range:pa,severity:Qx,uri:f()}),zP=w({languageId:f(),lastFocusedMs:W().nullish(),uri:f(),visibleRange:pa.nullish()}),UP=w({_meta:_(f(),S()).nullish(),diagnostics:M(NP).nullish(),editHistory:M(oP).nullish(),openFiles:M(zP).nullish(),recentFiles:M(uP).nullish(),relatedSnippets:M(pP).nullish(),userActions:M(LP).nullish()}),FP=w({newText:f(),range:pa}),ZP=w({cursorPosition:ci.nullish(),edits:M(FP),id:f(),uri:f()}),HP=K([ZP.and(w({kind:$("edit")})),xP.and(w({kind:$("jump")})),PP.and(w({kind:$("rename")})),wP.and(w({kind:$("searchAndReplace")}))]),VP=w({_meta:_(f(),S()).nullish(),content:f()}),BP=w({_meta:_(f(),S()).nullish()}),ys=K([W(),f()]).nullable();w({_meta:_(f(),S()).nullish(),requestId:ys});const qP=Nw(["assistant","user"]),kc=w({_meta:_(f(),S()).nullish(),audience:M(qP).nullish(),lastModified:f().nullish(),priority:W().nullish()}),jP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),data:f(),mimeType:f()}),WP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),data:f(),mimeType:f(),uri:f().nullish()}),GP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),description:f().nullish(),mimeType:f().nullish(),name:f(),size:W().nullish(),title:f().nullish(),uri:f()}),YP=w({_meta:_(f(),S()).nullish(),optionId:eb}),JP=K([w({outcome:$("cancelled")}),YP.and(w({outcome:$("selected")}))]),KP=w({_meta:_(f(),S()).nullish(),outcome:JP}),XP=w({_meta:_(f(),S()).nullish()}),QP=w({_meta:_(f(),S()).nullish()}),eL=w({currentValue:Oe()}),tL=f(),rb=f(),nL=K([$("mode"),$("model"),$("thought_level"),f()]),zm=f(),ib=w({_meta:_(f(),S()).nullish(),description:f().nullish(),name:f(),value:zm}),rL=w({_meta:_(f(),S()).nullish(),group:tL,name:f(),options:M(ib)}),iL=K([M(ib),M(rL)]),sL=w({currentValue:zm,options:iL}),fa=ed(K([sL.and(w({type:$("select")})),eL.and(w({type:$("boolean")}))]),w({_meta:_(f(),S()).nullish(),category:nL.nullish(),description:f().nullish(),id:rb,name:f()})),oL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa)}),aL=w({_meta:_(f(),S()).nullish()}),ae=f(),lL=w({_meta:_(f(),S()).nullish(),id:f(),sessionId:ae}),cL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),uL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),hL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),sb=w({_meta:_(f(),S()).nullish(),args:M(f()).optional(),command:f(),cwd:f().nullish(),env:M(Ww).optional(),outputByteLimit:W().nullish(),sessionId:ae}),dL=w({_meta:_(f(),S()).nullish(),sessionId:ae,uri:f()}),pL=w({_meta:_(f(),S()).nullish(),position:ci,sessionId:ae,uri:f(),version:W(),visibleRange:pa}),fL=w({_meta:_(f(),S()).nullish(),languageId:f(),sessionId:ae,text:f(),uri:f(),version:W()}),mL=w({_meta:_(f(),S()).nullish(),sessionId:ae,uri:f()}),gL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td).optional(),sessionId:ae}),ob=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),vL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td),sessionId:ae}),ab=w({_meta:_(f(),S()).nullish(),limit:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:f(),sessionId:ae}),yL=w({_meta:_(f(),S()).nullish(),id:f(),reason:dP.nullish(),sessionId:ae}),lb=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),wL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td).optional(),sessionId:ae}),bL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),sessionId:ae,title:f().nullish(),updatedAt:f().nullish()}),SL=w({_meta:_(f(),S()).nullish(),nextCursor:f().nullish(),sessions:M(bL)}),_L=w({_meta:_(f(),S()).nullish(),title:f().nullish(),updatedAt:f().nullish()}),AL=w({_meta:_(f(),S()).nullish()}),nd=f(),kL=w({_meta:_(f(),S()).nullish(),currentModeId:nd}),EL=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:nd,name:f()}),rd=w({_meta:_(f(),S()).nullish(),availableModes:M(EL),currentModeId:nd}),id=w({_meta:_(f(),S()).nullish(),availableModels:M(Xx),currentModelId:Nm}),CL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish(),sessionId:ae}),$L=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish()}),TL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish(),sessionId:ae}),RL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish()}),IL=w({_meta:_(f(),S()).nullish()}),xL=w({_meta:_(f(),S()).nullish(),additionalDirectories:XP.nullish(),close:QP.nullish(),fork:aL.nullish(),list:AL.nullish(),resume:IL.nullish()}),PL=ed(K([w({type:$("boolean"),value:Oe()}),w({value:zm})]),w({_meta:_(f(),S()).nullish(),configId:rb,sessionId:ae})),LL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa)}),DL=w({_meta:_(f(),S()).nullish(),modeId:nd,sessionId:ae}),OL=w({_meta:_(f(),S()).nullish()}),ML=w({_meta:_(f(),S()).nullish(),modelId:Nm,sessionId:ae}),NL=w({_meta:_(f(),S()).nullish()}),zL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),UL=K([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),FL=K([$("email"),$("uri"),$("date"),$("date-time")]),ZL=w({default:f().nullish(),description:f().nullish(),enum:M(f()).nullish(),format:FL.nullish(),maxLength:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:M(jw).nullish(),pattern:f().nullish(),title:f().nullish()}),HL=w({_meta:_(f(),S()).nullish(),context:UP.nullish(),position:ci,selection:pa.nullish(),sessionId:ae,triggerKind:bP,uri:f(),version:W()}),VL=w({_meta:_(f(),S()).nullish(),suggestions:M(HP)}),BL=w({_meta:_(f(),S()).nullish(),terminalId:f()}),qL=w({_meta:_(f(),S()).nullish(),exitCode:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:f().nullish()}),cb=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),jL=w({_meta:_(f(),S()).nullish(),exitStatus:qL.nullish(),output:f(),truncated:Oe()}),WL=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),text:f()}),GL=w({range:pa.nullish(),text:f()}),YL=w({_meta:_(f(),S()).nullish(),contentChanges:M(GL),sessionId:ae,uri:f(),version:W()});w({method:f(),params:K([cL,fL,YL,dL,mL,pL,lL,yL,Yw]).nullish()});const JL=K([$("full"),$("incremental")]),KL=w({_meta:_(f(),S()).nullish(),syncKind:JL}),XL=w({_meta:_(f(),S()).nullish(),didChange:KL.nullish(),didClose:tP.nullish(),didFocus:nP.nullish(),didOpen:rP.nullish(),didSave:iP.nullish()}),QL=w({_meta:_(f(),S()).nullish(),document:XL.nullish()}),eD=w({_meta:_(f(),S()).nullish(),context:_P.nullish(),events:QL.nullish()}),tD=w({_meta:_(f(),S()).nullish(),auth:qx.optional().default({}),loadSession:Oe().optional().default(!1),mcpCapabilities:Gx.optional().default({http:!1,sse:!1}),nes:eD.nullish(),positionEncoding:tb.nullish(),promptCapabilities:OP.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:xL.optional().default({})}),nD=w({_meta:_(f(),S()).nullish(),agentCapabilities:tD.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:Qw.nullish(),authMethods:M(yx).optional().default([]),protocolVersion:nb}),rD=w({_meta:_(f(),S()).nullish(),mimeType:f().nullish(),text:f(),uri:f()}),iD=K([rD,Sx]),sD=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),resource:iD}),Um=K([WL.and(w({type:$("text")})),WP.and(w({type:$("image")})),jP.and(w({type:$("audio")})),GP.and(w({type:$("resource_link")})),sD.and(w({type:$("resource")}))]),oD=w({_meta:_(f(),S()).nullish(),content:Um}),np=w({_meta:_(f(),S()).nullish(),content:Um,messageId:f().nullish()}),aD=w({_meta:_(f(),S()).nullish(),messageId:f().nullish(),prompt:M(Um),sessionId:ae}),lD=w({anyOf:M(jw)}),ub=K([oD.and(w({type:$("content")})),$x.and(w({type:$("diff")})),BL.and(w({type:$("terminal")}))]),hb=f(),db=w({_meta:_(f(),S()).nullish(),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:f()}),pb=K([$("pending"),$("in_progress"),$("completed"),$("failed")]),fb=K([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),cD=w({_meta:_(f(),S()).nullish(),content:M(ub).optional(),kind:fb.optional(),locations:M(db).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:pb.optional(),title:f(),toolCallId:hb}),mb=w({_meta:_(f(),S()).nullish(),content:M(ub).nullish(),kind:fb.nullish(),locations:M(db).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:pb.nullish(),title:f().nullish(),toolCallId:hb}),gb=w({_meta:_(f(),S()).nullish(),options:M(CP),sessionId:ae,toolCall:mb}),uD=w({_meta:_(f(),S()).nullish(),hint:f()}),hD=uD,dD=w({_meta:_(f(),S()).nullish(),description:f(),input:hD.nullish(),name:f()}),pD=w({_meta:_(f(),S()).nullish(),availableCommands:M(dD)}),fD=w({enum:M(f()),type:Ox}),mD=K([fD,lD]),gD=w({default:M(f()).nullish(),description:f().nullish(),items:mD,maxItems:W().nullish(),minItems:W().nullish(),title:f().nullish()}),vD=K([ZL.and(w({type:$("string")})),kP.and(w({type:$("number")})),Zx.and(w({type:$("integer")})),_x.and(w({type:$("boolean")})),gD.and(w({type:$("array")}))]),yD=w({description:f().nullish(),properties:_(f(),vD).optional().default({}),required:M(f()).nullish(),title:f().nullish(),type:Dx.optional().default("object")}),wD=w({requestedSchema:yD}),bD=ed(K([wD.and(w({mode:$("form")})),zx.and(w({mode:$("url")}))]),w({_meta:_(f(),S()).nullish(),message:f(),sessionId:ae})),SD=w({cachedReadTokens:W().nullish(),cachedWriteTokens:W().nullish(),inputTokens:W(),outputTokens:W(),thoughtTokens:W().nullish(),totalTokens:W()}),_D=w({_meta:_(f(),S()).nullish(),stopReason:UL,usage:SD.nullish(),userMessageId:f().nullish()});K([w({id:ys,result:K([nD,bx,Wx,TL,$L,SL,CL,RL,kx,OL,LL,_D,NL,zL,VL,Ax,Kw])}),w({error:Gw,id:ys})]);const AD=w({_meta:_(f(),S()).nullish(),cost:Ex.nullish(),size:W(),used:W()}),kD=K([np.and(w({sessionUpdate:$("user_message_chunk")})),np.and(w({sessionUpdate:$("agent_message_chunk")})),np.and(w({sessionUpdate:$("agent_thought_chunk")})),cD.and(w({sessionUpdate:$("tool_call")})),mb.and(w({sessionUpdate:$("tool_call_update")})),IP.and(w({sessionUpdate:$("plan")})),pD.and(w({sessionUpdate:$("available_commands_update")})),kL.and(w({sessionUpdate:$("current_mode_update")})),oL.and(w({sessionUpdate:$("config_option_update")})),_L.and(w({sessionUpdate:$("session_info_update")})),AD.and(w({sessionUpdate:$("usage_update")}))]),vb=w({_meta:_(f(),S()).nullish(),sessionId:ae,update:kD});w({method:f(),params:K([vb,Px,Yw]).nullish()});const yb=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),ED=w({_meta:_(f(),S()).nullish(),exitCode:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:f().nullish()}),CD=w({name:f(),uri:f()}),$D=w({_meta:_(f(),S()).nullish(),repository:gP.nullish(),workspaceFolders:M(CD).nullish(),workspaceUri:f().nullish()});w({id:ys,method:f(),params:K([MP,wx,jx,AP,vL,Vx,gL,wL,hL,DL,PL,aD,ML,$D,HL,uL,Jw]).nullish()});const wb=w({_meta:_(f(),S()).nullish(),content:f(),path:f(),sessionId:ae});w({id:ys,method:f(),params:K([wb,ab,gb,sb,cb,lb,yb,ob,bD,Jw]).nullish()});const TD=w({_meta:_(f(),S()).nullish()});K([w({id:ys,result:K([TD,VP,KP,Cx,jL,BP,ED,Hx,Lx,Kw])}),w({error:Gw,id:ys})]);var se;class RD{constructor(t,e){g(this,se);const r=t(this),i=async(a,l)=>{var c,u,p,m,v,y,k;switch(a){case zn.fs_write_text_file:{const A=wb.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,A)}case zn.fs_read_text_file:{const A=ab.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,A)}case zn.session_request_permission:{const A=gb.parse(l);return r.requestPermission(A)}case zn.terminal_create:{const A=sb.parse(l);return(p=r.createTerminal)==null?void 0:p.call(r,A)}case zn.terminal_output:{const A=cb.parse(l);return(m=r.terminalOutput)==null?void 0:m.call(r,A)}case zn.terminal_release:{const A=lb.parse(l);return await((v=r.releaseTerminal)==null?void 0:v.call(r,A))??{}}case zn.terminal_wait_for_exit:{const A=yb.parse(l);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,A)}case zn.terminal_kill:{const A=ob.parse(l);return await((k=r.killTerminal)==null?void 0:k.call(r,A))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw Ie.methodNotFound(a)}},s=async(a,l)=>{switch(a){case zn.session_update:{const c=vb.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Ie.methodNotFound(a)}};d(this,se,new ID(i,s,e))}async initialize(t){return await o(this,se).sendRequest(me.initialize,t)}async newSession(t){return await o(this,se).sendRequest(me.session_new,t)}async loadSession(t){return await o(this,se).sendRequest(me.session_load,t)??{}}async unstable_forkSession(t){return await o(this,se).sendRequest(me.session_fork,t)}async listSessions(t){return await o(this,se).sendRequest(me.session_list,t)}async unstable_resumeSession(t){return await o(this,se).sendRequest(me.session_resume,t)}async unstable_closeSession(t){return await o(this,se).sendRequest(me.session_close,t)}async setSessionMode(t){return await o(this,se).sendRequest(me.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await o(this,se).sendRequest(me.session_set_model,t)??{}}async setSessionConfigOption(t){return await o(this,se).sendRequest(me.session_set_config_option,t)}async authenticate(t){return await o(this,se).sendRequest(me.authenticate,t)??{}}async unstable_logout(t){return await o(this,se).sendRequest(me.logout,t)??{}}async prompt(t){return await o(this,se).sendRequest(me.session_prompt,t)}async cancel(t){return await o(this,se).sendNotification(me.session_cancel,t)}async unstable_startNes(t){return await o(this,se).sendRequest(me.nes_start,t)}async unstable_suggestNes(t){return await o(this,se).sendRequest(me.nes_suggest,t)}async unstable_closeNes(t){return await o(this,se).sendRequest(me.nes_close,t)??{}}async unstable_didOpenDocument(t){return await o(this,se).sendNotification(me.document_did_open,t)}async unstable_didChangeDocument(t){return await o(this,se).sendNotification(me.document_did_change,t)}async unstable_didCloseDocument(t){return await o(this,se).sendNotification(me.document_did_close,t)}async unstable_didSaveDocument(t){return await o(this,se).sendNotification(me.document_did_save,t)}async unstable_didFocusDocument(t){return await o(this,se).sendNotification(me.document_did_focus,t)}async unstable_acceptNes(t){return await o(this,se).sendNotification(me.nes_accept,t)}async unstable_rejectNes(t){return await o(this,se).sendNotification(me.nes_reject,t)}async extMethod(t,e){return await o(this,se).sendRequest(t,e)}async extNotification(t,e){return await o(this,se).sendNotification(t,e)}get signal(){return o(this,se).signal}get closed(){return o(this,se).closed}}se=new WeakMap;var Tr,fh,yl,wl,lo,co,an,bl,ye,bb,Np,Sb,_b,Ab,kb,zp,za;class ID{constructor(t,e,r){g(this,ye);g(this,Tr,new Map);g(this,fh,0);g(this,yl);g(this,wl);g(this,lo);g(this,co,Promise.resolve());g(this,an,new AbortController);g(this,bl);d(this,yl,t),d(this,wl,e),d(this,lo,r),d(this,bl,new Promise(i=>{o(this,an).signal.addEventListener("abort",()=>i())})),h(this,ye,bb).call(this)}get signal(){return o(this,an).signal}get closed(){return o(this,bl)}async sendRequest(t,e){h(this,ye,zp).call(this);const r=Nc(this,fh)._++,i=new Promise((s,a)=>{o(this,Tr).set(r,{resolve:s,reject:a})});return await h(this,ye,za).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){h(this,ye,zp).call(this),await h(this,ye,za).call(this,{jsonrpc:"2.0",method:t,params:e})}}Tr=new WeakMap,fh=new WeakMap,yl=new WeakMap,wl=new WeakMap,lo=new WeakMap,co=new WeakMap,an=new WeakMap,bl=new WeakMap,ye=new WeakSet,bb=async function(){let t;try{const e=o(this,lo).readable.getReader();try{for(;!o(this,an).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{h(this,ye,Sb).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&h(this,ye,za).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{h(this,ye,Np).call(this,t)}},Np=function(t){if(o(this,an).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of o(this,Tr).values())r.reject(e);o(this,Tr).clear(),o(this,an).abort(e)},Sb=async function(t){if("method"in t&&"id"in t){const e=await h(this,ye,_b).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await h(this,ye,za).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await h(this,ye,Ab).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?h(this,ye,kb).call(this,t):console.error("Invalid message",{message:t})},_b=async function(t,e){try{return{result:await o(this,yl).call(this,t,e)??null}}catch(r){if(r instanceof Ie)return r.toResult();if(r instanceof $v)return Ie.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ie.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ie.internalError({details:i}).toResult()}}},Ab=async function(t,e){try{return await o(this,wl).call(this,t,e),{result:null}}catch(r){if(r instanceof Ie)return r.toResult();if(r instanceof $v)return Ie.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ie.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ie.internalError({details:i}).toResult()}}},kb=function(t){const e=o(this,Tr).get(t.id);if(e){if("result"in t)e.resolve(t.result);else if("error"in t){const{code:r,message:i,data:s}=t.error;e.reject(new Ie(r,i,s))}o(this,Tr).delete(t.id)}else console.error("Got response to unknown request",t.id)},zp=function(){if(o(this,an).signal.aborted)throw o(this,an).signal.reason??new Error("ACP connection closed")},za=async function(t){return d(this,co,o(this,co).then(async()=>{const e=o(this,lo).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{h(this,ye,Np).call(this,e)})),o(this,co)};class Ie extends Error{constructor(e,r,i){super(r);C(this,"code");C(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new Ie(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new Ie(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new Ie(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new Ie(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new Ie(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new Ie(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new Ie(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function xD(n,t,e){const r=n.dispose.bind(n);n.dispose=()=>{if(!t())return e(),r()}}function Eb(n){var e;class t extends n{constructor(...s){super(...s);g(this,e,!1);xD(this,()=>o(this,e),()=>{d(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return o(this,e)}}return e=new WeakMap,t}const PD=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,LD=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,DD=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,OD=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,MD=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,ND="single_session",zD={name:"television-acp-client",version:"0.0.0"},Cb="agent:main:television",UD=Eb(di);var uo,ln,pt,cn,Rr,Zt,Gn,un,hn,Ir,Ht,ho,po,dn,We,Yn,fo,Di,Jn,xr,Sl,Vt,pn,mh,fn,R,Up,$b,Tb,Rb,gu,Ib,xb,Pb,Lb,Db,Ob,Mb,wi,Fs,Zs,Fn,Nb,Hs,Fp,Zp,vu,zb,yu,Hp,Vp,_l,Al,wu,Vs,Bp,Ub;class FD extends UD{constructor(e){super();g(this,R);g(this,uo,"disconnected");g(this,ln,null);g(this,pt,new Map);g(this,cn,null);g(this,Rr,null);g(this,Zt,null);g(this,Gn,null);g(this,un,null);g(this,hn,null);g(this,Ir);g(this,Ht,null);g(this,ho,0);g(this,po,1);g(this,dn,null);g(this,We,null);g(this,Yn,!1);g(this,fo,!1);g(this,Di,!1);g(this,Jn,null);g(this,xr,new Set);g(this,Sl);g(this,Vt);g(this,pn);g(this,mh,e=>{h(this,R,Tb).call(this,e)});g(this,fn,null);g(this,_l,()=>{h(this,R,Vs).call(this,"ACP bridge websocket closed")});g(this,Al,()=>{h(this,R,Vs).call(this,"ACP bridge websocket error")});d(this,Vt,e),d(this,pn,e.sessionMode??ND),d(this,Ir,e.mappedSessionStore??ZD()),d(this,Sl,e.createSocket??(r=>new WebSocket(r)))}get status(){return o(this,uo)}get messages(){return[...o(this,pt).values()]}get enabled(){return o(this,Vt).enabled??!1}setToken(e){o(this,Vt).token=e??""}setEnabled(e){o(this,Vt).enabled=e,e||(h(this,R,wu).call(this),d(this,ln,null),h(this,R,Fn).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){o(this,Rr)===null&&(d(this,ln,null),d(this,Rr,h(this,R,$b).call(this)));try{await o(this,Rr),await h(this,R,gu).call(this)}catch(e){throw h(this,R,Vs).call(this,rp(e)),e}}}dispose(){h(this,R,wu).call(this),d(this,ln,null),h(this,R,Fn).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Up).call(this,"ready")),(o(this,un)===null||o(this,Ht)!==h(this,R,yu).call(this))&&await h(this,R,gu).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=e.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,R,Fs).call(this,{id:h(this,R,Hs).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,R,Fn).call(this,"running");try{const i=await h(this,R,vu).call(this).prompt({sessionId:h(this,R,Zp).call(this),prompt:[{type:"text",text:h(this,R,Nb).call(this,r)}]});h(this,R,wi).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,R,Fn).call(this,"ready")}catch(i){throw h(this,R,Ub).call(this)||(h(this,R,wi).call(this,"error"),h(this,R,Fn).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Up).call(this,"ready"));const e=h(this,R,yu).call(this);((r=o(this,hn))==null?void 0:r.sessionIdStrategy)==="mapped"?o(this,Ir).clearActualSessionId(e):d(this,ho,o(this,ho)+1),d(this,Zt,null),d(this,Gn,null),d(this,un,null),d(this,Ht,null),h(this,R,Bp).call(this)}async cancel(){this.status==="running"&&(h(this,R,Fn).call(this,"cancelling"),await h(this,R,vu).call(this).cancel({sessionId:h(this,R,Zp).call(this)}))}setChannelContext(e){var s,a,l;if(e===null){if(o(this,We)===null)return;d(this,We,null),d(this,Yn,!1);return}const r={channelID:e.channelID,channelName:e.channelName};if(((s=o(this,We))==null?void 0:s.channelID)===r.channelID&&((a=o(this,We))==null?void 0:a.channelName)===r.channelName)return;const i=((l=o(this,We))==null?void 0:l.channelID)??null;if(d(this,We,r),o(this,pn)==="single_session"){(!o(this,Ht)||i!==r.channelID)&&d(this,Yn,!0);return}o(this,Ht)!==h(this,R,Hp).call(this,r.channelID)&&(d(this,Zt,null),d(this,Gn,null),o(this,cn)&&this.status==="ready"&&h(this,R,gu).call(this).catch(c=>{h(this,R,Vs).call(this,rp(c))}))}}uo=new WeakMap,ln=new WeakMap,pt=new WeakMap,cn=new WeakMap,Rr=new WeakMap,Zt=new WeakMap,Gn=new WeakMap,un=new WeakMap,hn=new WeakMap,Ir=new WeakMap,Ht=new WeakMap,ho=new WeakMap,po=new WeakMap,dn=new WeakMap,We=new WeakMap,Yn=new WeakMap,fo=new WeakMap,Di=new WeakMap,Jn=new WeakMap,xr=new WeakMap,Sl=new WeakMap,Vt=new WeakMap,pn=new WeakMap,mh=new WeakMap,fn=new WeakMap,R=new WeakSet,Up=async function(e){if(this.status!==e){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(o(this,ln)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===e){s(),r();return}if(this.status==="disposed"){s(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(s(),i(new Error(o(this,ln)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},$b=async function(){try{const{stream:e,socket:r,metadata:i}=await qD({serverURL:o(this,Vt).serverURL,token:o(this,Vt).token,createSocket:o(this,Sl),onDisconnect:o(this,mh)});d(this,hn,i),d(this,fn,r),r.addEventListener("close",o(this,_l)),r.addEventListener("error",o(this,Al)),d(this,cn,new RD(s=>({connection:s,sessionUpdate:async a=>{await h(this,R,xb).call(this,a)},requestPermission:async a=>h(this,R,Pb).call(this,a)}),e)),await o(this,cn).initialize({protocolVersion:dx,clientCapabilities:{},clientInfo:zD})}catch(e){throw e}},Tb=function(e){h(this,R,Vs).call(this,rp(e))},Rb=function(e){const r=e==null?void 0:e.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(s=>s.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},gu=async function(){const e=h(this,R,yu).call(this);if(o(this,Zt)&&o(this,Gn)===e){await o(this,Zt);return}d(this,Gn,e),d(this,Zt,h(this,R,Ib).call(this,e)),await o(this,Zt)},Ib=async function(e){var c;const r=h(this,R,vu).call(this);h(this,R,Bp).call(this);let i,s=!1,a=null;const l={cwd:h(this,R,zb).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(d(this,Di,!0),d(this,Jn,null),((c=o(this,hn))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=o(this,Ir).getActualSessionId(e);if(u)try{const p=await r.loadSession({...l,sessionId:u});if(HD(p))throw new Error("Mapped ACP session was not found");a=p,i=u,s=!0}catch{const p=await r.newSession(l);a=p,i=p.sessionId,o(this,Ir).setActualSessionId(e,i),s=!1}else{const p=await r.newSession(l);a=p,i=p.sessionId,o(this,Ir).setActualSessionId(e,i),s=!1}}else try{a=await r.loadSession({...l,sessionId:e}),i=e,s=o(this,pt).size>0}catch{const u=await r.newSession(l);a=u,i=u.sessionId,s=!1}}finally{d(this,Di,!1),d(this,Jn,null),h(this,R,wi).call(this,"final")}h(this,R,Rb).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,un,i),d(this,Ht,e),d(this,fo,!0),s?(o(this,xr).add(e),o(this,pn)==="single_session"&&d(this,Yn,!1)):(o(this,xr).delete(e),d(this,Yn,o(this,pn)==="single_session")),d(this,ln,null),h(this,R,Fn).call(this,"ready")},xb=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,R,Mb).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,R,Lb).call(this,r.content.text);return;case"tool_call":h(this,R,Db).call(this,r);return;case"tool_call_update":h(this,R,Ob).call(this,r);return;case"agent_thought_chunk":return;default:return}},Pb=async function(e){return{outcome:{outcome:"cancelled"}}},Lb=function(e){d(this,Jn,null);const r=BD(e);if(!r)return;if(!o(this,dn)){const s={id:h(this,R,Hs).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,dn,s.id),h(this,R,Fs).call(this,s);return}const i=o(this,pt).get(o(this,dn));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,R,Zs).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Db=function(e){h(this,R,wi).call(this,"final");const r=h(this,R,Fp).call(this,e.toolCallId),i=Uv("content"in e?e.content:void 0),s={id:(r==null?void 0:r.id)??h(this,R,Hs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:e.title,toolKind:e.kind??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,Zs).call(this,s);return}h(this,R,Fs).call(this,s)},Ob=function(e){const r=h(this,R,Fp).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",s=Uv(e.content),a=s?`${i}${s}`:i,l={id:(r==null?void 0:r.id)??h(this,R,Hs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:(r==null?void 0:r.title)??e.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:a,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,Zs).call(this,l);return}h(this,R,Fs).call(this,l)},Mb=function(e){if(h(this,R,wi).call(this,"final"),!e)return;const r=o(this,Di)?o(this,Jn):null;if(!r){const s=zv(e);if(!s)return;const a={id:h(this,R,Hs).call(this,"user"),kind:"user",text:s,status:"final"};h(this,R,Fs).call(this,a),o(this,Di)&&d(this,Jn,a.id);return}const i=o(this,pt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,R,Zs).call(this,{...i,text:zv(`${i.text}${e}`)})},wi=function(e){if(!o(this,dn))return;const r=o(this,pt).get(o(this,dn));(r==null?void 0:r.kind)==="assistant"&&h(this,R,Zs).call(this,{...r,status:e}),d(this,dn,null)},Fs=function(e){o(this,pt).set(e.id,e),this.dispatchEvent(new Qd("messages-changed"))},Zs=function(e){o(this,pt).set(e.id,e),this.dispatchEvent(new Qd("messages-changed"))},Fn=function(e){o(this,uo)!==e&&(d(this,uo,e),this.dispatchEvent(new JC("status-changed")))},Nb=function(e){const r=o(this,Ht);if(!r)return e;const i=o(this,We)?o(this,pn)==="single_session"?o(this,Yn)||!o(this,xr).has(r):!o(this,xr).has(r):!1,s=o(this,fo)&&(o(this,We)!==null||OD.test(e));if(!(s||i))return e;s&&d(this,fo,!1),i&&(d(this,Yn,!1),o(this,xr).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."];return o(this,We)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${o(this,We).channelID}`),l.push(`channel_name: ${o(this,We).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",e),l.join(`
43
- `)},Hs=function(e){const r=`${e}-${o(this,po)}`;return d(this,po,o(this,po)+1),r},Fp=function(e){for(const r of o(this,pt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},Zp=function(){if(!o(this,un))throw new Error("ACP session is not ready");return o(this,un)},vu=function(){if(!o(this,cn))throw new Error("ACP connection is not ready");return o(this,cn)},zb=function(){var r;const e=(r=o(this,hn))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},yu=function(){var r;if(o(this,pn)==="single_session")return h(this,R,Vp).call(this,`${Cb}-${(o(this,Vt).clientGUID??"default-client").toLowerCase()}`);const e=(r=o(this,We))==null?void 0:r.channelID;if(!e)throw new Error("Channel context is required for per-channel session mode");return h(this,R,Hp).call(this,e)},Hp=function(e){return h(this,R,Vp).call(this,VD(o(this,pn),e,o(this,Vt).clientGUID??"default-client"))},Vp=function(e){var r;return((r=o(this,hn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&o(this,ho)>0?`${e}:epoch-${o(this,ho)}`:e},_l=new WeakMap,Al=new WeakMap,wu=function(){d(this,cn,null),d(this,Rr,null),d(this,Zt,null),d(this,Gn,null),d(this,un,null),d(this,Ht,null),d(this,hn,null),o(this,fn)&&(o(this,fn).removeEventListener("close",o(this,_l)),o(this,fn).removeEventListener("error",o(this,Al)),o(this,fn).close(),d(this,fn,null))},Vs=function(e){const r=o(this,cn)!==null||o(this,Rr)!==null||o(this,Zt)!==null||o(this,Gn)!==null||o(this,un)!==null||o(this,Ht)!==null||o(this,hn)!==null||o(this,fn)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,R,wi).call(this,"error"),h(this,R,wu).call(this),d(this,ln,e??null),h(this,R,Fn).call(this,"disconnected"))},Bp=function(){const e=o(this,pt).size>0;d(this,dn,null),d(this,Jn,null),d(this,po,1),o(this,pt).clear(),e&&this.dispatchEvent(new Qd("messages-changed"))},Ub=function(){return this.status==="disconnected"};function ZD(){const n=new Map;return{getActualSessionId(t){return n.get(t)??null},setActualSessionId(t,e){n.set(t,e)},clearActualSessionId(t){n.delete(t)}}}function HD(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function VD(n,t,e){return n==="single_session"?`${Cb}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function Fb(n){return n.replace(/^(?:\s*\n)+/,"")}function zv(n){let t=n;return t=t.replace(PD,""),t=t.replace(LD,""),t=t.replace(DD,""),t=Fb(t),t}function BD(n){let t=n;return t=t.replace(MD,""),t=Fb(t),t}function Uv(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function qD(n){const t=n.createSocket(GD(n.serverURL,n.token));let e=!1,r,i;const s=new Promise((u,p)=>{r=u,i=p}),a=new ReadableStream({start(u){let p=!1;const m=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},v=A=>{const x=WD(A);if(!x)return;let L;try{L=JSON.parse(x)}catch(D){const V=D instanceof Error?D:new Error(String(D));i(V),u.error(V);return}switch(L.type){case"acp-bridge-status":if(L.status==="ready"){let D;try{D=jD(L)}catch(V){const F=V instanceof Error?V:new Error(String(V));e||i(F),u.error(F);return}e||(e=!0,r(D));return}if(L.status==="error"||L.status==="exited"){const D=new Error(L.error??`ACP bridge ${L.status}`);e||i(D),u.error(D)}return;case"acp-bridge-message":u.enqueue(L.message);return}},y=()=>{var x;if(p)return;p=!0;const A=new Error("ACP bridge websocket closed");e||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.close()},k=()=>{var x;if(p)return;p=!0;const A=new Error("ACP bridge websocket error");e||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.error(A)};t.addEventListener("open",m),t.addEventListener("message",v),t.addEventListener("close",y),t.addEventListener("error",k)}}),l=new WritableStream({async write(u){await s,t.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){t.close()},abort(){t.close()}}),c=await s;return{stream:{readable:a,writable:l},socket:t,metadata:c}}function jD(n){const{agent:t,sessionIdStrategy:e,sessionCwd:r}=n;if((t==="openclaw"||t==="hermes")&&(e==="deterministic"||e==="mapped")&&typeof r=="string"&&r.length>0)return{agent:t,sessionIdStrategy:e,sessionCwd:r};throw new Error("ACP bridge ready status missing bootstrap metadata")}function WD(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const t=n.data;if(typeof t=="string")return t;if(t instanceof Uint8Array)return new TextDecoder().decode(t);if(Array.isArray(t))return Buffer.concat(t).toString("utf8")}return null}function GD(n,t){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname="/acp",e.search="",e.searchParams.set("token",t),e.hash="",e.toString()}function rp(n){return n instanceof Error?n.message:String(n)}const Fv="television.acpClientGUID",Zv="television.acpMappedSessions",Hv=1;var mo;class YD{constructor(){g(this,mo,new Map)}getActualSessionId(t){return o(this,mo).get(t)??null}setActualSessionId(t,e){o(this,mo).set(t,e)}clearActualSessionId(t){o(this,mo).delete(t)}}mo=new WeakMap;var go,kl,vt,bu,Su,qp;class JD{constructor(t,e){g(this,vt);g(this,go);g(this,kl);d(this,go,t),d(this,kl,e)}getActualSessionId(t){const e=h(this,vt,Su).call(this)[h(this,vt,bu).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=h(this,vt,Su).call(this);r[h(this,vt,bu).call(this,t)]=e,h(this,vt,qp).call(this,r)}clearActualSessionId(t){const e=h(this,vt,Su).call(this);delete e[h(this,vt,bu).call(this,t)],h(this,vt,qp).call(this,e)}}go=new WeakMap,kl=new WeakMap,vt=new WeakSet,bu=function(t){return JSON.stringify([o(this,kl),t])},Su=function(){const t=o(this,go).getItem(Zv);if(!t)return{};let e;try{e=JSON.parse(t)}catch{return{}}if(typeof e!="object"||e===null||Array.isArray(e))return{};const r=e;return r.version!==Hv?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},qp=function(t){const e={version:Hv,entries:t};o(this,go).setItem(Zv,JSON.stringify(e))};function Zb(){return typeof window>"u"?null:window.localStorage}function KD(n){const t=n.getItem(Fv);if(t)return t;const e=Im().toLowerCase();return n.setItem(Fv,e),e}const Vv=4401,XD=401,Yc=1e3,QD=3e4;class _u extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class e5 extends di{constructor(e){var a,l;super();C(this,"url");C(this,"name");C(this,"telemetryMeta");C(this,"status","unauthorized");C(this,"channels",new Map);C(this,"client");C(this,"acpClient");C(this,"_token");C(this,"attempting",!1);C(this,"nextRetryAt",null);C(this,"hasEverConnected",!1);C(this,"hasAuthRejected",!1);C(this,"hasAuthTokenRejected",!1);C(this,"bootState","pending");C(this,"serverVersion",null);C(this,"updateState",null);C(this,"decideBoot");C(this,"navigationPending");C(this,"createSocket");C(this,"createClient");C(this,"socket",null);C(this,"connectAttempt",0);C(this,"autoReconnect",!1);C(this,"retryTimer",null);C(this,"retryDelay",Yc);C(this,"visibilityEventTarget");C(this,"networkEventTarget");C(this,"onVisibilityChange");C(this,"onNetworkOnline");C(this,"telemetryActivityAgent");this.url=oi(e.url),this.name=e.name,this.decideBoot=e.decideBoot??null,this.navigationPending=e.navigationPending??(()=>!1),this._token=e.token??null,this.telemetryMeta=e.telemetryMeta??null,this.createSocket=e.createSocket??(c=>new WebSocket(c)),this.createClient=e.createClient??((c,u,p)=>new AC(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...p?{telemetryMeta:p}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new JD(e.acpStorage,this.url):new YD);this.acpClient=new FD({serverURL:this.url,token:this._token??"",...e.createACPSocket?{createSocket:e.createACPSocket}:e.createSocket?{createSocket:e.createSocket}:{},...e.clientGUID?{clientGUID:e.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=e.visibilityEventTarget!==void 0?e.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=e.networkEventTarget!==void 0?e.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(a=this.visibilityEventTarget)==null||a.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=e.telemetryDocumentTarget!==void 0?e.telemetryDocumentTarget:typeof document<"u"?document:null,s=e.telemetryWindowTarget!==void 0?e.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&s?cx({meta:this.telemetryMeta,documentTarget:i,windowTarget:s,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(e){this._token=e,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Yc,this.autoReconnect=!0,await this.attempt()}dispose(){var e,r,i,s;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(e=this.socket)==null||e.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(s=this.telemetryActivityAgent)==null||s.stop(),this.acpClient.dispose()}getViewURL(e){const r=Mp(e,{electron:dr()});return dr()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(e){const r=Mp(e,{electron:dr()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(e){const{channel:r}=await this.client.channels.create({name:e});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"channel-created":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Ma("channels-changed"));break;case"channel-updated":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Ma("channels-changed"));break;case"channel-removed":this.channels.delete(e.channelID),this.dispatchEvent(new Ma("channels-changed"));break;case"artifact-created":{const r=this.channels.get(e.channelID);r&&!oC(r).includes(e.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[e.artifact.id],geometry:{...By},size:{...qy}}]);break}case"artifact-removed":{const r=this.channels.get(e.channelID);r&&(r.layout=Ep(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return t5(e,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const e=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new xt("change"));const r=this.createSocket(n5(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,a)=>{let l=!1;const c=()=>{var m;l||this.connectAttempt!==e||(l=!0,this.retryDelay=Yc,this.hasEverConnected=!0,this.setStatus("connected"),(m=this.telemetryActivityAgent)==null||m.start(),s())},u=m=>{l||this.connectAttempt!==e||(l=!0,a(m))},p=async()=>{const m=this.hasEverConnected;try{const[{channels:v},y]=await Promise.all([this.client.channels.list(),this.client.display.get()]);this.channels=new Map(v.map(k=>[k.id,structuredClone(k)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new xt("change")),m&&this.dispatchEvent(new Ma("channels-changed")),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:y.focusedChannelId}})),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...y.pinnedChannelIds]}})),c(),m&&this.connectAttempt===e&&this.dispatchEvent(new nw("server-reconnected",{serverURL:this.url}))}catch(v){if(l5(v)){u(new _u);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||p())}),r.addEventListener("message",m=>{const v=a5(m);if(!v)return;if(v.type==="server-status"){const k=v;this.serverVersion=k.version,this.updateState=k.update??null;let A=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(k)==="boot"?(this.bootState="booted",A=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new rw("server-status",{serverURL:this.url,message:k})),A?this.navigationPending()||p():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new xt("change"));return}if(!o5(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",m=>{if(this.connectAttempt!==e)return;this.socket=null;const v=r5(m);if(!l){u(v===Vv?new _u:new Error("Connection closed before initialization"));return}if(v===Vv){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},s=>{throw this.attempting=!1,this.handleAttemptFailure(s),s})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof _u){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(e){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const e=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,QD),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new xt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new xt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Yc,this.attempt().catch(()=>{})))}sendTelemetryActivity(e){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(e)))}sendTelemetrySignal(e,r){var s;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:sC,clientId:this.telemetryMeta.clientId,event:e,properties:r};(s=this.socket)==null||s.send(JSON.stringify(i))}setStatus(e){this.status!==e&&(this.status=e,this.dispatchEvent(new xt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function t5(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function n5(n,t,e=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",t&&r.searchParams.set("token",t),e)for(const[i,s]of lx(e))r.searchParams.set(i,s);return r.hash="",r.toString()}function r5(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const i5={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"appearance-changed":!0,"artifact-focus":!0},s5=new Set(Object.keys(i5));function o5(n){return s5.has(n)}function a5(n){const t=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||!("type"in e)||typeof e.type!="string"?null:e}function l5(n){return n instanceof ha&&n.status===XD}const c5="Local";var kt,Bt,Pn,jp,Wp,Hb,El,Cl,$l,Tl,Rl;class u5 extends di{constructor(e){super();g(this,Pn);C(this,"connection");C(this,"clientGUID");C(this,"acpStorage");C(this,"connectError",null);g(this,kt);g(this,Bt,!1);g(this,El,()=>{o(this,Bt)||(h(this,Pn,Hb).call(this),this.dispatchEvent(new xt("change")))});g(this,Cl,e=>{o(this,Bt)||this.dispatchEvent(new fu("server-event",{serverURL:e.serverURL,event:e.event}))});g(this,$l,()=>{o(this,Bt)||this.dispatchEvent(new Ma("channels-changed"))});g(this,Tl,e=>{o(this,Bt)||this.dispatchEvent(new nw("server-reconnected",{serverURL:e.serverURL}))});g(this,Rl,e=>{o(this,Bt)||this.dispatchEvent(new rw("server-status",{serverURL:e.serverURL,message:e.message}))});d(this,kt,e.localStore),this.acpStorage=e.acpStorage===void 0?Zb():e.acpStorage,this.clientGUID=e.clientGUID??(this.acpStorage?KD(this.acpStorage):Im().toLowerCase());const r=oi(e.serverURL);e.launchToken!==void 0&&e.launchToken!==null&&o(this,kt).set(uv(o(this,kt).get(),r,e.launchToken));const i=e.launchToken??cv(o(this,kt).get(),r),s=e.createSocket??(l=>new WebSocket(l)),a=e.createConnection??(l=>new e5(l));this.connection=a({url:r,name:e.connectionName??c5,token:i,createSocket:s,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:e.telemetryMeta??null,decideBoot:e.decideBoot,navigationPending:e.navigationPending}),this.connection.addEventListener("change",o(this,El)),this.connection.addEventListener("server-event",o(this,Cl)),this.connection.addEventListener("channels-changed",o(this,$l)),this.connection.addEventListener("server-reconnected",o(this,Tl)),this.connection.addEventListener("server-status",o(this,Rl))}get storedAuthToken(){return cv(o(this,kt).get(),this.connection.url)}async connect(){await h(this,Pn,jp).call(this,this.connection.token)}async authenticate(e){o(this,kt).set(uv(o(this,kt).get(),this.connection.url,e)),await h(this,Pn,jp).call(this,e)}dispose(){o(this,Bt)||(d(this,Bt,!0),this.connection.removeEventListener("change",o(this,El)),this.connection.removeEventListener("server-event",o(this,Cl)),this.connection.removeEventListener("channels-changed",o(this,$l)),this.connection.removeEventListener("server-reconnected",o(this,Tl)),this.connection.removeEventListener("server-status",o(this,Rl)),this.connection.dispose())}}kt=new WeakMap,Bt=new WeakMap,Pn=new WeakSet,jp=async function(e){if(!o(this,Bt)){h(this,Pn,Wp).call(this,null);try{await this.connection.connect(e)}catch(r){h(this,Pn,Wp).call(this,r instanceof _u?null:r instanceof Error?r.message:String(r))}}},Wp=function(e){this.connectError!==e&&(this.connectError=e,this.dispatchEvent(new xt("change")))},Hb=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const e=o(this,kt).get(),r=e$(e,this.connection.url);r!==e&&o(this,kt).set(r),this.connection.token!==null&&this.connection.clearToken()},El=new WeakMap,Cl=new WeakMap,$l=new WeakMap,Tl=new WeakMap,Rl=new WeakMap;const Gp="tv-nav:",ta="tv-reload",Bv=100,h5=1e3,d5=60,p5=60,f5=24,m5=30,g5=m5*f5*p5*d5*h5;function pr(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(ta);return t.searchParams.delete(ta),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var Il,vo,pe,de,Oi,$e,Vb,br,Bb,Yp,Jp;class v5 extends di{constructor(e,r){super();g(this,$e);g(this,Il);g(this,vo);g(this,pe,[]);g(this,de,-1);g(this,Oi,0);d(this,Il,e),d(this,vo,pr(r)),h(this,$e,Vb).call(this)}get currentURL(){var e;return o(this,de)===-1?null:((e=o(this,pe)[o(this,de)])==null?void 0:e.url)??null}get canGoBack(){return o(this,de)>-1}get canGoForward(){return o(this,de)<o(this,pe).length-1}get entries(){return o(this,pe).map(e=>({...e}))}get cursor(){return o(this,de)}navigate(e){const r=pr(e);if(r===o(this,vo)){if(o(this,de)===-1)return;d(this,de,-1),h(this,$e,br).call(this);return}o(this,de)<o(this,pe).length-1&&d(this,pe,o(this,pe).slice(0,o(this,de)+1)),o(this,pe).push({url:r}),d(this,de,o(this,pe).length-1),h(this,$e,Yp).call(this),h(this,$e,br).call(this)}replace(e){var i;if(o(this,de)===-1){this.navigate(e);return}const r=pr(e);if(r===o(this,vo)){d(this,pe,o(this,pe).filter((s,a)=>a!==o(this,de))),d(this,de,-1),h(this,$e,br).call(this);return}((i=o(this,pe)[o(this,de)])==null?void 0:i.url)!==r&&(d(this,pe,o(this,pe).map((s,a)=>a===o(this,de)?{url:r}:s)),h(this,$e,br).call(this))}back(){o(this,de)!==-1&&(d(this,de,o(this,de)-1),h(this,$e,br).call(this))}forward(){this.canGoForward&&(d(this,de,o(this,de)+1),h(this,$e,br).call(this))}reset(){o(this,de)===-1&&o(this,pe).length===0||(d(this,pe,[]),d(this,de,-1),h(this,$e,br).call(this))}}Il=new WeakMap,vo=new WeakMap,pe=new WeakMap,de=new WeakMap,Oi=new WeakMap,$e=new WeakSet,Vb=function(){const e=localStorage.getItem(o(this,$e,Jp));if(e!==null)try{const r=JSON.parse(e);if(!qb(r))return;d(this,pe,r.entries.map(i=>({url:i.url}))),d(this,de,r.cursor),d(this,Oi,r.lastWritten),h(this,$e,Yp).call(this)}catch{d(this,pe,[]),d(this,de,-1),d(this,Oi,0)}},br=function(){d(this,Oi,Date.now());try{localStorage.setItem(o(this,$e,Jp),JSON.stringify(h(this,$e,Bb).call(this)))}catch(e){if(!b5(e))throw e}this.dispatchEvent(new xt("change"))},Bb=function(){return{v:1,entries:o(this,pe).map(e=>({...e})),cursor:o(this,de),lastWritten:o(this,Oi)}},Yp=function(){if(o(this,pe).length<=Bv)return;const e=o(this,pe).length-Bv;d(this,pe,o(this,pe).slice(e)),d(this,de,Math.max(-1,o(this,de)-e))},Jp=function(){return y5(o(this,Il))};function y5(n){return`${Gp}${n}`}function w5(n){const t=Date.now()-g5,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(Gp)))continue;const s=i.slice(Gp.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{e.push(i);continue}if(!qb(l)){e.push(i);continue}!n.has(s)&&l.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function b5(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function qb(n){if(typeof n!="object"||n===null)return!1;const t=n;if(t.v!==1||!Array.isArray(t.entries))return!1;const e=t.cursor;return typeof e!="number"||!Number.isInteger(e)||typeof t.lastWritten!="number"||!Number.isFinite(t.lastWritten)||e<-1||e>=t.entries.length?!1:t.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const S5="1.3.3";function Fm(n=S5){return n!==void 0&&n.length>0?n:"0.0.0"}function Zm(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const Kp="tv-reload-attempted";function _5(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:CC(n.bundleVersion,n.serverVersion)?n.marker!==null&&n.marker.serverVersion===n.serverVersion?{action:"none"}:{action:"reload",marker:{serverVersion:n.serverVersion,fromVersion:n.bundleVersion}}:{action:"none"}:{action:"none"}}function A5(n){const t=n.getItem(Kp);if(t===null)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;const r=e;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function k5(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??Zm(),i=n.bundleVersion??Fm();if(t===null)return{dispose(){}};let s=null;const a=()=>{if(s===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const p=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:p.fromVersion,to_version:p.toVersion})},l=u=>{if(r.pending)return;const p=_5({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:A5(t)});switch(p.action){case"reload":t.setItem(Kp,JSON.stringify(p.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(Kp),s={fromVersion:p.fromVersion,toVersion:p.toVersion},a();return;case"none":return}},c=()=>{a()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function E5(n){const t=dr(n.search),e=Vw(n.search),r=e!==null&&Yh(e)?e:null;return{electron:t,shellVersion:r}}function C5(n){return!n.electron||n.requiredDesktopVersion===null||!Yh(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===Yu?!1:Rm(n.requiredDesktopVersion,n.shellVersion)}const $5=`# Desktop app upgrade required
42
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const p of n.seen.entries()){const m=p[1];if(t===p[0]){s(p);continue}if(n.external){const y=(c=n.external.registry.get(p[0]))==null?void 0:c.id;if(t!==p[0]&&y){s(p);continue}}if((u=n.metadataRegistry.get(p[0]))==null?void 0:u.id){s(p);continue}if(m.cycle){s(p);continue}if(m.count>1&&n.reused==="ref"){s(p);continue}}}function Lw(n,t){var a,l,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const p=n.seen.get(u);if(p.ref===null)return;const m=p.def??p.schema,v={...m},y=p.ref;if(p.ref=null,y){r(y);const A=n.seen.get(y),x=A.schema;if(x.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(m.allOf=m.allOf??[],m.allOf.push(x)):Object.assign(m,x),Object.assign(m,v),u._zod.parent===y)for(const D in m)D==="$ref"||D==="allOf"||D in v||delete m[D];if(x.$ref&&A.def)for(const D in m)D==="$ref"||D==="allOf"||D in A.def&&JSON.stringify(m[D])===JSON.stringify(A.def[D])&&delete m[D]}const k=u._zod.parent;if(k&&k!==y){r(k);const A=n.seen.get(k);if(A!=null&&A.schema.$ref&&(m.$ref=A.schema.$ref,A.def))for(const x in m)x==="$ref"||x==="allOf"||x in A.def&&JSON.stringify(m[x])===JSON.stringify(A.def[x])&&delete m[x]}n.override({zodSchema:u,jsonSchema:m,path:p.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(a=n.external)!=null&&a.uri){const u=(l=n.external.registry.get(t))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,e.def??e.schema);const s=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const p=u[1];p.def&&p.defId&&(s[p.defId]=p.def)}n.external||Object.keys(s).length>0&&(n.target==="draft-2020-12"?i.$defs=s:i.definitions=s);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:eh(t,"input",n.processors),output:eh(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function je(n,t){const e=t??{seen:new Set};if(e.seen.has(n))return!1;e.seen.add(n);const r=n._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return je(r.element,e);if(r.type==="set")return je(r.valueType,e);if(r.type==="lazy")return je(r.getter(),e);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return je(r.innerType,e);if(r.type==="intersection")return je(r.left,e)||je(r.right,e);if(r.type==="record"||r.type==="map")return je(r.keyType,e)||je(r.valueType,e);if(r.type==="pipe")return je(r.in,e)||je(r.out,e);if(r.type==="object"){for(const i in r.shape)if(je(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(je(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(je(i,e))return!0;return!!(r.rest&&je(r.rest,e))}return!1}const rI=(n,t={})=>e=>{const r=xw({...e,processors:t});return Te(n,r),Pw(r,n),Lw(r,n)},eh=(n,t,e={})=>r=>{const{libraryOptions:i,target:s}=r??{},a=xw({...i??{},target:s,io:t,processors:e});return Te(n,a),Pw(a,n),Lw(a,n)},iI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},sI=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:s,maximum:a,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof a=="number"&&(i.maxLength=a),l&&(i.format=iI[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const p=[...c];p.length===1?i.pattern=p[0].source:p.length>1&&(i.allOf=[...p.map(m=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:m.source}))])}},oI=(n,t,e,r)=>{const i=e,{minimum:s,maximum:a,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:p}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof p=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=p,i.exclusiveMinimum=!0):i.exclusiveMinimum=p),typeof s=="number"&&(i.minimum=s,typeof p=="number"&&t.target!=="draft-04"&&(p>=s?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},aI=(n,t,e,r)=>{e.type="boolean"},lI=(n,t,e,r)=>{e.not={}},cI=(n,t,e,r)=>{},uI=(n,t,e,r)=>{const i=n._zod.def,s=uw(i.entries);s.every(a=>typeof a=="number")&&(e.type="number"),s.every(a=>typeof a=="string")&&(e.type="string"),e.enum=s},hI=(n,t,e,r)=>{const i=n._zod.def,s=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(a))}else s.push(a);if(s.length!==0)if(s.length===1){const a=s[0];e.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[a]:e.const=a}else s.every(a=>typeof a=="number")&&(e.type="number"),s.every(a=>typeof a=="string")&&(e.type="string"),s.every(a=>typeof a=="boolean")&&(e.type="boolean"),s.every(a=>a===null)&&(e.type="null"),e.enum=s},dI=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},pI=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},fI=(n,t,e,r)=>{const i=e,s=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Te(s.element,t,{...r,path:[...r.path,"items"]})},mI=(n,t,e,r)=>{var u;const i=e,s=n._zod.def;i.type="object",i.properties={};const a=s.shape;for(const p in a)i.properties[p]=Te(a[p],t,{...r,path:[...r.path,"properties",p]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(p=>{const m=s.shape[p]._zod;return t.io==="input"?m.optin===void 0:m.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=s.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Te(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},gI=(n,t,e,r)=>{const i=n._zod.def,s=i.inclusive===!1,a=i.options.map((l,c)=>Te(l,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?e.oneOf=a:e.anyOf=a},vI=(n,t,e,r)=>{const i=n._zod.def,s=Te(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=Te(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(s)?s.allOf:[s],...l(a)?a.allOf:[a]];e.allOf=c},yI=(n,t,e,r)=>{const i=e,s=n._zod.def;i.type="object";const a=s.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(s.mode==="loose"&&c&&c.size>0){const p=Te(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const m of c)i.patternProperties[m.source]=p}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Te(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Te(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=a._zod.values;if(u){const p=[...u].filter(m=>typeof m=="string"||typeof m=="number");p.length>0&&(i.required=p)}},wI=(n,t,e,r)=>{const i=n._zod.def,s=Te(i.innerType,t,r),a=t.seen.get(n);t.target==="openapi-3.0"?(a.ref=i.innerType,e.nullable=!0):e.anyOf=[s,{type:"null"}]},bI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},SI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},_I=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,t.io==="input"&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},AI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=a},kI=(n,t,e,r)=>{const i=n._zod.def,s=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Te(s,t,r);const a=t.seen.get(n);a.ref=s},EI=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.readOnly=!0},Dw=(n,t,e,r)=>{const i=n._zod.def;Te(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},CI=E("ZodISODateTime",(n,t)=>{$T.init(n,t),Se.init(n,t)});function $I(n){return LR(CI,n)}const TI=E("ZodISODate",(n,t)=>{TT.init(n,t),Se.init(n,t)});function RI(n){return DR(TI,n)}const II=E("ZodISOTime",(n,t)=>{RT.init(n,t),Se.init(n,t)});function xI(n){return OR(II,n)}const PI=E("ZodISODuration",(n,t)=>{IT.init(n,t),Se.init(n,t)});function LI(n){return MR(PI,n)}const Ow=(n,t)=>{fw.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>b$(n,e)},flatten:{value:e=>w$(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,Dp,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,Dp,2)}},isEmpty:{get(){return n.issues.length===0}}})},xv=E("ZodError",Ow),zt=E("ZodError",Ow,{Parent:Error}),DI=Mm(zt),OI=Nm(zt),MI=Kh(zt),NI=Xh(zt),zI=A$(zt),UI=k$(zt),FI=E$(zt),ZI=C$(zt),HI=$$(zt),VI=T$(zt),BI=R$(zt),qI=I$(zt),be=E("ZodType",(n,t)=>(we.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:eh(n,"input"),output:eh(n,"output")}}),n.toJSONSchema=rI(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone(pi(t,{checks:[...t.checks??[],...e.map(r=>typeof r=="function"?{_zod:{check:r,def:{check:"custom"},onattach:[]}}:r)]}),{parent:!0}),n.with=n.check,n.clone=(e,r)=>fi(n,e,r),n.brand=()=>n,n.register=(e,r)=>(e.add(n,r),n),n.parse=(e,r)=>DI(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>MI(n,e,r),n.parseAsync=async(e,r)=>OI(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>NI(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>zI(n,e,r),n.decode=(e,r)=>UI(n,e,r),n.encodeAsync=async(e,r)=>FI(n,e,r),n.decodeAsync=async(e,r)=>ZI(n,e,r),n.safeEncode=(e,r)=>HI(n,e,r),n.safeDecode=(e,r)=>VI(n,e,r),n.safeEncodeAsync=async(e,r)=>BI(n,e,r),n.safeDecodeAsync=async(e,r)=>qI(n,e,r),n.refine=(e,r)=>n.check(N3(e,r)),n.superRefine=e=>n.check(z3(e)),n.overwrite=e=>n.check(da(e)),n.optional=()=>Dv(n),n.exactOptional=()=>k3(n),n.nullable=()=>Ov(n),n.nullish=()=>Dv(Ov(n)),n.nonoptional=e=>I3(n,e),n.array=()=>M(n),n.or=e=>K([n,e]),n.and=e=>ed(n,e),n.transform=e=>Mv(n,_3(e)),n.default=e=>$3(n,e),n.prefault=e=>R3(n,e),n.catch=e=>P3(n,e),n.pipe=e=>Mv(n,e),n.readonly=()=>O3(n),n.describe=e=>{const r=n.clone();return Na.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=Na.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return Na.get(n);const r=n.clone();return Na.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),Mw=E("_ZodString",(n,t)=>{zm.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>sI(n,r,i);const e=n._zod.bag;n.format=e.format??null,n.minLength=e.minimum??null,n.maxLength=e.maximum??null,n.regex=(...r)=>n.check(HR(...r)),n.includes=(...r)=>n.check(qR(...r)),n.startsWith=(...r)=>n.check(jR(...r)),n.endsWith=(...r)=>n.check(WR(...r)),n.min=(...r)=>n.check(Qu(...r)),n.max=(...r)=>n.check(Rw(...r)),n.length=(...r)=>n.check(Iw(...r)),n.nonempty=(...r)=>n.check(Qu(1,...r)),n.lowercase=r=>n.check(VR(r)),n.uppercase=r=>n.check(BR(r)),n.trim=()=>n.check(YR()),n.normalize=(...r)=>n.check(GR(...r)),n.toLowerCase=()=>n.check(JR()),n.toUpperCase=()=>n.check(KR()),n.slugify=()=>n.check(XR())}),jI=E("ZodString",(n,t)=>{zm.init(n,t),Mw.init(n,t),n.email=e=>n.check(dR(WI,e)),n.url=e=>n.check(vR(GI,e)),n.jwt=e=>n.check(PR(c3,e)),n.emoji=e=>n.check(yR(YI,e)),n.guid=e=>n.check($v(Pv,e)),n.uuid=e=>n.check(pR(Gc,e)),n.uuidv4=e=>n.check(fR(Gc,e)),n.uuidv6=e=>n.check(mR(Gc,e)),n.uuidv7=e=>n.check(gR(Gc,e)),n.nanoid=e=>n.check(wR(JI,e)),n.guid=e=>n.check($v(Pv,e)),n.cuid=e=>n.check(bR(KI,e)),n.cuid2=e=>n.check(SR(XI,e)),n.ulid=e=>n.check(_R(QI,e)),n.base64=e=>n.check(RR(o3,e)),n.base64url=e=>n.check(IR(a3,e)),n.xid=e=>n.check(AR(e3,e)),n.ksuid=e=>n.check(kR(t3,e)),n.ipv4=e=>n.check(ER(n3,e)),n.ipv6=e=>n.check(CR(r3,e)),n.cidrv4=e=>n.check($R(i3,e)),n.cidrv6=e=>n.check(TR(s3,e)),n.e164=e=>n.check(xR(l3,e)),n.datetime=e=>n.check($I(e)),n.date=e=>n.check(RI(e)),n.time=e=>n.check(xI(e)),n.duration=e=>n.check(LI(e))});function f(n){return hR(jI,n)}const Se=E("ZodStringFormat",(n,t)=>{ve.init(n,t),Mw.init(n,t)}),WI=E("ZodEmail",(n,t)=>{yT.init(n,t),Se.init(n,t)}),Pv=E("ZodGUID",(n,t)=>{gT.init(n,t),Se.init(n,t)}),Gc=E("ZodUUID",(n,t)=>{vT.init(n,t),Se.init(n,t)}),GI=E("ZodURL",(n,t)=>{wT.init(n,t),Se.init(n,t)}),YI=E("ZodEmoji",(n,t)=>{bT.init(n,t),Se.init(n,t)}),JI=E("ZodNanoID",(n,t)=>{ST.init(n,t),Se.init(n,t)}),KI=E("ZodCUID",(n,t)=>{_T.init(n,t),Se.init(n,t)}),XI=E("ZodCUID2",(n,t)=>{AT.init(n,t),Se.init(n,t)}),QI=E("ZodULID",(n,t)=>{kT.init(n,t),Se.init(n,t)}),e3=E("ZodXID",(n,t)=>{ET.init(n,t),Se.init(n,t)}),t3=E("ZodKSUID",(n,t)=>{CT.init(n,t),Se.init(n,t)}),n3=E("ZodIPv4",(n,t)=>{xT.init(n,t),Se.init(n,t)}),r3=E("ZodIPv6",(n,t)=>{PT.init(n,t),Se.init(n,t)}),i3=E("ZodCIDRv4",(n,t)=>{LT.init(n,t),Se.init(n,t)}),s3=E("ZodCIDRv6",(n,t)=>{DT.init(n,t),Se.init(n,t)}),o3=E("ZodBase64",(n,t)=>{OT.init(n,t),Se.init(n,t)}),a3=E("ZodBase64URL",(n,t)=>{NT.init(n,t),Se.init(n,t)}),l3=E("ZodE164",(n,t)=>{zT.init(n,t),Se.init(n,t)}),c3=E("ZodJWT",(n,t)=>{FT.init(n,t),Se.init(n,t)}),Nw=E("ZodNumber",(n,t)=>{kw.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>oI(n,r,i),n.gt=(r,i)=>n.check(Rv(r,i)),n.gte=(r,i)=>n.check(rp(r,i)),n.min=(r,i)=>n.check(rp(r,i)),n.lt=(r,i)=>n.check(Tv(r,i)),n.lte=(r,i)=>n.check(np(r,i)),n.max=(r,i)=>n.check(np(r,i)),n.int=r=>n.check(Lv(r)),n.safe=r=>n.check(Lv(r)),n.positive=r=>n.check(Rv(0,r)),n.nonnegative=r=>n.check(rp(0,r)),n.negative=r=>n.check(Tv(0,r)),n.nonpositive=r=>n.check(np(0,r)),n.multipleOf=(r,i)=>n.check(Iv(r,i)),n.step=(r,i)=>n.check(Iv(r,i)),n.finite=()=>n;const e=n._zod.bag;n.minValue=Math.max(e.minimum??Number.NEGATIVE_INFINITY,e.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,n.maxValue=Math.min(e.maximum??Number.POSITIVE_INFINITY,e.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,n.isInt=(e.format??"").includes("int")||Number.isSafeInteger(e.multipleOf??.5),n.isFinite=!0,n.format=e.format??null});function W(n){return NR(Nw,n)}const u3=E("ZodNumberFormat",(n,t)=>{ZT.init(n,t),Nw.init(n,t)});function Lv(n){return zR(u3,n)}const h3=E("ZodBoolean",(n,t)=>{HT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>aI(n,e,r)});function Oe(n){return UR(h3,n)}const d3=E("ZodUnknown",(n,t)=>{VT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>cI()});function S(){return FR(d3)}const p3=E("ZodNever",(n,t)=>{BT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>lI(n,e,r)});function f3(n){return ZR(p3,n)}const m3=E("ZodArray",(n,t)=>{qT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>fI(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(Qu(e,r)),n.nonempty=e=>n.check(Qu(1,e)),n.max=(e,r)=>n.check(Rw(e,r)),n.length=(e,r)=>n.check(Iw(e,r)),n.unwrap=()=>n.element});function M(n,t){return QR(m3,n,t)}const zw=E("ZodObject",(n,t)=>{WT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>mI(n,e,r,i),ce(n,"shape",()=>t.shape),n.keyof=()=>Zw(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:S()}),n.loose=()=>n.clone({...n._zod.def,catchall:S()}),n.strict=()=>n.clone({...n._zod.def,catchall:f3()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>f$(n,e),n.safeExtend=e=>m$(n,e),n.merge=e=>g$(n,e),n.pick=e=>d$(n,e),n.omit=e=>p$(n,e),n.partial=(...e)=>v$(Hw,n,e[0]),n.required=(...e)=>y$(Vw,n,e[0])});function Uw(n,t){const e={type:"object",shape:n??{},...U(t)};return new zw(e)}function w(n,t){return new zw({type:"object",shape:n,catchall:S(),...U(t)})}const Fw=E("ZodUnion",(n,t)=>{$w.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>gI(n,e,r,i),n.options=t.options});function K(n,t){return new Fw({type:"union",options:n,...U(t)})}const g3=E("ZodDiscriminatedUnion",(n,t)=>{Fw.init(n,t),GT.init(n,t)});function v3(n,t,e){return new g3({type:"union",options:t,discriminator:n,...U(e)})}const y3=E("ZodIntersection",(n,t)=>{YT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>vI(n,e,r,i)});function ed(n,t){return new y3({type:"intersection",left:n,right:t})}const w3=E("ZodRecord",(n,t)=>{JT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>yI(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function _(n,t,e){return new w3({type:"record",keyType:n,valueType:t,...U(e)})}const Mp=E("ZodEnum",(n,t)=>{KT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>uI(n,r,i),n.enum=t.entries,n.options=Object.values(t.entries);const e=new Set(Object.keys(t.entries));n.extract=(r,i)=>{const s={};for(const a of r)if(e.has(a))s[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Mp({...t,checks:[],...U(i),entries:s})},n.exclude=(r,i)=>{const s={...t.entries};for(const a of r)if(e.has(a))delete s[a];else throw new Error(`Key ${a} not found in enum`);return new Mp({...t,checks:[],...U(i),entries:s})}});function Zw(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new Mp({type:"enum",entries:e,...U(t)})}const b3=E("ZodLiteral",(n,t)=>{XT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>hI(n,e,r),n.values=new Set(t.values),Object.defineProperty(n,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function $(n,t){return new b3({type:"literal",values:Array.isArray(n)?n:[n],...U(t)})}const S3=E("ZodTransform",(n,t)=>{QT.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>pI(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new lw(n.constructor.name);e.addIssue=s=>{if(typeof s=="string")e.issues.push(al(s,e.value,t));else{const a=s;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=e.value),a.inst??(a.inst=n),e.issues.push(al(a))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(s=>(e.value=s,e)):(e.value=i,e)}});function _3(n){return new S3({type:"transform",transform:n})}const Hw=E("ZodOptional",(n,t)=>{Tw.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Dw(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function Dv(n){return new Hw({type:"optional",innerType:n})}const A3=E("ZodExactOptional",(n,t)=>{eR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>Dw(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function k3(n){return new A3({type:"optional",innerType:n})}const E3=E("ZodNullable",(n,t)=>{tR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>wI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function Ov(n){return new E3({type:"nullable",innerType:n})}const C3=E("ZodDefault",(n,t)=>{nR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>SI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function $3(n,t){return new C3({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():dw(t)}})}const T3=E("ZodPrefault",(n,t)=>{rR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>_I(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function R3(n,t){return new T3({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():dw(t)}})}const Vw=E("ZodNonOptional",(n,t)=>{iR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>bI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function I3(n,t){return new Vw({type:"nonoptional",innerType:n,...U(t)})}const x3=E("ZodCatch",(n,t)=>{sR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>AI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function P3(n,t){return new x3({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const L3=E("ZodPipe",(n,t)=>{oR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>kI(n,e,r,i),n.in=t.in,n.out=t.out});function Mv(n,t){return new L3({type:"pipe",in:n,out:t})}const D3=E("ZodReadonly",(n,t)=>{aR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>EI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function O3(n){return new D3({type:"readonly",innerType:n})}const M3=E("ZodCustom",(n,t)=>{lR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>dI(n,e)});function N3(n,t={}){return eI(M3,n,t)}function z3(n){return tI(n)}const U3=[".md",".markdown"];function Bw(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function qw(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function F3(n){return qw(n).toLowerCase()}function Z3(n,t){const e=F3(n);return t.some(r=>e.endsWith(r))}function Np(n){return!Bw(n)&&Z3(n,U3)}function H3(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function Hn(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const V3=Uw({id:f().min(1),kind:$("path"),title:f(),path:f()}).strict(),B3=Uw({id:f().min(1),kind:$("url"),title:f(),url:f().refine(H3,{message:"url must be an http(s) URL"})}).strict();v3("kind",[V3,B3]);const q3=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function j3(n,t){try{const e=new URL(t),r=new URL(n,e);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:q3.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Nv(n,t){return j3(n,t).kind==="web"}const W3="/views/markdown/",G3="/views/url-unsupported/";function jw(n){return`/artifact/${encodeURIComponent(n)}`}function Y3(n,t){return`${jw(n)}/${encodeURIComponent(t)}`}function J3(n){return`/markdown/${encodeURIComponent(n)}`}function zp(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Hn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:G3,contentURL:null};if(Np(n.path)){const r={viewURL:W3,contentURL:J3(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=Bw(n.path)?`${jw(n.id)}/`:Y3(n.id,qw(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const K3="serverURL",X3="token",Q3="mode",ex="desktopAppVersion",tx="electron";function nx(n=window.location.search,t=window.location.origin){const r=new URLSearchParams(n).get(K3);return r?new URL(r).origin:new URL(t).origin}function rx(n=window.location.search){return new URLSearchParams(n).get(X3)}function dr(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(Q3)===tx}function Ww(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(ex)}const zv="tv.telemetry.clientId",ix=5,sx=60,ox=1e3,ax=ix*sx*ox,Uv=["pointerdown","scroll","keydown"],Fv=["focus"],Zv=["visibilitychange"],lx="hidden";function cx(n,t=fx){const e=n.getItem(zv);if(e)return e;const r=t();return n.setItem(zv,r),r}function ux(n){return{clientId:cx(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function hx(n){const t=new URLSearchParams;return t.set("clientId",n.clientId),t.set("userAgent",n.userAgent),t.set("clientApp",n.clientApp),n.desktopAppVersion&&t.set("desktopAppVersion",n.desktopAppVersion),t}function dx(n){return new px(n)}var fl,Wn,$r,ml,gl,At,Li,vl,ph,Gw;class px{constructor(t){g(this,ph);g(this,fl);g(this,Wn);g(this,$r);g(this,ml);g(this,gl);g(this,At);g(this,Li,!1);g(this,vl,Number.NEGATIVE_INFINITY);d(this,fl,t.meta),d(this,Wn,t.documentTarget),d(this,$r,t.windowTarget),d(this,ml,t.send),d(this,gl,t.nowMs??Date.now),d(this,At,()=>h(this,ph,Gw).call(this))}start(){if(!o(this,Li)){d(this,Li,!0);for(const t of Uv)o(this,$r).addEventListener(t,o(this,At)),o(this,Wn).addEventListener(t,o(this,At));for(const t of Fv)o(this,$r).addEventListener(t,o(this,At));for(const t of Zv)o(this,Wn).addEventListener(t,o(this,At))}}stop(){if(o(this,Li)){d(this,Li,!1);for(const t of Uv)o(this,$r).removeEventListener(t,o(this,At)),o(this,Wn).removeEventListener(t,o(this,At));for(const t of Fv)o(this,$r).removeEventListener(t,o(this,At));for(const t of Zv)o(this,Wn).removeEventListener(t,o(this,At))}}}fl=new WeakMap,Wn=new WeakMap,$r=new WeakMap,ml=new WeakMap,gl=new WeakMap,At=new WeakMap,Li=new WeakMap,vl=new WeakMap,ph=new WeakSet,Gw=function(){if(o(this,Wn).visibilityState===lx)return;const t=o(this,gl).call(this);t-o(this,vl)<ax||(d(this,vl,t),o(this,ml).call(this,{type:aC,clientId:o(this,fl).clientId}))};function fx(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Pm().toLowerCase()}const me={authenticate:"authenticate",document_did_change:"document/didChange",document_did_close:"document/didClose",document_did_focus:"document/didFocus",document_did_open:"document/didOpen",document_did_save:"document/didSave",initialize:"initialize",logout:"logout",nes_accept:"nes/accept",nes_close:"nes/close",nes_reject:"nes/reject",nes_start:"nes/start",nes_suggest:"nes/suggest",session_cancel:"session/cancel",session_close:"session/close",session_fork:"session/fork",session_list:"session/list",session_load:"session/load",session_new:"session/new",session_prompt:"session/prompt",session_resume:"session/resume",session_set_config_option:"session/set_config_option",session_set_mode:"session/set_mode",session_set_model:"session/set_model"},zn={fs_read_text_file:"fs/read_text_file",fs_write_text_file:"fs/write_text_file",session_request_permission:"session/request_permission",session_update:"session/update",terminal_create:"terminal/create",terminal_kill:"terminal/kill",terminal_output:"terminal/output",terminal_release:"terminal/release",terminal_wait_for_exit:"terminal/wait_for_exit"},mx=1,gx=w({_meta:_(f(),S()).nullish(),terminal:Oe().optional().default(!1)}),vx=w({_meta:_(f(),S()).nullish(),label:f().nullish(),name:f(),optional:Oe().optional().default(!1),secret:Oe().optional().default(!0)}),yx=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:f(),name:f()}),wx=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:f(),link:f().nullish(),name:f(),vars:M(vx)}),bx=w({_meta:_(f(),S()).nullish(),args:M(f()).optional(),description:f().nullish(),env:_(f(),f()).optional(),id:f(),name:f()}),Sx=K([wx.and(w({type:$("env_var")})),bx.and(w({type:$("terminal")})),yx]),_x=w({_meta:_(f(),S()).nullish(),methodId:f()}),Ax=w({_meta:_(f(),S()).nullish()}),kx=w({_meta:_(f(),S()).nullish(),blob:f(),mimeType:f().nullish(),uri:f()}),Ex=w({default:Oe().nullish(),description:f().nullish(),title:f().nullish()}),Cx=w({_meta:_(f(),S()).nullish()}),$x=w({_meta:_(f(),S()).nullish()}),Tx=w({amount:W(),currency:f()}),Rx=w({_meta:_(f(),S()).nullish(),terminalId:f()}),Ix=w({_meta:_(f(),S()).nullish(),newText:f(),oldText:f().nullish(),path:f()}),xx=K([f(),W(),W(),Oe(),M(f())]),Px=w({content:_(f(),xx).nullish()}),Lx=K([Px.and(w({action:$("accept")})),w({action:$("decline")}),w({action:$("cancel")})]),Dx=w({_meta:_(f(),S()).nullish()}),Yw=f(),Ox=w({_meta:_(f(),S()).nullish(),elicitationId:Yw}),Mx=w({_meta:_(f(),S()).nullish(),action:Lx}),Nx=$("object"),zx=$("string"),Ux=w({_meta:_(f(),S()).nullish()}),Fx=w({_meta:_(f(),S()).nullish(),form:Dx.nullish(),url:Ux.nullish()}),Zx=w({elicitationId:Yw,url:f().url()}),Jw=w({const:f(),title:f()}),Kw=w({_meta:_(f(),S()).nullish(),name:f(),value:f()}),Hx=K([$(-32700),$(-32600),$(-32601),$(-32602),$(-32603),$(-32800),$(-32e3),$(-32002),$(-32042),W().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),Xw=w({code:Hx,data:S().optional(),message:f()}),Qw=S(),eb=S(),tb=S(),Vx=w({_meta:_(f(),S()).nullish(),readTextFile:Oe().optional().default(!1),writeTextFile:Oe().optional().default(!1)}),nb=w({_meta:_(f(),S()).nullish(),name:f(),value:f()}),rb=w({_meta:_(f(),S()).nullish(),name:f(),title:f().nullish(),version:f()}),Bx=w({default:W().nullish(),description:f().nullish(),maximum:W().nullish(),minimum:W().nullish(),title:f().nullish()}),qx=w({_meta:_(f(),S()).nullish()}),jx=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cursor:f().nullish(),cwd:f().nullish()}),Wx=w({_meta:_(f(),S()).nullish()}),Gx=w({_meta:_(f(),S()).nullish(),logout:Wx.nullish()}),Yx=w({_meta:_(f(),S()).nullish()}),Jx=w({_meta:_(f(),S()).nullish()}),Kx=w({_meta:_(f(),S()).nullish(),http:Oe().optional().default(!1),sse:Oe().optional().default(!1)}),Xx=w({_meta:_(f(),S()).nullish(),headers:M(nb),name:f(),url:f()}),Qx=w({_meta:_(f(),S()).nullish(),headers:M(nb),name:f(),url:f()}),eP=w({_meta:_(f(),S()).nullish(),args:M(f()),command:f(),env:M(Kw),name:f()}),td=K([Xx.and(w({type:$("http")})),Qx.and(w({type:$("sse")})),eP]),Um=f(),tP=w({_meta:_(f(),S()).nullish(),description:f().nullish(),modelId:Um,name:f()}),nP=K([$("error"),$("warning"),$("information"),$("hint")]),rP=w({_meta:_(f(),S()).nullish()}),iP=w({_meta:_(f(),S()).nullish()}),sP=w({_meta:_(f(),S()).nullish()}),oP=w({_meta:_(f(),S()).nullish()}),aP=w({_meta:_(f(),S()).nullish()}),lP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),cP=w({diff:f(),uri:f()}),uP=w({endLine:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:f()}),hP=w({_meta:_(f(),S()).nullish()}),dP=w({_meta:_(f(),S()).nullish()}),pP=w({languageId:f(),text:f(),uri:f()}),fP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),mP=K([$("rejected"),$("ignored"),$("replaced"),$("cancelled")]),gP=w({excerpts:M(uP),uri:f()}),vP=w({_meta:_(f(),S()).nullish()}),yP=w({_meta:_(f(),S()).nullish()}),wP=w({name:f(),owner:f(),remoteUrl:f()}),bP=w({_meta:_(f(),S()).nullish()}),SP=w({_meta:_(f(),S()).nullish(),jump:hP.nullish(),rename:yP.nullish(),searchAndReplace:bP.nullish()}),_P=w({id:f(),isRegex:Oe().nullish(),replace:f(),search:f(),uri:f()}),AP=K([$("automatic"),$("diagnostic"),$("manual")]),kP=w({_meta:_(f(),S()).nullish(),maxCount:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),EP=w({_meta:_(f(),S()).nullish(),diagnostics:rP.nullish(),editHistory:lP.nullish(),openFiles:dP.nullish(),recentFiles:fP.nullish(),relatedSnippets:vP.nullish(),userActions:kP.nullish()}),CP=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td)}),$P=w({default:W().nullish(),description:f().nullish(),maximum:W().nullish(),minimum:W().nullish(),title:f().nullish()}),ib=f(),TP=K([$("allow_once"),$("allow_always"),$("reject_once"),$("reject_always")]),RP=w({_meta:_(f(),S()).nullish(),kind:TP,name:f(),optionId:ib}),IP=K([$("high"),$("medium"),$("low")]),xP=K([$("pending"),$("in_progress"),$("completed")]),PP=w({_meta:_(f(),S()).nullish(),content:f(),priority:IP,status:xP}),LP=w({_meta:_(f(),S()).nullish(),entries:M(PP)}),ci=w({character:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),DP=w({id:f(),position:ci,uri:f()}),OP=w({id:f(),newName:f(),position:ci,uri:f()}),MP=w({action:f(),position:ci,timestampMs:W(),uri:f()}),sb=K([$("utf-16"),$("utf-32"),$("utf-8")]),NP=w({_meta:_(f(),S()).nullish(),auth:gx.optional().default({terminal:!1}),elicitation:Fx.nullish(),fs:Vx.optional().default({readTextFile:!1,writeTextFile:!1}),nes:SP.nullish(),positionEncodings:M(sb).optional(),terminal:Oe().optional().default(!1)}),zP=w({_meta:_(f(),S()).nullish(),audio:Oe().optional().default(!1),embeddedContext:Oe().optional().default(!1),image:Oe().optional().default(!1)}),ob=W().int().gte(0).lte(65535),UP=w({_meta:_(f(),S()).nullish(),clientCapabilities:NP.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:rb.nullish(),protocolVersion:ob}),pa=w({end:ci,start:ci}),FP=w({message:f(),range:pa,severity:nP,uri:f()}),ZP=w({languageId:f(),lastFocusedMs:W().nullish(),uri:f(),visibleRange:pa.nullish()}),HP=w({_meta:_(f(),S()).nullish(),diagnostics:M(FP).nullish(),editHistory:M(cP).nullish(),openFiles:M(ZP).nullish(),recentFiles:M(pP).nullish(),relatedSnippets:M(gP).nullish(),userActions:M(MP).nullish()}),VP=w({newText:f(),range:pa}),BP=w({cursorPosition:ci.nullish(),edits:M(VP),id:f(),uri:f()}),qP=K([BP.and(w({kind:$("edit")})),DP.and(w({kind:$("jump")})),OP.and(w({kind:$("rename")})),_P.and(w({kind:$("searchAndReplace")}))]),jP=w({_meta:_(f(),S()).nullish(),content:f()}),WP=w({_meta:_(f(),S()).nullish()}),ys=K([W(),f()]).nullable();w({_meta:_(f(),S()).nullish(),requestId:ys});const GP=Zw(["assistant","user"]),kc=w({_meta:_(f(),S()).nullish(),audience:M(GP).nullish(),lastModified:f().nullish(),priority:W().nullish()}),YP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),data:f(),mimeType:f()}),JP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),data:f(),mimeType:f(),uri:f().nullish()}),KP=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),description:f().nullish(),mimeType:f().nullish(),name:f(),size:W().nullish(),title:f().nullish(),uri:f()}),XP=w({_meta:_(f(),S()).nullish(),optionId:ib}),QP=K([w({outcome:$("cancelled")}),XP.and(w({outcome:$("selected")}))]),eL=w({_meta:_(f(),S()).nullish(),outcome:QP}),tL=w({_meta:_(f(),S()).nullish()}),nL=w({_meta:_(f(),S()).nullish()}),rL=w({currentValue:Oe()}),iL=f(),ab=f(),sL=K([$("mode"),$("model"),$("thought_level"),f()]),Fm=f(),lb=w({_meta:_(f(),S()).nullish(),description:f().nullish(),name:f(),value:Fm}),oL=w({_meta:_(f(),S()).nullish(),group:iL,name:f(),options:M(lb)}),aL=K([M(lb),M(oL)]),lL=w({currentValue:Fm,options:aL}),fa=ed(K([lL.and(w({type:$("select")})),rL.and(w({type:$("boolean")}))]),w({_meta:_(f(),S()).nullish(),category:sL.nullish(),description:f().nullish(),id:ab,name:f()})),cL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa)}),uL=w({_meta:_(f(),S()).nullish()}),ae=f(),hL=w({_meta:_(f(),S()).nullish(),id:f(),sessionId:ae}),dL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),pL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),fL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),cb=w({_meta:_(f(),S()).nullish(),args:M(f()).optional(),command:f(),cwd:f().nullish(),env:M(Kw).optional(),outputByteLimit:W().nullish(),sessionId:ae}),mL=w({_meta:_(f(),S()).nullish(),sessionId:ae,uri:f()}),gL=w({_meta:_(f(),S()).nullish(),position:ci,sessionId:ae,uri:f(),version:W(),visibleRange:pa}),vL=w({_meta:_(f(),S()).nullish(),languageId:f(),sessionId:ae,text:f(),uri:f(),version:W()}),yL=w({_meta:_(f(),S()).nullish(),sessionId:ae,uri:f()}),wL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td).optional(),sessionId:ae}),ub=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),bL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td),sessionId:ae}),hb=w({_meta:_(f(),S()).nullish(),limit:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:f(),sessionId:ae}),SL=w({_meta:_(f(),S()).nullish(),id:f(),reason:mP.nullish(),sessionId:ae}),db=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),_L=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),mcpServers:M(td).optional(),sessionId:ae}),AL=w({_meta:_(f(),S()).nullish(),additionalDirectories:M(f()).optional(),cwd:f(),sessionId:ae,title:f().nullish(),updatedAt:f().nullish()}),kL=w({_meta:_(f(),S()).nullish(),nextCursor:f().nullish(),sessions:M(AL)}),EL=w({_meta:_(f(),S()).nullish(),title:f().nullish(),updatedAt:f().nullish()}),CL=w({_meta:_(f(),S()).nullish()}),nd=f(),$L=w({_meta:_(f(),S()).nullish(),currentModeId:nd}),TL=w({_meta:_(f(),S()).nullish(),description:f().nullish(),id:nd,name:f()}),rd=w({_meta:_(f(),S()).nullish(),availableModes:M(TL),currentModeId:nd}),id=w({_meta:_(f(),S()).nullish(),availableModels:M(tP),currentModelId:Um}),RL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish(),sessionId:ae}),IL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish()}),xL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish(),sessionId:ae}),PL=w({_meta:_(f(),S()).nullish(),configOptions:M(fa).nullish(),models:id.nullish(),modes:rd.nullish()}),LL=w({_meta:_(f(),S()).nullish()}),DL=w({_meta:_(f(),S()).nullish(),additionalDirectories:tL.nullish(),close:nL.nullish(),fork:uL.nullish(),list:CL.nullish(),resume:LL.nullish()}),OL=ed(K([w({type:$("boolean"),value:Oe()}),w({value:Fm})]),w({_meta:_(f(),S()).nullish(),configId:ab,sessionId:ae})),ML=w({_meta:_(f(),S()).nullish(),configOptions:M(fa)}),NL=w({_meta:_(f(),S()).nullish(),modeId:nd,sessionId:ae}),zL=w({_meta:_(f(),S()).nullish()}),UL=w({_meta:_(f(),S()).nullish(),modelId:Um,sessionId:ae}),FL=w({_meta:_(f(),S()).nullish()}),ZL=w({_meta:_(f(),S()).nullish(),sessionId:ae}),HL=K([$("end_turn"),$("max_tokens"),$("max_turn_requests"),$("refusal"),$("cancelled")]),VL=K([$("email"),$("uri"),$("date"),$("date-time")]),BL=w({default:f().nullish(),description:f().nullish(),enum:M(f()).nullish(),format:VL.nullish(),maxLength:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:M(Jw).nullish(),pattern:f().nullish(),title:f().nullish()}),qL=w({_meta:_(f(),S()).nullish(),context:HP.nullish(),position:ci,selection:pa.nullish(),sessionId:ae,triggerKind:AP,uri:f(),version:W()}),jL=w({_meta:_(f(),S()).nullish(),suggestions:M(qP)}),WL=w({_meta:_(f(),S()).nullish(),terminalId:f()}),GL=w({_meta:_(f(),S()).nullish(),exitCode:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:f().nullish()}),pb=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),YL=w({_meta:_(f(),S()).nullish(),exitStatus:GL.nullish(),output:f(),truncated:Oe()}),JL=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),text:f()}),KL=w({range:pa.nullish(),text:f()}),XL=w({_meta:_(f(),S()).nullish(),contentChanges:M(KL),sessionId:ae,uri:f(),version:W()});w({method:f(),params:K([dL,vL,XL,mL,yL,gL,hL,SL,Qw]).nullish()});const QL=K([$("full"),$("incremental")]),eD=w({_meta:_(f(),S()).nullish(),syncKind:QL}),tD=w({_meta:_(f(),S()).nullish(),didChange:eD.nullish(),didClose:iP.nullish(),didFocus:sP.nullish(),didOpen:oP.nullish(),didSave:aP.nullish()}),nD=w({_meta:_(f(),S()).nullish(),document:tD.nullish()}),rD=w({_meta:_(f(),S()).nullish(),context:EP.nullish(),events:nD.nullish()}),iD=w({_meta:_(f(),S()).nullish(),auth:Gx.optional().default({}),loadSession:Oe().optional().default(!1),mcpCapabilities:Kx.optional().default({http:!1,sse:!1}),nes:rD.nullish(),positionEncoding:sb.nullish(),promptCapabilities:zP.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:DL.optional().default({})}),sD=w({_meta:_(f(),S()).nullish(),agentCapabilities:iD.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:rb.nullish(),authMethods:M(Sx).optional().default([]),protocolVersion:ob}),oD=w({_meta:_(f(),S()).nullish(),mimeType:f().nullish(),text:f(),uri:f()}),aD=K([oD,kx]),lD=w({_meta:_(f(),S()).nullish(),annotations:kc.nullish(),resource:aD}),Zm=K([JL.and(w({type:$("text")})),JP.and(w({type:$("image")})),YP.and(w({type:$("audio")})),KP.and(w({type:$("resource_link")})),lD.and(w({type:$("resource")}))]),cD=w({_meta:_(f(),S()).nullish(),content:Zm}),ip=w({_meta:_(f(),S()).nullish(),content:Zm,messageId:f().nullish()}),uD=w({_meta:_(f(),S()).nullish(),messageId:f().nullish(),prompt:M(Zm),sessionId:ae}),hD=w({anyOf:M(Jw)}),fb=K([cD.and(w({type:$("content")})),Ix.and(w({type:$("diff")})),WL.and(w({type:$("terminal")}))]),mb=f(),gb=w({_meta:_(f(),S()).nullish(),line:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:f()}),vb=K([$("pending"),$("in_progress"),$("completed"),$("failed")]),yb=K([$("read"),$("edit"),$("delete"),$("move"),$("search"),$("execute"),$("think"),$("fetch"),$("switch_mode"),$("other")]),dD=w({_meta:_(f(),S()).nullish(),content:M(fb).optional(),kind:yb.optional(),locations:M(gb).optional(),rawInput:S().optional(),rawOutput:S().optional(),status:vb.optional(),title:f(),toolCallId:mb}),wb=w({_meta:_(f(),S()).nullish(),content:M(fb).nullish(),kind:yb.nullish(),locations:M(gb).nullish(),rawInput:S().optional(),rawOutput:S().optional(),status:vb.nullish(),title:f().nullish(),toolCallId:mb}),bb=w({_meta:_(f(),S()).nullish(),options:M(RP),sessionId:ae,toolCall:wb}),pD=w({_meta:_(f(),S()).nullish(),hint:f()}),fD=pD,mD=w({_meta:_(f(),S()).nullish(),description:f(),input:fD.nullish(),name:f()}),gD=w({_meta:_(f(),S()).nullish(),availableCommands:M(mD)}),vD=w({enum:M(f()),type:zx}),yD=K([vD,hD]),wD=w({default:M(f()).nullish(),description:f().nullish(),items:yD,maxItems:W().nullish(),minItems:W().nullish(),title:f().nullish()}),bD=K([BL.and(w({type:$("string")})),$P.and(w({type:$("number")})),Bx.and(w({type:$("integer")})),Ex.and(w({type:$("boolean")})),wD.and(w({type:$("array")}))]),SD=w({description:f().nullish(),properties:_(f(),bD).optional().default({}),required:M(f()).nullish(),title:f().nullish(),type:Nx.optional().default("object")}),_D=w({requestedSchema:SD}),AD=ed(K([_D.and(w({mode:$("form")})),Zx.and(w({mode:$("url")}))]),w({_meta:_(f(),S()).nullish(),message:f(),sessionId:ae})),kD=w({cachedReadTokens:W().nullish(),cachedWriteTokens:W().nullish(),inputTokens:W(),outputTokens:W(),thoughtTokens:W().nullish(),totalTokens:W()}),ED=w({_meta:_(f(),S()).nullish(),stopReason:HL,usage:kD.nullish(),userMessageId:f().nullish()});K([w({id:ys,result:K([sD,Ax,Jx,xL,IL,kL,RL,PL,$x,zL,ML,ED,FL,ZL,jL,Cx,tb])}),w({error:Xw,id:ys})]);const CD=w({_meta:_(f(),S()).nullish(),cost:Tx.nullish(),size:W(),used:W()}),$D=K([ip.and(w({sessionUpdate:$("user_message_chunk")})),ip.and(w({sessionUpdate:$("agent_message_chunk")})),ip.and(w({sessionUpdate:$("agent_thought_chunk")})),dD.and(w({sessionUpdate:$("tool_call")})),wb.and(w({sessionUpdate:$("tool_call_update")})),LP.and(w({sessionUpdate:$("plan")})),gD.and(w({sessionUpdate:$("available_commands_update")})),$L.and(w({sessionUpdate:$("current_mode_update")})),cL.and(w({sessionUpdate:$("config_option_update")})),EL.and(w({sessionUpdate:$("session_info_update")})),CD.and(w({sessionUpdate:$("usage_update")}))]),Sb=w({_meta:_(f(),S()).nullish(),sessionId:ae,update:$D});w({method:f(),params:K([Sb,Ox,Qw]).nullish()});const _b=w({_meta:_(f(),S()).nullish(),sessionId:ae,terminalId:f()}),TD=w({_meta:_(f(),S()).nullish(),exitCode:W().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:f().nullish()}),RD=w({name:f(),uri:f()}),ID=w({_meta:_(f(),S()).nullish(),repository:wP.nullish(),workspaceFolders:M(RD).nullish(),workspaceUri:f().nullish()});w({id:ys,method:f(),params:K([UP,_x,Yx,CP,bL,jx,wL,_L,fL,NL,OL,uD,UL,ID,qL,pL,eb]).nullish()});const Ab=w({_meta:_(f(),S()).nullish(),content:f(),path:f(),sessionId:ae});w({id:ys,method:f(),params:K([Ab,hb,bb,cb,pb,db,_b,ub,AD,eb]).nullish()});const xD=w({_meta:_(f(),S()).nullish()});K([w({id:ys,result:K([xD,jP,eL,Rx,YL,WP,TD,qx,Mx,tb])}),w({error:Xw,id:ys})]);var se;class PD{constructor(t,e){g(this,se);const r=t(this),i=async(a,l)=>{var c,u,p,m,v,y,k;switch(a){case zn.fs_write_text_file:{const A=Ab.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,A)}case zn.fs_read_text_file:{const A=hb.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,A)}case zn.session_request_permission:{const A=bb.parse(l);return r.requestPermission(A)}case zn.terminal_create:{const A=cb.parse(l);return(p=r.createTerminal)==null?void 0:p.call(r,A)}case zn.terminal_output:{const A=pb.parse(l);return(m=r.terminalOutput)==null?void 0:m.call(r,A)}case zn.terminal_release:{const A=db.parse(l);return await((v=r.releaseTerminal)==null?void 0:v.call(r,A))??{}}case zn.terminal_wait_for_exit:{const A=_b.parse(l);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,A)}case zn.terminal_kill:{const A=ub.parse(l);return await((k=r.killTerminal)==null?void 0:k.call(r,A))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw Ie.methodNotFound(a)}},s=async(a,l)=>{switch(a){case zn.session_update:{const c=Sb.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw Ie.methodNotFound(a)}};d(this,se,new LD(i,s,e))}async initialize(t){return await o(this,se).sendRequest(me.initialize,t)}async newSession(t){return await o(this,se).sendRequest(me.session_new,t)}async loadSession(t){return await o(this,se).sendRequest(me.session_load,t)??{}}async unstable_forkSession(t){return await o(this,se).sendRequest(me.session_fork,t)}async listSessions(t){return await o(this,se).sendRequest(me.session_list,t)}async unstable_resumeSession(t){return await o(this,se).sendRequest(me.session_resume,t)}async unstable_closeSession(t){return await o(this,se).sendRequest(me.session_close,t)}async setSessionMode(t){return await o(this,se).sendRequest(me.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await o(this,se).sendRequest(me.session_set_model,t)??{}}async setSessionConfigOption(t){return await o(this,se).sendRequest(me.session_set_config_option,t)}async authenticate(t){return await o(this,se).sendRequest(me.authenticate,t)??{}}async unstable_logout(t){return await o(this,se).sendRequest(me.logout,t)??{}}async prompt(t){return await o(this,se).sendRequest(me.session_prompt,t)}async cancel(t){return await o(this,se).sendNotification(me.session_cancel,t)}async unstable_startNes(t){return await o(this,se).sendRequest(me.nes_start,t)}async unstable_suggestNes(t){return await o(this,se).sendRequest(me.nes_suggest,t)}async unstable_closeNes(t){return await o(this,se).sendRequest(me.nes_close,t)??{}}async unstable_didOpenDocument(t){return await o(this,se).sendNotification(me.document_did_open,t)}async unstable_didChangeDocument(t){return await o(this,se).sendNotification(me.document_did_change,t)}async unstable_didCloseDocument(t){return await o(this,se).sendNotification(me.document_did_close,t)}async unstable_didSaveDocument(t){return await o(this,se).sendNotification(me.document_did_save,t)}async unstable_didFocusDocument(t){return await o(this,se).sendNotification(me.document_did_focus,t)}async unstable_acceptNes(t){return await o(this,se).sendNotification(me.nes_accept,t)}async unstable_rejectNes(t){return await o(this,se).sendNotification(me.nes_reject,t)}async extMethod(t,e){return await o(this,se).sendRequest(t,e)}async extNotification(t,e){return await o(this,se).sendNotification(t,e)}get signal(){return o(this,se).signal}get closed(){return o(this,se).closed}}se=new WeakMap;var Tr,fh,yl,wl,lo,co,an,bl,ye,kb,Up,Eb,Cb,$b,Tb,Fp,za;class LD{constructor(t,e,r){g(this,ye);g(this,Tr,new Map);g(this,fh,0);g(this,yl);g(this,wl);g(this,lo);g(this,co,Promise.resolve());g(this,an,new AbortController);g(this,bl);d(this,yl,t),d(this,wl,e),d(this,lo,r),d(this,bl,new Promise(i=>{o(this,an).signal.addEventListener("abort",()=>i())})),h(this,ye,kb).call(this)}get signal(){return o(this,an).signal}get closed(){return o(this,bl)}async sendRequest(t,e){h(this,ye,Fp).call(this);const r=Nc(this,fh)._++,i=new Promise((s,a)=>{o(this,Tr).set(r,{resolve:s,reject:a})});return await h(this,ye,za).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){h(this,ye,Fp).call(this),await h(this,ye,za).call(this,{jsonrpc:"2.0",method:t,params:e})}}Tr=new WeakMap,fh=new WeakMap,yl=new WeakMap,wl=new WeakMap,lo=new WeakMap,co=new WeakMap,an=new WeakMap,bl=new WeakMap,ye=new WeakSet,kb=async function(){let t;try{const e=o(this,lo).readable.getReader();try{for(;!o(this,an).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{h(this,ye,Eb).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&h(this,ye,za).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{h(this,ye,Up).call(this,t)}},Up=function(t){if(o(this,an).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of o(this,Tr).values())r.reject(e);o(this,Tr).clear(),o(this,an).abort(e)},Eb=async function(t){if("method"in t&&"id"in t){const e=await h(this,ye,Cb).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await h(this,ye,za).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await h(this,ye,$b).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?h(this,ye,Tb).call(this,t):console.error("Invalid message",{message:t})},Cb=async function(t,e){try{return{result:await o(this,yl).call(this,t,e)??null}}catch(r){if(r instanceof Ie)return r.toResult();if(r instanceof xv)return Ie.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ie.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ie.internalError({details:i}).toResult()}}},$b=async function(t,e){try{return await o(this,wl).call(this,t,e),{result:null}}catch(r){if(r instanceof Ie)return r.toResult();if(r instanceof xv)return Ie.invalidParams(r.format()).toResult();let i;(r instanceof Error||typeof r=="object"&&r!=null&&"message"in r&&typeof r.message=="string")&&(i=r.message);try{return Ie.internalError(i?JSON.parse(i):{}).toResult()}catch{return Ie.internalError({details:i}).toResult()}}},Tb=function(t){const e=o(this,Tr).get(t.id);if(e){if("result"in t)e.resolve(t.result);else if("error"in t){const{code:r,message:i,data:s}=t.error;e.reject(new Ie(r,i,s))}o(this,Tr).delete(t.id)}else console.error("Got response to unknown request",t.id)},Fp=function(){if(o(this,an).signal.aborted)throw o(this,an).signal.reason??new Error("ACP connection closed")},za=async function(t){return d(this,co,o(this,co).then(async()=>{const e=o(this,lo).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{h(this,ye,Up).call(this,e)})),o(this,co)};class Ie extends Error{constructor(e,r,i){super(r);C(this,"code");C(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new Ie(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new Ie(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new Ie(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new Ie(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new Ie(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new Ie(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new Ie(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function DD(n,t,e){const r=n.dispose.bind(n);n.dispose=()=>{if(!t())return e(),r()}}function Rb(n){var e;class t extends n{constructor(...s){super(...s);g(this,e,!1);DD(this,()=>o(this,e),()=>{d(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return o(this,e)}}return e=new WeakMap,t}const OD=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,MD=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,ND=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,zD=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,UD=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,FD="single_session",ZD={name:"television-acp-client",version:"0.0.0"},Ib="agent:main:television",HD=Rb(di);var uo,ln,pt,cn,Rr,Zt,Gn,un,hn,Ir,Ht,ho,po,dn,We,Yn,fo,Di,Jn,xr,Sl,Vt,pn,mh,fn,R,Zp,xb,Pb,Lb,gu,Db,Ob,Mb,Nb,zb,Ub,Fb,wi,Fs,Zs,Fn,Zb,Hs,Hp,Vp,vu,Hb,yu,Bp,qp,_l,Al,wu,Vs,jp,Vb;class VD extends HD{constructor(e){super();g(this,R);g(this,uo,"disconnected");g(this,ln,null);g(this,pt,new Map);g(this,cn,null);g(this,Rr,null);g(this,Zt,null);g(this,Gn,null);g(this,un,null);g(this,hn,null);g(this,Ir);g(this,Ht,null);g(this,ho,0);g(this,po,1);g(this,dn,null);g(this,We,null);g(this,Yn,!1);g(this,fo,!1);g(this,Di,!1);g(this,Jn,null);g(this,xr,new Set);g(this,Sl);g(this,Vt);g(this,pn);g(this,mh,e=>{h(this,R,Pb).call(this,e)});g(this,fn,null);g(this,_l,()=>{h(this,R,Vs).call(this,"ACP bridge websocket closed")});g(this,Al,()=>{h(this,R,Vs).call(this,"ACP bridge websocket error")});d(this,Vt,e),d(this,pn,e.sessionMode??FD),d(this,Ir,e.mappedSessionStore??BD()),d(this,Sl,e.createSocket??(r=>new WebSocket(r)))}get status(){return o(this,uo)}get messages(){return[...o(this,pt).values()]}get enabled(){return o(this,Vt).enabled??!1}setToken(e){o(this,Vt).token=e??""}setEnabled(e){o(this,Vt).enabled=e,e||(h(this,R,wu).call(this),d(this,ln,null),h(this,R,Fn).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){o(this,Rr)===null&&(d(this,ln,null),d(this,Rr,h(this,R,xb).call(this)));try{await o(this,Rr),await h(this,R,gu).call(this)}catch(e){throw h(this,R,Vs).call(this,sp(e)),e}}}dispose(){h(this,R,wu).call(this),d(this,ln,null),h(this,R,Fn).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Zp).call(this,"ready")),(o(this,un)===null||o(this,Ht)!==h(this,R,yu).call(this))&&await h(this,R,gu).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=e.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,R,Fs).call(this,{id:h(this,R,Hs).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,R,Fn).call(this,"running");try{const i=await h(this,R,vu).call(this).prompt({sessionId:h(this,R,Vp).call(this),prompt:[{type:"text",text:h(this,R,Zb).call(this,r)}]});h(this,R,wi).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,R,Fn).call(this,"ready")}catch(i){throw h(this,R,Vb).call(this)||(h(this,R,wi).call(this,"error"),h(this,R,Fn).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,R,Zp).call(this,"ready"));const e=h(this,R,yu).call(this);((r=o(this,hn))==null?void 0:r.sessionIdStrategy)==="mapped"?o(this,Ir).clearActualSessionId(e):d(this,ho,o(this,ho)+1),d(this,Zt,null),d(this,Gn,null),d(this,un,null),d(this,Ht,null),h(this,R,jp).call(this)}async cancel(){this.status==="running"&&(h(this,R,Fn).call(this,"cancelling"),await h(this,R,vu).call(this).cancel({sessionId:h(this,R,Vp).call(this)}))}setChannelContext(e){var s,a,l;if(e===null){if(o(this,We)===null)return;d(this,We,null),d(this,Yn,!1);return}const r={channelID:e.channelID,channelName:e.channelName};if(((s=o(this,We))==null?void 0:s.channelID)===r.channelID&&((a=o(this,We))==null?void 0:a.channelName)===r.channelName)return;const i=((l=o(this,We))==null?void 0:l.channelID)??null;if(d(this,We,r),o(this,pn)==="single_session"){(!o(this,Ht)||i!==r.channelID)&&d(this,Yn,!0);return}o(this,Ht)!==h(this,R,Bp).call(this,r.channelID)&&(d(this,Zt,null),d(this,Gn,null),o(this,cn)&&this.status==="ready"&&h(this,R,gu).call(this).catch(c=>{h(this,R,Vs).call(this,sp(c))}))}}uo=new WeakMap,ln=new WeakMap,pt=new WeakMap,cn=new WeakMap,Rr=new WeakMap,Zt=new WeakMap,Gn=new WeakMap,un=new WeakMap,hn=new WeakMap,Ir=new WeakMap,Ht=new WeakMap,ho=new WeakMap,po=new WeakMap,dn=new WeakMap,We=new WeakMap,Yn=new WeakMap,fo=new WeakMap,Di=new WeakMap,Jn=new WeakMap,xr=new WeakMap,Sl=new WeakMap,Vt=new WeakMap,pn=new WeakMap,mh=new WeakMap,fn=new WeakMap,R=new WeakSet,Zp=async function(e){if(this.status!==e){if(this.status==="disposed")throw new Error("ACPClient has been disposed");if(this.status==="disconnected")throw new Error(o(this,ln)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===e){s(),r();return}if(this.status==="disposed"){s(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(s(),i(new Error(o(this,ln)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},xb=async function(){try{const{stream:e,socket:r,metadata:i}=await GD({serverURL:o(this,Vt).serverURL,token:o(this,Vt).token,createSocket:o(this,Sl),onDisconnect:o(this,mh)});d(this,hn,i),d(this,fn,r),r.addEventListener("close",o(this,_l)),r.addEventListener("error",o(this,Al)),d(this,cn,new PD(s=>({connection:s,sessionUpdate:async a=>{await h(this,R,Ob).call(this,a)},requestPermission:async a=>h(this,R,Mb).call(this,a)}),e)),await o(this,cn).initialize({protocolVersion:mx,clientCapabilities:{},clientInfo:ZD})}catch(e){throw e}},Pb=function(e){h(this,R,Vs).call(this,sp(e))},Lb=function(e){const r=e==null?void 0:e.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(s=>s.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},gu=async function(){const e=h(this,R,yu).call(this);if(o(this,Zt)&&o(this,Gn)===e){await o(this,Zt);return}d(this,Gn,e),d(this,Zt,h(this,R,Db).call(this,e)),await o(this,Zt)},Db=async function(e){var c;const r=h(this,R,vu).call(this);h(this,R,jp).call(this);let i,s=!1,a=null;const l={cwd:h(this,R,Hb).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(d(this,Di,!0),d(this,Jn,null),((c=o(this,hn))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=o(this,Ir).getActualSessionId(e);if(u)try{const p=await r.loadSession({...l,sessionId:u});if(qD(p))throw new Error("Mapped ACP session was not found");a=p,i=u,s=!0}catch{const p=await r.newSession(l);a=p,i=p.sessionId,o(this,Ir).setActualSessionId(e,i),s=!1}else{const p=await r.newSession(l);a=p,i=p.sessionId,o(this,Ir).setActualSessionId(e,i),s=!1}}else try{a=await r.loadSession({...l,sessionId:e}),i=e,s=o(this,pt).size>0}catch{const u=await r.newSession(l);a=u,i=u.sessionId,s=!1}}finally{d(this,Di,!1),d(this,Jn,null),h(this,R,wi).call(this,"final")}h(this,R,Lb).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,un,i),d(this,Ht,e),d(this,fo,!0),s?(o(this,xr).add(e),o(this,pn)==="single_session"&&d(this,Yn,!1)):(o(this,xr).delete(e),d(this,Yn,o(this,pn)==="single_session")),d(this,ln,null),h(this,R,Fn).call(this,"ready")},Ob=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,R,Fb).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,R,Nb).call(this,r.content.text);return;case"tool_call":h(this,R,zb).call(this,r);return;case"tool_call_update":h(this,R,Ub).call(this,r);return;case"agent_thought_chunk":return;default:return}},Mb=async function(e){return{outcome:{outcome:"cancelled"}}},Nb=function(e){d(this,Jn,null);const r=WD(e);if(!r)return;if(!o(this,dn)){const s={id:h(this,R,Hs).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,dn,s.id),h(this,R,Fs).call(this,s);return}const i=o(this,pt).get(o(this,dn));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,R,Zs).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},zb=function(e){h(this,R,wi).call(this,"final");const r=h(this,R,Hp).call(this,e.toolCallId),i=Vv("content"in e?e.content:void 0),s={id:(r==null?void 0:r.id)??h(this,R,Hs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:e.title,toolKind:e.kind??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,Zs).call(this,s);return}h(this,R,Fs).call(this,s)},Ub=function(e){const r=h(this,R,Hp).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",s=Vv(e.content),a=s?`${i}${s}`:i,l={id:(r==null?void 0:r.id)??h(this,R,Hs).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:(r==null?void 0:r.title)??e.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:a,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,R,Zs).call(this,l);return}h(this,R,Fs).call(this,l)},Fb=function(e){if(h(this,R,wi).call(this,"final"),!e)return;const r=o(this,Di)?o(this,Jn):null;if(!r){const s=Hv(e);if(!s)return;const a={id:h(this,R,Hs).call(this,"user"),kind:"user",text:s,status:"final"};h(this,R,Fs).call(this,a),o(this,Di)&&d(this,Jn,a.id);return}const i=o(this,pt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,R,Zs).call(this,{...i,text:Hv(`${i.text}${e}`)})},wi=function(e){if(!o(this,dn))return;const r=o(this,pt).get(o(this,dn));(r==null?void 0:r.kind)==="assistant"&&h(this,R,Zs).call(this,{...r,status:e}),d(this,dn,null)},Fs=function(e){o(this,pt).set(e.id,e),this.dispatchEvent(new tp("messages-changed"))},Zs=function(e){o(this,pt).set(e.id,e),this.dispatchEvent(new tp("messages-changed"))},Fn=function(e){o(this,uo)!==e&&(d(this,uo,e),this.dispatchEvent(new QC("status-changed")))},Zb=function(e){const r=o(this,Ht);if(!r)return e;const i=o(this,We)?o(this,pn)==="single_session"?o(this,Yn)||!o(this,xr).has(r):!o(this,xr).has(r):!1,s=o(this,fo)&&(o(this,We)!==null||zD.test(e));if(!(s||i))return e;s&&d(this,fo,!1),i&&(d(this,Yn,!1),o(this,xr).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."];return o(this,We)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${o(this,We).channelID}`),l.push(`channel_name: ${o(this,We).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",e),l.join(`
43
+ `)},Hs=function(e){const r=`${e}-${o(this,po)}`;return d(this,po,o(this,po)+1),r},Hp=function(e){for(const r of o(this,pt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},Vp=function(){if(!o(this,un))throw new Error("ACP session is not ready");return o(this,un)},vu=function(){if(!o(this,cn))throw new Error("ACP connection is not ready");return o(this,cn)},Hb=function(){var r;const e=(r=o(this,hn))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},yu=function(){var r;if(o(this,pn)==="single_session")return h(this,R,qp).call(this,`${Ib}-${(o(this,Vt).clientGUID??"default-client").toLowerCase()}`);const e=(r=o(this,We))==null?void 0:r.channelID;if(!e)throw new Error("Channel context is required for per-channel session mode");return h(this,R,Bp).call(this,e)},Bp=function(e){return h(this,R,qp).call(this,jD(o(this,pn),e,o(this,Vt).clientGUID??"default-client"))},qp=function(e){var r;return((r=o(this,hn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&o(this,ho)>0?`${e}:epoch-${o(this,ho)}`:e},_l=new WeakMap,Al=new WeakMap,wu=function(){d(this,cn,null),d(this,Rr,null),d(this,Zt,null),d(this,Gn,null),d(this,un,null),d(this,Ht,null),d(this,hn,null),o(this,fn)&&(o(this,fn).removeEventListener("close",o(this,_l)),o(this,fn).removeEventListener("error",o(this,Al)),o(this,fn).close(),d(this,fn,null))},Vs=function(e){const r=o(this,cn)!==null||o(this,Rr)!==null||o(this,Zt)!==null||o(this,Gn)!==null||o(this,un)!==null||o(this,Ht)!==null||o(this,hn)!==null||o(this,fn)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,R,wi).call(this,"error"),h(this,R,wu).call(this),d(this,ln,e??null),h(this,R,Fn).call(this,"disconnected"))},jp=function(){const e=o(this,pt).size>0;d(this,dn,null),d(this,Jn,null),d(this,po,1),o(this,pt).clear(),e&&this.dispatchEvent(new tp("messages-changed"))},Vb=function(){return this.status==="disconnected"};function BD(){const n=new Map;return{getActualSessionId(t){return n.get(t)??null},setActualSessionId(t,e){n.set(t,e)},clearActualSessionId(t){n.delete(t)}}}function qD(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function jD(n,t,e){return n==="single_session"?`${Ib}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function Bb(n){return n.replace(/^(?:\s*\n)+/,"")}function Hv(n){let t=n;return t=t.replace(OD,""),t=t.replace(MD,""),t=t.replace(ND,""),t=Bb(t),t}function WD(n){let t=n;return t=t.replace(UD,""),t=Bb(t),t}function Vv(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function GD(n){const t=n.createSocket(KD(n.serverURL,n.token));let e=!1,r,i;const s=new Promise((u,p)=>{r=u,i=p}),a=new ReadableStream({start(u){let p=!1;const m=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},v=A=>{const x=JD(A);if(!x)return;let L;try{L=JSON.parse(x)}catch(D){const V=D instanceof Error?D:new Error(String(D));i(V),u.error(V);return}switch(L.type){case"acp-bridge-status":if(L.status==="ready"){let D;try{D=YD(L)}catch(V){const F=V instanceof Error?V:new Error(String(V));e||i(F),u.error(F);return}e||(e=!0,r(D));return}if(L.status==="error"||L.status==="exited"){const D=new Error(L.error??`ACP bridge ${L.status}`);e||i(D),u.error(D)}return;case"acp-bridge-message":u.enqueue(L.message);return}},y=()=>{var x;if(p)return;p=!0;const A=new Error("ACP bridge websocket closed");e||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.close()},k=()=>{var x;if(p)return;p=!0;const A=new Error("ACP bridge websocket error");e||i(A),(x=n.onDisconnect)==null||x.call(n,A),u.error(A)};t.addEventListener("open",m),t.addEventListener("message",v),t.addEventListener("close",y),t.addEventListener("error",k)}}),l=new WritableStream({async write(u){await s,t.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){t.close()},abort(){t.close()}}),c=await s;return{stream:{readable:a,writable:l},socket:t,metadata:c}}function YD(n){const{agent:t,sessionIdStrategy:e,sessionCwd:r}=n;if((t==="openclaw"||t==="hermes")&&(e==="deterministic"||e==="mapped")&&typeof r=="string"&&r.length>0)return{agent:t,sessionIdStrategy:e,sessionCwd:r};throw new Error("ACP bridge ready status missing bootstrap metadata")}function JD(n){if(typeof n=="string")return n;if(n instanceof Uint8Array)return new TextDecoder().decode(n);if(typeof Buffer<"u"&&n instanceof Buffer)return n.toString("utf8");if(typeof n=="object"&&n!==null&&"data"in n){const t=n.data;if(typeof t=="string")return t;if(t instanceof Uint8Array)return new TextDecoder().decode(t);if(Array.isArray(t))return Buffer.concat(t).toString("utf8")}return null}function KD(n,t){const e=new URL(n);return e.protocol=e.protocol==="https:"?"wss:":"ws:",e.pathname="/acp",e.search="",e.searchParams.set("token",t),e.hash="",e.toString()}function sp(n){return n instanceof Error?n.message:String(n)}const Bv="television.acpClientGUID",qv="television.acpMappedSessions",jv=1;var mo;class XD{constructor(){g(this,mo,new Map)}getActualSessionId(t){return o(this,mo).get(t)??null}setActualSessionId(t,e){o(this,mo).set(t,e)}clearActualSessionId(t){o(this,mo).delete(t)}}mo=new WeakMap;var go,kl,vt,bu,Su,Wp;class QD{constructor(t,e){g(this,vt);g(this,go);g(this,kl);d(this,go,t),d(this,kl,e)}getActualSessionId(t){const e=h(this,vt,Su).call(this)[h(this,vt,bu).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=h(this,vt,Su).call(this);r[h(this,vt,bu).call(this,t)]=e,h(this,vt,Wp).call(this,r)}clearActualSessionId(t){const e=h(this,vt,Su).call(this);delete e[h(this,vt,bu).call(this,t)],h(this,vt,Wp).call(this,e)}}go=new WeakMap,kl=new WeakMap,vt=new WeakSet,bu=function(t){return JSON.stringify([o(this,kl),t])},Su=function(){const t=o(this,go).getItem(qv);if(!t)return{};let e;try{e=JSON.parse(t)}catch{return{}}if(typeof e!="object"||e===null||Array.isArray(e))return{};const r=e;return r.version!==jv?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},Wp=function(t){const e={version:jv,entries:t};o(this,go).setItem(qv,JSON.stringify(e))};function qb(){return typeof window>"u"?null:window.localStorage}function e5(n){const t=n.getItem(Bv);if(t)return t;const e=Pm().toLowerCase();return n.setItem(Bv,e),e}const Wv=4401,t5=401,Yc=1e3,n5=3e4;class _u extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class r5 extends di{constructor(e){var a,l;super();C(this,"url");C(this,"name");C(this,"telemetryMeta");C(this,"status","unauthorized");C(this,"channels",new Map);C(this,"client");C(this,"acpClient");C(this,"_token");C(this,"attempting",!1);C(this,"nextRetryAt",null);C(this,"hasEverConnected",!1);C(this,"hasAuthRejected",!1);C(this,"hasAuthTokenRejected",!1);C(this,"bootState","pending");C(this,"serverVersion",null);C(this,"updateState",null);C(this,"decideBoot");C(this,"navigationPending");C(this,"createSocket");C(this,"createClient");C(this,"socket",null);C(this,"connectAttempt",0);C(this,"autoReconnect",!1);C(this,"retryTimer",null);C(this,"retryDelay",Yc);C(this,"visibilityEventTarget");C(this,"networkEventTarget");C(this,"onVisibilityChange");C(this,"onNetworkOnline");C(this,"telemetryActivityAgent");this.url=oi(e.url),this.name=e.name,this.decideBoot=e.decideBoot??null,this.navigationPending=e.navigationPending??(()=>!1),this._token=e.token??null,this.telemetryMeta=e.telemetryMeta??null,this.createSocket=e.createSocket??(c=>new WebSocket(c)),this.createClient=e.createClient??((c,u,p)=>new CC(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...p?{telemetryMeta:p}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new QD(e.acpStorage,this.url):new XD);this.acpClient=new VD({serverURL:this.url,token:this._token??"",...e.createACPSocket?{createSocket:e.createACPSocket}:e.createSocket?{createSocket:e.createSocket}:{},...e.clientGUID?{clientGUID:e.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=e.visibilityEventTarget!==void 0?e.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=e.networkEventTarget!==void 0?e.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(a=this.visibilityEventTarget)==null||a.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=e.telemetryDocumentTarget!==void 0?e.telemetryDocumentTarget:typeof document<"u"?document:null,s=e.telemetryWindowTarget!==void 0?e.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&s?dx({meta:this.telemetryMeta,documentTarget:i,windowTarget:s,send:c=>this.sendTelemetryActivity(c)}):null}get token(){return this._token}clearToken(){this._token=null,this.acpClient.setToken(null),this.client=this.createClient(this.url,null,this.telemetryMeta)}async connect(e){this._token=e,this.hasAuthRejected=!1,this.hasAuthTokenRejected=!1,this.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Yc,this.autoReconnect=!0,await this.attempt()}dispose(){var e,r,i,s;this.autoReconnect=!1,this.connectAttempt+=1,this.cancelRetryTimer(),(e=this.socket)==null||e.close(),this.socket=null,this.setStatus("unauthorized"),(r=this.visibilityEventTarget)==null||r.removeEventListener("visibilitychange",this.onVisibilityChange),(i=this.networkEventTarget)==null||i.removeEventListener("online",this.onNetworkOnline),(s=this.telemetryActivityAgent)==null||s.stop(),this.acpClient.dispose()}getViewURL(e){const r=zp(e,{electron:dr()});return dr()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(e){const r=zp(e,{electron:dr()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(e){const{channel:r}=await this.client.channels.create({name:e});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"channel-created":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Ma("channels-changed"));break;case"channel-updated":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new Ma("channels-changed"));break;case"channel-removed":this.channels.delete(e.channelID),this.dispatchEvent(new Ma("channels-changed"));break;case"artifact-created":{const r=this.channels.get(e.channelID);r&&!cC(r).includes(e.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[e.artifact.id],geometry:{...Gy},size:{...Yy}}]);break}case"artifact-removed":{const r=this.channels.get(e.channelID);r&&(r.layout=$p(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return i5(e,"server event")}}async attempt(){var i;this.attempting=!0,this.nextRetryAt=null,this.connectAttempt+=1,this.bootState="pending";const e=this.connectAttempt;(i=this.socket)==null||i.close(),this.client=this.createClient(this.url,this._token,this.telemetryMeta),this.setStatus("disconnected"),this.dispatchEvent(new xt("change"));const r=this.createSocket(s5(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,a)=>{let l=!1;const c=()=>{var m;l||this.connectAttempt!==e||(l=!0,this.retryDelay=Yc,this.hasEverConnected=!0,this.setStatus("connected"),(m=this.telemetryActivityAgent)==null||m.start(),s())},u=m=>{l||this.connectAttempt!==e||(l=!0,a(m))},p=async()=>{const m=this.hasEverConnected;try{const[{channels:v},y]=await Promise.all([this.client.channels.list(),this.client.display.get()]);this.channels=new Map(v.map(k=>[k.id,structuredClone(k)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new xt("change")),m&&this.dispatchEvent(new Ma("channels-changed")),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:{type:"channel-changed",channelID:y.focusedChannelId}})),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:{type:"pinned-channels-changed",pinnedChannelIds:[...y.pinnedChannelIds]}})),c(),m&&this.connectAttempt===e&&this.dispatchEvent(new ow("server-reconnected",{serverURL:this.url}))}catch(v){if(h5(v)){u(new _u);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||p())}),r.addEventListener("message",m=>{const v=u5(m);if(!v)return;if(v.type==="server-status"){const k=v;this.serverVersion=k.version,this.updateState=k.update??null;let A=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(k)==="boot"?(this.bootState="booted",A=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new aw("server-status",{serverURL:this.url,message:k})),A?this.navigationPending()||p():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new xt("change"));return}if(!c5(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new fu("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",m=>{if(this.connectAttempt!==e)return;this.socket=null;const v=o5(m);if(!l){u(v===Wv?new _u:new Error("Connection closed before initialization"));return}if(v===Wv){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(l){this.handleTransportFailure(new Error("WebSocket error"));return}u(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},s=>{throw this.attempting=!1,this.handleAttemptFailure(s),s})}handleAuthRejected(){this.hasAuthRejected=!0,this.hasAuthTokenRejected=this._token!==null,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof _u){this.handleAuthRejected();return}this.autoReconnect&&this.scheduleRetry()}handleTransportFailure(e){this.autoReconnect&&(this.setStatus("disconnected"),this.scheduleRetry())}scheduleRetry(){this.cancelRetryTimer(),this.connectAttempt+=1;const e=this.retryDelay;this.retryDelay=Math.min(this.retryDelay*2,n5),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new xt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new xt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Yc,this.attempt().catch(()=>{})))}sendTelemetryActivity(e){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(e)))}sendTelemetrySignal(e,r){var s;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:lC,clientId:this.telemetryMeta.clientId,event:e,properties:r};(s=this.socket)==null||s.send(JSON.stringify(i))}setStatus(e){this.status!==e&&(this.status=e,this.dispatchEvent(new xt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function i5(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function s5(n,t,e=null){const r=new URL(n);if(r.protocol=r.protocol==="https:"?"wss:":"ws:",r.pathname="/events",r.search="",t&&r.searchParams.set("token",t),e)for(const[i,s]of hx(e))r.searchParams.set(i,s);return r.hash="",r.toString()}function o5(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const a5={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"appearance-changed":!0,"artifact-focus":!0},l5=new Set(Object.keys(a5));function c5(n){return l5.has(n)}function u5(n){const t=typeof n=="string"?n:typeof n=="object"&&n!==null&&"data"in n&&typeof n.data=="string"?n.data:"";if(!t)return null;let e;try{e=JSON.parse(t)}catch{return null}return typeof e!="object"||e===null||!("type"in e)||typeof e.type!="string"?null:e}function h5(n){return n instanceof ha&&n.status===t5}const d5="Local";var kt,Bt,Pn,Gp,Yp,jb,El,Cl,$l,Tl,Rl;class p5 extends di{constructor(e){super();g(this,Pn);C(this,"connection");C(this,"clientGUID");C(this,"acpStorage");C(this,"connectError",null);g(this,kt);g(this,Bt,!1);g(this,El,()=>{o(this,Bt)||(h(this,Pn,jb).call(this),this.dispatchEvent(new xt("change")))});g(this,Cl,e=>{o(this,Bt)||this.dispatchEvent(new fu("server-event",{serverURL:e.serverURL,event:e.event}))});g(this,$l,()=>{o(this,Bt)||this.dispatchEvent(new Ma("channels-changed"))});g(this,Tl,e=>{o(this,Bt)||this.dispatchEvent(new ow("server-reconnected",{serverURL:e.serverURL}))});g(this,Rl,e=>{o(this,Bt)||this.dispatchEvent(new aw("server-status",{serverURL:e.serverURL,message:e.message}))});d(this,kt,e.localStore),this.acpStorage=e.acpStorage===void 0?qb():e.acpStorage,this.clientGUID=e.clientGUID??(this.acpStorage?e5(this.acpStorage):Pm().toLowerCase());const r=oi(e.serverURL);e.launchToken!==void 0&&e.launchToken!==null&&o(this,kt).set(fv(o(this,kt).get(),r,e.launchToken));const i=e.launchToken??pv(o(this,kt).get(),r),s=e.createSocket??(l=>new WebSocket(l)),a=e.createConnection??(l=>new r5(l));this.connection=a({url:r,name:e.connectionName??d5,token:i,createSocket:s,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:e.telemetryMeta??null,decideBoot:e.decideBoot,navigationPending:e.navigationPending}),this.connection.addEventListener("change",o(this,El)),this.connection.addEventListener("server-event",o(this,Cl)),this.connection.addEventListener("channels-changed",o(this,$l)),this.connection.addEventListener("server-reconnected",o(this,Tl)),this.connection.addEventListener("server-status",o(this,Rl))}get storedAuthToken(){return pv(o(this,kt).get(),this.connection.url)}async connect(){await h(this,Pn,Gp).call(this,this.connection.token)}async authenticate(e){o(this,kt).set(fv(o(this,kt).get(),this.connection.url,e)),await h(this,Pn,Gp).call(this,e)}dispose(){o(this,Bt)||(d(this,Bt,!0),this.connection.removeEventListener("change",o(this,El)),this.connection.removeEventListener("server-event",o(this,Cl)),this.connection.removeEventListener("channels-changed",o(this,$l)),this.connection.removeEventListener("server-reconnected",o(this,Tl)),this.connection.removeEventListener("server-status",o(this,Rl)),this.connection.dispose())}}kt=new WeakMap,Bt=new WeakMap,Pn=new WeakSet,Gp=async function(e){if(!o(this,Bt)){h(this,Pn,Yp).call(this,null);try{await this.connection.connect(e)}catch(r){h(this,Pn,Yp).call(this,r instanceof _u?null:r instanceof Error?r.message:String(r))}}},Yp=function(e){this.connectError!==e&&(this.connectError=e,this.dispatchEvent(new xt("change")))},jb=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const e=o(this,kt).get(),r=r$(e,this.connection.url);r!==e&&o(this,kt).set(r),this.connection.token!==null&&this.connection.clearToken()},El=new WeakMap,Cl=new WeakMap,$l=new WeakMap,Tl=new WeakMap,Rl=new WeakMap;const Jp="tv-nav:",ta="tv-reload",Gv=100,f5=1e3,m5=60,g5=60,v5=24,y5=30,w5=y5*v5*g5*m5*f5;function pr(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(ta);return t.searchParams.delete(ta),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var Il,vo,pe,de,Oi,$e,Wb,br,Gb,Kp,Xp;class b5 extends di{constructor(e,r){super();g(this,$e);g(this,Il);g(this,vo);g(this,pe,[]);g(this,de,-1);g(this,Oi,0);d(this,Il,e),d(this,vo,pr(r)),h(this,$e,Wb).call(this)}get currentURL(){var e;return o(this,de)===-1?null:((e=o(this,pe)[o(this,de)])==null?void 0:e.url)??null}get canGoBack(){return o(this,de)>-1}get canGoForward(){return o(this,de)<o(this,pe).length-1}get entries(){return o(this,pe).map(e=>({...e}))}get cursor(){return o(this,de)}navigate(e){const r=pr(e);if(r===o(this,vo)){if(o(this,de)===-1)return;d(this,de,-1),h(this,$e,br).call(this);return}o(this,de)<o(this,pe).length-1&&d(this,pe,o(this,pe).slice(0,o(this,de)+1)),o(this,pe).push({url:r}),d(this,de,o(this,pe).length-1),h(this,$e,Kp).call(this),h(this,$e,br).call(this)}replace(e){var i;if(o(this,de)===-1){this.navigate(e);return}const r=pr(e);if(r===o(this,vo)){d(this,pe,o(this,pe).filter((s,a)=>a!==o(this,de))),d(this,de,-1),h(this,$e,br).call(this);return}((i=o(this,pe)[o(this,de)])==null?void 0:i.url)!==r&&(d(this,pe,o(this,pe).map((s,a)=>a===o(this,de)?{url:r}:s)),h(this,$e,br).call(this))}back(){o(this,de)!==-1&&(d(this,de,o(this,de)-1),h(this,$e,br).call(this))}forward(){this.canGoForward&&(d(this,de,o(this,de)+1),h(this,$e,br).call(this))}reset(){o(this,de)===-1&&o(this,pe).length===0||(d(this,pe,[]),d(this,de,-1),h(this,$e,br).call(this))}}Il=new WeakMap,vo=new WeakMap,pe=new WeakMap,de=new WeakMap,Oi=new WeakMap,$e=new WeakSet,Wb=function(){const e=localStorage.getItem(o(this,$e,Xp));if(e!==null)try{const r=JSON.parse(e);if(!Yb(r))return;d(this,pe,r.entries.map(i=>({url:i.url}))),d(this,de,r.cursor),d(this,Oi,r.lastWritten),h(this,$e,Kp).call(this)}catch{d(this,pe,[]),d(this,de,-1),d(this,Oi,0)}},br=function(){d(this,Oi,Date.now());try{localStorage.setItem(o(this,$e,Xp),JSON.stringify(h(this,$e,Gb).call(this)))}catch(e){if(!A5(e))throw e}this.dispatchEvent(new xt("change"))},Gb=function(){return{v:1,entries:o(this,pe).map(e=>({...e})),cursor:o(this,de),lastWritten:o(this,Oi)}},Kp=function(){if(o(this,pe).length<=Gv)return;const e=o(this,pe).length-Gv;d(this,pe,o(this,pe).slice(e)),d(this,de,Math.max(-1,o(this,de)-e))},Xp=function(){return S5(o(this,Il))};function S5(n){return`${Jp}${n}`}function _5(n){const t=Date.now()-w5,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(Jp)))continue;const s=i.slice(Jp.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{e.push(i);continue}if(!Yb(l)){e.push(i);continue}!n.has(s)&&l.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function A5(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function Yb(n){if(typeof n!="object"||n===null)return!1;const t=n;if(t.v!==1||!Array.isArray(t.entries))return!1;const e=t.cursor;return typeof e!="number"||!Number.isInteger(e)||typeof t.lastWritten!="number"||!Number.isFinite(t.lastWritten)||e<-1||e>=t.entries.length?!1:t.entries.every(r=>typeof r=="object"&&r!==null&&typeof r.url=="string")}const k5="1.3.4";function Hm(n=k5){return n!==void 0&&n.length>0?n:"0.0.0"}function Vm(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const Qp="tv-reload-attempted";function E5(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:RC(n.bundleVersion,n.serverVersion)?n.marker!==null&&n.marker.serverVersion===n.serverVersion?{action:"none"}:{action:"reload",marker:{serverVersion:n.serverVersion,fromVersion:n.bundleVersion}}:{action:"none"}:{action:"none"}}function C5(n){const t=n.getItem(Qp);if(t===null)return null;let e;try{e=JSON.parse(t)}catch{return null}if(!e||typeof e!="object")return null;const r=e;return typeof r.serverVersion!="string"||typeof r.fromVersion!="string"?null:{serverVersion:r.serverVersion,fromVersion:r.fromVersion}}function $5(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??Vm(),i=n.bundleVersion??Hm();if(t===null)return{dispose(){}};let s=null;const a=()=>{if(s===null)return;const u=n.owner.connection;if(u.url!==n.primaryServerURL||u.status!=="connected")return;const p=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:p.fromVersion,to_version:p.toVersion})},l=u=>{if(r.pending)return;const p=E5({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:C5(t)});switch(p.action){case"reload":t.setItem(Qp,JSON.stringify(p.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(Qp),s={fromVersion:p.fromVersion,toVersion:p.toVersion},a();return;case"none":return}},c=()=>{a()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function T5(n){const t=dr(n.search),e=Ww(n.search),r=e!==null&&Yh(e)?e:null;return{electron:t,shellVersion:r}}function R5(n){return!n.electron||n.requiredDesktopVersion===null||!Yh(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===Yu?!1:xm(n.requiredDesktopVersion,n.shellVersion)}const I5=`# Desktop app upgrade required
44
44
 
45
45
  Your Television server requires a newer version of this desktop app.
46
46
  In a terminal, please upgrade:
@@ -53,17 +53,17 @@ Then quit this app, and relaunch it from the terminal with:
53
53
 
54
54
  \`\`\`bash
55
55
  tv-desktop
56
- \`\`\``;function jb(n){return n===null?$5:n.upgradeMarkdown}function T5(n){const t=C5(n);return{gated:t,instructionsMarkdown:t?jb(n.desktop):null,suppressUpdateToast:t}}function R5(n){const t=n.reload??(()=>location.reload()),e=n.navigationLatch??Zm();let r=null,i=!1;const s=new Set,a=p=>{var m;return T5({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:p.requiredDesktopVersion,desktop:((m=p.update)==null?void 0:m.desktop)??null})};function l(){var p;(p=n.presentation)==null||p.suppressToasts()}function c(p){const m=p.requiredDesktopVersion;if(m===null||s.has(m))return;s.add(m);const v=r==null?void 0:r.connection;(v==null?void 0:v.url)===n.primaryServerURL&&v.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:m})}const u=p=>{e.pending||p.serverURL===n.primaryServerURL&&(a(p.message).gated?(i=!0,l(),c(p.message)):i&&e.begin(t))};return{get gated(){return i},decideBoot(p){return a(p).gated?"halt":"boot"},attach(p){r=p,p.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var yo;class I5 extends di{constructor(){super(...arguments);g(this,yo,!1)}get toastsSuppressed(){return o(this,yo)}suppressToasts(){o(this,yo)||(d(this,yo,!0),this.dispatchEvent(new xt("change")))}}yo=new WeakMap;function x5(n,t=window){const e=t.__televisionAppearanceResolver;if(e!==void 0)return e;const r=t.matchMedia("(prefers-color-scheme: dark)");let i=n;const s=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;t.document.documentElement.dataset.theme=c},l={setPreference(c){s(c)&&(i=c,a())}};return t.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function Wb(n){return typeof n=="object"&&n!==null}function Gb(n){return!Wb(n)||n.type!=="ready"?!1:!("id"in n)}function Yb(n){return!(!Wb(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const Jb=Nt(),Kb="No handler registered for update-content",Xb="handleUpdateContent: handler already registered",qv="television-artifact-bridge";function Qb(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const e2=Eb(di);var wo,bo,So,Mi,Ni,_o,xe,Xp,t2,n2,Bs,Au,B1;let P5=(B1=class extends e2{constructor(e){super();g(this,xe);g(this,wo);g(this,bo);g(this,So);g(this,Mi,null);g(this,Ni,null);g(this,_o,!1);d(this,wo,e);const r=e.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,bo,r),d(this,So,i=>h(this,xe,t2).call(this,i)),o(this,bo).addEventListener("message",o(this,So))}get content(){return o(this,Ni)}set content(e){h(this,xe,Au).call(this),d(this,Ni,e),o(this,_o)&&h(this,xe,Xp).call(this,e)}handleUpdateContent(e){if(h(this,xe,Au).call(this),o(this,Mi)!==null)throw new Error(Xb);d(this,Mi,e)}notifyStylesChanged(){if(h(this,xe,Au).call(this),!o(this,_o))return;const e={type:"styles-changed"};h(this,xe,Bs).call(this,e)}dispose(){o(this,bo).removeEventListener("message",o(this,So)),d(this,Mi,null)}},wo=new WeakMap,bo=new WeakMap,So=new WeakMap,Mi=new WeakMap,Ni=new WeakMap,_o=new WeakMap,xe=new WeakSet,Xp=function(e){const r={type:"content-updated",content:e};h(this,xe,Bs).call(this,r)},t2=function(e){if(this.disposed||e.source!==o(this,wo).contentWindow)return;const r=e.data;if(Gb(r)){d(this,_o,!0),this.dispatchEvent(new Jb("ready")),o(this,Ni)!==null&&h(this,xe,Xp).call(this,o(this,Ni));return}if(Yb(r)){h(this,xe,n2).call(this,r);return}},n2=async function(e){const r=o(this,Mi);if(r===null){h(this,xe,Bs).call(this,{type:"response",id:e.id,error:{message:Kb}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,xe,Bs).call(this,{type:"response",id:e.id,error:{message:Qb(i)}});return}this.disposed||h(this,xe,Bs).call(this,{type:"response",id:e.id,result:{}})},Bs=function(e){const r=o(this,wo).contentWindow;r&&r.postMessage(e,"*")},Au=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},B1);var zi,Ao,Ui,Fi,ko,Pe,Qp,r2,i2,qs,ku;class L5 extends e2{constructor(e){super();g(this,Pe);g(this,zi);g(this,Ao);g(this,Ui,null);g(this,Fi,null);g(this,ko,!1);d(this,zi,e),d(this,Ao,r=>h(this,Pe,r2).call(this,r)),o(this,zi).addEventListener("ipc-message",o(this,Ao))}get content(){return o(this,Fi)}set content(e){h(this,Pe,ku).call(this),d(this,Fi,e),o(this,ko)&&h(this,Pe,Qp).call(this,e)}handleUpdateContent(e){if(h(this,Pe,ku).call(this),o(this,Ui)!==null)throw new Error(Xb);d(this,Ui,e)}notifyStylesChanged(){if(h(this,Pe,ku).call(this),!o(this,ko))return;const e={type:"styles-changed"};h(this,Pe,qs).call(this,e)}dispose(){o(this,zi).removeEventListener("ipc-message",o(this,Ao)),d(this,Ui,null)}}zi=new WeakMap,Ao=new WeakMap,Ui=new WeakMap,Fi=new WeakMap,ko=new WeakMap,Pe=new WeakSet,Qp=function(e){const r={type:"content-updated",content:e};h(this,Pe,qs).call(this,r)},r2=function(e){var s;if(this.disposed)return;const r=e.detail??e;if(!r||r.channel!==qv)return;const i=(s=r.args)==null?void 0:s[0];if(Gb(i)){d(this,ko,!0),this.dispatchEvent(new Jb("ready")),o(this,Fi)!==null&&h(this,Pe,Qp).call(this,o(this,Fi));return}if(Yb(i)){h(this,Pe,i2).call(this,i);return}},i2=async function(e){const r=o(this,Ui);if(r===null){h(this,Pe,qs).call(this,{type:"response",id:e.id,error:{message:Kb}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,Pe,qs).call(this,{type:"response",id:e.id,error:{message:Qb(i)}});return}this.disposed||h(this,Pe,qs).call(this,{type:"response",id:e.id,result:{}})},qs=function(e){var r,i;(i=(r=o(this,zi)).send)==null||i.call(r,qv,e)},ku=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
56
+ \`\`\``;function Jb(n){return n===null?I5:n.upgradeMarkdown}function x5(n){const t=R5(n);return{gated:t,instructionsMarkdown:t?Jb(n.desktop):null,suppressUpdateToast:t}}function P5(n){const t=n.reload??(()=>location.reload()),e=n.navigationLatch??Vm();let r=null,i=!1;const s=new Set,a=p=>{var m;return x5({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:p.requiredDesktopVersion,desktop:((m=p.update)==null?void 0:m.desktop)??null})};function l(){var p;(p=n.presentation)==null||p.suppressToasts()}function c(p){const m=p.requiredDesktopVersion;if(m===null||s.has(m))return;s.add(m);const v=r==null?void 0:r.connection;(v==null?void 0:v.url)===n.primaryServerURL&&v.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:m})}const u=p=>{e.pending||p.serverURL===n.primaryServerURL&&(a(p.message).gated?(i=!0,l(),c(p.message)):i&&e.begin(t))};return{get gated(){return i},decideBoot(p){return a(p).gated?"halt":"boot"},attach(p){r=p,p.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var yo;class L5 extends di{constructor(){super(...arguments);g(this,yo,!1)}get toastsSuppressed(){return o(this,yo)}suppressToasts(){o(this,yo)||(d(this,yo,!0),this.dispatchEvent(new xt("change")))}}yo=new WeakMap;function D5(n,t=window){const e=t.__televisionAppearanceResolver;if(e!==void 0)return e;const r=t.matchMedia("(prefers-color-scheme: dark)");let i=n;const s=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;t.document.documentElement.dataset.theme=c},l={setPreference(c){s(c)&&(i=c,a())}};return t.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function Kb(n){return typeof n=="object"&&n!==null}function Xb(n){return!Kb(n)||n.type!=="ready"?!1:!("id"in n)}function Qb(n){return!(!Kb(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const e2=Nt(),t2="No handler registered for update-content",n2="handleUpdateContent: handler already registered",Yv="television-artifact-bridge";function r2(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const i2=Rb(di);var wo,bo,So,Mi,Ni,_o,xe,ef,s2,o2,Bs,Au,G1;let O5=(G1=class extends i2{constructor(e){super();g(this,xe);g(this,wo);g(this,bo);g(this,So);g(this,Mi,null);g(this,Ni,null);g(this,_o,!1);d(this,wo,e);const r=e.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,bo,r),d(this,So,i=>h(this,xe,s2).call(this,i)),o(this,bo).addEventListener("message",o(this,So))}get content(){return o(this,Ni)}set content(e){h(this,xe,Au).call(this),d(this,Ni,e),o(this,_o)&&h(this,xe,ef).call(this,e)}handleUpdateContent(e){if(h(this,xe,Au).call(this),o(this,Mi)!==null)throw new Error(n2);d(this,Mi,e)}notifyStylesChanged(){if(h(this,xe,Au).call(this),!o(this,_o))return;const e={type:"styles-changed"};h(this,xe,Bs).call(this,e)}dispose(){o(this,bo).removeEventListener("message",o(this,So)),d(this,Mi,null)}},wo=new WeakMap,bo=new WeakMap,So=new WeakMap,Mi=new WeakMap,Ni=new WeakMap,_o=new WeakMap,xe=new WeakSet,ef=function(e){const r={type:"content-updated",content:e};h(this,xe,Bs).call(this,r)},s2=function(e){if(this.disposed||e.source!==o(this,wo).contentWindow)return;const r=e.data;if(Xb(r)){d(this,_o,!0),this.dispatchEvent(new e2("ready")),o(this,Ni)!==null&&h(this,xe,ef).call(this,o(this,Ni));return}if(Qb(r)){h(this,xe,o2).call(this,r);return}},o2=async function(e){const r=o(this,Mi);if(r===null){h(this,xe,Bs).call(this,{type:"response",id:e.id,error:{message:t2}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,xe,Bs).call(this,{type:"response",id:e.id,error:{message:r2(i)}});return}this.disposed||h(this,xe,Bs).call(this,{type:"response",id:e.id,result:{}})},Bs=function(e){const r=o(this,wo).contentWindow;r&&r.postMessage(e,"*")},Au=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},G1);var zi,Ao,Ui,Fi,ko,Pe,tf,a2,l2,qs,ku;class M5 extends i2{constructor(e){super();g(this,Pe);g(this,zi);g(this,Ao);g(this,Ui,null);g(this,Fi,null);g(this,ko,!1);d(this,zi,e),d(this,Ao,r=>h(this,Pe,a2).call(this,r)),o(this,zi).addEventListener("ipc-message",o(this,Ao))}get content(){return o(this,Fi)}set content(e){h(this,Pe,ku).call(this),d(this,Fi,e),o(this,ko)&&h(this,Pe,tf).call(this,e)}handleUpdateContent(e){if(h(this,Pe,ku).call(this),o(this,Ui)!==null)throw new Error(n2);d(this,Ui,e)}notifyStylesChanged(){if(h(this,Pe,ku).call(this),!o(this,ko))return;const e={type:"styles-changed"};h(this,Pe,qs).call(this,e)}dispose(){o(this,zi).removeEventListener("ipc-message",o(this,Ao)),d(this,Ui,null)}}zi=new WeakMap,Ao=new WeakMap,Ui=new WeakMap,Fi=new WeakMap,ko=new WeakMap,Pe=new WeakSet,tf=function(e){const r={type:"content-updated",content:e};h(this,Pe,qs).call(this,r)},a2=function(e){var s;if(this.disposed)return;const r=e.detail??e;if(!r||r.channel!==Yv)return;const i=(s=r.args)==null?void 0:s[0];if(Xb(i)){d(this,ko,!0),this.dispatchEvent(new e2("ready")),o(this,Fi)!==null&&h(this,Pe,tf).call(this,o(this,Fi));return}if(Qb(i)){h(this,Pe,l2).call(this,i);return}},l2=async function(e){const r=o(this,Ui);if(r===null){h(this,Pe,qs).call(this,{type:"response",id:e.id,error:{message:t2}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,Pe,qs).call(this,{type:"response",id:e.id,error:{message:r2(i)}});return}this.disposed||h(this,Pe,qs).call(this,{type:"response",id:e.id,result:{}})},qs=function(e){var r,i;(i=(r=o(this,zi)).send)==null||i.call(r,Yv,e)},ku=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
57
57
  * @license
58
58
  * Copyright 2017 Google LLC
59
59
  * SPDX-License-Identifier: BSD-3-Clause
60
- */const tl=globalThis,jv=n=>n,th=tl.trustedTypes,Wv=th?th.createPolicy("lit-html",{createHTML:n=>n}):void 0,s2="$lit$",kr=`lit$${Math.random().toFixed(9).slice(2)}$`,o2="?"+kr,D5=`<${o2}>`,ws=document,ll=()=>ws.createComment(""),cl=n=>n===null||typeof n!="object"&&typeof n!="function",Hm=Array.isArray,O5=n=>Hm(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",ip=`[
61
- \f\r]`,Aa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Gv=/-->/g,Yv=/>/g,vi=RegExp(`>|${ip}(?:([^\\s"'>=/]+)(${ip}*=${ip}*(?:[^
62
- \f\r"'\`<>=]|("|')|))|$)`,"g"),Jv=/'/g,Kv=/"/g,a2=/^(?:script|style|textarea|title)$/i,M5=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),B=M5(1),Ke=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),Xv=new WeakMap,Ei=ws.createTreeWalker(ws,129);function l2(n,t){if(!Hm(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Wv!==void 0?Wv.createHTML(t):t}const N5=(n,t)=>{const e=n.length-1,r=[];let i,s=t===2?"<svg>":t===3?"<math>":"",a=Aa;for(let l=0;l<e;l++){const c=n[l];let u,p,m=-1,v=0;for(;v<c.length&&(a.lastIndex=v,p=a.exec(c),p!==null);)v=a.lastIndex,a===Aa?p[1]==="!--"?a=Gv:p[1]!==void 0?a=Yv:p[2]!==void 0?(a2.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=vi):p[3]!==void 0&&(a=vi):a===vi?p[0]===">"?(a=i??Aa,m=-1):p[1]===void 0?m=-2:(m=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?vi:p[3]==='"'?Kv:Jv):a===Kv||a===Jv?a=vi:a===Gv||a===Yv?a=Aa:(a=vi,i=void 0);const y=a===vi&&n[l+1].startsWith("/>")?" ":"";s+=a===Aa?c+D5:m>=0?(r.push(u),c.slice(0,m)+s2+c.slice(m)+kr+y):c+kr+(m===-2?l:y)}return[l2(n,s+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class ul{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let s=0,a=0;const l=t.length-1,c=this.parts,[u,p]=N5(t,e);if(this.el=ul.createElement(u,r),Ei.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Ei.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(s2)){const v=p[a++],y=i.getAttribute(m).split(kr),k=/([.?@])?(.*)/.exec(v);c.push({type:1,index:s,name:k[2],strings:y,ctor:k[1]==="."?U5:k[1]==="?"?F5:k[1]==="@"?Z5:od}),i.removeAttribute(m)}else m.startsWith(kr)&&(c.push({type:6,index:s}),i.removeAttribute(m));if(a2.test(i.tagName)){const m=i.textContent.split(kr),v=m.length-1;if(v>0){i.textContent=th?th.emptyScript:"";for(let y=0;y<v;y++)i.append(m[y],ll()),Ei.nextNode(),c.push({type:2,index:++s});i.append(m[v],ll())}}}else if(i.nodeType===8)if(i.data===o2)c.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(kr,m+1))!==-1;)c.push({type:7,index:s}),m+=kr.length-1}s++}}static createElement(t,e){const r=ws.createElement("template");return r.innerHTML=t,r}}function na(n,t,e=n,r){var a,l;if(t===Ke)return t;let i=r!==void 0?(a=e._$Co)==null?void 0:a[r]:e._$Cl;const s=cl(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),s===void 0?i=void 0:(i=new s(n),i._$AT(n,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=na(n,i._$AS(n,t.values),i,r)),t}class z5{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??ws).importNode(e,!0);Ei.currentNode=i;let s=Ei.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new sd(s,s.nextSibling,this,t):c.type===1?u=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(u=new H5(s,this,t)),this._$AV.push(u),c=r[++l]}a!==(c==null?void 0:c.index)&&(s=Ei.nextNode(),a++)}return Ei.currentNode=ws,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}let sd=class c2{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=ie,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=na(this,t,e),cl(t)?t===ie||t==null||t===""?(this._$AH!==ie&&this._$AR(),this._$AH=ie):t!==this._$AH&&t!==Ke&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):O5(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ie&&cl(this._$AH)?this._$AA.nextSibling.data=t:this.T(ws.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=ul.createElement(l2(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(e);else{const a=new z5(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(t){let e=Xv.get(t.strings);return e===void 0&&Xv.set(t.strings,e=new ul(t)),e}k(t){Hm(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const s of t)i===e.length?e.push(r=new c2(this.O(ll()),this.O(ll()),this,this.options)):r=e[i],r._$AI(s),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t!==this._$AB;){const i=jv(t).nextSibling;jv(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},od=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,s){this.type=1,this._$AH=ie,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ie}_$AI(t,e=this,r,i){const s=this.strings;let a=!1;if(s===void 0)t=na(this,t,e,0),a=!cl(t)||t!==this._$AH&&t!==Ke,a&&(this._$AH=t);else{const l=t;let c,u;for(t=s[0],c=0;c<s.length-1;c++)u=na(this,l[r+c],e,c),u===Ke&&(u=this._$AH[c]),a||(a=!cl(u)||u!==this._$AH[c]),u===ie?t=ie:t!==ie&&(t+=(u??"")+s[c+1]),this._$AH[c]=u}a&&!i&&this.j(t)}j(t){t===ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},U5=class extends od{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ie?void 0:t}},F5=class extends od{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ie)}},Z5=class extends od{constructor(t,e,r,i,s){super(t,e,r,i,s),this.type=5}_$AI(t,e=this){if((t=na(this,t,e,0)??ie)===Ke)return;const r=this._$AH,i=t===ie&&r!==ie||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==ie&&(r===ie||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class H5{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){na(this,t)}}const V5={I:sd},sp=tl.litHtmlPolyfillSupport;sp==null||sp(ul,sd),(tl.litHtmlVersions??(tl.litHtmlVersions=[])).push("3.3.2");const Eu=(n,t,e)=>{const r=t;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new sd(t.insertBefore(ll(),null),null,void 0,{})),i._$AI(n),i};/**
60
+ */const tl=globalThis,Jv=n=>n,th=tl.trustedTypes,Kv=th?th.createPolicy("lit-html",{createHTML:n=>n}):void 0,c2="$lit$",kr=`lit$${Math.random().toFixed(9).slice(2)}$`,u2="?"+kr,N5=`<${u2}>`,ws=document,ll=()=>ws.createComment(""),cl=n=>n===null||typeof n!="object"&&typeof n!="function",Bm=Array.isArray,z5=n=>Bm(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",op=`[
61
+ \f\r]`,Aa=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Xv=/-->/g,Qv=/>/g,vi=RegExp(`>|${op}(?:([^\\s"'>=/]+)(${op}*=${op}*(?:[^
62
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),e1=/'/g,t1=/"/g,h2=/^(?:script|style|textarea|title)$/i,U5=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),B=U5(1),Ke=Symbol.for("lit-noChange"),ie=Symbol.for("lit-nothing"),n1=new WeakMap,Ei=ws.createTreeWalker(ws,129);function d2(n,t){if(!Bm(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Kv!==void 0?Kv.createHTML(t):t}const F5=(n,t)=>{const e=n.length-1,r=[];let i,s=t===2?"<svg>":t===3?"<math>":"",a=Aa;for(let l=0;l<e;l++){const c=n[l];let u,p,m=-1,v=0;for(;v<c.length&&(a.lastIndex=v,p=a.exec(c),p!==null);)v=a.lastIndex,a===Aa?p[1]==="!--"?a=Xv:p[1]!==void 0?a=Qv:p[2]!==void 0?(h2.test(p[2])&&(i=RegExp("</"+p[2],"g")),a=vi):p[3]!==void 0&&(a=vi):a===vi?p[0]===">"?(a=i??Aa,m=-1):p[1]===void 0?m=-2:(m=a.lastIndex-p[2].length,u=p[1],a=p[3]===void 0?vi:p[3]==='"'?t1:e1):a===t1||a===e1?a=vi:a===Xv||a===Qv?a=Aa:(a=vi,i=void 0);const y=a===vi&&n[l+1].startsWith("/>")?" ":"";s+=a===Aa?c+N5:m>=0?(r.push(u),c.slice(0,m)+c2+c.slice(m)+kr+y):c+kr+(m===-2?l:y)}return[d2(n,s+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class ul{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let s=0,a=0;const l=t.length-1,c=this.parts,[u,p]=F5(t,e);if(this.el=ul.createElement(u,r),Ei.currentNode=this.el.content,e===2||e===3){const m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(i=Ei.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const m of i.getAttributeNames())if(m.endsWith(c2)){const v=p[a++],y=i.getAttribute(m).split(kr),k=/([.?@])?(.*)/.exec(v);c.push({type:1,index:s,name:k[2],strings:y,ctor:k[1]==="."?H5:k[1]==="?"?V5:k[1]==="@"?B5:od}),i.removeAttribute(m)}else m.startsWith(kr)&&(c.push({type:6,index:s}),i.removeAttribute(m));if(h2.test(i.tagName)){const m=i.textContent.split(kr),v=m.length-1;if(v>0){i.textContent=th?th.emptyScript:"";for(let y=0;y<v;y++)i.append(m[y],ll()),Ei.nextNode(),c.push({type:2,index:++s});i.append(m[v],ll())}}}else if(i.nodeType===8)if(i.data===u2)c.push({type:2,index:s});else{let m=-1;for(;(m=i.data.indexOf(kr,m+1))!==-1;)c.push({type:7,index:s}),m+=kr.length-1}s++}}static createElement(t,e){const r=ws.createElement("template");return r.innerHTML=t,r}}function na(n,t,e=n,r){var a,l;if(t===Ke)return t;let i=r!==void 0?(a=e._$Co)==null?void 0:a[r]:e._$Cl;const s=cl(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),s===void 0?i=void 0:(i=new s(n),i._$AT(n,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=na(n,i._$AS(n,t.values),i,r)),t}class Z5{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??ws).importNode(e,!0);Ei.currentNode=i;let s=Ei.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new sd(s,s.nextSibling,this,t):c.type===1?u=new c.ctor(s,c.name,c.strings,this,t):c.type===6&&(u=new q5(s,this,t)),this._$AV.push(u),c=r[++l]}a!==(c==null?void 0:c.index)&&(s=Ei.nextNode(),a++)}return Ei.currentNode=ws,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}let sd=class p2{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=ie,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=na(this,t,e),cl(t)?t===ie||t==null||t===""?(this._$AH!==ie&&this._$AR(),this._$AH=ie):t!==this._$AH&&t!==Ke&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):z5(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==ie&&cl(this._$AH)?this._$AA.nextSibling.data=t:this.T(ws.createTextNode(t)),this._$AH=t}$(t){var s;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=ul.createElement(d2(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(e);else{const a=new Z5(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(t){let e=n1.get(t.strings);return e===void 0&&n1.set(t.strings,e=new ul(t)),e}k(t){Bm(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const s of t)i===e.length?e.push(r=new p2(this.O(ll()),this.O(ll()),this,this.options)):r=e[i],r._$AI(s),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t!==this._$AB;){const i=Jv(t).nextSibling;Jv(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},od=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,s){this.type=1,this._$AH=ie,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=ie}_$AI(t,e=this,r,i){const s=this.strings;let a=!1;if(s===void 0)t=na(this,t,e,0),a=!cl(t)||t!==this._$AH&&t!==Ke,a&&(this._$AH=t);else{const l=t;let c,u;for(t=s[0],c=0;c<s.length-1;c++)u=na(this,l[r+c],e,c),u===Ke&&(u=this._$AH[c]),a||(a=!cl(u)||u!==this._$AH[c]),u===ie?t=ie:t!==ie&&(t+=(u??"")+s[c+1]),this._$AH[c]=u}a&&!i&&this.j(t)}j(t){t===ie?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},H5=class extends od{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===ie?void 0:t}},V5=class extends od{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==ie)}},B5=class extends od{constructor(t,e,r,i,s){super(t,e,r,i,s),this.type=5}_$AI(t,e=this){if((t=na(this,t,e,0)??ie)===Ke)return;const r=this._$AH,i=t===ie&&r!==ie||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,s=t!==ie&&(r===ie||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class q5{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){na(this,t)}}const j5={I:sd},ap=tl.litHtmlPolyfillSupport;ap==null||ap(ul,sd),(tl.litHtmlVersions??(tl.litHtmlVersions=[])).push("3.3.2");const Eu=(n,t,e)=>{const r=t;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new sd(t.insertBefore(ll(),null),null,void 0,{})),i._$AI(n),i};/**
63
63
  * @license
64
64
  * Copyright 2020 Google LLC
65
65
  * SPDX-License-Identifier: BSD-3-Clause
66
- */const{I:B5}=V5,Qv=n=>n,u2=n=>n.strings===void 0,e1=()=>document.createComment(""),ka=(n,t,e)=>{var s;const r=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const a=r.insertBefore(e1(),i),l=r.insertBefore(e1(),i);e=new B5(a,l,n,n.options)}else{const a=e._$AB.nextSibling,l=e._$AM,c=l!==n;if(c){let u;(s=e._$AQ)==null||s.call(e,n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==l._$AU&&e._$AP(u)}if(a!==i||c){let u=e._$AA;for(;u!==a;){const p=Qv(u).nextSibling;Qv(r).insertBefore(u,i),u=p}}}return e},yi=(n,t,e=n)=>(n._$AI(t,e),n),q5={},h2=(n,t=q5)=>n._$AH=t,j5=n=>n._$AH,op=n=>{n._$AR(),n._$AA.remove()};/**
66
+ */const{I:W5}=j5,r1=n=>n,f2=n=>n.strings===void 0,i1=()=>document.createComment(""),ka=(n,t,e)=>{var s;const r=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const a=r.insertBefore(i1(),i),l=r.insertBefore(i1(),i);e=new W5(a,l,n,n.options)}else{const a=e._$AB.nextSibling,l=e._$AM,c=l!==n;if(c){let u;(s=e._$AQ)==null||s.call(e,n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==l._$AU&&e._$AP(u)}if(a!==i||c){let u=e._$AA;for(;u!==a;){const p=r1(u).nextSibling;r1(r).insertBefore(u,i),u=p}}}return e},yi=(n,t,e=n)=>(n._$AI(t,e),n),G5={},m2=(n,t=G5)=>n._$AH=t,Y5=n=>n._$AH,lp=n=>{n._$AR(),n._$AA.remove()};/**
67
67
  * @license
68
68
  * Copyright 2017 Google LLC
69
69
  * SPDX-License-Identifier: BSD-3-Clause
@@ -71,21 +71,21 @@ tv-desktop
71
71
  * @license
72
72
  * Copyright 2017 Google LLC
73
73
  * SPDX-License-Identifier: BSD-3-Clause
74
- */const nl=(n,t)=>{var r;const e=n._$AN;if(e===void 0)return!1;for(const i of e)(r=i._$AO)==null||r.call(i,t,!1),nl(i,t);return!0},nh=n=>{let t,e;do{if((t=n._$AM)===void 0)break;e=t._$AN,e.delete(n),n=t}while((e==null?void 0:e.size)===0)},d2=n=>{for(let t;t=n._$AM;n=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(n))break;e.add(n),Y5(t)}};function W5(n){this._$AN!==void 0?(nh(this),this._$AM=n,d2(this)):this._$AM=n}function G5(n,t=!1,e=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let s=e;s<r.length;s++)nl(r[s],!1),nh(r[s]);else r!=null&&(nl(r,!1),nh(r));else nl(this,n)}const Y5=n=>{n.type==In.CHILD&&(n._$AP??(n._$AP=G5),n._$AQ??(n._$AQ=W5))};class p2 extends Ec{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),d2(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(nl(this,t),nh(this))}setValue(t){if(u2(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}var xl,Pl,Pr,Zi;class bt extends p2{constructor(){super(...arguments);g(this,xl,[]);g(this,Pl,!1);g(this,Pr,!1);g(this,Zi,!1)}connected(){}template(...e){return Ke}render(...e){return!this.isConnected||o(this,Pr)||this.setValue(e.length?e[0]:this.template(...o(this,xl))),Ke}update(e,r){d(this,xl,r),d(this,Zi,!1),d(this,Pr,!0);try{return o(this,Pl)||(d(this,Pl,!0),this.connected()),this.template(...r)}finally{d(this,Pr,!1)}}reconnected(){d(this,Pr,!0);try{this.connected()}finally{d(this,Pr,!1)}d(this,Zi,!0),queueMicrotask(()=>{o(this,Zi)&&(d(this,Zi,!1),this.render())})}}xl=new WeakMap,Pl=new WeakMap,Pr=new WeakMap,Zi=new WeakMap;function St(n){return ma(n)}function J5(n,t){var r;const e=n.connection;return e.authorizationRequired?e.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:e.gateHalted?{kind:"needs-upgrade",instructions:e.upgradeInstructions}:e.status!=="connected"?e.hasEverConnected?{kind:"disconnected",nextRetryAt:e.nextRetryAt}:e.firstConnectError!==null?{kind:"error",serverURL:t,message:e.firstConnectError}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}function ad(n){return B`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function ld(n,t){let e=!1;const r=s=>{s.preventDefault(),t("escape")},i=s=>{if(s.target!==n)return;const a=n.getBoundingClientRect();s.clientX>=a.left&&s.clientX<=a.right&&s.clientY>=a.top&&s.clientY<=a.bottom||t("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const s of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))s.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){e||(e=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}const ef=new WeakMap;function js(n,t,e){e===null?n.hasAttribute(t)&&n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}var Ll,Eo,Lr,gh,vh,yh;class K5{constructor(t){C(this,"document");C(this,"panels",new Set);g(this,Ll,new AbortController);g(this,Eo);g(this,Lr,0);g(this,gh,t=>{var s,a,l;if(!(t.target instanceof Element))return;const e=t.target,r=new Set([...this.panels].filter(c=>c.contains(e))),i=[...this.panels].find(c=>{var u;return(u=c.trigger)==null?void 0:u.contains(e)});for(const c of[...this.panels])c.open&&!c.manual&&c!==i&&!r.has(c)&&c.close();if(i&&!((s=i.trigger)!=null&&s.disabled))i.toggle(t.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(e)&&((l=(a=c.behavior).click)==null||l.call(a,e))});g(this,vh,t=>{var e,r;if(t.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(t.target)&&((r=(e=i.behavior).pointermove)==null||r.call(e,t.target))});g(this,yh,t=>{var s,a,l,c;const e=[...this.panels].filter(u=>u.open).reverse(),r=e.find(u=>u.behavior.select),i=r??e.find(u=>u.behavior.keydown);if(!((a=i==null?void 0:(s=i.behavior).keydown)!=null&&a.call(s,t))){if(t.key==="Escape"){if(!r&&e.some(p=>p.manual&&t.composedPath().includes(p.host)))return;const u=r??e.find(p=>!p.manual);u&&!u.manual&&(t.preventDefault(),t.stopImmediatePropagation(),u.close());return}for(const u of this.panels)if(!u.open&&u.trigger===this.document.activeElement&&((c=(l=u.behavior).keydown)!=null&&c.call(l,t)))return}});this.document=t;const e={signal:o(this,Ll).signal};t.addEventListener("click",o(this,gh),e),t.addEventListener("keydown",o(this,yh),{...e,capture:!0}),t.addEventListener("pointermove",o(this,vh),e),d(this,Eo,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),o(this,Eo).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(o(this,Lr))return;const t=()=>{d(this,Lr,0);for(const e of this.panels)e.open&&e.place();[...this.panels].some(e=>e.open)&&d(this,Lr,this.document.defaultView.requestAnimationFrame(t))};d(this,Lr,this.document.defaultView.requestAnimationFrame(t))}remove(t){this.panels.delete(t),!this.panels.size&&(o(this,Ll).abort(),o(this,Eo).disconnect(),this.document.defaultView.cancelAnimationFrame(o(this,Lr)),ef.delete(this.document))}}Ll=new WeakMap,Eo=new WeakMap,Lr=new WeakMap,gh=new WeakMap,vh=new WeakMap,yh=new WeakMap;var Ge,Dr,Hi,Vi,wt,tf,nf,f2,rf;class Vm{constructor(t,e={}){g(this,wt);C(this,"host");C(this,"behavior");C(this,"trigger",null);g(this,Ge);g(this,Dr,!1);g(this,Hi,!1);g(this,Vi,new Map);this.host=t,this.behavior=e}get open(){return this.host.hasAttribute("open")&&o(this,Dr)}get manual(){return this.host.hasAttribute("manual")}connect(){if(o(this,Ge))return;const t=this.host.ownerDocument;d(this,Ge,ef.get(t)),o(this,Ge)||(d(this,Ge,new K5(t)),ef.set(t,o(this,Ge))),o(this,Ge).panels.add(this),this.refresh()}disconnect(){var t,e,r;h(this,wt,nf).call(this),d(this,Dr,!1),this.host.removeAttribute("open"),(e=(t=this.behavior).closed)==null||e.call(t),h(this,wt,rf).call(this),h(this,wt,tf).call(this),(r=o(this,Ge))==null||r.remove(this),d(this,Ge,void 0)}refresh(){var r,i,s,a,l,c,u;if(!o(this,Ge))return;const t=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),e=t instanceof HTMLButtonElement?t:null;if(e!==this.trigger&&(h(this,wt,tf).call(this),this.trigger=e),this.trigger&&js(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==o(this,Dr))if(this.host.hasAttribute("open")){if(!this.manual&&!this.behavior.select)for(const p of o(this,Ge).panels)p!==this&&!p.manual&&!p.behavior.select&&p.close();d(this,Dr,!0),h(this,wt,f2).call(this),this.place(),(a=(s=this.behavior).opened)==null||a.call(s,o(this,Hi)),d(this,Hi,!1),o(this,Ge).animate()}else{const p=this.host.contains(this.host.ownerDocument.activeElement);h(this,wt,nf).call(this),d(this,Dr,!1),(c=(l=this.behavior).closed)==null||c.call(l),h(this,wt,rf).call(this),p&&((u=this.trigger)==null||u.focus({preventScroll:!0}))}}toggle(t=!1){d(this,Hi,t),this.host.toggleAttribute("open")}show(t=!1){d(this,Hi,t),this.host.setAttribute("open","")}close(){this.host.removeAttribute("open")}contains(t){var e;return this.host.contains(t)||!!((e=this.trigger)!=null&&e.contains(t))}place(){var J,re,_t;if(!this.open||!this.trigger)return;const t=this.host,e=t.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(e.getComputedStyle(t).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const s=t.scrollTop,a=t.scrollLeft;t.style.maxWidth="none",t.style.maxHeight="none",t.style.minWidth=this.behavior.select?`${Math.min(r.width,e.innerWidth-2*i)}px`:((J=o(this,Vi).get("min-width"))==null?void 0:J.value)??"";const l=t.getBoundingClientRect(),c=Math.max(0,e.innerWidth-i-r.left),u=Math.max(0,r.right-i),p=l.width>c&&u>c,m=Math.min(e.innerWidth-2*i,p?u:c),v=Number.parseFloat(e.getComputedStyle(t).minWidth)||0;t.style.minWidth=`${Math.max(0,Math.min(v,m))}px`,t.style.maxWidth=`${Math.max(0,m)}px`;const y=t.getBoundingClientRect(),k=y.width,A=y.height,x=Math.max(i,Math.min(p?r.right-k:r.left,e.innerWidth-i-k));let L,D;if(this.behavior.select){const Me=(_t=(re=this.behavior).selectedRow)==null?void 0:_t.call(re),he=Me?Me.getBoundingClientRect().top+Me.offsetHeight/2-y.top:0,Ne=r.top+r.height/2-he;if(Ne>=i&&Ne+A<=e.innerHeight-i)L=Ne,D=e.innerHeight-i-Ne;else{const tt=e.innerHeight-i-r.top,Ut=r.bottom-i,Es=A>tt&&Ut>tt;D=Es?Ut:tt,L=Es?r.bottom-Math.min(A,D):r.top}}else{const Me=Math.max(0,e.innerHeight-i-r.bottom-i),he=Math.max(0,r.top-2*i),Ne=A>Me&&he>Me;D=Ne?he:Me,L=Ne?r.top-i-Math.min(A,he):r.bottom+i}t.style.maxHeight=`${Math.max(0,D)}px`,t.style.left=`${x}px`,t.style.top=`${Math.max(i,Math.min(L,e.innerHeight-i-Math.min(A,D)))}px`;const V=e.getComputedStyle(t),F=V.boxSizing==="border-box",G=parseFloat(V.width)+(F?0:parseFloat(V.paddingLeft)+parseFloat(V.paddingRight)+parseFloat(V.borderLeftWidth)+parseFloat(V.borderRightWidth)),z=parseFloat(V.height)+(F?0:parseFloat(V.paddingTop)+parseFloat(V.paddingBottom)+parseFloat(V.borderTopWidth)+parseFloat(V.borderBottomWidth));t.style.setProperty("--_panel-edge-inset",`${t.style.top} auto auto ${t.style.left}`),t.style.setProperty("--_panel-edge-width",`${G}px`),t.style.setProperty("--_panel-edge-height",`${z}px`),t.scrollTop=s,t.scrollLeft=a}}Ge=new WeakMap,Dr=new WeakMap,Hi=new WeakMap,Vi=new WeakMap,wt=new WeakSet,tf=function(){var t,e;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(e=(t=this.behavior).unpair)==null||e.call(t,this.trigger),this.trigger=null)},nf=function(){var t;for(const e of((t=o(this,Ge))==null?void 0:t.panels)??[])e!==this&&this.host.contains(e.host)&&e.close()},f2=function(){const t=this.host;for(const e of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])o(this,Vi).set(e,{value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)});t.style.position="fixed",t.style.zIndex="var(--layer-panel)",t.style.margin="0",t.style.overflow="auto",t.style.setProperty("--_panel-edge-position","fixed")},rf=function(){for(const[t,{value:e,priority:r}]of o(this,Vi))e?this.host.style.setProperty(t,e,r):this.host.style.removeProperty(t);o(this,Vi).clear()};class X5 extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var Or,Ln,sf,of,g2;class m2 extends HTMLElement{constructor(){super();g(this,Ln);g(this,Or,new Vm(this,{opened:e=>{var r;e&&((r=h(this,Ln,sf).call(this)[0])==null||r.focus({preventScroll:!0}))},keydown:e=>h(this,Ln,g2).call(this,e),pointermove:e=>{var r;return(r=h(this,Ln,of).call(this,e))==null?void 0:r.focus({preventScroll:!0})},click:e=>{h(this,Ln,of).call(this,e)&&o(this,Or).close()}}));this.attachInternals().role="menu"}connectedCallback(){o(this,Or).connect()}disconnectedCallback(){o(this,Or).disconnect()}attributeChangedCallback(){o(this,Or).refresh()}}Or=new WeakMap,Ln=new WeakSet,sf=function(){return[...this.querySelectorAll("tv-menu-item")]},of=function(e){const r=e.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},g2=function(e){var s;if(!o(this,Or).open)return!1;const r=h(this,Ln,sf).call(this),i=r.indexOf(this.ownerDocument.activeElement);if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopImmediatePropagation();const a=i<0?e.key==="ArrowDown"?0:r.length-1:Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)));return(s=r[a])==null||s.focus({preventScroll:!0}),!0}return e.key==="Enter"&&i>=0?(e.preventDefault(),e.stopImmediatePropagation(),r[i].click(),!0):!1},C(m2,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",X5);customElements.get("tv-menu")||customElements.define("tv-menu",m2);let Q5=0;var Dl;class eO extends bt{constructor(){super(...arguments);g(this,Dl,`menu-trigger-${++Q5}`)}template(e,{trigger:r}){return B`${r(o(this,Dl))}<tv-menu trigger=${o(this,Dl)}>
74
+ */const nl=(n,t)=>{var r;const e=n._$AN;if(e===void 0)return!1;for(const i of e)(r=i._$AO)==null||r.call(i,t,!1),nl(i,t);return!0},nh=n=>{let t,e;do{if((t=n._$AM)===void 0)break;e=t._$AN,e.delete(n),n=t}while((e==null?void 0:e.size)===0)},g2=n=>{for(let t;t=n._$AM;n=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(n))break;e.add(n),X5(t)}};function J5(n){this._$AN!==void 0?(nh(this),this._$AM=n,g2(this)):this._$AM=n}function K5(n,t=!1,e=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let s=e;s<r.length;s++)nl(r[s],!1),nh(r[s]);else r!=null&&(nl(r,!1),nh(r));else nl(this,n)}const X5=n=>{n.type==In.CHILD&&(n._$AP??(n._$AP=K5),n._$AQ??(n._$AQ=J5))};class v2 extends Ec{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),g2(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(nl(this,t),nh(this))}setValue(t){if(f2(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}var xl,Pl,Pr,Zi;class bt extends v2{constructor(){super(...arguments);g(this,xl,[]);g(this,Pl,!1);g(this,Pr,!1);g(this,Zi,!1)}connected(){}template(...e){return Ke}render(...e){return!this.isConnected||o(this,Pr)||this.setValue(e.length?e[0]:this.template(...o(this,xl))),Ke}update(e,r){d(this,xl,r),d(this,Zi,!1),d(this,Pr,!0);try{return o(this,Pl)||(d(this,Pl,!0),this.connected()),this.template(...r)}finally{d(this,Pr,!1)}}reconnected(){d(this,Pr,!0);try{this.connected()}finally{d(this,Pr,!1)}d(this,Zi,!0),queueMicrotask(()=>{o(this,Zi)&&(d(this,Zi,!1),this.render())})}}xl=new WeakMap,Pl=new WeakMap,Pr=new WeakMap,Zi=new WeakMap;function St(n){return ma(n)}function Q5(n,t){var r;const e=n.connection;return e.authorizationRequired?e.authorizationRejected?{kind:"unauthorized",invalid:!0}:{kind:"unauthorized"}:e.gateHalted?{kind:"needs-upgrade",instructions:e.upgradeInstructions}:e.status!=="connected"?e.hasEverConnected?{kind:"disconnected",nextRetryAt:e.nextRetryAt}:e.firstConnectError!==null?{kind:"error",serverURL:t,message:e.firstConnectError}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}function ad(n){return B`<div class="dialog-overlay"><dialog open><div class="dialog-content">${n}</div></dialog></div>`}function ld(n,t){let e=!1;const r=s=>{s.preventDefault(),t("escape")},i=s=>{if(s.target!==n)return;const a=n.getBoundingClientRect();s.clientX>=a.left&&s.clientX<=a.right&&s.clientY>=a.top&&s.clientY<=a.bottom||t("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const s of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))s.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){e||(e=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}const nf=new WeakMap;function js(n,t,e){e===null?n.hasAttribute(t)&&n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}var Ll,Eo,Lr,gh,vh,yh;class eO{constructor(t){C(this,"document");C(this,"panels",new Set);g(this,Ll,new AbortController);g(this,Eo);g(this,Lr,0);g(this,gh,t=>{var s,a,l;if(!(t.target instanceof Element))return;const e=t.target,r=new Set([...this.panels].filter(c=>c.contains(e))),i=[...this.panels].find(c=>{var u;return(u=c.trigger)==null?void 0:u.contains(e)});for(const c of[...this.panels])c.open&&!c.manual&&c!==i&&!r.has(c)&&c.close();if(i&&!((s=i.trigger)!=null&&s.disabled))i.toggle(t.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(e)&&((l=(a=c.behavior).click)==null||l.call(a,e))});g(this,vh,t=>{var e,r;if(t.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(t.target)&&((r=(e=i.behavior).pointermove)==null||r.call(e,t.target))});g(this,yh,t=>{var s,a,l,c;const e=[...this.panels].filter(u=>u.open).reverse(),r=e.find(u=>u.behavior.select),i=r??e.find(u=>u.behavior.keydown);if(!((a=i==null?void 0:(s=i.behavior).keydown)!=null&&a.call(s,t))){if(t.key==="Escape"){if(!r&&e.some(p=>p.manual&&t.composedPath().includes(p.host)))return;const u=r??e.find(p=>!p.manual);u&&!u.manual&&(t.preventDefault(),t.stopImmediatePropagation(),u.close());return}for(const u of this.panels)if(!u.open&&u.trigger===this.document.activeElement&&((c=(l=u.behavior).keydown)!=null&&c.call(l,t)))return}});this.document=t;const e={signal:o(this,Ll).signal};t.addEventListener("click",o(this,gh),e),t.addEventListener("keydown",o(this,yh),{...e,capture:!0}),t.addEventListener("pointermove",o(this,vh),e),d(this,Eo,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),o(this,Eo).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(o(this,Lr))return;const t=()=>{d(this,Lr,0);for(const e of this.panels)e.open&&e.place();[...this.panels].some(e=>e.open)&&d(this,Lr,this.document.defaultView.requestAnimationFrame(t))};d(this,Lr,this.document.defaultView.requestAnimationFrame(t))}remove(t){this.panels.delete(t),!this.panels.size&&(o(this,Ll).abort(),o(this,Eo).disconnect(),this.document.defaultView.cancelAnimationFrame(o(this,Lr)),nf.delete(this.document))}}Ll=new WeakMap,Eo=new WeakMap,Lr=new WeakMap,gh=new WeakMap,vh=new WeakMap,yh=new WeakMap;var Ge,Dr,Hi,Vi,wt,rf,sf,y2,of;class qm{constructor(t,e={}){g(this,wt);C(this,"host");C(this,"behavior");C(this,"trigger",null);g(this,Ge);g(this,Dr,!1);g(this,Hi,!1);g(this,Vi,new Map);this.host=t,this.behavior=e}get open(){return this.host.hasAttribute("open")&&o(this,Dr)}get manual(){return this.host.hasAttribute("manual")}connect(){if(o(this,Ge))return;const t=this.host.ownerDocument;d(this,Ge,nf.get(t)),o(this,Ge)||(d(this,Ge,new eO(t)),nf.set(t,o(this,Ge))),o(this,Ge).panels.add(this),this.refresh()}disconnect(){var t,e,r;h(this,wt,sf).call(this),d(this,Dr,!1),this.host.removeAttribute("open"),(e=(t=this.behavior).closed)==null||e.call(t),h(this,wt,of).call(this),h(this,wt,rf).call(this),(r=o(this,Ge))==null||r.remove(this),d(this,Ge,void 0)}refresh(){var r,i,s,a,l,c,u;if(!o(this,Ge))return;const t=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),e=t instanceof HTMLButtonElement?t:null;if(e!==this.trigger&&(h(this,wt,rf).call(this),this.trigger=e),this.trigger&&js(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==o(this,Dr))if(this.host.hasAttribute("open")){if(!this.manual&&!this.behavior.select)for(const p of o(this,Ge).panels)p!==this&&!p.manual&&!p.behavior.select&&p.close();d(this,Dr,!0),h(this,wt,y2).call(this),this.place(),(a=(s=this.behavior).opened)==null||a.call(s,o(this,Hi)),d(this,Hi,!1),o(this,Ge).animate()}else{const p=this.host.contains(this.host.ownerDocument.activeElement);h(this,wt,sf).call(this),d(this,Dr,!1),(c=(l=this.behavior).closed)==null||c.call(l),h(this,wt,of).call(this),p&&((u=this.trigger)==null||u.focus({preventScroll:!0}))}}toggle(t=!1){d(this,Hi,t),this.host.toggleAttribute("open")}show(t=!1){d(this,Hi,t),this.host.setAttribute("open","")}close(){this.host.removeAttribute("open")}contains(t){var e;return this.host.contains(t)||!!((e=this.trigger)!=null&&e.contains(t))}place(){var J,re,_t;if(!this.open||!this.trigger)return;const t=this.host,e=t.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(e.getComputedStyle(t).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const s=t.scrollTop,a=t.scrollLeft;t.style.maxWidth="none",t.style.maxHeight="none",t.style.minWidth=this.behavior.select?`${Math.min(r.width,e.innerWidth-2*i)}px`:((J=o(this,Vi).get("min-width"))==null?void 0:J.value)??"";const l=t.getBoundingClientRect(),c=Math.max(0,e.innerWidth-i-r.left),u=Math.max(0,r.right-i),p=l.width>c&&u>c,m=Math.min(e.innerWidth-2*i,p?u:c),v=Number.parseFloat(e.getComputedStyle(t).minWidth)||0;t.style.minWidth=`${Math.max(0,Math.min(v,m))}px`,t.style.maxWidth=`${Math.max(0,m)}px`;const y=t.getBoundingClientRect(),k=y.width,A=y.height,x=Math.max(i,Math.min(p?r.right-k:r.left,e.innerWidth-i-k));let L,D;if(this.behavior.select){const Me=(_t=(re=this.behavior).selectedRow)==null?void 0:_t.call(re),he=Me?Me.getBoundingClientRect().top+Me.offsetHeight/2-y.top:0,Ne=r.top+r.height/2-he;if(Ne>=i&&Ne+A<=e.innerHeight-i)L=Ne,D=e.innerHeight-i-Ne;else{const tt=e.innerHeight-i-r.top,Ut=r.bottom-i,Es=A>tt&&Ut>tt;D=Es?Ut:tt,L=Es?r.bottom-Math.min(A,D):r.top}}else{const Me=Math.max(0,e.innerHeight-i-r.bottom-i),he=Math.max(0,r.top-2*i),Ne=A>Me&&he>Me;D=Ne?he:Me,L=Ne?r.top-i-Math.min(A,he):r.bottom+i}t.style.maxHeight=`${Math.max(0,D)}px`,t.style.left=`${x}px`,t.style.top=`${Math.max(i,Math.min(L,e.innerHeight-i-Math.min(A,D)))}px`;const V=e.getComputedStyle(t),F=V.boxSizing==="border-box",G=parseFloat(V.width)+(F?0:parseFloat(V.paddingLeft)+parseFloat(V.paddingRight)+parseFloat(V.borderLeftWidth)+parseFloat(V.borderRightWidth)),z=parseFloat(V.height)+(F?0:parseFloat(V.paddingTop)+parseFloat(V.paddingBottom)+parseFloat(V.borderTopWidth)+parseFloat(V.borderBottomWidth));t.style.setProperty("--_panel-edge-inset",`${t.style.top} auto auto ${t.style.left}`),t.style.setProperty("--_panel-edge-width",`${G}px`),t.style.setProperty("--_panel-edge-height",`${z}px`),t.scrollTop=s,t.scrollLeft=a}}Ge=new WeakMap,Dr=new WeakMap,Hi=new WeakMap,Vi=new WeakMap,wt=new WeakSet,rf=function(){var t,e;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(e=(t=this.behavior).unpair)==null||e.call(t,this.trigger),this.trigger=null)},sf=function(){var t;for(const e of((t=o(this,Ge))==null?void 0:t.panels)??[])e!==this&&this.host.contains(e.host)&&e.close()},y2=function(){const t=this.host;for(const e of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])o(this,Vi).set(e,{value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)});t.style.position="fixed",t.style.zIndex="var(--layer-panel)",t.style.margin="0",t.style.overflow="auto",t.style.setProperty("--_panel-edge-position","fixed")},of=function(){for(const[t,{value:e,priority:r}]of o(this,Vi))e?this.host.style.setProperty(t,e,r):this.host.style.removeProperty(t);o(this,Vi).clear()};class tO extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var Or,Ln,af,lf,b2;class w2 extends HTMLElement{constructor(){super();g(this,Ln);g(this,Or,new qm(this,{opened:e=>{var r;e&&((r=h(this,Ln,af).call(this)[0])==null||r.focus({preventScroll:!0}))},keydown:e=>h(this,Ln,b2).call(this,e),pointermove:e=>{var r;return(r=h(this,Ln,lf).call(this,e))==null?void 0:r.focus({preventScroll:!0})},click:e=>{h(this,Ln,lf).call(this,e)&&o(this,Or).close()}}));this.attachInternals().role="menu"}connectedCallback(){o(this,Or).connect()}disconnectedCallback(){o(this,Or).disconnect()}attributeChangedCallback(){o(this,Or).refresh()}}Or=new WeakMap,Ln=new WeakSet,af=function(){return[...this.querySelectorAll("tv-menu-item")]},lf=function(e){const r=e.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},b2=function(e){var s;if(!o(this,Or).open)return!1;const r=h(this,Ln,af).call(this),i=r.indexOf(this.ownerDocument.activeElement);if(e.key==="ArrowDown"||e.key==="ArrowUp"){e.preventDefault(),e.stopImmediatePropagation();const a=i<0?e.key==="ArrowDown"?0:r.length-1:Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)));return(s=r[a])==null||s.focus({preventScroll:!0}),!0}return e.key==="Enter"&&i>=0?(e.preventDefault(),e.stopImmediatePropagation(),r[i].click(),!0):!1},C(w2,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",tO);customElements.get("tv-menu")||customElements.define("tv-menu",w2);let nO=0;var Dl;class rO extends bt{constructor(){super(...arguments);g(this,Dl,`menu-trigger-${++nO}`)}template(e,{trigger:r}){return B`${r(o(this,Dl))}<tv-menu trigger=${o(this,Dl)}>
75
75
  ${e.map(i=>"separator"in i?B`<hr>`:B`<tv-menu-item intent=${i.destructive?"danger":ie} @click=${i.action}>${i.label}</tv-menu-item>`)}
76
- </tv-menu>`}}Dl=new WeakMap;const v2=St(eO);/**
76
+ </tv-menu>`}}Dl=new WeakMap;const S2=St(rO);/**
77
77
  * @license
78
78
  * Copyright 2020 Google LLC
79
79
  * SPDX-License-Identifier: BSD-3-Clause
80
- */const xn=()=>new tO;class tO{}const ap=new WeakMap,ct=ma(class extends p2{render(n){return ie}update(n,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),ie}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=ap.get(t);e===void 0&&(e=new WeakMap,ap.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,t;return typeof this.G=="function"?(n=ap.get(this.ht??globalThis))==null?void 0:n.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
80
+ */const xn=()=>new iO;class iO{}const cp=new WeakMap,ct=ma(class extends v2{render(n){return ie}update(n,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),ie}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=cp.get(t);e===void 0&&(e=new WeakMap,cp.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,t;return typeof this.G=="function"?(n=cp.get(this.ht??globalThis))==null?void 0:n.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
81
81
  * @license
82
82
  * Copyright 2017 Google LLC
83
83
  * SPDX-License-Identifier: BSD-3-Clause
84
- */const t1=(n,t,e)=>{const r=new Map;for(let i=t;i<=e;i++)r.set(n[i],i);return r},rh=ma(class extends Ec{constructor(n){if(super(n),n.type!==In.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);const i=[],s=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,s[a]=e(l,a),a++;return{values:s,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,r]){const i=j5(n),{values:s,keys:a}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=a,s;const l=this.ut??(this.ut=[]),c=[];let u,p,m=0,v=i.length-1,y=0,k=s.length-1;for(;m<=v&&y<=k;)if(i[m]===null)m++;else if(i[v]===null)v--;else if(l[m]===a[y])c[y]=yi(i[m],s[y]),m++,y++;else if(l[v]===a[k])c[k]=yi(i[v],s[k]),v--,k--;else if(l[m]===a[k])c[k]=yi(i[m],s[k]),ka(n,c[k+1],i[m]),m++,k--;else if(l[v]===a[y])c[y]=yi(i[v],s[y]),ka(n,i[m],i[v]),v--,y++;else if(u===void 0&&(u=t1(a,y,k),p=t1(l,m,v)),u.has(l[m]))if(u.has(l[v])){const A=p.get(a[y]),x=A!==void 0?i[A]:null;if(x===null){const L=ka(n,i[m]);yi(L,s[y]),c[y]=L}else c[y]=yi(x,s[y]),ka(n,i[m],x),i[A]=null;y++}else op(i[v]),v--;else op(i[m]),m++;for(;y<=k;){const A=ka(n,c[k+1]);yi(A,s[y]),c[y++]=A}for(;m<=v;){const A=i[m++];A!==null&&op(A)}return this.ut=a,h2(n,c),Ke}});/**
84
+ */const s1=(n,t,e)=>{const r=new Map;for(let i=t;i<=e;i++)r.set(n[i],i);return r},rh=ma(class extends Ec{constructor(n){if(super(n),n.type!==In.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);const i=[],s=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,s[a]=e(l,a),a++;return{values:s,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,r]){const i=Y5(n),{values:s,keys:a}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=a,s;const l=this.ut??(this.ut=[]),c=[];let u,p,m=0,v=i.length-1,y=0,k=s.length-1;for(;m<=v&&y<=k;)if(i[m]===null)m++;else if(i[v]===null)v--;else if(l[m]===a[y])c[y]=yi(i[m],s[y]),m++,y++;else if(l[v]===a[k])c[k]=yi(i[v],s[k]),v--,k--;else if(l[m]===a[k])c[k]=yi(i[m],s[k]),ka(n,c[k+1],i[m]),m++,k--;else if(l[v]===a[y])c[y]=yi(i[v],s[y]),ka(n,i[m],i[v]),v--,y++;else if(u===void 0&&(u=s1(a,y,k),p=s1(l,m,v)),u.has(l[m]))if(u.has(l[v])){const A=p.get(a[y]),x=A!==void 0?i[A]:null;if(x===null){const L=ka(n,i[m]);yi(L,s[y]),c[y]=L}else c[y]=yi(x,s[y]),ka(n,i[m],x),i[A]=null;y++}else lp(i[v]),v--;else lp(i[m]),m++;for(;y<=k;){const A=ka(n,c[k+1]);yi(A,s[y]),c[y++]=A}for(;m<=v;){const A=i[m++];A!==null&&lp(A)}return this.ut=a,m2(n,c),Ke}});/**
85
85
  * @license
86
86
  * Copyright 2018 Google LLC
87
87
  * SPDX-License-Identifier: BSD-3-Clause
88
- */const y2="important",nO=" !"+y2,ih=ma(class extends Ec{constructor(n){var t;if(super(n),n.type!==In.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const r=n[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(nO);r.includes("-")||s?e.setProperty(r,s?i.slice(0,-11):i,s?y2:""):e[r]=i}}return Ke}}),rO=24;function iO(n){return!n1(n.source)||!n1(n.current)||!hO(n.source,n.current)||!dO(n)||!uO(n.geometry)?{kind:"invalidated"}:aO(n.pointer,n.geometry)==="pinned"?sO(n):oO(n)}function sO(n){var c;const{source:t,current:e,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??lO(r.y,i.pinnedRows),l=e.pinnedChannelIds.filter(u=>u!==t.channelId);return l.splice(a,0,t.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function oO(n){const{source:t,current:e}=n,r=t.pinnedChannelIds.includes(t.channelId),i=r?cO(e.unpinnedChannelIds,t.channelId):t.unpinnedChannelIds.indexOf(t.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&e.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?e.pinnedChannelIds.filter(s=>s!==t.channelId):null}}function aO(n,t){const{sidebar:e}=t;if(n.x<e.left||n.x>e.right||n.y<e.top||n.y>e.bottom)return"unpinned";const i=t.unpinnedGroupTop??(t.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:t.pinnedContentBottom+rO);return n.y<i?"pinned":"unpinned"}function lO(n,t){const e=t.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return e===-1?t.length:e}function cO(n,t){const e=n.filter(i=>i!==t),r=e.findIndex(i=>i<t);return r===-1?e.length:r}function uO(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function n1(n){const t=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(t).size===t.length}function hO(n,t){return af(n.pinnedChannelIds,t.pinnedChannelIds)&&af(n.unpinnedChannelIds,t.unpinnedChannelIds)}function dO(n){const t=n.current.pinnedChannelIds.filter(s=>s!==n.source.channelId),e=n.geometry.pinnedRows.map(({channelId:s})=>s),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?t.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&af(t,e)&&i}function af(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}const pO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',fO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',mO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',gO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',vO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',yO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',wO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',bO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',SO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',_O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',AO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',kO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',EO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',CO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',$O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',TO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',RO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',IO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',xO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',PO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',LO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',DO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',OO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',MO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',NO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',zO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',UO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',FO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',ZO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',HO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',VO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',BO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',qO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',jO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',WO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',GO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',YO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',JO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',KO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',XO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',QO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',eM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',tM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',nM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',rM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',iM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',sM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',oM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',aM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',lM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',cM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',uM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',hM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',dM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',pM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',fM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',mM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',gM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',vM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',yM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',wM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',bM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',SM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',_M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',AM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',kM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',EM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',CM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',$M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',TM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',RM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',IM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',xM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',PM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',LM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',DM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',OM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',MM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',NM=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media (prefers-reduced-motion: reduce){:host([spinning])>svg{animation:none}}',w2=new CSSStyleSheet;w2.replaceSync(NM);const b2={check:pO,close:fO,copy:mO,pin:gO,search:vO,add:yO,more:wO,settings:bO,expand:SO,collapse:_O,"collapse-up":AO,select:kO,skills:EO,notification:CO,artifact:$O,spinner:TO,locked:RO,unpin:IO,back:xO,forward:PO,television:LO,calendar:DO,grid:OO,hash:MO,delete:NO,edit:zO,link:UO,external:FO,download:ZO,reload:HO,warning:VO,info:BO,file:qO,folder:jO,clock:WO,user:GO,upload:YO,star:JO,home:KO,send:XO,filter:QO,sort:eM,help:tM,chart:nM,image:rM,chat:iM,location:sM,play:oM,pause:aM,stop:lM,video:cM,music:uM,error:hM,email:dM,phone:pM,web:fM,tag:mM,bookmark:gM,table:vM,code:yM,group:wM,up:bM,down:SM,money:_M,bank:AM,card:kM,wallet:EM,gauge:CM,activity:$M,"trend-up":TM,"trend-down":RM,database:IM,server:xM,deploy:PM,list:LM,terminal:DM,branch:OM,shield:MM};function zM(n){return n!==null&&Object.hasOwn(b2,n)}var Ol,lf;class S2 extends HTMLElement{constructor(){super(...arguments);g(this,Ol)}connectedCallback(){h(this,Ol,lf).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Ol,lf).call(this)}}Ol=new WeakSet,lf=function(){const e=this.shadowRoot??this.attachShadow({mode:"open"});e.adoptedStyleSheets=[w2],this.replaceChildren();const r=this.getAttribute("name");e.innerHTML=zM(r)?b2[r]:""},C(S2,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",S2);const _2=4,eo=200,Pt=28,sh=800,Jc="ease",r1=.5,Ea=.5,UM="New channel",Ms=".channel-group:not(.channel-group-withdrawal) .channel-row",FM=24;var ft,rt,mt,mn,Bi,Ae,oe,Kn,Et,gn,Ct,it,$t,Mr,vn,yn,qi,Co,$o,T,cf,A2,k2,wh,E2,C2,Cu,$2,T2,R2,I2,uf,hf,Ua,bh,Sh,_h,Ah,x2,df,P2,L2,Ml,D2,O2,Fa,pf,M2,N2,Za,ff,mf,gf,z2,$u,Nl,zl,Ul,Fl,U2,vf,Tu,Ru,Ha,F2,yf,kh;class ZM extends bt{constructor(){super(...arguments);g(this,T);g(this,ft,null);g(this,rt,null);g(this,mt,null);g(this,mn,"");g(this,Bi,!1);g(this,Ae,null);g(this,oe,null);g(this,Kn,!1);g(this,Et,null);g(this,gn,null);g(this,Ct,null);g(this,it,null);g(this,$t,null);g(this,Mr,null);g(this,vn,null);g(this,yn,null);g(this,qi,xn());g(this,Co,xn());g(this,$o,xn());g(this,wh,()=>{const e=o(this,ft),r=o(this,rt);if(e===null||r===null||o(this,Et)!==null)return;const i={resultChannelId:null};d(this,Et,i),this.render(),e.createChannel(UM).then(s=>{i.resultChannelId=s.id,e.focusChannel(s.id).catch(()=>{}),o(this,Et)===i&&this.render()},()=>{o(this,Et)!==i||o(this,gn)!==null||(d(this,Et,null),this.render())})});g(this,bh,e=>{d(this,mn,e.currentTarget.value)});g(this,Sh,e=>{e.key==="Enter"?(e.preventDefault(),h(this,T,Ua).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),h(this,T,Ua).call(this,!1))});g(this,_h,()=>{h(this,T,Ua).call(this,!0)});g(this,Ah,e=>{e.preventDefault(),h(this,T,Ua).call(this,!0)});g(this,Ml,e=>{const r=o(this,oe);if(r!==null){if(r.pointerId!==e.pointerId)return;e.preventDefault(),h(this,T,Fa).call(this,r,e);return}const i=o(this,Ae);if(!(i===null||i.pointerId!==e.pointerId)){if(e.buttons===0){d(this,Ae,null);return}Math.hypot(e.clientX-i.x,e.clientY-i.y)<=_2||h(this,T,D2).call(this,i,e)}});g(this,Nl,e=>{var i;const r=o(this,oe);if(r!==null&&r.pointerId===e.pointerId){if(r.completed)return;const s=r.captureTarget.hasPointerCapture(e.pointerId);h(this,T,Fa).call(this,r,e);const a=s&&r.placement.kind==="placement"?r.placement.operation:null,l=o(this,ft);if(a===null||l===null){h(this,T,Ha).call(this,r,!1);return}r.completed=!0,h(this,T,Za).call(this,r),r.operation=[...a],l.setPinnedChannelIds([...a]).then(()=>{o(this,oe)===r&&(r.operationResolved=!0,h(this,T,vf).call(this,o(this,rt)))},()=>{o(this,oe)===r&&(r.operationResolved=!0,r.operationRejected=!0,h(this,T,Tu).call(this,r))});return}((i=o(this,Ae))==null?void 0:i.pointerId)===e.pointerId&&d(this,Ae,null)});g(this,zl,e=>{var r,i;((r=o(this,oe))==null?void 0:r.pointerId)===e.pointerId&&!o(this,oe).completed?h(this,T,Ru).call(this):((i=o(this,Ae))==null?void 0:i.pointerId)===e.pointerId&&d(this,Ae,null)});g(this,Ul,e=>{const r=o(this,oe);r===null||r.pointerId!==e.pointerId||r.completed||h(this,T,Ha).call(this,r,!1)});g(this,Fl,e=>{e.key!=="Escape"||o(this,oe)===null||o(this,oe).completed||(e.preventDefault(),h(this,T,Ru).call(this))});g(this,kh,e=>{const r=e.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){window.addEventListener("pointermove",o(this,Ml)),window.addEventListener("pointerup",o(this,Nl)),window.addEventListener("pointercancel",o(this,zl)),window.addEventListener("lostpointercapture",o(this,Ul)),window.addEventListener("keydown",o(this,Fl))}template(e,r,i){var l;const s=o(this,rt);d(this,ft,e),d(this,rt,r),h(this,T,U2).call(this,r),h(this,T,E2).call(this,r),h(this,T,R2).call(this,s,r),o(this,mt)!==null&&!r.channels.some(({id:c})=>c===o(this,mt))&&(d(this,mt,null),d(this,mn,"")),h(this,T,vf).call(this,r);const a=h(this,T,I2).call(this,i1(r,(l=o(this,oe))==null?void 0:l.source));return B`
88
+ */const _2="important",sO=" !"+_2,ih=ma(class extends Ec{constructor(n){var t;if(super(n),n.type!==In.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const r=n[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const s=typeof i=="string"&&i.endsWith(sO);r.includes("-")||s?e.setProperty(r,s?i.slice(0,-11):i,s?_2:""):e[r]=i}}return Ke}}),oO=24;function aO(n){return!o1(n.source)||!o1(n.current)||!fO(n.source,n.current)||!mO(n)||!pO(n.geometry)?{kind:"invalidated"}:uO(n.pointer,n.geometry)==="pinned"?lO(n):cO(n)}function lO(n){var c;const{source:t,current:e,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??hO(r.y,i.pinnedRows),l=e.pinnedChannelIds.filter(u=>u!==t.channelId);return l.splice(a,0,t.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function cO(n){const{source:t,current:e}=n,r=t.pinnedChannelIds.includes(t.channelId),i=r?dO(e.unpinnedChannelIds,t.channelId):t.unpinnedChannelIds.indexOf(t.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&e.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?e.pinnedChannelIds.filter(s=>s!==t.channelId):null}}function uO(n,t){const{sidebar:e}=t;if(n.x<e.left||n.x>e.right||n.y<e.top||n.y>e.bottom)return"unpinned";const i=t.unpinnedGroupTop??(t.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:t.pinnedContentBottom+oO);return n.y<i?"pinned":"unpinned"}function hO(n,t){const e=t.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return e===-1?t.length:e}function dO(n,t){const e=n.filter(i=>i!==t),r=e.findIndex(i=>i<t);return r===-1?e.length:r}function pO(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function o1(n){const t=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(t).size===t.length}function fO(n,t){return cf(n.pinnedChannelIds,t.pinnedChannelIds)&&cf(n.unpinnedChannelIds,t.unpinnedChannelIds)}function mO(n){const t=n.current.pinnedChannelIds.filter(s=>s!==n.source.channelId),e=n.geometry.pinnedRows.map(({channelId:s})=>s),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?t.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&cf(t,e)&&i}function cf(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}const gO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',vO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',yO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',wO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',bO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',SO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',_O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',AO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',kO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',EO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',CO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',$O='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',TO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',RO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',IO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',xO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',PO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',LO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',DO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',OO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',MO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',NO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',zO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',UO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',FO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',ZO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',HO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',VO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',BO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',qO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',jO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',WO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',GO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',YO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',JO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',KO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',XO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',QO='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',eM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',tM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',nM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',rM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',iM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',sM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',oM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',aM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',lM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',cM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',uM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',hM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',dM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',pM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',fM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',mM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',gM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',vM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',yM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',wM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',bM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',SM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',_M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',AM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',kM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',EM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',CM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',$M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',TM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',RM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',IM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',xM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',PM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',LM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',DM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',OM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',MM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',NM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',zM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',UM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',FM=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media (prefers-reduced-motion: reduce){:host([spinning])>svg{animation:none}}',A2=new CSSStyleSheet;A2.replaceSync(FM);const k2={check:gO,close:vO,copy:yO,pin:wO,search:bO,add:SO,more:_O,settings:AO,expand:kO,collapse:EO,"collapse-up":CO,select:$O,skills:TO,notification:RO,artifact:IO,spinner:xO,locked:PO,unpin:LO,back:DO,forward:OO,television:MO,calendar:NO,grid:zO,hash:UO,delete:FO,edit:ZO,link:HO,external:VO,download:BO,reload:qO,warning:jO,info:WO,file:GO,folder:YO,clock:JO,user:KO,upload:XO,star:QO,home:eM,send:tM,filter:nM,sort:rM,help:iM,chart:sM,image:oM,chat:aM,location:lM,play:cM,pause:uM,stop:hM,video:dM,music:pM,error:fM,email:mM,phone:gM,web:vM,tag:yM,bookmark:wM,table:bM,code:SM,group:_M,up:AM,down:kM,money:EM,bank:CM,card:$M,wallet:TM,gauge:RM,activity:IM,"trend-up":xM,"trend-down":PM,database:LM,server:DM,deploy:OM,list:MM,terminal:NM,branch:zM,shield:UM};function ZM(n){return n!==null&&Object.hasOwn(k2,n)}var Ol,uf;class E2 extends HTMLElement{constructor(){super(...arguments);g(this,Ol)}connectedCallback(){h(this,Ol,uf).call(this)}attributeChangedCallback(){this.isConnected&&h(this,Ol,uf).call(this)}}Ol=new WeakSet,uf=function(){const e=this.shadowRoot??this.attachShadow({mode:"open"});e.adoptedStyleSheets=[A2],this.replaceChildren();const r=this.getAttribute("name");e.innerHTML=ZM(r)?k2[r]:""},C(E2,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",E2);const C2=4,eo=200,Pt=28,sh=800,Jc="ease",a1=.5,Ea=.5,HM="New channel",Ms=".channel-group:not(.channel-group-withdrawal) .channel-row",VM=24;var ft,rt,mt,mn,Bi,Ae,oe,Kn,Et,gn,Ct,it,$t,Mr,vn,yn,qi,Co,$o,T,hf,$2,T2,wh,R2,I2,Cu,x2,P2,L2,D2,df,pf,Ua,bh,Sh,_h,Ah,O2,ff,M2,N2,Ml,z2,U2,Fa,mf,F2,Z2,Za,gf,vf,yf,H2,$u,Nl,zl,Ul,Fl,V2,wf,Tu,Ru,Ha,B2,bf,kh;class BM extends bt{constructor(){super(...arguments);g(this,T);g(this,ft,null);g(this,rt,null);g(this,mt,null);g(this,mn,"");g(this,Bi,!1);g(this,Ae,null);g(this,oe,null);g(this,Kn,!1);g(this,Et,null);g(this,gn,null);g(this,Ct,null);g(this,it,null);g(this,$t,null);g(this,Mr,null);g(this,vn,null);g(this,yn,null);g(this,qi,xn());g(this,Co,xn());g(this,$o,xn());g(this,wh,()=>{const e=o(this,ft),r=o(this,rt);if(e===null||r===null||o(this,Et)!==null)return;const i={resultChannelId:null};d(this,Et,i),this.render(),e.createChannel(HM).then(s=>{i.resultChannelId=s.id,e.focusChannel(s.id).catch(()=>{}),o(this,Et)===i&&this.render()},()=>{o(this,Et)!==i||o(this,gn)!==null||(d(this,Et,null),this.render())})});g(this,bh,e=>{d(this,mn,e.currentTarget.value)});g(this,Sh,e=>{e.key==="Enter"?(e.preventDefault(),h(this,T,Ua).call(this,!0)):e.key==="Escape"&&(e.preventDefault(),h(this,T,Ua).call(this,!1))});g(this,_h,()=>{h(this,T,Ua).call(this,!0)});g(this,Ah,e=>{e.preventDefault(),h(this,T,Ua).call(this,!0)});g(this,Ml,e=>{const r=o(this,oe);if(r!==null){if(r.pointerId!==e.pointerId)return;e.preventDefault(),h(this,T,Fa).call(this,r,e);return}const i=o(this,Ae);if(!(i===null||i.pointerId!==e.pointerId)){if(e.buttons===0){d(this,Ae,null);return}Math.hypot(e.clientX-i.x,e.clientY-i.y)<=C2||h(this,T,z2).call(this,i,e)}});g(this,Nl,e=>{var i;const r=o(this,oe);if(r!==null&&r.pointerId===e.pointerId){if(r.completed)return;const s=r.captureTarget.hasPointerCapture(e.pointerId);h(this,T,Fa).call(this,r,e);const a=s&&r.placement.kind==="placement"?r.placement.operation:null,l=o(this,ft);if(a===null||l===null){h(this,T,Ha).call(this,r,!1);return}r.completed=!0,h(this,T,Za).call(this,r),r.operation=[...a],l.setPinnedChannelIds([...a]).then(()=>{o(this,oe)===r&&(r.operationResolved=!0,h(this,T,wf).call(this,o(this,rt)))},()=>{o(this,oe)===r&&(r.operationResolved=!0,r.operationRejected=!0,h(this,T,Tu).call(this,r))});return}((i=o(this,Ae))==null?void 0:i.pointerId)===e.pointerId&&d(this,Ae,null)});g(this,zl,e=>{var r,i;((r=o(this,oe))==null?void 0:r.pointerId)===e.pointerId&&!o(this,oe).completed?h(this,T,Ru).call(this):((i=o(this,Ae))==null?void 0:i.pointerId)===e.pointerId&&d(this,Ae,null)});g(this,Ul,e=>{const r=o(this,oe);r===null||r.pointerId!==e.pointerId||r.completed||h(this,T,Ha).call(this,r,!1)});g(this,Fl,e=>{e.key!=="Escape"||o(this,oe)===null||o(this,oe).completed||(e.preventDefault(),h(this,T,Ru).call(this))});g(this,kh,e=>{const r=e.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){window.addEventListener("pointermove",o(this,Ml)),window.addEventListener("pointerup",o(this,Nl)),window.addEventListener("pointercancel",o(this,zl)),window.addEventListener("lostpointercapture",o(this,Ul)),window.addEventListener("keydown",o(this,Fl))}template(e,r,i){var l;const s=o(this,rt);d(this,ft,e),d(this,rt,r),h(this,T,V2).call(this,r),h(this,T,R2).call(this,r),h(this,T,L2).call(this,s,r),o(this,mt)!==null&&!r.channels.some(({id:c})=>c===o(this,mt))&&(d(this,mt,null),d(this,mn,"")),h(this,T,wf).call(this,r);const a=h(this,T,D2).call(this,l1(r,(l=o(this,oe))==null?void 0:l.source));return B`
89
89
  <nav
90
90
  class="sidebar"
91
91
  ?dragging=${o(this,oe)!==null}
@@ -110,12 +110,12 @@ tv-desktop
110
110
  </header>
111
111
 
112
112
  <div class="sidebar-body" role="listbox" aria-label="Channels" @scroll=${o(this,kh)}>
113
- ${h(this,T,cf).call(this,"Pinned",a.pinned)}
114
- ${h(this,T,cf).call(this,"Recent",a.unpinned)}
113
+ ${h(this,T,hf).call(this,"Pinned",a.pinned)}
114
+ ${h(this,T,hf).call(this,"Recent",a.unpinned)}
115
115
  </div>
116
116
  </nav>
117
- ${h(this,T,T2).call(this)}
118
- `}disconnected(){var e,r,i;window.removeEventListener("pointermove",o(this,Ml)),window.removeEventListener("pointerup",o(this,Nl)),window.removeEventListener("pointercancel",o(this,zl)),window.removeEventListener("lostpointercapture",o(this,Ul)),window.removeEventListener("keydown",o(this,Fl)),h(this,T,F2).call(this),(e=o(this,yn))==null||e.withdraw(),d(this,yn,null),(r=o(this,Mr))==null||r.cancel(),d(this,Mr,null),(i=o(this,vn))==null||i.cancel(),d(this,vn,null),d(this,ft,null),d(this,rt,null),d(this,mt,null),d(this,mn,""),d(this,Bi,!1),d(this,Ae,null),d(this,Kn,!1),d(this,Et,null),d(this,gn,null),d(this,Ct,null),d(this,it,null),d(this,$t,null)}}ft=new WeakMap,rt=new WeakMap,mt=new WeakMap,mn=new WeakMap,Bi=new WeakMap,Ae=new WeakMap,oe=new WeakMap,Kn=new WeakMap,Et=new WeakMap,gn=new WeakMap,Ct=new WeakMap,it=new WeakMap,$t=new WeakMap,Mr=new WeakMap,vn=new WeakMap,yn=new WeakMap,qi=new WeakMap,Co=new WeakMap,$o=new WeakMap,T=new WeakSet,cf=function(e,r){var m;const i=e==="Pinned"?"pinned":"unpinned",s=o(this,oe);if(s===null&&r.length===0)return null;const a=s===null?void 0:r.find(({channel:v})=>v.id===s.channelId),l=s===null?r:r.filter(({channel:v})=>v.id!==s.channelId),c=(s==null?void 0:s.placement.kind)==="placement"&&((m=s.placement.placeholder)==null?void 0:m.side)===i?s.placement.placeholder:null,u=l.map(v=>({kind:"row",row:v}));c!==null&&u.splice(c.index,0,{kind:"placeholder",key:`channel-placeholder-${i}`}),a!==void 0&&u.push({kind:"row",row:a});const p=s!==null&&l.length===0&&c===null;return B`
117
+ ${h(this,T,P2).call(this)}
118
+ `}disconnected(){var e,r,i;window.removeEventListener("pointermove",o(this,Ml)),window.removeEventListener("pointerup",o(this,Nl)),window.removeEventListener("pointercancel",o(this,zl)),window.removeEventListener("lostpointercapture",o(this,Ul)),window.removeEventListener("keydown",o(this,Fl)),h(this,T,B2).call(this),(e=o(this,yn))==null||e.withdraw(),d(this,yn,null),(r=o(this,Mr))==null||r.cancel(),d(this,Mr,null),(i=o(this,vn))==null||i.cancel(),d(this,vn,null),d(this,ft,null),d(this,rt,null),d(this,mt,null),d(this,mn,""),d(this,Bi,!1),d(this,Ae,null),d(this,Kn,!1),d(this,Et,null),d(this,gn,null),d(this,Ct,null),d(this,it,null),d(this,$t,null)}}ft=new WeakMap,rt=new WeakMap,mt=new WeakMap,mn=new WeakMap,Bi=new WeakMap,Ae=new WeakMap,oe=new WeakMap,Kn=new WeakMap,Et=new WeakMap,gn=new WeakMap,Ct=new WeakMap,it=new WeakMap,$t=new WeakMap,Mr=new WeakMap,vn=new WeakMap,yn=new WeakMap,qi=new WeakMap,Co=new WeakMap,$o=new WeakMap,T=new WeakSet,hf=function(e,r){var m;const i=e==="Pinned"?"pinned":"unpinned",s=o(this,oe);if(s===null&&r.length===0)return null;const a=s===null?void 0:r.find(({channel:v})=>v.id===s.channelId),l=s===null?r:r.filter(({channel:v})=>v.id!==s.channelId),c=(s==null?void 0:s.placement.kind)==="placement"&&((m=s.placement.placeholder)==null?void 0:m.side)===i?s.placement.placeholder:null,u=l.map(v=>({kind:"row",row:v}));c!==null&&u.splice(c.index,0,{kind:"placeholder",key:`channel-placeholder-${i}`}),a!==void 0&&u.push({kind:"row",row:a});const p=s!==null&&l.length===0&&c===null;return B`
119
119
  <div
120
120
  class="channel-group"
121
121
  role="group"
@@ -124,7 +124,7 @@ tv-desktop
124
124
  ?drag-collapsed=${p}
125
125
  >
126
126
  <div class="channel-group-label" id=${`channel-group-${i}`}>${e}</div>
127
- ${rh(u,v=>v.kind==="row"?v.row.channel.id:v.key,v=>v.kind==="row"?h(this,T,A2).call(this,v.row):B`
127
+ ${rh(u,v=>v.kind==="row"?v.row.channel.id:v.key,v=>v.kind==="row"?h(this,T,$2).call(this,v.row):B`
128
128
  <span
129
129
  class="channel-placeholder"
130
130
  aria-hidden="true"
@@ -134,7 +134,7 @@ tv-desktop
134
134
  ></span>
135
135
  `)}
136
136
  </div>
137
- `},A2=function(e){var u;const{channel:r,pinned:i,selected:s}=e,a=((u=o(this,oe))==null?void 0:u.channelId)===r.id?o(this,oe):null,l=a!==null&&i&&a.placement.kind==="placement"&&a.placement.side==="unpinned",c=r.id===o(this,mt);return B`
137
+ `},$2=function(e){var u;const{channel:r,pinned:i,selected:s}=e,a=((u=o(this,oe))==null?void 0:u.channelId)===r.id?o(this,oe):null,l=a!==null&&i&&a.placement.kind==="placement"&&a.placement.side==="unpinned",c=r.id===o(this,mt);return B`
138
138
  <div
139
139
  class=${`channel-row${a!==null?" dragged":""}${l?" unpinning":""}`}
140
140
  data-channel-id=${r.id}
@@ -175,12 +175,12 @@ tv-desktop
175
175
  tabindex="-1"
176
176
  @keydown=${p=>{p.key!=="Enter"&&p.key!==" "||(p.preventDefault(),p.currentTarget.click())}}
177
177
  aria-selected=${s?"true":ie}
178
- @pointerdown=${p=>h(this,T,P2).call(this,r.id,p)}
179
- @click=${p=>h(this,T,L2).call(this,r.id,p)}
178
+ @pointerdown=${p=>h(this,T,M2).call(this,r.id,p)}
179
+ @click=${p=>h(this,T,N2).call(this,r.id,p)}
180
180
  >
181
181
  ${r.name}
182
182
  </div>
183
- ${v2(h(this,T,k2).call(this,e),{trigger:p=>B`
183
+ ${S2(h(this,T,T2).call(this,e),{trigger:p=>B`
184
184
  <button
185
185
  class="channel-menu-trigger"
186
186
  variant="ghost"
@@ -197,7 +197,7 @@ tv-desktop
197
197
  `})}
198
198
  `}
199
199
  </div>
200
- `},k2=function(e){const{channel:r,pinned:i}=e;return[{label:"Rename",action:()=>h(this,T,hf).call(this,r.id)},{label:i?"Unpin":"Pin",action:()=>h(this,T,x2).call(this,r.id,!i)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,T,C2).call(this,r.id,r.name)}]},wh=new WeakMap,E2=function(e){const r=o(this,Et);if(r===null||o(this,gn)!==null||r.resultChannelId===null)return;const i=e.channels.find(({id:s})=>s===r.resultChannelId);i!==void 0&&(d(this,gn,i.id),queueMicrotask(()=>h(this,T,uf).call(this,"create",i.id)))},C2=function(e,r){var s,a,l;if(o(this,Ct)!==null||o(this,it)!==null)return;h(this,T,df).call(this,e),d(this,Ct,{channelId:e,name:r}),this.render();const i=(s=o(this,$o).value)==null?void 0:s.closest("dialog");i instanceof HTMLDialogElement&&(d(this,yn,ld(i,()=>{h(this,T,Cu).call(this)})),(l=(a=o(this,$o).value)==null?void 0:a.querySelector(".dialog-actions button"))==null||l.focus())},Cu=function(){const e=o(this,yn);d(this,yn,null),d(this,Ct,null),e==null||e.withdraw(),this.render()},$2=function(){const e=o(this,ft),r=o(this,Ct);e===null||r===null||o(this,it)!==null||(d(this,it,r.channelId),h(this,T,Cu).call(this),e.deleteChannel(r.channelId).catch(()=>{o(this,it)!==r.channelId||o(this,$t)!==null||(d(this,it,null),this.render())}))},T2=function(){const e=o(this,Ct);return e===null?null:ad(B`
200
+ `},T2=function(e){const{channel:r,pinned:i}=e;return[{label:"Rename",action:()=>h(this,T,pf).call(this,r.id)},{label:i?"Unpin":"Pin",action:()=>h(this,T,O2).call(this,r.id,!i)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,T,I2).call(this,r.id,r.name)}]},wh=new WeakMap,R2=function(e){const r=o(this,Et);if(r===null||o(this,gn)!==null||r.resultChannelId===null)return;const i=e.channels.find(({id:s})=>s===r.resultChannelId);i!==void 0&&(d(this,gn,i.id),queueMicrotask(()=>h(this,T,df).call(this,"create",i.id)))},I2=function(e,r){var s,a,l;if(o(this,Ct)!==null||o(this,it)!==null)return;h(this,T,ff).call(this,e),d(this,Ct,{channelId:e,name:r}),this.render();const i=(s=o(this,$o).value)==null?void 0:s.closest("dialog");i instanceof HTMLDialogElement&&(d(this,yn,ld(i,()=>{h(this,T,Cu).call(this)})),(l=(a=o(this,$o).value)==null?void 0:a.querySelector(".dialog-actions button"))==null||l.focus())},Cu=function(){const e=o(this,yn);d(this,yn,null),d(this,Ct,null),e==null||e.withdraw(),this.render()},x2=function(){const e=o(this,ft),r=o(this,Ct);e===null||r===null||o(this,it)!==null||(d(this,it,r.channelId),h(this,T,Cu).call(this),e.deleteChannel(r.channelId).catch(()=>{o(this,it)!==r.channelId||o(this,$t)!==null||(d(this,it,null),this.render())}))},P2=function(){const e=o(this,Ct);return e===null?null:ad(B`
201
201
  <div
202
202
  class="dialog-alert channel-delete-alert"
203
203
  role="alertdialog"
@@ -213,12 +213,12 @@ tv-desktop
213
213
  <button type="button" autofocus @click=${()=>h(this,T,Cu).call(this)}>
214
214
  Cancel
215
215
  </button>
216
- <button type="button" intent="danger" @click=${()=>h(this,T,$2).call(this)}>
216
+ <button type="button" intent="danger" @click=${()=>h(this,T,x2).call(this)}>
217
217
  Delete
218
218
  </button>
219
219
  </div>
220
220
  </div>
221
- `)},R2=function(e,r){var p,m;o(this,Ct)!==null&&!r.channels.some(({id:v})=>{var y;return v===((y=o(this,Ct))==null?void 0:y.channelId)})&&((p=o(this,yn))==null||p.withdraw(),d(this,yn,null),d(this,Ct,null));const i=o(this,$t);if(i!==null&&r.channels.some(({id:v})=>v===i.row.channel.id)){(m=o(this,vn))==null||m.cancel(),d(this,vn,null),d(this,$t,null),d(this,it,null);return}const s=o(this,it);if(s===null||i!==null||r.channels.some(({id:v})=>v===s))return;if(e===null){d(this,it,null);return}const a=i1(e),l=a.pinned.findIndex(({channel:v})=>v.id===s),c=a.unpinned.findIndex(({channel:v})=>v.id===s),u=l>=0?a.pinned[l]:a.unpinned[c];if(u===void 0){d(this,it,null);return}d(this,$t,{row:{...u,selected:!1},side:l>=0?"pinned":"unpinned",index:l>=0?l:c}),queueMicrotask(()=>h(this,T,uf).call(this,"delete",s))},I2=function(e){const r=o(this,$t);if(r===null)return e;const i=[...e[r.side]];return i.some(({channel:s})=>s.id===r.row.channel.id)||i.splice(r.index,0,r.row),{...e,[r.side]:i}},uf=function(e,r){var u,p;if(e==="create"&&o(this,gn)!==r||e==="delete"&&((u=o(this,$t))==null?void 0:u.row.channel.id)!==r)return;const i=[...((p=o(this,qi).value)==null?void 0:p.querySelectorAll(Ms))??[]].find(m=>m.dataset.channelId===r);if(i===void 0)return;const s=()=>{var m;if(e==="create"){if(o(this,gn)!==r)return;d(this,gn,null),d(this,Et,null),h(this,T,hf).call(this,r)}else{if(((m=o(this,$t))==null?void 0:m.row.channel.id)!==r)return;d(this,$t,null),d(this,it,null),this.render()}};if(typeof i.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){s();return}const a=i.getBoundingClientRect().height,l=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${a}px`,opacity:1}]:[{maxHeight:`${a}px`,opacity:1},{maxHeight:"0px",opacity:0}],c=i.animate(l,{duration:eo,easing:Jc});e==="create"?d(this,Mr,c):d(this,vn,c),c.finished.then(()=>{e==="create"&&o(this,Mr)!==c||e==="delete"&&o(this,vn)!==c||(e==="create"?d(this,Mr,null):d(this,vn,null),s())},()=>{})},hf=function(e){var i;const r=(i=o(this,rt))==null?void 0:i.channels.find(({id:s})=>s===e);r!==void 0&&(d(this,mt,e),d(this,mn,r.name),d(this,Ae,null),this.render(),queueMicrotask(()=>{var s,a;o(this,mt)===e&&((s=o(this,Co).value)==null||s.focus(),(a=o(this,Co).value)==null||a.select())}))},Ua=function(e){if(o(this,mt)===null||o(this,Bi)||o(this,ft)===null)return;d(this,Bi,!0);const r=o(this,mt),i=o(this,mn).trim();d(this,mt,null),d(this,mn,""),this.render(),d(this,Bi,!1),e&&i.length>0&&o(this,ft).renameChannel(r,i).catch(()=>{})},bh=new WeakMap,Sh=new WeakMap,_h=new WeakMap,Ah=new WeakMap,x2=function(e,r){if(o(this,ft)===null||o(this,rt)===null)return;h(this,T,df).call(this,e);const i=o(this,rt).display.pinnedChannelIds,s=r?[...i.filter(a=>a!==e),e]:i.filter(a=>a!==e);o(this,ft).setPinnedChannelIds(s).catch(()=>{})},df=function(e){var s,a,l;const r=[...((s=o(this,qi).value)==null?void 0:s.querySelectorAll(Ms))??[]].find(c=>c.dataset.channelId===e),i=r==null?void 0:r.querySelector(".channel-menu-trigger");i&&((l=(a=o(this,qi).value)==null?void 0:a.ownerDocument.querySelector(`tv-menu[trigger="${i.id}"]`))==null||l.removeAttribute("open"))},P2=function(e,r){if(r.button!==0||o(this,Ae)!==null||o(this,oe)!==null||o(this,rt)===null)return;d(this,Kn,!1);const s=r.currentTarget.closest(".sidebar");if(s===null)return;const a=Va(o(this,rt));!a.pinnedChannelIds.includes(e)&&!a.unpinnedChannelIds.includes(e)||d(this,Ae,{channelId:e,pointerId:r.pointerId,x:r.clientX,y:r.clientY,source:{channelId:e,...a},captureTarget:s})},L2=function(e,r){var i;if(r.detail!==0&&o(this,Kn)){d(this,Kn,!1);return}d(this,Kn,!1),o(this,oe)===null&&((i=o(this,ft))==null||i.focusChannel(e).catch(()=>{}))},Ml=new WeakMap,D2=function(e,r){const i=[...e.captureTarget.querySelectorAll(Ms)].find(m=>m.dataset.channelId===e.channelId);if(i===void 0){d(this,Ae,null);return}const s=i.getBoundingClientRect(),a=h(this,T,O2).call(this,i),l=VM({wideRow:s,compactPreviewWidth:a,pointer:{x:e.x,y:e.y}}),c=e.captureTarget.querySelector('[data-channel-side="pinned"]'),u=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{d(this,Ae,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${l.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${l.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${l.correctionX}px`),d(this,Kn,!0);const p={...e,placement:{kind:"invalidated"},currentX:r.clientX,currentY:r.clientY,grip:l,rowWidth:a,rowHeight:s.height,originPinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,Ae,null),d(this,oe,p),h(this,T,Fa).call(this,p,r)},O2=function(e){const r=e.cloneNode(!0);for(const s of[r,...r.querySelectorAll("[id], [trigger]")])s.removeAttribute("id"),s.removeAttribute("trigger");r.classList.add("dragged"),r.style.position="fixed",r.style.left="-10000px",r.style.top="-10000px",r.style.visibility="hidden",r.style.pointerEvents="none",document.body.append(r);const i=r.getBoundingClientRect().width;return r.remove(),i},Fa=function(e,r,i=!0){if(e.completed)return;const s=o(this,rt);if(s===null){e.placement={kind:"invalidated"};return}e.currentX=r.clientX,e.currentY=r.clientY;const a=Va(s),l=new Map([...e.captureTarget.querySelectorAll(Ms)].map(V=>[V.dataset.channelId,V])),c=a.pinnedChannelIds.filter(V=>V!==e.channelId).flatMap(V=>{const F=l.get(V);if(F===void 0)return[];const G=F.getBoundingClientRect();return[{channelId:V,top:G.top,bottom:G.bottom}]}),u=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),p=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),m=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),v=m==null?void 0:m.getBoundingClientRect(),y=m==null?void 0:m.dataset.channelSide,k=Number(m==null?void 0:m.dataset.channelIndex),A=e.captureTarget.getBoundingClientRect(),x=iO({source:e.source,current:a,pointer:{x:r.clientX,y:r.clientY},geometry:{sidebar:{left:A.left,right:A.right,top:A.top,bottom:A.bottom},pinnedRows:c,unpinnedGroupTop:(p==null?void 0:p.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(u==null?void 0:u.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:v!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(k)?{side:y,index:k,top:v.top,bottom:v.bottom}:null}}),L=!BM(e.placement,x),D=L?h(this,T,mf).call(this,e):null;e.placement=x,(L||i)&&h(this,T,gf).call(this,e,D,!1),h(this,T,pf).call(this,e)},pf=function(e){const r=e.captureTarget.querySelector(".sidebar-body"),i=r?h(this,T,ff).call(this,r,e.currentY):0,s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=i<0?((r==null?void 0:r.scrollTop)??0)<=r1:((r==null?void 0:r.scrollTop)??0)>=s-r1;if(e.completed||i===0||s===0||a||typeof requestAnimationFrame!="function"){h(this,T,Za).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,T,M2).call(this,e,l)}))},M2=function(e,r){if(e.edgeScrollFrame=0,o(this,oe)!==e||e.completed){e.edgeScrollTimestamp=null;return}const i=e.captureTarget.querySelector(".sidebar-body");if(i===null){e.edgeScrollTimestamp=null;return}const s=h(this,T,ff).call(this,i,e.currentY),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollHeight-i.clientHeight),u=i.scrollTop,p=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+p));i.scrollTop=m;const v=i.scrollTop-u;if(e.edgeScrollRemainder=m===0||m===c?0:p-v,v!==0){i.toggleAttribute("continues-start",i.scrollTop>0),h(this,T,N2).call(this,e);return}}h(this,T,pf).call(this,e)},N2=function(e){h(this,T,Fa).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},Za=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},ff=function(e,r){const i=e.getBoundingClientRect();return r>=i.top&&r<i.top+Pt?-sh*(i.top+Pt-r)/Pt:r>i.bottom-Pt&&r<=i.bottom?sh*(r-(i.bottom-Pt))/Pt:0},mf=function(e){var s;for(const a of e.displacementAnimations)a.cancel();e.displacementAnimations.clear();const r=new Map;for(const a of e.captureTarget.querySelectorAll(Ms)){const l=a.dataset.channelId;if(l===void 0)continue;const c=a.getBoundingClientRect();r.set(l,{left:c.left,top:c.top})}const i=new Map;for(const a of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const l=a.dataset.channelSide;if(l!=="pinned"&&l!=="unpinned")continue;const c=a.getBoundingClientRect(),u=a.cloneNode(!0);for(const p of[u,...u.querySelectorAll("[id], [trigger]")])p.removeAttribute("id"),p.removeAttribute("trigger");(s=u.querySelector(".channel-row.dragged"))==null||s.remove(),u.classList.add("channel-group-withdrawal"),u.setAttribute("aria-hidden","true"),u.removeAttribute("drag-collapsed"),i.set(l,{left:c.left,top:c.top,width:c.width,height:a.hasAttribute("drag-collapsed")?0:c.height,withdrawal:u})}return{rows:r,groups:i}},gf=function(e,r,i){const s=e.captureTarget.querySelector(".sidebar-body"),a=(s==null?void 0:s.scrollTop)??0;this.render(),queueMicrotask(()=>{const l=e.captureTarget.querySelector(".sidebar-body");l!==null&&(l.scrollTop=a),r!==null&&h(this,T,z2).call(this,e,r,i)})},z2=function(e,r,i){if(!(typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const s of e.captureTarget.querySelectorAll(Ms)){const a=s.dataset.channelId;if(a===void 0||!i&&a===e.channelId)continue;const l=r.rows.get(a);if(l===void 0)continue;const c=s.getBoundingClientRect(),u=l.left-c.left,p=l.top-c.top;Math.hypot(u,p)<=Ea||h(this,T,$u).call(this,e,s.animate({translate:[`${u}px ${p}px`,"0px 0px"]},{duration:eo,easing:Jc}))}for(const s of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=s.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=r.groups.get(a),c=s.getBoundingClientRect(),u=s.hasAttribute("drag-collapsed")?0:c.height;if(l!==void 0){if(l.height<=Ea&&u>Ea)h(this,T,$u).call(this,e,s.animate([{opacity:0,translate:`0px -${u}px`},{opacity:1,translate:"0px 0px"}],{duration:eo,easing:Jc}));else if(l.height>Ea&&u<=Ea&&l.withdrawal.childElementCount>0){const p=l.withdrawal;p.style.left=`${l.left}px`,p.style.top=`${l.top}px`,p.style.width=`${l.width}px`,p.style.height=`${l.height}px`,e.captureTarget.append(p);const m=p.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${l.height}px`}],{duration:eo,easing:Jc});h(this,T,$u).call(this,e,m),m.finished.finally(()=>p.remove()).catch(()=>{})}}}}},$u=function(e,r){e.displacementAnimations.add(r),r.finished.finally(()=>{e.displacementAnimations.delete(r)}).catch(()=>{})},Nl=new WeakMap,zl=new WeakMap,Ul=new WeakMap,Fl=new WeakMap,U2=function(e){const r=Va(e);o(this,oe)!==null&&!o(this,oe).completed&&!s1(o(this,oe).source,r)&&h(this,T,Ru).call(this),o(this,Ae)!==null&&!s1(o(this,Ae).source,r)&&d(this,Ae,null)},vf=function(e){const r=o(this,oe);if(e===null||r===null||!r.completed||!r.operationResolved||r.restorationQueued)return;if(r.operationRejected){h(this,T,Tu).call(this,r);return}const i=r.operation;i!==null&&oh(Va(e).pinnedChannelIds,i)&&h(this,T,Tu).call(this,r)},Tu=function(e){o(this,oe)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{o(this,oe)===e&&h(this,T,Ha).call(this,e,!1)}))},Ru=function(){d(this,Ae,null);const e=o(this,oe);e!==null&&h(this,T,Ha).call(this,e,!0)},Ha=function(e,r){if(o(this,oe)!==e)return;h(this,T,Za).call(this,e);const i=h(this,T,mf).call(this,e);d(this,oe,null),h(this,T,yf).call(this,e),r&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),h(this,T,gf).call(this,e,i,!0)},F2=function(){d(this,Ae,null);const e=o(this,oe);if(d(this,oe,null),e!==null){h(this,T,Za).call(this,e);for(const r of e.displacementAnimations)r.cancel();e.displacementAnimations.clear(),h(this,T,yf).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},yf=function(e){e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")},kh=new WeakMap;const HM=St(ZM);function VM(n){const t=Math.max(0,n.wideRow.right-n.wideRow.left),e=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=o1(n.pointer.x-n.wideRow.left,0,t),i=Math.min(r,Math.max(0,n.compactPreviewWidth-FM));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:o1(n.pointer.y-n.wideRow.top,0,e)}}function i1(n,t=Va(n)){var l,c;const e=new Map(n.channels.map(u=>[u.id,u])),r=t.pinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),i=t.unpinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),s=n.display.focusedChannelId,a=s!==null&&e.has(s)?s:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===a})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===a}))}}function Va(n){const t=new Set(n.channels.map(({id:s})=>s)),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,a)=>a.localeCompare(s));return{pinnedChannelIds:e,unpinnedChannelIds:i}}function s1(n,t){return oh(n.pinnedChannelIds,t.pinnedChannelIds)&&oh(n.unpinnedChannelIds,t.unpinnedChannelIds)}function oh(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function BM(n,t){var e,r,i,s;return n.kind!==t.kind?!1:n.kind==="invalidated"||t.kind==="invalidated"?!0:n.side===t.side&&((e=n.placeholder)==null?void 0:e.side)===((r=t.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((s=t.placeholder)==null?void 0:s.index)&&n.operation===null==(t.operation===null)&&(n.operation===null||t.operation===null||oh(n.operation,t.operation))}function o1(n,t,e){return Math.max(t,Math.min(e,n))}const Z2="television-active-theme",Bm="tv-theme";let Er=null,fr=null,ri=null,ii=null,Sr=null,a1=0,ah=0;function qM(n){const t=document.createElement("link"),e=new URL("/theme/theme.css",n);e.searchParams.set(Bm,qm()),t.rel="stylesheet",t.href=e.toString(),t.dataset.televisionStyle=Z2;const r=()=>{Er===t&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",r,{once:!0}),Er==null||Er.remove(),document.head.append(t),Er=t,t}function jM(){Er&&(Er.remove(),Er=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function l1(n){const t=document.createElement("script"),e=new URL("/theme/main.js",n);return e.searchParams.set(Bm,qm()),t.src=e.toString(),t.dataset.televisionScript=Z2,fr==null||fr.remove(),document.head.append(t),fr=t,t}function WM(){fr==null||fr.remove(),fr=null}function GM(){return fr}async function YM(n,t,e){const r=H2();if(t===null)return;let i;try{i=await e()}catch{return}if(r!==ah)return;const s=i.themes.find(p=>p.id===t);if(s===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=s.enableIframeBackgroundJS===!0?c1(n,"background"):null,u=s.enableIframeOverlayJS===!0?c1(n,"overlay"):null;r===ah&&(c!==null&&(a.before(c),ri=c),u!==null&&(l.after(u),ii=u))}function JM(){H2()}function H2(){return ah+=1,ri==null||ri.remove(),ii==null||ii.remove(),ri=null,ii=null,ah}function c1(n,t){const e=t==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);e.searchParams.set(Bm,qm());const r=document.createElement("iframe");return r.id=t==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=XM(e.toString(),KM()),r}function KM(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function XM(n,t){return`<!doctype html>
221
+ `)},L2=function(e,r){var p,m;o(this,Ct)!==null&&!r.channels.some(({id:v})=>{var y;return v===((y=o(this,Ct))==null?void 0:y.channelId)})&&((p=o(this,yn))==null||p.withdraw(),d(this,yn,null),d(this,Ct,null));const i=o(this,$t);if(i!==null&&r.channels.some(({id:v})=>v===i.row.channel.id)){(m=o(this,vn))==null||m.cancel(),d(this,vn,null),d(this,$t,null),d(this,it,null);return}const s=o(this,it);if(s===null||i!==null||r.channels.some(({id:v})=>v===s))return;if(e===null){d(this,it,null);return}const a=l1(e),l=a.pinned.findIndex(({channel:v})=>v.id===s),c=a.unpinned.findIndex(({channel:v})=>v.id===s),u=l>=0?a.pinned[l]:a.unpinned[c];if(u===void 0){d(this,it,null);return}d(this,$t,{row:{...u,selected:!1},side:l>=0?"pinned":"unpinned",index:l>=0?l:c}),queueMicrotask(()=>h(this,T,df).call(this,"delete",s))},D2=function(e){const r=o(this,$t);if(r===null)return e;const i=[...e[r.side]];return i.some(({channel:s})=>s.id===r.row.channel.id)||i.splice(r.index,0,r.row),{...e,[r.side]:i}},df=function(e,r){var u,p;if(e==="create"&&o(this,gn)!==r||e==="delete"&&((u=o(this,$t))==null?void 0:u.row.channel.id)!==r)return;const i=[...((p=o(this,qi).value)==null?void 0:p.querySelectorAll(Ms))??[]].find(m=>m.dataset.channelId===r);if(i===void 0)return;const s=()=>{var m;if(e==="create"){if(o(this,gn)!==r)return;d(this,gn,null),d(this,Et,null),h(this,T,pf).call(this,r)}else{if(((m=o(this,$t))==null?void 0:m.row.channel.id)!==r)return;d(this,$t,null),d(this,it,null),this.render()}};if(typeof i.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){s();return}const a=i.getBoundingClientRect().height,l=e==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${a}px`,opacity:1}]:[{maxHeight:`${a}px`,opacity:1},{maxHeight:"0px",opacity:0}],c=i.animate(l,{duration:eo,easing:Jc});e==="create"?d(this,Mr,c):d(this,vn,c),c.finished.then(()=>{e==="create"&&o(this,Mr)!==c||e==="delete"&&o(this,vn)!==c||(e==="create"?d(this,Mr,null):d(this,vn,null),s())},()=>{})},pf=function(e){var i;const r=(i=o(this,rt))==null?void 0:i.channels.find(({id:s})=>s===e);r!==void 0&&(d(this,mt,e),d(this,mn,r.name),d(this,Ae,null),this.render(),queueMicrotask(()=>{var s,a;o(this,mt)===e&&((s=o(this,Co).value)==null||s.focus(),(a=o(this,Co).value)==null||a.select())}))},Ua=function(e){if(o(this,mt)===null||o(this,Bi)||o(this,ft)===null)return;d(this,Bi,!0);const r=o(this,mt),i=o(this,mn).trim();d(this,mt,null),d(this,mn,""),this.render(),d(this,Bi,!1),e&&i.length>0&&o(this,ft).renameChannel(r,i).catch(()=>{})},bh=new WeakMap,Sh=new WeakMap,_h=new WeakMap,Ah=new WeakMap,O2=function(e,r){if(o(this,ft)===null||o(this,rt)===null)return;h(this,T,ff).call(this,e);const i=o(this,rt).display.pinnedChannelIds,s=r?[...i.filter(a=>a!==e),e]:i.filter(a=>a!==e);o(this,ft).setPinnedChannelIds(s).catch(()=>{})},ff=function(e){var s,a,l;const r=[...((s=o(this,qi).value)==null?void 0:s.querySelectorAll(Ms))??[]].find(c=>c.dataset.channelId===e),i=r==null?void 0:r.querySelector(".channel-menu-trigger");i&&((l=(a=o(this,qi).value)==null?void 0:a.ownerDocument.querySelector(`tv-menu[trigger="${i.id}"]`))==null||l.removeAttribute("open"))},M2=function(e,r){if(r.button!==0||o(this,Ae)!==null||o(this,oe)!==null||o(this,rt)===null)return;d(this,Kn,!1);const s=r.currentTarget.closest(".sidebar");if(s===null)return;const a=Va(o(this,rt));!a.pinnedChannelIds.includes(e)&&!a.unpinnedChannelIds.includes(e)||d(this,Ae,{channelId:e,pointerId:r.pointerId,x:r.clientX,y:r.clientY,source:{channelId:e,...a},captureTarget:s})},N2=function(e,r){var i;if(r.detail!==0&&o(this,Kn)){d(this,Kn,!1);return}d(this,Kn,!1),o(this,oe)===null&&((i=o(this,ft))==null||i.focusChannel(e).catch(()=>{}))},Ml=new WeakMap,z2=function(e,r){const i=[...e.captureTarget.querySelectorAll(Ms)].find(m=>m.dataset.channelId===e.channelId);if(i===void 0){d(this,Ae,null);return}const s=i.getBoundingClientRect(),a=h(this,T,U2).call(this,i),l=jM({wideRow:s,compactPreviewWidth:a,pointer:{x:e.x,y:e.y}}),c=e.captureTarget.querySelector('[data-channel-side="pinned"]'),u=e.captureTarget.querySelector('[data-channel-side="unpinned"]');try{e.captureTarget.setPointerCapture(e.pointerId)}catch{d(this,Ae,null);return}e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${l.previewOffsetX}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${l.offsetY}px`),e.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${l.correctionX}px`),d(this,Kn,!0);const p={...e,placement:{kind:"invalidated"},currentX:r.clientX,currentY:r.clientY,grip:l,rowWidth:a,rowHeight:s.height,originPinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,Ae,null),d(this,oe,p),h(this,T,Fa).call(this,p,r)},U2=function(e){const r=e.cloneNode(!0);for(const s of[r,...r.querySelectorAll("[id], [trigger]")])s.removeAttribute("id"),s.removeAttribute("trigger");r.classList.add("dragged"),r.style.position="fixed",r.style.left="-10000px",r.style.top="-10000px",r.style.visibility="hidden",r.style.pointerEvents="none",document.body.append(r);const i=r.getBoundingClientRect().width;return r.remove(),i},Fa=function(e,r,i=!0){if(e.completed)return;const s=o(this,rt);if(s===null){e.placement={kind:"invalidated"};return}e.currentX=r.clientX,e.currentY=r.clientY;const a=Va(s),l=new Map([...e.captureTarget.querySelectorAll(Ms)].map(V=>[V.dataset.channelId,V])),c=a.pinnedChannelIds.filter(V=>V!==e.channelId).flatMap(V=>{const F=l.get(V);if(F===void 0)return[];const G=F.getBoundingClientRect();return[{channelId:V,top:G.top,bottom:G.bottom}]}),u=e.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),p=e.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),m=e.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),v=m==null?void 0:m.getBoundingClientRect(),y=m==null?void 0:m.dataset.channelSide,k=Number(m==null?void 0:m.dataset.channelIndex),A=e.captureTarget.getBoundingClientRect(),x=aO({source:e.source,current:a,pointer:{x:r.clientX,y:r.clientY},geometry:{sidebar:{left:A.left,right:A.right,top:A.top,bottom:A.bottom},pinnedRows:c,unpinnedGroupTop:(p==null?void 0:p.getBoundingClientRect().top)??e.originUnpinnedGroupTop,pinnedContentBottom:(u==null?void 0:u.getBoundingClientRect().bottom)??e.originPinnedContentBottom,placeholder:v!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(k)?{side:y,index:k,top:v.top,bottom:v.bottom}:null}}),L=!WM(e.placement,x),D=L?h(this,T,vf).call(this,e):null;e.placement=x,(L||i)&&h(this,T,yf).call(this,e,D,!1),h(this,T,mf).call(this,e)},mf=function(e){const r=e.captureTarget.querySelector(".sidebar-body"),i=r?h(this,T,gf).call(this,r,e.currentY):0,s=r?Math.max(0,r.scrollHeight-r.clientHeight):0,a=i<0?((r==null?void 0:r.scrollTop)??0)<=a1:((r==null?void 0:r.scrollTop)??0)>=s-a1;if(e.completed||i===0||s===0||a||typeof requestAnimationFrame!="function"){h(this,T,Za).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,T,F2).call(this,e,l)}))},F2=function(e,r){if(e.edgeScrollFrame=0,o(this,oe)!==e||e.completed){e.edgeScrollTimestamp=null;return}const i=e.captureTarget.querySelector(".sidebar-body");if(i===null){e.edgeScrollTimestamp=null;return}const s=h(this,T,gf).call(this,i,e.currentY),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollHeight-i.clientHeight),u=i.scrollTop,p=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+p));i.scrollTop=m;const v=i.scrollTop-u;if(e.edgeScrollRemainder=m===0||m===c?0:p-v,v!==0){i.toggleAttribute("continues-start",i.scrollTop>0),h(this,T,Z2).call(this,e);return}}h(this,T,mf).call(this,e)},Z2=function(e){h(this,T,Fa).call(this,e,{clientX:e.currentX,clientY:e.currentY},!1)},Za=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},gf=function(e,r){const i=e.getBoundingClientRect();return r>=i.top&&r<i.top+Pt?-sh*(i.top+Pt-r)/Pt:r>i.bottom-Pt&&r<=i.bottom?sh*(r-(i.bottom-Pt))/Pt:0},vf=function(e){var s;for(const a of e.displacementAnimations)a.cancel();e.displacementAnimations.clear();const r=new Map;for(const a of e.captureTarget.querySelectorAll(Ms)){const l=a.dataset.channelId;if(l===void 0)continue;const c=a.getBoundingClientRect();r.set(l,{left:c.left,top:c.top})}const i=new Map;for(const a of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const l=a.dataset.channelSide;if(l!=="pinned"&&l!=="unpinned")continue;const c=a.getBoundingClientRect(),u=a.cloneNode(!0);for(const p of[u,...u.querySelectorAll("[id], [trigger]")])p.removeAttribute("id"),p.removeAttribute("trigger");(s=u.querySelector(".channel-row.dragged"))==null||s.remove(),u.classList.add("channel-group-withdrawal"),u.setAttribute("aria-hidden","true"),u.removeAttribute("drag-collapsed"),i.set(l,{left:c.left,top:c.top,width:c.width,height:a.hasAttribute("drag-collapsed")?0:c.height,withdrawal:u})}return{rows:r,groups:i}},yf=function(e,r,i){const s=e.captureTarget.querySelector(".sidebar-body"),a=(s==null?void 0:s.scrollTop)??0;this.render(),queueMicrotask(()=>{const l=e.captureTarget.querySelector(".sidebar-body");l!==null&&(l.scrollTop=a),r!==null&&h(this,T,H2).call(this,e,r,i)})},H2=function(e,r,i){if(!(typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const s of e.captureTarget.querySelectorAll(Ms)){const a=s.dataset.channelId;if(a===void 0||!i&&a===e.channelId)continue;const l=r.rows.get(a);if(l===void 0)continue;const c=s.getBoundingClientRect(),u=l.left-c.left,p=l.top-c.top;Math.hypot(u,p)<=Ea||h(this,T,$u).call(this,e,s.animate({translate:[`${u}px ${p}px`,"0px 0px"]},{duration:eo,easing:Jc}))}for(const s of e.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=s.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=r.groups.get(a),c=s.getBoundingClientRect(),u=s.hasAttribute("drag-collapsed")?0:c.height;if(l!==void 0){if(l.height<=Ea&&u>Ea)h(this,T,$u).call(this,e,s.animate([{opacity:0,translate:`0px -${u}px`},{opacity:1,translate:"0px 0px"}],{duration:eo,easing:Jc}));else if(l.height>Ea&&u<=Ea&&l.withdrawal.childElementCount>0){const p=l.withdrawal;p.style.left=`${l.left}px`,p.style.top=`${l.top}px`,p.style.width=`${l.width}px`,p.style.height=`${l.height}px`,e.captureTarget.append(p);const m=p.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${l.height}px`}],{duration:eo,easing:Jc});h(this,T,$u).call(this,e,m),m.finished.finally(()=>p.remove()).catch(()=>{})}}}}},$u=function(e,r){e.displacementAnimations.add(r),r.finished.finally(()=>{e.displacementAnimations.delete(r)}).catch(()=>{})},Nl=new WeakMap,zl=new WeakMap,Ul=new WeakMap,Fl=new WeakMap,V2=function(e){const r=Va(e);o(this,oe)!==null&&!o(this,oe).completed&&!c1(o(this,oe).source,r)&&h(this,T,Ru).call(this),o(this,Ae)!==null&&!c1(o(this,Ae).source,r)&&d(this,Ae,null)},wf=function(e){const r=o(this,oe);if(e===null||r===null||!r.completed||!r.operationResolved||r.restorationQueued)return;if(r.operationRejected){h(this,T,Tu).call(this,r);return}const i=r.operation;i!==null&&oh(Va(e).pinnedChannelIds,i)&&h(this,T,Tu).call(this,r)},Tu=function(e){o(this,oe)!==e||e.restorationQueued||(e.restorationQueued=!0,queueMicrotask(()=>{o(this,oe)===e&&h(this,T,Ha).call(this,e,!1)}))},Ru=function(){d(this,Ae,null);const e=o(this,oe);e!==null&&h(this,T,Ha).call(this,e,!0)},Ha=function(e,r){if(o(this,oe)!==e)return;h(this,T,Za).call(this,e);const i=h(this,T,vf).call(this,e);d(this,oe,null),h(this,T,bf).call(this,e),r&&e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId),h(this,T,yf).call(this,e,i,!0)},B2=function(){d(this,Ae,null);const e=o(this,oe);if(d(this,oe,null),e!==null){h(this,T,Za).call(this,e);for(const r of e.displacementAnimations)r.cancel();e.displacementAnimations.clear(),h(this,T,bf).call(this,e),e.captureTarget.hasPointerCapture(e.pointerId)&&e.captureTarget.releasePointerCapture(e.pointerId)}},bf=function(e){e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),e.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")},kh=new WeakMap;const qM=St(BM);function jM(n){const t=Math.max(0,n.wideRow.right-n.wideRow.left),e=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=u1(n.pointer.x-n.wideRow.left,0,t),i=Math.min(r,Math.max(0,n.compactPreviewWidth-VM));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:u1(n.pointer.y-n.wideRow.top,0,e)}}function l1(n,t=Va(n)){var l,c;const e=new Map(n.channels.map(u=>[u.id,u])),r=t.pinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),i=t.unpinnedChannelIds.flatMap(u=>{const p=e.get(u);return p===void 0?[]:[p]}),s=n.display.focusedChannelId,a=s!==null&&e.has(s)?s:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===a})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===a}))}}function Va(n){const t=new Set(n.channels.map(({id:s})=>s)),e=n.display.pinnedChannelIds.filter(s=>t.has(s)),r=new Set(e),i=n.channels.filter(({id:s})=>!r.has(s)).map(({id:s})=>s).sort((s,a)=>a.localeCompare(s));return{pinnedChannelIds:e,unpinnedChannelIds:i}}function c1(n,t){return oh(n.pinnedChannelIds,t.pinnedChannelIds)&&oh(n.unpinnedChannelIds,t.unpinnedChannelIds)}function oh(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function WM(n,t){var e,r,i,s;return n.kind!==t.kind?!1:n.kind==="invalidated"||t.kind==="invalidated"?!0:n.side===t.side&&((e=n.placeholder)==null?void 0:e.side)===((r=t.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((s=t.placeholder)==null?void 0:s.index)&&n.operation===null==(t.operation===null)&&(n.operation===null||t.operation===null||oh(n.operation,t.operation))}function u1(n,t,e){return Math.max(t,Math.min(e,n))}const q2="television-active-theme",jm="tv-theme";let Er=null,fr=null,ri=null,ii=null,Sr=null,h1=0,ah=0;function GM(n){const t=document.createElement("link"),e=new URL("/theme/theme.css",n);e.searchParams.set(jm,Wm()),t.rel="stylesheet",t.href=e.toString(),t.dataset.televisionStyle=q2;const r=()=>{Er===t&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",r,{once:!0}),Er==null||Er.remove(),document.head.append(t),Er=t,t}function YM(){Er&&(Er.remove(),Er=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function d1(n){const t=document.createElement("script"),e=new URL("/theme/main.js",n);return e.searchParams.set(jm,Wm()),t.src=e.toString(),t.dataset.televisionScript=q2,fr==null||fr.remove(),document.head.append(t),fr=t,t}function JM(){fr==null||fr.remove(),fr=null}function KM(){return fr}async function XM(n,t,e){const r=j2();if(t===null)return;let i;try{i=await e()}catch{return}if(r!==ah)return;const s=i.themes.find(p=>p.id===t);if(s===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=s.enableIframeBackgroundJS===!0?p1(n,"background"):null,u=s.enableIframeOverlayJS===!0?p1(n,"overlay"):null;r===ah&&(c!==null&&(a.before(c),ri=c),u!==null&&(l.after(u),ii=u))}function QM(){j2()}function j2(){return ah+=1,ri==null||ri.remove(),ii==null||ii.remove(),ri=null,ii=null,ah}function p1(n,t){const e=t==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);e.searchParams.set(jm,Wm());const r=document.createElement("iframe");return r.id=t==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=tN(e.toString(),eN()),r}function eN(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function tN(n,t){return`<!doctype html>
222
222
  <html data-theme="${t}">
223
223
  <head>
224
224
  <meta charset="utf-8">
@@ -236,19 +236,19 @@ html, body {
236
236
  <body>
237
237
  <script src="${n}"><\/script>
238
238
  </body>
239
- </html>`}function V2(n){var s;let t,e=n.button,r=n.buttons;switch(n.eventType){case"pointermove":t="television-theme-pointer-move",e=-1;break;case"pointerdown":t="television-theme-pointer-down";break;case"pointerup":t="television-theme-pointer-up";break;case"pointercancel":t="television-theme-pointer-cancel",e=-1,r=0;break;case"click":t="television-theme-pointer-click",r=0;break}const i={type:t,clientX:n.clientX,clientY:n.clientY,button:e,buttons:r};for(const a of[ri,ii])(a==null?void 0:a.isConnected)===!0&&((s=a.contentWindow)==null||s.postMessage(i,"*"))}function Cc(n){n.isTrusted&&V2({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",Cc,{capture:!0});document.addEventListener("pointerdown",Cc,{capture:!0});document.addEventListener("pointerup",Cc,{capture:!0});document.addEventListener("pointercancel",Cc,{capture:!0});document.addEventListener("click",Cc,{capture:!0});function B2(n){if(n!==ri&&n!==ii)return!1;const e=((Sr==null?void 0:Sr.isConnected)===!0&&Sr!==ri&&Sr!==ii&&Sr.closest("#foreground-overlay")===null?Sr:null)??document.querySelector("#app");return e==null||e.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const t=n.target;t instanceof HTMLElement&&(B2(t)||t.isConnected&&t.closest("#foreground-overlay")===null&&(Sr=t))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>B2(document.activeElement))},{capture:!0});function qm(){return a1+=1,`${Date.now()}-${a1}`}const QM=404,eN="/views/url-unsupported/";function Iu(n){const t=Mp(n.artifact,{electron:n.electron});let e;if(n.currentURL===null){const r=n.viewURL??t.viewURL;t.renderer==="markdown"?e={renderer:"markdown",viewURL:r,contentURL:n.contentURL??t.contentURL}:t.renderer==="url-webview"&&t.contentURL!==null?e={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??t.contentURL}:e={...t,viewURL:r}}else u1(n.currentURL)&&!n.electron?e=Hn(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:eN,contentURL:null}:u1(n.currentURL)?e={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:e={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:rN(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...e,viewURL:n.frameSrcOverride}:e}var Fe,Tt,To,ji,Wi,qt,Gi,Ro,st,Io,xo,wn,Nr,zr,Yi,Y,xu,q2,j2,wf,W2,bn,Pu,Ba,bf,G2,Sf,_f,bi;class tN extends bt{constructor(){super(...arguments);g(this,Y);g(this,Fe,null);g(this,Tt,null);g(this,To,"");g(this,ji,()=>{});g(this,Wi,()=>{});g(this,qt,null);g(this,Gi,null);g(this,Ro,null);g(this,st,null);g(this,Io,null);g(this,xo,null);g(this,wn,null);g(this,Nr,null);g(this,zr,null);g(this,Yi,null);g(this,bn,()=>{!o(this,Tt)||o(this,Tt)!==o(this,qt)||o(this,ji).call(this,!0)})}get currentFrame(){return o(this,Tt)}connected(){h(this,Y,Pu).call(this),h(this,Y,bf).call(this)}disconnected(){h(this,Y,Ba).call(this),h(this,Y,bi).call(this)}template(e,r,i=()=>{}){return d(this,ji,r),d(this,Wi,i),e(this),o(this,To)}assignSource(e){const r=o(this,Fe),i=r?!iN(r.artifact,e.artifact):!0;((r==null?void 0:r.artifact.id)!==e.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&e.artifact.kind==="path"&&r.artifact.path!==e.artifact.path)&&d(this,Yi,null),i&&(d(this,wn,null),o(this,st)&&(o(this,st).content=""),d(this,Nr,null),d(this,zr,null)),d(this,Fe,e),h(this,Y,xu).call(this)}handleArtifactContentChanged(e){const r=o(this,Fe);return e!==(r==null?void 0:r.artifact.id)||!o(this,st)&&!h(this,Y,_f).call(this)?!1:(h(this,Y,Sf).call(this),!0)}handleThemeChanged(){var r;const e=(r=o(this,Fe))==null?void 0:r.artifact;return(e==null?void 0:e.kind)!=="path"||!Op(e.path)||o(this,st)===null?!1:(o(this,st).notifyStylesChanged(),!0)}refreshFrameLoadState(){h(this,Y,Pu).call(this)}}Fe=new WeakMap,Tt=new WeakMap,To=new WeakMap,ji=new WeakMap,Wi=new WeakMap,qt=new WeakMap,Gi=new WeakMap,Ro=new WeakMap,st=new WeakMap,Io=new WeakMap,xo=new WeakMap,wn=new WeakMap,Nr=new WeakMap,zr=new WeakMap,Yi=new WeakMap,Y=new WeakSet,xu=function(){const e=o(this,Fe);if(!e)return;if(e.artifact.kind==="path"&&h(this,Y,_f).call(this)){h(this,Y,W2).call(this,e.artifact);return}const r=Iu(e),i=h(this,Y,q2).call(this,r.renderer);h(this,Y,j2).call(this,i,r),h(this,Y,wf).call(this,i),h(this,Y,Pu).call(this),h(this,Y,bf).call(this)},q2=function(e){var s;const r=e==="url-webview"?"webview":"iframe";if(((s=o(this,Tt))==null?void 0:s.tagName.toLowerCase())===r)return o(this,Tt);h(this,Y,Ba).call(this),h(this,Y,bi).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,Tt,i),i},j2=function(e,r){e.getAttribute("src")!==r.viewURL&&(o(this,Wi).call(this,null),o(this,Wi).call(this,e),e.setAttribute("src",r.viewURL)),r.contentURL===null?delete e.dataset.contentUrl:e.dataset.contentUrl=r.contentURL},wf=function(e){o(this,To)!==e&&(d(this,To,e),this.render(e))},W2=function(e){o(this,Wi).call(this,null),h(this,Y,Ba).call(this),h(this,Y,bi).call(this),d(this,Tt,null),o(this,ji).call(this,!1),h(this,Y,wf).call(this,B`
239
+ </html>`}function W2(n){var s;let t,e=n.button,r=n.buttons;switch(n.eventType){case"pointermove":t="television-theme-pointer-move",e=-1;break;case"pointerdown":t="television-theme-pointer-down";break;case"pointerup":t="television-theme-pointer-up";break;case"pointercancel":t="television-theme-pointer-cancel",e=-1,r=0;break;case"click":t="television-theme-pointer-click",r=0;break}const i={type:t,clientX:n.clientX,clientY:n.clientY,button:e,buttons:r};for(const a of[ri,ii])(a==null?void 0:a.isConnected)===!0&&((s=a.contentWindow)==null||s.postMessage(i,"*"))}function Cc(n){n.isTrusted&&W2({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",Cc,{capture:!0});document.addEventListener("pointerdown",Cc,{capture:!0});document.addEventListener("pointerup",Cc,{capture:!0});document.addEventListener("pointercancel",Cc,{capture:!0});document.addEventListener("click",Cc,{capture:!0});function G2(n){if(n!==ri&&n!==ii)return!1;const e=((Sr==null?void 0:Sr.isConnected)===!0&&Sr!==ri&&Sr!==ii&&Sr.closest("#foreground-overlay")===null?Sr:null)??document.querySelector("#app");return e==null||e.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const t=n.target;t instanceof HTMLElement&&(G2(t)||t.isConnected&&t.closest("#foreground-overlay")===null&&(Sr=t))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>G2(document.activeElement))},{capture:!0});function Wm(){return h1+=1,`${Date.now()}-${h1}`}const nN=404,rN="/views/url-unsupported/";function Iu(n){const t=zp(n.artifact,{electron:n.electron});let e;if(n.currentURL===null){const r=n.viewURL??t.viewURL;t.renderer==="markdown"?e={renderer:"markdown",viewURL:r,contentURL:n.contentURL??t.contentURL}:t.renderer==="url-webview"&&t.contentURL!==null?e={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??t.contentURL}:e={...t,viewURL:r}}else f1(n.currentURL)&&!n.electron?e=Hn(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:rN,contentURL:null}:f1(n.currentURL)?e={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:e={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:oN(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...e,viewURL:n.frameSrcOverride}:e}var Fe,Tt,To,ji,Wi,qt,Gi,Ro,st,Io,xo,wn,Nr,zr,Yi,Y,xu,Y2,J2,Sf,K2,bn,Pu,Ba,_f,X2,Af,kf,bi;class iN extends bt{constructor(){super(...arguments);g(this,Y);g(this,Fe,null);g(this,Tt,null);g(this,To,"");g(this,ji,()=>{});g(this,Wi,()=>{});g(this,qt,null);g(this,Gi,null);g(this,Ro,null);g(this,st,null);g(this,Io,null);g(this,xo,null);g(this,wn,null);g(this,Nr,null);g(this,zr,null);g(this,Yi,null);g(this,bn,()=>{!o(this,Tt)||o(this,Tt)!==o(this,qt)||o(this,ji).call(this,!0)})}get currentFrame(){return o(this,Tt)}connected(){h(this,Y,Pu).call(this),h(this,Y,_f).call(this)}disconnected(){h(this,Y,Ba).call(this),h(this,Y,bi).call(this)}template(e,r,i=()=>{}){return d(this,ji,r),d(this,Wi,i),e(this),o(this,To)}assignSource(e){const r=o(this,Fe),i=r?!aN(r.artifact,e.artifact):!0;((r==null?void 0:r.artifact.id)!==e.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&e.artifact.kind==="path"&&r.artifact.path!==e.artifact.path)&&d(this,Yi,null),i&&(d(this,wn,null),o(this,st)&&(o(this,st).content=""),d(this,Nr,null),d(this,zr,null)),d(this,Fe,e),h(this,Y,xu).call(this)}handleArtifactContentChanged(e){const r=o(this,Fe);return e!==(r==null?void 0:r.artifact.id)||!o(this,st)&&!h(this,Y,kf).call(this)?!1:(h(this,Y,Af).call(this),!0)}handleThemeChanged(){var r;const e=(r=o(this,Fe))==null?void 0:r.artifact;return(e==null?void 0:e.kind)!=="path"||!Np(e.path)||o(this,st)===null?!1:(o(this,st).notifyStylesChanged(),!0)}refreshFrameLoadState(){h(this,Y,Pu).call(this)}}Fe=new WeakMap,Tt=new WeakMap,To=new WeakMap,ji=new WeakMap,Wi=new WeakMap,qt=new WeakMap,Gi=new WeakMap,Ro=new WeakMap,st=new WeakMap,Io=new WeakMap,xo=new WeakMap,wn=new WeakMap,Nr=new WeakMap,zr=new WeakMap,Yi=new WeakMap,Y=new WeakSet,xu=function(){const e=o(this,Fe);if(!e)return;if(e.artifact.kind==="path"&&h(this,Y,kf).call(this)){h(this,Y,K2).call(this,e.artifact);return}const r=Iu(e),i=h(this,Y,Y2).call(this,r.renderer);h(this,Y,J2).call(this,i,r),h(this,Y,Sf).call(this,i),h(this,Y,Pu).call(this),h(this,Y,_f).call(this)},Y2=function(e){var s;const r=e==="url-webview"?"webview":"iframe";if(((s=o(this,Tt))==null?void 0:s.tagName.toLowerCase())===r)return o(this,Tt);h(this,Y,Ba).call(this),h(this,Y,bi).call(this);const i=document.createElement(r);return i.className="artifact-content",r==="webview"&&i.setAttribute("allowpopups",""),d(this,Tt,i),i},J2=function(e,r){e.getAttribute("src")!==r.viewURL&&(o(this,Wi).call(this,null),o(this,Wi).call(this,e),e.setAttribute("src",r.viewURL)),r.contentURL===null?delete e.dataset.contentUrl:e.dataset.contentUrl=r.contentURL},Sf=function(e){o(this,To)!==e&&(d(this,To,e),this.render(e))},K2=function(e){o(this,Wi).call(this,null),h(this,Y,Ba).call(this),h(this,Y,bi).call(this),d(this,Tt,null),o(this,ji).call(this,!1),h(this,Y,Sf).call(this,B`
240
240
  <section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
241
241
  <div class="artifact-missing-wrapper">
242
- <h1>${C_()}</h1>
243
- <p>${$_()}</p>
242
+ <h1>${I_()}</h1>
243
+ <p>${x_()}</p>
244
244
  <section class="artifact-missing-path" aria-label="Missing artifact path">
245
245
  <p class="artifact-missing-path-label">Registered path:</p>
246
246
  <p><code>${e.path}</code></p>
247
247
  </section>
248
- <p>${T_()}</p>
248
+ <p>${P_()}</p>
249
249
  </div>
250
250
  </section>
251
- `)},bn=new WeakMap,Pu=function(){var s;const e=o(this,Tt),r=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===o(this,qt)&&r===o(this,Gi)||(h(this,Y,Ba).call(this),o(this,ji).call(this,!1),!e||!r||!this.isConnected))return;if(d(this,qt,e),d(this,Gi,r),e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",o(this,bn)),e.addEventListener("did-fail-load",o(this,bn));return}e.addEventListener("load",o(this,bn));const i=e;try{i.isConnected&&((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&o(this,bn).call(this)}catch{}},Ba=function(){if(!o(this,qt)){d(this,Gi,null);return}o(this,qt).removeEventListener("load",o(this,bn)),o(this,qt).removeEventListener("did-finish-load",o(this,bn)),o(this,qt).removeEventListener("did-fail-load",o(this,bn)),d(this,qt,null),d(this,Gi,null)},bf=function(){const e=o(this,Fe),r=o(this,Tt),i=(r==null?void 0:r.dataset.contentUrl)??null,s=(e==null?void 0:e.artifact.id)??null;if(!e||!r||!i||!s){h(this,Y,bi).call(this,{clearContent:!0});return}if(r!==o(this,Ro)||s!==o(this,xo)){h(this,Y,bi).call(this),d(this,Ro,r),d(this,Io,i),d(this,xo,s);const a=r.tagName.toLowerCase()==="webview"?new L5(r):new P5(r);d(this,st,a),a.handleUpdateContent(async l=>{const c=o(this,Fe),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,wn,l),o(this,st)===a&&(a.content=l)}),o(this,wn)!==null&&(a.content=o(this,wn))}else d(this,Io,i);h(this,Y,G2).call(this)},G2=function(){const e=o(this,Fe),r=e==null?void 0:e.application;!e||!r||!o(this,st)||o(this,Nr)===e.artifact.id&&o(this,zr)===r||(d(this,Nr,e.artifact.id),d(this,zr,r),h(this,Y,Sf).call(this))},Sf=async function(){var s,a;const e=o(this,Fe),r=e==null?void 0:e.application;if(!e||!r)return;const i=e.artifact.id;try{const l=await r.readMarkdown(i);if(((s=o(this,Fe))==null?void 0:s.artifact.id)!==i||o(this,Fe).application!==r)return;d(this,Yi,null),d(this,wn,l);const c=o(this,st);if(!c){h(this,Y,xu).call(this);return}c.content=l}catch(l){if(((a=o(this,Fe))==null?void 0:a.artifact.id)!==i||o(this,Fe).application!==r)return;if(l instanceof ha&&l.status===QM){d(this,Yi,i),d(this,wn,null),h(this,Y,bi).call(this),h(this,Y,xu).call(this);return}d(this,Nr,null),d(this,zr,null)}},_f=function(){var r;const e=(r=o(this,Fe))==null?void 0:r.artifact;return o(this,Yi)===(e==null?void 0:e.id)&&e.kind==="path"&&Op(e.path)},bi=function(e={}){var r;(r=o(this,st))==null||r.dispose(),d(this,st,null),d(this,Ro,null),d(this,Io,null),d(this,xo,null),d(this,Nr,null),d(this,zr,null),e.clearContent&&d(this,wn,null)};const nN=St(tN);function u1(n){return n.startsWith("http://")||n.startsWith("https://")}function rN(n,t){if(!n.startsWith("/")||!t)return n;try{return new URL(n,t).toString()}catch{return n}}function iN(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?n.url===t.url:!0}var Zl,Po,Sn,Xn,Ur,Fr,Zr,Hl,Vl,Bl,ql,yt,Af,Lu,Du;class sN{constructor(t,e=()=>{}){g(this,yt);g(this,Zl);g(this,Po);g(this,Sn,null);g(this,Xn,null);g(this,Ur,null);g(this,Fr,null);g(this,Zr,!1);g(this,Hl,t=>{const e=d1(t.data);if(!e)return;const r=o(this,Ur);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,s=i.contentWindow;if(s===null)return;const a=e.type==="leaving",l=e.type==="navigation-request"&&e.native===!0&&e.sameDocument!==!0,c=s===t.source,u=(a||l)&&o(this,Xn)!==null&&o(this,Xn)===t.source,p=a&&aN(i)===t.origin;!c&&!u&&!p||h(this,yt,Af).call(this,e,i,{send:m=>{var v;return(v=i.contentWindow)==null?void 0:v.postMessage(m,"*")}})});g(this,Vl,t=>{var s;const e=t.detail??t;if(!e||e.channel!==h1)return;const r=d1((s=e.args)==null?void 0:s[0]),i=o(this,Fr);!r||!i||h(this,yt,Af).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,h1,a)}})});g(this,Bl,t=>{const e=p1(t);e.isMainFrame===!0&&e.isInPlace!==!0&&this.reset()});g(this,ql,t=>{p1(t).isMainFrame!==!1&&this.reset()});d(this,Zl,t),d(this,Po,e)}get currentGuid(){return o(this,Sn)}get lifecycleWindow(){return o(this,Xn)}get trustState(){return{currentGuid:o(this,Sn),lifecycleWindow:o(this,Xn)}}connect(){o(this,Zr)||(d(this,Zr,!0),window.addEventListener("message",o(this,Hl)),h(this,yt,Lu).call(this))}disconnect(){o(this,Zr)&&(window.removeEventListener("message",o(this,Hl)),d(this,Zr,!1),h(this,yt,Du).call(this))}reset(){d(this,Sn,null),d(this,Xn,null),o(this,Po).call(this)}setCurrentFrame(t){if(t===o(this,Ur)){h(this,yt,Lu).call(this);return}h(this,yt,Du).call(this),o(this,Ur)!==null&&this.reset(),d(this,Ur,oN(t)?t:null),h(this,yt,Lu).call(this)}}Zl=new WeakMap,Po=new WeakMap,Sn=new WeakMap,Xn=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,Zr=new WeakMap,Hl=new WeakMap,Vl=new WeakMap,Bl=new WeakMap,ql=new WeakMap,yt=new WeakSet,Af=function(t,e,r){t.type==="bridge-ready"&&t.guid!==o(this,Sn)?(o(this,Sn)!==null&&o(this,Po).call(this),d(this,Sn,t.guid),d(this,Xn,e.tagName.toLowerCase()==="iframe"?e.contentWindow:null)):t.type==="leaving"&&t.guid===o(this,Sn)&&this.reset(),o(this,Zl).call(this,t,r)},Lu=function(){if(!o(this,Zr))return;const t=o(this,Ur),e=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;e!==o(this,Fr)&&(h(this,yt,Du).call(this),e&&(e.addEventListener("ipc-message",o(this,Vl)),e.addEventListener("did-start-navigation",o(this,Bl)),e.addEventListener("did-fail-load",o(this,ql)),d(this,Fr,e)))},Du=function(){const t=o(this,Fr);t&&(t.removeEventListener("ipc-message",o(this,Vl)),t.removeEventListener("did-start-navigation",o(this,Bl)),t.removeEventListener("did-fail-load",o(this,ql)),d(this,Fr,null))};const h1="television-artifact-bridge";function d1(n){return m_(n)||g_(n)||v_(n)||y_(n)||w_(n)||b_(n)||S_(n)||__(n)?n:null}function oN(n){if(!n)return!1;const t=n.tagName.toLowerCase();return t==="iframe"||t==="webview"}function aN(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function p1(n){return n.detail??n}const lN="/views/url-unsupported/";class cN extends bt{constructor(){super(...arguments);C(this,"_artifact",null);C(this,"_viewURL",null);C(this,"_contentURL",null);C(this,"_application",null);C(this,"_fullScreen",!1);C(this,"_inert",!1);C(this,"_onFullScreenChange",()=>{});C(this,"_connected",!1);C(this,"_deleteConfirmationOpen",!1);C(this,"_dialogPresentation",null);C(this,"_subscribedWebview",null);C(this,"_documentHost",null);C(this,"_pendingDocumentSource",null);C(this,"_rootRef",xn());C(this,"_trustedChannel",new sN((e,r)=>{this.handleTrustedFrameMessage(e,r)},()=>{this._missingArtifactReplyTransport=null}));C(this,"_activeReloadFrameSrc",null);C(this,"_applicationSubscriptionsAttached",!1);C(this,"_proxyReloadVersion",0);C(this,"_navigationState",null);C(this,"_navigationArtifactId",null);C(this,"_navigationCanonicalURL",null);C(this,"_preserveFrameSrcOnNavigationRender",!1);C(this,"_missingArtifactReplyTransport",null);C(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,r=!e;r&&!dr()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:e,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});C(this,"handleArtifactContentChanged",e=>{var s;const r=e.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((s=this._documentHost)!=null&&s.handleArtifactContentChanged(r))||this.reloadProxyFrame()});C(this,"handleThemeChanged",()=>{var e,r;((e=this._artifact)==null?void 0:e.kind)==="url"&&Hn(this._artifact.url)||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});C(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});C(this,"handleWebviewDidNavigateInPage",e=>{if(e.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});C(this,"captureDocumentHost",e=>{this._documentHost=e,this._pendingDocumentSource&&(e.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});C(this,"handleEmbedLoadChange",e=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",e)});C(this,"handleDocumentFrameChange",e=>{e===null&&this.resetTrustedFrame(),this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)});C(this,"handleTitleBarDoubleClick",e=>{const r=e.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(e,r){var u;const[i,s,a]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==s){const p=c?!dN(c,s):!0;if(p&&(this._activeReloadFrameSrc=null),this._artifact=s,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:p}),l=!0,c&&pN(c,s)){const m=this.currentMissingArtifactMessage();m&&((u=this._missingArtifactReplyTransport)==null||u.send(m))}}else p&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(e,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var e;this._connected=!1,(e=this._dialogPresentation)==null||e.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(e,r){var i;switch(e.type){case"url-target-request":r.send({type:A_,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const s=this.currentMissingArtifactMessage();s&&(this._missingArtifactReplyTransport=r,r.send(s));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(e);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(e.key);return;case"artifact-pointer":this.handleArtifactPointer(e);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(e){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();V2({eventType:e.eventType,clientX:i.left+e.clientX*i.width/r.clientWidth,clientY:i.top+e.clientY*i.height/r.clientHeight,button:e.button,buttons:e.buttons})}currentExternalTargetURL(){var r,i;const e=((r=this._navigationState)==null?void 0:r.currentURL)??null;return e&&hN(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:k_,title:e.title,path:e.path}}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!Hn(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){if(!Lv(e.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(e.url);if(i===lN||i===r.currentURL)return;const s=e.native===!0;(e.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),e.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new v5(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const r=Iu({artifact:e,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return e.kind==="url"&&Hn(e.url)||r.renderer==="url-webview"?pr(i):f1(i,i)}convertIframeNavigationURL(e){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&Hn(this._artifact.url)&&Hn(e)?pr(e):f1(e,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(e){const r=e.url;if(typeof r!="string"||!Lv(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=pr(r);return s===i.currentURL?!1:(i.navigate(s),!0)}syncWebviewSubscription(e=this.currentFrame){const r=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var e;return((e=this._documentHost)==null?void 0:e.currentFrame)??null}syncFrameSubscriptions(){const e=this.currentFrame;this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)}syncFrameTitle(e){e&&this._artifact&&e.getAttribute("title")!==this._artifact.title&&e.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(e={}){var p,m,v;const r=this._artifact;if(!r)return;e.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((p=this._navigationState)==null?void 0:p.currentURL)??null},s=Iu(i),a=(m=this.currentFrame)==null?void 0:m.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(Y2(this._activeReloadFrameSrc,s.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=e.frameSrcOverride??l??(e.preserveFrameSrc&&a?a:s.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(v=this._documentHost)==null||v.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,u,p;const e=this.currentFrame;if(!e||e.hasAttribute("data-content-url")||e.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Hn(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Hn(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(ta,String(++this._proxyReloadVersion));const s=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,(p=this._rootRef.value)==null||p.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:s,resetTrust:!0})}forceCurrentFrameSrc(){var s,a,l;if(!this._artifact)return;const e=Iu({artifact:this._artifact,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((s=this._navigationState)==null?void 0:s.currentURL)??null});if(e.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(a=this._rootRef.value)==null||a.removeAttribute("data-embed-loaded"),i.setAttribute("src",e.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var i;const e=this._rootRef.value,r=e==null?void 0:e.querySelector(".artifact-menu-trigger");r&&((i=e==null?void 0:e.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(e){this.closeMenu(),this._onFullScreenChange(e)}showDeleteConfirmation(){var r,i,s;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const e=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");e&&(this._dialogPresentation=ld(e,()=>this.dismissDeleteConfirmation()),(s=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||s.focus())}dismissDeleteConfirmation(){const e=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,e==null||e.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const e=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!e||!r)&&r.deleteArtifact(e).catch(()=>{})}navigationControlsTemplate(){const e=this._navigationState;return!e||!e.canGoBack&&!e.canGoForward?null:B`
251
+ `)},bn=new WeakMap,Pu=function(){var s;const e=o(this,Tt),r=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===o(this,qt)&&r===o(this,Gi)||(h(this,Y,Ba).call(this),o(this,ji).call(this,!1),!e||!r||!this.isConnected))return;if(d(this,qt,e),d(this,Gi,r),e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",o(this,bn)),e.addEventListener("did-fail-load",o(this,bn));return}e.addEventListener("load",o(this,bn));const i=e;try{i.isConnected&&((s=i.contentDocument)==null?void 0:s.readyState)==="complete"&&o(this,bn).call(this)}catch{}},Ba=function(){if(!o(this,qt)){d(this,Gi,null);return}o(this,qt).removeEventListener("load",o(this,bn)),o(this,qt).removeEventListener("did-finish-load",o(this,bn)),o(this,qt).removeEventListener("did-fail-load",o(this,bn)),d(this,qt,null),d(this,Gi,null)},_f=function(){const e=o(this,Fe),r=o(this,Tt),i=(r==null?void 0:r.dataset.contentUrl)??null,s=(e==null?void 0:e.artifact.id)??null;if(!e||!r||!i||!s){h(this,Y,bi).call(this,{clearContent:!0});return}if(r!==o(this,Ro)||s!==o(this,xo)){h(this,Y,bi).call(this),d(this,Ro,r),d(this,Io,i),d(this,xo,s);const a=r.tagName.toLowerCase()==="webview"?new M5(r):new O5(r);d(this,st,a),a.handleUpdateContent(async l=>{const c=o(this,Fe),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,wn,l),o(this,st)===a&&(a.content=l)}),o(this,wn)!==null&&(a.content=o(this,wn))}else d(this,Io,i);h(this,Y,X2).call(this)},X2=function(){const e=o(this,Fe),r=e==null?void 0:e.application;!e||!r||!o(this,st)||o(this,Nr)===e.artifact.id&&o(this,zr)===r||(d(this,Nr,e.artifact.id),d(this,zr,r),h(this,Y,Af).call(this))},Af=async function(){var s,a;const e=o(this,Fe),r=e==null?void 0:e.application;if(!e||!r)return;const i=e.artifact.id;try{const l=await r.readMarkdown(i);if(((s=o(this,Fe))==null?void 0:s.artifact.id)!==i||o(this,Fe).application!==r)return;d(this,Yi,null),d(this,wn,l);const c=o(this,st);if(!c){h(this,Y,xu).call(this);return}c.content=l}catch(l){if(((a=o(this,Fe))==null?void 0:a.artifact.id)!==i||o(this,Fe).application!==r)return;if(l instanceof ha&&l.status===nN){d(this,Yi,i),d(this,wn,null),h(this,Y,bi).call(this),h(this,Y,xu).call(this);return}d(this,Nr,null),d(this,zr,null)}},kf=function(){var r;const e=(r=o(this,Fe))==null?void 0:r.artifact;return o(this,Yi)===(e==null?void 0:e.id)&&e.kind==="path"&&Np(e.path)},bi=function(e={}){var r;(r=o(this,st))==null||r.dispose(),d(this,st,null),d(this,Ro,null),d(this,Io,null),d(this,xo,null),d(this,Nr,null),d(this,zr,null),e.clearContent&&d(this,wn,null)};const sN=St(iN);function f1(n){return n.startsWith("http://")||n.startsWith("https://")}function oN(n,t){if(!n.startsWith("/")||!t)return n;try{return new URL(n,t).toString()}catch{return n}}function aN(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?n.url===t.url:!0}var Zl,Po,Sn,Xn,Ur,Fr,Zr,Hl,Vl,Bl,ql,yt,Ef,Lu,Du;class lN{constructor(t,e=()=>{}){g(this,yt);g(this,Zl);g(this,Po);g(this,Sn,null);g(this,Xn,null);g(this,Ur,null);g(this,Fr,null);g(this,Zr,!1);g(this,Hl,t=>{const e=g1(t.data);if(!e)return;const r=o(this,Ur);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,s=i.contentWindow;if(s===null)return;const a=e.type==="leaving",l=e.type==="navigation-request"&&e.native===!0&&e.sameDocument!==!0,c=s===t.source,u=(a||l)&&o(this,Xn)!==null&&o(this,Xn)===t.source,p=a&&uN(i)===t.origin;!c&&!u&&!p||h(this,yt,Ef).call(this,e,i,{send:m=>{var v;return(v=i.contentWindow)==null?void 0:v.postMessage(m,"*")}})});g(this,Vl,t=>{var s;const e=t.detail??t;if(!e||e.channel!==m1)return;const r=g1((s=e.args)==null?void 0:s[0]),i=o(this,Fr);!r||!i||h(this,yt,Ef).call(this,r,i,{send:a=>{var l;return(l=i.send)==null?void 0:l.call(i,m1,a)}})});g(this,Bl,t=>{const e=v1(t);e.isMainFrame===!0&&e.isInPlace!==!0&&this.reset()});g(this,ql,t=>{v1(t).isMainFrame!==!1&&this.reset()});d(this,Zl,t),d(this,Po,e)}get currentGuid(){return o(this,Sn)}get lifecycleWindow(){return o(this,Xn)}get trustState(){return{currentGuid:o(this,Sn),lifecycleWindow:o(this,Xn)}}connect(){o(this,Zr)||(d(this,Zr,!0),window.addEventListener("message",o(this,Hl)),h(this,yt,Lu).call(this))}disconnect(){o(this,Zr)&&(window.removeEventListener("message",o(this,Hl)),d(this,Zr,!1),h(this,yt,Du).call(this))}reset(){d(this,Sn,null),d(this,Xn,null),o(this,Po).call(this)}setCurrentFrame(t){if(t===o(this,Ur)){h(this,yt,Lu).call(this);return}h(this,yt,Du).call(this),o(this,Ur)!==null&&this.reset(),d(this,Ur,cN(t)?t:null),h(this,yt,Lu).call(this)}}Zl=new WeakMap,Po=new WeakMap,Sn=new WeakMap,Xn=new WeakMap,Ur=new WeakMap,Fr=new WeakMap,Zr=new WeakMap,Hl=new WeakMap,Vl=new WeakMap,Bl=new WeakMap,ql=new WeakMap,yt=new WeakSet,Ef=function(t,e,r){t.type==="bridge-ready"&&t.guid!==o(this,Sn)?(o(this,Sn)!==null&&o(this,Po).call(this),d(this,Sn,t.guid),d(this,Xn,e.tagName.toLowerCase()==="iframe"?e.contentWindow:null)):t.type==="leaving"&&t.guid===o(this,Sn)&&this.reset(),o(this,Zl).call(this,t,r)},Lu=function(){if(!o(this,Zr))return;const t=o(this,Ur),e=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;e!==o(this,Fr)&&(h(this,yt,Du).call(this),e&&(e.addEventListener("ipc-message",o(this,Vl)),e.addEventListener("did-start-navigation",o(this,Bl)),e.addEventListener("did-fail-load",o(this,ql)),d(this,Fr,e)))},Du=function(){const t=o(this,Fr);t&&(t.removeEventListener("ipc-message",o(this,Vl)),t.removeEventListener("did-start-navigation",o(this,Bl)),t.removeEventListener("did-fail-load",o(this,ql)),d(this,Fr,null))};const m1="television-artifact-bridge";function g1(n){return w_(n)||b_(n)||S_(n)||__(n)||A_(n)||k_(n)||E_(n)||C_(n)?n:null}function cN(n){if(!n)return!1;const t=n.tagName.toLowerCase();return t==="iframe"||t==="webview"}function uN(n){try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function v1(n){return n.detail??n}const hN="/views/url-unsupported/";class dN extends bt{constructor(){super(...arguments);C(this,"_artifact",null);C(this,"_viewURL",null);C(this,"_contentURL",null);C(this,"_application",null);C(this,"_fullScreen",!1);C(this,"_inert",!1);C(this,"_onFullScreenChange",()=>{});C(this,"_connected",!1);C(this,"_deleteConfirmationOpen",!1);C(this,"_dialogPresentation",null);C(this,"_subscribedWebview",null);C(this,"_documentHost",null);C(this,"_pendingDocumentSource",null);C(this,"_rootRef",xn());C(this,"_trustedChannel",new lN((e,r)=>{this.handleTrustedFrameMessage(e,r)},()=>{this._missingArtifactReplyTransport=null}));C(this,"_activeReloadFrameSrc",null);C(this,"_applicationSubscriptionsAttached",!1);C(this,"_proxyReloadVersion",0);C(this,"_navigationState",null);C(this,"_navigationArtifactId",null);C(this,"_navigationCanonicalURL",null);C(this,"_preserveFrameSrcOnNavigationRender",!1);C(this,"_missingArtifactReplyTransport",null);C(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,r=!e;r&&!dr()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:e,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});C(this,"handleArtifactContentChanged",e=>{var s;const r=e.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((s=this._documentHost)!=null&&s.handleArtifactContentChanged(r))||this.reloadProxyFrame()});C(this,"handleThemeChanged",()=>{var e,r;((e=this._artifact)==null?void 0:e.kind)==="url"&&Hn(this._artifact.url)||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});C(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});C(this,"handleWebviewDidNavigateInPage",e=>{if(e.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});C(this,"captureDocumentHost",e=>{this._documentHost=e,this._pendingDocumentSource&&(e.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});C(this,"handleEmbedLoadChange",e=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",e)});C(this,"handleDocumentFrameChange",e=>{e===null&&this.resetTrustedFrame(),this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)});C(this,"handleTitleBarDoubleClick",e=>{const r=e.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(e,r){var u;const[i,s,a]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==s){const p=c?!mN(c,s):!0;if(p&&(this._activeReloadFrameSrc=null),this._artifact=s,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:p}),l=!0,c&&gN(c,s)){const m=this.currentMissingArtifactMessage();m&&((u=this._missingArtifactReplyTransport)==null||u.send(m))}}else p&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(e,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var e;this._connected=!1,(e=this._dialogPresentation)==null||e.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(e,r){var i;switch(e.type){case"url-target-request":r.send({type:$_,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const s=this.currentMissingArtifactMessage();s&&(this._missingArtifactReplyTransport=r,r.send(s));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(e);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(e.key);return;case"artifact-pointer":this.handleArtifactPointer(e);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(e){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();W2({eventType:e.eventType,clientX:i.left+e.clientX*i.width/r.clientWidth,clientY:i.top+e.clientY*i.height/r.clientHeight,button:e.button,buttons:e.buttons})}currentExternalTargetURL(){var r,i;const e=((r=this._navigationState)==null?void 0:r.currentURL)??null;return e&&fN(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:T_,title:e.title,path:e.path}}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!Hn(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){if(!Nv(e.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(e.url);if(i===hN||i===r.currentURL)return;const s=e.native===!0;(e.sameDocument||s)&&(this._preserveFrameSrcOnNavigationRender=!0),e.replace?r.replace(i):r.navigate(i)}syncNavigationState(){if(!this._connected||!this._artifact){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new b5(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const r=Iu({artifact:e,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return e.kind==="url"&&Hn(e.url)||r.renderer==="url-webview"?pr(i):y1(i,i)}convertIframeNavigationURL(e){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&Hn(this._artifact.url)&&Hn(e)?pr(e):y1(e,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(e){const r=e.url;if(typeof r!="string"||!Nv(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const s=pr(r);return s===i.currentURL?!1:(i.navigate(s),!0)}syncWebviewSubscription(e=this.currentFrame){const r=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var e;return((e=this._documentHost)==null?void 0:e.currentFrame)??null}syncFrameSubscriptions(){const e=this.currentFrame;this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(e),this.syncWebviewSubscription(e)}syncFrameTitle(e){e&&this._artifact&&e.getAttribute("title")!==this._artifact.title&&e.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(e={}){var p,m,v;const r=this._artifact;if(!r)return;e.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((p=this._navigationState)==null?void 0:p.currentURL)??null},s=Iu(i),a=(m=this.currentFrame)==null?void 0:m.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(Q2(this._activeReloadFrameSrc,s.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=e.frameSrcOverride??l??(e.preserveFrameSrc&&a?a:s.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(v=this._documentHost)==null||v.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,u,p;const e=this.currentFrame;if(!e||e.hasAttribute("data-content-url")||e.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Hn(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Hn(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(ta,String(++this._proxyReloadVersion));const s=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=s,(p=this._rootRef.value)==null||p.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:s,resetTrust:!0})}forceCurrentFrameSrc(){var s,a,l;if(!this._artifact)return;const e=Iu({artifact:this._artifact,application:this._application,electron:dr(),viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((s=this._navigationState)==null?void 0:s.currentURL)??null});if(e.renderer==="url-webview")return;const r=this.currentFrame,i=(r==null?void 0:r.tagName.toLowerCase())==="iframe"?r:null;i&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(a=this._rootRef.value)==null||a.removeAttribute("data-embed-loaded"),i.setAttribute("src",e.viewURL),(l=this._documentHost)==null||l.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var i;const e=this._rootRef.value,r=e==null?void 0:e.querySelector(".artifact-menu-trigger");r&&((i=e==null?void 0:e.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(e){this.closeMenu(),this._onFullScreenChange(e)}showDeleteConfirmation(){var r,i,s;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const e=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");e&&(this._dialogPresentation=ld(e,()=>this.dismissDeleteConfirmation()),(s=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||s.focus())}dismissDeleteConfirmation(){const e=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,e==null||e.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const e=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!e||!r)&&r.deleteArtifact(e).catch(()=>{})}navigationControlsTemplate(){const e=this._navigationState;return!e||!e.canGoBack&&!e.canGoForward?null:B`
252
252
  <button
253
253
  icon
254
254
  size="sm"
@@ -291,12 +291,12 @@ html, body {
291
291
  ${ct(this._rootRef)}
292
292
  >
293
293
  <div class="artifact-frame-clip">
294
- ${nN(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
294
+ ${sN(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
295
295
  <footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
296
296
  <tv-icon name="artifact"></tv-icon>
297
297
  <span class="artifact-title">${s.title}</span>
298
298
  ${this.navigationControlsTemplate()}
299
- ${v2(this.menuEntries(),{trigger:a=>B`
299
+ ${S2(this.menuEntries(),{trigger:a=>B`
300
300
  <button
301
301
  icon
302
302
  size="sm"
@@ -312,11 +312,11 @@ html, body {
312
312
  </div>
313
313
  ${this.deleteConfirmationTemplate()}
314
314
  </div>
315
- `}renderArtifact(e={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:e.preserveFrameSrc??!1,frameSrcOverride:e.frameSrcOverride,resetTrust:e.resetTrust}),this.render(),e.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const uN=St(cN);function hN(n){return n.startsWith("http://")||n.startsWith("https://")}function dN(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?Y2(n.url,t.url):!0}function pN(n,t){return n.kind==="path"&&t.kind==="path"&&n.id===t.id&&(n.title!==t.title||n.path!==t.path)}function Y2(n,t){try{const e=new URL(n,window.location.href),r=new URL(t,window.location.href);return e.searchParams.delete(ta),r.searchParams.delete(ta),e.origin===r.origin&&e.pathname===r.pathname&&e.search===r.search}catch{return!1}}function f1(n,t){try{const e=new URL(n,window.location.href);if(t){const r=new URL(t,window.location.href);if(e.origin!=="null"&&e.origin===r.origin)return e.searchParams.delete(ta),`${e.pathname}${e.search}${e.hash}`}}catch{return pr(n)}return pr(n)}function J2(n,t,e,r,i){const s=t.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===e?i:a.geometry.full_screen},size:a===e?{...r}:{...a.size}}));n.updateChannelPages(t.id,s).catch(()=>{})}function kf(n,t,e,r){J2(n,t,e,e.size,r)}const fN=1280,mN=800,m1=.4,g1=.4,K2=280,gN=14,vN=45,yN=16,v1=64,wN=100,bN=1,SN=24,_N=230,AN=230;function jm(n){return{width:1-m1+m1*n.width/fN,height:1-g1+g1*n.height/mN}}function X2(n){return{width:Math.min(_N,n.width),height:Math.min(AN,n.height)}}function y1(n,t){const e=jm(t),r=X2(t);return{width:Math.min(t.width,Math.max(r.width,n.width*e.width)),height:Math.min(t.height,Math.max(r.height,n.height*e.height))}}function kN(n,t){const e=jm(t);return{width:n.width/e.width,height:n.height/e.height}}const w1=.5,Kc=2,EN=120,CN=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Ji,_n,Lo,Qn,Do,Ki,Hr,Vr,Br,er,Xi,Qi,An,Oo,tr,kn,Ye,es,Z,Q2,eS,qa,tS,ja,Ef,Ou,nS,jl,Wl,Gl,Yl,ts,Jl,Cf,rn,$f,Ws,rS,iS,Mu;class $N extends bt{constructor(){super(...arguments);g(this,Z);g(this,Ji,xn());g(this,_n,xn());g(this,Lo);g(this,Qn);g(this,Do);g(this,Ki);g(this,Hr);g(this,Vr,0);g(this,Br,0);g(this,er,null);g(this,Xi,null);g(this,Qi,null);g(this,An,null);g(this,Oo,[]);g(this,tr,null);g(this,kn,null);g(this,Ye,null);g(this,es,new Set);g(this,jl,e=>{const r=o(this,Ye);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},r.option=e.altKey,h(this,Z,Cf).call(this,r))});g(this,Wl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!0)});g(this,Gl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!1)});g(this,Yl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!1)});g(this,ts,e=>{const r=o(this,Ye);if(r){if(e.type==="keydown"&&e.key==="Escape"){e.preventDefault(),h(this,Z,rn).call(this,!1);return}r.option!==e.altKey&&(r.option=e.altKey,h(this,Z,Cf).call(this,r))}});g(this,Jl,()=>{const e=o(this,Ye);!e||b1(h(this,Z,qa).call(this,e.filmstrip),e.pageBox)||(h(this,Z,Ef).call(this),h(this,Z,rn).call(this,!1))})}connected(){d(this,Lo,void 0),d(this,Qn,void 0),d(this,Do,void 0),d(this,Ki,void 0),d(this,Hr,void 0)}template(e,r,i){var z;const s=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,a=RN(r,(s==null?void 0:s.pages)??(r==null?void 0:r.pages)),l=(r==null?void 0:r.selectedPage)??null,c=(r==null?void 0:r.id)??null,u=(l==null?void 0:l.artifactIds[0])??null,p=(l==null?void 0:l.geometry.full_screen)??null,m=o(this,Ki)!==void 0,v=a.map(({key:J,page:re})=>`${J}:${re.geometry.full_screen}:${re.size.width}:${re.size.height}`).sort().join("|"),y=s===null?null:a.map(({key:J})=>J).join("|"),k=c!==o(this,Lo),A=u!==o(this,Qn),x=p!==o(this,Do),L=v!==o(this,Ki),D=y!==o(this,Hr),F=s!==null&&o(this,Hr)!==void 0&&o(this,Hr)!==null&&D?h(this,Z,rS).call(this):null,G=A&&!k&&o(this,Qn)!==void 0&&o(this,Qn)!==null&&u!==null;return o(this,Ye)&&(k||A||x)&&h(this,Z,rn).call(this,!1),d(this,Lo,c),d(this,Qn,u),d(this,Do,p),d(this,Ki,v),d(this,Hr,y),d(this,Oo,a),L&&m&&h(this,Z,Ou).call(this),k&&((z=o(this,An))==null||z.disconnect(),d(this,Xi,null),d(this,Qi,null),d(this,tr,null)),queueMicrotask(()=>h(this,Z,ja).call(this)),k||A||L?queueMicrotask(()=>h(this,Z,Q2).call(this,u,G)):D&&queueMicrotask(()=>{const J=o(this,_n).value;J&&(h(this,Z,Ws).call(this,J,u,!1),F&&h(this,Z,iS).call(this,F))}),B`
315
+ `}renderArtifact(e={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:e.preserveFrameSrc??!1,frameSrcOverride:e.frameSrcOverride,resetTrust:e.resetTrust}),this.render(),e.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const pN=St(dN);function fN(n){return n.startsWith("http://")||n.startsWith("https://")}function mN(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?Q2(n.url,t.url):!0}function gN(n,t){return n.kind==="path"&&t.kind==="path"&&n.id===t.id&&(n.title!==t.title||n.path!==t.path)}function Q2(n,t){try{const e=new URL(n,window.location.href),r=new URL(t,window.location.href);return e.searchParams.delete(ta),r.searchParams.delete(ta),e.origin===r.origin&&e.pathname===r.pathname&&e.search===r.search}catch{return!1}}function y1(n,t){try{const e=new URL(n,window.location.href);if(t){const r=new URL(t,window.location.href);if(e.origin!=="null"&&e.origin===r.origin)return e.searchParams.delete(ta),`${e.pathname}${e.search}${e.hash}`}}catch{return pr(n)}return pr(n)}function eS(n,t,e,r,i){const s=t.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===e?i:a.geometry.full_screen},size:a===e?{...r}:{...a.size}}));n.updateChannelPages(t.id,s).catch(()=>{})}function Cf(n,t,e,r){eS(n,t,e,e.size,r)}const vN=1280,yN=800,w1=.4,b1=.4,tS=280,wN=14,bN=45,SN=16,S1=64,_N=100,AN=1,kN=24,EN=230,CN=230;function Gm(n){return{width:1-w1+w1*n.width/vN,height:1-b1+b1*n.height/yN}}function nS(n){return{width:Math.min(EN,n.width),height:Math.min(CN,n.height)}}function _1(n,t){const e=Gm(t),r=nS(t);return{width:Math.min(t.width,Math.max(r.width,n.width*e.width)),height:Math.min(t.height,Math.max(r.height,n.height*e.height))}}function $N(n,t){const e=Gm(t);return{width:n.width/e.width,height:n.height/e.height}}const A1=.5,Kc=2,TN=120,RN=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Ji,_n,Lo,Qn,Do,Ki,Hr,Vr,Br,er,Xi,Qi,An,Oo,tr,kn,Ye,es,Z,rS,iS,qa,sS,ja,$f,Ou,oS,jl,Wl,Gl,Yl,ts,Jl,Tf,rn,Rf,Ws,aS,lS,Mu;class IN extends bt{constructor(){super(...arguments);g(this,Z);g(this,Ji,xn());g(this,_n,xn());g(this,Lo);g(this,Qn);g(this,Do);g(this,Ki);g(this,Hr);g(this,Vr,0);g(this,Br,0);g(this,er,null);g(this,Xi,null);g(this,Qi,null);g(this,An,null);g(this,Oo,[]);g(this,tr,null);g(this,kn,null);g(this,Ye,null);g(this,es,new Set);g(this,jl,e=>{const r=o(this,Ye);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},r.option=e.altKey,h(this,Z,Tf).call(this,r))});g(this,Wl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!0)});g(this,Gl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!1)});g(this,Yl,e=>{var r;e.pointerId===((r=o(this,Ye))==null?void 0:r.pointerId)&&h(this,Z,rn).call(this,!1)});g(this,ts,e=>{const r=o(this,Ye);if(r){if(e.type==="keydown"&&e.key==="Escape"){e.preventDefault(),h(this,Z,rn).call(this,!1);return}r.option!==e.altKey&&(r.option=e.altKey,h(this,Z,Tf).call(this,r))}});g(this,Jl,()=>{const e=o(this,Ye);!e||k1(h(this,Z,qa).call(this,e.filmstrip),e.pageBox)||(h(this,Z,$f).call(this),h(this,Z,rn).call(this,!1))})}connected(){d(this,Lo,void 0),d(this,Qn,void 0),d(this,Do,void 0),d(this,Ki,void 0),d(this,Hr,void 0)}template(e,r,i){var z;const s=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,a=PN(r,(s==null?void 0:s.pages)??(r==null?void 0:r.pages)),l=(r==null?void 0:r.selectedPage)??null,c=(r==null?void 0:r.id)??null,u=(l==null?void 0:l.artifactIds[0])??null,p=(l==null?void 0:l.geometry.full_screen)??null,m=o(this,Ki)!==void 0,v=a.map(({key:J,page:re})=>`${J}:${re.geometry.full_screen}:${re.size.width}:${re.size.height}`).sort().join("|"),y=s===null?null:a.map(({key:J})=>J).join("|"),k=c!==o(this,Lo),A=u!==o(this,Qn),x=p!==o(this,Do),L=v!==o(this,Ki),D=y!==o(this,Hr),F=s!==null&&o(this,Hr)!==void 0&&o(this,Hr)!==null&&D?h(this,Z,aS).call(this):null,G=A&&!k&&o(this,Qn)!==void 0&&o(this,Qn)!==null&&u!==null;return o(this,Ye)&&(k||A||x)&&h(this,Z,rn).call(this,!1),d(this,Lo,c),d(this,Qn,u),d(this,Do,p),d(this,Ki,v),d(this,Hr,y),d(this,Oo,a),L&&m&&h(this,Z,Ou).call(this),k&&((z=o(this,An))==null||z.disconnect(),d(this,Xi,null),d(this,Qi,null),d(this,tr,null)),queueMicrotask(()=>h(this,Z,ja).call(this)),k||A||L?queueMicrotask(()=>h(this,Z,rS).call(this,u,G)):D&&queueMicrotask(()=>{const J=o(this,_n).value;J&&(h(this,Z,Ws).call(this,J,u,!1),F&&h(this,Z,lS).call(this,F))}),B`
316
316
  <section
317
317
  class="stage"
318
318
  ${ct(o(this,Ji))}
319
- style=${`--handle-band: ${gN}px; --handle-reach: ${vN}px; --handle-thickness: ${yN}px;`}
319
+ style=${`--handle-band: ${wN}px; --handle-reach: ${bN}px; --handle-thickness: ${SN}px;`}
320
320
  >
321
321
  ${r!==null&&a.length===0?B`
322
322
  <div class="stage-empty">
@@ -333,16 +333,16 @@ html, body {
333
333
  data-page-key=${_t}
334
334
  ?selected=${Me}
335
335
  ?full-screen=${J.geometry.full_screen}
336
- style=${h(this,Z,tS).call(this,J)}
336
+ style=${h(this,Z,sS).call(this,J)}
337
337
  @click=${Me||re===null?null:()=>e.selectPage(r.id,re.id)}
338
338
  >
339
- ${re?uN(e,re,{viewURL:e.getArtifactViewURL(re),contentURL:e.getArtifactContentURL(re),fullScreen:J.geometry.full_screen,inert:!Me,onFullScreenChange:he=>kf(e,r,J,he)}):null}
339
+ ${re?pN(e,re,{viewURL:e.getArtifactViewURL(re),contentURL:e.getArtifactContentURL(re),fullScreen:J.geometry.full_screen,inert:!Me,onFullScreenChange:he=>Cf(e,r,J,he)}):null}
340
340
  ${Me?B`
341
341
  <div class="page-handles" aria-hidden="true">
342
- ${CN.map(he=>B`
342
+ ${RN.map(he=>B`
343
343
  <span
344
344
  class="page-handle ${he}"
345
- @pointerdown=${Ne=>h(this,Z,nS).call(this,Ne,he,e,r,J,_t)}
345
+ @pointerdown=${Ne=>h(this,Z,oS).call(this,Ne,he,e,r,J,_t)}
346
346
  ></span>
347
347
  `)}
348
348
  </div>
@@ -353,16 +353,16 @@ html, body {
353
353
  </div>
354
354
  `)}
355
355
  </section>
356
- `}disconnected(){var e;h(this,Z,rn).call(this,!1),h(this,Z,Ou).call(this),h(this,Z,Mu).call(this),cancelAnimationFrame(o(this,Vr)),d(this,Vr,0),(e=o(this,An))==null||e.disconnect(),d(this,An,null),d(this,Xi,null),d(this,Qi,null),d(this,tr,null),d(this,Oo,[]);for(const r of o(this,es))r.cancel();o(this,es).clear()}}Ji=new WeakMap,_n=new WeakMap,Lo=new WeakMap,Qn=new WeakMap,Do=new WeakMap,Ki=new WeakMap,Hr=new WeakMap,Vr=new WeakMap,Br=new WeakMap,er=new WeakMap,Xi=new WeakMap,Qi=new WeakMap,An=new WeakMap,Oo=new WeakMap,tr=new WeakMap,kn=new WeakMap,Ye=new WeakMap,es=new WeakMap,Z=new WeakSet,Q2=function(e,r){const i=o(this,_n).value;i&&(cancelAnimationFrame(o(this,Vr)),d(this,Vr,requestAnimationFrame(()=>{d(this,Vr,0),h(this,Z,Ws).call(this,i,e,r)})))},eS=function(e,r){var i;typeof ResizeObserver>"u"||e===o(this,Xi)&&r===o(this,Qi)||((i=o(this,An))==null||i.disconnect(),d(this,Xi,e),d(this,Qi,r),d(this,An,new ResizeObserver(()=>{const s=h(this,Z,qa).call(this,e);b1(s,o(this,tr))||(h(this,Z,Ef).call(this),o(this,Ye)&&h(this,Z,rn).call(this,!1),h(this,Z,ja).call(this,e)),o(this,er)===null&&h(this,Z,Ws).call(this,e,o(this,Qn)??null,!1)})),o(this,An).observe(e),o(this,An).observe(r))},qa=function(e){const r=Number.parseFloat(getComputedStyle(e).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,e.clientWidth-2*r),height:Math.max(0,e.clientHeight-r)}},tS=function(e){if(e.geometry.full_screen||o(this,tr)===null)return"";const r=y1(e.size,o(this,tr));return`width: ${r.width}px; height: ${r.height}px;`},ja=function(e=o(this,_n).value){var s;if(!e)return;const r=h(this,Z,qa).call(this,e);d(this,tr,r);const i=new Map(o(this,Oo).map(a=>[a.key,a.page]));for(const a of e.querySelectorAll(".page")){if(a===((s=o(this,Ye))==null?void 0:s.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=y1(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},Ef=function(){const e=o(this,Ji).value;e&&(e.setAttribute("window-tracking",""),o(this,kn)!==null&&clearTimeout(o(this,kn)),d(this,kn,setTimeout(()=>{d(this,kn,null),e.removeAttribute("window-tracking")},EN)))},Ou=function(){var e;o(this,kn)!==null&&(clearTimeout(o(this,kn)),d(this,kn,null)),(e=o(this,Ji).value)==null||e.removeAttribute("window-tracking")},nS=function(e,r,i,s,a,l){if(e.button!==0||!e.isPrimary)return;const c=e.currentTarget,u=c.closest(".page"),p=o(this,_n).value,m=o(this,Ji).value;if(!u||!p||!m)return;h(this,Z,rn).call(this,!1),h(this,Z,Ou).call(this),e.preventDefault(),e.stopPropagation();const v=u.getBoundingClientRect(),y=h(this,Z,qa).call(this,p),k=jm(y),A=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),L=r.includes("top")||r.includes("bottom");d(this,Ye,{application:i,channel:s,page:a,pageKey:l,pageElement:u,filmstrip:p,stage:m,handle:c,pointerId:e.pointerId,startPointer:{x:e.clientX,y:e.clientY},lastPointer:{x:e.clientX,y:e.clientY},startRendered:{width:v.width,height:v.height},rendered:{width:v.width,height:v.height},baselineSize:A?{width:y.width/k.width,height:y.height/k.height}:{...a.size},pageBox:y,wasFullScreen:A,horizontal:x,vertical:L,leftish:r.includes("left"),topish:r.includes("top"),option:e.altKey,armed:!1,leftFullScreen:!1}),m.setAttribute("resizing",""),c.addEventListener("pointermove",o(this,jl)),c.addEventListener("pointerup",o(this,Wl)),c.addEventListener("pointercancel",o(this,Gl)),c.addEventListener("lostpointercapture",o(this,Yl)),window.addEventListener("keydown",o(this,ts)),window.addEventListener("keyup",o(this,ts)),window.addEventListener("resize",o(this,Jl)),c.setPointerCapture(e.pointerId)},jl=new WeakMap,Wl=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,ts=new WeakMap,Jl=new WeakMap,Cf=function(e){const r=e.lastPointer.x!==e.startPointer.x||e.lastPointer.y!==e.startPointer.y;if(e.wasFullScreen&&!e.leftFullScreen){if(!r)return;e.leftFullScreen=!0,e.pageElement.removeAttribute("full-screen")}const i=X2(e.pageBox);let s=e.startRendered.width,a=e.startRendered.height;if(e.horizontal){const l=e.leftish?-Kc:Kc;s=Math.min(e.pageBox.width,Math.max(i.width,e.startRendered.width+(e.lastPointer.x-e.startPointer.x)*l))}if(e.vertical){const l=e.topish?-Kc:Kc;a=Math.min(e.pageBox.height,Math.max(i.height,e.startRendered.height+(e.lastPointer.y-e.startPointer.y)*l))}e.armed=!e.option&&e.horizontal&&e.vertical&&s>=e.pageBox.width-v1&&a>=e.pageBox.height-v1,e.rendered=e.armed?{...e.pageBox}:{width:s,height:a},e.pageElement.style.width=`${e.rendered.width}px`,e.pageElement.style.height=`${e.rendered.height}px`,h(this,Z,$f).call(this,e.stage,e.armed),h(this,Z,Ws).call(this,e.filmstrip,e.pageKey,!1)},rn=function(e){const r=o(this,Ye);if(r){if(d(this,Ye,null),r.handle.removeEventListener("pointermove",o(this,jl)),r.handle.removeEventListener("pointerup",o(this,Wl)),r.handle.removeEventListener("pointercancel",o(this,Gl)),r.handle.removeEventListener("lostpointercapture",o(this,Yl)),window.removeEventListener("keydown",o(this,ts)),window.removeEventListener("keyup",o(this,ts)),window.removeEventListener("resize",o(this,Jl)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,Z,$f).call(this,r.stage,!1),e&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),kf(r.application,r.channel,r.page,!0);else if(e){const i={...r.baselineSize},s=kN(r.rendered,r.pageBox);let a=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=s.width,a=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=s.height,a=!0),a?J2(r.application,r.channel,r.page,i,!1):h(this,Z,ja).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,Z,ja).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,Z,Ws).call(this,r.filmstrip,r.pageKey,!1)}},$f=function(e,r){const i=e.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const s=document.createElement("div");s.className="snap-outline",s.setAttribute("aria-hidden","true"),e.append(s)},Ws=function(e,r,i){const s=[...e.querySelectorAll(".page")].find(v=>v.dataset.pageKey===r);if(!s){h(this,Z,Mu).call(this);return}h(this,Z,eS).call(this,e,s);const a=s.getBoundingClientRect(),l=e.getBoundingClientRect(),c=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(l.left+l.width/2),e.scrollWidth-e.clientWidth));if(h(this,Z,Mu).call(this),!i||Math.abs(c-e.scrollLeft)<w1||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,p=e.animate([{},{}],{duration:K2,easing:"ease"});d(this,er,p);const m=()=>{var y;if(p!==o(this,er))return;const v=p.playState==="finished"?1:((y=p.effect)==null?void 0:y.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*v,p.playState==="finished"?(e.scrollLeft=c,d(this,er,null),d(this,Br,0)):d(this,Br,requestAnimationFrame(m))};d(this,Br,requestAnimationFrame(m))},rS=function(){const e=o(this,_n).value;return e?new Map([...e.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},iS=function(e){const r=o(this,_n).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const s=e.get(i.dataset.pageKey??"");if(s===void 0)continue;const a=s-i.getBoundingClientRect().left;if(Math.abs(a)<=w1)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:eo,easing:"ease"});o(this,es).add(l),l.finished.finally(()=>{o(this,es).delete(l)}).catch(()=>{})}},Mu=function(){var e;cancelAnimationFrame(o(this,Br)),d(this,Br,0),(e=o(this,er))==null||e.cancel(),d(this,er,null)};const TN=St($N);function RN(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{const s=r.artifactIds[0];return{page:r,artifact:s===void 0?null:e.get(s)??null,key:s??`empty-page-${i}`}})}function b1(n,t){return t!==null&&n.width===t.width&&n.height===t.height}/**
356
+ `}disconnected(){var e;h(this,Z,rn).call(this,!1),h(this,Z,Ou).call(this),h(this,Z,Mu).call(this),cancelAnimationFrame(o(this,Vr)),d(this,Vr,0),(e=o(this,An))==null||e.disconnect(),d(this,An,null),d(this,Xi,null),d(this,Qi,null),d(this,tr,null),d(this,Oo,[]);for(const r of o(this,es))r.cancel();o(this,es).clear()}}Ji=new WeakMap,_n=new WeakMap,Lo=new WeakMap,Qn=new WeakMap,Do=new WeakMap,Ki=new WeakMap,Hr=new WeakMap,Vr=new WeakMap,Br=new WeakMap,er=new WeakMap,Xi=new WeakMap,Qi=new WeakMap,An=new WeakMap,Oo=new WeakMap,tr=new WeakMap,kn=new WeakMap,Ye=new WeakMap,es=new WeakMap,Z=new WeakSet,rS=function(e,r){const i=o(this,_n).value;i&&(cancelAnimationFrame(o(this,Vr)),d(this,Vr,requestAnimationFrame(()=>{d(this,Vr,0),h(this,Z,Ws).call(this,i,e,r)})))},iS=function(e,r){var i;typeof ResizeObserver>"u"||e===o(this,Xi)&&r===o(this,Qi)||((i=o(this,An))==null||i.disconnect(),d(this,Xi,e),d(this,Qi,r),d(this,An,new ResizeObserver(()=>{const s=h(this,Z,qa).call(this,e);k1(s,o(this,tr))||(h(this,Z,$f).call(this),o(this,Ye)&&h(this,Z,rn).call(this,!1),h(this,Z,ja).call(this,e)),o(this,er)===null&&h(this,Z,Ws).call(this,e,o(this,Qn)??null,!1)})),o(this,An).observe(e),o(this,An).observe(r))},qa=function(e){const r=Number.parseFloat(getComputedStyle(e).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,e.clientWidth-2*r),height:Math.max(0,e.clientHeight-r)}},sS=function(e){if(e.geometry.full_screen||o(this,tr)===null)return"";const r=_1(e.size,o(this,tr));return`width: ${r.width}px; height: ${r.height}px;`},ja=function(e=o(this,_n).value){var s;if(!e)return;const r=h(this,Z,qa).call(this,e);d(this,tr,r);const i=new Map(o(this,Oo).map(a=>[a.key,a.page]));for(const a of e.querySelectorAll(".page")){if(a===((s=o(this,Ye))==null?void 0:s.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=_1(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},$f=function(){const e=o(this,Ji).value;e&&(e.setAttribute("window-tracking",""),o(this,kn)!==null&&clearTimeout(o(this,kn)),d(this,kn,setTimeout(()=>{d(this,kn,null),e.removeAttribute("window-tracking")},TN)))},Ou=function(){var e;o(this,kn)!==null&&(clearTimeout(o(this,kn)),d(this,kn,null)),(e=o(this,Ji).value)==null||e.removeAttribute("window-tracking")},oS=function(e,r,i,s,a,l){if(e.button!==0||!e.isPrimary)return;const c=e.currentTarget,u=c.closest(".page"),p=o(this,_n).value,m=o(this,Ji).value;if(!u||!p||!m)return;h(this,Z,rn).call(this,!1),h(this,Z,Ou).call(this),e.preventDefault(),e.stopPropagation();const v=u.getBoundingClientRect(),y=h(this,Z,qa).call(this,p),k=Gm(y),A=a.geometry.full_screen,x=r.includes("left")||r.includes("right"),L=r.includes("top")||r.includes("bottom");d(this,Ye,{application:i,channel:s,page:a,pageKey:l,pageElement:u,filmstrip:p,stage:m,handle:c,pointerId:e.pointerId,startPointer:{x:e.clientX,y:e.clientY},lastPointer:{x:e.clientX,y:e.clientY},startRendered:{width:v.width,height:v.height},rendered:{width:v.width,height:v.height},baselineSize:A?{width:y.width/k.width,height:y.height/k.height}:{...a.size},pageBox:y,wasFullScreen:A,horizontal:x,vertical:L,leftish:r.includes("left"),topish:r.includes("top"),option:e.altKey,armed:!1,leftFullScreen:!1}),m.setAttribute("resizing",""),c.addEventListener("pointermove",o(this,jl)),c.addEventListener("pointerup",o(this,Wl)),c.addEventListener("pointercancel",o(this,Gl)),c.addEventListener("lostpointercapture",o(this,Yl)),window.addEventListener("keydown",o(this,ts)),window.addEventListener("keyup",o(this,ts)),window.addEventListener("resize",o(this,Jl)),c.setPointerCapture(e.pointerId)},jl=new WeakMap,Wl=new WeakMap,Gl=new WeakMap,Yl=new WeakMap,ts=new WeakMap,Jl=new WeakMap,Tf=function(e){const r=e.lastPointer.x!==e.startPointer.x||e.lastPointer.y!==e.startPointer.y;if(e.wasFullScreen&&!e.leftFullScreen){if(!r)return;e.leftFullScreen=!0,e.pageElement.removeAttribute("full-screen")}const i=nS(e.pageBox);let s=e.startRendered.width,a=e.startRendered.height;if(e.horizontal){const l=e.leftish?-Kc:Kc;s=Math.min(e.pageBox.width,Math.max(i.width,e.startRendered.width+(e.lastPointer.x-e.startPointer.x)*l))}if(e.vertical){const l=e.topish?-Kc:Kc;a=Math.min(e.pageBox.height,Math.max(i.height,e.startRendered.height+(e.lastPointer.y-e.startPointer.y)*l))}e.armed=!e.option&&e.horizontal&&e.vertical&&s>=e.pageBox.width-S1&&a>=e.pageBox.height-S1,e.rendered=e.armed?{...e.pageBox}:{width:s,height:a},e.pageElement.style.width=`${e.rendered.width}px`,e.pageElement.style.height=`${e.rendered.height}px`,h(this,Z,Rf).call(this,e.stage,e.armed),h(this,Z,Ws).call(this,e.filmstrip,e.pageKey,!1)},rn=function(e){const r=o(this,Ye);if(r){if(d(this,Ye,null),r.handle.removeEventListener("pointermove",o(this,jl)),r.handle.removeEventListener("pointerup",o(this,Wl)),r.handle.removeEventListener("pointercancel",o(this,Gl)),r.handle.removeEventListener("lostpointercapture",o(this,Yl)),window.removeEventListener("keydown",o(this,ts)),window.removeEventListener("keyup",o(this,ts)),window.removeEventListener("resize",o(this,Jl)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,Z,Rf).call(this,r.stage,!1),e&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),Cf(r.application,r.channel,r.page,!0);else if(e){const i={...r.baselineSize},s=$N(r.rendered,r.pageBox);let a=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(i.width=s.width,a=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(i.height=s.height,a=!0),a?eS(r.application,r.channel,r.page,i,!1):h(this,Z,ja).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,Z,ja).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,Z,Ws).call(this,r.filmstrip,r.pageKey,!1)}},Rf=function(e,r){const i=e.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const s=document.createElement("div");s.className="snap-outline",s.setAttribute("aria-hidden","true"),e.append(s)},Ws=function(e,r,i){const s=[...e.querySelectorAll(".page")].find(v=>v.dataset.pageKey===r);if(!s){h(this,Z,Mu).call(this);return}h(this,Z,iS).call(this,e,s);const a=s.getBoundingClientRect(),l=e.getBoundingClientRect(),c=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(l.left+l.width/2),e.scrollWidth-e.clientWidth));if(h(this,Z,Mu).call(this),!i||Math.abs(c-e.scrollLeft)<A1||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,p=e.animate([{},{}],{duration:tS,easing:"ease"});d(this,er,p);const m=()=>{var y;if(p!==o(this,er))return;const v=p.playState==="finished"?1:((y=p.effect)==null?void 0:y.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*v,p.playState==="finished"?(e.scrollLeft=c,d(this,er,null),d(this,Br,0)):d(this,Br,requestAnimationFrame(m))};d(this,Br,requestAnimationFrame(m))},aS=function(){const e=o(this,_n).value;return e?new Map([...e.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},lS=function(e){const r=o(this,_n).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const s=e.get(i.dataset.pageKey??"");if(s===void 0)continue;const a=s-i.getBoundingClientRect().left;if(Math.abs(a)<=A1)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:eo,easing:"ease"});o(this,es).add(l),l.finished.finally(()=>{o(this,es).delete(l)}).catch(()=>{})}},Mu=function(){var e;cancelAnimationFrame(o(this,Br)),d(this,Br,0),(e=o(this,er))==null||e.cancel(),d(this,er,null)};const xN=St(IN);function PN(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{const s=r.artifactIds[0];return{page:r,artifact:s===void 0?null:e.get(s)??null,key:s??`empty-page-${i}`}})}function k1(n,t){return t!==null&&n.width===t.width&&n.height===t.height}/**
357
357
  * @license
358
358
  * Copyright 2017 Google LLC
359
359
  * SPDX-License-Identifier: BSD-3-Clause
360
- */class Tf extends Ec{constructor(t){if(super(t),this.it=ie,t.type!==In.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ie||t==null)return this._t=void 0,this.it=t;if(t===Ke)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}Tf.directiveName="unsafeHTML",Tf.resultType=1;const sS=ma(Tf);/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:oS,setPrototypeOf:S1,isFrozen:IN,getPrototypeOf:xN,getOwnPropertyDescriptor:PN}=Object;let{freeze:Qe,seal:Ot,create:Nu}=Object,{apply:Rf,construct:If}=typeof Reflect<"u"&&Reflect;Qe||(Qe=function(t){return t});Ot||(Ot=function(t){return t});Rf||(Rf=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(e,i)});If||(If=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Xc=et(Array.prototype.forEach),LN=et(Array.prototype.lastIndexOf),_1=et(Array.prototype.pop),Ca=et(Array.prototype.push),DN=et(Array.prototype.splice),zu=et(String.prototype.toLowerCase),lp=et(String.prototype.toString),cp=et(String.prototype.match),$a=et(String.prototype.replace),ON=et(String.prototype.indexOf),MN=et(String.prototype.trim),ht=et(Object.prototype.hasOwnProperty),qe=et(RegExp.prototype.test),Ta=NN(TypeError);function et(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return Rf(n,t,r)}}function NN(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return If(n,e)}}function X(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zu;S1&&S1(n,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=e(i);s!==i&&(IN(t)||(t[r]=s),i=s)}n[i]=!0}return n}function zN(n){for(let t=0;t<n.length;t++)ht(n,t)||(n[t]=null);return n}function sn(n){const t=Nu(null);for(const[e,r]of oS(n))ht(n,e)&&(Array.isArray(r)?t[e]=zN(r):r&&typeof r=="object"&&r.constructor===Object?t[e]=sn(r):t[e]=r);return t}function Ra(n,t){for(;n!==null;){const r=PN(n,t);if(r){if(r.get)return et(r.get);if(typeof r.value=="function")return et(r.value)}n=xN(n)}function e(){return null}return e}const A1=Qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),up=Qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),hp=Qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),UN=Qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),dp=Qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),FN=Qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),k1=Qe(["#text"]),E1=Qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pp=Qe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),C1=Qe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qc=Qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ZN=Ot(/\{\{[\w\W]*|[\w\W]*\}\}/gm),HN=Ot(/<%[\w\W]*|[\w\W]*%>/gm),VN=Ot(/\$\{[\w\W]*/gm),BN=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),qN=Ot(/^aria-[\-\w]+$/),aS=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),jN=Ot(/^(?:\w+script|data):/i),WN=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),lS=Ot(/^html$/i),GN=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i);var $1=Object.freeze({__proto__:null,ARIA_ATTR:qN,ATTR_WHITESPACE:WN,CUSTOM_ELEMENT:GN,DATA_ATTR:BN,DOCTYPE_NAME:lS,ERB_EXPR:HN,IS_ALLOWED_URI:aS,IS_SCRIPT_OR_DATA:jN,MUSTACHE_EXPR:ZN,TMPLIT_EXPR:VN});const Ia={element:1,text:3,progressingInstruction:7,comment:8,document:9},YN=function(){return typeof window>"u"?null:window},JN=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},T1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function cS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:YN();const t=H=>cS(H);if(t.version="3.3.3",t.removed=[],!n||!n.document||n.document.nodeType!==Ia.document||!n.Element)return t.isSupported=!1,t;let{document:e}=n;const r=e,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:p=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:y}=n,k=c.prototype,A=Ra(k,"cloneNode"),x=Ra(k,"remove"),L=Ra(k,"nextSibling"),D=Ra(k,"childNodes"),V=Ra(k,"parentNode");if(typeof a=="function"){const H=e.createElement("template");H.content&&H.content.ownerDocument&&(e=H.content.ownerDocument)}let F,G="";const{implementation:z,createNodeIterator:J,createDocumentFragment:re,getElementsByTagName:_t}=e,{importNode:Me}=r;let he=T1();t.isSupported=typeof oS=="function"&&typeof V=="function"&&z&&z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ne,ERB_EXPR:tt,TMPLIT_EXPR:Ut,DATA_ATTR:Es,ARIA_ATTR:Tc,IS_SCRIPT_OR_DATA:r_,ATTR_WHITESPACE:ag,CUSTOM_ELEMENT:i_}=$1;let{IS_ALLOWED_URI:lg}=$1,Le=null;const cg=X({},[...A1,...up,...hp,...dp,...k1]);let ze=null;const ug=X({},[...E1,...pp,...C1,...Qc]);let _e=Object.seal(Nu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),va=null,Rc=null;const wr=Object.seal(Nu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let hg=!0,dd=!0,dg=!1,pg=!0,Cs=!1,Ic=!0,mi=!1,pd=!1,fd=!1,$s=!1,xc=!1,Pc=!1,fg=!0,mg=!1;const s_="user-content-";let md=!0,ya=!1,Ts={},Xt=null;const gd=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let gg=null;const vg=X({},["audio","video","img","source","image","track"]);let vd=null;const yg=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lc="http://www.w3.org/1998/Math/MathML",Dc="http://www.w3.org/2000/svg",Dn="http://www.w3.org/1999/xhtml";let Rs=Dn,yd=!1,wd=null;const o_=X({},[Lc,Dc,Dn],lp);let Oc=X({},["mi","mo","mn","ms","mtext"]),Mc=X({},["annotation-xml"]);const a_=X({},["title","style","font","a","script"]);let wa=null;const l_=["application/xhtml+xml","text/html"],c_="text/html";let Re=null,Is=null;const u_=e.createElement("form"),wg=function(b){return b instanceof RegExp||b instanceof Function},bd=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Is&&Is===b)){if((!b||typeof b!="object")&&(b={}),b=sn(b),wa=l_.indexOf(b.PARSER_MEDIA_TYPE)===-1?c_:b.PARSER_MEDIA_TYPE,Re=wa==="application/xhtml+xml"?lp:zu,Le=ht(b,"ALLOWED_TAGS")?X({},b.ALLOWED_TAGS,Re):cg,ze=ht(b,"ALLOWED_ATTR")?X({},b.ALLOWED_ATTR,Re):ug,wd=ht(b,"ALLOWED_NAMESPACES")?X({},b.ALLOWED_NAMESPACES,lp):o_,vd=ht(b,"ADD_URI_SAFE_ATTR")?X(sn(yg),b.ADD_URI_SAFE_ATTR,Re):yg,gg=ht(b,"ADD_DATA_URI_TAGS")?X(sn(vg),b.ADD_DATA_URI_TAGS,Re):vg,Xt=ht(b,"FORBID_CONTENTS")?X({},b.FORBID_CONTENTS,Re):gd,va=ht(b,"FORBID_TAGS")?X({},b.FORBID_TAGS,Re):sn({}),Rc=ht(b,"FORBID_ATTR")?X({},b.FORBID_ATTR,Re):sn({}),Ts=ht(b,"USE_PROFILES")?b.USE_PROFILES:!1,hg=b.ALLOW_ARIA_ATTR!==!1,dd=b.ALLOW_DATA_ATTR!==!1,dg=b.ALLOW_UNKNOWN_PROTOCOLS||!1,pg=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Cs=b.SAFE_FOR_TEMPLATES||!1,Ic=b.SAFE_FOR_XML!==!1,mi=b.WHOLE_DOCUMENT||!1,$s=b.RETURN_DOM||!1,xc=b.RETURN_DOM_FRAGMENT||!1,Pc=b.RETURN_TRUSTED_TYPE||!1,fd=b.FORCE_BODY||!1,fg=b.SANITIZE_DOM!==!1,mg=b.SANITIZE_NAMED_PROPS||!1,md=b.KEEP_CONTENT!==!1,ya=b.IN_PLACE||!1,lg=b.ALLOWED_URI_REGEXP||aS,Rs=b.NAMESPACE||Dn,Oc=b.MATHML_TEXT_INTEGRATION_POINTS||Oc,Mc=b.HTML_INTEGRATION_POINTS||Mc,_e=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&wg(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_e.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&wg(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_e.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Cs&&(dd=!1),xc&&($s=!0),Ts&&(Le=X({},k1),ze=Nu(null),Ts.html===!0&&(X(Le,A1),X(ze,E1)),Ts.svg===!0&&(X(Le,up),X(ze,pp),X(ze,Qc)),Ts.svgFilters===!0&&(X(Le,hp),X(ze,pp),X(ze,Qc)),Ts.mathMl===!0&&(X(Le,dp),X(ze,C1),X(ze,Qc))),ht(b,"ADD_TAGS")||(wr.tagCheck=null),ht(b,"ADD_ATTR")||(wr.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?wr.tagCheck=b.ADD_TAGS:(Le===cg&&(Le=sn(Le)),X(Le,b.ADD_TAGS,Re))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?wr.attributeCheck=b.ADD_ATTR:(ze===ug&&(ze=sn(ze)),X(ze,b.ADD_ATTR,Re))),b.ADD_URI_SAFE_ATTR&&X(vd,b.ADD_URI_SAFE_ATTR,Re),b.FORBID_CONTENTS&&(Xt===gd&&(Xt=sn(Xt)),X(Xt,b.FORBID_CONTENTS,Re)),b.ADD_FORBID_CONTENTS&&(Xt===gd&&(Xt=sn(Xt)),X(Xt,b.ADD_FORBID_CONTENTS,Re)),md&&(Le["#text"]=!0),mi&&X(Le,["html","head","body"]),Le.table&&(X(Le,["tbody"]),delete va.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=b.TRUSTED_TYPES_POLICY,G=F.createHTML("")}else F===void 0&&(F=JN(y,i)),F!==null&&typeof G=="string"&&(G=F.createHTML(""));Qe&&Qe(b),Is=b}},bg=X({},[...up,...hp,...UN]),Sg=X({},[...dp,...FN]),h_=function(b){let I=V(b);(!I||!I.tagName)&&(I={namespaceURI:Rs,tagName:"template"});const O=zu(b.tagName),fe=zu(I.tagName);return wd[b.namespaceURI]?b.namespaceURI===Dc?I.namespaceURI===Dn?O==="svg":I.namespaceURI===Lc?O==="svg"&&(fe==="annotation-xml"||Oc[fe]):!!bg[O]:b.namespaceURI===Lc?I.namespaceURI===Dn?O==="math":I.namespaceURI===Dc?O==="math"&&Mc[fe]:!!Sg[O]:b.namespaceURI===Dn?I.namespaceURI===Dc&&!Mc[fe]||I.namespaceURI===Lc&&!Oc[fe]?!1:!Sg[O]&&(a_[O]||!bg[O]):!!(wa==="application/xhtml+xml"&&wd[b.namespaceURI]):!1},Qt=function(b){Ca(t.removed,{element:b});try{V(b).removeChild(b)}catch{x(b)}},gi=function(b,I){try{Ca(t.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Ca(t.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if($s||xc)try{Qt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},_g=function(b){let I=null,O=null;if(fd)b="<remove></remove>"+b;else{const ke=cp(b,/^[\r\n\t ]+/);O=ke&&ke[0]}wa==="application/xhtml+xml"&&Rs===Dn&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const fe=F?F.createHTML(b):b;if(Rs===Dn)try{I=new v().parseFromString(fe,wa)}catch{}if(!I||!I.documentElement){I=z.createDocument(Rs,"template",null);try{I.documentElement.innerHTML=yd?G:fe}catch{}}const He=I.body||I.documentElement;return b&&O&&He.insertBefore(e.createTextNode(O),He.childNodes[0]||null),Rs===Dn?_t.call(I,mi?"html":"body")[0]:mi?I.documentElement:He},Ag=function(b){return J.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Sd=function(b){return b instanceof m&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof p)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},kg=function(b){return typeof l=="function"&&b instanceof l};function On(H,b,I){Xc(H,O=>{O.call(t,b,I,Is)})}const Eg=function(b){let I=null;if(On(he.beforeSanitizeElements,b,null),Sd(b))return Qt(b),!0;const O=Re(b.nodeName);if(On(he.uponSanitizeElement,b,{tagName:O,allowedTags:Le}),Ic&&b.hasChildNodes()&&!kg(b.firstElementChild)&&qe(/<[/\w!]/g,b.innerHTML)&&qe(/<[/\w!]/g,b.textContent)||b.nodeType===Ia.progressingInstruction||Ic&&b.nodeType===Ia.comment&&qe(/<[/\w]/g,b.data))return Qt(b),!0;if(!(wr.tagCheck instanceof Function&&wr.tagCheck(O))&&(!Le[O]||va[O])){if(!va[O]&&$g(O)&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,O)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(O)))return!1;if(md&&!Xt[O]){const fe=V(b)||b.parentNode,He=D(b)||b.childNodes;if(He&&fe){const ke=He.length;for(let nt=ke-1;nt>=0;--nt){const Mn=A(He[nt],!0);Mn.__removalCount=(b.__removalCount||0)+1,fe.insertBefore(Mn,L(b))}}}return Qt(b),!0}return b instanceof c&&!h_(b)||(O==="noscript"||O==="noembed"||O==="noframes")&&qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(Qt(b),!0):(Cs&&b.nodeType===Ia.text&&(I=b.textContent,Xc([Ne,tt,Ut],fe=>{I=$a(I,fe," ")}),b.textContent!==I&&(Ca(t.removed,{element:b.cloneNode()}),b.textContent=I)),On(he.afterSanitizeElements,b,null),!1)},Cg=function(b,I,O){if(Rc[I]||fg&&(I==="id"||I==="name")&&(O in e||O in u_))return!1;if(!(dd&&!Rc[I]&&qe(Es,I))){if(!(hg&&qe(Tc,I))){if(!(wr.attributeCheck instanceof Function&&wr.attributeCheck(I,b))){if(!ze[I]||Rc[I]){if(!($g(b)&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,b)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(b))&&(_e.attributeNameCheck instanceof RegExp&&qe(_e.attributeNameCheck,I)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(I,b))||I==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,O)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(O))))return!1}else if(!vd[I]){if(!qe(lg,$a(O,ag,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&ON(O,"data:")===0&&gg[b])){if(!(dg&&!qe(r_,$a(O,ag,"")))){if(O)return!1}}}}}}}return!0},$g=function(b){return b!=="annotation-xml"&&cp(b,i_)},Tg=function(b){On(he.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||Sd(b))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let fe=I.length;for(;fe--;){const He=I[fe],{name:ke,namespaceURI:nt,value:Mn}=He,xs=Re(ke),_d=Mn;let Ue=ke==="value"?_d:MN(_d);if(O.attrName=xs,O.attrValue=Ue,O.keepAttr=!0,O.forceKeepAttr=void 0,On(he.uponSanitizeAttribute,b,O),Ue=O.attrValue,mg&&(xs==="id"||xs==="name")&&(gi(ke,b),Ue=s_+Ue),Ic&&qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ue)){gi(ke,b);continue}if(xs==="attributename"&&cp(Ue,"href")){gi(ke,b);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){gi(ke,b);continue}if(!pg&&qe(/\/>/i,Ue)){gi(ke,b);continue}Cs&&Xc([Ne,tt,Ut],Ig=>{Ue=$a(Ue,Ig," ")});const Rg=Re(b.nodeName);if(!Cg(Rg,xs,Ue)){gi(ke,b);continue}if(F&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!nt)switch(y.getAttributeType(Rg,xs)){case"TrustedHTML":{Ue=F.createHTML(Ue);break}case"TrustedScriptURL":{Ue=F.createScriptURL(Ue);break}}if(Ue!==_d)try{nt?b.setAttributeNS(nt,ke,Ue):b.setAttribute(ke,Ue),Sd(b)?Qt(b):_1(t.removed)}catch{gi(ke,b)}}On(he.afterSanitizeAttributes,b,null)},d_=function H(b){let I=null;const O=Ag(b);for(On(he.beforeSanitizeShadowDOM,b,null);I=O.nextNode();)On(he.uponSanitizeShadowNode,I,null),Eg(I),Tg(I),I.content instanceof s&&H(I.content);On(he.afterSanitizeShadowDOM,b,null)};return t.sanitize=function(H){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,O=null,fe=null,He=null;if(yd=!H,yd&&(H="<!-->"),typeof H!="string"&&!kg(H))if(typeof H.toString=="function"){if(H=H.toString(),typeof H!="string")throw Ta("dirty is not a string, aborting")}else throw Ta("toString is not a function");if(!t.isSupported)return H;if(pd||bd(b),t.removed=[],typeof H=="string"&&(ya=!1),ya){if(H.nodeName){const Mn=Re(H.nodeName);if(!Le[Mn]||va[Mn])throw Ta("root node is forbidden and cannot be sanitized in-place")}}else if(H instanceof l)I=_g("<!---->"),O=I.ownerDocument.importNode(H,!0),O.nodeType===Ia.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?I=O:I.appendChild(O);else{if(!$s&&!Cs&&!mi&&H.indexOf("<")===-1)return F&&Pc?F.createHTML(H):H;if(I=_g(H),!I)return $s?null:Pc?G:""}I&&fd&&Qt(I.firstChild);const ke=Ag(ya?H:I);for(;fe=ke.nextNode();)Eg(fe),Tg(fe),fe.content instanceof s&&d_(fe.content);if(ya)return H;if($s){if(xc)for(He=re.call(I.ownerDocument);I.firstChild;)He.appendChild(I.firstChild);else He=I;return(ze.shadowroot||ze.shadowrootmode)&&(He=Me.call(r,He,!0)),He}let nt=mi?I.outerHTML:I.innerHTML;return mi&&Le["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&qe(lS,I.ownerDocument.doctype.name)&&(nt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
361
- `+nt),Cs&&Xc([Ne,tt,Ut],Mn=>{nt=$a(nt,Mn," ")}),F&&Pc?F.createHTML(nt):nt},t.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bd(H),pd=!0},t.clearConfig=function(){Is=null,pd=!1},t.isValidAttribute=function(H,b,I){Is||bd({});const O=Re(H),fe=Re(b);return Cg(O,fe,I)},t.addHook=function(H,b){typeof b=="function"&&Ca(he[H],b)},t.removeHook=function(H,b){if(b!==void 0){const I=LN(he[H],b);return I===-1?void 0:DN(he[H],I,1)[0]}return _1(he[H])},t.removeHooks=function(H){he[H]=[]},t.removeAllHooks=function(){he=T1()},t}var uS=cS();function Wm(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ks=Wm();function hS(n){ks=n}var _i={exec:()=>null};function ne(n,t=""){let e=typeof n=="string"?n:n.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Xe.caret,"$1"),e=e.replace(i,a),r},getRegex:()=>new RegExp(e,t)};return r}var KN=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},XN=/^(?:[ \t]*(?:\n|$))+/,QN=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ez=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$c=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,tz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Gm=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,dS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,pS=ne(dS).replace(/bull/g,Gm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),nz=ne(dS).replace(/bull/g,Gm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ym=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,rz=/^[^\n]+/,Jm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,iz=ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Jm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),sz=ne(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Gm).getRegex(),cd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Km=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,oz=ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Km).replace("tag",cd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),fS=ne(Ym).replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex(),az=ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",fS).getRegex(),Xm={blockquote:az,code:QN,def:iz,fences:ez,heading:tz,hr:$c,html:oz,lheading:pS,list:sz,newline:XN,paragraph:fS,table:_i,text:rz},R1=ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex(),lz={...Xm,lheading:nz,table:R1,paragraph:ne(Ym).replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",R1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex()},cz={...Xm,html:ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Km).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ne(Ym).replace("hr",$c).replace("heading",` *#{1,6} *[^
362
- ]`).replace("lheading",pS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},uz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,hz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,mS=/^( {2,}|\\)\n(?!\s*$)/,dz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,ud=/[\s\p{P}\p{S}]/u,Qm=/[^\s\p{P}\p{S}]/u,pz=ne(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ud).getRegex(),gS=/(?!~)[\p{P}\p{S}]/u,fz=/(?!~)[\s\p{P}\p{S}]/u,mz=/(?:[^\s\p{P}\p{S}]|~)/u,gz=ne(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",KN?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),vS=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,vz=ne(vS,"u").replace(/punct/g,ga).getRegex(),yz=ne(vS,"u").replace(/punct/g,gS).getRegex(),yS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",wz=ne(yS,"gu").replace(/notPunctSpace/g,Qm).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),bz=ne(yS,"gu").replace(/notPunctSpace/g,mz).replace(/punctSpace/g,fz).replace(/punct/g,gS).getRegex(),Sz=ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Qm).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),_z=ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ga).getRegex(),Az="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",kz=ne(Az,"gu").replace(/notPunctSpace/g,Qm).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),Ez=ne(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),Cz=ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),$z=ne(Km).replace("(?:-->|$)","-->").getRegex(),Tz=ne("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",$z).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Rz=ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",lh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wS=ne(/^!?\[(label)\]\[(ref)\]/).replace("label",lh).replace("ref",Jm).getRegex(),bS=ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",Jm).getRegex(),Iz=ne("reflink|nolink(?!\\()","g").replace("reflink",wS).replace("nolink",bS).getRegex(),I1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,eg={_backpedal:_i,anyPunctuation:Ez,autolink:Cz,blockSkip:gz,br:mS,code:hz,del:_i,delLDelim:_i,delRDelim:_i,emStrongLDelim:vz,emStrongRDelimAst:wz,emStrongRDelimUnd:Sz,escape:uz,link:Rz,nolink:bS,punctuation:pz,reflink:wS,reflinkSearch:Iz,tag:Tz,text:dz,url:_i},xz={...eg,link:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",lh).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lh).getRegex()},xf={...eg,emStrongRDelimAst:bz,emStrongLDelim:yz,delLDelim:_z,delRDelim:kz,url:ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",I1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",I1).getRegex()},Pz={...xf,br:ne(mS).replace("{2,}","*").getRegex(),text:ne(xf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},eu={normal:Xm,gfm:lz,pedantic:cz},xa={normal:eg,gfm:xf,breaks:Pz,pedantic:xz},Lz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},x1=n=>Lz[n];function on(n,t){if(t){if(Xe.escapeTest.test(n))return n.replace(Xe.escapeReplace,x1)}else if(Xe.escapeTestNoEncode.test(n))return n.replace(Xe.escapeReplaceNoEncode,x1);return n}function P1(n){try{n=encodeURI(n).replace(Xe.percentDecode,"%")}catch{return null}return n}function L1(n,t){var s;let e=n.replace(Xe.findPipe,(a,l,c)=>{let u=!1,p=l;for(;--p>=0&&c[p]==="\\";)u=!u;return u?"|":" |"}),r=e.split(Xe.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Xe.slashPipe,"|");return r}function Pa(n,t,e){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===t;)i++;return n.slice(0,r-i)}function Dz(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===t[0])e++;else if(n[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function Oz(n,t=0){let e=t,r="";for(let i of n)if(i===" "){let s=4-e%4;r+=" ".repeat(s),e+=s}else r+=i,e++;return r}function D1(n,t,e,r,i){let s=t.href,a=t.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:s,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function Mz(n,t,e){let r=n.match(e.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
360
+ */class If extends Ec{constructor(t){if(super(t),this.it=ie,t.type!==In.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===ie||t==null)return this._t=void 0,this.it=t;if(t===Ke)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}If.directiveName="unsafeHTML",If.resultType=1;const cS=ma(If);/*! @license DOMPurify 3.3.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.3/LICENSE */const{entries:uS,setPrototypeOf:E1,isFrozen:LN,getPrototypeOf:DN,getOwnPropertyDescriptor:ON}=Object;let{freeze:Qe,seal:Ot,create:Nu}=Object,{apply:xf,construct:Pf}=typeof Reflect<"u"&&Reflect;Qe||(Qe=function(t){return t});Ot||(Ot=function(t){return t});xf||(xf=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return t.apply(e,i)});Pf||(Pf=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const Xc=et(Array.prototype.forEach),MN=et(Array.prototype.lastIndexOf),C1=et(Array.prototype.pop),Ca=et(Array.prototype.push),NN=et(Array.prototype.splice),zu=et(String.prototype.toLowerCase),up=et(String.prototype.toString),hp=et(String.prototype.match),$a=et(String.prototype.replace),zN=et(String.prototype.indexOf),UN=et(String.prototype.trim),ht=et(Object.prototype.hasOwnProperty),qe=et(RegExp.prototype.test),Ta=FN(TypeError);function et(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return xf(n,t,r)}}function FN(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return Pf(n,e)}}function X(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:zu;E1&&E1(n,null);let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const s=e(i);s!==i&&(LN(t)||(t[r]=s),i=s)}n[i]=!0}return n}function ZN(n){for(let t=0;t<n.length;t++)ht(n,t)||(n[t]=null);return n}function sn(n){const t=Nu(null);for(const[e,r]of uS(n))ht(n,e)&&(Array.isArray(r)?t[e]=ZN(r):r&&typeof r=="object"&&r.constructor===Object?t[e]=sn(r):t[e]=r);return t}function Ra(n,t){for(;n!==null;){const r=ON(n,t);if(r){if(r.get)return et(r.get);if(typeof r.value=="function")return et(r.value)}n=DN(n)}function e(){return null}return e}const $1=Qe(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),dp=Qe(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),pp=Qe(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),HN=Qe(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fp=Qe(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),VN=Qe(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),T1=Qe(["#text"]),R1=Qe(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),mp=Qe(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),I1=Qe(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qc=Qe(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),BN=Ot(/\{\{[\w\W]*|[\w\W]*\}\}/gm),qN=Ot(/<%[\w\W]*|[\w\W]*%>/gm),jN=Ot(/\$\{[\w\W]*/gm),WN=Ot(/^data-[\-\w.\u00B7-\uFFFF]+$/),GN=Ot(/^aria-[\-\w]+$/),hS=Ot(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),YN=Ot(/^(?:\w+script|data):/i),JN=Ot(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dS=Ot(/^html$/i),KN=Ot(/^[a-z][.\w]*(-[.\w]+)+$/i);var x1=Object.freeze({__proto__:null,ARIA_ATTR:GN,ATTR_WHITESPACE:JN,CUSTOM_ELEMENT:KN,DATA_ATTR:WN,DOCTYPE_NAME:dS,ERB_EXPR:qN,IS_ALLOWED_URI:hS,IS_SCRIPT_OR_DATA:YN,MUSTACHE_EXPR:BN,TMPLIT_EXPR:jN});const Ia={element:1,text:3,progressingInstruction:7,comment:8,document:9},XN=function(){return typeof window>"u"?null:window},QN=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const s="dompurify"+(r?"#"+r:"");try{return t.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},P1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function pS(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:XN();const t=H=>pS(H);if(t.version="3.3.3",t.removed=[],!n||!n.document||n.document.nodeType!==Ia.document||!n.Element)return t.isSupported=!1,t;let{document:e}=n;const r=e,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:a,Node:l,Element:c,NodeFilter:u,NamedNodeMap:p=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:m,DOMParser:v,trustedTypes:y}=n,k=c.prototype,A=Ra(k,"cloneNode"),x=Ra(k,"remove"),L=Ra(k,"nextSibling"),D=Ra(k,"childNodes"),V=Ra(k,"parentNode");if(typeof a=="function"){const H=e.createElement("template");H.content&&H.content.ownerDocument&&(e=H.content.ownerDocument)}let F,G="";const{implementation:z,createNodeIterator:J,createDocumentFragment:re,getElementsByTagName:_t}=e,{importNode:Me}=r;let he=P1();t.isSupported=typeof uS=="function"&&typeof V=="function"&&z&&z.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Ne,ERB_EXPR:tt,TMPLIT_EXPR:Ut,DATA_ATTR:Es,ARIA_ATTR:Tc,IS_SCRIPT_OR_DATA:a_,ATTR_WHITESPACE:cg,CUSTOM_ELEMENT:l_}=x1;let{IS_ALLOWED_URI:ug}=x1,Le=null;const hg=X({},[...$1,...dp,...pp,...fp,...T1]);let ze=null;const dg=X({},[...R1,...mp,...I1,...Qc]);let _e=Object.seal(Nu(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),va=null,Rc=null;const wr=Object.seal(Nu(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let pg=!0,dd=!0,fg=!1,mg=!0,Cs=!1,Ic=!0,mi=!1,pd=!1,fd=!1,$s=!1,xc=!1,Pc=!1,gg=!0,vg=!1;const c_="user-content-";let md=!0,ya=!1,Ts={},Xt=null;const gd=X({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let yg=null;const wg=X({},["audio","video","img","source","image","track"]);let vd=null;const bg=X({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Lc="http://www.w3.org/1998/Math/MathML",Dc="http://www.w3.org/2000/svg",Dn="http://www.w3.org/1999/xhtml";let Rs=Dn,yd=!1,wd=null;const u_=X({},[Lc,Dc,Dn],up);let Oc=X({},["mi","mo","mn","ms","mtext"]),Mc=X({},["annotation-xml"]);const h_=X({},["title","style","font","a","script"]);let wa=null;const d_=["application/xhtml+xml","text/html"],p_="text/html";let Re=null,Is=null;const f_=e.createElement("form"),Sg=function(b){return b instanceof RegExp||b instanceof Function},bd=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Is&&Is===b)){if((!b||typeof b!="object")&&(b={}),b=sn(b),wa=d_.indexOf(b.PARSER_MEDIA_TYPE)===-1?p_:b.PARSER_MEDIA_TYPE,Re=wa==="application/xhtml+xml"?up:zu,Le=ht(b,"ALLOWED_TAGS")?X({},b.ALLOWED_TAGS,Re):hg,ze=ht(b,"ALLOWED_ATTR")?X({},b.ALLOWED_ATTR,Re):dg,wd=ht(b,"ALLOWED_NAMESPACES")?X({},b.ALLOWED_NAMESPACES,up):u_,vd=ht(b,"ADD_URI_SAFE_ATTR")?X(sn(bg),b.ADD_URI_SAFE_ATTR,Re):bg,yg=ht(b,"ADD_DATA_URI_TAGS")?X(sn(wg),b.ADD_DATA_URI_TAGS,Re):wg,Xt=ht(b,"FORBID_CONTENTS")?X({},b.FORBID_CONTENTS,Re):gd,va=ht(b,"FORBID_TAGS")?X({},b.FORBID_TAGS,Re):sn({}),Rc=ht(b,"FORBID_ATTR")?X({},b.FORBID_ATTR,Re):sn({}),Ts=ht(b,"USE_PROFILES")?b.USE_PROFILES:!1,pg=b.ALLOW_ARIA_ATTR!==!1,dd=b.ALLOW_DATA_ATTR!==!1,fg=b.ALLOW_UNKNOWN_PROTOCOLS||!1,mg=b.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Cs=b.SAFE_FOR_TEMPLATES||!1,Ic=b.SAFE_FOR_XML!==!1,mi=b.WHOLE_DOCUMENT||!1,$s=b.RETURN_DOM||!1,xc=b.RETURN_DOM_FRAGMENT||!1,Pc=b.RETURN_TRUSTED_TYPE||!1,fd=b.FORCE_BODY||!1,gg=b.SANITIZE_DOM!==!1,vg=b.SANITIZE_NAMED_PROPS||!1,md=b.KEEP_CONTENT!==!1,ya=b.IN_PLACE||!1,ug=b.ALLOWED_URI_REGEXP||hS,Rs=b.NAMESPACE||Dn,Oc=b.MATHML_TEXT_INTEGRATION_POINTS||Oc,Mc=b.HTML_INTEGRATION_POINTS||Mc,_e=b.CUSTOM_ELEMENT_HANDLING||{},b.CUSTOM_ELEMENT_HANDLING&&Sg(b.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(_e.tagNameCheck=b.CUSTOM_ELEMENT_HANDLING.tagNameCheck),b.CUSTOM_ELEMENT_HANDLING&&Sg(b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(_e.attributeNameCheck=b.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),b.CUSTOM_ELEMENT_HANDLING&&typeof b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(_e.allowCustomizedBuiltInElements=b.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Cs&&(dd=!1),xc&&($s=!0),Ts&&(Le=X({},T1),ze=Nu(null),Ts.html===!0&&(X(Le,$1),X(ze,R1)),Ts.svg===!0&&(X(Le,dp),X(ze,mp),X(ze,Qc)),Ts.svgFilters===!0&&(X(Le,pp),X(ze,mp),X(ze,Qc)),Ts.mathMl===!0&&(X(Le,fp),X(ze,I1),X(ze,Qc))),ht(b,"ADD_TAGS")||(wr.tagCheck=null),ht(b,"ADD_ATTR")||(wr.attributeCheck=null),b.ADD_TAGS&&(typeof b.ADD_TAGS=="function"?wr.tagCheck=b.ADD_TAGS:(Le===hg&&(Le=sn(Le)),X(Le,b.ADD_TAGS,Re))),b.ADD_ATTR&&(typeof b.ADD_ATTR=="function"?wr.attributeCheck=b.ADD_ATTR:(ze===dg&&(ze=sn(ze)),X(ze,b.ADD_ATTR,Re))),b.ADD_URI_SAFE_ATTR&&X(vd,b.ADD_URI_SAFE_ATTR,Re),b.FORBID_CONTENTS&&(Xt===gd&&(Xt=sn(Xt)),X(Xt,b.FORBID_CONTENTS,Re)),b.ADD_FORBID_CONTENTS&&(Xt===gd&&(Xt=sn(Xt)),X(Xt,b.ADD_FORBID_CONTENTS,Re)),md&&(Le["#text"]=!0),mi&&X(Le,["html","head","body"]),Le.table&&(X(Le,["tbody"]),delete va.tbody),b.TRUSTED_TYPES_POLICY){if(typeof b.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof b.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ta('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');F=b.TRUSTED_TYPES_POLICY,G=F.createHTML("")}else F===void 0&&(F=QN(y,i)),F!==null&&typeof G=="string"&&(G=F.createHTML(""));Qe&&Qe(b),Is=b}},_g=X({},[...dp,...pp,...HN]),Ag=X({},[...fp,...VN]),m_=function(b){let I=V(b);(!I||!I.tagName)&&(I={namespaceURI:Rs,tagName:"template"});const O=zu(b.tagName),fe=zu(I.tagName);return wd[b.namespaceURI]?b.namespaceURI===Dc?I.namespaceURI===Dn?O==="svg":I.namespaceURI===Lc?O==="svg"&&(fe==="annotation-xml"||Oc[fe]):!!_g[O]:b.namespaceURI===Lc?I.namespaceURI===Dn?O==="math":I.namespaceURI===Dc?O==="math"&&Mc[fe]:!!Ag[O]:b.namespaceURI===Dn?I.namespaceURI===Dc&&!Mc[fe]||I.namespaceURI===Lc&&!Oc[fe]?!1:!Ag[O]&&(h_[O]||!_g[O]):!!(wa==="application/xhtml+xml"&&wd[b.namespaceURI]):!1},Qt=function(b){Ca(t.removed,{element:b});try{V(b).removeChild(b)}catch{x(b)}},gi=function(b,I){try{Ca(t.removed,{attribute:I.getAttributeNode(b),from:I})}catch{Ca(t.removed,{attribute:null,from:I})}if(I.removeAttribute(b),b==="is")if($s||xc)try{Qt(I)}catch{}else try{I.setAttribute(b,"")}catch{}},kg=function(b){let I=null,O=null;if(fd)b="<remove></remove>"+b;else{const ke=hp(b,/^[\r\n\t ]+/);O=ke&&ke[0]}wa==="application/xhtml+xml"&&Rs===Dn&&(b='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+b+"</body></html>");const fe=F?F.createHTML(b):b;if(Rs===Dn)try{I=new v().parseFromString(fe,wa)}catch{}if(!I||!I.documentElement){I=z.createDocument(Rs,"template",null);try{I.documentElement.innerHTML=yd?G:fe}catch{}}const He=I.body||I.documentElement;return b&&O&&He.insertBefore(e.createTextNode(O),He.childNodes[0]||null),Rs===Dn?_t.call(I,mi?"html":"body")[0]:mi?I.documentElement:He},Eg=function(b){return J.call(b.ownerDocument||b,b,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Sd=function(b){return b instanceof m&&(typeof b.nodeName!="string"||typeof b.textContent!="string"||typeof b.removeChild!="function"||!(b.attributes instanceof p)||typeof b.removeAttribute!="function"||typeof b.setAttribute!="function"||typeof b.namespaceURI!="string"||typeof b.insertBefore!="function"||typeof b.hasChildNodes!="function")},Cg=function(b){return typeof l=="function"&&b instanceof l};function On(H,b,I){Xc(H,O=>{O.call(t,b,I,Is)})}const $g=function(b){let I=null;if(On(he.beforeSanitizeElements,b,null),Sd(b))return Qt(b),!0;const O=Re(b.nodeName);if(On(he.uponSanitizeElement,b,{tagName:O,allowedTags:Le}),Ic&&b.hasChildNodes()&&!Cg(b.firstElementChild)&&qe(/<[/\w!]/g,b.innerHTML)&&qe(/<[/\w!]/g,b.textContent)||b.nodeType===Ia.progressingInstruction||Ic&&b.nodeType===Ia.comment&&qe(/<[/\w]/g,b.data))return Qt(b),!0;if(!(wr.tagCheck instanceof Function&&wr.tagCheck(O))&&(!Le[O]||va[O])){if(!va[O]&&Rg(O)&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,O)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(O)))return!1;if(md&&!Xt[O]){const fe=V(b)||b.parentNode,He=D(b)||b.childNodes;if(He&&fe){const ke=He.length;for(let nt=ke-1;nt>=0;--nt){const Mn=A(He[nt],!0);Mn.__removalCount=(b.__removalCount||0)+1,fe.insertBefore(Mn,L(b))}}}return Qt(b),!0}return b instanceof c&&!m_(b)||(O==="noscript"||O==="noembed"||O==="noframes")&&qe(/<\/no(script|embed|frames)/i,b.innerHTML)?(Qt(b),!0):(Cs&&b.nodeType===Ia.text&&(I=b.textContent,Xc([Ne,tt,Ut],fe=>{I=$a(I,fe," ")}),b.textContent!==I&&(Ca(t.removed,{element:b.cloneNode()}),b.textContent=I)),On(he.afterSanitizeElements,b,null),!1)},Tg=function(b,I,O){if(Rc[I]||gg&&(I==="id"||I==="name")&&(O in e||O in f_))return!1;if(!(dd&&!Rc[I]&&qe(Es,I))){if(!(pg&&qe(Tc,I))){if(!(wr.attributeCheck instanceof Function&&wr.attributeCheck(I,b))){if(!ze[I]||Rc[I]){if(!(Rg(b)&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,b)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(b))&&(_e.attributeNameCheck instanceof RegExp&&qe(_e.attributeNameCheck,I)||_e.attributeNameCheck instanceof Function&&_e.attributeNameCheck(I,b))||I==="is"&&_e.allowCustomizedBuiltInElements&&(_e.tagNameCheck instanceof RegExp&&qe(_e.tagNameCheck,O)||_e.tagNameCheck instanceof Function&&_e.tagNameCheck(O))))return!1}else if(!vd[I]){if(!qe(ug,$a(O,cg,""))){if(!((I==="src"||I==="xlink:href"||I==="href")&&b!=="script"&&zN(O,"data:")===0&&yg[b])){if(!(fg&&!qe(a_,$a(O,cg,"")))){if(O)return!1}}}}}}}return!0},Rg=function(b){return b!=="annotation-xml"&&hp(b,l_)},Ig=function(b){On(he.beforeSanitizeAttributes,b,null);const{attributes:I}=b;if(!I||Sd(b))return;const O={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ze,forceKeepAttr:void 0};let fe=I.length;for(;fe--;){const He=I[fe],{name:ke,namespaceURI:nt,value:Mn}=He,xs=Re(ke),_d=Mn;let Ue=ke==="value"?_d:UN(_d);if(O.attrName=xs,O.attrValue=Ue,O.keepAttr=!0,O.forceKeepAttr=void 0,On(he.uponSanitizeAttribute,b,O),Ue=O.attrValue,vg&&(xs==="id"||xs==="name")&&(gi(ke,b),Ue=c_+Ue),Ic&&qe(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Ue)){gi(ke,b);continue}if(xs==="attributename"&&hp(Ue,"href")){gi(ke,b);continue}if(O.forceKeepAttr)continue;if(!O.keepAttr){gi(ke,b);continue}if(!mg&&qe(/\/>/i,Ue)){gi(ke,b);continue}Cs&&Xc([Ne,tt,Ut],Pg=>{Ue=$a(Ue,Pg," ")});const xg=Re(b.nodeName);if(!Tg(xg,xs,Ue)){gi(ke,b);continue}if(F&&typeof y=="object"&&typeof y.getAttributeType=="function"&&!nt)switch(y.getAttributeType(xg,xs)){case"TrustedHTML":{Ue=F.createHTML(Ue);break}case"TrustedScriptURL":{Ue=F.createScriptURL(Ue);break}}if(Ue!==_d)try{nt?b.setAttributeNS(nt,ke,Ue):b.setAttribute(ke,Ue),Sd(b)?Qt(b):C1(t.removed)}catch{gi(ke,b)}}On(he.afterSanitizeAttributes,b,null)},g_=function H(b){let I=null;const O=Eg(b);for(On(he.beforeSanitizeShadowDOM,b,null);I=O.nextNode();)On(he.uponSanitizeShadowNode,I,null),$g(I),Ig(I),I.content instanceof s&&H(I.content);On(he.afterSanitizeShadowDOM,b,null)};return t.sanitize=function(H){let b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=null,O=null,fe=null,He=null;if(yd=!H,yd&&(H="<!-->"),typeof H!="string"&&!Cg(H))if(typeof H.toString=="function"){if(H=H.toString(),typeof H!="string")throw Ta("dirty is not a string, aborting")}else throw Ta("toString is not a function");if(!t.isSupported)return H;if(pd||bd(b),t.removed=[],typeof H=="string"&&(ya=!1),ya){if(H.nodeName){const Mn=Re(H.nodeName);if(!Le[Mn]||va[Mn])throw Ta("root node is forbidden and cannot be sanitized in-place")}}else if(H instanceof l)I=kg("<!---->"),O=I.ownerDocument.importNode(H,!0),O.nodeType===Ia.element&&O.nodeName==="BODY"||O.nodeName==="HTML"?I=O:I.appendChild(O);else{if(!$s&&!Cs&&!mi&&H.indexOf("<")===-1)return F&&Pc?F.createHTML(H):H;if(I=kg(H),!I)return $s?null:Pc?G:""}I&&fd&&Qt(I.firstChild);const ke=Eg(ya?H:I);for(;fe=ke.nextNode();)$g(fe),Ig(fe),fe.content instanceof s&&g_(fe.content);if(ya)return H;if($s){if(xc)for(He=re.call(I.ownerDocument);I.firstChild;)He.appendChild(I.firstChild);else He=I;return(ze.shadowroot||ze.shadowrootmode)&&(He=Me.call(r,He,!0)),He}let nt=mi?I.outerHTML:I.innerHTML;return mi&&Le["!doctype"]&&I.ownerDocument&&I.ownerDocument.doctype&&I.ownerDocument.doctype.name&&qe(dS,I.ownerDocument.doctype.name)&&(nt="<!DOCTYPE "+I.ownerDocument.doctype.name+`>
361
+ `+nt),Cs&&Xc([Ne,tt,Ut],Mn=>{nt=$a(nt,Mn," ")}),F&&Pc?F.createHTML(nt):nt},t.setConfig=function(){let H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};bd(H),pd=!0},t.clearConfig=function(){Is=null,pd=!1},t.isValidAttribute=function(H,b,I){Is||bd({});const O=Re(H),fe=Re(b);return Tg(O,fe,I)},t.addHook=function(H,b){typeof b=="function"&&Ca(he[H],b)},t.removeHook=function(H,b){if(b!==void 0){const I=MN(he[H],b);return I===-1?void 0:NN(he[H],I,1)[0]}return C1(he[H])},t.removeHooks=function(H){he[H]=[]},t.removeAllHooks=function(){he=P1()},t}var fS=pS();function Ym(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ks=Ym();function mS(n){ks=n}var _i={exec:()=>null};function ne(n,t=""){let e=typeof n=="string"?n:n.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(Xe.caret,"$1"),e=e.replace(i,a),r},getRegex:()=>new RegExp(e,t)};return r}var ez=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Xe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},tz=/^(?:[ \t]*(?:\n|$))+/,nz=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rz=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,$c=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,iz=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jm=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,vS=ne(gS).replace(/bull/g,Jm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sz=ne(gS).replace(/bull/g,Jm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Km=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,oz=/^[^\n]+/,Xm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,az=ne(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Xm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),lz=ne(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Jm).getRegex(),cd="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Qm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,cz=ne("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Qm).replace("tag",cd).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),yS=ne(Km).replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex(),uz=ne(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",yS).getRegex(),eg={blockquote:uz,code:nz,def:az,fences:rz,heading:iz,hr:$c,html:cz,lheading:vS,list:lz,newline:tz,paragraph:yS,table:_i,text:oz},L1=ne("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex(),hz={...eg,lheading:sz,table:L1,paragraph:ne(Km).replace("hr",$c).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",L1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",cd).getRegex()},dz={...eg,html:ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Qm).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_i,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ne(Km).replace("hr",$c).replace("heading",` *#{1,6} *[^
362
+ ]`).replace("lheading",vS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},pz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,wS=/^( {2,}|\\)\n(?!\s*$)/,mz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ga=/[\p{P}\p{S}]/u,ud=/[\s\p{P}\p{S}]/u,tg=/[^\s\p{P}\p{S}]/u,gz=ne(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ud).getRegex(),bS=/(?!~)[\p{P}\p{S}]/u,vz=/(?!~)[\s\p{P}\p{S}]/u,yz=/(?:[^\s\p{P}\p{S}]|~)/u,wz=ne(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ez?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),SS=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,bz=ne(SS,"u").replace(/punct/g,ga).getRegex(),Sz=ne(SS,"u").replace(/punct/g,bS).getRegex(),_S="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",_z=ne(_S,"gu").replace(/notPunctSpace/g,tg).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),Az=ne(_S,"gu").replace(/notPunctSpace/g,yz).replace(/punctSpace/g,vz).replace(/punct/g,bS).getRegex(),kz=ne("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,tg).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),Ez=ne(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,ga).getRegex(),Cz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",$z=ne(Cz,"gu").replace(/notPunctSpace/g,tg).replace(/punctSpace/g,ud).replace(/punct/g,ga).getRegex(),Tz=ne(/\\(punct)/,"gu").replace(/punct/g,ga).getRegex(),Rz=ne(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Iz=ne(Qm).replace("(?:-->|$)","-->").getRegex(),xz=ne("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Iz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),lh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Pz=ne(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",lh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),AS=ne(/^!?\[(label)\]\[(ref)\]/).replace("label",lh).replace("ref",Xm).getRegex(),kS=ne(/^!?\[(ref)\](?:\[\])?/).replace("ref",Xm).getRegex(),Lz=ne("reflink|nolink(?!\\()","g").replace("reflink",AS).replace("nolink",kS).getRegex(),D1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,ng={_backpedal:_i,anyPunctuation:Tz,autolink:Rz,blockSkip:wz,br:wS,code:fz,del:_i,delLDelim:_i,delRDelim:_i,emStrongLDelim:bz,emStrongRDelimAst:_z,emStrongRDelimUnd:kz,escape:pz,link:Pz,nolink:kS,punctuation:gz,reflink:AS,reflinkSearch:Lz,tag:xz,text:mz,url:_i},Dz={...ng,link:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",lh).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",lh).getRegex()},Lf={...ng,emStrongRDelimAst:Az,emStrongLDelim:Sz,delLDelim:Ez,delRDelim:$z,url:ne(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",D1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ne(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",D1).getRegex()},Oz={...Lf,br:ne(wS).replace("{2,}","*").getRegex(),text:ne(Lf.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},eu={normal:eg,gfm:hz,pedantic:dz},xa={normal:ng,gfm:Lf,breaks:Oz,pedantic:Dz},Mz={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},O1=n=>Mz[n];function on(n,t){if(t){if(Xe.escapeTest.test(n))return n.replace(Xe.escapeReplace,O1)}else if(Xe.escapeTestNoEncode.test(n))return n.replace(Xe.escapeReplaceNoEncode,O1);return n}function M1(n){try{n=encodeURI(n).replace(Xe.percentDecode,"%")}catch{return null}return n}function N1(n,t){var s;let e=n.replace(Xe.findPipe,(a,l,c)=>{let u=!1,p=l;for(;--p>=0&&c[p]==="\\";)u=!u;return u?"|":" |"}),r=e.split(Xe.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((s=r.at(-1))!=null&&s.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Xe.slashPipe,"|");return r}function Pa(n,t,e){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===t;)i++;return n.slice(0,r-i)}function Nz(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===t[0])e++;else if(n[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function zz(n,t=0){let e=t,r="";for(let i of n)if(i===" "){let s=4-e%4;r+=" ".repeat(s),e+=s}else r+=i,e++;return r}function z1(n,t,e,r,i){let s=t.href,a=t.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:s,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function Uz(n,t,e){let r=n.match(e.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
363
363
  `).map(s=>{let a=s.match(e.other.beginningSpace);if(a===null)return s;let[l]=a;return l.length>=i.length?s.slice(i.length):s}).join(`
364
364
  `)}var ch=class{constructor(n){C(this,"options");C(this,"rules");C(this,"lexer");this.options=n||ks}space(n){let t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){let t=this.rules.block.code.exec(n);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Pa(e,`
365
- `)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],r=Mz(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=Pa(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:Pa(t[0],`
365
+ `)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],r=Uz(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=Pa(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:Pa(t[0],`
366
366
  `)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=Pa(t[0],`
367
367
  `).split(`
368
368
  `),r="",i="",s=[];for(;e.length>0;){let a=!1,l=[],c;for(c=0;c<e.length;c++)if(this.rules.other.blockquoteStart.test(e[c]))l.push(e[c]),a=!0;else if(!a)l.push(e[c]);else break;e=e.slice(c);let u=l.join(`
@@ -374,16 +374,16 @@ ${p}`:p;let m=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
374
374
  `),A=this.blockquote(k);s[s.length-1]=A,r=r.substring(0,r.length-y.raw.length)+A.raw,i=i.substring(0,i.length-y.text.length)+A.text;break}else if((v==null?void 0:v.type)==="list"){let y=v,k=y.raw+`
375
375
  `+e.join(`
376
376
  `),A=this.list(k);s[s.length-1]=A,r=r.substring(0,r.length-v.raw.length)+A.raw,i=i.substring(0,i.length-y.raw.length)+A.raw,e=k.substring(s.at(-1).raw.length).split(`
377
- `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){var e,r;let t=this.rules.block.list.exec(n);if(t){let i=t[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let p=!1,m="",v="";if(!(t=l.exec(n))||this.rules.block.hr.test(n))break;m=t[0],n=n.substring(m.length);let y=Oz(t[2].split(`
377
+ `);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(n){var e,r;let t=this.rules.block.list.exec(n);if(t){let i=t[1].trim(),s=i.length>1,a={type:"list",raw:"",ordered:s,start:s?+i.slice(0,-1):"",loose:!1,items:[]};i=s?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=s?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let p=!1,m="",v="";if(!(t=l.exec(n))||this.rules.block.hr.test(n))break;m=t[0],n=n.substring(m.length);let y=zz(t[2].split(`
378
378
  `,1)[0],t[1].length),k=n.split(`
379
379
  `,1)[0],A=!y.trim(),x=0;if(this.options.pedantic?(x=2,v=y.trimStart()):A?x=t[1].length+1:(x=y.search(this.rules.other.nonSpaceChar),x=x>4?1:x,v=y.slice(x),x+=t[1].length),A&&this.rules.other.blankLine.test(k)&&(m+=k+`
380
380
  `,n=n.substring(k.length+1),p=!0),!p){let L=this.rules.other.nextBulletRegex(x),D=this.rules.other.hrRegex(x),V=this.rules.other.fencesBeginRegex(x),F=this.rules.other.headingBeginRegex(x),G=this.rules.other.htmlBeginRegex(x),z=this.rules.other.blockquoteBeginRegex(x);for(;n;){let J=n.split(`
381
381
  `,1)[0],re;if(k=J,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),re=k):re=k.replace(this.rules.other.tabCharGlobal," "),V.test(k)||F.test(k)||G.test(k)||z.test(k)||L.test(k)||D.test(k))break;if(re.search(this.rules.other.nonSpaceChar)>=x||!k.trim())v+=`
382
382
  `+re.slice(x);else{if(A||y.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||V.test(y)||F.test(y)||D.test(y))break;v+=`
383
383
  `+k}A=!k.trim(),m+=J+`
384
- `,n=n.substring(J.length+1),y=re.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),a.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(v),loose:!1,text:v,tokens:[]}),a.raw+=m}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p of a.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((e=p.tokens[0])==null?void 0:e.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(p.raw);if(m){let v={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};p.checked=v.checked,a.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=v.raw+p.tokens[0].raw,p.tokens[0].text=v.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(v)):p.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):p.tokens.unshift(v)}}if(!a.loose){let m=p.tokens.filter(y=>y.type==="space"),v=m.length>0&&m.some(y=>this.rules.other.anyLine.test(y.raw));a.loose=v}}if(a.loose)for(let p of a.items){p.loose=!0;for(let m of p.tokens)m.type==="text"&&(m.type="paragraph")}return a}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:i}}}table(n){var a;let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=L1(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
385
- `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<e.length;l++)s.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(L1(l,s.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[u]})));return s}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
386
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let s=Pa(e.slice(0,-1),"\\");if((e.length-s.length)%2===0)return}else{let s=Dz(t[2],"()");if(s===-2)return;if(s>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),D1(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return D1(e,i,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+i);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let p=[...r[0]][0].length,m=n.slice(0,i+r.index+p+a);if(Math.min(i,a)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n,t,e=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*n.length+i);(r=c.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(a=[...s].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let u=[...r[0]][0].length,p=n.slice(0,i+r.index+u+a),m=p.slice(i,-i);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(n){var e;let t;if(t=this.rules.inline.url.exec(n)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let s;do s=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(s!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Wt=class Pf{constructor(t){C(this,"tokens");C(this,"options");C(this,"state");C(this,"inlineQueue");C(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ks,this.options.tokenizer=this.options.tokenizer||new ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Xe,block:eu.normal,inline:xa.normal};this.options.pedantic?(e.block=eu.pedantic,e.inline=xa.pedantic):this.options.gfm&&(e.block=eu.gfm,this.options.breaks?e.inline=xa.breaks:e.inline=xa.gfm),this.tokenizer.rules=e}static get rules(){return{block:eu,inline:xa}}static lex(t,e){return new Pf(e).lex(t)}static lexInline(t,e){return new Pf(e).inlineTokens(t)}lex(t){t=t.replace(Xe.carriageReturn,`
384
+ `,n=n.substring(J.length+1),y=re.slice(x)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(m)&&(c=!0)),a.items.push({type:"list_item",raw:m,task:!!this.options.gfm&&this.rules.other.listIsTask.test(v),loose:!1,text:v,tokens:[]}),a.raw+=m}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let p of a.items){if(this.lexer.state.top=!1,p.tokens=this.lexer.blockTokens(p.text,[]),p.task){if(p.text=p.text.replace(this.rules.other.listReplaceTask,""),((e=p.tokens[0])==null?void 0:e.type)==="text"||((r=p.tokens[0])==null?void 0:r.type)==="paragraph"){p.tokens[0].raw=p.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),p.tokens[0].text=p.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let v=this.lexer.inlineQueue.length-1;v>=0;v--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[v].src)){this.lexer.inlineQueue[v].src=this.lexer.inlineQueue[v].src.replace(this.rules.other.listReplaceTask,"");break}}let m=this.rules.other.listTaskCheckbox.exec(p.raw);if(m){let v={type:"checkbox",raw:m[0]+" ",checked:m[0]!=="[ ]"};p.checked=v.checked,a.loose?p.tokens[0]&&["paragraph","text"].includes(p.tokens[0].type)&&"tokens"in p.tokens[0]&&p.tokens[0].tokens?(p.tokens[0].raw=v.raw+p.tokens[0].raw,p.tokens[0].text=v.raw+p.tokens[0].text,p.tokens[0].tokens.unshift(v)):p.tokens.unshift({type:"paragraph",raw:v.raw,text:v.raw,tokens:[v]}):p.tokens.unshift(v)}}if(!a.loose){let m=p.tokens.filter(y=>y.type==="space"),v=m.length>0&&m.some(y=>this.rules.other.anyLine.test(y.raw));a.loose=v}}if(a.loose)for(let p of a.items){p.loose=!0;for(let m of p.tokens)m.type==="text"&&(m.type="paragraph")}return a}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:i}}}table(n){var a;let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=N1(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
385
+ `):[],s={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?s.align.push("right"):this.rules.other.tableAlignCenter.test(l)?s.align.push("center"):this.rules.other.tableAlignLeft.test(l)?s.align.push("left"):s.align.push(null);for(let l=0;l<e.length;l++)s.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:s.align[l]});for(let l of i)s.rows.push(N1(l,s.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[u]})));return s}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
386
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let s=Pa(e.slice(0,-1),"\\");if((e.length-s.length)%2===0)return}else{let s=Nz(t[2],"()");if(s===-2)return;if(s>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+s;t[2]=t[2].substring(0,s),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),z1(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let s=e[0].charAt(0);return{type:"text",raw:s,text:s}}return z1(e,i,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+i);(r=u.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let p=[...r[0]][0].length,m=n.slice(0,i+r.index+p+a);if(Math.min(i,a)%2){let y=m.slice(1,-1);return{type:"em",raw:m,text:y,tokens:this.lexer.inlineTokens(y)}}let v=m.slice(2,-2);return{type:"strong",raw:m,text:v,tokens:this.lexer.inlineTokens(v)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n,t,e=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,s,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*n.length+i);(r=c.exec(t))!=null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(a=[...s].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let u=[...r[0]][0].length,p=n.slice(0,i+r.index+u+a),m=p.slice(i,-i);return{type:"del",raw:p,text:m,tokens:this.lexer.inlineTokens(m)}}}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(n){var e;let t;if(t=this.rules.inline.url.exec(n)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let s;do s=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(s!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Wt=class Df{constructor(t){C(this,"tokens");C(this,"options");C(this,"state");C(this,"inlineQueue");C(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||ks,this.options.tokenizer=this.options.tokenizer||new ch,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Xe,block:eu.normal,inline:xa.normal};this.options.pedantic?(e.block=eu.pedantic,e.inline=xa.pedantic):this.options.gfm&&(e.block=eu.gfm,this.options.breaks?e.inline=xa.breaks:e.inline=xa.gfm),this.tokenizer.rules=e}static get rules(){return{block:eu,inline:xa}}static lex(t,e){return new Df(e).lex(t)}static lexInline(t,e){return new Df(e).inlineTokens(t)}lex(t){t=t.replace(Xe.carriageReturn,`
387
387
  `),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let r=this.inlineQueue[e];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){var i,s,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Xe.tabCharGlobal," ").replace(Xe.spaceLine,""));t;){let l;if((s=(i=this.options.extensions)==null?void 0:i.block)!=null&&s.some(u=>(l=u.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let u=e.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
388
388
  `:e.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
389
389
  `)?"":`
@@ -415,12 +415,12 @@ ${this.parser.parse(n)}</blockquote>
415
415
  `}tablerow({text:n}){return`<tr>
416
416
  ${n}</tr>
417
417
  `}tablecell(n){let t=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
418
- `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${on(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let r=this.parser.parseInline(e),i=P1(n);if(i===null)return r;n=i;let s='<a href="'+n+'"';return t&&(s+=' title="'+on(t)+'"'),s+=">"+r+"</a>",s}image({href:n,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let i=P1(n);if(i===null)return on(e);n=i;let s=`<img src="${n}" alt="${on(e)}"`;return t&&(s+=` title="${on(t)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:on(n.text)}},tg=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Gt=class Lf{constructor(t){C(this,"options");C(this,"renderer");C(this,"textRenderer");this.options=t||ks,this.options.renderer=this.options.renderer||new uh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new tg}static parse(t,e){return new Lf(e).parse(t)}static parseInline(t,e){return new Lf(e).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let e="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){e+=u||"";continue}}let l=a;switch(l.type){case"space":{e+=this.renderer.space(l);break}case"hr":{e+=this.renderer.hr(l);break}case"heading":{e+=this.renderer.heading(l);break}case"code":{e+=this.renderer.code(l);break}case"table":{e+=this.renderer.table(l);break}case"blockquote":{e+=this.renderer.blockquote(l);break}case"list":{e+=this.renderer.list(l);break}case"checkbox":{e+=this.renderer.checkbox(l);break}case"html":{e+=this.renderer.html(l);break}case"def":{e+=this.renderer.def(l);break}case"paragraph":{e+=this.renderer.paragraph(l);break}case"text":{e+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return e}parseInline(t,e=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=e.text(c);break}case"html":{r+=e.html(c);break}case"link":{r+=e.link(c);break}case"image":{r+=e.image(c);break}case"checkbox":{r+=e.checkbox(c);break}case"strong":{r+=e.strong(c);break}case"em":{r+=e.em(c);break}case"codespan":{r+=e.codespan(c);break}case"br":{r+=e.br(c);break}case"del":{r+=e.del(c);break}case"text":{r+=e.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},ou,Wa=(ou=class{constructor(n){C(this,"options");C(this,"block");this.options=n||ks}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Wt.lex:Wt.lexInline}provideParser(){return this.block?Gt.parse:Gt.parseInline}},C(ou,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(ou,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ou),Nz=class{constructor(...n){C(this,"defaults",Wm());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",Gt);C(this,"Renderer",uh);C(this,"TextRenderer",tg);C(this,"Lexer",Wt);C(this,"Tokenizer",ch);C(this,"Hooks",Wa);this.use(...n)}walkTokens(n,t){var r,i;let e=[];for(let s of n)switch(e=e.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)e=e.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)e=e.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=s;e=e.concat(this.walkTokens(a.items,t));break}default:{let a=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);e=e.concat(this.walkTokens(c,t))}):a.tokens&&(e=e.concat(this.walkTokens(a.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),e.renderer){let i=this.defaults.renderer||new uh(this.defaults);for(let s in e.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=e.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}r.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new ch(this.defaults);for(let s in e.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=e.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new Wa;for(let s in e.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,l=e.hooks[a],c=i[a];Wa.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async&&Wa.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await l.call(i,u);return c.call(i,m)})();let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(i,u);return m===!1&&(m=await c.apply(i,u)),m})();let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,t){return Wt.lex(n,t??this.defaults)}parser(n,t){return Gt.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let r={...e},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer():n?Wt.lex:Wt.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?Gt.parse:Gt.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():n?Wt.lex:Wt.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?Gt.parse:Gt.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return s(a)}}}onError(n,t){return e=>{if(e.message+=`
419
- Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+on(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},bs=new Nz;function ue(n,t){return bs.parse(n,t)}ue.options=ue.setOptions=function(n){return bs.setOptions(n),ue.defaults=bs.defaults,hS(ue.defaults),ue};ue.getDefaults=Wm;ue.defaults=ks;ue.use=function(...n){return bs.use(...n),ue.defaults=bs.defaults,hS(ue.defaults),ue};ue.walkTokens=function(n,t){return bs.walkTokens(n,t)};ue.parseInline=bs.parseInline;ue.Parser=Gt;ue.parser=Gt.parse;ue.Renderer=uh;ue.TextRenderer=tg;ue.Lexer=Wt;ue.lexer=Wt.lex;ue.Tokenizer=ch;ue.Hooks=Wa;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Gt.parse;Wt.lex;uS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function SS(n){const t=ue.parse(n,{async:!1});return uS.sanitize(t,{USE_PROFILES:{html:!0}})}var ns,Kl;class zz extends bt{constructor(){super(...arguments);g(this,ns,null);g(this,Kl,xn())}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||o(this,ns)!==null)return;const e=((r=o(this,Kl).value)==null?void 0:r.querySelector("dialog"))??null;if(e===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,ns,ld(e,()=>{}))})}disconnected(){var e;(e=o(this,ns))==null||e.withdraw(),d(this,ns,null)}template(e){return B`
418
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${on(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let r=this.parser.parseInline(e),i=M1(n);if(i===null)return r;n=i;let s='<a href="'+n+'"';return t&&(s+=' title="'+on(t)+'"'),s+=">"+r+"</a>",s}image({href:n,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let i=M1(n);if(i===null)return on(e);n=i;let s=`<img src="${n}" alt="${on(e)}"`;return t&&(s+=` title="${on(t)}"`),s+=">",s}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:on(n.text)}},rg=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Gt=class Of{constructor(t){C(this,"options");C(this,"renderer");C(this,"textRenderer");this.options=t||ks,this.options.renderer=this.options.renderer||new uh,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new rg}static parse(t,e){return new Of(e).parse(t)}static parseInline(t,e){return new Of(e).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let e="";for(let s=0;s<t.length;s++){let a=t[s];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){e+=u||"";continue}}let l=a;switch(l.type){case"space":{e+=this.renderer.space(l);break}case"hr":{e+=this.renderer.hr(l);break}case"heading":{e+=this.renderer.heading(l);break}case"code":{e+=this.renderer.code(l);break}case"table":{e+=this.renderer.table(l);break}case"blockquote":{e+=this.renderer.blockquote(l);break}case"list":{e+=this.renderer.list(l);break}case"checkbox":{e+=this.renderer.checkbox(l);break}case"html":{e+=this.renderer.html(l);break}case"def":{e+=this.renderer.def(l);break}case"paragraph":{e+=this.renderer.paragraph(l);break}case"text":{e+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return e}parseInline(t,e=this.renderer){var i,s;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let l=t[a];if((s=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&s[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=e.text(c);break}case"html":{r+=e.html(c);break}case"link":{r+=e.link(c);break}case"image":{r+=e.image(c);break}case"checkbox":{r+=e.checkbox(c);break}case"strong":{r+=e.strong(c);break}case"em":{r+=e.em(c);break}case"codespan":{r+=e.codespan(c);break}case"br":{r+=e.br(c);break}case"del":{r+=e.del(c);break}case"text":{r+=e.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},ou,Wa=(ou=class{constructor(n){C(this,"options");C(this,"block");this.options=n||ks}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Wt.lex:Wt.lexInline}provideParser(){return this.block?Gt.parse:Gt.parseInline}},C(ou,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),C(ou,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),ou),Fz=class{constructor(...n){C(this,"defaults",Ym());C(this,"options",this.setOptions);C(this,"parse",this.parseMarkdown(!0));C(this,"parseInline",this.parseMarkdown(!1));C(this,"Parser",Gt);C(this,"Renderer",uh);C(this,"TextRenderer",rg);C(this,"Lexer",Wt);C(this,"Tokenizer",ch);C(this,"Hooks",Wa);this.use(...n)}walkTokens(n,t){var r,i;let e=[];for(let s of n)switch(e=e.concat(t.call(this,s)),s.type){case"table":{let a=s;for(let l of a.header)e=e.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)e=e.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=s;e=e.concat(this.walkTokens(a.items,t));break}default:{let a=s;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);e=e.concat(this.walkTokens(c,t))}):a.tokens&&(e=e.concat(this.walkTokens(a.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=s.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),e.renderer){let i=this.defaults.renderer||new uh(this.defaults);for(let s in e.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,l=e.renderer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p||""}}r.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new ch(this.defaults);for(let s in e.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,l=e.tokenizer[a],c=i[a];i[a]=(...u)=>{let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new Wa;for(let s in e.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,l=e.hooks[a],c=i[a];Wa.passThroughHooks.has(s)?i[a]=u=>{if(this.defaults.async&&Wa.passThroughHooksRespectAsync.has(s))return(async()=>{let m=await l.call(i,u);return c.call(i,m)})();let p=l.call(i,u);return c.call(i,p)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let m=await l.apply(i,u);return m===!1&&(m=await c.apply(i,u)),m})();let p=l.apply(i,u);return p===!1&&(p=c.apply(i,u)),p}}r.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,s=e.walkTokens;r.walkTokens=function(a){let l=[];return l.push(s.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,t){return Wt.lex(n,t??this.defaults)}parser(n,t){return Gt.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let r={...e},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer():n?Wt.lex:Wt.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?Gt.parse:Gt.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():n?Wt.lex:Wt.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?Gt.parse:Gt.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return s(a)}}}onError(n,t){return e=>{if(e.message+=`
419
+ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+on(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},bs=new Fz;function ue(n,t){return bs.parse(n,t)}ue.options=ue.setOptions=function(n){return bs.setOptions(n),ue.defaults=bs.defaults,mS(ue.defaults),ue};ue.getDefaults=Ym;ue.defaults=ks;ue.use=function(...n){return bs.use(...n),ue.defaults=bs.defaults,mS(ue.defaults),ue};ue.walkTokens=function(n,t){return bs.walkTokens(n,t)};ue.parseInline=bs.parseInline;ue.Parser=Gt;ue.parser=Gt.parse;ue.Renderer=uh;ue.TextRenderer=rg;ue.Lexer=Wt;ue.lexer=Wt.lex;ue.Tokenizer=ch;ue.Hooks=Wa;ue.parse=ue;ue.options;ue.setOptions;ue.use;ue.walkTokens;ue.parseInline;Gt.parse;Wt.lex;fS.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function ES(n){const t=ue.parse(n,{async:!1});return fS.sanitize(t,{USE_PROFILES:{html:!0}})}var ns,Kl;class Zz extends bt{constructor(){super(...arguments);g(this,ns,null);g(this,Kl,xn())}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||o(this,ns)!==null)return;const e=((r=o(this,Kl).value)==null?void 0:r.querySelector("dialog"))??null;if(e===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,ns,ld(e,()=>{}))})}disconnected(){var e;(e=o(this,ns))==null||e.withdraw(),d(this,ns,null)}template(e){return B`
420
420
  <div class="desktop-upgrade-gate" ${ct(o(this,Kl))}>
421
- ${ad(B`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${sS(SS(jb(e)))}</div>`)}
421
+ ${ad(B`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${cS(ES(Jb(e)))}</div>`)}
422
422
  </div>
423
- `}}ns=new WeakMap,Kl=new WeakMap;const Uz=St(zz),Fz=250,Zz=1e3;var En,Cn,rs,qr,is,Mo,Kt,_S,Eh,Ch,AS,Df,kS;class Hz extends bt{constructor(){super(...arguments);g(this,Kt);g(this,En,Bz());g(this,Cn,null);g(this,rs,!1);g(this,qr,null);g(this,is,"");g(this,Mo,null);g(this,Eh,e=>{d(this,is,e.currentTarget.value)});g(this,Ch,e=>{e.preventDefault();const r=o(this,is).trim();r.length===0||o(this,Mo)===null||o(this,Mo).authenticate(r)})}disconnected(){var e;h(this,Kt,Df).call(this),(e=o(this,Cn))==null||e.withdraw(),d(this,Cn,null),d(this,rs,!1),Eu(null,o(this,En))}template(e,r){var i;return d(this,Mo,r),h(this,Kt,AS).call(this,e),e.kind==="needs-upgrade"?((i=o(this,Cn))==null||i.withdraw(),d(this,Cn,null),Eu(Uz(e.instructions),o(this,En)),o(this,En)):(Eu(ad(h(this,Kt,_S).call(this,e)),o(this,En)),h(this,Kt,kS).call(this),o(this,En))}}En=new WeakMap,Cn=new WeakMap,rs=new WeakMap,qr=new WeakMap,is=new WeakMap,Mo=new WeakMap,Kt=new WeakSet,_S=function(e){switch(e.kind){case"connecting":return B`
423
+ `}}ns=new WeakMap,Kl=new WeakMap;const Hz=St(Zz),Vz=250,Bz=1e3;var En,Cn,rs,qr,is,Mo,Kt,CS,Eh,Ch,$S,Mf,TS;class qz extends bt{constructor(){super(...arguments);g(this,Kt);g(this,En,Wz());g(this,Cn,null);g(this,rs,!1);g(this,qr,null);g(this,is,"");g(this,Mo,null);g(this,Eh,e=>{d(this,is,e.currentTarget.value)});g(this,Ch,e=>{e.preventDefault();const r=o(this,is).trim();r.length===0||o(this,Mo)===null||o(this,Mo).authenticate(r)})}disconnected(){var e;h(this,Kt,Mf).call(this),(e=o(this,Cn))==null||e.withdraw(),d(this,Cn,null),d(this,rs,!1),Eu(null,o(this,En))}template(e,r){var i;return d(this,Mo,r),h(this,Kt,$S).call(this,e),e.kind==="needs-upgrade"?((i=o(this,Cn))==null||i.withdraw(),d(this,Cn,null),Eu(Hz(e.instructions),o(this,En)),o(this,En)):(Eu(ad(h(this,Kt,CS).call(this,e)),o(this,En)),h(this,Kt,TS).call(this),o(this,En))}}En=new WeakMap,Cn=new WeakMap,rs=new WeakMap,qr=new WeakMap,is=new WeakMap,Mo=new WeakMap,Kt=new WeakSet,CS=function(e){switch(e.kind){case"connecting":return B`
424
424
  <div class="system-modal" role="status" aria-live="polite">
425
425
  <tv-icon name="spinner" size="xl" spinning></tv-icon>
426
426
  <h2>Connecting</h2>
@@ -429,7 +429,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
429
429
  <div class="system-modal" role="status" aria-live="polite">
430
430
  <tv-icon name="spinner" size="xl" spinning></tv-icon>
431
431
  <h2>Disconnected</h2>
432
- <p>${qz(e.nextRetryAt)}</p>
432
+ <p>${Gz(e.nextRetryAt)}</p>
433
433
  </div>
434
434
  `;case"unauthorized":{const r=!!e.invalid;return r&&d(this,is,""),B`
435
435
  <form class="system-modal auth-form" @submit=${o(this,Ch)}>
@@ -462,7 +462,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
462
462
  <p class="server-url">${e.serverURL}</p>
463
463
  <p>${e.message}</p>
464
464
  </div>
465
- `}},Eh=new WeakMap,Ch=new WeakMap,AS=function(e){const r=e.kind==="disconnected"&&e.nextRetryAt!==null;r&&o(this,qr)===null?d(this,qr,setInterval(()=>this.render(),Fz)):r||h(this,Kt,Df).call(this)},Df=function(){o(this,qr)!==null&&(clearInterval(o(this,qr)),d(this,qr,null))},kS=function(){o(this,Cn)!==null||o(this,rs)||(d(this,rs,!0),queueMicrotask(()=>{if(d(this,rs,!1),!this.isConnected||!o(this,En).isConnected||o(this,Cn)!==null)return;const e=o(this,En).querySelector("dialog");e!==null&&d(this,Cn,ld(e,()=>{}))}))};const Vz=St(Hz);function Bz(){const n=document.createElement("section");return n.className="system-modal-host",n}function qz(n){if(n===null)return"Reattempting now…";const t=n-Date.now();return t<=0?"Reattempting now…":`Reattempting in ${Math.ceil(t/Zz)}s…`}const jz=1400,tu=new WeakMap;function Wz(n,t){var s;const e=t.ownerDocument,r=(s=e.defaultView)==null?void 0:s.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=e.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",e.body.append(i),i.select();try{e.execCommand("copy")}catch{}i.remove()}const Gz={writeClipboard:Wz,scheduler:{setTimeout(n,t){return globalThis.setTimeout(n,t)},clearTimeout(n){globalThis.clearTimeout(n)}}};function Yz(n,t,e){const r=n.currentTarget;if(!r)return;t.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,s=i!=null&&i.classList.contains("copy-button-status")?i:null;s&&(s.textContent="",s.textContent="Copied");const a=tu.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:t.scheduler};l.handle=t.scheduler.setTimeout(()=>{tu.get(r)===l&&(tu.delete(r),r.toggleAttribute("copied",!1),s&&(s.textContent=""))},jz),tu.set(r,l),e()}function ES({label:n,prompt:t="",intent:e,copied:r=!1,onActivate:i=()=>{}},s=Gz){return B`
465
+ `}},Eh=new WeakMap,Ch=new WeakMap,$S=function(e){const r=e.kind==="disconnected"&&e.nextRetryAt!==null;r&&o(this,qr)===null?d(this,qr,setInterval(()=>this.render(),Vz)):r||h(this,Kt,Mf).call(this)},Mf=function(){o(this,qr)!==null&&(clearInterval(o(this,qr)),d(this,qr,null))},TS=function(){o(this,Cn)!==null||o(this,rs)||(d(this,rs,!0),queueMicrotask(()=>{if(d(this,rs,!1),!this.isConnected||!o(this,En).isConnected||o(this,Cn)!==null)return;const e=o(this,En).querySelector("dialog");e!==null&&d(this,Cn,ld(e,()=>{}))}))};const jz=St(qz);function Wz(){const n=document.createElement("section");return n.className="system-modal-host",n}function Gz(n){if(n===null)return"Reattempting now…";const t=n-Date.now();return t<=0?"Reattempting now…":`Reattempting in ${Math.ceil(t/Bz)}s…`}const Yz=1400,tu=new WeakMap;function Jz(n,t){var s;const e=t.ownerDocument,r=(s=e.defaultView)==null?void 0:s.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=e.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",e.body.append(i),i.select();try{e.execCommand("copy")}catch{}i.remove()}const Kz={writeClipboard:Jz,scheduler:{setTimeout(n,t){return globalThis.setTimeout(n,t)},clearTimeout(n){globalThis.clearTimeout(n)}}};function Xz(n,t,e){const r=n.currentTarget;if(!r)return;t.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,s=i!=null&&i.classList.contains("copy-button-status")?i:null;s&&(s.textContent="",s.textContent="Copied");const a=tu.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:t.scheduler};l.handle=t.scheduler.setTimeout(()=>{tu.get(r)===l&&(tu.delete(r),r.toggleAttribute("copied",!1),s&&(s.textContent=""))},Yz),tu.set(r,l),e()}function RS({label:n,prompt:t="",intent:e,copied:r=!1,onActivate:i=()=>{}},s=Kz){return B`
466
466
  <button
467
467
  class="copy-button"
468
468
  size="sm"
@@ -470,7 +470,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
470
470
  intent=${e??ie}
471
471
  ?copied=${r}
472
472
  prompt=${t}
473
- @click=${a=>Yz(a,s,i)}
473
+ @click=${a=>Xz(a,s,i)}
474
474
  >
475
475
  <span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
476
476
  <span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
@@ -481,7 +481,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
481
481
  aria-live="polite"
482
482
  >${r?"Copied":ie}</span
483
483
  >
484
- `}const CS="1.3.1",Jz="tv-desktop-upgrade-recommendation-dismissed",Kz="### Recommended desktop upgrade available\n\nTelevision now supports light/dark mode settings and better theming. To fully use them, upgrade the desktop app with `npm install -g @telepath-computer/television-desktop@latest`, then quit Television and relaunch it with `tv-desktop`.\n\nIf you don't need light/dark mode, you can keep using your current version.";function Xz(n){var t;return!n.electron||n.noticesSuppressed||((t=n.updateState)==null?void 0:t.toast)!=null||n.shellVersion===null||!Yh(n.shellVersion)||n.shellVersion===Yu?!1:Rm(CS,n.shellVersion)}var No;class $S extends HTMLElement{constructor(){super(...arguments);g(this,No,new Vm(this))}connectedCallback(){o(this,No).connect()}disconnectedCallback(){o(this,No).disconnect()}attributeChangedCallback(){o(this,No).refresh()}}No=new WeakMap,C($S,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",$S);const Qz="tv-update-dismissed",nu={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later"},e9="update-popover";function t9(n,t){const e=n.target;if(!(e instanceof Element))return!1;const r=e.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&t.contains(r)}var zo,nr,Uo,Xl,Ql,$h;class n9 extends bt{constructor(){super(...arguments);g(this,zo);g(this,nr);g(this,Uo,!1);g(this,Xl,()=>{});g(this,Ql,()=>{});g(this,$h,e=>{var r;(r=o(this,nr))==null||r.disconnect(),d(this,nr,void 0),d(this,zo,e),d(this,Uo,(e==null?void 0:e.hasAttribute("open"))??!1),e&&(d(this,nr,new MutationObserver(()=>{const i=e.hasAttribute("open");i!==o(this,Uo)&&(d(this,Uo,i),i?o(this,Xl).call(this):o(this,Ql).call(this))})),o(this,nr).observe(e,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var e;(e=o(this,nr))==null||e.disconnect(),d(this,nr,void 0),d(this,zo,void 0)}template({body:e,prompt:r,copied:i=!1,panelRef:s,bellRef:a,onPresent:l=()=>{},onDismiss:c=()=>{},onCopy:u=()=>{}}){d(this,Xl,l),d(this,Ql,c);const p=()=>{var v;(v=o(this,zo))==null||v.removeAttribute("open")},m=v=>{const y=v.currentTarget;v.key!=="Escape"||!t9(v,y)||(v.preventDefault(),v.stopPropagation(),y.removeAttribute("open"))};return B`
484
+ `}const IS="1.3.1",Qz="tv-desktop-upgrade-recommendation-dismissed",e9="### Recommended desktop upgrade available\n\nTelevision now supports light/dark mode settings and better theming. To fully use them, upgrade the desktop app with `npm install -g @telepath-computer/television-desktop@latest`, then quit Television and relaunch it with `tv-desktop`.\n\nIf you don't need light/dark mode, you can keep using your current version.";function t9(n){var t;return!n.electron||n.noticesSuppressed||((t=n.updateState)==null?void 0:t.toast)!=null||n.shellVersion===null||!Yh(n.shellVersion)||n.shellVersion===Yu?!1:xm(IS,n.shellVersion)}var No;class xS extends HTMLElement{constructor(){super(...arguments);g(this,No,new qm(this))}connectedCallback(){o(this,No).connect()}disconnectedCallback(){o(this,No).disconnect()}attributeChangedCallback(){o(this,No).refresh()}}No=new WeakMap,C(xS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",xS);const n9="tv-update-dismissed",nu={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later"},r9="update-popover";function i9(n,t){const e=n.target;if(!(e instanceof Element))return!1;const r=e.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&t.contains(r)}var zo,nr,Uo,Xl,Ql,$h;class s9 extends bt{constructor(){super(...arguments);g(this,zo);g(this,nr);g(this,Uo,!1);g(this,Xl,()=>{});g(this,Ql,()=>{});g(this,$h,e=>{var r;(r=o(this,nr))==null||r.disconnect(),d(this,nr,void 0),d(this,zo,e),d(this,Uo,(e==null?void 0:e.hasAttribute("open"))??!1),e&&(d(this,nr,new MutationObserver(()=>{const i=e.hasAttribute("open");i!==o(this,Uo)&&(d(this,Uo,i),i?o(this,Xl).call(this):o(this,Ql).call(this))})),o(this,nr).observe(e,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var e;(e=o(this,nr))==null||e.disconnect(),d(this,nr,void 0),d(this,zo,void 0)}template({body:e,prompt:r,copied:i=!1,panelRef:s,bellRef:a,onPresent:l=()=>{},onDismiss:c=()=>{},onCopy:u=()=>{}}){d(this,Xl,l),d(this,Ql,c);const p=()=>{var v;(v=o(this,zo))==null||v.removeAttribute("open")},m=v=>{const y=v.currentTarget;v.key!=="Escape"||!i9(v,y)||(v.preventDefault(),v.stopPropagation(),y.removeAttribute("open"))};return B`
485
485
  <button
486
486
  class="update-bell"
487
487
  id="update-bell"
@@ -495,7 +495,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
495
495
  </button>
496
496
 
497
497
  <tv-popover
498
- id=${e9}
498
+ id=${r9}
499
499
  manual
500
500
  trigger="update-bell"
501
501
  role="status"
@@ -509,24 +509,24 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
509
509
  <button size="sm" class="update-later" @click=${p}
510
510
  >${nu.later}</button
511
511
  >
512
- ${r===void 0?ie:ES({label:nu.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:u})}
512
+ ${r===void 0?ie:RS({label:nu.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:u})}
513
513
  </div>
514
514
  </tv-popover>
515
- `}}zo=new WeakMap,nr=new WeakMap,Uo=new WeakMap,Xl=new WeakMap,Ql=new WeakMap,$h=new WeakMap;const r9=St(n9);function i9(n,t){return t===null?!0:Rm(n,t)}const O1=new Set;var Rt,gt,ec,tc,Fo,rr,ss,os,Zo,Ve,ir,as,Ho,Vo,ls,jr,q,Of,Mf,Nf,zf,Uf,nc,cs,Uu,Ga,Ff,TS,Zf,Hf,Vf,Th,Rh,Ih,xh,Ph,Ya,RS;class s9{constructor(t=()=>{}){g(this,q);g(this,Rt,null);g(this,gt,null);g(this,ec,null);g(this,tc,"");g(this,Fo);g(this,rr,!1);g(this,ss,!1);g(this,os,!1);g(this,Zo,null);g(this,Ve,!1);g(this,ir,!1);g(this,as,null);g(this,Ho,null);g(this,Vo,!1);g(this,ls,[]);g(this,jr);g(this,nc,()=>{o(this,jr).call(this)});g(this,cs,()=>{h(this,q,Vf).call(this),o(this,jr).call(this)});g(this,Th,()=>{var e;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);t===null||o(this,Ve)||(d(this,Ve,!0),t.kind==="server"&&h(this,q,Zf).call(this,t.toast),o(this,jr).call(this))});g(this,Rh,()=>{var e,r;if(!o(this,Ve))return;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);t!==null&&((r=h(this,q,Of).call(this))==null||r.setItem(h(this,q,Ff).call(this,t),t.version)),d(this,Ve,!1),d(this,ir,!0),o(this,jr).call(this)});g(this,Ih,()=>{var e;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);(t==null?void 0:t.kind)!=="server"||t.prompt===void 0||h(this,q,Hf).call(this,"update_prompt_copy_clicked",t.toast)});g(this,xh,t=>{d(this,as,t instanceof HTMLElement?t:null),h(this,q,Ya).call(this)});g(this,Ph,t=>{d(this,Ho,t instanceof HTMLElement?t:null),h(this,q,Ya).call(this)});d(this,jr,t)}get presented(){return o(this,Ve)}configure({connectionOwner:t=null,primaryServerURL:e="",presentation:r=null,dismissalStorage:i,desktopRecommendation:s=null}){t!==o(this,Rt)&&(h(this,q,Nf).call(this),d(this,Rt,t),h(this,q,Mf).call(this)),r!==o(this,gt)&&(h(this,q,Uf).call(this),d(this,gt,r),h(this,q,zf).call(this)),d(this,tc,e),d(this,Fo,i),d(this,ec,s)}connect(){o(this,rr)||(d(this,rr,!0),h(this,q,Mf).call(this),h(this,q,zf).call(this))}disconnect(){o(this,rr)&&(h(this,q,Nf).call(this),h(this,q,Uf).call(this),d(this,rr,!1),d(this,as,null),d(this,Ho,null))}template(){var l,c;const t=((l=o(this,gt))==null?void 0:l.toastsSuppressed)??!1,e=h(this,q,Ga).call(this,t),r=e===null?null:`${e.kind}:${e.version}`;if(e===null?(d(this,Zo,null),d(this,Ve,!1),d(this,ir,!0)):r!==o(this,Zo)&&(d(this,Zo,r),d(this,Ve,i9(e.version,h(this,q,TS).call(this,h(this,q,Ff).call(this,e)))),d(this,ir,!0),o(this,Ve)&&e.kind==="server"&&!t&&h(this,q,Zf).call(this,e.toast)),e===null||t)return d(this,Ve,!1),d(this,ir,!0),h(this,q,Ya).call(this),ie;const i=(c=o(this,as))==null?void 0:c.querySelector(".copy-button"),s=o(this,Ve)&&!o(this,ir)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=r9({body:sS(SS(e.markdown)),prompt:e.kind==="server"?e.prompt:void 0,copied:s,presented:o(this,Ve),panelRef:o(this,xh),bellRef:o(this,Ph),onPresent:o(this,Th),onDismiss:o(this,Rh),onCopy:o(this,Ih)});return d(this,ir,!1),h(this,q,Ya).call(this),a}}Rt=new WeakMap,gt=new WeakMap,ec=new WeakMap,tc=new WeakMap,Fo=new WeakMap,rr=new WeakMap,ss=new WeakMap,os=new WeakMap,Zo=new WeakMap,Ve=new WeakMap,ir=new WeakMap,as=new WeakMap,Ho=new WeakMap,Vo=new WeakMap,ls=new WeakMap,jr=new WeakMap,q=new WeakSet,Of=function(){return o(this,Fo)!==void 0?o(this,Fo):typeof localStorage>"u"?null:localStorage},Mf=function(){!o(this,rr)||o(this,ss)||o(this,Rt)===null||(o(this,Rt).addEventListener("server-status",o(this,cs)),o(this,Rt).addEventListener("change",o(this,cs)),d(this,ss,!0))},Nf=function(){!o(this,ss)||o(this,Rt)===null||(o(this,Rt).removeEventListener("server-status",o(this,cs)),o(this,Rt).removeEventListener("change",o(this,cs)),d(this,ss,!1))},zf=function(){!o(this,rr)||o(this,os)||o(this,gt)===null||(o(this,gt).addEventListener("change",o(this,nc)),d(this,os,!0))},Uf=function(){!o(this,os)||o(this,gt)===null||(o(this,gt).removeEventListener("change",o(this,nc)),d(this,os,!1))},nc=new WeakMap,cs=new WeakMap,Uu=function(){var e;const t=((e=o(this,Rt))==null?void 0:e.connection)??null;return(t==null?void 0:t.url)===o(this,tc)?t:null},Ga=function(t){var s;const e=((s=h(this,q,Uu).call(this))==null?void 0:s.updateState)??null,r=(e==null?void 0:e.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=o(this,ec);return i!==null&&Xz({...i,noticesSuppressed:t,updateState:e})?{kind:"desktop",version:CS,markdown:Kz}:null},Ff=function(t){return t.kind==="server"?Qz:Jz},TS=function(t){var r;const e=((r=h(this,q,Of).call(this))==null?void 0:r.getItem(t))??null;return e!==null&&Yh(e)?e:null},Zf=function(t){O1.has(t.version)||(O1.add(t.version),h(this,q,Hf).call(this,"update_toast_shown",t))},Hf=function(t,e){var r;o(this,ls).push({event:t,properties:{server_version:((r=h(this,q,Uu).call(this))==null?void 0:r.serverVersion)??"",channel_version:e.version}}),h(this,q,Vf).call(this)},Vf=function(){if(o(this,ls).length===0)return;const t=h(this,q,Uu).call(this);if(!t||t.status!=="connected")return;const e=o(this,ls);d(this,ls,[]);for(const r of e)t.sendTelemetrySignal(r.event,r.properties)},Th=new WeakMap,Rh=new WeakMap,Ih=new WeakMap,xh=new WeakMap,Ph=new WeakMap,Ya=function(){o(this,Vo)||(d(this,Vo,!0),queueMicrotask(()=>{d(this,Vo,!1),h(this,q,RS).call(this)}))},RS=function(){const t=o(this,as);t!==null&&(o(this,Ve)&&o(this,Ho)===null||t.toggleAttribute("open",o(this,Ve)))};const o9=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,a9=""+new URL("table-oeG9uAN1.png",import.meta.url).href,l9=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,c9=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,M1="Artifact skills",u9="Artifact skills",h9="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",d9="Copy prompt";function ru({artifactSkill:n,name:t,description:e,prompt:r,thumbnail:i},s){return B`
515
+ `}}zo=new WeakMap,nr=new WeakMap,Uo=new WeakMap,Xl=new WeakMap,Ql=new WeakMap,$h=new WeakMap;const o9=St(s9);function a9(n,t){return t===null?!0:xm(n,t)}const U1=new Set;var Rt,gt,ec,tc,Fo,rr,ss,os,Zo,Ve,ir,as,Ho,Vo,ls,jr,q,Nf,zf,Uf,Ff,Zf,nc,cs,Uu,Ga,Hf,PS,Vf,Bf,qf,Th,Rh,Ih,xh,Ph,Ya,LS;class l9{constructor(t=()=>{}){g(this,q);g(this,Rt,null);g(this,gt,null);g(this,ec,null);g(this,tc,"");g(this,Fo);g(this,rr,!1);g(this,ss,!1);g(this,os,!1);g(this,Zo,null);g(this,Ve,!1);g(this,ir,!1);g(this,as,null);g(this,Ho,null);g(this,Vo,!1);g(this,ls,[]);g(this,jr);g(this,nc,()=>{o(this,jr).call(this)});g(this,cs,()=>{h(this,q,qf).call(this),o(this,jr).call(this)});g(this,Th,()=>{var e;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);t===null||o(this,Ve)||(d(this,Ve,!0),t.kind==="server"&&h(this,q,Vf).call(this,t.toast),o(this,jr).call(this))});g(this,Rh,()=>{var e,r;if(!o(this,Ve))return;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);t!==null&&((r=h(this,q,Nf).call(this))==null||r.setItem(h(this,q,Hf).call(this,t),t.version)),d(this,Ve,!1),d(this,ir,!0),o(this,jr).call(this)});g(this,Ih,()=>{var e;const t=h(this,q,Ga).call(this,((e=o(this,gt))==null?void 0:e.toastsSuppressed)??!1);(t==null?void 0:t.kind)!=="server"||t.prompt===void 0||h(this,q,Bf).call(this,"update_prompt_copy_clicked",t.toast)});g(this,xh,t=>{d(this,as,t instanceof HTMLElement?t:null),h(this,q,Ya).call(this)});g(this,Ph,t=>{d(this,Ho,t instanceof HTMLElement?t:null),h(this,q,Ya).call(this)});d(this,jr,t)}get presented(){return o(this,Ve)}configure({connectionOwner:t=null,primaryServerURL:e="",presentation:r=null,dismissalStorage:i,desktopRecommendation:s=null}){t!==o(this,Rt)&&(h(this,q,Uf).call(this),d(this,Rt,t),h(this,q,zf).call(this)),r!==o(this,gt)&&(h(this,q,Zf).call(this),d(this,gt,r),h(this,q,Ff).call(this)),d(this,tc,e),d(this,Fo,i),d(this,ec,s)}connect(){o(this,rr)||(d(this,rr,!0),h(this,q,zf).call(this),h(this,q,Ff).call(this))}disconnect(){o(this,rr)&&(h(this,q,Uf).call(this),h(this,q,Zf).call(this),d(this,rr,!1),d(this,as,null),d(this,Ho,null))}template(){var l,c;const t=((l=o(this,gt))==null?void 0:l.toastsSuppressed)??!1,e=h(this,q,Ga).call(this,t),r=e===null?null:`${e.kind}:${e.version}`;if(e===null?(d(this,Zo,null),d(this,Ve,!1),d(this,ir,!0)):r!==o(this,Zo)&&(d(this,Zo,r),d(this,Ve,a9(e.version,h(this,q,PS).call(this,h(this,q,Hf).call(this,e)))),d(this,ir,!0),o(this,Ve)&&e.kind==="server"&&!t&&h(this,q,Vf).call(this,e.toast)),e===null||t)return d(this,Ve,!1),d(this,ir,!0),h(this,q,Ya).call(this),ie;const i=(c=o(this,as))==null?void 0:c.querySelector(".copy-button"),s=o(this,Ve)&&!o(this,ir)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=o9({body:cS(ES(e.markdown)),prompt:e.kind==="server"?e.prompt:void 0,copied:s,presented:o(this,Ve),panelRef:o(this,xh),bellRef:o(this,Ph),onPresent:o(this,Th),onDismiss:o(this,Rh),onCopy:o(this,Ih)});return d(this,ir,!1),h(this,q,Ya).call(this),a}}Rt=new WeakMap,gt=new WeakMap,ec=new WeakMap,tc=new WeakMap,Fo=new WeakMap,rr=new WeakMap,ss=new WeakMap,os=new WeakMap,Zo=new WeakMap,Ve=new WeakMap,ir=new WeakMap,as=new WeakMap,Ho=new WeakMap,Vo=new WeakMap,ls=new WeakMap,jr=new WeakMap,q=new WeakSet,Nf=function(){return o(this,Fo)!==void 0?o(this,Fo):typeof localStorage>"u"?null:localStorage},zf=function(){!o(this,rr)||o(this,ss)||o(this,Rt)===null||(o(this,Rt).addEventListener("server-status",o(this,cs)),o(this,Rt).addEventListener("change",o(this,cs)),d(this,ss,!0))},Uf=function(){!o(this,ss)||o(this,Rt)===null||(o(this,Rt).removeEventListener("server-status",o(this,cs)),o(this,Rt).removeEventListener("change",o(this,cs)),d(this,ss,!1))},Ff=function(){!o(this,rr)||o(this,os)||o(this,gt)===null||(o(this,gt).addEventListener("change",o(this,nc)),d(this,os,!0))},Zf=function(){!o(this,os)||o(this,gt)===null||(o(this,gt).removeEventListener("change",o(this,nc)),d(this,os,!1))},nc=new WeakMap,cs=new WeakMap,Uu=function(){var e;const t=((e=o(this,Rt))==null?void 0:e.connection)??null;return(t==null?void 0:t.url)===o(this,tc)?t:null},Ga=function(t){var s;const e=((s=h(this,q,Uu).call(this))==null?void 0:s.updateState)??null,r=(e==null?void 0:e.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=o(this,ec);return i!==null&&t9({...i,noticesSuppressed:t,updateState:e})?{kind:"desktop",version:IS,markdown:e9}:null},Hf=function(t){return t.kind==="server"?n9:Qz},PS=function(t){var r;const e=((r=h(this,q,Nf).call(this))==null?void 0:r.getItem(t))??null;return e!==null&&Yh(e)?e:null},Vf=function(t){U1.has(t.version)||(U1.add(t.version),h(this,q,Bf).call(this,"update_toast_shown",t))},Bf=function(t,e){var r;o(this,ls).push({event:t,properties:{server_version:((r=h(this,q,Uu).call(this))==null?void 0:r.serverVersion)??"",channel_version:e.version}}),h(this,q,qf).call(this)},qf=function(){if(o(this,ls).length===0)return;const t=h(this,q,Uu).call(this);if(!t||t.status!=="connected")return;const e=o(this,ls);d(this,ls,[]);for(const r of e)t.sendTelemetrySignal(r.event,r.properties)},Th=new WeakMap,Rh=new WeakMap,Ih=new WeakMap,xh=new WeakMap,Ph=new WeakMap,Ya=function(){o(this,Vo)||(d(this,Vo,!0),queueMicrotask(()=>{d(this,Vo,!1),h(this,q,LS).call(this)}))},LS=function(){const t=o(this,as);t!==null&&(o(this,Ve)&&o(this,Ho)===null||t.toggleAttribute("open",o(this,Ve)))};const c9=""+new URL("calendar-DToAnkzj.png",import.meta.url).href,u9=""+new URL("table-oeG9uAN1.png",import.meta.url).href,h9=""+new URL("tasks-D4xqXFPl.png",import.meta.url).href,d9=""+new URL("markdown-DdDrJuVK.png",import.meta.url).href,F1="Artifact skills",p9="Artifact skills",f9="Ready-made starting prompts for creating Television artifacts. Copy one, add the details of what you want, and send it to your agent.",m9="Copy prompt";function ru({artifactSkill:n,name:t,description:e,prompt:r,thumbnail:i},s){return B`
516
516
  <article class="skill-card">
517
517
  <div class="skill-thumb"><img src=${i} alt="" /></div>
518
518
  <div class="skill-name">${t}</div>
519
519
  <p class="skill-desc">${e}</p>
520
- ${ES({label:d9,prompt:r,onActivate:()=>s==null?void 0:s.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
520
+ ${RS({label:m9,prompt:r,onActivate:()=>s==null?void 0:s.sendTelemetrySignal("artifact_skill_prompt_copy_clicked",{artifact_skill:n})})}
521
521
  </article>
522
- `}class p9 extends bt{template(t=null){return B`
522
+ `}class g9 extends bt{template(t=null){return B`
523
523
  <button
524
524
  class="skill-trigger"
525
525
  variant="ghost"
526
526
  icon
527
527
  id="skills-trigger"
528
- aria-label=${M1}
529
- title=${M1}
528
+ aria-label=${F1}
529
+ title=${F1}
530
530
  >
531
531
  <tv-icon name="skills" size="sm"></tv-icon>
532
532
  </button>
@@ -536,27 +536,27 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
536
536
  trigger="skills-trigger"
537
537
  class="skill-popover"
538
538
  >
539
- <div class="skill-heading">${u9}</div>
540
- <p class="skill-intro">${h9}</p>
539
+ <div class="skill-heading">${p9}</div>
540
+ <p class="skill-intro">${f9}</p>
541
541
  <div class="skill-grid">
542
- ${ru({artifactSkill:"calendar",name:"Calendar",description:"Visualize your calendar events across day and week views.",prompt:"Use the tv-calendar skill to make a calendar artifact for the following request, and put it on TV: ",thumbnail:o9},t)}
543
- ${ru({artifactSkill:"table",name:"Table",description:"Beautiful tables with headers, grouping, and chips for displaying data.",prompt:"Use the tv-table skill to make a table artifact for the following request, and put it on TV: ",thumbnail:a9},t)}
544
- ${ru({artifactSkill:"tasks",name:"Tasks",description:"Track tasks and plans in a checklist, with due dates, projects, and labels.",prompt:"Use the tv-tasks skill to make a task list artifact for the following request, and put it on TV: ",thumbnail:l9},t)}
545
- ${ru({artifactSkill:"markdown",name:"Markdown",description:"An interactive markdown editor for Obsidian notes and other formatted docs.",prompt:"Make a markdown artifact for the following request, and put it on TV: ",thumbnail:c9},t)}
542
+ ${ru({artifactSkill:"calendar",name:"Calendar",description:"Visualize your calendar events across day and week views.",prompt:"Use the tv-calendar skill to make a calendar artifact for the following request, and put it on TV: ",thumbnail:c9},t)}
543
+ ${ru({artifactSkill:"table",name:"Table",description:"Beautiful tables with headers, grouping, and chips for displaying data.",prompt:"Use the tv-table skill to make a table artifact for the following request, and put it on TV: ",thumbnail:u9},t)}
544
+ ${ru({artifactSkill:"tasks",name:"Tasks",description:"Track tasks and plans in a checklist, with due dates, projects, and labels.",prompt:"Use the tv-tasks skill to make a task list artifact for the following request, and put it on TV: ",thumbnail:h9},t)}
545
+ ${ru({artifactSkill:"markdown",name:"Markdown",description:"An interactive markdown editor for Obsidian notes and other formatted docs.",prompt:"Make a markdown artifact for the following request, and put it on TV: ",thumbnail:d9},t)}
546
546
  </div>
547
547
  </tv-popover>
548
- `}}const f9=St(p9),m9=600;let g9=0;const N1=new WeakMap,fp=n=>{if(n.id)return n.id;let t=N1.get(n);if(!t){do t=`tv-select-${++g9}`;while(n.ownerDocument.getElementById(t));N1.set(n,t)}return n.id=t,t},iu=n=>{var t;return((t=n.textContent)==null?void 0:t.trim())??""};var rc;class IS extends HTMLElement{constructor(){super();g(this,rc,this.attachInternals());o(this,rc).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){o(this,rc).ariaSelected=String(this.hasAttribute("selected"))}}rc=new WeakMap,C(IS,"observedAttributes",["selected"]);var Je,sr,Bo,Wr,Gr,ic,j,_r,Gs,Bf,Fu,Ar,Zu,qf,PS,Hu,LS;class xS extends HTMLElement{constructor(){super();g(this,j);g(this,Je,new Vm(this,{select:!0,refresh:()=>h(this,j,Zu).call(this),opened:()=>{d(this,Gr,""),h(this,j,Ar).call(this,h(this,j,Gs).call(this))},closed:()=>{h(this,j,Ar).call(this,void 0),d(this,Gr,"")},keydown:e=>h(this,j,LS).call(this,e),pointermove:e=>{const r=h(this,j,Bf).call(this,e);r&&h(this,j,Ar).call(this,r)},click:e=>{const r=h(this,j,Bf).call(this,e);r&&h(this,j,Hu).call(this,r)},selectedRow:()=>h(this,j,Gs).call(this),unpair:e=>h(this,j,PS).call(this,e)}));g(this,sr);g(this,Bo,"");g(this,Wr);g(this,Gr,"");g(this,ic,0);this.attachInternals().role="listbox"}connectedCallback(){o(this,Je).connect()}disconnectedCallback(){o(this,Je).disconnect()}attributeChangedCallback(){o(this,Je).refresh()}get value(){var e;return((e=h(this,j,Gs).call(this))==null?void 0:e.getAttribute("value"))??""}set value(e){const r=h(this,j,_r).call(this).find(i=>i.getAttribute("value")===e);r&&(h(this,j,Fu).call(this,r),h(this,j,Zu).call(this))}}Je=new WeakMap,sr=new WeakMap,Bo=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,ic=new WeakMap,j=new WeakSet,_r=function(){return[...this.querySelectorAll("tv-option")].filter(e=>e.closest("tv-select")===this)},Gs=function(){return h(this,j,_r).call(this).find(e=>e.hasAttribute("selected"))},Bf=function(e){const r=e.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},Fu=function(e){for(const r of h(this,j,_r).call(this))r.toggleAttribute("selected",r===e)},Ar=function(e){for(const r of h(this,j,_r).call(this))r.toggleAttribute("highlighted",r===e);if(o(this,Je).trigger&&js(o(this,Je).trigger,"aria-activedescendant",e?fp(e):null),e){const r=e.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},Zu=function(){var l;const e=h(this,j,_r).call(this),r=h(this,j,Gs).call(this)??e[0];r&&h(this,j,Fu).call(this,r);const i=o(this,Je).trigger;if(!i)return;js(i,"role","combobox"),js(i,"aria-haspopup","listbox"),js(i,"aria-controls",fp(this));for(const c of e)fp(c);const s=e.find(c=>c.hasAttribute("highlighted"));js(i,"aria-activedescendant",this.hasAttribute("open")&&s?s.id:null);const a=r?iu(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}h(this,j,qf).call(this,i,e)},qf=function(e,r){if(o(this,Wr)||(d(this,Wr,new ResizeObserver(()=>{const c=o(this,Je).trigger;c&&h(this,j,qf).call(this,c,h(this,j,_r).call(this))})),o(this,Wr).observe(e)),!e.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(e),s=JSON.stringify([e.id,r.map(iu),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(s===o(this,Bo))return;d(this,Bo,s);const a=e.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,e.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${iu(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),o(this,sr)??d(this,sr,this.ownerDocument.createElement("style")),o(this,sr).textContent=`:where(button[id="${CSS.escape(e.id)}"]) { width: ${l}px; }`,o(this,sr).isConnected||this.ownerDocument.head.append(o(this,sr))},PS=function(e){var r,i;for(const s of["role","aria-haspopup","aria-controls","aria-activedescendant"])e.removeAttribute(s);(r=o(this,Wr))==null||r.disconnect(),d(this,Wr,void 0),(i=o(this,sr))==null||i.remove(),d(this,sr,void 0),d(this,Bo,"")},Hu=function(e){const r=h(this,j,Gs).call(this)!==e;h(this,j,Fu).call(this,e),h(this,j,Zu).call(this),o(this,Je).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},LS=function(e){if(!o(this,Je).open)return this.ownerDocument.activeElement!==o(this,Je).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)?!1:(e.preventDefault(),e.stopImmediatePropagation(),o(this,Je).show(!0),!0);const r=h(this,j,_r).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(e.key==="Tab")return e.stopImmediatePropagation(),this.ownerDocument.activeElement!==o(this,Je).trigger?(e.preventDefault(),!0):(r[i]&&h(this,j,Hu).call(this,r[i]),!0);if(e.key==="Escape")return!1;const s=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(e.key)&&!s)return!1;if(e.preventDefault(),e.stopImmediatePropagation(),e.key==="Enter"||e.key===" ")r[i]&&h(this,j,Hu).call(this,r[i]);else if(e.key==="Home")h(this,j,Ar).call(this,r[0]);else if(e.key==="End")h(this,j,Ar).call(this,r.at(-1));else if(e.key==="ArrowDown"||e.key==="ArrowUp")h(this,j,Ar).call(this,r[Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();d(this,Gr,a-o(this,ic)>m9?e.key.toLowerCase():o(this,Gr)+e.key.toLowerCase()),d(this,ic,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(u=>iu(u).toLowerCase().startsWith(o(this,Gr)));c&&h(this,j,Ar).call(this,c)}return!0},C(xS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",IS);customElements.get("tv-select")||customElements.define("tv-select",xS);/**
548
+ `}}const v9=St(g9),y9=600;let w9=0;const Z1=new WeakMap,gp=n=>{if(n.id)return n.id;let t=Z1.get(n);if(!t){do t=`tv-select-${++w9}`;while(n.ownerDocument.getElementById(t));Z1.set(n,t)}return n.id=t,t},iu=n=>{var t;return((t=n.textContent)==null?void 0:t.trim())??""};var rc;class DS extends HTMLElement{constructor(){super();g(this,rc,this.attachInternals());o(this,rc).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){o(this,rc).ariaSelected=String(this.hasAttribute("selected"))}}rc=new WeakMap,C(DS,"observedAttributes",["selected"]);var Je,sr,Bo,Wr,Gr,ic,j,_r,Gs,jf,Fu,Ar,Zu,Wf,MS,Hu,NS;class OS extends HTMLElement{constructor(){super();g(this,j);g(this,Je,new qm(this,{select:!0,refresh:()=>h(this,j,Zu).call(this),opened:()=>{d(this,Gr,""),h(this,j,Ar).call(this,h(this,j,Gs).call(this))},closed:()=>{h(this,j,Ar).call(this,void 0),d(this,Gr,"")},keydown:e=>h(this,j,NS).call(this,e),pointermove:e=>{const r=h(this,j,jf).call(this,e);r&&h(this,j,Ar).call(this,r)},click:e=>{const r=h(this,j,jf).call(this,e);r&&h(this,j,Hu).call(this,r)},selectedRow:()=>h(this,j,Gs).call(this),unpair:e=>h(this,j,MS).call(this,e)}));g(this,sr);g(this,Bo,"");g(this,Wr);g(this,Gr,"");g(this,ic,0);this.attachInternals().role="listbox"}connectedCallback(){o(this,Je).connect()}disconnectedCallback(){o(this,Je).disconnect()}attributeChangedCallback(){o(this,Je).refresh()}get value(){var e;return((e=h(this,j,Gs).call(this))==null?void 0:e.getAttribute("value"))??""}set value(e){const r=h(this,j,_r).call(this).find(i=>i.getAttribute("value")===e);r&&(h(this,j,Fu).call(this,r),h(this,j,Zu).call(this))}}Je=new WeakMap,sr=new WeakMap,Bo=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,ic=new WeakMap,j=new WeakSet,_r=function(){return[...this.querySelectorAll("tv-option")].filter(e=>e.closest("tv-select")===this)},Gs=function(){return h(this,j,_r).call(this).find(e=>e.hasAttribute("selected"))},jf=function(e){const r=e.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},Fu=function(e){for(const r of h(this,j,_r).call(this))r.toggleAttribute("selected",r===e)},Ar=function(e){for(const r of h(this,j,_r).call(this))r.toggleAttribute("highlighted",r===e);if(o(this,Je).trigger&&js(o(this,Je).trigger,"aria-activedescendant",e?gp(e):null),e){const r=e.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},Zu=function(){var l;const e=h(this,j,_r).call(this),r=h(this,j,Gs).call(this)??e[0];r&&h(this,j,Fu).call(this,r);const i=o(this,Je).trigger;if(!i)return;js(i,"role","combobox"),js(i,"aria-haspopup","listbox"),js(i,"aria-controls",gp(this));for(const c of e)gp(c);const s=e.find(c=>c.hasAttribute("highlighted"));js(i,"aria-activedescendant",this.hasAttribute("open")&&s?s.id:null);const a=r?iu(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}h(this,j,Wf).call(this,i,e)},Wf=function(e,r){if(o(this,Wr)||(d(this,Wr,new ResizeObserver(()=>{const c=o(this,Je).trigger;c&&h(this,j,Wf).call(this,c,h(this,j,_r).call(this))})),o(this,Wr).observe(e)),!e.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(e),s=JSON.stringify([e.id,r.map(iu),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(s===o(this,Bo))return;d(this,Bo,s);const a=e.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,e.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${iu(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),o(this,sr)??d(this,sr,this.ownerDocument.createElement("style")),o(this,sr).textContent=`:where(button[id="${CSS.escape(e.id)}"]) { width: ${l}px; }`,o(this,sr).isConnected||this.ownerDocument.head.append(o(this,sr))},MS=function(e){var r,i;for(const s of["role","aria-haspopup","aria-controls","aria-activedescendant"])e.removeAttribute(s);(r=o(this,Wr))==null||r.disconnect(),d(this,Wr,void 0),(i=o(this,sr))==null||i.remove(),d(this,sr,void 0),d(this,Bo,"")},Hu=function(e){const r=h(this,j,Gs).call(this)!==e;h(this,j,Fu).call(this,e),h(this,j,Zu).call(this),o(this,Je).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},NS=function(e){if(!o(this,Je).open)return this.ownerDocument.activeElement!==o(this,Je).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)?!1:(e.preventDefault(),e.stopImmediatePropagation(),o(this,Je).show(!0),!0);const r=h(this,j,_r).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(e.key==="Tab")return e.stopImmediatePropagation(),this.ownerDocument.activeElement!==o(this,Je).trigger?(e.preventDefault(),!0):(r[i]&&h(this,j,Hu).call(this,r[i]),!0);if(e.key==="Escape")return!1;const s=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(e.key)&&!s)return!1;if(e.preventDefault(),e.stopImmediatePropagation(),e.key==="Enter"||e.key===" ")r[i]&&h(this,j,Hu).call(this,r[i]);else if(e.key==="Home")h(this,j,Ar).call(this,r[0]);else if(e.key==="End")h(this,j,Ar).call(this,r.at(-1));else if(e.key==="ArrowDown"||e.key==="ArrowUp")h(this,j,Ar).call(this,r[Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();d(this,Gr,a-o(this,ic)>y9?e.key.toLowerCase():o(this,Gr)+e.key.toLowerCase()),d(this,ic,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(u=>iu(u).toLowerCase().startsWith(o(this,Gr)));c&&h(this,j,Ar).call(this,c)}return!0},C(OS,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",DS);customElements.get("tv-select")||customElements.define("tv-select",OS);/**
549
549
  * @license
550
550
  * Copyright 2020 Google LLC
551
551
  * SPDX-License-Identifier: BSD-3-Clause
552
- */const v9=ma(class extends Ec{constructor(n){if(super(n),n.type!==In.PROPERTY&&n.type!==In.ATTRIBUTE&&n.type!==In.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!u2(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[t]){if(t===Ke||t===ie)return t;const e=n.element,r=n.name;if(n.type===In.PROPERTY){if(t===e[r])return Ke}else if(n.type===In.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(r))return Ke}else if(n.type===In.ATTRIBUTE&&e.getAttribute(r)===t+"")return Ke;return h2(n),t}}),z1="Settings",U1="Refresh themes",y9="Themes directory",w9="None";function F1(n){return n instanceof Error?n.message:String(n)}var ot,us,or,$n,sc,ar,lr,hs,qo,jo,Yt,DS,Lh,Dh,jf,Oh,Mh,Nh,Vu;class b9 extends bt{constructor(){super(...arguments);g(this,Yt);g(this,ot,null);g(this,us,null);g(this,or,!1);g(this,$n,null);g(this,sc,!1);g(this,ar,0);g(this,lr,null);g(this,hs,!1);g(this,qo,xn());g(this,jo,xn());g(this,Lh,e=>{var i;if((i=o(this,lr))==null||i.disconnect(),d(this,lr,null),d(this,hs,!1),!e)return;const r=()=>{const s=e.hasAttribute("open");s!==o(this,hs)&&(d(this,hs,s),s&&h(this,Yt,jf).call(this,!1))};d(this,lr,new MutationObserver(r)),o(this,lr).observe(e,{attributes:!0,attributeFilter:["open"]}),r()});g(this,Dh,()=>{h(this,Yt,jf).call(this,!0)});g(this,Oh,e=>{var s;const r=e.currentTarget,i=r.value;r.value=((s=o(this,ot))==null?void 0:s.snapshot.display.appearanceMode)??"system",this.render(),h(this,Yt,Vu).call(this,()=>{var a;return(a=o(this,ot))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});g(this,Mh,e=>{var s;const r=e.currentTarget,i=r.value||null;r.value=((s=o(this,ot))==null?void 0:s.snapshot.display.activeThemeName)??"",this.render(),h(this,Yt,Vu).call(this,()=>{var a;return(a=o(this,ot))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});g(this,Nh,e=>{var a;const r=e.currentTarget,i=r.value,s=r.checked;r.checked=((a=o(this,ot))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),h(this,Yt,Vu).call(this,()=>{var l;return(l=o(this,ot))==null?void 0:l.setThemeJavaScriptConsent(i,s)},"Unable to change theme JavaScript consent")})}template(e){var m,v;d(this,ot,e);const r=e.snapshot.connection.status==="connected";o(this,sc)&&!r&&h(this,Yt,DS).call(this),d(this,sc,r);const{activeThemeName:i,appearanceMode:s,themeJavaScriptConsentIds:a}=e.snapshot.display,l=((m=o(this,us))==null?void 0:m.themes)??[],c=((v=o(this,us))==null?void 0:v.errors)??[],u=i===null?void 0:l.find(y=>y.id===i&&y.enableMainJS===!0),p=i!==null&&a.includes(i);return queueMicrotask(()=>{var y,k;this.isConnected&&(o(this,qo).value&&(o(this,qo).value.value=((y=o(this,ot))==null?void 0:y.snapshot.display.appearanceMode)??"system"),o(this,jo).value&&(o(this,jo).value.value=((k=o(this,ot))==null?void 0:k.snapshot.display.activeThemeName)??""))}),B`
552
+ */const b9=ma(class extends Ec{constructor(n){if(super(n),n.type!==In.PROPERTY&&n.type!==In.ATTRIBUTE&&n.type!==In.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!f2(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[t]){if(t===Ke||t===ie)return t;const e=n.element,r=n.name;if(n.type===In.PROPERTY){if(t===e[r])return Ke}else if(n.type===In.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(r))return Ke}else if(n.type===In.ATTRIBUTE&&e.getAttribute(r)===t+"")return Ke;return m2(n),t}}),H1="Settings",V1="Refresh themes",S9="Themes directory",_9="None";function B1(n){return n instanceof Error?n.message:String(n)}var ot,us,or,$n,sc,ar,lr,hs,qo,jo,Yt,zS,Lh,Dh,Gf,Oh,Mh,Nh,Vu;class A9 extends bt{constructor(){super(...arguments);g(this,Yt);g(this,ot,null);g(this,us,null);g(this,or,!1);g(this,$n,null);g(this,sc,!1);g(this,ar,0);g(this,lr,null);g(this,hs,!1);g(this,qo,xn());g(this,jo,xn());g(this,Lh,e=>{var i;if((i=o(this,lr))==null||i.disconnect(),d(this,lr,null),d(this,hs,!1),!e)return;const r=()=>{const s=e.hasAttribute("open");s!==o(this,hs)&&(d(this,hs,s),s&&h(this,Yt,Gf).call(this,!1))};d(this,lr,new MutationObserver(r)),o(this,lr).observe(e,{attributes:!0,attributeFilter:["open"]}),r()});g(this,Dh,()=>{h(this,Yt,Gf).call(this,!0)});g(this,Oh,e=>{var s;const r=e.currentTarget,i=r.value;r.value=((s=o(this,ot))==null?void 0:s.snapshot.display.appearanceMode)??"system",this.render(),h(this,Yt,Vu).call(this,()=>{var a;return(a=o(this,ot))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});g(this,Mh,e=>{var s;const r=e.currentTarget,i=r.value||null;r.value=((s=o(this,ot))==null?void 0:s.snapshot.display.activeThemeName)??"",this.render(),h(this,Yt,Vu).call(this,()=>{var a;return(a=o(this,ot))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});g(this,Nh,e=>{var a;const r=e.currentTarget,i=r.value,s=r.checked;r.checked=((a=o(this,ot))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),h(this,Yt,Vu).call(this,()=>{var l;return(l=o(this,ot))==null?void 0:l.setThemeJavaScriptConsent(i,s)},"Unable to change theme JavaScript consent")})}template(e){var m,v;d(this,ot,e);const r=e.snapshot.connection.status==="connected";o(this,sc)&&!r&&h(this,Yt,zS).call(this),d(this,sc,r);const{activeThemeName:i,appearanceMode:s,themeJavaScriptConsentIds:a}=e.snapshot.display,l=((m=o(this,us))==null?void 0:m.themes)??[],c=((v=o(this,us))==null?void 0:v.errors)??[],u=i===null?void 0:l.find(y=>y.id===i&&y.enableMainJS===!0),p=i!==null&&a.includes(i);return queueMicrotask(()=>{var y,k;this.isConnected&&(o(this,qo).value&&(o(this,qo).value.value=((y=o(this,ot))==null?void 0:y.snapshot.display.appearanceMode)??"system"),o(this,jo).value&&(o(this,jo).value.value=((k=o(this,ot))==null?void 0:k.snapshot.display.activeThemeName)??""))}),B`
553
553
  <button
554
554
  class="settings-trigger"
555
555
  variant="ghost"
556
556
  icon
557
557
  id="settings-trigger"
558
- aria-label=${z1}
559
- title=${z1}
558
+ aria-label=${H1}
559
+ title=${H1}
560
560
  >
561
561
  <tv-icon name="settings" size="sm"></tv-icon>
562
562
  </button>
@@ -594,7 +594,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
594
594
  ${ct(o(this,jo))}
595
595
  @change=${o(this,Mh)}
596
596
  >
597
- <tv-option value="" ?selected=${i===null}>${w9}</tv-option>
597
+ <tv-option value="" ?selected=${i===null}>${_9}</tv-option>
598
598
  ${l.map(y=>B`
599
599
  <tv-option
600
600
  value=${y.id}
@@ -606,8 +606,8 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
606
606
  type="button"
607
607
  variant="ghost"
608
608
  icon
609
- aria-label=${U1}
610
- title=${U1}
609
+ aria-label=${V1}
610
+ title=${V1}
611
611
  ?disabled=${o(this,or)||!r}
612
612
  @click=${o(this,Dh)}
613
613
  >
@@ -628,7 +628,7 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
628
628
  role="switch"
629
629
  name="theme-javascript-consent"
630
630
  value=${u.id}
631
- .checked=${v9(p)}
631
+ .checked=${b9(p)}
632
632
  @change=${o(this,Nh)}
633
633
  >
634
634
  <span>Enable experimental javascript for this theme</span>
@@ -641,12 +641,12 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
641
641
  ${c.length>0?B`
642
642
  <div class="settings-errors" aria-label="Theme validation errors">
643
643
  ${c.map(y=>B`
644
- <p><strong>${y.folder??y9}</strong>: ${y.error}</p>
644
+ <p><strong>${y.folder??S9}</strong>: ${y.error}</p>
645
645
  `)}
646
646
  </div>
647
647
  `:null}
648
648
  </tv-popover>
649
- `}disconnected(){var e;(e=o(this,lr))==null||e.disconnect(),d(this,lr,null),d(this,hs,!1),d(this,ot,null),d(this,ar,o(this,ar)+1)}}ot=new WeakMap,us=new WeakMap,or=new WeakMap,$n=new WeakMap,sc=new WeakMap,ar=new WeakMap,lr=new WeakMap,hs=new WeakMap,qo=new WeakMap,jo=new WeakMap,Yt=new WeakSet,DS=function(){d(this,us,null),d(this,$n,null),d(this,or,!1),d(this,ar,o(this,ar)+1)},Lh=new WeakMap,Dh=new WeakMap,jf=async function(e){const r=o(this,ot);if(r===null||r.snapshot.connection.status!=="connected"||o(this,or))return;const i=++Nc(this,ar)._;d(this,or,!0),d(this,$n,null),this.render();try{const s=await(e?r.refreshThemes():r.listThemes());if(i!==o(this,ar))return;d(this,us,s)}catch(s){if(i!==o(this,ar))return;d(this,$n,`${e?"Unable to refresh themes":"Unable to load themes"}: ${F1(s)}`)}finally{i===o(this,ar)&&(d(this,or,!1),this.render())}},Oh=new WeakMap,Mh=new WeakMap,Nh=new WeakMap,Vu=async function(e,r){d(this,$n,null),this.render();try{await e()}catch(i){d(this,$n,`${r}: ${F1(i)}`),this.render()}};const S9=St(b9),La={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},_9=(n,{items:t,distance:e,edges:r})=>{const i=new Set;let s=0,a=!1;const l=y=>{y.removeAttribute("data-item-edge-fade");for(const k of Object.values(La))y.style.removeProperty(k)},c=()=>{s=0;const y=new Set(n.querySelectorAll(t)),k=[];for(const z of i)y.has(z)||(p.unobserve(z),i.delete(z),k.push(z));for(const z of y)i.has(z)||(i.add(z),p.observe(z));const x=n.getBoundingClientRect().left+n.clientLeft,L=x+n.clientWidth,D=Math.max(0,Math.min(e,n.clientWidth/2)),V=0,F=n.scrollLeft<n.scrollWidth-n.clientWidth-1?D:0,G=[...y].map(z=>({item:z,bounds:z.getBoundingClientRect()}));for(const z of k)l(z);for(const{item:z,bounds:J}of G){if(!(F>0&&J.right>L-F&&J.left<L)){l(z);continue}z.style.setProperty(La.start,`${x-J.left}px`),z.style.setProperty(La.end,`${L-J.left}px`),z.style.setProperty(La.left,`${V}px`),z.style.setProperty(La.right,`${F}px`),z.setAttribute("data-item-edge-fade","")}},u=()=>{!a&&!s&&(s=requestAnimationFrame(c))},p=new ResizeObserver(u);p.observe(n);const m=new MutationObserver(u);return m.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",u,{passive:!0}),u(),{refresh:u,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(s),p.disconnect(),m.disconnect(),n.removeEventListener("scroll",u);for(const y of i)l(y);i.clear()}}}},Da=.5;var It,Wo,Go,ds,Yr,cr,ur,Jr,Kr,Xr,jt,Qr,Yo,ei,ps,oc,Ze,hr,ti,zh,N,OS,MS,ac,lc,cc,Uh,uc,Ys,Wf,NS,Gf,Yf,Jf,Kf,zS,US,Jo,hc,FS,Js,Xf,ZS,HS,VS,Ja,Ka;class A9 extends bt{constructor(){super(...arguments);g(this,N);g(this,It,xn());g(this,Wo);g(this,Go);g(this,ds,!1);g(this,Yr,0);g(this,cr,!1);g(this,ur,!1);g(this,Jr,!1);g(this,Kr,0);g(this,Xr,null);g(this,jt,!1);g(this,Qr,null);g(this,Yo,null);g(this,ei,null);g(this,ps,null);g(this,oc,!1);g(this,Ze,null);g(this,hr,!1);g(this,ti,!1);g(this,zh,()=>{h(this,N,Ka).call(this)});g(this,ac,e=>{var s;const r=o(this,Ze);if(r===null||r.pointerId!==e.pointerId||!r.dragging&&Math.hypot(e.clientX-r.originX,e.clientY-r.originY)<=_2)return;const i=o(this,It).value;if(i){if(r.currentX=e.clientX,r.currentY=e.clientY,r.dragging)this.render();else{h(this,N,Ja).call(this);const a=r.tab.getBoundingClientRect();d(this,hr,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(e.pointerId),this.render(),(s=r.onReorderChange)==null||s.call(r,h(this,N,Kf).call(this,r))}h(this,N,Jf).call(this,r),h(this,N,Wf).call(this,r)}});g(this,lc,e=>{const r=o(this,Ze);r===null||r.pointerId!==e.pointerId||h(this,N,Ys).call(this,!0,!0)});g(this,cc,e=>{var r;((r=o(this,Ze))==null?void 0:r.pointerId)===e.pointerId&&h(this,N,Ys).call(this,!1,!0)});g(this,Uh,e=>{var r;((r=o(this,Ze))==null?void 0:r.pointerId)===e.pointerId&&h(this,N,Ys).call(this,!1,!0)});g(this,uc,e=>{var r;e.key!=="Escape"||!((r=o(this,Ze))!=null&&r.dragging)||(e.preventDefault(),h(this,N,Ys).call(this,!1,!0))});g(this,Jo,()=>{d(this,jt,!0),h(this,N,Js).call(this,!1)});g(this,hc,()=>{d(this,jt,!0),h(this,N,Js).call(this,!0)})}connected(){var e;d(this,Wo,void 0),d(this,Go,void 0),d(this,jt,!1),h(this,N,FS).call(this),typeof document<"u"&&((e=document.fonts)==null||e.addEventListener("loadingdone",o(this,hc),{once:!0})),document.addEventListener("television-theme-styles-changed",o(this,Jo)),d(this,ps,new MutationObserver(o(this,Jo))),o(this,ps).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",o(this,ac)),window.addEventListener("pointerup",o(this,lc)),window.addEventListener("pointercancel",o(this,cc)),window.addEventListener("keydown",o(this,uc))}template(e,r,i=null,s){var A,x;const a=(A=o(this,Ze))!=null&&A.dragging?o(this,Ze):null,l=(a==null?void 0:a.provisionalPages)??(r==null?void 0:r.pages),c=E9(r,l),u=(a==null?void 0:a.artifactId)??i,p=((x=r==null?void 0:r.selectedPage)==null?void 0:x.artifactIds[0])??null,m=`${(r==null?void 0:r.id)??""}:${c.map(({key:L,label:D})=>`${L}:${D}`).join("|")}`,v=p!==o(this,Wo),y=m!==o(this,Go);v&&d(this,ti,!1);const k=v||a===null&&y;return y&&d(this,jt,!0),d(this,Wo,p),d(this,Go,m),h(this,N,Js).call(this,k,v,v&&!y),B`
649
+ `}disconnected(){var e;(e=o(this,lr))==null||e.disconnect(),d(this,lr,null),d(this,hs,!1),d(this,ot,null),d(this,ar,o(this,ar)+1)}}ot=new WeakMap,us=new WeakMap,or=new WeakMap,$n=new WeakMap,sc=new WeakMap,ar=new WeakMap,lr=new WeakMap,hs=new WeakMap,qo=new WeakMap,jo=new WeakMap,Yt=new WeakSet,zS=function(){d(this,us,null),d(this,$n,null),d(this,or,!1),d(this,ar,o(this,ar)+1)},Lh=new WeakMap,Dh=new WeakMap,Gf=async function(e){const r=o(this,ot);if(r===null||r.snapshot.connection.status!=="connected"||o(this,or))return;const i=++Nc(this,ar)._;d(this,or,!0),d(this,$n,null),this.render();try{const s=await(e?r.refreshThemes():r.listThemes());if(i!==o(this,ar))return;d(this,us,s)}catch(s){if(i!==o(this,ar))return;d(this,$n,`${e?"Unable to refresh themes":"Unable to load themes"}: ${B1(s)}`)}finally{i===o(this,ar)&&(d(this,or,!1),this.render())}},Oh=new WeakMap,Mh=new WeakMap,Nh=new WeakMap,Vu=async function(e,r){d(this,$n,null),this.render();try{await e()}catch(i){d(this,$n,`${r}: ${B1(i)}`),this.render()}};const k9=St(A9),La={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},E9=(n,{items:t,distance:e,edges:r})=>{const i=new Set;let s=0,a=!1;const l=y=>{y.removeAttribute("data-item-edge-fade");for(const k of Object.values(La))y.style.removeProperty(k)},c=()=>{s=0;const y=new Set(n.querySelectorAll(t)),k=[];for(const z of i)y.has(z)||(p.unobserve(z),i.delete(z),k.push(z));for(const z of y)i.has(z)||(i.add(z),p.observe(z));const x=n.getBoundingClientRect().left+n.clientLeft,L=x+n.clientWidth,D=Math.max(0,Math.min(e,n.clientWidth/2)),V=0,F=n.scrollLeft<n.scrollWidth-n.clientWidth-1?D:0,G=[...y].map(z=>({item:z,bounds:z.getBoundingClientRect()}));for(const z of k)l(z);for(const{item:z,bounds:J}of G){if(!(F>0&&J.right>L-F&&J.left<L)){l(z);continue}z.style.setProperty(La.start,`${x-J.left}px`),z.style.setProperty(La.end,`${L-J.left}px`),z.style.setProperty(La.left,`${V}px`),z.style.setProperty(La.right,`${F}px`),z.setAttribute("data-item-edge-fade","")}},u=()=>{!a&&!s&&(s=requestAnimationFrame(c))},p=new ResizeObserver(u);p.observe(n);const m=new MutationObserver(u);return m.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",u,{passive:!0}),u(),{refresh:u,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(s),p.disconnect(),m.disconnect(),n.removeEventListener("scroll",u);for(const y of i)l(y);i.clear()}}}},Da=.5;var It,Wo,Go,ds,Yr,cr,ur,Jr,Kr,Xr,jt,Qr,Yo,ei,ps,oc,Ze,hr,ti,zh,N,US,FS,ac,lc,cc,Uh,uc,Ys,Yf,ZS,Jf,Kf,Xf,Qf,HS,VS,Jo,hc,BS,Js,em,qS,jS,WS,Ja,Ka;class C9 extends bt{constructor(){super(...arguments);g(this,N);g(this,It,xn());g(this,Wo);g(this,Go);g(this,ds,!1);g(this,Yr,0);g(this,cr,!1);g(this,ur,!1);g(this,Jr,!1);g(this,Kr,0);g(this,Xr,null);g(this,jt,!1);g(this,Qr,null);g(this,Yo,null);g(this,ei,null);g(this,ps,null);g(this,oc,!1);g(this,Ze,null);g(this,hr,!1);g(this,ti,!1);g(this,zh,()=>{h(this,N,Ka).call(this)});g(this,ac,e=>{var s;const r=o(this,Ze);if(r===null||r.pointerId!==e.pointerId||!r.dragging&&Math.hypot(e.clientX-r.originX,e.clientY-r.originY)<=C2)return;const i=o(this,It).value;if(i){if(r.currentX=e.clientX,r.currentY=e.clientY,r.dragging)this.render();else{h(this,N,Ja).call(this);const a=r.tab.getBoundingClientRect();d(this,hr,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(e.pointerId),this.render(),(s=r.onReorderChange)==null||s.call(r,h(this,N,Qf).call(this,r))}h(this,N,Xf).call(this,r),h(this,N,Yf).call(this,r)}});g(this,lc,e=>{const r=o(this,Ze);r===null||r.pointerId!==e.pointerId||h(this,N,Ys).call(this,!0,!0)});g(this,cc,e=>{var r;((r=o(this,Ze))==null?void 0:r.pointerId)===e.pointerId&&h(this,N,Ys).call(this,!1,!0)});g(this,Uh,e=>{var r;((r=o(this,Ze))==null?void 0:r.pointerId)===e.pointerId&&h(this,N,Ys).call(this,!1,!0)});g(this,uc,e=>{var r;e.key!=="Escape"||!((r=o(this,Ze))!=null&&r.dragging)||(e.preventDefault(),h(this,N,Ys).call(this,!1,!0))});g(this,Jo,()=>{d(this,jt,!0),h(this,N,Js).call(this,!1)});g(this,hc,()=>{d(this,jt,!0),h(this,N,Js).call(this,!0)})}connected(){var e;d(this,Wo,void 0),d(this,Go,void 0),d(this,jt,!1),h(this,N,BS).call(this),typeof document<"u"&&((e=document.fonts)==null||e.addEventListener("loadingdone",o(this,hc),{once:!0})),document.addEventListener("television-theme-styles-changed",o(this,Jo)),d(this,ps,new MutationObserver(o(this,Jo))),o(this,ps).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",o(this,ac)),window.addEventListener("pointerup",o(this,lc)),window.addEventListener("pointercancel",o(this,cc)),window.addEventListener("keydown",o(this,uc))}template(e,r,i=null,s){var A,x;const a=(A=o(this,Ze))!=null&&A.dragging?o(this,Ze):null,l=(a==null?void 0:a.provisionalPages)??(r==null?void 0:r.pages),c=T9(r,l),u=(a==null?void 0:a.artifactId)??i,p=((x=r==null?void 0:r.selectedPage)==null?void 0:x.artifactIds[0])??null,m=`${(r==null?void 0:r.id)??""}:${c.map(({key:L,label:D})=>`${L}:${D}`).join("|")}`,v=p!==o(this,Wo),y=m!==o(this,Go);v&&d(this,ti,!1);const k=v||a===null&&y;return y&&d(this,jt,!0),d(this,Wo,p),d(this,Go,m),h(this,N,Js).call(this,k,v,v&&!y),B`
650
650
  <div
651
651
  class="tab-strip"
652
652
  role="tablist"
@@ -672,35 +672,35 @@ Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error
672
672
  aria-selected=${V?"true":"false"}
673
673
  tabindex=${V?"0":"-1"}
674
674
  data-artifact-id=${L.artifactId??""}
675
- @pointerdown=${u===null?z=>h(this,N,OS).call(this,z,e,r,L,s):null}
676
- @click=${z=>h(this,N,MS).call(this,z,e,r,L)}
677
- @dblclick=${V&&r!==null&&!G?()=>kf(e,r,L.page,!L.page.geometry.full_screen):null}
675
+ @pointerdown=${u===null?z=>h(this,N,US).call(this,z,e,r,L,s):null}
676
+ @click=${z=>h(this,N,FS).call(this,z,e,r,L)}
677
+ @dblclick=${V&&r!==null&&!G?()=>Cf(e,r,L.page,!L.page.geometry.full_screen):null}
678
678
  >
679
679
  <span class="tab-label">${L.label}</span>
680
680
  </div>
681
681
  `})}
682
682
  </div>
683
- `}disconnected(){var e,r,i,s;d(this,ds,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(o(this,Yr)),d(this,Yr,0),d(this,cr,!1),d(this,ur,!1),d(this,Jr,!1),h(this,N,Ja).call(this),d(this,ti,!1),d(this,jt,!1),(e=o(this,Qr))==null||e.disconnect(),d(this,Qr,null),d(this,Yo,null),(r=o(this,ei))==null||r.dispose(),d(this,ei,null),(i=o(this,ps))==null||i.disconnect(),d(this,ps,null),document.removeEventListener("television-theme-styles-changed",o(this,Jo)),typeof document<"u"&&((s=document.fonts)==null||s.removeEventListener("loadingdone",o(this,hc))),window.removeEventListener("pointermove",o(this,ac)),window.removeEventListener("pointerup",o(this,lc)),window.removeEventListener("pointercancel",o(this,cc)),window.removeEventListener("keydown",o(this,uc)),h(this,N,Ys).call(this,!1,!1),d(this,hr,!1)}}It=new WeakMap,Wo=new WeakMap,Go=new WeakMap,ds=new WeakMap,Yr=new WeakMap,cr=new WeakMap,ur=new WeakMap,Jr=new WeakMap,Kr=new WeakMap,Xr=new WeakMap,jt=new WeakMap,Qr=new WeakMap,Yo=new WeakMap,ei=new WeakMap,ps=new WeakMap,oc=new WeakMap,Ze=new WeakMap,hr=new WeakMap,ti=new WeakMap,zh=new WeakMap,N=new WeakSet,OS=function(e,r,i,s,a){o(this,Ze)!==null||i===null||s.artifactId===null||e.button!==0||!e.isPrimary||(d(this,hr,!1),d(this,Ze,{pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,tab:e.currentTarget,application:r,channelId:i.id,artifactId:s.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(s.page),currentX:e.clientX,currentY:e.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},MS=function(e,r,i,s){var a;if(e.detail!==0&&o(this,hr)){d(this,hr,!1);return}d(this,hr,!1),!((a=o(this,Ze))!=null&&a.dragging||i===null||s.artifactId===null)&&r.selectPage(i.id,s.artifactId)},ac=new WeakMap,lc=new WeakMap,cc=new WeakMap,Uh=new WeakMap,uc=new WeakMap,Ys=function(e,r){var a;const i=o(this,Ze);if(i===null)return;if(h(this,N,Gf).call(this,i),i.edgeScrollMoved&&d(this,ti,!0),i.dragging&&(d(this,cr,o(this,ur)),o(this,ur)||d(this,Jr,!1)),i.dragging&&e&&!C9(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!e)for(const l of i.displacementAnimations)l.cancel();d(this,Ze,null),(a=i.onReorderChange)==null||a.call(i,null);const s=o(this,It).value;i.dragging&&(s!=null&&s.hasPointerCapture(i.pointerId))&&s.releasePointerCapture(i.pointerId),r&&this.render()},Wf=function(e){const r=o(this,It).value,i=r?h(this,N,Yf).call(this,r,e.currentX):0,s=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=Da:((r==null?void 0:r.scrollLeft)??0)>=s-Da;if(!e.dragging||i===0||s===0||a||typeof requestAnimationFrame!="function"){h(this,N,Gf).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,N,NS).call(this,e,l)}))},NS=function(e,r){if(e.edgeScrollFrame=0,o(this,Ze)!==e||!e.dragging){e.edgeScrollTimestamp=null;return}const i=o(this,It).value;if(!i){e.edgeScrollTimestamp=null;return}const s=h(this,N,Yf).call(this,i,e.currentX),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,p=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+p));i.scrollLeft=m;const v=i.scrollLeft-u;v!==0&&(e.edgeScrollMoved=!0),e.edgeScrollRemainder=m===0||m===c?0:p-v,v!==0&&(h(this,N,Ka).call(this,i),h(this,N,Jf).call(this,e))}h(this,N,Wf).call(this,e)},Gf=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},Yf=function(e,r){const i=e.getBoundingClientRect();return r>=i.left&&r<i.left+Pt?-sh*(i.left+Pt-r)/Pt:r>i.right-Pt&&r<=i.right?sh*(r-(i.right-Pt))/Pt:0},Jf=function(e){var k;const r=o(this,It).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const s=i.nextElementSibling,a=e.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=e.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const A=u.getBoundingClientRect();if(l>=A.left+A.width/2)break;c-=1,u=u.previousElementSibling}let p=s==null?void 0:s.nextElementSibling;for(;p!=null&&p.classList.contains("tab");){const A=p.getBoundingClientRect();if(l<=A.left+A.width/2)break;c+=1,p=p.nextElementSibling}if(c===e.slot)return;const m=h(this,N,zS).call(this,r),v=[...e.provisionalPages],[y]=v.splice(e.slot,1);y&&(v.splice(c,0,y),e.provisionalPages=v,e.slot=c,this.render(),(k=e.onReorderChange)==null||k.call(e,h(this,N,Kf).call(this,e)),queueMicrotask(()=>h(this,N,US).call(this,e,m)))},Kf=function(e){return{channelId:e.channelId,pages:e.provisionalPages,carriedArtifactId:e.artifactId}},zS=function(e){return new Map([...e.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},US=function(e,r){const i=o(this,It).value;if(i)for(const s of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(s.dataset.artifactId??"");if(a===void 0)continue;const l=a-s.getBoundingClientRect().left;if(Math.abs(l)<=Da)continue;const c=s.animate({translate:[`${l}px 0`,"0px 0"]},{duration:eo,easing:"ease"});e.displacementAnimations.add(c),c.finished.finally(()=>{e.displacementAnimations.delete(c)}).catch(()=>{})}},Jo=new WeakMap,hc=new WeakMap,FS=function(){o(this,oc)||typeof document>"u"||!document.fonts||(d(this,oc,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,jt,!0),h(this,N,Js).call(this,!0))}))},Js=function(e,r=!1,i=!1){o(this,cr)||d(this,cr,e),e&&r&&(d(this,ur,!0),d(this,Jr,i)),!(o(this,ds)||o(this,Yr)!==0)&&(d(this,ds,!0),queueMicrotask(()=>{if(d(this,ds,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,N,Xf).call(this);return}d(this,Yr,requestAnimationFrame(()=>{d(this,Yr,0),h(this,N,Xf).call(this)}))}}))},Xf=function(){var l,c;const e=o(this,It).value;if(!e)return;o(this,jt)&&(d(this,jt,!1),h(this,N,ZS).call(this,e)),h(this,N,HS).call(this,e);const r=((l=o(this,Ze))==null?void 0:l.dragging)===!0,i=o(this,ur),s=i&&o(this,Jr),a=!r&&(i||o(this,cr)&&!o(this,ti));r?d(this,cr,i):(d(this,cr,!1),d(this,ur,!1),d(this,Jr,!1),i&&d(this,ti,!1)),a&&h(this,N,VS).call(this,e,s),h(this,N,Ka).call(this,e),(c=o(this,ei))==null||c.refresh()},ZS=function(e){var r;for(const i of e.querySelectorAll(".tab")){const s=i.querySelector(".tab-label");if(!s)continue;const a=document.createRange();a.selectNodeContents(s);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=su(c.paddingLeft)+su(c.paddingRight)+su(c.borderLeftWidth)+su(c.borderRightWidth),m=Math.ceil(l.width)+u>wN+bN?"capped":"hugging";i.dataset.compression!==m&&(i.dataset.compression=m)}},HS=function(e){var r,i;typeof ResizeObserver>"u"||o(this,Yo)===e||((r=o(this,Qr))==null||r.disconnect(),o(this,Qr)??d(this,Qr,new ResizeObserver(()=>h(this,N,Js).call(this,!0))),o(this,Qr).observe(e),d(this,Yo,e),(i=o(this,ei))==null||i.dispose(),d(this,ei,_9(e,{items:".tab:not(.dragged)",distance:SN,edges:"right"})))},VS=function(e,r){const i=e.querySelector('.tab[aria-selected="true"]');if(!i){h(this,N,Ja).call(this);return}const s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(s.left+s.width/2),e.scrollWidth-e.clientWidth));if(h(this,N,Ja).call(this),!r||Math.abs(e.scrollLeft-l)<=Da||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=l;return}const c=e.scrollLeft,u=e.animate([{},{}],{duration:K2,easing:"ease"});d(this,Xr,u);const p=()=>{var v;if(u!==o(this,Xr))return;const m=u.playState==="finished"?1:((v=u.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=c+(l-c)*m,u.playState==="finished"?(e.scrollLeft=l,d(this,Xr,null),d(this,Kr,0),h(this,N,Ka).call(this,e)):d(this,Kr,requestAnimationFrame(p))};d(this,Kr,requestAnimationFrame(p))},Ja=function(){var e;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(o(this,Kr)),d(this,Kr,0),(e=o(this,Xr))==null||e.cancel(),d(this,Xr,null)},Ka=function(e=o(this,It).value){if(!e)return;const r=Math.max(0,e.scrollWidth-e.clientWidth);e.toggleAttribute("data-overflow",r>Da)};const k9=St(A9);function E9(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{var a;const s=r.artifactIds[0]??null;return{page:r,artifactId:s,label:s===null?"":((a=e.get(s))==null?void 0:a.title)??"",key:s??`empty-page-${i}`}})}function C9(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function su(n){const t=Number.parseFloat(n);return Number.isFinite(t)?t:0}var fs;class $9 extends bt{constructor(){super(...arguments);g(this,fs,new s9(()=>this.render()))}connected(){o(this,fs).connect()}template(e,r,i={}){var s;return o(this,fs).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),B`
683
+ `}disconnected(){var e,r,i,s;d(this,ds,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(o(this,Yr)),d(this,Yr,0),d(this,cr,!1),d(this,ur,!1),d(this,Jr,!1),h(this,N,Ja).call(this),d(this,ti,!1),d(this,jt,!1),(e=o(this,Qr))==null||e.disconnect(),d(this,Qr,null),d(this,Yo,null),(r=o(this,ei))==null||r.dispose(),d(this,ei,null),(i=o(this,ps))==null||i.disconnect(),d(this,ps,null),document.removeEventListener("television-theme-styles-changed",o(this,Jo)),typeof document<"u"&&((s=document.fonts)==null||s.removeEventListener("loadingdone",o(this,hc))),window.removeEventListener("pointermove",o(this,ac)),window.removeEventListener("pointerup",o(this,lc)),window.removeEventListener("pointercancel",o(this,cc)),window.removeEventListener("keydown",o(this,uc)),h(this,N,Ys).call(this,!1,!1),d(this,hr,!1)}}It=new WeakMap,Wo=new WeakMap,Go=new WeakMap,ds=new WeakMap,Yr=new WeakMap,cr=new WeakMap,ur=new WeakMap,Jr=new WeakMap,Kr=new WeakMap,Xr=new WeakMap,jt=new WeakMap,Qr=new WeakMap,Yo=new WeakMap,ei=new WeakMap,ps=new WeakMap,oc=new WeakMap,Ze=new WeakMap,hr=new WeakMap,ti=new WeakMap,zh=new WeakMap,N=new WeakSet,US=function(e,r,i,s,a){o(this,Ze)!==null||i===null||s.artifactId===null||e.button!==0||!e.isPrimary||(d(this,hr,!1),d(this,Ze,{pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,tab:e.currentTarget,application:r,channelId:i.id,artifactId:s.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(s.page),currentX:e.clientX,currentY:e.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},FS=function(e,r,i,s){var a;if(e.detail!==0&&o(this,hr)){d(this,hr,!1);return}d(this,hr,!1),!((a=o(this,Ze))!=null&&a.dragging||i===null||s.artifactId===null)&&r.selectPage(i.id,s.artifactId)},ac=new WeakMap,lc=new WeakMap,cc=new WeakMap,Uh=new WeakMap,uc=new WeakMap,Ys=function(e,r){var a;const i=o(this,Ze);if(i===null)return;if(h(this,N,Jf).call(this,i),i.edgeScrollMoved&&d(this,ti,!0),i.dragging&&(d(this,cr,o(this,ur)),o(this,ur)||d(this,Jr,!1)),i.dragging&&e&&!R9(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!e)for(const l of i.displacementAnimations)l.cancel();d(this,Ze,null),(a=i.onReorderChange)==null||a.call(i,null);const s=o(this,It).value;i.dragging&&(s!=null&&s.hasPointerCapture(i.pointerId))&&s.releasePointerCapture(i.pointerId),r&&this.render()},Yf=function(e){const r=o(this,It).value,i=r?h(this,N,Kf).call(this,r,e.currentX):0,s=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=Da:((r==null?void 0:r.scrollLeft)??0)>=s-Da;if(!e.dragging||i===0||s===0||a||typeof requestAnimationFrame!="function"){h(this,N,Jf).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,N,ZS).call(this,e,l)}))},ZS=function(e,r){if(e.edgeScrollFrame=0,o(this,Ze)!==e||!e.dragging){e.edgeScrollTimestamp=null;return}const i=o(this,It).value;if(!i){e.edgeScrollTimestamp=null;return}const s=h(this,N,Kf).call(this,i,e.currentX),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,s!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,p=s*l+e.edgeScrollRemainder,m=Math.max(0,Math.min(c,u+p));i.scrollLeft=m;const v=i.scrollLeft-u;v!==0&&(e.edgeScrollMoved=!0),e.edgeScrollRemainder=m===0||m===c?0:p-v,v!==0&&(h(this,N,Ka).call(this,i),h(this,N,Xf).call(this,e))}h(this,N,Yf).call(this,e)},Jf=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},Kf=function(e,r){const i=e.getBoundingClientRect();return r>=i.left&&r<i.left+Pt?-sh*(i.left+Pt-r)/Pt:r>i.right-Pt&&r<=i.right?sh*(r-(i.right-Pt))/Pt:0},Xf=function(e){var k;const r=o(this,It).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const s=i.nextElementSibling,a=e.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=e.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const A=u.getBoundingClientRect();if(l>=A.left+A.width/2)break;c-=1,u=u.previousElementSibling}let p=s==null?void 0:s.nextElementSibling;for(;p!=null&&p.classList.contains("tab");){const A=p.getBoundingClientRect();if(l<=A.left+A.width/2)break;c+=1,p=p.nextElementSibling}if(c===e.slot)return;const m=h(this,N,HS).call(this,r),v=[...e.provisionalPages],[y]=v.splice(e.slot,1);y&&(v.splice(c,0,y),e.provisionalPages=v,e.slot=c,this.render(),(k=e.onReorderChange)==null||k.call(e,h(this,N,Qf).call(this,e)),queueMicrotask(()=>h(this,N,VS).call(this,e,m)))},Qf=function(e){return{channelId:e.channelId,pages:e.provisionalPages,carriedArtifactId:e.artifactId}},HS=function(e){return new Map([...e.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},VS=function(e,r){const i=o(this,It).value;if(i)for(const s of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(s.dataset.artifactId??"");if(a===void 0)continue;const l=a-s.getBoundingClientRect().left;if(Math.abs(l)<=Da)continue;const c=s.animate({translate:[`${l}px 0`,"0px 0"]},{duration:eo,easing:"ease"});e.displacementAnimations.add(c),c.finished.finally(()=>{e.displacementAnimations.delete(c)}).catch(()=>{})}},Jo=new WeakMap,hc=new WeakMap,BS=function(){o(this,oc)||typeof document>"u"||!document.fonts||(d(this,oc,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,jt,!0),h(this,N,Js).call(this,!0))}))},Js=function(e,r=!1,i=!1){o(this,cr)||d(this,cr,e),e&&r&&(d(this,ur,!0),d(this,Jr,i)),!(o(this,ds)||o(this,Yr)!==0)&&(d(this,ds,!0),queueMicrotask(()=>{if(d(this,ds,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,N,em).call(this);return}d(this,Yr,requestAnimationFrame(()=>{d(this,Yr,0),h(this,N,em).call(this)}))}}))},em=function(){var l,c;const e=o(this,It).value;if(!e)return;o(this,jt)&&(d(this,jt,!1),h(this,N,qS).call(this,e)),h(this,N,jS).call(this,e);const r=((l=o(this,Ze))==null?void 0:l.dragging)===!0,i=o(this,ur),s=i&&o(this,Jr),a=!r&&(i||o(this,cr)&&!o(this,ti));r?d(this,cr,i):(d(this,cr,!1),d(this,ur,!1),d(this,Jr,!1),i&&d(this,ti,!1)),a&&h(this,N,WS).call(this,e,s),h(this,N,Ka).call(this,e),(c=o(this,ei))==null||c.refresh()},qS=function(e){var r;for(const i of e.querySelectorAll(".tab")){const s=i.querySelector(".tab-label");if(!s)continue;const a=document.createRange();a.selectNodeContents(s);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=su(c.paddingLeft)+su(c.paddingRight)+su(c.borderLeftWidth)+su(c.borderRightWidth),m=Math.ceil(l.width)+u>_N+AN?"capped":"hugging";i.dataset.compression!==m&&(i.dataset.compression=m)}},jS=function(e){var r,i;typeof ResizeObserver>"u"||o(this,Yo)===e||((r=o(this,Qr))==null||r.disconnect(),o(this,Qr)??d(this,Qr,new ResizeObserver(()=>h(this,N,Js).call(this,!0))),o(this,Qr).observe(e),d(this,Yo,e),(i=o(this,ei))==null||i.dispose(),d(this,ei,E9(e,{items:".tab:not(.dragged)",distance:kN,edges:"right"})))},WS=function(e,r){const i=e.querySelector('.tab[aria-selected="true"]');if(!i){h(this,N,Ja).call(this);return}const s=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(s.left+s.width/2),e.scrollWidth-e.clientWidth));if(h(this,N,Ja).call(this),!r||Math.abs(e.scrollLeft-l)<=Da||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=l;return}const c=e.scrollLeft,u=e.animate([{},{}],{duration:tS,easing:"ease"});d(this,Xr,u);const p=()=>{var v;if(u!==o(this,Xr))return;const m=u.playState==="finished"?1:((v=u.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=c+(l-c)*m,u.playState==="finished"?(e.scrollLeft=l,d(this,Xr,null),d(this,Kr,0),h(this,N,Ka).call(this,e)):d(this,Kr,requestAnimationFrame(p))};d(this,Kr,requestAnimationFrame(p))},Ja=function(){var e;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(o(this,Kr)),d(this,Kr,0),(e=o(this,Xr))==null||e.cancel(),d(this,Xr,null)},Ka=function(e=o(this,It).value){if(!e)return;const r=Math.max(0,e.scrollWidth-e.clientWidth);e.toggleAttribute("data-overflow",r>Da)};const $9=St(C9);function T9(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{var a;const s=r.artifactIds[0]??null;return{page:r,artifactId:s,label:s===null?"":((a=e.get(s))==null?void 0:a.title)??"",key:s??`empty-page-${i}`}})}function R9(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function su(n){const t=Number.parseFloat(n);return Number.isFinite(t)?t:0}var fs;class I9 extends bt{constructor(){super(...arguments);g(this,fs,new l9(()=>this.render()))}connected(){o(this,fs).connect()}template(e,r,i={}){var s;return o(this,fs).configure({connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),B`
684
684
  <header class="top-bar">
685
- ${k9(e,r,null,i.onTabReorderChange)}
685
+ ${$9(e,r,null,i.onTabReorderChange)}
686
686
  <div class="top-bar-controls">
687
- ${f9((s=i.connectionOwner)==null?void 0:s.connection)}
688
- ${S9(e)}
687
+ ${v9((s=i.connectionOwner)==null?void 0:s.connection)}
688
+ ${k9(e)}
689
689
  ${o(this,fs).template()}
690
690
  </div>
691
691
  </header>
692
- `}disconnected(){o(this,fs).disconnect()}}fs=new WeakMap;const T9=St($9);var Tn,dc,pc,Fh,ms,Zh,BS;class R9 extends bt{constructor(){super(...arguments);g(this,Zh);g(this,Tn,null);g(this,dc);g(this,pc,e=>{var r;E_(e,navigator.platform)&&(e.preventDefault(),e.stopPropagation(),(r=o(this,Tn))==null||r.handleNavigationKey(e.key))});g(this,Fh,e=>{d(this,dc,e??void 0),this.render()});g(this,ms,()=>{this.render()})}update(e,r){const i=r[0];return o(this,Tn)!==i&&(o(this,Tn)!==null&&this.isConnected&&(o(this,Tn).removeEventListener("change",o(this,ms)),i.addEventListener("change",o(this,ms))),d(this,Tn,i)),super.update(e,r)}connected(){var e;(e=o(this,Tn))==null||e.addEventListener("change",o(this,ms)),document.addEventListener("keydown",o(this,pc),{capture:!0})}disconnected(){var e;(e=o(this,Tn))==null||e.removeEventListener("change",o(this,ms)),document.removeEventListener("keydown",o(this,pc),{capture:!0})}template(e,r){const i=J5(e.snapshot,r.runtimeServerURL),s=e.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),B`
692
+ `}disconnected(){o(this,fs).disconnect()}}fs=new WeakMap;const x9=St(I9);var Tn,dc,pc,Fh,ms,Zh,GS;class P9 extends bt{constructor(){super(...arguments);g(this,Zh);g(this,Tn,null);g(this,dc);g(this,pc,e=>{var r;R_(e,navigator.platform)&&(e.preventDefault(),e.stopPropagation(),(r=o(this,Tn))==null||r.handleNavigationKey(e.key))});g(this,Fh,e=>{d(this,dc,e??void 0),this.render()});g(this,ms,()=>{this.render()})}update(e,r){const i=r[0];return o(this,Tn)!==i&&(o(this,Tn)!==null&&this.isConnected&&(o(this,Tn).removeEventListener("change",o(this,ms)),i.addEventListener("change",o(this,ms))),d(this,Tn,i)),super.update(e,r)}connected(){var e;(e=o(this,Tn))==null||e.addEventListener("change",o(this,ms)),document.addEventListener("keydown",o(this,pc),{capture:!0})}disconnected(){var e;(e=o(this,Tn))==null||e.removeEventListener("change",o(this,ms)),document.removeEventListener("keydown",o(this,pc),{capture:!0})}template(e,r){const i=Q5(e.snapshot,r.runtimeServerURL),s=e.snapshot;return r.onRenderComplete&&queueMicrotask(()=>{var a;this.isConnected&&((a=r.onRenderComplete)==null||a.call(r,i.kind))}),B`
693
693
  <div id="app" tabindex="-1" data-app-state=${i.kind}>
694
- ${x9(i)?h(this,Zh,BS).call(this,e,s,r):null}
695
- ${P9(i)?Vz(i,e):null}
694
+ ${D9(i)?h(this,Zh,GS).call(this,e,s,r):null}
695
+ ${O9(i)?jz(i,e):null}
696
696
  </div>
697
697
  <div id="foreground-overlay" inert aria-hidden="true"></div>
698
- `}}Tn=new WeakMap,dc=new WeakMap,pc=new WeakMap,Fh=new WeakMap,ms=new WeakMap,Zh=new WeakSet,BS=function(e,r,i){return B`
698
+ `}}Tn=new WeakMap,dc=new WeakMap,pc=new WeakMap,Fh=new WeakMap,ms=new WeakMap,Zh=new WeakSet,GS=function(e,r,i){return B`
699
699
  <aside class="app-sidebar">
700
- ${HM(e,r,i.electronMode)}
700
+ ${qM(e,r,i.electronMode)}
701
701
  </aside>
702
702
  <main class="app-main">
703
- ${T9(e,r.focusedChannel,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,onTabReorderChange:o(this,Fh)})}
704
- ${TN(e,r.focusedChannel,o(this,dc))}
703
+ ${x9(e,r.focusedChannel,{connectionOwner:i.connectionOwner,primaryServerURL:i.primaryServerURL,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,onTabReorderChange:o(this,Fh)})}
704
+ ${xN(e,r.focusedChannel,o(this,dc))}
705
705
  </main>
706
- `};const I9=St(R9);function x9(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function P9(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const qS="television-appearance-mode";function L9(n){return n==="system"||n==="light"||n==="dark"}function D9(){try{const n=window.localStorage.getItem(qS);return L9(n)?n:"system"}catch{return"system"}}function jS(){return window.__televisionAppearanceResolver??x5(D9())}function O9(n,t){return t==="light"||t==="dark"?t:n}function M9(n){jS().setPreference(n);try{window.localStorage.setItem(qS,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Fm();Object.defineProperty(window,"__tvVersion",{value:Fm(),writable:!1,configurable:!1});jS();const N9=Y9(),mr=dr(),ng=Q3(),WS=ex(),z9=new QC(mr?"television-electron":"television-browser",XC()),Z1=Zb(),U9=Z1?ax({storage:Z1,clientApp:mr?"desktop":"browser",desktopAppVersion:mr?Vw():null}):null,rg=oi(mr?ng:window.location.origin),ig=E5({search:window.location.search}),Jt=Zm(),GS=new I5,sg=R5({detection:ig,primaryServerURL:rg,navigationLatch:Jt,presentation:GS}),ge=new u5({localStore:z9,serverURL:ng,launchToken:WS,telemetryMeta:U9,navigationPending:()=>Jt.pending,...ig.electron?{decideBoot:n=>sg.decideBoot(n)}:{}}),F9=n=>{ZC(Be,n)},Be=new xC({connectionOwner:ge,navigationKeyHandler:F9,retainedGateHalted:()=>sg.gated}),to=globalThis.__televisionNativeBridge;mr&&to&&to.onNavigationKey(n=>Be.handleNavigationKey(n));if(WS){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}k5({owner:ge,primaryServerURL:rg,navigationLatch:Jt});sg.attach(ge);const Z9=()=>{const n=ge.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:t})=>{const e=new Set(t.map(r=>r.id));w5(e)}).catch(()=>{})},YS=()=>{ge.connection.status==="connected"&&qM(ge.connection.url)};let hh=null,Qf=null,JS=ge.connection.status;const H9=()=>{Jt.pending||Jt.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const t=new URL(window.location.href);t.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`)}window.location.reload()})},KS=(n,t,e)=>{if(Jt.pending||ge.connection.status!=="connected"||Be.snapshot.connection.status!=="connected"||!Be.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(t)},i=hh,s=GM(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),u=i!==null&&!a&&l&&!c,p=i!==null&&n_(i.consentIds,r.consentIds);if(hh=r,s!==null&&(a||u)){H9();return}if(s===null&&c){l1(ge.connection.url);return}s!==null&&c&&e&&!a&&p&&l1(ge.connection.url)},V9=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},XS=(n,t)=>{if(Jt.pending||ge.connection.status!=="connected"||Be.snapshot.connection.status!=="connected"||!Be.snapshot.ready)return;const e={activeThemeName:n,serverURL:ge.connection.url,appearance:V9()},r=Qf;Qf=e,!(!t&&(r==null?void 0:r.activeThemeName)===e.activeThemeName&&r.serverURL===e.serverURL&&r.appearance===e.appearance)&&YM(e.serverURL,e.activeThemeName,()=>Be.listThemes())},QS=()=>{if(!Jt.pending){if(JS=ge.connection.status,ge.connection.status!=="connected"){jM(),WM(),JM(),hh=null,Qf=null;return}YS(),Z9()}};let em,tm;const og=(n,t)=>{const e=O9(n,t);e!==em&&(M9(e),em=e),e!==tm&&mr&&typeof(to==null?void 0:to.setAppearanceMode)=="function"&&(to.setAppearanceMode(e),tm=e)},hd=()=>{const n=Be.snapshot;if(n.connection.status!=="connected"){em=void 0,tm=void 0;return}n.ready&&(og(n.display.appearanceMode,n.display.activeThemeColorScheme),JS===ge.connection.status&&(KS(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),XS(n.display.activeThemeName,!1)))},B9=n=>{if(Jt.pending)return;og(Be.snapshot.display.appearanceMode,n.activeThemeColorScheme);const t=hh,e=t!==null&&t.activeThemeName===n.themeName&&!n_(t.consentIds,new Set(n.themeJavaScriptConsentIds));KS(n.themeName,n.themeJavaScriptConsentIds,!0),!(Jt.pending||e)&&(YS(),XS(n.themeName,!0))},q9=n=>{Jt.pending||og(n.appearanceMode,Be.snapshot.display.activeThemeColorScheme)};QS();hd();ge.addEventListener("change",QS);Be.addEventListener("change",hd);Be.addEventListener("theme-changed",B9);Be.addEventListener("appearance-changed",q9);const j9=new MutationObserver(()=>{hd()});j9.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});Vy.register("ServerConnectionOwner",()=>ge);Vy.register("ApplicationService",()=>Be);const rl=globalThis.__telepath??(globalThis.__telepath={});rl.applicationService=Be;rl.connectionOwner=ge;const W9=rl.renderCompleteCallbacks??(rl.renderCompleteCallbacks=new Set);mr&&document.body.classList.add("electron");let H1=!1,V1=!1;const G9=n=>{if(!N9||V1||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const t=document.querySelector("#settings-popover");t!==null&&(V1=!0,t.setAttribute("open",""))},e_=()=>{H1||(Eu(I9(Be,{runtimeServerURL:ng,electronMode:mr,connectionOwner:ge,primaryServerURL:rg,updatePresentation:GS,desktopRecommendation:ig,onRenderComplete(n){G9(n);for(const t of W9)t(n)}}),document.body),H1=!0,hd())},t_=()=>{const n=ge.connection;n.bootState==="pending"&&!n.hasAuthRejected&&ge.connectError===null||(ge.removeEventListener("change",t_),e_())};mr?ge.addEventListener("change",t_):e_();ge.connect();function Y9(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function n_(n,t){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}
706
+ `};const L9=St(P9);function D9(n){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"}function O9(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const YS="television-appearance-mode";function M9(n){return n==="system"||n==="light"||n==="dark"}function N9(){try{const n=window.localStorage.getItem(YS);return M9(n)?n:"system"}catch{return"system"}}function JS(){return window.__televisionAppearanceResolver??D5(N9())}function z9(n,t){return t==="light"||t==="dark"?t:n}function U9(n){JS().setPreference(n);try{window.localStorage.setItem(YS,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Hm();Object.defineProperty(window,"__tvVersion",{value:Hm(),writable:!1,configurable:!1});JS();const F9=X9(),mr=dr(),ig=nx(),KS=rx(),Z9=new n$(mr?"television-electron":"television-browser",t$()),q1=qb(),H9=q1?ux({storage:q1,clientApp:mr?"desktop":"browser",desktopAppVersion:mr?Ww():null}):null,sg=oi(mr?ig:window.location.origin),og=T5({search:window.location.search}),Jt=Vm(),XS=new L5,ag=P5({detection:og,primaryServerURL:sg,navigationLatch:Jt,presentation:XS}),ge=new p5({localStore:Z9,serverURL:ig,launchToken:KS,telemetryMeta:H9,navigationPending:()=>Jt.pending,...og.electron?{decideBoot:n=>ag.decideBoot(n)}:{}}),V9=n=>{BC(Be,n)},Be=new DC({connectionOwner:ge,navigationKeyHandler:V9,retainedGateHalted:()=>ag.gated}),to=globalThis.__televisionNativeBridge;mr&&to&&to.onNavigationKey(n=>Be.handleNavigationKey(n));if(KS){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}$5({owner:ge,primaryServerURL:sg,navigationLatch:Jt});ag.attach(ge);const B9=()=>{const n=ge.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:t})=>{const e=new Set(t.map(r=>r.id));_5(e)}).catch(()=>{})},QS=()=>{ge.connection.status==="connected"&&GM(ge.connection.url)};let hh=null,tm=null,e_=ge.connection.status;const q9=()=>{Jt.pending||Jt.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const t=new URL(window.location.href);t.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`)}window.location.reload()})},t_=(n,t,e)=>{if(Jt.pending||ge.connection.status!=="connected"||Be.snapshot.connection.status!=="connected"||!Be.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(t)},i=hh,s=KM(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),u=i!==null&&!a&&l&&!c,p=i!==null&&o_(i.consentIds,r.consentIds);if(hh=r,s!==null&&(a||u)){q9();return}if(s===null&&c){d1(ge.connection.url);return}s!==null&&c&&e&&!a&&p&&d1(ge.connection.url)},j9=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},n_=(n,t)=>{if(Jt.pending||ge.connection.status!=="connected"||Be.snapshot.connection.status!=="connected"||!Be.snapshot.ready)return;const e={activeThemeName:n,serverURL:ge.connection.url,appearance:j9()},r=tm;tm=e,!(!t&&(r==null?void 0:r.activeThemeName)===e.activeThemeName&&r.serverURL===e.serverURL&&r.appearance===e.appearance)&&XM(e.serverURL,e.activeThemeName,()=>Be.listThemes())},r_=()=>{if(!Jt.pending){if(e_=ge.connection.status,ge.connection.status!=="connected"){YM(),JM(),QM(),hh=null,tm=null;return}QS(),B9()}};let nm,rm;const lg=(n,t)=>{const e=z9(n,t);e!==nm&&(U9(e),nm=e),e!==rm&&mr&&typeof(to==null?void 0:to.setAppearanceMode)=="function"&&(to.setAppearanceMode(e),rm=e)},hd=()=>{const n=Be.snapshot;if(n.connection.status!=="connected"){nm=void 0,rm=void 0;return}n.ready&&(lg(n.display.appearanceMode,n.display.activeThemeColorScheme),e_===ge.connection.status&&(t_(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),n_(n.display.activeThemeName,!1)))},W9=n=>{if(Jt.pending)return;lg(Be.snapshot.display.appearanceMode,n.activeThemeColorScheme);const t=hh,e=t!==null&&t.activeThemeName===n.themeName&&!o_(t.consentIds,new Set(n.themeJavaScriptConsentIds));t_(n.themeName,n.themeJavaScriptConsentIds,!0),!(Jt.pending||e)&&(QS(),n_(n.themeName,!0))},G9=n=>{Jt.pending||lg(n.appearanceMode,Be.snapshot.display.activeThemeColorScheme)};r_();hd();ge.addEventListener("change",r_);Be.addEventListener("change",hd);Be.addEventListener("theme-changed",W9);Be.addEventListener("appearance-changed",G9);const Y9=new MutationObserver(()=>{hd()});Y9.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});Wy.register("ServerConnectionOwner",()=>ge);Wy.register("ApplicationService",()=>Be);const rl=globalThis.__telepath??(globalThis.__telepath={});rl.applicationService=Be;rl.connectionOwner=ge;const J9=rl.renderCompleteCallbacks??(rl.renderCompleteCallbacks=new Set);mr&&document.body.classList.add("electron");let j1=!1,W1=!1;const K9=n=>{if(!F9||W1||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const t=document.querySelector("#settings-popover");t!==null&&(W1=!0,t.setAttribute("open",""))},i_=()=>{j1||(Eu(L9(Be,{runtimeServerURL:ig,electronMode:mr,connectionOwner:ge,primaryServerURL:sg,updatePresentation:XS,desktopRecommendation:og,onRenderComplete(n){K9(n);for(const t of J9)t(n)}}),document.body),j1=!0,hd())},s_=()=>{const n=ge.connection;n.bootState==="pending"&&!n.hasAuthRejected&&ge.connectError===null||(ge.removeEventListener("change",s_),i_())};mr?ge.addEventListener("change",s_):i_();ge.connect();function X9(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function o_(n,t){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}