@telepath-computer/television 0.1.183 → 0.1.185
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +35 -30
- package/dist/views/artifact-missing/index.html +2 -2
- package/dist/views/markdown/index.html +9 -9
- package/dist/web/assets/artifact-bridge-BhiFDvPj.js +1 -0
- package/dist/web/assets/{artifactMissing-DWPZdkiF.js → artifactMissing-DY3nzD0p.js} +1 -1
- package/dist/web/assets/{main-D1MjT1Io.js → main-KWg2vw8N.js} +2 -2
- package/dist/web/assets/{urlUnsupported-VVXPf33N.js → urlUnsupported-B2K6eB7H.js} +1 -1
- package/dist/web/index.html +2 -2
- package/dist/web/views/artifact-missing/index.html +2 -2
- package/dist/web/views/url-unsupported/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/artifact-bridge-C0H5cXgO.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var X_=Object.defineProperty;var lg=n=>{throw TypeError(n)};var Q_=(n,t,e)=>t in n?X_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var g=(n,t,e)=>Q_(n,typeof t!="symbol"?t+"":t,e),Zu=(n,t,e)=>t.has(n)||lg("Cannot "+e);var l=(n,t,e)=>(Zu(n,t,"read from private field"),e?e.call(n):t.get(n)),b=(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),m=(n,t,e,r)=>(Zu(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),d=(n,t,e)=>(Zu(n,t,"access private method"),e);var Bu=(n,t,e,r)=>({set _(i){m(n,t,i,e)},get _(){return l(n,t,r)}});import{i as cg,a as Wu,b as ug,c as hg,d as dg,e as ek,U as tk,f as pg,g as fg,A as nk,h as rk,j as ik}from"./artifact-bridge-C0H5cXgO.js";import{m as sk,a as ok,b as ak}from"./missing-artifact-page-DVzJ41AE.js";var Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lk(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 gg=Object.prototype.toString,xy=function(t){var e=gg.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&gg.call(t.callee)==="[object Function]"),r},ju,mg;function ck(){if(mg)return ju;mg=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=xy,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),a=["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},h=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}(),f=function(v){if(typeof window>"u"||!h)return c(v);try{return c(v)}catch{return!1}};n=function(y){var E=y!==null&&typeof y=="object",x=e.call(y)==="[object Function]",C=r(y),L=E&&e.call(y)==="[object String]",R=[];if(!E&&!x&&!C)throw new TypeError("Object.keys called on a non-object");var W=o&&x;if(L&&y.length>0&&!t.call(y,0))for(var N=0;N<y.length;++N)R.push(String(N));if(C&&y.length>0)for(var V=0;V<y.length;++V)R.push(String(V));else for(var K in y)!(W&&K==="prototype")&&t.call(y,K)&&R.push(String(K));if(s)for(var G=f(y),he=0;he<a.length;++he)!(G&&a[he]==="constructor")&&t.call(y,a[he])&&R.push(a[he]);return R}}return ju=n,ju}var uk=Array.prototype.slice,hk=xy,vg=Object.keys,Gl=vg?function(t){return vg(t)}:ck(),yg=Object.keys;Gl.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 hk(r)?yg(uk.call(r)):yg(r)})}else Object.keys=Gl;return Object.keys||Gl};var dk=Gl,ql=Object.defineProperty||!1;if(ql)try{ql({},"a",{value:1})}catch{ql=!1}var sl=ql,Hn=SyntaxError,J=TypeError,pk=Object.getOwnPropertyDescriptor,Yl=pk;if(Yl)try{Yl([],"length")}catch{Yl=null}var js=Yl,bg=sl,fk=Hn,zi=J,wg=js,Ay=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new zi("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new zi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new zi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new zi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new zi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new zi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,c=!!wg&&wg(t,e);if(bg)bg(t,e,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(a||!i&&!s&&!o)t[e]=r;else throw new fk("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},jh=sl,Ty=function(){return!!jh};Ty.hasArrayLengthDefineBug=function(){if(!jh)return null;try{return jh([],"length",{value:1}).length!==1}catch{return!0}};var au=Ty,gk=dk,mk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",vk=Object.prototype.toString,yk=Array.prototype.concat,Sg=Ay,bk=function(n){return typeof n=="function"&&vk.call(n)==="[object Function]"},$y=au(),wk=function(n,t,e,r){if(t in n){if(r===!0){if(n[t]===e)return}else if(!bk(r)||!r())return}$y?Sg(n,t,e,!0):Sg(n,t,e)},Cy=function(n,t){var e=arguments.length>2?arguments[2]:{},r=gk(t);mk&&(r=yk.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)wk(n,r[i],t[r[i]],e[r[i]])};Cy.supportsDescriptors=!!$y;var Ti=Cy,Kl={exports:{}};typeof self<"u"?Kl.exports=self:typeof window<"u"?Kl.exports=window:Kl.exports=Function("return this")();var Iy=Kl.exports,Sk=Iy,Ry=function(){return typeof Dr!="object"||!Dr||Dr.Math!==Math||Dr.Array!==Array?Sk:Dr},_k=Ti,kk=js,Ek=Ry,xk=function(){var t=Ek();if(_k.supportsDescriptors){var e=kk(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},Ak=Ti,Tk=Iy,Py=Ry,$k=xk,Ck=Py(),Ly=function(){return Ck};Ak(Ly,{getPolyfill:Py,implementation:Tk,shim:$k});var Cp=Ly,Vn=function(t){return!!t&&(typeof t=="function"||typeof t=="object")},Ip=Object,Dy=Error,Ik=EvalError,Rk=RangeError,Rp=ReferenceError,Pk=URIError,Lk=Math.abs,Dk=Math.floor,Mk=Math.max,Ok=Math.min,zk=Math.pow,Nk=Math.round,Pp=Number.isNaN||function(t){return t!==t},Uk=Pp,Fk=function(t){return Uk(t)||t===0?t:t<0?-1:1},Gs=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 o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==i||a.enumerable!==!0)return!1}return!0},_g=typeof Symbol<"u"&&Symbol,Hk=Gs,Lp=function(){return typeof _g!="function"||typeof Symbol!="function"||typeof _g("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Hk()},Gu,kg;function My(){return kg||(kg=1,Gu=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Gu}var qu,Eg;function Oy(){if(Eg)return qu;Eg=1;var n=Ip;return qu=n.getPrototypeOf||null,qu}var Vk="Function.prototype.bind called on incompatible ",Zk=Object.prototype.toString,Bk=Math.max,Wk="[object Function]",xg=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},jk=function(t,e){for(var r=[],i=e,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},Gk=function(n,t){for(var e="",r=0;r<n.length;r+=1)e+=n[r],r+1<n.length&&(e+=t);return e},qk=function(t){var e=this;if(typeof e!="function"||Zk.apply(e)!==Wk)throw new TypeError(Vk+e);for(var r=jk(arguments,1),i,s=function(){if(this instanceof i){var h=e.apply(this,xg(r,arguments));return Object(h)===h?h:this}return e.apply(t,xg(r,arguments))},o=Bk(0,e.length-r.length),a=[],c=0;c<o;c++)a[c]="$"+c;if(i=Function("binder","return function ("+Gk(a,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,i.prototype=new u,u.prototype=null}return i},Yk=qk,ol=Function.prototype.bind||Yk,Dp=Function.prototype.call,Mp=Function.prototype.apply,Kk=typeof Reflect<"u"&&Reflect&&Reflect.apply,Jk=ol,Xk=Mp,Qk=Dp,e1=Kk,zy=e1||Jk.call(Qk,Xk),t1=ol,n1=J,r1=Dp,i1=zy,lu=function(t){if(t.length<1||typeof t[0]!="function")throw new n1("a function is required");return i1(t1,r1,t)},Yu,Ag;function s1(){if(Ag)return Yu;Ag=1;var n=lu,t=js,e;try{e=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!e&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return Yu=r&&typeof r.get=="function"?n([r.get]):typeof s=="function"?function(a){return s(a==null?a:i(a))}:!1,Yu}var Ku,Tg;function Ny(){if(Tg)return Ku;Tg=1;var n=My(),t=Oy(),e=s1();return Ku=n?function(i){return n(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:e?function(i){return e(i)}:null,Ku}var o1=Function.prototype.call,a1=Object.prototype.hasOwnProperty,l1=ol,Zn=l1.call(o1,a1),Y,c1=Ip,u1=Dy,h1=Ik,d1=Rk,p1=Rp,Us=Hn,is=J,f1=Pk,g1=Lk,m1=Dk,v1=Mk,y1=Ok,b1=zk,w1=Nk,S1=Fk,Uy=Function,Ju=function(n){try{return Uy('"use strict"; return ('+n+").constructor;")()}catch{}},Fo=js,_1=sl,Xu=function(){throw new is},k1=Fo?function(){try{return arguments.callee,Xu}catch{try{return Fo(arguments,"callee").get}catch{return Xu}}}():Xu,Ni=Lp(),ze=Ny(),E1=Oy(),x1=My(),Fy=Mp,al=Dp,Bi={},A1=typeof Uint8Array>"u"||!ze?Y:ze(Uint8Array),vi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Y:ArrayBuffer,"%ArrayIteratorPrototype%":Ni&&ze?ze([][Symbol.iterator]()):Y,"%AsyncFromSyncIteratorPrototype%":Y,"%AsyncFunction%":Bi,"%AsyncGenerator%":Bi,"%AsyncGeneratorFunction%":Bi,"%AsyncIteratorPrototype%":Bi,"%Atomics%":typeof Atomics>"u"?Y:Atomics,"%BigInt%":typeof BigInt>"u"?Y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":u1,"%eval%":eval,"%EvalError%":h1,"%Float16Array%":typeof Float16Array>"u"?Y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Y:FinalizationRegistry,"%Function%":Uy,"%GeneratorFunction%":Bi,"%Int8Array%":typeof Int8Array>"u"?Y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ni&&ze?ze(ze([][Symbol.iterator]())):Y,"%JSON%":typeof JSON=="object"?JSON:Y,"%Map%":typeof Map>"u"?Y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ni||!ze?Y:ze(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":c1,"%Object.getOwnPropertyDescriptor%":Fo,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Y:Promise,"%Proxy%":typeof Proxy>"u"?Y:Proxy,"%RangeError%":d1,"%ReferenceError%":p1,"%Reflect%":typeof Reflect>"u"?Y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ni||!ze?Y:ze(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ni&&ze?ze(""[Symbol.iterator]()):Y,"%Symbol%":Ni?Symbol:Y,"%SyntaxError%":Us,"%ThrowTypeError%":k1,"%TypedArray%":A1,"%TypeError%":is,"%Uint8Array%":typeof Uint8Array>"u"?Y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Y:Uint32Array,"%URIError%":f1,"%WeakMap%":typeof WeakMap>"u"?Y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Y:WeakSet,"%Function.prototype.call%":al,"%Function.prototype.apply%":Fy,"%Object.defineProperty%":_1,"%Object.getPrototypeOf%":E1,"%Math.abs%":g1,"%Math.floor%":m1,"%Math.max%":v1,"%Math.min%":y1,"%Math.pow%":b1,"%Math.round%":w1,"%Math.sign%":S1,"%Reflect.getPrototypeOf%":x1};if(ze)try{null.error}catch(n){var T1=ze(ze(n));vi["%Error.prototype%"]=T1}var $1=function n(t){var e;if(t==="%AsyncFunction%")e=Ju("async function () {}");else if(t==="%GeneratorFunction%")e=Ju("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Ju("async function* () {}");else if(t==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&ze&&(e=ze(i.prototype))}return vi[t]=e,e},$g={__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"]},ll=ol,vc=Zn,C1=ll.call(al,Array.prototype.concat),I1=ll.call(Fy,Array.prototype.splice),Cg=ll.call(al,String.prototype.replace),yc=ll.call(al,String.prototype.slice),R1=ll.call(al,RegExp.prototype.exec),P1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L1=/\\(\\)?/g,D1=function(t){var e=yc(t,0,1),r=yc(t,-1);if(e==="%"&&r!=="%")throw new Us("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&e!=="%")throw new Us("invalid intrinsic syntax, expected opening `%`");var i=[];return Cg(t,P1,function(s,o,a,c){i[i.length]=a?Cg(c,L1,"$1"):o||s}),i},M1=function(t,e){var r=t,i;if(vc($g,r)&&(i=$g[r],r="%"+i[0]+"%"),vc(vi,r)){var s=vi[r];if(s===Bi&&(s=$1(r)),typeof s>"u"&&!e)throw new is("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Us("intrinsic "+t+" does not exist!")},Ct=function(t,e){if(typeof t!="string"||t.length===0)throw new is("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new is('"allowMissing" argument must be a boolean');if(R1(/^%?[^%]*%?$/,t)===null)throw new Us("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=D1(t),i=r.length>0?r[0]:"",s=M1("%"+i+"%",e),o=s.name,a=s.value,c=!1,u=s.alias;u&&(i=u[0],I1(r,C1([0,1],u)));for(var h=1,f=!0;h<r.length;h+=1){var v=r[h],y=yc(v,0,1),E=yc(v,-1);if((y==='"'||y==="'"||y==="`"||E==='"'||E==="'"||E==="`")&&y!==E)throw new Us("property names with quotes must have matching quotes");if((v==="constructor"||!f)&&(c=!0),i+="."+v,o="%"+i+"%",vc(vi,o))a=vi[o];else if(a!=null){if(!(v in a)){if(!e)throw new is("base intrinsic for "+t+" exists, but the property is not available.");return}if(Fo&&h+1>=r.length){var x=Fo(a,v);f=!!x,f&&"get"in x&&!("originalValue"in x.get)?a=x.get:a=a[v]}else f=vc(a,v),a=a[v];f&&!c&&(vi[o]=a)}}return a},Qu,Ig;function yr(){if(Ig)return Qu;Ig=1;var n=Ct,t=lu,e=t([n("%String.prototype.indexOf%")]);return Qu=function(i,s){var o=n(i,!!s);return typeof o=="function"&&e(i,".prototype.")>-1?t([o]):o},Qu}var eh,Rg;function Op(){if(Rg)return eh;Rg=1;var n=Ct,t=n("%Array%"),e=!t.isArray&&yr()("Object.prototype.toString");return eh=t.isArray||function(i){return e(i)==="[object Array]"},eh}var O1=au,Pg=sl,Hy=O1.hasArrayLengthDefineBug(),z1=Hy&&Op(),N1=yr(),U1=N1("Object.prototype.propertyIsEnumerable"),zp=function(t,e,r,i,s,o){if(!Pg){if(!t(o)||!o["[[Configurable]]"]||!o["[[Writable]]"]||s in i&&U1(i,s)!==!!o["[[Enumerable]]"])return!1;var a=o["[[Value]]"];return i[s]=a,e(i[s],a)}return Hy&&s==="length"&&"[[Value]]"in o&&z1(i)&&i.length!==o["[[Value]]"]?(i.length=o["[[Value]]"],i.length===o["[[Value]]"]):(Pg(i,s,r(o)),!0)},F1=J,ao=Zn,H1={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},qs=function(t){if(!t||typeof t!="object")return!1;for(var e in t)if(ao(t,e)&&!H1[e])return!1;var r=ao(t,"[[Value]]")||ao(t,"[[Writable]]"),i=ao(t,"[[Get]]")||ao(t,"[[Set]]");if(r&&i)throw new F1("Property Descriptors may not be both accessor and data descriptors");return!0},Vy=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},V1=J,Z1=qs,B1=Vy,Zy=function(t){if(typeof t<"u"&&!Z1(t))throw new V1("Assertion failed: `Desc` must be a Property Descriptor");return B1(t)},W1=J,Lg=Zn,j1=qs,By=function(t){if(typeof t>"u")return!1;if(!j1(t))throw new W1("Assertion failed: `Desc` must be a Property Descriptor");return!(!Lg(t,"[[Value]]")&&!Lg(t,"[[Writable]]"))},Ys=function(t){return typeof t=="string"||typeof t=="symbol"},Dg=Pp,Wy=function(t,e){return t===e?t===0?1/t===1/e:!0:Dg(t)&&Dg(e)},Mg=J,G1=Vn,q1=zp,Y1=Zy,K1=By,J1=Ys,X1=Wy,Np=function(t,e,r){if(!G1(t))throw new Mg("Assertion failed: Type(O) is not Object");if(!J1(e))throw new Mg("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return q1(K1,X1,Y1,t,e,i)},jy=Function.prototype.toString,Qi=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Gh,Jl;if(typeof Qi=="function"&&typeof Object.defineProperty=="function")try{Gh=Object.defineProperty({},"length",{get:function(){throw Jl}}),Jl={},Qi(function(){throw 42},null,Gh)}catch(n){n!==Jl&&(Qi=null)}else Qi=null;var Q1=/^\s*class\b/,qh=function(t){try{var e=jy.call(t);return Q1.test(e)}catch{return!1}},th=function(t){try{return qh(t)?!1:(jy.call(t),!0)}catch{return!1}},Xl=Object.prototype.toString,eE="[object Object]",tE="[object Function]",nE="[object GeneratorFunction]",rE="[object HTMLAllCollection]",iE="[object HTML document.all class]",sE="[object HTMLCollection]",oE=typeof Symbol=="function"&&!!Symbol.toStringTag,aE=!(0 in[,]),Yh=function(){return!1};if(typeof document=="object"){var lE=document.all;Xl.call(lE)===Xl.call(document.all)&&(Yh=function(t){if((aE||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=Xl.call(t);return(e===rE||e===iE||e===sE||e===eE)&&t("")==null}catch{}return!1})}var Gy=Qi?function(t){if(Yh(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Qi(t,null,Gh)}catch(e){if(e!==Jl)return!1}return!qh(t)&&th(t)}:function(t){if(Yh(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(oE)return th(t);if(qh(t))return!1;var e=Xl.call(t);return e!==tE&&e!==nE&&!/^\[object HTML/.test(e)?!1:th(t)},cE=Gy,uE=function(t){return!!t},Kt=Zn,$l=J,hE=Vn,Og=cE,nh=uE,dE=function(t){if(!hE(t))throw new $l("ToPropertyDescriptor requires an object");var e={};if(Kt(t,"enumerable")&&(e["[[Enumerable]]"]=nh(t.enumerable)),Kt(t,"configurable")&&(e["[[Configurable]]"]=nh(t.configurable)),Kt(t,"value")&&(e["[[Value]]"]=t.value),Kt(t,"writable")&&(e["[[Writable]]"]=nh(t.writable)),Kt(t,"get")){var r=t.get;if(typeof r<"u"&&!Og(r))throw new $l("getter must be a function");e["[[Get]]"]=r}if(Kt(t,"set")){var i=t.set;if(typeof i<"u"&&!Og(i))throw new $l("setter must be a function");e["[[Set]]"]=i}if((Kt(e,"[[Get]]")||Kt(e,"[[Set]]"))&&(Kt(e,"[[Value]]")||Kt(e,"[[Writable]]")))throw new $l("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},rh=J,pE=Vn,zg=qs,fE=zp,gE=Zy,mE=By,vE=Ys,yE=Wy,bE=dE,wE=function(t,e,r){if(!pE(t))throw new rh("Assertion failed: Type(O) is not Object");if(!vE(e))throw new rh("Assertion failed: P is not a Property Key");var i=zg(r)?r:bE(r);if(!zg(i))throw new rh("Assertion failed: Desc is not a valid Property Descriptor");return fE(mE,yE,gE,t,e,i)},Ng=J,SE=Vn,_E=wE,kE=Ys,EE=function(t,e,r){if(!SE(t))throw new Ng("Assertion failed: Type(O) is not Object");if(!kE(e))throw new Ng("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return _E(t,e,i)},xE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,AE=Ip,TE=AE.setPrototypeOf||null,$E=lu,Ug=js,CE=J,qy={};try{qy.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var IE=!("toString"in qy),ih=Ug&&Ug(Object.prototype,"__proto__"),RE=IE&&(!!ih&&typeof ih.set=="function"&&$E([ih.set])||function(t,e){if(t==null)throw new CE("set Object.prototype.__proto__ called on null or undefined");return t.__proto__=e,e}),Fg=xE,PE=TE,Hg=RE,LE=J,DE=Fg?function(t,e){if(Fg(t,e))return t;throw new LE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:PE||(Hg?function(t,e){return Hg(t,e),t}:null),Vg=J,ME=Vn,Zg=Ny(),OE=function(t){if(!ME(t))throw new Vg("Assertion failed: O must be an Object");if(!Zg)throw new Vg("This environment does not support fetching prototypes.");return Zg(t)},zE=J,NE=DE,UE=Vn,FE=OE,HE=function(t,e){if(e!==null&&!UE(e))throw new zE("Assertion failed: V must be Object or Null");try{NE(t,e)}catch{return!1}return FE(t)===e},sh=Np,Bg=EE,Yy=HE,VE=au(),Up=Dy;function cl(n,t,e){var r=new Up(e);return Yy(r,Ql),delete r.constructor,Bg(r,"error",n),Bg(r,"suppressed",t),r}VE&&Object.defineProperty(cl,"prototype",{writable:!1});var Ql=cl.prototype;if(!sh(Ql,"constructor",cl)||!sh(Ql,"message","")||!sh(Ql,"name","SuppressedError"))throw new Up("unable to install SuppressedError.prototype properties; please report this!");Yy(cl.prototype,Up.prototype);var ZE=cl,BE=ZE,Ky=function(){return typeof SuppressedError=="function"?SuppressedError:BE},WE=Ti,Wg=Cp(),jE=Ky,GE=function(){var t=jE();return WE(Wg,{SuppressedError:t},{SuppressedError:function(){return Wg.SuppressedError!==t}}),t};GE();var qE=J,YE=qs,KE=Vy,JE=function(t){if(typeof t<"u"&&!YE(t))throw new qE("Assertion failed: `Desc` must be a Property Descriptor");return KE(t)},XE=J,jg=Zn,QE=qs,ex=function(t){if(typeof t>"u")return!1;if(!QE(t))throw new XE("Assertion failed: `Desc` must be a Property Descriptor");return!(!jg(t,"[[Value]]")&&!jg(t,"[[Writable]]"))},Gg=Pp,tx=function(t,e){return t===e?t===0?1/t===1/e:!0:Gg(t)&&Gg(e)},Ks=Gy,nx=function(t){return!!t},Jt=Zn,Cl=J,rx=Vn,qg=Ks,oh=nx,ix=function(t){if(!rx(t))throw new Cl("ToPropertyDescriptor requires an object");var e={};if(Jt(t,"enumerable")&&(e["[[Enumerable]]"]=oh(t.enumerable)),Jt(t,"configurable")&&(e["[[Configurable]]"]=oh(t.configurable)),Jt(t,"value")&&(e["[[Value]]"]=t.value),Jt(t,"writable")&&(e["[[Writable]]"]=oh(t.writable)),Jt(t,"get")){var r=t.get;if(typeof r<"u"&&!qg(r))throw new Cl("getter must be a function");e["[[Get]]"]=r}if(Jt(t,"set")){var i=t.set;if(typeof i<"u"&&!qg(i))throw new Cl("setter must be a function");e["[[Set]]"]=i}if((Jt(e,"[[Get]]")||Jt(e,"[[Set]]"))&&(Jt(e,"[[Value]]")||Jt(e,"[[Writable]]")))throw new Cl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},ah=J,sx=Vn,Yg=qs,ox=zp,ax=JE,lx=ex,cx=Ys,ux=tx,hx=ix,ul=function(t,e,r){if(!sx(t))throw new ah("Assertion failed: Type(O) is not Object");if(!cx(e))throw new ah("Assertion failed: P is not a Property Key");var i=Yg(r)?r:hx(r);if(!Yg(i))throw new ah("Assertion failed: Desc is not a valid Property Descriptor");return ox(lx,ux,ax,t,e,i)},dx=Gs(),px=dx?Symbol.dispose||Symbol("Symbol.dispose"):null,fx=Gs,gx=px,Fp=function(){return fx()&&Symbol.dispose||gx},mx=Lp,vx=ul,yx=Fp,bx=function(){var t=yx();return mx()&&vx(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},wx=Gs(),Sx=wx?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,_x=Gs,kx=Sx,Hp=function(){return _x()&&Symbol.asyncDispose||kx},Ex=Lp,xx=ul,Ax=Hp,Tx=function(){var t=Ax();return Ex()&&xx(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},$x=Op(),Cx=Ct,Ix=yr(),Rx=J,Px=$x,Lx=Cx("%Reflect.apply%",!0)||Ix("Function.prototype.apply"),cu=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!Px(r))throw new Rx("Assertion failed: optional `argumentsList`, if provided, must be a List");return Lx(t,e,r)};const Dx={},Mx=Object.freeze(Object.defineProperty({__proto__:null,default:Dx},Symbol.toStringTag,{value:"Module"})),Ox=lk(Mx);var Vp=typeof Map=="function"&&Map.prototype,lh=Object.getOwnPropertyDescriptor&&Vp?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,bc=Vp&&lh&&typeof lh.get=="function"?lh.get:null,Kg=Vp&&Map.prototype.forEach,Zp=typeof Set=="function"&&Set.prototype,ch=Object.getOwnPropertyDescriptor&&Zp?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,wc=Zp&&ch&&typeof ch.get=="function"?ch.get:null,Jg=Zp&&Set.prototype.forEach,zx=typeof WeakMap=="function"&&WeakMap.prototype,Do=zx?WeakMap.prototype.has:null,Nx=typeof WeakSet=="function"&&WeakSet.prototype,Mo=Nx?WeakSet.prototype.has:null,Ux=typeof WeakRef=="function"&&WeakRef.prototype,Xg=Ux?WeakRef.prototype.deref:null,Fx=Boolean.prototype.valueOf,Hx=Object.prototype.toString,Vx=Function.prototype.toString,Zx=String.prototype.match,Bp=String.prototype.slice,cr=String.prototype.replace,Bx=String.prototype.toUpperCase,Qg=String.prototype.toLowerCase,Jy=RegExp.prototype.test,em=Array.prototype.concat,yn=Array.prototype.join,Wx=Array.prototype.slice,tm=Math.floor,Kh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,uh=Object.getOwnPropertySymbols,Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Oo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Fs||!0)?Symbol.toStringTag:null,Xy=Object.prototype.propertyIsEnumerable,nm=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function rm(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Jy.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-tm(-n):tm(n);if(r!==n){var i=String(r),s=Bp.call(t,i.length+1);return cr.call(i,e,"$&_")+"."+cr.call(cr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return cr.call(t,e,"$&_")}var Xh=Ox,im=Xh.custom,sm=tb(im)?im:null,Qy={__proto__:null,double:'"',single:"'"},jx={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Js=function n(t,e,r,i){var s=e||{};if($n(s,"quoteStyle")&&!$n(Qy,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($n(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 o=$n(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($n(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($n(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=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 rb(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?rm(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return a?rm(t,u):u}var h=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=h&&h>0&&typeof t=="object")return Qh(t)?"[Array]":"[Object]";var f=uA(s,r);if(typeof i>"u")i=[];else if(nb(i,t)>=0)return"[Circular]";function v(Gt,Bn,Ru){if(Bn&&(i=Wx.call(i),i.push(Bn)),Ru){var bl={depth:s.depth};return $n(s,"quoteStyle")&&(bl.quoteStyle=s.quoteStyle),n(Gt,bl,r+1,i)}return n(Gt,s,r+1,i)}if(typeof t=="function"&&!om(t)){var y=tA(t),E=Il(t,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(E.length>0?" { "+yn.call(E,", ")+" }":"")}if(tb(t)){var x=Fs?cr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jh.call(t);return typeof t=="object"&&!Fs?lo(x):x}if(aA(t)){for(var C="<"+Qg.call(String(t.nodeName)),L=t.attributes||[],R=0;R<L.length;R++)C+=" "+L[R].name+"="+eb(Gx(L[R].value),"double",s);return C+=">",t.childNodes&&t.childNodes.length&&(C+="..."),C+="</"+Qg.call(String(t.nodeName))+">",C}if(Qh(t)){if(t.length===0)return"[]";var W=Il(t,v);return f&&!cA(W)?"["+ed(W,f)+"]":"[ "+yn.call(W,", ")+" ]"}if(Yx(t)){var N=Il(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!Xy.call(t,"cause")?"{ ["+String(t)+"] "+yn.call(em.call("[cause]: "+v(t.cause),N),", ")+" }":N.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+yn.call(N,", ")+" }"}if(typeof t=="object"&&o){if(sm&&typeof t[sm]=="function"&&Xh)return Xh(t,{depth:h-r});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(nA(t)){var V=[];return Kg&&Kg.call(t,function(Gt,Bn){V.push(v(Bn,t,!0)+" => "+v(Gt,t))}),am("Map",bc.call(t),V,f)}if(sA(t)){var K=[];return Jg&&Jg.call(t,function(Gt){K.push(v(Gt,t))}),am("Set",wc.call(t),K,f)}if(rA(t))return hh("WeakMap");if(oA(t))return hh("WeakSet");if(iA(t))return hh("WeakRef");if(Jx(t))return lo(v(Number(t)));if(Qx(t))return lo(v(Kh.call(t)));if(Xx(t))return lo(Fx.call(t));if(Kx(t))return lo(v(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Dr<"u"&&t===Dr)return"{ [object globalThis] }";if(!qx(t)&&!om(t)){var G=Il(t,v),he=nm?nm(t)===Object.prototype:t instanceof Object||t.constructor===Object,Lt=t instanceof Object?"":"null prototype",_r=!he&&Oo&&Object(t)===t&&Oo in t?Bp.call(br(t),8,-1):Lt?"Object":"",He=he||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",kr=He+(_r||Lt?"["+yn.call(em.call([],_r||[],Lt||[]),": ")+"] ":"");return G.length===0?kr+"{}":f?kr+"{"+ed(G,f)+"}":kr+"{ "+yn.call(G,", ")+" }"}return String(t)};function eb(n,t,e){var r=e.quoteStyle||t,i=Qy[r];return i+n+i}function Gx(n){return cr.call(String(n),/"/g,""")}function $i(n){return!Oo||!(typeof n=="object"&&(Oo in n||typeof n[Oo]<"u"))}function Qh(n){return br(n)==="[object Array]"&&$i(n)}function qx(n){return br(n)==="[object Date]"&&$i(n)}function om(n){return br(n)==="[object RegExp]"&&$i(n)}function Yx(n){return br(n)==="[object Error]"&&$i(n)}function Kx(n){return br(n)==="[object String]"&&$i(n)}function Jx(n){return br(n)==="[object Number]"&&$i(n)}function Xx(n){return br(n)==="[object Boolean]"&&$i(n)}function tb(n){if(Fs)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Jh)return!1;try{return Jh.call(n),!0}catch{}return!1}function Qx(n){if(!n||typeof n!="object"||!Kh)return!1;try{return Kh.call(n),!0}catch{}return!1}var eA=Object.prototype.hasOwnProperty||function(n){return n in this};function $n(n,t){return eA.call(n,t)}function br(n){return Hx.call(n)}function tA(n){if(n.name)return n.name;var t=Zx.call(Vx.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function nb(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 nA(n){if(!bc||!n||typeof n!="object")return!1;try{bc.call(n);try{wc.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function rA(n){if(!Do||!n||typeof n!="object")return!1;try{Do.call(n,Do);try{Mo.call(n,Mo)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function iA(n){if(!Xg||!n||typeof n!="object")return!1;try{return Xg.call(n),!0}catch{}return!1}function sA(n){if(!wc||!n||typeof n!="object")return!1;try{wc.call(n);try{bc.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function oA(n){if(!Mo||!n||typeof n!="object")return!1;try{Mo.call(n,Mo);try{Do.call(n,Do)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function aA(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function rb(n,t){if(n.length>t.maxStringLength){var e=n.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return rb(Bp.call(n,0,t.maxStringLength),t)+r}var i=jx[t.quoteStyle||"single"];i.lastIndex=0;var s=cr.call(cr.call(n,i,"\\$1"),/[\x00-\x1f]/g,lA);return eb(s,"single",t)}function lA(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":"")+Bx.call(t.toString(16))}function lo(n){return"Object("+n+")"}function hh(n){return n+" { ? }"}function am(n,t,e,r){var i=r?ed(e,r):yn.call(e,", ");return n+" ("+t+") {"+i+"}"}function cA(n){for(var t=0;t<n.length;t++)if(nb(n[t],`
|
|
1
|
+
var X_=Object.defineProperty;var lg=n=>{throw TypeError(n)};var Q_=(n,t,e)=>t in n?X_(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var g=(n,t,e)=>Q_(n,typeof t!="symbol"?t+"":t,e),Zu=(n,t,e)=>t.has(n)||lg("Cannot "+e);var l=(n,t,e)=>(Zu(n,t,"read from private field"),e?e.call(n):t.get(n)),b=(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),m=(n,t,e,r)=>(Zu(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),d=(n,t,e)=>(Zu(n,t,"access private method"),e);var Bu=(n,t,e,r)=>({set _(i){m(n,t,i,e)},get _(){return l(n,t,r)}});import{i as cg,a as Wu,b as ug,c as hg,d as dg,e as ek,U as tk,f as pg,g as fg,A as nk,h as rk,j as ik}from"./artifact-bridge-BhiFDvPj.js";import{m as sk,a as ok,b as ak}from"./missing-artifact-page-DVzJ41AE.js";var Dr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lk(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 gg=Object.prototype.toString,xy=function(t){var e=gg.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&gg.call(t.callee)==="[object Function]"),r},ju,mg;function ck(){if(mg)return ju;mg=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=xy,i=Object.prototype.propertyIsEnumerable,s=!i.call({toString:null},"toString"),o=i.call(function(){},"prototype"),a=["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},h=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}(),f=function(v){if(typeof window>"u"||!h)return c(v);try{return c(v)}catch{return!1}};n=function(y){var E=y!==null&&typeof y=="object",x=e.call(y)==="[object Function]",C=r(y),L=E&&e.call(y)==="[object String]",R=[];if(!E&&!x&&!C)throw new TypeError("Object.keys called on a non-object");var W=o&&x;if(L&&y.length>0&&!t.call(y,0))for(var N=0;N<y.length;++N)R.push(String(N));if(C&&y.length>0)for(var V=0;V<y.length;++V)R.push(String(V));else for(var K in y)!(W&&K==="prototype")&&t.call(y,K)&&R.push(String(K));if(s)for(var G=f(y),he=0;he<a.length;++he)!(G&&a[he]==="constructor")&&t.call(y,a[he])&&R.push(a[he]);return R}}return ju=n,ju}var uk=Array.prototype.slice,hk=xy,vg=Object.keys,Gl=vg?function(t){return vg(t)}:ck(),yg=Object.keys;Gl.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 hk(r)?yg(uk.call(r)):yg(r)})}else Object.keys=Gl;return Object.keys||Gl};var dk=Gl,ql=Object.defineProperty||!1;if(ql)try{ql({},"a",{value:1})}catch{ql=!1}var sl=ql,Hn=SyntaxError,J=TypeError,pk=Object.getOwnPropertyDescriptor,Yl=pk;if(Yl)try{Yl([],"length")}catch{Yl=null}var js=Yl,bg=sl,fk=Hn,zi=J,wg=js,Ay=function(t,e,r){if(!t||typeof t!="object"&&typeof t!="function")throw new zi("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new zi("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new zi("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new zi("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new zi("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new zi("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,c=!!wg&&wg(t,e);if(bg)bg(t,e,{configurable:o===null&&c?c.configurable:!o,enumerable:i===null&&c?c.enumerable:!i,value:r,writable:s===null&&c?c.writable:!s});else if(a||!i&&!s&&!o)t[e]=r;else throw new fk("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},jh=sl,Ty=function(){return!!jh};Ty.hasArrayLengthDefineBug=function(){if(!jh)return null;try{return jh([],"length",{value:1}).length!==1}catch{return!0}};var au=Ty,gk=dk,mk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",vk=Object.prototype.toString,yk=Array.prototype.concat,Sg=Ay,bk=function(n){return typeof n=="function"&&vk.call(n)==="[object Function]"},$y=au(),wk=function(n,t,e,r){if(t in n){if(r===!0){if(n[t]===e)return}else if(!bk(r)||!r())return}$y?Sg(n,t,e,!0):Sg(n,t,e)},Cy=function(n,t){var e=arguments.length>2?arguments[2]:{},r=gk(t);mk&&(r=yk.call(r,Object.getOwnPropertySymbols(t)));for(var i=0;i<r.length;i+=1)wk(n,r[i],t[r[i]],e[r[i]])};Cy.supportsDescriptors=!!$y;var Ti=Cy,Kl={exports:{}};typeof self<"u"?Kl.exports=self:typeof window<"u"?Kl.exports=window:Kl.exports=Function("return this")();var Iy=Kl.exports,Sk=Iy,Ry=function(){return typeof Dr!="object"||!Dr||Dr.Math!==Math||Dr.Array!==Array?Sk:Dr},_k=Ti,kk=js,Ek=Ry,xk=function(){var t=Ek();if(_k.supportsDescriptors){var e=kk(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},Ak=Ti,Tk=Iy,Py=Ry,$k=xk,Ck=Py(),Ly=function(){return Ck};Ak(Ly,{getPolyfill:Py,implementation:Tk,shim:$k});var Cp=Ly,Vn=function(t){return!!t&&(typeof t=="function"||typeof t=="object")},Ip=Object,Dy=Error,Ik=EvalError,Rk=RangeError,Rp=ReferenceError,Pk=URIError,Lk=Math.abs,Dk=Math.floor,Mk=Math.max,Ok=Math.min,zk=Math.pow,Nk=Math.round,Pp=Number.isNaN||function(t){return t!==t},Uk=Pp,Fk=function(t){return Uk(t)||t===0?t:t<0?-1:1},Gs=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 o=Object.getOwnPropertySymbols(t);if(o.length!==1||o[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(t,e);if(a.value!==i||a.enumerable!==!0)return!1}return!0},_g=typeof Symbol<"u"&&Symbol,Hk=Gs,Lp=function(){return typeof _g!="function"||typeof Symbol!="function"||typeof _g("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Hk()},Gu,kg;function My(){return kg||(kg=1,Gu=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Gu}var qu,Eg;function Oy(){if(Eg)return qu;Eg=1;var n=Ip;return qu=n.getPrototypeOf||null,qu}var Vk="Function.prototype.bind called on incompatible ",Zk=Object.prototype.toString,Bk=Math.max,Wk="[object Function]",xg=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},jk=function(t,e){for(var r=[],i=e,s=0;i<t.length;i+=1,s+=1)r[s]=t[i];return r},Gk=function(n,t){for(var e="",r=0;r<n.length;r+=1)e+=n[r],r+1<n.length&&(e+=t);return e},qk=function(t){var e=this;if(typeof e!="function"||Zk.apply(e)!==Wk)throw new TypeError(Vk+e);for(var r=jk(arguments,1),i,s=function(){if(this instanceof i){var h=e.apply(this,xg(r,arguments));return Object(h)===h?h:this}return e.apply(t,xg(r,arguments))},o=Bk(0,e.length-r.length),a=[],c=0;c<o;c++)a[c]="$"+c;if(i=Function("binder","return function ("+Gk(a,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,i.prototype=new u,u.prototype=null}return i},Yk=qk,ol=Function.prototype.bind||Yk,Dp=Function.prototype.call,Mp=Function.prototype.apply,Kk=typeof Reflect<"u"&&Reflect&&Reflect.apply,Jk=ol,Xk=Mp,Qk=Dp,e1=Kk,zy=e1||Jk.call(Qk,Xk),t1=ol,n1=J,r1=Dp,i1=zy,lu=function(t){if(t.length<1||typeof t[0]!="function")throw new n1("a function is required");return i1(t1,r1,t)},Yu,Ag;function s1(){if(Ag)return Yu;Ag=1;var n=lu,t=js,e;try{e=[].__proto__===Array.prototype}catch(o){if(!o||typeof o!="object"||!("code"in o)||o.code!=="ERR_PROTO_ACCESS")throw o}var r=!!e&&t&&t(Object.prototype,"__proto__"),i=Object,s=i.getPrototypeOf;return Yu=r&&typeof r.get=="function"?n([r.get]):typeof s=="function"?function(a){return s(a==null?a:i(a))}:!1,Yu}var Ku,Tg;function Ny(){if(Tg)return Ku;Tg=1;var n=My(),t=Oy(),e=s1();return Ku=n?function(i){return n(i)}:t?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return t(i)}:e?function(i){return e(i)}:null,Ku}var o1=Function.prototype.call,a1=Object.prototype.hasOwnProperty,l1=ol,Zn=l1.call(o1,a1),Y,c1=Ip,u1=Dy,h1=Ik,d1=Rk,p1=Rp,Us=Hn,is=J,f1=Pk,g1=Lk,m1=Dk,v1=Mk,y1=Ok,b1=zk,w1=Nk,S1=Fk,Uy=Function,Ju=function(n){try{return Uy('"use strict"; return ('+n+").constructor;")()}catch{}},Fo=js,_1=sl,Xu=function(){throw new is},k1=Fo?function(){try{return arguments.callee,Xu}catch{try{return Fo(arguments,"callee").get}catch{return Xu}}}():Xu,Ni=Lp(),ze=Ny(),E1=Oy(),x1=My(),Fy=Mp,al=Dp,Bi={},A1=typeof Uint8Array>"u"||!ze?Y:ze(Uint8Array),vi={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Y:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Y:ArrayBuffer,"%ArrayIteratorPrototype%":Ni&&ze?ze([][Symbol.iterator]()):Y,"%AsyncFromSyncIteratorPrototype%":Y,"%AsyncFunction%":Bi,"%AsyncGenerator%":Bi,"%AsyncGeneratorFunction%":Bi,"%AsyncIteratorPrototype%":Bi,"%Atomics%":typeof Atomics>"u"?Y:Atomics,"%BigInt%":typeof BigInt>"u"?Y:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Y:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Y:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Y:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":u1,"%eval%":eval,"%EvalError%":h1,"%Float16Array%":typeof Float16Array>"u"?Y:Float16Array,"%Float32Array%":typeof Float32Array>"u"?Y:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Y:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Y:FinalizationRegistry,"%Function%":Uy,"%GeneratorFunction%":Bi,"%Int8Array%":typeof Int8Array>"u"?Y:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Y:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Y:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ni&&ze?ze(ze([][Symbol.iterator]())):Y,"%JSON%":typeof JSON=="object"?JSON:Y,"%Map%":typeof Map>"u"?Y:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ni||!ze?Y:ze(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":c1,"%Object.getOwnPropertyDescriptor%":Fo,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Y:Promise,"%Proxy%":typeof Proxy>"u"?Y:Proxy,"%RangeError%":d1,"%ReferenceError%":p1,"%Reflect%":typeof Reflect>"u"?Y:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Y:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ni||!ze?Y:ze(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Y:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ni&&ze?ze(""[Symbol.iterator]()):Y,"%Symbol%":Ni?Symbol:Y,"%SyntaxError%":Us,"%ThrowTypeError%":k1,"%TypedArray%":A1,"%TypeError%":is,"%Uint8Array%":typeof Uint8Array>"u"?Y:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Y:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Y:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Y:Uint32Array,"%URIError%":f1,"%WeakMap%":typeof WeakMap>"u"?Y:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Y:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Y:WeakSet,"%Function.prototype.call%":al,"%Function.prototype.apply%":Fy,"%Object.defineProperty%":_1,"%Object.getPrototypeOf%":E1,"%Math.abs%":g1,"%Math.floor%":m1,"%Math.max%":v1,"%Math.min%":y1,"%Math.pow%":b1,"%Math.round%":w1,"%Math.sign%":S1,"%Reflect.getPrototypeOf%":x1};if(ze)try{null.error}catch(n){var T1=ze(ze(n));vi["%Error.prototype%"]=T1}var $1=function n(t){var e;if(t==="%AsyncFunction%")e=Ju("async function () {}");else if(t==="%GeneratorFunction%")e=Ju("function* () {}");else if(t==="%AsyncGeneratorFunction%")e=Ju("async function* () {}");else if(t==="%AsyncGenerator%"){var r=n("%AsyncGeneratorFunction%");r&&(e=r.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=n("%AsyncGenerator%");i&&ze&&(e=ze(i.prototype))}return vi[t]=e,e},$g={__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"]},ll=ol,vc=Zn,C1=ll.call(al,Array.prototype.concat),I1=ll.call(Fy,Array.prototype.splice),Cg=ll.call(al,String.prototype.replace),yc=ll.call(al,String.prototype.slice),R1=ll.call(al,RegExp.prototype.exec),P1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,L1=/\\(\\)?/g,D1=function(t){var e=yc(t,0,1),r=yc(t,-1);if(e==="%"&&r!=="%")throw new Us("invalid intrinsic syntax, expected closing `%`");if(r==="%"&&e!=="%")throw new Us("invalid intrinsic syntax, expected opening `%`");var i=[];return Cg(t,P1,function(s,o,a,c){i[i.length]=a?Cg(c,L1,"$1"):o||s}),i},M1=function(t,e){var r=t,i;if(vc($g,r)&&(i=$g[r],r="%"+i[0]+"%"),vc(vi,r)){var s=vi[r];if(s===Bi&&(s=$1(r)),typeof s>"u"&&!e)throw new is("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:r,value:s}}throw new Us("intrinsic "+t+" does not exist!")},Ct=function(t,e){if(typeof t!="string"||t.length===0)throw new is("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new is('"allowMissing" argument must be a boolean');if(R1(/^%?[^%]*%?$/,t)===null)throw new Us("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=D1(t),i=r.length>0?r[0]:"",s=M1("%"+i+"%",e),o=s.name,a=s.value,c=!1,u=s.alias;u&&(i=u[0],I1(r,C1([0,1],u)));for(var h=1,f=!0;h<r.length;h+=1){var v=r[h],y=yc(v,0,1),E=yc(v,-1);if((y==='"'||y==="'"||y==="`"||E==='"'||E==="'"||E==="`")&&y!==E)throw new Us("property names with quotes must have matching quotes");if((v==="constructor"||!f)&&(c=!0),i+="."+v,o="%"+i+"%",vc(vi,o))a=vi[o];else if(a!=null){if(!(v in a)){if(!e)throw new is("base intrinsic for "+t+" exists, but the property is not available.");return}if(Fo&&h+1>=r.length){var x=Fo(a,v);f=!!x,f&&"get"in x&&!("originalValue"in x.get)?a=x.get:a=a[v]}else f=vc(a,v),a=a[v];f&&!c&&(vi[o]=a)}}return a},Qu,Ig;function yr(){if(Ig)return Qu;Ig=1;var n=Ct,t=lu,e=t([n("%String.prototype.indexOf%")]);return Qu=function(i,s){var o=n(i,!!s);return typeof o=="function"&&e(i,".prototype.")>-1?t([o]):o},Qu}var eh,Rg;function Op(){if(Rg)return eh;Rg=1;var n=Ct,t=n("%Array%"),e=!t.isArray&&yr()("Object.prototype.toString");return eh=t.isArray||function(i){return e(i)==="[object Array]"},eh}var O1=au,Pg=sl,Hy=O1.hasArrayLengthDefineBug(),z1=Hy&&Op(),N1=yr(),U1=N1("Object.prototype.propertyIsEnumerable"),zp=function(t,e,r,i,s,o){if(!Pg){if(!t(o)||!o["[[Configurable]]"]||!o["[[Writable]]"]||s in i&&U1(i,s)!==!!o["[[Enumerable]]"])return!1;var a=o["[[Value]]"];return i[s]=a,e(i[s],a)}return Hy&&s==="length"&&"[[Value]]"in o&&z1(i)&&i.length!==o["[[Value]]"]?(i.length=o["[[Value]]"],i.length===o["[[Value]]"]):(Pg(i,s,r(o)),!0)},F1=J,ao=Zn,H1={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0},qs=function(t){if(!t||typeof t!="object")return!1;for(var e in t)if(ao(t,e)&&!H1[e])return!1;var r=ao(t,"[[Value]]")||ao(t,"[[Writable]]"),i=ao(t,"[[Get]]")||ao(t,"[[Set]]");if(r&&i)throw new F1("Property Descriptors may not be both accessor and data descriptors");return!0},Vy=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},V1=J,Z1=qs,B1=Vy,Zy=function(t){if(typeof t<"u"&&!Z1(t))throw new V1("Assertion failed: `Desc` must be a Property Descriptor");return B1(t)},W1=J,Lg=Zn,j1=qs,By=function(t){if(typeof t>"u")return!1;if(!j1(t))throw new W1("Assertion failed: `Desc` must be a Property Descriptor");return!(!Lg(t,"[[Value]]")&&!Lg(t,"[[Writable]]"))},Ys=function(t){return typeof t=="string"||typeof t=="symbol"},Dg=Pp,Wy=function(t,e){return t===e?t===0?1/t===1/e:!0:Dg(t)&&Dg(e)},Mg=J,G1=Vn,q1=zp,Y1=Zy,K1=By,J1=Ys,X1=Wy,Np=function(t,e,r){if(!G1(t))throw new Mg("Assertion failed: Type(O) is not Object");if(!J1(e))throw new Mg("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return q1(K1,X1,Y1,t,e,i)},jy=Function.prototype.toString,Qi=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,Gh,Jl;if(typeof Qi=="function"&&typeof Object.defineProperty=="function")try{Gh=Object.defineProperty({},"length",{get:function(){throw Jl}}),Jl={},Qi(function(){throw 42},null,Gh)}catch(n){n!==Jl&&(Qi=null)}else Qi=null;var Q1=/^\s*class\b/,qh=function(t){try{var e=jy.call(t);return Q1.test(e)}catch{return!1}},th=function(t){try{return qh(t)?!1:(jy.call(t),!0)}catch{return!1}},Xl=Object.prototype.toString,eE="[object Object]",tE="[object Function]",nE="[object GeneratorFunction]",rE="[object HTMLAllCollection]",iE="[object HTML document.all class]",sE="[object HTMLCollection]",oE=typeof Symbol=="function"&&!!Symbol.toStringTag,aE=!(0 in[,]),Yh=function(){return!1};if(typeof document=="object"){var lE=document.all;Xl.call(lE)===Xl.call(document.all)&&(Yh=function(t){if((aE||!t)&&(typeof t>"u"||typeof t=="object"))try{var e=Xl.call(t);return(e===rE||e===iE||e===sE||e===eE)&&t("")==null}catch{}return!1})}var Gy=Qi?function(t){if(Yh(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;try{Qi(t,null,Gh)}catch(e){if(e!==Jl)return!1}return!qh(t)&&th(t)}:function(t){if(Yh(t))return!0;if(!t||typeof t!="function"&&typeof t!="object")return!1;if(oE)return th(t);if(qh(t))return!1;var e=Xl.call(t);return e!==tE&&e!==nE&&!/^\[object HTML/.test(e)?!1:th(t)},cE=Gy,uE=function(t){return!!t},Kt=Zn,$l=J,hE=Vn,Og=cE,nh=uE,dE=function(t){if(!hE(t))throw new $l("ToPropertyDescriptor requires an object");var e={};if(Kt(t,"enumerable")&&(e["[[Enumerable]]"]=nh(t.enumerable)),Kt(t,"configurable")&&(e["[[Configurable]]"]=nh(t.configurable)),Kt(t,"value")&&(e["[[Value]]"]=t.value),Kt(t,"writable")&&(e["[[Writable]]"]=nh(t.writable)),Kt(t,"get")){var r=t.get;if(typeof r<"u"&&!Og(r))throw new $l("getter must be a function");e["[[Get]]"]=r}if(Kt(t,"set")){var i=t.set;if(typeof i<"u"&&!Og(i))throw new $l("setter must be a function");e["[[Set]]"]=i}if((Kt(e,"[[Get]]")||Kt(e,"[[Set]]"))&&(Kt(e,"[[Value]]")||Kt(e,"[[Writable]]")))throw new $l("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},rh=J,pE=Vn,zg=qs,fE=zp,gE=Zy,mE=By,vE=Ys,yE=Wy,bE=dE,wE=function(t,e,r){if(!pE(t))throw new rh("Assertion failed: Type(O) is not Object");if(!vE(e))throw new rh("Assertion failed: P is not a Property Key");var i=zg(r)?r:bE(r);if(!zg(i))throw new rh("Assertion failed: Desc is not a valid Property Descriptor");return fE(mE,yE,gE,t,e,i)},Ng=J,SE=Vn,_E=wE,kE=Ys,EE=function(t,e,r){if(!SE(t))throw new Ng("Assertion failed: Type(O) is not Object");if(!kE(e))throw new Ng("Assertion failed: P is not a Property Key");var i={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":r,"[[Writable]]":!0};return _E(t,e,i)},xE=typeof Reflect<"u"&&Reflect.setPrototypeOf||null,AE=Ip,TE=AE.setPrototypeOf||null,$E=lu,Ug=js,CE=J,qy={};try{qy.__proto__=null}catch(n){if(!n||typeof n!="object"||!("code"in n)||n.code!=="ERR_PROTO_ACCESS")throw n}var IE=!("toString"in qy),ih=Ug&&Ug(Object.prototype,"__proto__"),RE=IE&&(!!ih&&typeof ih.set=="function"&&$E([ih.set])||function(t,e){if(t==null)throw new CE("set Object.prototype.__proto__ called on null or undefined");return t.__proto__=e,e}),Fg=xE,PE=TE,Hg=RE,LE=J,DE=Fg?function(t,e){if(Fg(t,e))return t;throw new LE("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:PE||(Hg?function(t,e){return Hg(t,e),t}:null),Vg=J,ME=Vn,Zg=Ny(),OE=function(t){if(!ME(t))throw new Vg("Assertion failed: O must be an Object");if(!Zg)throw new Vg("This environment does not support fetching prototypes.");return Zg(t)},zE=J,NE=DE,UE=Vn,FE=OE,HE=function(t,e){if(e!==null&&!UE(e))throw new zE("Assertion failed: V must be Object or Null");try{NE(t,e)}catch{return!1}return FE(t)===e},sh=Np,Bg=EE,Yy=HE,VE=au(),Up=Dy;function cl(n,t,e){var r=new Up(e);return Yy(r,Ql),delete r.constructor,Bg(r,"error",n),Bg(r,"suppressed",t),r}VE&&Object.defineProperty(cl,"prototype",{writable:!1});var Ql=cl.prototype;if(!sh(Ql,"constructor",cl)||!sh(Ql,"message","")||!sh(Ql,"name","SuppressedError"))throw new Up("unable to install SuppressedError.prototype properties; please report this!");Yy(cl.prototype,Up.prototype);var ZE=cl,BE=ZE,Ky=function(){return typeof SuppressedError=="function"?SuppressedError:BE},WE=Ti,Wg=Cp(),jE=Ky,GE=function(){var t=jE();return WE(Wg,{SuppressedError:t},{SuppressedError:function(){return Wg.SuppressedError!==t}}),t};GE();var qE=J,YE=qs,KE=Vy,JE=function(t){if(typeof t<"u"&&!YE(t))throw new qE("Assertion failed: `Desc` must be a Property Descriptor");return KE(t)},XE=J,jg=Zn,QE=qs,ex=function(t){if(typeof t>"u")return!1;if(!QE(t))throw new XE("Assertion failed: `Desc` must be a Property Descriptor");return!(!jg(t,"[[Value]]")&&!jg(t,"[[Writable]]"))},Gg=Pp,tx=function(t,e){return t===e?t===0?1/t===1/e:!0:Gg(t)&&Gg(e)},Ks=Gy,nx=function(t){return!!t},Jt=Zn,Cl=J,rx=Vn,qg=Ks,oh=nx,ix=function(t){if(!rx(t))throw new Cl("ToPropertyDescriptor requires an object");var e={};if(Jt(t,"enumerable")&&(e["[[Enumerable]]"]=oh(t.enumerable)),Jt(t,"configurable")&&(e["[[Configurable]]"]=oh(t.configurable)),Jt(t,"value")&&(e["[[Value]]"]=t.value),Jt(t,"writable")&&(e["[[Writable]]"]=oh(t.writable)),Jt(t,"get")){var r=t.get;if(typeof r<"u"&&!qg(r))throw new Cl("getter must be a function");e["[[Get]]"]=r}if(Jt(t,"set")){var i=t.set;if(typeof i<"u"&&!qg(i))throw new Cl("setter must be a function");e["[[Set]]"]=i}if((Jt(e,"[[Get]]")||Jt(e,"[[Set]]"))&&(Jt(e,"[[Value]]")||Jt(e,"[[Writable]]")))throw new Cl("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return e},ah=J,sx=Vn,Yg=qs,ox=zp,ax=JE,lx=ex,cx=Ys,ux=tx,hx=ix,ul=function(t,e,r){if(!sx(t))throw new ah("Assertion failed: Type(O) is not Object");if(!cx(e))throw new ah("Assertion failed: P is not a Property Key");var i=Yg(r)?r:hx(r);if(!Yg(i))throw new ah("Assertion failed: Desc is not a valid Property Descriptor");return ox(lx,ux,ax,t,e,i)},dx=Gs(),px=dx?Symbol.dispose||Symbol("Symbol.dispose"):null,fx=Gs,gx=px,Fp=function(){return fx()&&Symbol.dispose||gx},mx=Lp,vx=ul,yx=Fp,bx=function(){var t=yx();return mx()&&vx(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},wx=Gs(),Sx=wx?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,_x=Gs,kx=Sx,Hp=function(){return _x()&&Symbol.asyncDispose||kx},Ex=Lp,xx=ul,Ax=Hp,Tx=function(){var t=Ax();return Ex()&&xx(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":t}),t},$x=Op(),Cx=Ct,Ix=yr(),Rx=J,Px=$x,Lx=Cx("%Reflect.apply%",!0)||Ix("Function.prototype.apply"),cu=function(t,e){var r=arguments.length>2?arguments[2]:[];if(!Px(r))throw new Rx("Assertion failed: optional `argumentsList`, if provided, must be a List");return Lx(t,e,r)};const Dx={},Mx=Object.freeze(Object.defineProperty({__proto__:null,default:Dx},Symbol.toStringTag,{value:"Module"})),Ox=lk(Mx);var Vp=typeof Map=="function"&&Map.prototype,lh=Object.getOwnPropertyDescriptor&&Vp?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,bc=Vp&&lh&&typeof lh.get=="function"?lh.get:null,Kg=Vp&&Map.prototype.forEach,Zp=typeof Set=="function"&&Set.prototype,ch=Object.getOwnPropertyDescriptor&&Zp?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,wc=Zp&&ch&&typeof ch.get=="function"?ch.get:null,Jg=Zp&&Set.prototype.forEach,zx=typeof WeakMap=="function"&&WeakMap.prototype,Do=zx?WeakMap.prototype.has:null,Nx=typeof WeakSet=="function"&&WeakSet.prototype,Mo=Nx?WeakSet.prototype.has:null,Ux=typeof WeakRef=="function"&&WeakRef.prototype,Xg=Ux?WeakRef.prototype.deref:null,Fx=Boolean.prototype.valueOf,Hx=Object.prototype.toString,Vx=Function.prototype.toString,Zx=String.prototype.match,Bp=String.prototype.slice,cr=String.prototype.replace,Bx=String.prototype.toUpperCase,Qg=String.prototype.toLowerCase,Jy=RegExp.prototype.test,em=Array.prototype.concat,yn=Array.prototype.join,Wx=Array.prototype.slice,tm=Math.floor,Kh=typeof BigInt=="function"?BigInt.prototype.valueOf:null,uh=Object.getOwnPropertySymbols,Jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Fs=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Oo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Fs||!0)?Symbol.toStringTag:null,Xy=Object.prototype.propertyIsEnumerable,nm=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(n){return n.__proto__}:null);function rm(n,t){if(n===1/0||n===-1/0||n!==n||n&&n>-1e3&&n<1e3||Jy.call(/e/,t))return t;var e=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof n=="number"){var r=n<0?-tm(-n):tm(n);if(r!==n){var i=String(r),s=Bp.call(t,i.length+1);return cr.call(i,e,"$&_")+"."+cr.call(cr.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return cr.call(t,e,"$&_")}var Xh=Ox,im=Xh.custom,sm=tb(im)?im:null,Qy={__proto__:null,double:'"',single:"'"},jx={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Js=function n(t,e,r,i){var s=e||{};if($n(s,"quoteStyle")&&!$n(Qy,s.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if($n(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 o=$n(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if($n(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($n(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=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 rb(t,s);if(typeof t=="number"){if(t===0)return 1/0/t>0?"0":"-0";var c=String(t);return a?rm(t,c):c}if(typeof t=="bigint"){var u=String(t)+"n";return a?rm(t,u):u}var h=typeof s.depth>"u"?5:s.depth;if(typeof r>"u"&&(r=0),r>=h&&h>0&&typeof t=="object")return Qh(t)?"[Array]":"[Object]";var f=uA(s,r);if(typeof i>"u")i=[];else if(nb(i,t)>=0)return"[Circular]";function v(Gt,Bn,Ru){if(Bn&&(i=Wx.call(i),i.push(Bn)),Ru){var bl={depth:s.depth};return $n(s,"quoteStyle")&&(bl.quoteStyle=s.quoteStyle),n(Gt,bl,r+1,i)}return n(Gt,s,r+1,i)}if(typeof t=="function"&&!om(t)){var y=tA(t),E=Il(t,v);return"[Function"+(y?": "+y:" (anonymous)")+"]"+(E.length>0?" { "+yn.call(E,", ")+" }":"")}if(tb(t)){var x=Fs?cr.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):Jh.call(t);return typeof t=="object"&&!Fs?lo(x):x}if(aA(t)){for(var C="<"+Qg.call(String(t.nodeName)),L=t.attributes||[],R=0;R<L.length;R++)C+=" "+L[R].name+"="+eb(Gx(L[R].value),"double",s);return C+=">",t.childNodes&&t.childNodes.length&&(C+="..."),C+="</"+Qg.call(String(t.nodeName))+">",C}if(Qh(t)){if(t.length===0)return"[]";var W=Il(t,v);return f&&!cA(W)?"["+ed(W,f)+"]":"[ "+yn.call(W,", ")+" ]"}if(Yx(t)){var N=Il(t,v);return!("cause"in Error.prototype)&&"cause"in t&&!Xy.call(t,"cause")?"{ ["+String(t)+"] "+yn.call(em.call("[cause]: "+v(t.cause),N),", ")+" }":N.length===0?"["+String(t)+"]":"{ ["+String(t)+"] "+yn.call(N,", ")+" }"}if(typeof t=="object"&&o){if(sm&&typeof t[sm]=="function"&&Xh)return Xh(t,{depth:h-r});if(o!=="symbol"&&typeof t.inspect=="function")return t.inspect()}if(nA(t)){var V=[];return Kg&&Kg.call(t,function(Gt,Bn){V.push(v(Bn,t,!0)+" => "+v(Gt,t))}),am("Map",bc.call(t),V,f)}if(sA(t)){var K=[];return Jg&&Jg.call(t,function(Gt){K.push(v(Gt,t))}),am("Set",wc.call(t),K,f)}if(rA(t))return hh("WeakMap");if(oA(t))return hh("WeakSet");if(iA(t))return hh("WeakRef");if(Jx(t))return lo(v(Number(t)));if(Qx(t))return lo(v(Kh.call(t)));if(Xx(t))return lo(Fx.call(t));if(Kx(t))return lo(v(String(t)));if(typeof window<"u"&&t===window)return"{ [object Window] }";if(typeof globalThis<"u"&&t===globalThis||typeof Dr<"u"&&t===Dr)return"{ [object globalThis] }";if(!qx(t)&&!om(t)){var G=Il(t,v),he=nm?nm(t)===Object.prototype:t instanceof Object||t.constructor===Object,Lt=t instanceof Object?"":"null prototype",_r=!he&&Oo&&Object(t)===t&&Oo in t?Bp.call(br(t),8,-1):Lt?"Object":"",He=he||typeof t.constructor!="function"?"":t.constructor.name?t.constructor.name+" ":"",kr=He+(_r||Lt?"["+yn.call(em.call([],_r||[],Lt||[]),": ")+"] ":"");return G.length===0?kr+"{}":f?kr+"{"+ed(G,f)+"}":kr+"{ "+yn.call(G,", ")+" }"}return String(t)};function eb(n,t,e){var r=e.quoteStyle||t,i=Qy[r];return i+n+i}function Gx(n){return cr.call(String(n),/"/g,""")}function $i(n){return!Oo||!(typeof n=="object"&&(Oo in n||typeof n[Oo]<"u"))}function Qh(n){return br(n)==="[object Array]"&&$i(n)}function qx(n){return br(n)==="[object Date]"&&$i(n)}function om(n){return br(n)==="[object RegExp]"&&$i(n)}function Yx(n){return br(n)==="[object Error]"&&$i(n)}function Kx(n){return br(n)==="[object String]"&&$i(n)}function Jx(n){return br(n)==="[object Number]"&&$i(n)}function Xx(n){return br(n)==="[object Boolean]"&&$i(n)}function tb(n){if(Fs)return n&&typeof n=="object"&&n instanceof Symbol;if(typeof n=="symbol")return!0;if(!n||typeof n!="object"||!Jh)return!1;try{return Jh.call(n),!0}catch{}return!1}function Qx(n){if(!n||typeof n!="object"||!Kh)return!1;try{return Kh.call(n),!0}catch{}return!1}var eA=Object.prototype.hasOwnProperty||function(n){return n in this};function $n(n,t){return eA.call(n,t)}function br(n){return Hx.call(n)}function tA(n){if(n.name)return n.name;var t=Zx.call(Vx.call(n),/^function\s*([\w$]+)/);return t?t[1]:null}function nb(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 nA(n){if(!bc||!n||typeof n!="object")return!1;try{bc.call(n);try{wc.call(n)}catch{return!0}return n instanceof Map}catch{}return!1}function rA(n){if(!Do||!n||typeof n!="object")return!1;try{Do.call(n,Do);try{Mo.call(n,Mo)}catch{return!0}return n instanceof WeakMap}catch{}return!1}function iA(n){if(!Xg||!n||typeof n!="object")return!1;try{return Xg.call(n),!0}catch{}return!1}function sA(n){if(!wc||!n||typeof n!="object")return!1;try{wc.call(n);try{bc.call(n)}catch{return!0}return n instanceof Set}catch{}return!1}function oA(n){if(!Mo||!n||typeof n!="object")return!1;try{Mo.call(n,Mo);try{Do.call(n,Do)}catch{return!0}return n instanceof WeakSet}catch{}return!1}function aA(n){return!n||typeof n!="object"?!1:typeof HTMLElement<"u"&&n instanceof HTMLElement?!0:typeof n.nodeName=="string"&&typeof n.getAttribute=="function"}function rb(n,t){if(n.length>t.maxStringLength){var e=n.length-t.maxStringLength,r="... "+e+" more character"+(e>1?"s":"");return rb(Bp.call(n,0,t.maxStringLength),t)+r}var i=jx[t.quoteStyle||"single"];i.lastIndex=0;var s=cr.call(cr.call(n,i,"\\$1"),/[\x00-\x1f]/g,lA);return eb(s,"single",t)}function lA(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":"")+Bx.call(t.toString(16))}function lo(n){return"Object("+n+")"}function hh(n){return n+" { ? }"}function am(n,t,e,r){var i=r?ed(e,r):yn.call(e,", ");return n+" ("+t+") {"+i+"}"}function cA(n){for(var t=0;t<n.length;t++)if(nb(n[t],`
|
|
2
2
|
`)>=0)return!1;return!0}function uA(n,t){var e;if(n.indent===" ")e=" ";else if(typeof n.indent=="number"&&n.indent>0)e=yn.call(Array(n.indent+1)," ");else return null;return{base:e,prev:yn.call(Array(t+1),e)}}function ed(n,t){if(n.length===0)return"";var e=`
|
|
3
3
|
`+t.prev+t.base;return e+yn.call(n,","+e)+`
|
|
4
4
|
`+t.prev}function Il(n,t){var e=Qh(n),r=[];if(e){r.length=n.length;for(var i=0;i<n.length;i++)r[i]=$n(n,i)?t(n[i],n):""}var s=typeof uh=="function"?uh(n):[],o;if(Fs){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var c in n)$n(n,c)&&(e&&String(Number(c))===c&&c<n.length||Fs&&o["$"+c]instanceof Symbol||(Jy.call(/[^\w$]/,c)?r.push(t(c,n)+": "+t(n[c],n)):r.push(c+": "+t(n[c],n))));if(typeof uh=="function")for(var u=0;u<s.length;u++)Xy.call(n,s[u])&&r.push("["+t(s[u])+"]: "+t(n[s[u]],n));return r}var hA=Js,dA=J,uu=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},pA=function(n,t){if(n){var e=uu(n,t);return e&&e.value}},fA=function(n,t,e){var r=uu(n,t);r?r.value=e:n.next={key:t,next:n.next,value:e}},gA=function(n,t){return n?!!uu(n,t):!1},mA=function(n,t){if(n)return uu(n,t,!0)},vA=function(){var t,e={assert:function(r){if(!e.has(r))throw new dA("Side channel does not contain "+hA(r))},delete:function(r){var i=t&&t.next,s=mA(t,r);return s&&i&&i===s&&(t=void 0),!!s},get:function(r){return pA(t,r)},has:function(r){return gA(t,r)},set:function(r,i){t||(t={next:void 0}),fA(t,r,i)}};return e},yA=Ct,hl=yr(),bA=Js,wA=J,lm=yA("%Map%",!0),SA=hl("Map.prototype.get",!0),_A=hl("Map.prototype.set",!0),kA=hl("Map.prototype.has",!0),EA=hl("Map.prototype.delete",!0),xA=hl("Map.prototype.size",!0),ib=!!lm&&function(){var t,e={assert:function(r){if(!e.has(r))throw new wA("Side channel does not contain "+bA(r))},delete:function(r){if(t){var i=EA(t,r);return xA(t)===0&&(t=void 0),i}return!1},get:function(r){if(t)return SA(t,r)},has:function(r){return t?kA(t,r):!1},set:function(r,i){t||(t=new lm),_A(t,r,i)}};return e},AA=Ct,hu=yr(),TA=Js,Rl=ib,$A=J,Ui=AA("%WeakMap%",!0),CA=hu("WeakMap.prototype.get",!0),IA=hu("WeakMap.prototype.set",!0),RA=hu("WeakMap.prototype.has",!0),PA=hu("WeakMap.prototype.delete",!0),LA=Ui?function(){var t,e,r={assert:function(i){if(!r.has(i))throw new $A("Side channel does not contain "+TA(i))},delete:function(i){if(Ui&&i&&(typeof i=="object"||typeof i=="function")){if(t)return PA(t,i)}else if(Rl&&e)return e.delete(i);return!1},get:function(i){return Ui&&i&&(typeof i=="object"||typeof i=="function")&&t?CA(t,i):e&&e.get(i)},has:function(i){return Ui&&i&&(typeof i=="object"||typeof i=="function")&&t?RA(t,i):!!e&&e.has(i)},set:function(i,s){Ui&&i&&(typeof i=="object"||typeof i=="function")?(t||(t=new Ui),IA(t,i,s)):Rl&&(e||(e=Rl()),e.set(i,s))}};return r}:Rl,DA=J,MA=Js,OA=vA,zA=ib,NA=LA,UA=NA||zA||OA,FA=function(){var t,e={assert:function(r){if(!e.has(r))throw new DA("Side channel does not contain "+MA(r))},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=UA()),t.set(r,i)}};return e},HA=Zn,co=FA(),kn=J,Wp={assert:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");if(co.assert(n),!Wp.has(n,t))throw new kn("`"+t+"` is not present on `O`")},get:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var e=co.get(n);return e&&e["$"+t]},has:function(n,t){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var e=co.get(n);return!!e&&HA(e,"$"+t)},set:function(n,t,e){if(!n||typeof n!="object"&&typeof n!="function")throw new kn("`O` is not an object");if(typeof t!="string")throw new kn("`slot` must be a string");var r=co.get(n);r||(r={},co.set(n,r)),r["$"+t]=e}};Object.freeze&&Object.freeze(Wp);var jp=Wp,sb=Hn,hr=jp,dl=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 sb('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');hr.set(this,"[[Type]]",t),hr.set(this,"[[Value]]",e)};dl.prototype.type=function(){return hr.get(this,"[[Type]]")};dl.prototype.value=function(){return hr.get(this,"[[Value]]")};dl.prototype["?"]=function(){var t=hr.get(this,"[[Type]]"),e=hr.get(this,"[[Value]]");if(t==="throw")throw e;return e};dl.prototype["!"]=function(){var t=hr.get(this,"[[Type]]");if(t!=="normal")throw new sb('Assertion failed: Completion Record is not of type "normal"');return hr.get(this,"[[Value]]")};var Gp=dl,VA=Gp,qp=function(t){return new VA("normal",t)},dh,cm;function ZA(){if(cm)return dh;cm=1;var n=Gs;return dh=function(){return n()&&!!Symbol.toStringTag},dh}var BA=Ct,um=BA("%Object.defineProperty%",!0),WA=ZA()(),jA=Zn,GA=J,Pl=WA?Symbol.toStringTag:null,ob=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 GA("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");Pl&&(r||!jA(t,Pl))&&(um?um(t,Pl,{configurable:!i,enumerable:!1,value:e,writable:!1}):t[Pl]=e)},ab={exports:{}},qA=Ct,hm=Ay,YA=au(),dm=js,pm=J,KA=qA("%Math.floor%"),JA=function(t,e){if(typeof t!="function")throw new pm("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||KA(e)!==e)throw new pm("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in t&&dm){var o=dm(t,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1)}return(i||s||!r)&&(YA?hm(t,"length",e,!0,!0):hm(t,"length",e)),t},XA=ol,QA=Mp,eT=zy,tT=function(){return eT(XA,QA,arguments)};(function(n){var t=JA,e=sl,r=lu,i=tT;n.exports=function(o){var a=r(arguments),c=1+o.length-(arguments.length-1);return t(a,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(ab);var Yp=ab.exports,nT=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0},rT=Object,iT=function(t){return t&&typeof t=="object"&&(typeof t["[[ResourceValue]]"]>"u"||rT(t["[[ResourceValue]]"])===t["[[ResourceValue]]"])&&(t["[[Hint]]"]==="SYNC-DISPOSE"||t["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof t["[[DisposeMethod]]"]=="function"||typeof t["[[DisposeMethod]]"]>"u")},sT=Zn,oT=Op(),aT=nT,lT=iT,cT=function(t){return t&&typeof t=="object"&&sT(t,"[[DisposableResourceStack]]")&&oT(t["[[DisposableResourceStack]]"])&&(t["[[DisposableResourceStack]]"].length===0||aT(t["[[DisposableResourceStack]]"],lT))},uT=Vn,hT=function(t){if(t===null)return"Null";if(typeof t>"u")return"Undefined";if(uT(t))return"Object";if(typeof t=="number")return"Number";if(typeof t=="boolean")return"Boolean";if(typeof t=="string")return"String"},dT=hT,Kp=function(t){return typeof t=="symbol"?"Symbol":typeof t=="bigint"?"BigInt":dT(t)},pT=J,fT=Js,gT=Ys,mT=function(t,e){if(!gT(e))throw new pT("Assertion failed: P is not a Property Key, got "+fT(e));return t[e]},fm=J,vT=mT,yT=Ks,bT=Ys,gm=Js,wT=function(t,e){if(!bT(e))throw new fm("Assertion failed: P is not a Property Key");var r=vT(t,e);if(r!=null){if(!yT(r))throw new fm(gm(e)+" is not a function: "+gm(r));return r}},td={exports:{}},ST=Ct,_T=ST,mm=_T("%Reflect.construct%",!0),Sc=ul;try{Sc({},"",{"[[Get]]":function(){}})}catch{Sc=null}if(Sc&&mm){var vm={},ym={};Sc(ym,"length",{"[[Get]]":function(){throw vm},"[[Enumerable]]":!0}),td.exports=function(t){try{mm(t,ym)}catch(e){return e===vm}}}else td.exports=function(t){return typeof t=="function"&&!!t.prototype};var kT=td.exports,ph=J,bm=Ks,ET=kT,xT=function(t){if(!ET(t))throw new ph("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 ph("executor has already been called");e["[[Resolve]]"]=i,e["[[Reject]]"]=s});if(!bm(e["[[Resolve]]"])||!bm(e["[[Reject]]"]))throw new ph("executor must provide valid resolve and reject functions");return{"[[Promise]]":r,"[[Resolve]]":e["[[Resolve]]"],"[[Reject]]":e["[[Reject]]"]}},wm=Hn,AT=J,fh=cu,Sm=wT,TT=xT,$T=Kp,_m=Fp(),km=Hp(),CT=function(t,e){if($T(t)!=="Object")throw new AT("`V` must be an Object");if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new wm("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var r;if(e==="ASYNC-DISPOSE"&&km&&(r=Sm(t,km)),!r){if(!_m)throw new wm("`Symbol.dispose` is not supported");if(r=Sm(t,_m),typeof r<"u")return function(){var i=this;if(e==="ASYNC-DISPOSE"){var s=TT(Promise);try{fh(r,i),fh(s["[[Resolve]]"],void 0,[void 0])}catch(o){s["[[Reject]]"](o)}return s["[[Promise]]"]}fh(r,i)}}return r},IT=Hn,gh=J,RT=Ks,PT=Kp,LT=CT,DT=function(t,e){if(e!=="SYNC-DISPOSE"&&e!=="ASYNC-DISPOSE")throw new IT("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"&&PT(t)!=="Object")throw new gh("`V` must be an Object, or `null` or `undefined`");if(r=LT(t,e),typeof r>"u")throw new gh("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(r=arguments[2],!RT(r))throw new gh("`method`, when provided, must be a function");return{"[[ResourceValue]]":t,"[[Hint]]":e,"[[DisposeMethod]]":r}},MT=Hn,Ll=J,OT=cT,Em=DT,zT=yr(),NT=zT("Array.prototype.push"),lb=function(t,e,r){if(!OT(t))throw new Ll("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(r!=="SYNC-DISPOSE"&&r!=="ASYNC-DISPOSE")throw new MT("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 Ll("Assertion failed: `method`, when present, must be a function");if(!t["[[DisposableResourceStack]]"])throw new Ll("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var s;if(arguments.length<4){if(e==null&&r==="SYNC_DISPOSE")return"UNUSED";s=Em(e,r)}else{if(typeof e<"u")throw new Ll("Assertion failed: `V` must be undefined when `method` is present");s=Em(void 0,r,i)}return NT(t["[[DisposableResourceStack]]"],s),"UNUSED"},mh,xm;function Jp(){if(xm)return mh;xm=1;var n=Ct,t=Yp,e=Hn,r=n("%Promise.resolve%",!0),i=r&&t(r);return mh=function(o,a){if(!i)throw new e("This environment does not support Promises.");return i(o,a)},mh}var vh,Am;function UT(){if(Am)return vh;Am=1;var n=Ct,t=Hn,e=n("%Promise%",!0),r=cu,i=Jp(),s=Kp;return vh=function(a,c,u){if(typeof a<"u"&&s(a)!=="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 h=typeof u>"u"?u:r(u,a);if(c==="ASYNC-DISPOSE")return i(e,h)},vh}var yh,Tm;function FT(){if(Tm)return yh;Tm=1;var n=Gp;return yh=function(e){return new n("throw",e)},yh}var HT=Ct,bh=Hn,$m=J,VT=HT("%Promise%",!0),ZT=yr(),Cm=ZT("Promise.prototype.then",!0),BT=Gp,Im=UT(),WT=qp,jT=Jp(),Rm=FT(),GT=Ky(),cb=function(t,e){if(!(e instanceof BT))throw new $m("`completion` must be a Completion Record");var r=t["[[DisposableResourceStack]]"];if(!r)throw new $m("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 bh("mixed hint stacks are not supported");for(var o=i==="ASYNC-DISPOSE"&&jT(VT,e),a=function(v){if(e.type()==="throw"){var y=e.value(),E=new GT(v,y);e=Rm(E)}else e=Rm(v)},c=i==="ASYNC-DISPOSE"&&function(y){return Cm(o,function(){var E=Im(y["[[ResourceValue]]"],y["[[Hint]]"],y["[[DisposeMethod]]"]);if(!E)throw new bh("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return Cm(E,WT)},a)},u=r.length-1;u>=0;u-=1)if(i==="ASYNC-DISPOSE")o=c(r[u]);else{var h=r[u];try{var f=Im(h["[[ResourceValue]]"],h["[[Hint]]"],h["[[DisposeMethod]]"]);if(f)throw new bh("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(v){a(v)}}return t["[[DisposableResourceStack]]"]=null,i==="ASYNC-DISPOSE"?o:e},ub=function(){var t=[];return{"[[DisposableResourceStack]]":t}},du=Rp,Xp=J,qT=cu,Xs=Np,YT=ul,hb=Ks,KT=qp,ct=jp,JT=ob,db=Ti.supportsDescriptors,XT=Yp,Qp=lb,QT=cb,pb=ub,Pm=Fp(),xt=function n(){if(!(this instanceof n)||ct.has(this,"[[DisposableState]]")||ct.has(this,"[[DisposeCapability]]"))throw new Xp("can only be used with new");ct.set(this,"[[DisposableState]]","PENDING"),ct.set(this,"[[DisposeCapability]]",pb())},fb=function(){var t=this;return ct.assert(t,"[[DisposableState]]"),ct.get(t,"[[DisposableState]]")==="DISPOSED"},pl=XT(fb);db?YT(xt.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":fb}):xt.prototype.disposed=!1;var gb=function(t){ct.set(t,"[[DisposableState]]","DISPOSED"),db||(t.disposed=!0)};Xs(xt.prototype,"dispose",function(){var t=this;if(!pl(t))return gb(t),QT(ct.get(t,"[[DisposeCapability]]"),KT())["?"]()});Xs(xt.prototype,"use",function(t){var e=this;if(pl(e))throw new du("a disposed stack can not use anything new");return Qp(ct.get(e,"[[DisposeCapability]]"),t,"SYNC-DISPOSE"),t});Xs(xt.prototype,"adopt",function(t,e){var r=this;if(pl(r))throw new du("a disposed stack can not use anything new");if(!hb(e))throw new Xp("`onDispose` must be a function");var i=function(){return qT(e,void 0,[t])};return Qp(ct.get(r,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",i),t});Xs(xt.prototype,"defer",function(t){var e=this;if(pl(e))throw new du("a disposed stack can not defer anything new");if(!hb(t))throw new Xp("`onDispose` must be a function");Qp(ct.get(e,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",t)});Xs(xt.prototype,"move",function(){var t=this;if(pl(t))throw new du("a disposed stack can not use anything new");var e=new xt;return ct.set(e,"[[DisposeCapability]]",ct.get(t,"[[DisposeCapability]]")),ct.set(t,"[[DisposeCapability]]",pb()),gb(t),e});Pm&&Xs(xt.prototype,Pm,xt.prototype.dispose);JT(xt.prototype,"DisposableStack");var e$=xt,t$=e$,n$=function(){return typeof DisposableStack=="function"?DisposableStack:t$},r$=Ti,i$=Cp(),s$=n$,o$=function(){var t=s$();return r$(i$,{DisposableStack:t},{DisposableStack:!0}),t},a$=Ct,pu=Rp,ef=J,Lm=a$("%Promise%",!0),tf=lb,l$=cu,Qs=Np,c$=ul,u$=cb,mb=Ks,vb=ub,h$=qp,Dm=Jp(),ut=jp,d$=ob,yb=Ti.supportsDescriptors,p$=Yp,f$=yr(),g$=f$("Promise.prototype.then",!0),Mm=Hp(),At=function n(){if(!(this instanceof n)||ut.has(this,"[[AsyncDisposableState]]")||ut.has(this,"[[DisposeCapability]]"))throw new ef("can only be used with new");ut.set(this,"[[AsyncDisposableState]]","pending"),ut.set(this,"[[DisposeCapability]]",vb())},bb=function(){var t=this;return ut.assert(t,"[[AsyncDisposableState]]"),ut.get(t,"[[AsyncDisposableState]]")==="disposed"},fl=p$(bb);yb?c$(At.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":bb}):At.prototype.disposed=!1;var wb=function(t){ut.set(t,"[[AsyncDisposableState]]","disposed"),yb||(t.disposed=!0)};Qs(At.prototype,"disposeAsync",function(){var t=this;return fl(t)?Dm(Lm):(wb(t),g$(Dm(Lm,u$(ut.get(t,"[[DisposeCapability]]"),h$())),function(e){return e["?"]()}))});Qs(At.prototype,"use",function(t){var e=this;if(fl(e))throw new pu("a disposed stack can not use anything new");return tf(ut.get(e,"[[DisposeCapability]]"),t,"ASYNC-DISPOSE"),t});Qs(At.prototype,"adopt",function(t,e){var r=this;if(fl(r))throw new pu("a disposed stack can not use anything new");if(!mb(e))throw new ef("`onDisposeAsync` must be a function");var i=function(){return l$(e,void 0,[t])};return i.value=t,tf(ut.get(r,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",i),t});Qs(At.prototype,"defer",function(t){var e=this;if(fl(e))throw new pu("a disposed stack can not defer anything new");if(!mb(t))throw new ef("`onDispose` must be a function");tf(ut.get(e,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",t)});Qs(At.prototype,"move",function(){var t=this;if(fl(t))throw new pu("a disposed stack can not use anything new");var e=new At;return ut.set(e,"[[DisposeCapability]]",ut.get(t,"[[DisposeCapability]]")),ut.set(t,"[[DisposeCapability]]",vb()),wb(t),e});Mm&&Qs(At.prototype,Mm,At.prototype.disposeAsync);d$(At.prototype,"AsyncDisposableStack");var m$=At,v$=m$,y$=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:v$},b$=Ti,w$=Cp(),S$=y$,_$=function(){var t=S$();return b$(w$,{AsyncDisposableStack:t},{AsyncDisposableStack:!0}),t},k$=bx,E$=Tx,x$=o$,A$=_$,T$=function(){k$(),E$(),x$(),A$()};T$();const Om=new WeakMap;function $$(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function Fi(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function zm(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function C$(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class I${constructor(){g(this,"entries",new Map);g(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw zm();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw zm();if(e.constructor.name==="AsyncFunction")throw C$();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=Om.get(t);if(e){if(t.length!==e.length)throw new Error(`${Fi(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(`${Fi(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=Om.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(`${Fi(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=>Fi(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if($$(r))throw new Error(`Factory for ${Fi(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${Fi(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 bn=new I$,R$=.5,Nm=.1,Um=8,P$=4,Sb=3,_b=3,L$=4,zr=255,kb=.2126,Eb=.7152,xb=.0722;async function Ab(n){const t=D$(n);if(!t)return"light";try{return await z$(n,t)>=R$?"light":"dark"}catch{return"light"}}function D$(n){if(typeof document.elementsFromPoint!="function")return null;const t=n.getBoundingClientRect(),e=t.left+t.width/2,r=t.top+t.height/2,i=document.elementsFromPoint(e,r);for(const s of i){if(!(s instanceof HTMLElement)||s===n||n.contains(s))continue;const o=window.getComputedStyle(s);if(M$(o))return s}return null}function M$(n){return Tb(n.backgroundImage)?!0:O$(n.backgroundColor)>0}function O$(n){if(!n)return 0;const t=n.match(/rgba?\(([^)]+)\)/);if(!t)return 0;const e=t[1].split(/[\s,/]+/).filter(Boolean);return e.length===L$?parseFloat(e[Sb]):e.length===_b?1:0}async function z$(n,t){const e=n.getBoundingClientRect(),r=t.getBoundingClientRect(),i={x:Dl((e.left-r.left)/r.width),y:Dl((e.top-r.top)/r.height),width:Dl(e.width/r.width),height:Dl(e.height/r.height)},s=window.getComputedStyle(t),o=Tb(s.backgroundImage);return o?U$({url:o,surfaceWidth:r.width,surfaceHeight:r.height,region:i}):F$(s.backgroundColor)}function Tb(n){const t=n.match(/url\(\s*["']?([^"')]+)["']?\s*\)/);return t?t[1]:null}const Fm=new Map;function N$(n){let t=Fm.get(n);return t||(t=new Promise((e,r)=>{const i=new Image;i.crossOrigin="anonymous",i.onload=()=>e(i),i.onerror=()=>r(new Error(`Failed to load ${n}`)),i.src=n}),Fm.set(n,t),t)}async function U$(n){const t=await N$(n.url),e=Math.max(Um,Math.ceil(n.surfaceWidth*Nm)),r=Math.max(Um,Math.ceil(n.surfaceHeight*Nm)),i=document.createElement("canvas");i.width=e,i.height=r;const s=i.getContext("2d",{willReadFrequently:!0});if(!s)return 1;const o=n.surfaceWidth/n.surfaceHeight,a=t.naturalWidth/t.naturalHeight;let c,u;a>o?(u=r,c=r*a):(c=e,u=e/a);const h=(e-c)/2,f=(r-u)/2;s.drawImage(t,h,f,c,u);const v=Math.max(0,Math.floor(n.region.x*e)),y=Math.max(0,Math.floor(n.region.y*r)),E=Math.max(1,Math.min(e-v,Math.floor(n.region.width*e))),x=Math.max(1,Math.min(r-y,Math.floor(n.region.height*r))),C=s.getImageData(v,y,E,x).data;let L=0,R=0;for(let W=0;W<C.length;W+=P$){const N=C[W]/zr,V=C[W+1]/zr,K=C[W+2]/zr,G=C[W+Sb]/zr;L+=G*(kb*N+Eb*V+xb*K),R+=1}return R>0?L/R:1}function F$(n){const t=n.match(/rgba?\(([^)]+)\)/);if(!t)return 1;const e=t[1].split(/[\s,/]+/).filter(Boolean).map(parseFloat);if(e.length<_b)return 1;const r=e[0]/zr,i=e[1]/zr,s=e[2]/zr;return kb*r+Eb*i+xb*s}function Dl(n){return n<0?0:n>1?1:n}const H$=["ghost","glass"],Ho=[...H$.map(n=>`[variant="${n}"]`),'[material="glass"]'].join(", "),Ml=new WeakSet,Hm=new WeakSet;function $b(n){if(Hm.has(n))return;Hm.add(n);for(const e of n.querySelectorAll(Ho))wh(e);if(typeof MutationObserver!="function")return;new MutationObserver(e=>{for(const r of e)if(r.type==="childList")for(const i of r.addedNodes)V$(i,wh);else r.type==="attributes"&&r.target instanceof HTMLElement&&r.target.matches(Ho)&&wh(r.target)}).observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["variant","material"]})}function V$(n,t){if(n instanceof Element){n instanceof HTMLElement&&n.matches(Ho)&&t(n);for(const e of n.querySelectorAll(Ho))t(e)}}async function wh(n){var e,r;if(Ml.has(n)||n.hasAttribute("tone")||(e=n.parentElement)!=null&&e.closest("[tone]"))return;Ml.add(n);const t=await Ab(n);if(!n.matches(Ho)){Ml.delete(n);return}if(n.hasAttribute("tone")||(r=n.parentElement)!=null&&r.closest("[tone]")){Ml.delete(n);return}n.setAttribute("tone",t)}const Z$="*,*:before,*:after{box-sizing:border-box}html,body{margin:0;padding:0}h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote,pre,hr{margin:0}button,input,textarea,select{font:inherit;color:inherit}@font-face{font-family:Hind;src:url("+new URL("Hind-Variable-C47b_dt9.woff2",import.meta.url).href+') format("woff2-variations");font-weight:300 700;font-style:normal;font-display:swap}:root{--font-sans: "Hind", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;--font-brand: var(--font-sans);--font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;--font-weight-body: 500;--text-base: 13.5px;--text-scale: 1.125;--text-sm: round(calc(var(--text-base) / var(--text-scale)), 1px);--text-lg: round(calc(var(--text-base) * var(--text-scale)), 1px);--text-xl: round(calc(var(--text-lg) * var(--text-scale)), 1px);--leading-base: 1.5;--control-height-xs: 18px;--control-height-sm: 24px;--control-height-md: 28px;--control-height-lg: 32px;--space-2: 2px;--space-4: 4px;--space-6: 6px;--space-8: 8px;--space-10: 10px;--space-12: 12px;--space-16: 16px;--space-20: 20px;--space-24: 24px;--space-32: 32px;--space-48: 48px;--space-64: 64px;--radius-4: 4px;--radius-8: 8px;--radius-12: 12px;--radius-16: 16px;--radius-24: 24px;--radius-full: 9999px;--layer-chrome: 100;--layer-panel: 500;--layer-overlay: 2000;--shadow-hairline: 0 0 0 .5px var(--color-border);--shadow-control: 0 1px 1px rgb(0 0 0 / .04), 0 2px 6px rgb(0 0 0 / .06);--alpha-50: 4%;--alpha-100: 8%;--alpha-150: 11%;--alpha-200: 15%;--alpha-300: 22%;--alpha-400: 30%;--alpha-500: 40%;--alpha-600: 50%;--alpha-700: 65%;--alpha-800: 80%;--alpha-900: 90%;--alpha-950: 95%;--tint-50: color-mix(in srgb, currentColor var(--alpha-50), transparent);--tint-100: color-mix(in srgb, currentColor var(--alpha-100), transparent);--tint-150: color-mix(in srgb, currentColor var(--alpha-150), transparent);--tint-200: color-mix(in srgb, currentColor var(--alpha-200), transparent);--tint-300: color-mix(in srgb, currentColor var(--alpha-300), transparent);--tint-400: color-mix(in srgb, currentColor var(--alpha-400), transparent);--tint-500: color-mix(in srgb, currentColor var(--alpha-500), transparent);--tint-600: color-mix(in srgb, currentColor var(--alpha-600), transparent);--tint-700: color-mix(in srgb, currentColor var(--alpha-700), transparent);--tint-800: color-mix(in srgb, currentColor var(--alpha-800), transparent);--tint-900: color-mix(in srgb, currentColor var(--alpha-900), transparent);--tint-950: color-mix(in srgb, currentColor var(--alpha-950), transparent);--color-overlay-hover: color-mix(in srgb, var(--black) var(--alpha-100), transparent);--color-overlay-active: color-mix(in srgb, var(--black) var(--alpha-300), transparent);--backdrop-blur-glass: blur(20px) saturate(1.4);--black: #000000;--white: #ffffff;--neutral-50: oklch(.985 0 0);--neutral-100: oklch(.97 0 0);--neutral-200: oklch(.923 0 0);--neutral-300: oklch(.869 0 0);--neutral-350: oklch(.79 0 0);--neutral-400: oklch(.709 0 0);--neutral-500: oklch(.553 0 0);--neutral-600: oklch(.444 0 0);--neutral-700: oklch(.374 0 0);--neutral-800: oklch(.268 0 0);--neutral-900: oklch(.216 0 0);--neutral-950: oklch(.147 0 0);--red-50: oklch(.969 .015 12.422);--red-100: oklch(.941 .03 12.58);--red-200: oklch(.892 .058 10.001);--red-300: oklch(.81 .117 11.638);--red-400: oklch(.712 .194 13.428);--red-500: oklch(.645 .246 16.439);--red-600: oklch(.586 .253 17.585);--red-700: oklch(.514 .222 16.935);--red-800: oklch(.455 .188 13.697);--red-900: oklch(.41 .159 10.272);--red-950: oklch(.271 .105 12.094);--orange-50: oklch(.98 .016 73.684);--orange-100: oklch(.954 .038 75.164);--orange-200: oklch(.901 .076 70.697);--orange-300: oklch(.837 .128 66.29);--orange-400: oklch(.75 .183 55.934);--orange-500: oklch(.705 .213 47.604);--orange-600: oklch(.646 .222 41.116);--orange-700: oklch(.553 .195 38.402);--orange-800: oklch(.47 .157 37.304);--orange-900: oklch(.408 .123 38.172);--orange-950: oklch(.266 .079 36.259);--yellow-50: oklch(.987 .026 102.212);--yellow-100: oklch(.973 .071 103.193);--yellow-200: oklch(.945 .129 101.54);--yellow-300: oklch(.905 .182 98.111);--yellow-400: oklch(.852 .199 91.936);--yellow-500: oklch(.795 .184 86.047);--yellow-600: oklch(.681 .162 75.834);--yellow-700: oklch(.554 .135 66.442);--yellow-800: oklch(.476 .114 61.907);--yellow-900: oklch(.421 .095 57.708);--yellow-950: oklch(.286 .066 53.813);--green-50: oklch(.979 .021 166.113);--green-100: oklch(.95 .052 163.051);--green-200: oklch(.905 .093 164.15);--green-300: oklch(.845 .143 164.978);--green-400: oklch(.765 .177 163.223);--green-500: oklch(.696 .17 162.48);--green-600: oklch(.596 .145 163.225);--green-700: oklch(.508 .118 165.612);--green-800: oklch(.432 .095 166.913);--green-900: oklch(.378 .077 168.94);--green-950: oklch(.262 .051 172.552);--blue-50: oklch(.97 .014 254.604);--blue-100: oklch(.932 .032 255.585);--blue-200: oklch(.882 .059 254.128);--blue-300: oklch(.809 .105 251.813);--blue-400: oklch(.707 .165 254.624);--blue-500: oklch(.623 .214 259.815);--blue-600: oklch(.546 .245 262.881);--blue-700: oklch(.488 .243 264.376);--blue-800: oklch(.424 .199 265.638);--blue-900: oklch(.379 .146 265.522);--blue-950: oklch(.282 .091 267.935);--purple-50: oklch(.969 .016 293.756);--purple-100: oklch(.943 .029 294.588);--purple-200: oklch(.894 .057 293.283);--purple-300: oklch(.811 .111 293.571);--purple-400: oklch(.702 .183 293.541);--purple-500: oklch(.606 .25 292.717);--purple-600: oklch(.541 .281 293.009);--purple-700: oklch(.491 .27 292.581);--purple-800: oklch(.432 .232 292.759);--purple-900: oklch(.38 .189 293.745);--purple-950: oklch(.283 .141 291.089)}@supports (corner-shape: squircle){:root{--radius-8: 10px;--radius-12: 15px;--radius-16: 20px;--radius-24: 30px}}:root[data-font=system]{--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif}:root{--color-bg: var(--neutral-50);--color-bg-muted: var(--neutral-100);--color-surface: var(--white);--color-surface-muted: var(--neutral-100);--color-interactive: var(--neutral-200);--color-interactive-hover: var(--neutral-300);--color-border: rgba(0, 0, 0, .1);--color-border-muted: rgba(0, 0, 0, .06);--color-text: var(--neutral-900);--color-text-muted: var(--neutral-500);--color-link: inherit;--color-focus-ring: var(--neutral-500);--color-overlay-backdrop: rgb(0 0 0 / .5);--color-highlight: rgb(255 255 255 / .5);--color-primary: var(--blue-500);--color-danger: var(--red-600);color-scheme:light}body{font-family:var(--font-sans);font-size:var(--text-base);font-weight:var(--font-weight-body);line-height:var(--leading-base);letter-spacing:.015em;color:var(--color-text);background:var(--color-bg);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{color:var(--color-link);text-underline-offset:.15em;text-decoration-thickness:.08em}h1,h2,h3,h4,h5,h6{font-weight:600;color:inherit}code{font-family:var(--font-mono);font-size:.9em;background:var(--color-bg-muted);padding:var(--space-2) var(--space-4);border-radius:var(--radius-4)}pre{font-family:var(--font-mono);background:var(--color-bg-muted);padding:var(--space-12);border-radius:var(--radius-8);overflow-x:auto}pre code{background:none;padding:0}blockquote{padding-left:var(--space-16);border-left:3px solid var(--color-border);color:var(--color-text-muted)}hr{border:none;border-top:1px solid var(--color-border)}table{border-collapse:collapse}th,td{padding:var(--space-8) var(--space-12);border:1px solid var(--color-border);text-align:left}th{background:var(--color-bg-muted);font-weight:600}input,textarea{border:.5px solid var(--tint-300);border-radius:var(--radius-12);background:var(--tint-100);color:inherit;font:inherit;box-sizing:border-box;transition:background .12s ease,border-color .12s ease,box-shadow .12s ease}input{height:var(--control-height-lg);padding:0 12px}textarea{padding:6px 10px;resize:none}input::placeholder,textarea::placeholder{color:var(--tint-500)}input:focus,textarea:focus{background:color-mix(in srgb,var(--white) var(--alpha-300),transparent);border-color:var(--color-primary);outline:none;box-shadow:0 0 0 1.5px var(--color-primary)}label.field{display:grid;gap:4px;font-size:13px}label.field>span{font-size:11.5px;font-weight:450;color:var(--tint-800)}@supports (corner-shape: squircle){*{corner-shape:squircle}}button{display:inline-flex;align-items:center;justify-content:center;gap:var(--space-6);box-sizing:border-box;height:var(--control-height-md);padding:0 14px 2px;font:inherit;cursor:default}button,segmented-control{background:var(--color-surface);border:.5px solid var(--tint-200);border-radius:var(--radius-12);box-shadow:var(--shadow-control);color:inherit}button:not([material]):hover:not(:disabled){background:color-mix(in srgb,var(--color-surface) 96%,black)}button:not([material]):active:not(:disabled){background:color-mix(in srgb,var(--color-surface) 88%,black);box-shadow:inset 0 1px 2px #00000014}button:focus-visible{outline:2px solid var(--color-focus-ring);outline-offset:2px}button[variant=primary]{background:var(--color-primary);border-color:#0000002e;color:var(--white)}button[variant=primary]:hover:not(:disabled){background:color-mix(in srgb,var(--color-primary) 92%,black)}button[variant=primary]:active:not(:disabled){background:color-mix(in srgb,var(--color-primary) 82%,black);box-shadow:inset 0 1px 2px #0000002e}button[variant=danger]{background:var(--color-danger);border-color:#0000002e;color:var(--white)}button[variant=danger]:hover:not(:disabled){background:color-mix(in srgb,var(--color-danger) 92%,black)}button[variant=danger]:active:not(:disabled){background:color-mix(in srgb,var(--color-danger) 82%,black);box-shadow:inset 0 1px 2px #0000002e}button[variant=ghost]{background:transparent;border-color:transparent;color:inherit;box-shadow:none}button[variant=ghost]:hover:not(:disabled){background:var(--tint-150);backdrop-filter:saturate(1.2);-webkit-backdrop-filter:saturate(1.2)}button[variant=ghost]:active:not(:disabled){background:var(--tint-300);backdrop-filter:saturate(1.4);-webkit-backdrop-filter:saturate(1.4);box-shadow:none}button[variant=ghost][data-active]:not(:disabled),button[variant=ghost][data-active]:hover:not(:disabled),button[variant=ghost][aria-pressed=true]:not(:disabled),button[variant=ghost][aria-pressed=true]:hover:not(:disabled),button[variant=ghost][aria-expanded=true]:not(:disabled),button[variant=ghost][aria-expanded=true]:hover:not(:disabled){background:var(--color-overlay-active);backdrop-filter:saturate(1.3);-webkit-backdrop-filter:saturate(1.3);box-shadow:none}button[variant=glass],segmented-control[variant=glass]{background:transparent;border:.5px solid color-mix(in srgb,var(--black) var(--alpha-100),transparent);box-shadow:none}button[variant=glass]{backdrop-filter:blur(20px) brightness(.95) saturate(1.5);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.5)}button[variant=glass]:hover:not(:disabled){background:linear-gradient(var(--color-overlay-hover),var(--color-overlay-hover));backdrop-filter:blur(20px) brightness(.95) saturate(1.8);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.8)}button[variant=glass]:active:not(:disabled){background:linear-gradient(var(--color-overlay-active),var(--color-overlay-active));backdrop-filter:blur(20px) brightness(.95) saturate(2.2);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(2.2)}button[variant=glass][aria-pressed=true]:not(:disabled),button[variant=glass][aria-pressed=true]:hover:not(:disabled),button[variant=glass][aria-expanded=true]:not(:disabled),button[variant=glass][aria-expanded=true]:hover:not(:disabled){background:linear-gradient(var(--color-overlay-active),var(--color-overlay-active));backdrop-filter:blur(20px) brightness(.95) saturate(2);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(2)}[tone=dark] button[variant=glass],[tone=dark] segmented-control[variant=glass]{border-color:var(--tint-400)}button[material],segmented-control[material]{color:inherit;box-shadow:none}button[material]:hover:not(:disabled){background-image:linear-gradient(var(--color-overlay-hover),var(--color-overlay-hover))}button[material]:active:not(:disabled){background-image:linear-gradient(var(--color-overlay-active),var(--color-overlay-active))}[tone=dark] button[material],[tone=dark] segmented-control[material]{border-color:var(--tint-400)}button:disabled{background:var(--tint-300);border-color:transparent;color:var(--tint-700);box-shadow:none}button[variant=ghost]:disabled{background:transparent}:where([tone=dark]) button:not([variant]):not([material]):not(:disabled),:where([tone=dark]) button[variant=default]:not([material]):not(:disabled),:where([tone=dark]) segmented-control:not([variant]):not([material]),:where([tone=dark]) segmented-control[variant=default]:not([material]){background:var(--tint-200);border-color:var(--tint-300);box-shadow:inset 0 .5px 0 var(--tint-300)}:where([tone=dark]) button:not([variant]):hover:not(:disabled),:where([tone=dark]) button[variant=default]:hover:not(:disabled){background:var(--tint-300)}:where([tone=dark]) button:not([variant]):active:not(:disabled),:where([tone=dark]) button[variant=default]:active:not(:disabled){background:var(--tint-400);box-shadow:inset 0 1px 2px #0003}:where([tone=light]) button:not([variant]):not([material]):not(:disabled),:where([tone=light]) button[variant=default]:not([material]):not(:disabled),:where([tone=light]) segmented-control:not([variant]):not([material]),:where([tone=light]) segmented-control[variant=default]:not([material]){background:var(--color-surface);border-color:var(--tint-200);box-shadow:var(--shadow-control)}:where([tone=light]) button:not([variant]):hover:not(:disabled){background:color-mix(in srgb,var(--color-surface) 96%,black)}:where([tone=light]) button:not([variant]):active:not(:disabled){background:color-mix(in srgb,var(--color-surface) 88%,black);box-shadow:inset 0 1px 2px #00000014}button[size=sm],segmented-control[size=sm]{height:var(--control-height-sm)}button[size=sm][icon-only]{width:var(--control-height-sm)}button[size=xs]{height:var(--control-height-xs);padding:0 var(--space-6) 1px;border-radius:var(--radius-8)}button[size=xs][icon-only]{width:var(--control-height-xs);padding:0}button[icon-only]{width:var(--control-height-md);padding:0}[data-ui-icon]{display:inline-block;vertical-align:middle}[selectable],[selectable] *{user-select:text;-webkit-user-select:text}[unselectable],[unselectable] *{user-select:none;-webkit-user-select:none}.prose{line-height:var(--leading-base)}.prose h1{font-size:var(--text-xl);margin-bottom:var(--space-8)}.prose h2{font-size:var(--text-lg);margin-top:var(--space-24);margin-bottom:var(--space-8)}.prose h3,.prose h4,.prose h5,.prose h6{font-size:var(--text-base);margin-top:var(--space-24);margin-bottom:var(--space-8)}.prose p{margin:var(--space-12) 0}.prose ul,.prose ol{padding-left:var(--space-24);margin:var(--space-12) 0}.prose blockquote,.prose pre{margin:var(--space-12) 0}.prose hr{margin:var(--space-24) 0}.prose table{width:100%;margin:var(--space-12) 0}.prose img{max-width:100%;height:auto}.prose>:first-child{margin-top:0}.prose>:last-child{margin-bottom:0}[material=paper]{background:var(--white);border:.5px solid color-mix(in srgb,var(--black) var(--alpha-100),transparent);color:var(--color-text)}[material=glass]{background:transparent;border:.5px solid color-mix(in srgb,var(--black) var(--alpha-100),transparent);backdrop-filter:blur(20px) brightness(.95) saturate(1.5);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.5)}[material=glass-frosted]{background:color-mix(in srgb,var(--white) var(--alpha-800),transparent);border:.5px solid color-mix(in srgb,var(--black) var(--alpha-100),transparent);color:var(--color-text);backdrop-filter:var(--backdrop-blur-glass);-webkit-backdrop-filter:var(--backdrop-blur-glass)}[tone=dark]{color:color-mix(in srgb,var(--white) var(--alpha-950),transparent);border-color:color-mix(in srgb,var(--white) var(--alpha-200),transparent);--color-overlay-hover: color-mix(in srgb, var(--white) var(--alpha-100), transparent);--color-overlay-active: color-mix(in srgb, var(--white) var(--alpha-200), transparent);--color-bg-muted: color-mix(in srgb, var(--white) var(--alpha-100), transparent)}[tone=dark][material=paper]{background:var(--neutral-900)}[tone=dark][material=glass-frosted]{background:color-mix(in srgb,var(--black) 70%,transparent)}[tone=light]{color:var(--color-text);border-color:color-mix(in srgb,var(--black) var(--alpha-100),transparent);--color-overlay-hover: color-mix(in srgb, var(--black) var(--alpha-50), transparent);--color-overlay-active: color-mix(in srgb, var(--black) var(--alpha-100), transparent);--color-bg-muted: var(--neutral-100)}[level="1"]{box-shadow:0 12px 32px #00000024}[level="2"]{box-shadow:0 4px 6px -2px #0000001f,0 40px 60px -16px #00000038}action-row{display:flex;justify-content:flex-end;gap:var(--space-8);margin-top:var(--space-12)}copy-button{display:contents}copy-button button{position:relative}copy-button .copy-button-idle,copy-button .copy-button-done{display:inline-flex;align-items:center;gap:var(--space-6)}copy-button .copy-button-done{display:none}copy-button[copied] .copy-button-idle{visibility:hidden}copy-button[copied] .copy-button-done{display:flex;position:absolute;top:0;right:0;bottom:0;left:0;align-items:center;justify-content:center}dropdown-menu{position:relative;display:inline-block;color:inherit}dropdown-group{display:grid;gap:var(--space-4)}dropdown-label{display:block;padding:var(--space-4) var(--space-8);color:var(--color-text-muted);font:inherit;font-size:var(--text-sm);font-weight:600;letter-spacing:.04em;text-transform:uppercase}dropdown-divider{display:block;height:1px;margin:2px 0;background:var(--color-border)}[data-dropdown-trigger][aria-expanded=true],[data-dropdown-trigger][aria-expanded=true]:hover,dropdown-menu[open]::part(trigger),dropdown-menu[open]::part(trigger):hover{background:color-mix(in srgb,var(--color-surface) 88%,black);box-shadow:inset 0 1px 2px #00000014}[data-dropdown-trigger-label],dropdown-menu::part(trigger-label){min-width:0}[data-dropdown-trigger-icon],dropdown-menu::part(trigger-icon){display:inline-flex;align-items:center;justify-content:center;flex:none;color:var(--color-text-muted);transform:translateY(1px)}dropdown-item:focus-visible{outline:2px solid var(--color-focus-ring);outline-offset:2px}ui-popover.dropdown-popover::part(panel){min-width:192px;padding:var(--space-4)}.dropdown-list{display:flex;flex-direction:column;gap:2px}dropdown-item{display:flex;align-items:center;gap:var(--space-8);margin:0;padding:6px 12px;border-radius:var(--radius-8);font:inherit;line-height:1.2;color:inherit;font-weight:var(--font-weight-body);-webkit-user-select:none;user-select:none}dropdown-item>[data-ui-icon]{flex:none}dropdown-item[selected]{background:var(--color-overlay-active)}dropdown-item:hover,dropdown-item[action]:hover{background:var(--color-primary);color:var(--white)}dropdown-item[action]{color:inherit}dropdown-item[danger]{color:var(--color-danger)}dropdown-item[danger]:hover{background:var(--color-danger);color:var(--white)}editable-text{display:inline-block;max-width:100%;vertical-align:top}editable-text>.editable-text-span{display:inline-block;max-width:100%;outline:none;overflow:hidden;white-space:nowrap;cursor:inherit;vertical-align:top}editable-text:not([data-editing])>.editable-text-span{text-overflow:ellipsis}editable-text[data-editing]>.editable-text-span{cursor:text}modal-overlay{color:inherit}modal-overlay::part(backdrop){position:fixed;top:0;right:0;bottom:0;left:0;z-index:var(--layer-overlay);display:flex;align-items:center;justify-content:center;padding:var(--space-16);background:linear-gradient(to bottom,color-mix(in srgb,var(--black) var(--alpha-50),transparent),color-mix(in srgb,var(--black) var(--alpha-400),transparent));backdrop-filter:blur(1px);-webkit-backdrop-filter:blur(1px)}panel-view{display:block}panel-view::part(panel){display:flex;flex-direction:column;gap:var(--space-16);color:var(--color-text)}panel-view::part(header){display:flex;align-items:center;justify-content:space-between;gap:var(--space-12)}panel-view::part(title){margin:0;font:inherit;font-size:var(--text-lg);font-weight:600;color:var(--color-text)}panel-view::part(button){display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;margin:0;border:1px solid var(--color-border);border-radius:var(--radius-4);background:var(--color-surface);color:var(--color-text);box-shadow:none}panel-view::part(button):hover{background:var(--color-interactive-hover)}panel-view::part(button):focus-visible{outline:2px solid var(--color-focus-ring);outline-offset:2px}panel-view::part(icon){display:inline-flex;align-items:center;justify-content:center;flex:none}ui-popover{display:contents}ui-popover::part(panel){position:fixed;inset:0 auto auto 0;margin:0;min-width:192px;max-width:384px;padding:var(--space-16) var(--space-20);border-radius:var(--radius-12);outline:none;z-index:2000}segmented-control{display:inline-flex;align-items:stretch;box-sizing:border-box;height:var(--control-height-md)}segmented-control>button{height:auto}segmented-control[variant=ghost]{background:transparent;box-shadow:none}[tone=dark] segmented-control[variant=ghost]{border-color:var(--tint-400)}segmented-control>button{position:relative}segmented-control>button[icon-only]{width:auto;height:auto;padding:0 var(--space-6)}segmented-control>button:not([variant]):not(:disabled),[tone] segmented-control>button:not([variant]):not(:disabled){background:transparent;border:0;box-shadow:none}segmented-control>button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}segmented-control>button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}segmented-control>button:not(:first-child):not(:last-child){border-radius:0}segmented-control>button:not([variant]):hover:not(:disabled),[tone] segmented-control>button:not([variant]):hover:not(:disabled){background:var(--color-overlay-hover)}segmented-control>button:not([variant]):active:not(:disabled),[tone] segmented-control>button:not([variant]):active:not(:disabled){background:var(--color-overlay-active);box-shadow:none}segmented-control>button:not([variant])[aria-pressed=true]:not(:disabled),segmented-control>button:not([variant])[aria-current]:not([aria-current=false]):not(:disabled),segmented-control>button:not([variant])[aria-expanded=true]:not(:disabled),[tone] segmented-control>button:not([variant])[aria-pressed=true]:not(:disabled),[tone] segmented-control>button:not([variant])[aria-current]:not([aria-current=false]):not(:disabled),[tone] segmented-control>button:not([variant])[aria-expanded=true]:not(:disabled){background:linear-gradient(var(--color-overlay-active),var(--color-overlay-active))}segmented-control>button:not(:last-child):after{content:"";position:absolute;top:0;bottom:0;right:0;width:.5px;background:var(--tint-200);pointer-events:none}[tone=dark] segmented-control>button:not(:last-child):after{background:var(--tint-400)}segmented-control>dropdown-menu{display:inline-flex;align-items:stretch;height:auto}segmented-control>dropdown-menu>[slot=trigger]{height:auto;position:relative}segmented-control>dropdown-menu>[slot=trigger]:not([variant]):not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant]):not(:disabled){background:transparent;border:0;box-shadow:none}segmented-control>dropdown-menu:first-child>[slot=trigger]{border-top-right-radius:0;border-bottom-right-radius:0}segmented-control>dropdown-menu:last-child>[slot=trigger]{border-top-left-radius:0;border-bottom-left-radius:0}segmented-control>dropdown-menu:not(:first-child):not(:last-child)>[slot=trigger]{border-radius:0}segmented-control>dropdown-menu>[slot=trigger]:not([variant]):hover:not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant]):hover:not(:disabled){background:var(--color-overlay-hover)}segmented-control>dropdown-menu>[slot=trigger]:not([variant]):active:not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant]):active:not(:disabled){background:var(--color-overlay-active);box-shadow:none}segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-pressed=true]:not(:disabled),segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-current]:not([aria-current=false]):not(:disabled),segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-expanded=true]:not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-pressed=true]:not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-current]:not([aria-current=false]):not(:disabled),[tone] segmented-control>dropdown-menu>[slot=trigger]:not([variant])[aria-expanded=true]:not(:disabled){background:linear-gradient(var(--color-overlay-active),var(--color-overlay-active))}segmented-control[variant=glass]>button,segmented-control[variant=glass]>dropdown-menu{backdrop-filter:blur(20px) brightness(.95) saturate(1.5);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.5)}segmented-control[variant=glass]>button:not(:disabled):hover,segmented-control[variant=glass]>dropdown-menu:has(>[slot=trigger]:not(:disabled):hover){backdrop-filter:blur(20px) brightness(.95) saturate(1.8);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.8)}segmented-control[variant=glass]>button:not(:disabled):active,segmented-control[variant=glass]>dropdown-menu:has(>[slot=trigger]:not(:disabled):active){backdrop-filter:blur(20px) brightness(.95) saturate(2.2);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(2.2)}segmented-control[variant=glass]>button:not(:disabled)[aria-pressed=true],segmented-control[variant=glass]>button:not(:disabled)[aria-current]:not([aria-current=false]),segmented-control[variant=glass]>dropdown-menu:has(>[slot=trigger]:not(:disabled)[aria-pressed=true]),segmented-control[variant=glass]>dropdown-menu:has(>[slot=trigger]:not(:disabled)[aria-current]:not([aria-current=false])){backdrop-filter:blur(20px) brightness(.95) saturate(1.8);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(1.8)}segmented-control[variant=glass]>button:not(:disabled)[aria-expanded=true],segmented-control[variant=glass]>dropdown-menu:has(>[slot=trigger]:not(:disabled)[aria-expanded=true]){backdrop-filter:blur(20px) brightness(.95) saturate(2);-webkit-backdrop-filter:blur(20px) brightness(.95) saturate(2)}segmented-control>dropdown-menu:not(:last-child):after{content:"";position:absolute;top:0;bottom:0;right:0;width:.5px;background:var(--tint-200);pointer-events:none}[tone=dark] segmented-control>dropdown-menu:not(:last-child):after{background:var(--tint-400)}ui-spinner{display:inline-flex;align-items:center;justify-content:center;line-height:0;color:inherit}ui-spinner .spin,.spin{display:inline-flex;animation:ui-spinner-spin 1s steps(8,end) infinite}@keyframes ui-spinner-spin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.spin{animation:none}}system-modal[size=lg]{width:min(560px,100%)}system-modal{display:flex;flex-direction:column;width:min(400px,100%);box-sizing:border-box;padding:var(--space-32) var(--space-24);border-radius:var(--radius-12)}system-modal header{display:flex;flex-direction:column;align-items:center;gap:var(--space-16);text-align:center}system-modal header>hgroup{display:flex;flex-direction:column;align-items:center;gap:var(--space-4);max-width:100%}system-modal header h2{margin:0;font-size:var(--text-lg);font-weight:600;letter-spacing:.01em;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}system-modal header p{margin:0;font-size:var(--text-base);opacity:.7;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}ui-pill{display:inline-block;vertical-align:baseline;margin:2px 0;padding:0 var(--space-8);font-size:var(--text-sm);font-weight:500;line-height:1.7;border-radius:var(--radius-full);border:1px solid var(--neutral-300);background:var(--neutral-200);color:var(--neutral-900);white-space:nowrap}ui-pill[color=gray]{border-color:var(--neutral-300);background:var(--neutral-200);color:var(--neutral-900)}ui-pill[color=red]{border-color:var(--red-200);background:var(--red-100);color:var(--red-950)}ui-pill[color=orange]{border-color:var(--orange-200);background:var(--orange-100);color:var(--orange-950)}ui-pill[color=yellow]{border-color:var(--yellow-200);background:var(--yellow-100);color:var(--yellow-950)}ui-pill[color=green]{border-color:var(--green-200);background:var(--green-100);color:var(--green-950)}ui-pill[color=blue]{border-color:var(--blue-200);background:var(--blue-100);color:var(--blue-950)}ui-pill[color=purple]{border-color:var(--purple-200);background:var(--purple-100);color:var(--purple-950)}',nf=new CSSStyleSheet;nf.replaceSync(Z$);const rf=new CSSStyleSheet;try{document.adoptedStyleSheets=[...document.adoptedStyleSheets,nf,rf]}catch{}$b(document);function Cb(n){rf.replaceSync(n)}function _c(){Cb("")}function sf(n){try{n.adoptedStyleSheets=[...n.adoptedStyleSheets,nf,rf]}catch{}$b(n)}const B$=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function W$(n){for(const t of Object.keys(n))if(B$.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function j$(n,t){W$(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Fe(){class n extends Event{constructor(e,r){const{type:i,bubbles:s,cancelable:o,composed:a,...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:o,composed:a}),j$(this,c)}}return n}class It extends globalThis.EventTarget{}function G$(n,t,e){const r=n.dispose.bind(n);n.dispose=()=>{if(!t())return e(),r()}}function gl(n){var e;class t extends n{constructor(...s){super(...s);b(this,e,!1);G$(this,()=>l(this,e),()=>{m(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return l(this,e)}}return e=new WeakMap,t}const q$=Fe(),Vm=Fe(),Y$=Fe(),So=Fe(),Ib=Fe(),Rb=Fe(),K$=Fe(),Sh=Fe(),Je=4,vt=6,Vo=2,nd=2,of=8,J$=vt,af="auto",dr="auto",Yn=128,Zm=50,ce=16,yi=Yn*Je+ce*(Je-1),Zo=Yn*vt+ce*(vt-1),X$=yi+ce*2,Q$=200,eC=4,Ol=150,tC=10,Bm=2,Wm=8,nC=300,rC=4;function Pb(n){return Mb(n)}function Lb(n,t){return Mb(n.flatMap(e=>zb(e,t)))}function Db(n){const t=[],e=new Set;for(const r of n){if(r.type==="row"){t.push(`Top-level rows are invalid: ${r.id}`);continue}Nb(r,"strip",t,e)}return{valid:t.length===0,errors:t}}function Nr(n){const t=Pb(n),e=Db(t);if(!e.valid)throw new Error(`Invalid layout: ${e.errors.join("; ")}`);return{totalNodes:t.length,nodes:t.filter(r=>r.type!=="row").map(aC)}}function Mb(n){const t=[];for(const e of n){const r=Ob(e);for(const i of r){if(i.type==="row"){t.push(...i.children.map(Un));continue}t.push(i)}}return t}function Ob(n){switch(n.type){case"card":return[Un(n)];case"row":{const t=n.children.map(Un);return t.length===0?[]:t.length===1?[t[0]]:[{...n,children:t}]}case"stack":{const t=[];for(const e of n.children){const r=Ob(e);for(const i of r){if(i.type==="stack"){t.push(...i.children.map(rd));continue}if(i.type==="row"){t.push({...i,children:i.children.map(Un)});continue}t.push(Un(i))}}return t.length===0?[]:t.length===1?[rd(t[0])]:[{...n,children:t}]}}}function zb(n,t){switch(n.type){case"card":return n.artifactID===t?[]:[Un(n)];case"row":{const e=n.children.filter(r=>r.artifactID!==t).map(Un);return e.length===0?[]:e.length===1?[e[0]]:[{...n,children:e}]}case"stack":{const e=n.children.flatMap(r=>zb(r,t).filter(s=>s.type!=="stack"));return e.length===0?[]:e.length===1?[rd(e[0])]:[{...n,children:e}]}}}function Nb(n,t,e,r){switch(n.type){case"card":Ub(n,t,e,r);return;case"row":iC(n,t,e,r);return;case"stack":sC(n,t,e,r);return}}function Ub(n,t,e,r){"id"in n&&e.push(`Card ${uo(n)} must not include id`),typeof n.artifactID!="string"||n.artifactID.length===0?e.push("Card is missing artifactID"):r.has(n.artifactID)?e.push(`Duplicate artifactID in layout: ${n.artifactID}`):r.add(n.artifactID),oC(n.width)||e.push(`Card ${uo(n)} width must be an integer in the range ${Vo}-${of}`),Hb(n.height)||e.push(`Card ${uo(n)} height must be an integer in the range 2-6 or "auto"`);const i=es(n.width);t==="stack"&&i!==Je&&e.push(`Stack child ${uo(n)} width must be ${Je}`),t==="row"&&i<Vo&&e.push(`Row child ${uo(n)} must be at least 2 columns wide`)}function uo(n){return typeof n.artifactID=="string"&&n.artifactID.length>0?n.artifactID:"<missing artifactID>"}function iC(n,t,e,r){if(Fb(n.id,e),t!=="stack"&&e.push(`Row ${n.id} may only appear inside a stack`),Hb(n.height,rC)||e.push(`Row ${n.id} height must be an integer in the range 2-4 or "auto"`),!Array.isArray(n.children)||n.children.length===0){e.push(`Row ${n.id} must contain card nodes`);return}let i=0;for(const s of n.children){if(s.type!=="card"){e.push(`Row ${n.id} must contain only card nodes`);continue}Ub(s,"row",e,r),i+=es(s.width)}i!==Je&&e.push(`Row ${n.id} children must sum to 4 columns`)}function sC(n,t,e,r){if(Fb(n.id,e),t!=="strip"&&e.push(`Invalid nested stack at ${n.id}; stack children cannot contain another nested stack`),!Array.isArray(n.children)||n.children.length===0){e.push(`Stack ${n.id} must contain at least one child`);return}let i=0,s=0;for(const a of n.children){if(a.type==="stack"){e.push(`Stack ${n.id} cannot contain another nested stack`);continue}if(Nb(a,"stack",e,r),a.height===dr){s+=1;continue}i+=a.height}if(i>vt&&e.push(`Stack ${n.id} exceeds the 6-row budget`),s===0)return;const o=vt-i;if(o<s*nd||o%s!==0){e.push(`Stack ${n.id} has auto-height children that cannot resolve to whole height >= 2`);return}o/s<nd&&e.push(`Stack ${n.id} has auto-height children below the minimum row size`)}function Fb(n,t){(typeof n!="string"||n.length===0)&&t.push(`Node id must be a non-empty string: ${String(n)}`)}function oC(n){return n===af||Number.isInteger(n)&&n>=Vo&&n<=of}function Hb(n,t=J$){return n===dr||Number.isInteger(n)&&n>=nd&&n<=t}function es(n){return n===af?Je:n}function aC(n){if(n.type==="card")return{id:n.artifactID,type:"card",width:es(n.width),cards:[{id:n.artifactID,artifactID:n.artifactID,col:1,row:1,width:es(n.width),height:Vb(n.height,vt)}]};const t=lC(n.children),e=[];let r=1;for(let i=0;i<n.children.length;i+=1){const s=n.children[i],o=t[i];if(s.type==="card")e.push({id:s.artifactID,artifactID:s.artifactID,col:1,row:r,width:Je,height:o});else{let a=1;for(const c of s.children)e.push({id:c.artifactID,artifactID:c.artifactID,col:a,row:r,width:es(c.width),height:o}),a+=es(c.width)}r+=o}return{id:n.id,type:"stack",width:e.reduce((i,s)=>Math.max(i,s.col+s.width-1),1),cards:e}}function lC(n){let t=0,e=0;for(const i of n)i.height===dr?e+=1:t+=i.height;const r=e>0?(vt-t)/e:0;return n.map(i=>Vb(i.height,r))}function Vb(n,t){return n===dr?t:n}function Un(n){return{...n}}function rd(n){return n.type==="card"?Un(n):{...n,children:n.children.map(Un)}}const cC="X-Television-Client-Meta",uC="telemetry-activity",hC="telemetry-signal";function Zb(n,t={}){return{type:"card",artifactID:n,width:t.width??af,height:t.height??dr}}function ec(n){return n.layout.flatMap(Bb)}function Bb(n){switch(n.type){case"card":return[n.artifactID];case"row":return n.children.map(t=>t.artifactID);case"stack":return n.children.flatMap(Bb)}}const ie=Fe(),id=Fe(),Hi=Fe(),jm=Fe();function dC(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const lf=dC("RequestError"),pC=200,fC=300,zl=401;class gC{constructor(t,e){g(this,"serverURL");g(this,"token");g(this,"onUnauthorized");g(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){var o;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<pC||i.status>=fC)throw i.status===zl&&((o=this.onUnauthorized)==null||o.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===zl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await _h(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===zl&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await _h(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===zl&&((s=this.onUnauthorized)==null||s.call(this)),this.createError(await _h(i,i.statusText),i.status)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new lf(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(o){throw this.createError(o instanceof Error?o.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[cC]=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 _h(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 vC(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var en,Oc,Wb;class yC{constructor(t){b(this,Oc);b(this,en);m(this,en,t)}list(){return l(this,en).requestJSON("GET","/screens")}async get(t={}){const e=await d(this,Oc,Wb).call(this,t.screenID);return l(this,en).requestJSON("GET",`/screens/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),l(this,en).requestJSON("POST","/screens",e)}update(t){const{screenID:e,...r}=t;return l(this,en).requestJSON("PATCH",`/screens/${encodeURIComponent(e)}`,r)}remove(t){return l(this,en).requestJSON("DELETE",`/screens/${encodeURIComponent(t.screenID)}`)}}en=new WeakMap,Oc=new WeakSet,Wb=async function(t){if(t!==void 0)return t;const{screens:e}=await this.list();if(e.length===1)return e[0].id;throw l(this,en).createError(`screenID is required when multiple screens exist. Available screens: ${vC(e)}`)};var Cn;class bC{constructor(t){b(this,Cn);m(this,Cn,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.screenID=t.screenID,l(this,Cn).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.screenID!==void 0&&e.set("screenID",t.screenID);const r=e.toString();return l(this,Cn).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return l(this,Cn).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),l(this,Cn).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return l(this,Cn).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}}Cn=new WeakMap;var ls;class wC{constructor(t){b(this,ls);m(this,ls,t)}get(t){return l(this,ls).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return l(this,ls).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}ls=new WeakMap;var Zr;class SC{constructor(t){b(this,Zr);m(this,Zr,t)}status(){return l(this,Zr).requestJSON("GET","/telemetry")}enable(){return l(this,Zr).requestJSON("POST","/telemetry/enable")}disable(){return l(this,Zr).requestJSON("POST","/telemetry/disable")}}Zr=new WeakMap;var Br;class _C{constructor(t){b(this,Br);m(this,Br,t)}get(){return l(this,Br).requestJSON("GET","/display")}patch(t){const e={};return t.activeScreenID!==void 0&&(e.activeScreenID=t.activeScreenID),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),l(this,Br).requestVoid("PATCH","/display",e)}focus(t){return l(this,Br).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}Br=new WeakMap;var tn;class kC{constructor(t,e={}){g(this,"screens");g(this,"artifacts");g(this,"display");g(this,"markdown");g(this,"telemetry");b(this,tn);m(this,tn,new gC(t,e)),this.screens=new yC(l(this,tn)),this.artifacts=new bC(l(this,tn)),this.display=new _C(l(this,tn)),this.markdown=new wC(l(this,tn)),this.telemetry=new SC(l(this,tn))}health(){return l(this,tn).requestJSON("GET","/health")}}tn=new WeakMap;const EC={focusCommandInput:{label:"Focus Command Input",trigger:{key:"k",meta:!0}}},sd="0.0.0",xC=/^\d+\.\d+\.\d+$/,AC=3;function cf(n){return xC.test(n)}function jb(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<AC;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function TC(n,t){return n===sd||t===sd?!1:n!==t}const $C="Local",CC="store-";function ee(n){return new URL(n).origin}function IC(n){return{servers:[{url:ee(n),name:$C}],activeServerURL:null,activeScreenID:null,tabs:{},screens:{},authTokens:{},promotedOnboardingScreens:{}}}function RC(n,t){return[...n.promotedOnboardingScreens[ee(t)]??[]]}function PC(n,t,e){const r=ee(t),i=n.promotedOnboardingScreens[r]??[];return i.includes(e)?n:{...n,promotedOnboardingScreens:{...n.promotedOnboardingScreens,[r]:[...i,e]}}}function LC(n,t){return[...n.tabs[ee(t)]??[]]}function Gm(n,t,e){const r=ee(t),i=n.tabs[r]??[];return i.includes(e)?n:{...n,tabs:{...n.tabs,[r]:[...i,e]}}}function DC(n,t,e){const r=ee(t),i=n.tabs[r]??[],s=i.filter(a=>a!==e);if(s.length===i.length)return n;const o={...n.tabs};return s.length===0?delete o[r]:o[r]=s,{...n,tabs:o}}function MC(n,t,e=Date.now()){const r=n.screens[t]??{scrollPosition:0};return{...n,screens:{...n.screens,[t]:{...r,lastActivatedAt:e}}}}var Wr,jr,Gr;class OC extends It{constructor(e,r,i={}){super();b(this,Wr);b(this,jr);b(this,Gr);m(this,Wr,`${CC}${e}`),m(this,jr,i.storage??UC());const s=l(this,jr).getItem(l(this,Wr));s===null?(m(this,Gr,r),l(this,jr).setItem(l(this,Wr),JSON.stringify(r))):m(this,Gr,FC(JSON.parse(s),r))}get(){return l(this,Gr)}set(e){m(this,Gr,e),l(this,jr).setItem(l(this,Wr),JSON.stringify(e)),this.dispatchEvent(new ie("change"))}}Wr=new WeakMap,jr=new WeakMap,Gr=new WeakMap;function kh(n,t){return n.authTokens[ee(t)]??null}function zC(n,t,e){return{...n,authTokens:{...n.authTokens,[ee(t)]:e}}}function NC(n,t){const e=ee(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{...n,authTokens:r}}function UC(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function FC(n,t){return{servers:Array.isArray(n.servers)?n.servers:t.servers,activeServerURL:typeof n.activeServerURL=="string"||n.activeServerURL===null?n.activeServerURL:t.activeServerURL,activeScreenID:typeof n.activeScreenID=="string"||n.activeScreenID===null?n.activeScreenID:t.activeScreenID,tabs:n.tabs&&typeof n.tabs=="object"?n.tabs:t.tabs,screens:n.screens&&typeof n.screens=="object"?n.screens:t.screens,authTokens:n.authTokens&&typeof n.authTokens=="object"?n.authTokens:t.authTokens,promotedOnboardingScreens:n.promotedOnboardingScreens&&typeof n.promotedOnboardingScreens=="object"?n.promotedOnboardingScreens:{}}}class HC extends Event{constructor(){super("theme-changed")}}const VC=gl(It);var qr,Be,Jn,Ye,Xn,In,Ko,ne,Ir,Gb,Jo,qb,Yb,Kb,Jb,od,ad,ld,Xb;class ZC extends VC{constructor(e){var i;super();b(this,ne);g(this,"id");g(this,"server");b(this,qr);b(this,Be,new Map);b(this,Jn);b(this,Ye);b(this,Xn);b(this,In,null);b(this,Ko,0);b(this,Jo,e=>{if(this.disposed)return;const r=e.event;switch(r.type){case"screen-updated":r.screen.id===this.id&&d(this,ne,qb).call(this,r.screen);break;case"artifact-created":r.screenID===this.id&&d(this,ne,Yb).call(this,r.artifact);break;case"artifact-updated":d(this,ne,Kb).call(this,r.artifact);break;case"artifact-removed":r.screenID===this.id&&d(this,ne,Jb).call(this,r.artifactID);break;case"artifact-content-changed":l(this,Be).has(r.artifactID)&&this.dispatchEvent(new jm("artifact-content-changed",{artifactID:r.artifactID}));break;case"theme-changed":this.dispatchEvent(new HC);break}});this.id=e.screen.id,this.server=e.server,m(this,qr,e.localStore),m(this,Jn,e.screen.name),m(this,Ye,structuredClone(e.screen.layout));const r=((i=l(this,qr).get().screens[this.id])==null?void 0:i.scrollPosition)??0;m(this,Xn,Math.max(0,r)),this.server.addEventListener("server-event",l(this,Jo)),d(this,ne,Gb).call(this)}get name(){return l(this,Jn)}get layout(){return l(this,Ye)}get scrollPosition(){return l(this,Xn)}get artifacts(){return l(this,Be)}setScrollPosition(e){d(this,ne,Ir).call(this);const r=Math.max(0,e);r!==l(this,Xn)&&(m(this,Xn,r),d(this,ne,Xb).call(this),this.dispatchEvent(new ie("change")))}setLayout(e){d(this,ne,Ir).call(this);const r=Pb(e);if(!Db(r).valid)return;const s=d(this,ne,ad).call(this);m(this,Ye,r),m(this,In,{layout:r,snapshot:s}),this.dispatchEvent(new ie("change")),this.server.client.screens.update({screenID:this.id,layout:r.map(o=>structuredClone(o))}).catch(()=>{var o;this.disposed||((o=l(this,In))==null?void 0:o.layout)===r&&(m(this,In,null),d(this,ne,ld).call(this,s),this.dispatchEvent(new ie("change")))})}rename(e){d(this,ne,Ir).call(this),m(this,Jn,e),this.dispatchEvent(new ie("change")),this.server.client.screens.update({screenID:this.id,name:e}).catch(()=>{})}async remove(){d(this,ne,Ir).call(this),await this.server.client.screens.remove({screenID:this.id})}removeArtifact(e){if(d(this,ne,Ir).call(this),!l(this,Be).has(e))return;const r=d(this,ne,ad).call(this);d(this,ne,od).call(this,e),this.dispatchEvent(new ie("change")),this.server.client.artifacts.delete({artifactID:e}).catch(()=>{this.disposed||(d(this,ne,ld).call(this,r),this.dispatchEvent(new ie("change")))})}async refreshFromServer(){d(this,ne,Ir).call(this);const e=++Bu(this,Ko)._;let r;try{r=await this.server.client.screens.get({screenID:this.id})}catch{return}if(this.disposed||e!==l(this,Ko))return;const i=new Set([...l(this,Be).values()].filter(s=>s.kind==="path").map(s=>s.id));m(this,In,null),m(this,Jn,r.screen.name),m(this,Ye,structuredClone(r.screen.layout)),l(this,Be).clear();for(const s of r.artifacts)l(this,Be).set(s.id,s);this.dispatchEvent(new ie("change"));for(const s of r.artifacts)s.kind==="path"&&i.has(s.id)&&this.dispatchEvent(new jm("artifact-content-changed",{artifactID:s.id}))}dispose(){this.server.removeEventListener("server-event",l(this,Jo))}}qr=new WeakMap,Be=new WeakMap,Jn=new WeakMap,Ye=new WeakMap,Xn=new WeakMap,In=new WeakMap,Ko=new WeakMap,ne=new WeakSet,Ir=function(){if(this.disposed)throw new Error("ScreenModel is disposed")},Gb=async function(){try{const e=await this.server.client.screens.get({screenID:this.id});if(this.disposed)return;for(const r of e.artifacts)l(this,Be).set(r.id,r);this.dispatchEvent(new ie("change"))}catch{}},Jo=new WeakMap,qb=function(e){l(this,In)&&m(this,In,null),m(this,Jn,e.name),m(this,Ye,structuredClone(e.layout)),this.dispatchEvent(new ie("change"))},Yb=function(e){ec({layout:l(this,Ye)}).includes(e.id)||m(this,Ye,[...l(this,Ye),Zb(e.id)]),l(this,Be).set(e.id,e),this.dispatchEvent(new ie("change"))},Kb=function(e){const r=l(this,Be).get(e.id);r&&(l(this,Be).set(e.id,{...r,...e}),this.dispatchEvent(new ie("change")))},Jb=function(e){d(this,ne,od).call(this,e)&&this.dispatchEvent(new ie("change"))},od=function(e){const r=l(this,Be).delete(e),i=ec({layout:l(this,Ye)}).length,s=Lb(l(this,Ye),e),o=ec({layout:s}).length;return m(this,Ye,s),r||i!==o},ad=function(){return{layout:structuredClone(l(this,Ye)),artifacts:new Map([...l(this,Be).entries()].map(([e,r])=>[e,structuredClone(r)]))}},ld=function(e){m(this,Ye,structuredClone(e.layout)),l(this,Be).clear();for(const[r,i]of e.artifacts)l(this,Be).set(r,structuredClone(i))},Xb=function(){const e=l(this,qr).get();l(this,qr).set({...e,screens:{...e.screens,[this.id]:{...e.screens[this.id],scrollPosition:l(this,Xn)}}})};const BC=gl(It);var Ee,xe,Dt,Xo,Qo,ea,ta,na,De,tc,nc,cd,Wi;class WC extends BC{constructor(e){super();b(this,De);b(this,Ee);b(this,xe);b(this,Dt,null);b(this,Xo,()=>{this.disposed||d(this,De,tc).call(this)});b(this,Qo,()=>{this.disposed||(d(this,De,tc).call(this),d(this,De,nc).call(this))});b(this,ea,()=>{this.disposed||d(this,De,nc).call(this)});b(this,ta,e=>{if(this.disposed)return;const r=e.event;if(r.type==="screen-removed"){this.removeTab(e.serverURL,r.screenID);const i=l(this,Ee).get();i.activeServerURL===ee(e.serverURL)&&i.activeScreenID===r.screenID&&d(this,De,Wi).call(this,e.serverURL,null);return}if(r.type==="screen-changed"){if(r.screenID===null){d(this,De,Wi).call(this,e.serverURL,null);return}const i=l(this,xe).servers.get(ee(e.serverURL));if(!i||!i.screens.has(r.screenID))return;this.addTab(e.serverURL,r.screenID),d(this,De,Wi).call(this,e.serverURL,r.screenID)}});b(this,na,e=>{if(this.disposed)return;const r=l(this,Dt);r&&ee(e.serverURL)===ee(r.server.url)&&r.refreshFromServer()});m(this,Ee,e.localStore),m(this,xe,e.serverManager),l(this,Ee).addEventListener("change",l(this,Xo)),l(this,xe).addEventListener("change",l(this,Qo)),l(this,xe).addEventListener("screens-changed",l(this,ea)),l(this,xe).addEventListener("server-event",l(this,ta)),l(this,xe).addEventListener("server-reconnected",l(this,na)),d(this,De,tc).call(this),d(this,De,nc).call(this)}get activeScreen(){return l(this,Dt)}get screens(){const e=l(this,Ee).get().screens,r=[];let i=0;for(const s of l(this,xe).servers.values())for(const o of s.screens.values())r.push({server:s,screen:o,local:e[o.id]??{scrollPosition:0},index:i}),i+=1;return r.sort((s,o)=>{const a=(o.local.lastActivatedAt??0)-(s.local.lastActivatedAt??0);return a===0?s.index-o.index:a}).map(({index:s,...o})=>o)}getTabs(e){const r=ee(e),i=LC(l(this,Ee).get(),r),s=l(this,xe).servers.get(r);return s?i.filter(o=>s.screens.has(o)):i}hasTab(e,r){return this.getTabs(e).includes(r)}addTab(e,r){const i=ee(e),s=l(this,xe).servers.get(i);s&&!s.screens.has(r)||d(this,De,cd).call(this,Gm(l(this,Ee).get(),i,r))}removeTab(e,r){d(this,De,cd).call(this,DC(l(this,Ee).get(),e,r))}setActive(e,r){const i=ee(e),s=l(this,xe).servers.get(i);!s||!s.screens.has(r)||d(this,De,Wi).call(this,i,r)&&s.client.display.patch({activeScreenID:r}).catch(()=>{})}clearActive(){const e=l(this,Ee).get().activeServerURL;if(!e||!d(this,De,Wi).call(this,e,null))return;const r=l(this,xe).servers.get(e);r==null||r.client.display.patch({activeScreenID:null}).catch(()=>{})}dispose(){var e;l(this,Ee).removeEventListener("change",l(this,Xo)),l(this,xe).removeEventListener("change",l(this,Qo)),l(this,xe).removeEventListener("screens-changed",l(this,ea)),l(this,xe).removeEventListener("server-event",l(this,ta)),l(this,xe).removeEventListener("server-reconnected",l(this,na)),(e=l(this,Dt))==null||e.dispose(),m(this,Dt,null)}}Ee=new WeakMap,xe=new WeakMap,Dt=new WeakMap,Xo=new WeakMap,Qo=new WeakMap,ea=new WeakMap,ta=new WeakMap,na=new WeakMap,De=new WeakSet,tc=function(){var c,u,h;const{activeServerURL:e,activeScreenID:r}=l(this,Ee).get(),i=e?l(this,xe).servers.get(e)??null:null,s=i&&r?i.screens.get(r)??null:null,o=((c=l(this,Dt))==null?void 0:c.id)??null,a=(s==null?void 0:s.id)??null;o===a&&((u=l(this,Dt))==null?void 0:u.server)===i||((h=l(this,Dt))==null||h.dispose(),m(this,Dt,i&&s?new ZC({screen:s,server:i,localStore:l(this,Ee)}):null),i&&i.acpClient.setScreenContext(s?{screenID:s.id,screenName:s.name}:null),this.dispatchEvent(new q$("active-screen-changed")))},nc=function(){const e=l(this,Ee).get();let r=e;for(const[i,s]of l(this,xe).servers){const o=[...s.screens.values()].filter(c=>c.onboarding!==void 0).sort((c,u)=>c.onboarding.order-u.onboarding.order);if(o.length===0)continue;const a=new Set(RC(r,i));for(const c of o)a.has(c.onboarding.slug)||(r=PC(Gm(r,i,c.id),i,c.onboarding.slug))}r!==e&&(l(this,Ee).set(r),this.dispatchEvent(new Vm("tabs-changed")))},cd=function(e){e!==l(this,Ee).get()&&(l(this,Ee).set(e),this.dispatchEvent(new Vm("tabs-changed")))},Wi=function(e,r){const i=ee(e),s=l(this,Ee).get();if(s.activeServerURL===i&&s.activeScreenID===r)return!1;const o=r===null?{...s,activeServerURL:i,activeScreenID:r}:MC({...s,activeServerURL:i,activeScreenID:r},r);return l(this,Ee).set(o),!0};const Qb="0123456789ABCDEFGHJKMNPQRSTVWXYZ",kc=32,jC=16,e0=10,qm=0xffffffffffff;var Ur;(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"})(Ur||(Ur={}));class _o extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function GC(n){const t=Math.floor(n()*kc)%kc;return Qb.charAt(t)}function qC(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 _o(Ur.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 KC(n,t){let e="";for(;n>0;n--)e=GC(t)+e;return e}function JC(n,t=e0){if(isNaN(n))throw new _o(Ur.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>qm)throw new _o(Ur.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${qm}: ${n}`);if(n<0)throw new _o(Ur.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new _o(Ur.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%kc,r=Qb.charAt(e)+r,n=(n-e)/kc;return r}function XC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function fu(n,t){const e=qC(),r=Date.now();return JC(r,e0)+KC(jC,e)}function A(n,t,e){function r(a,c){if(a._zod||Object.defineProperty(a,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),a._zod.traits.has(n))return;a._zod.traits.add(n),t(a,c);const u=o.prototype,h=Object.keys(u);for(let f=0;f<h.length;f++){const v=h[f];v in a||(a[v]=u[v].bind(a))}}const i=(e==null?void 0:e.Parent)??Object;class s extends i{}Object.defineProperty(s,"name",{value:n});function o(a){var c;const u=e!=null&&e.Parent?new s:this;r(u,a),(c=u._zod).deferred??(c.deferred=[]);for(const h of u._zod.deferred)h();return u}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:a=>{var c,u;return e!=null&&e.Parent&&a instanceof e.Parent?!0:(u=(c=a==null?void 0:a._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(o,"name",{value:n}),o}class ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class t0 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const n0={};function pr(n){return n0}function r0(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 ud(n,t){return typeof t=="bigint"?t.toString():t}function gu(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function uf(n){return n==null}function hf(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function QC(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,o=Number.parseInt(n.toFixed(s).replace(".","")),a=Number.parseInt(t.toFixed(s).replace(".",""));return o%a/10**s}const Ym=Symbol("evaluating");function re(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==Ym)return r===void 0&&(r=Ym,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function Ci(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function wr(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function Km(n){return JSON.stringify(n)}function eI(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const i0="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Bo(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const tI=gu(()=>{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 Hs(n){if(Bo(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(Bo(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function s0(n){return Hs(n)?{...n}:Array.isArray(n)?[...n]:n}const nI=new Set(["string","number","symbol"]);function Vs(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Sr(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 O(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 rI(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const iI={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 sI(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=wr(n._zod.def,{get shape(){const o={};for(const a in t){if(!(a in e.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&(o[a]=e.shape[a])}return Ci(this,"shape",o),o},checks:[]});return Sr(n,s)}function oI(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=wr(n._zod.def,{get shape(){const o={...n._zod.def.shape};for(const a in t){if(!(a in e.shape))throw new Error(`Unrecognized key: "${a}"`);t[a]&&delete o[a]}return Ci(this,"shape",o),o},checks:[]});return Sr(n,s)}function aI(n,t){if(!Hs(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 o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=wr(n._zod.def,{get shape(){const s={...n._zod.def.shape,...t};return Ci(this,"shape",s),s}});return Sr(n,i)}function lI(n,t){if(!Hs(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=wr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return Ci(this,"shape",r),r}});return Sr(n,e)}function cI(n,t){const e=wr(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return Ci(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Sr(n,e)}function uI(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 o=wr(t._zod.def,{get shape(){const a=t._zod.def.shape,c={...a};if(e)for(const u in e){if(!(u in a))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:a[u]}):a[u])}else for(const u in a)c[u]=n?new n({type:"optional",innerType:a[u]}):a[u];return Ci(this,"shape",c),c},checks:[]});return Sr(t,o)}function hI(n,t,e){const r=wr(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(e)for(const o in e){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(s[o]=new n({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new n({type:"nonoptional",innerType:i[o]});return Ci(this,"shape",s),s}});return Sr(t,r)}function ts(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 ns(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function Nl(n){return typeof n=="string"?n:n==null?void 0:n.message}function fr(n,t,e){var i,s,o,a,c,u;const r={...n,path:n.path??[]};if(!n.message){const h=Nl((o=(s=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:s.error)==null?void 0:o.call(s,n))??Nl((a=t==null?void 0:t.error)==null?void 0:a.call(t,n))??Nl((c=e.customError)==null?void 0:c.call(e,n))??Nl((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=h}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function df(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Wo(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const o0=(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,ud,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},a0=A("$ZodError",o0),l0=A("$ZodError",o0,{Parent:Error});function dI(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 pI(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(o=>r({issues:o}));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 o=e,a=0;for(;a<s.path.length;){const c=s.path[a];a===s.path.length-1?(o[c]=o[c]||{_errors:[]},o[c]._errors.push(t(s))):o[c]=o[c]||{_errors:[]},o=o[c],a++}}};return r(n),e}const pf=n=>(t,e,r,i)=>{const s=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:e,issues:[]},s);if(o instanceof Promise)throw new ss;if(o.issues.length){const a=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>fr(c,s,pr())));throw i0(a,i==null?void 0:i.callee),a}return o.value},ff=n=>async(t,e,r,i)=>{const s=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:e,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const a=new((i==null?void 0:i.Err)??n)(o.issues.map(c=>fr(c,s,pr())));throw i0(a,i==null?void 0:i.callee),a}return o.value},mu=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 ss;return s.issues.length?{success:!1,error:new(n??a0)(s.issues.map(o=>fr(o,i,pr())))}:{success:!0,data:s.value}},fI=mu(l0),vu=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(o=>fr(o,i,pr())))}:{success:!0,data:s.value}},gI=vu(l0),mI=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return pf(n)(t,e,i)},vI=n=>(t,e,r)=>pf(n)(t,e,r),yI=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return ff(n)(t,e,i)},bI=n=>async(t,e,r)=>ff(n)(t,e,r),wI=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return mu(n)(t,e,i)},SI=n=>(t,e,r)=>mu(n)(t,e,r),_I=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return vu(n)(t,e,i)},kI=n=>async(t,e,r)=>vu(n)(t,e,r),EI=/^[cC][^\s-]{8,}$/,xI=/^[0-9a-z]+$/,AI=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,TI=/^[0-9a-vA-V]{20}$/,$I=/^[A-Za-z0-9]{27}$/,CI=/^[a-zA-Z0-9_-]{21}$/,II=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,RI=/^([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})$/,Jm=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)$/,PI=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,LI="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function DI(){return new RegExp(LI,"u")}const MI=/^(?:(?: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])$/,OI=/^(([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}|:))$/,zI=/^((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])$/,NI=/^(([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])$/,UI=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,c0=/^[A-Za-z0-9_-]*$/,FI=/^\+[1-9]\d{6,14}$/,u0="(?:(?:\\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])))",HI=new RegExp(`^${u0}$`);function h0(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 VI(n){return new RegExp(`^${h0(n)}$`)}function ZI(n){const t=h0({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(`^${u0}T(?:${r})$`)}const BI=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}$`)},WI=/^-?\d+$/,d0=/^-?\d+(?:\.\d+)?$/,jI=/^(?:true|false)$/i,GI=/^[^A-Z]*$/,qI=/^[^a-z]*$/,ht=A("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),p0={number:"number",bigint:"bigint",object:"date"},f0=A("$ZodCheckLessThan",(n,t)=>{ht.init(n,t);const e=p0[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})}}),g0=A("$ZodCheckGreaterThan",(n,t)=>{ht.init(n,t);const e=p0[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})}}),YI=A("$ZodCheckMultipleOf",(n,t)=>{ht.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):QC(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})}}),KI=A("$ZodCheckNumberFormat",(n,t)=>{var o;ht.init(n,t),t.format=t.format||"float64";const e=(o=t.format)==null?void 0:o.includes("int"),r=e?"int":"number",[i,s]=iI[t.format];n._zod.onattach.push(a=>{const c=a._zod.bag;c.format=t.format,c.minimum=i,c.maximum=s,e&&(c.pattern=WI)}),n._zod.check=a=>{const c=a.value;if(e){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?a.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}):a.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&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>s&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:s,inclusive:!0,inst:n,continue:!t.abort})}}),JI=A("$ZodCheckMaxLength",(n,t)=>{var e;ht.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!uf(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 o=df(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),XI=A("$ZodCheckMinLength",(n,t)=>{var e;ht.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!uf(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 o=df(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),QI=A("$ZodCheckLengthEquals",(n,t)=>{var e;ht.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!uf(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 o=df(i),a=s>t.length;r.issues.push({origin:o,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),yu=A("$ZodCheckStringFormat",(n,t)=>{var e,r;ht.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=()=>{})}),eR=A("$ZodCheckRegex",(n,t)=>{yu.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})}}),tR=A("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=GI),yu.init(n,t)}),nR=A("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=qI),yu.init(n,t)}),rR=A("$ZodCheckIncludes",(n,t)=>{ht.init(n,t);const e=Vs(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})}}),iR=A("$ZodCheckStartsWith",(n,t)=>{ht.init(n,t);const e=new RegExp(`^${Vs(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})}}),sR=A("$ZodCheckEndsWith",(n,t)=>{ht.init(n,t);const e=new RegExp(`.*${Vs(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})}}),oR=A("$ZodCheckOverwrite",(n,t)=>{ht.init(n,t),n._zod.check=e=>{e.value=t.tx(e.value)}});class aR{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(`
|
|
@@ -40,7 +40,7 @@ var X_=Object.defineProperty;var lg=n=>{throw TypeError(n)};var Q_=(n,t,e)=>t in
|
|
|
40
40
|
`)}y.write("payload.value = newResult;"),y.write("return payload;");const R=y.compile();return(N,V)=>R(v,N,V)};let s;const o=Bo,a=!n0.jitless,u=a&&tI.value,h=t.catchall;let f;n._zod.parse=(v,y)=>{f??(f=r.value);const E=v.value;return o(E)?a&&u&&(y==null?void 0:y.async)===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),h?b0([],E,v,y,f,n):v):e(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:E,inst:n}),v)}});function Qm(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=>!ts(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(o=>fr(o,r,pr())))}),t)}const w0=A("$ZodUnion",(n,t)=>{ye.init(n,t),re(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),re(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),re(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),re(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=>hf(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 o=!1;const a=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},s);if(u instanceof Promise)a.push(u),o=!0;else{if(u.issues.length===0)return u;a.push(u)}}return o?Promise.all(a).then(c=>Qm(c,i,n,s)):Qm(a,i,n,s)}}),HR=A("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,w0.init(n,t);const e=n._zod.parse;re(n._zod,"propValues",()=>{const i={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[a,c]of Object.entries(o)){i[a]||(i[a]=new Set);for(const u of c)i[a].add(u)}}return i});const r=gu(()=>{var o;const i=t.options,s=new Map;for(const a of i){const c=(o=a._zod.propValues)==null?void 0:o[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(a)}"`);for(const u of c){if(s.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);s.set(u,a)}}return s});n._zod.parse=(i,s)=>{const o=i.value;if(!Bo(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:n}),i;const a=r.value.get(o==null?void 0:o[t.discriminator]);return a?a._zod.run(i,s):t.unionFallback?e(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:o,path:[t.discriminator],inst:n}),i)}}),VR=A("$ZodIntersection",(n,t)=>{ye.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,u])=>ev(e,c,u)):ev(e,s,o)}});function hd(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(Hs(n)&&Hs(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 o=hd(n[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.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],o=hd(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};e.push(o.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function ev(n,t,e){const r=new Map;let i;for(const a of t.issues)if(a.code==="unrecognized_keys"){i??(i=a);for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(a);for(const a of e.issues)if(a.code==="unrecognized_keys")for(const c of a.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(a);const s=[...r].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(s.length&&i&&n.issues.push({...i,keys:s}),ts(n))return n;const o=hd(t.value,e.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return n.value=o.data,n}const ZR=A("$ZodRecord",(n,t)=>{ye.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Hs(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const s=[],o=t.keyType._zod.values;if(o){e.value={};const a=new Set;for(const u of o)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){a.add(typeof u=="number"?u.toString():u);const h=t.valueType._zod.run({value:i[u],issues:[]},r);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&e.issues.push(...ns(u,f.issues)),e.value[u]=f.value})):(h.issues.length&&e.issues.push(...ns(u,h.issues)),e.value[u]=h.value)}let c;for(const u in i)a.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 a of Reflect.ownKeys(i)){if(a==="__proto__")continue;let c=t.keyType._zod.run({value:a,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof a=="string"&&d0.test(a)&&c.issues.length){const f=t.keyType._zod.run({value:Number(a),issues:[]},r);if(f instanceof Promise)throw new Error("Async schemas not supported in object keys currently");f.issues.length===0&&(c=f)}if(c.issues.length){t.mode==="loose"?e.value[a]=i[a]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(f=>fr(f,r,pr())),input:a,path:[a],inst:n});continue}const h=t.valueType._zod.run({value:i[a],issues:[]},r);h instanceof Promise?s.push(h.then(f=>{f.issues.length&&e.issues.push(...ns(a,f.issues)),e.value[c.value]=f.value})):(h.issues.length&&e.issues.push(...ns(a,h.issues)),e.value[c.value]=h.value)}}return s.length?Promise.all(s).then(()=>e):e}}),BR=A("$ZodEnum",(n,t)=>{ye.init(n,t);const e=r0(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>nI.has(typeof i)).map(i=>typeof i=="string"?Vs(i):i.toString()).join("|")})$`),n._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:e,input:o,inst:n}),i}}),WR=A("$ZodLiteral",(n,t)=>{if(ye.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"?Vs(r):r?Vs(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}}),jR=A("$ZodTransform",(n,t)=>{ye.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new t0(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(e.value=o,e));if(i instanceof Promise)throw new ss;return e.value=i,e}});function tv(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const S0=A("$ZodOptional",(n,t)=>{ye.init(n,t),n._zod.optin="optional",n._zod.optout="optional",re(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),re(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${hf(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=>tv(s,e.value)):tv(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),GR=A("$ZodExactOptional",(n,t)=>{S0.init(n,t),re(n._zod,"values",()=>t.innerType._zod.values),re(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),qR=A("$ZodNullable",(n,t)=>{ye.init(n,t),re(n._zod,"optin",()=>t.innerType._zod.optin),re(n._zod,"optout",()=>t.innerType._zod.optout),re(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${hf(e.source)}|null)$`):void 0}),re(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)}),YR=A("$ZodDefault",(n,t)=>{ye.init(n,t),n._zod.optin="optional",re(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=>nv(s,t)):nv(i,t)}});function nv(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const KR=A("$ZodPrefault",(n,t)=>{ye.init(n,t),n._zod.optin="optional",re(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))}),JR=A("$ZodNonOptional",(n,t)=>{ye.init(n,t),re(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=>rv(s,n)):rv(i,n)}});function rv(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 XR=A("$ZodCatch",(n,t)=>{ye.init(n,t),re(n._zod,"optin",()=>t.innerType._zod.optin),re(n._zod,"optout",()=>t.innerType._zod.optout),re(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(o=>fr(o,r,pr()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(s=>fr(s,r,pr()))},input:e.value}),e.issues=[]),e)}}),QR=A("$ZodPipe",(n,t)=>{ye.init(n,t),re(n._zod,"values",()=>t.in._zod.values),re(n._zod,"optin",()=>t.in._zod.optin),re(n._zod,"optout",()=>t.out._zod.optout),re(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(o=>Ul(o,t.in,r)):Ul(s,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(s=>Ul(s,t.out,r)):Ul(i,t.out,r)}});function Ul(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const eP=A("$ZodReadonly",(n,t)=>{ye.init(n,t),re(n._zod,"propValues",()=>t.innerType._zod.propValues),re(n._zod,"values",()=>t.innerType._zod.values),re(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),re(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(iv):iv(i)}});function iv(n){return n.value=Object.freeze(n.value),n}const tP=A("$ZodCustom",(n,t)=>{ht.init(n,t),ye.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(Wo(i))}}var ov;class nP{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 rP(){return new nP}(ov=globalThis).__zod_globalRegistry??(ov.__zod_globalRegistry=rP());const ko=globalThis.__zod_globalRegistry;function iP(n,t){return new n({type:"string",...O(t)})}function sP(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...O(t)})}function av(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...O(t)})}function oP(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...O(t)})}function aP(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...O(t)})}function lP(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...O(t)})}function cP(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...O(t)})}function uP(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...O(t)})}function hP(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...O(t)})}function dP(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...O(t)})}function pP(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...O(t)})}function fP(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...O(t)})}function gP(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...O(t)})}function mP(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...O(t)})}function vP(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...O(t)})}function yP(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...O(t)})}function bP(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...O(t)})}function wP(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...O(t)})}function SP(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...O(t)})}function _P(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...O(t)})}function kP(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...O(t)})}function EP(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...O(t)})}function xP(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...O(t)})}function AP(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...O(t)})}function TP(n,t){return new n({type:"string",format:"date",check:"string_format",...O(t)})}function $P(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...O(t)})}function CP(n,t){return new n({type:"string",format:"duration",check:"string_format",...O(t)})}function IP(n,t){return new n({type:"number",checks:[],...O(t)})}function RP(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...O(t)})}function PP(n,t){return new n({type:"boolean",...O(t)})}function LP(n){return new n({type:"unknown"})}function DP(n,t){return new n({type:"never",...O(t)})}function lv(n,t){return new f0({check:"less_than",...O(t),value:n,inclusive:!1})}function Eh(n,t){return new f0({check:"less_than",...O(t),value:n,inclusive:!0})}function cv(n,t){return new g0({check:"greater_than",...O(t),value:n,inclusive:!1})}function xh(n,t){return new g0({check:"greater_than",...O(t),value:n,inclusive:!0})}function uv(n,t){return new YI({check:"multiple_of",...O(t),value:n})}function _0(n,t){return new JI({check:"max_length",...O(t),maximum:n})}function xc(n,t){return new XI({check:"min_length",...O(t),minimum:n})}function k0(n,t){return new QI({check:"length_equals",...O(t),length:n})}function MP(n,t){return new eR({check:"string_format",format:"regex",...O(t),pattern:n})}function OP(n){return new tR({check:"string_format",format:"lowercase",...O(n)})}function zP(n){return new nR({check:"string_format",format:"uppercase",...O(n)})}function NP(n,t){return new rR({check:"string_format",format:"includes",...O(t),includes:n})}function UP(n,t){return new iR({check:"string_format",format:"starts_with",...O(t),prefix:n})}function FP(n,t){return new sR({check:"string_format",format:"ends_with",...O(t),suffix:n})}function eo(n){return new oR({check:"overwrite",tx:n})}function HP(n){return eo(t=>t.normalize(n))}function VP(){return eo(n=>n.trim())}function ZP(){return eo(n=>n.toLowerCase())}function BP(){return eo(n=>n.toUpperCase())}function WP(){return eo(n=>eI(n))}function jP(n,t,e){return new n({type:"array",element:t,...O(e)})}function GP(n,t,e){return new n({type:"custom",check:"custom",fn:t,...O(e)})}function qP(n){const t=YP(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(Wo(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(Wo(i))}},n(e.value,e)));return t}function YP(n,t){const e=new ht({check:"custom",...O(t)});return e._zod.check=n,e}function E0(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)??ko,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 $e(n,t,e={path:[],schemaPath:[]}){var h,f;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 o={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,o);const a=(f=(h=n._zod).toJSONSchema)==null?void 0:f.call(h);if(a)o.schema=a;else{const v={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,o.schema,v);else{const E=o.schema,x=t.processors[i.type];if(!x)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);x(n,t,E,v)}const y=n._zod.parent;y&&(o.ref||(o.ref=y),$e(y,t,v),t.seen.get(y).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(o.schema,c),t.io==="input"&&Qe(n)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&o.schema._prefault&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(n).schema}function x0(n,t){var o,a,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 h of n.seen.entries()){const f=(o=n.metadataRegistry.get(h[0]))==null?void 0:o.id;if(f){const v=r.get(f);if(v&&v!==h[0])throw new Error(`Duplicate schema id "${f}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(f,h[0])}}const i=h=>{var x;const f=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const C=(x=n.external.registry.get(h[0]))==null?void 0:x.id,L=n.external.uri??(W=>W);if(C)return{ref:L(C)};const R=h[1].defId??h[1].schema.id??`schema${n.counter++}`;return h[1].defId=R,{defId:R,ref:`${L("__shared")}#/${f}/${R}`}}if(h[1]===e)return{ref:"#"};const y=`#/${f}/`,E=h[1].schema.id??`__schema${n.counter++}`;return{defId:E,ref:y+E}},s=h=>{if(h[1].schema.$ref)return;const f=h[1],{ref:v,defId:y}=i(h);f.def={...f.schema},y&&(f.defId=y);const E=f.schema;for(const x in E)delete E[x];E.$ref=v};if(n.cycles==="throw")for(const h of n.seen.entries()){const f=h[1];if(f.cycle)throw new Error(`Cycle detected: #/${(a=f.cycle)==null?void 0:a.join("/")}/<root>
|
|
41
41
|
|
|
42
42
|
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const h of n.seen.entries()){const f=h[1];if(t===h[0]){s(h);continue}if(n.external){const y=(c=n.external.registry.get(h[0]))==null?void 0:c.id;if(t!==h[0]&&y){s(h);continue}}if((u=n.metadataRegistry.get(h[0]))==null?void 0:u.id){s(h);continue}if(f.cycle){s(h);continue}if(f.count>1&&n.reused==="ref"){s(h);continue}}}function A0(n,t){var o,a,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const h=n.seen.get(u);if(h.ref===null)return;const f=h.def??h.schema,v={...f},y=h.ref;if(h.ref=null,y){r(y);const x=n.seen.get(y),C=x.schema;if(C.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(f.allOf=f.allOf??[],f.allOf.push(C)):Object.assign(f,C),Object.assign(f,v),u._zod.parent===y)for(const R in f)R==="$ref"||R==="allOf"||R in v||delete f[R];if(C.$ref&&x.def)for(const R in f)R==="$ref"||R==="allOf"||R in x.def&&JSON.stringify(f[R])===JSON.stringify(x.def[R])&&delete f[R]}const E=u._zod.parent;if(E&&E!==y){r(E);const x=n.seen.get(E);if(x!=null&&x.schema.$ref&&(f.$ref=x.schema.$ref,x.def))for(const C in f)C==="$ref"||C==="allOf"||C in x.def&&JSON.stringify(f[C])===JSON.stringify(x.def[C])&&delete f[C]}n.override({zodSchema:u,jsonSchema:f,path:h.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,(o=n.external)!=null&&o.uri){const u=(a=n.external.registry.get(t))==null?void 0:a.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 h=u[1];h.def&&h.defId&&(s[h.defId]=h.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:Ac(t,"input",n.processors),output:Ac(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Qe(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 Qe(r.element,e);if(r.type==="set")return Qe(r.valueType,e);if(r.type==="lazy")return Qe(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 Qe(r.innerType,e);if(r.type==="intersection")return Qe(r.left,e)||Qe(r.right,e);if(r.type==="record"||r.type==="map")return Qe(r.keyType,e)||Qe(r.valueType,e);if(r.type==="pipe")return Qe(r.in,e)||Qe(r.out,e);if(r.type==="object"){for(const i in r.shape)if(Qe(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Qe(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Qe(i,e))return!0;return!!(r.rest&&Qe(r.rest,e))}return!1}const KP=(n,t={})=>e=>{const r=E0({...e,processors:t});return $e(n,r),x0(r,n),A0(r,n)},Ac=(n,t,e={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=E0({...i??{},target:s,io:t,processors:e});return $e(n,o),x0(o,n),A0(o,n)},JP={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},XP=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:s,maximum:o,format:a,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),a&&(i.format=JP[a]??a,i.format===""&&delete i.format,a==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const h=[...c];h.length===1?i.pattern=h[0].source:h.length>1&&(i.allOf=[...h.map(f=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))])}},QP=(n,t,e,r)=>{const i=e,{minimum:s,maximum:o,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:h}=n._zod.bag;typeof a=="string"&&a.includes("int")?i.type="integer":i.type="number",typeof h=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=h,i.exclusiveMinimum=!0):i.exclusiveMinimum=h),typeof s=="number"&&(i.minimum=s,typeof h=="number"&&t.target!=="draft-04"&&(h>=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 o=="number"&&(i.maximum=o,typeof u=="number"&&t.target!=="draft-04"&&(u<=o?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},e2=(n,t,e,r)=>{e.type="boolean"},t2=(n,t,e,r)=>{e.not={}},n2=(n,t,e,r)=>{},r2=(n,t,e,r)=>{const i=n._zod.def,s=r0(i.entries);s.every(o=>typeof o=="number")&&(e.type="number"),s.every(o=>typeof o=="string")&&(e.type="string"),e.enum=s},i2=(n,t,e,r)=>{const i=n._zod.def,s=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];e.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[o]:e.const=o}else s.every(o=>typeof o=="number")&&(e.type="number"),s.every(o=>typeof o=="string")&&(e.type="string"),s.every(o=>typeof o=="boolean")&&(e.type="boolean"),s.every(o=>o===null)&&(e.type="null"),e.enum=s},s2=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},o2=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},a2=(n,t,e,r)=>{const i=e,s=n._zod.def,{minimum:o,maximum:a}=n._zod.bag;typeof o=="number"&&(i.minItems=o),typeof a=="number"&&(i.maxItems=a),i.type="array",i.items=$e(s.element,t,{...r,path:[...r.path,"items"]})},l2=(n,t,e,r)=>{var u;const i=e,s=n._zod.def;i.type="object",i.properties={};const o=s.shape;for(const h in o)i.properties[h]=$e(o[h],t,{...r,path:[...r.path,"properties",h]});const a=new Set(Object.keys(o)),c=new Set([...a].filter(h=>{const f=s.shape[h]._zod;return t.io==="input"?f.optin===void 0:f.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=$e(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},c2=(n,t,e,r)=>{const i=n._zod.def,s=i.inclusive===!1,o=i.options.map((a,c)=>$e(a,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?e.oneOf=o:e.anyOf=o},u2=(n,t,e,r)=>{const i=n._zod.def,s=$e(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=$e(i.right,t,{...r,path:[...r.path,"allOf",1]}),a=u=>"allOf"in u&&Object.keys(u).length===1,c=[...a(s)?s.allOf:[s],...a(o)?o.allOf:[o]];e.allOf=c},h2=(n,t,e,r)=>{const i=e,s=n._zod.def;i.type="object";const o=s.keyType,a=o._zod.bag,c=a==null?void 0:a.patterns;if(s.mode==="loose"&&c&&c.size>0){const h=$e(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const f of c)i.patternProperties[f.source]=h}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=$e(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=$e(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=o._zod.values;if(u){const h=[...u].filter(f=>typeof f=="string"||typeof f=="number");h.length>0&&(i.required=h)}},d2=(n,t,e,r)=>{const i=n._zod.def,s=$e(i.innerType,t,r),o=t.seen.get(n);t.target==="openapi-3.0"?(o.ref=i.innerType,e.nullable=!0):e.anyOf=[s,{type:"null"}]},p2=(n,t,e,r)=>{const i=n._zod.def;$e(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},f2=(n,t,e,r)=>{const i=n._zod.def;$e(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},g2=(n,t,e,r)=>{const i=n._zod.def;$e(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)))},m2=(n,t,e,r)=>{const i=n._zod.def;$e(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=o},v2=(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;$e(s,t,r);const o=t.seen.get(n);o.ref=s},y2=(n,t,e,r)=>{const i=n._zod.def;$e(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType,e.readOnly=!0},T0=(n,t,e,r)=>{const i=n._zod.def;$e(i.innerType,t,r);const s=t.seen.get(n);s.ref=i.innerType},b2=A("ZodISODateTime",(n,t)=>{wR.init(n,t),we.init(n,t)});function w2(n){return AP(b2,n)}const S2=A("ZodISODate",(n,t)=>{SR.init(n,t),we.init(n,t)});function _2(n){return TP(S2,n)}const k2=A("ZodISOTime",(n,t)=>{_R.init(n,t),we.init(n,t)});function E2(n){return $P(k2,n)}const x2=A("ZodISODuration",(n,t)=>{kR.init(n,t),we.init(n,t)});function A2(n){return CP(x2,n)}const $0=(n,t)=>{a0.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>pI(n,e)},flatten:{value:e=>dI(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,ud,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,ud,2)}},isEmpty:{get(){return n.issues.length===0}}})},hv=A("ZodError",$0),Rt=A("ZodError",$0,{Parent:Error}),T2=pf(Rt),$2=ff(Rt),C2=mu(Rt),I2=vu(Rt),R2=mI(Rt),P2=vI(Rt),L2=yI(Rt),D2=bI(Rt),M2=wI(Rt),O2=SI(Rt),z2=_I(Rt),N2=kI(Rt),be=A("ZodType",(n,t)=>(ye.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:Ac(n,"input"),output:Ac(n,"output")}}),n.toJSONSchema=KP(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone(wr(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)=>Sr(n,e,r),n.brand=()=>n,n.register=(e,r)=>(e.add(n,r),n),n.parse=(e,r)=>T2(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>C2(n,e,r),n.parseAsync=async(e,r)=>$2(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>I2(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>R2(n,e,r),n.decode=(e,r)=>P2(n,e,r),n.encodeAsync=async(e,r)=>L2(n,e,r),n.decodeAsync=async(e,r)=>D2(n,e,r),n.safeEncode=(e,r)=>M2(n,e,r),n.safeDecode=(e,r)=>O2(n,e,r),n.safeEncodeAsync=async(e,r)=>z2(n,e,r),n.safeDecodeAsync=async(e,r)=>N2(n,e,r),n.refine=(e,r)=>n.check(IL(e,r)),n.superRefine=e=>n.check(RL(e)),n.overwrite=e=>n.check(eo(e)),n.optional=()=>fv(n),n.exactOptional=()=>vL(n),n.nullable=()=>gv(n),n.nullish=()=>fv(gv(n)),n.nonoptional=e=>kL(n,e),n.array=()=>M(n),n.or=e=>j([n,e]),n.and=e=>bu(n,e),n.transform=e=>mv(n,gL(e)),n.default=e=>wL(n,e),n.prefault=e=>_L(n,e),n.catch=e=>xL(n,e),n.pipe=e=>mv(n,e),n.readonly=()=>$L(n),n.describe=e=>{const r=n.clone();return ko.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=ko.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return ko.get(n);const r=n.clone();return ko.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),C0=A("_ZodString",(n,t)=>{gf.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>XP(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(MP(...r)),n.includes=(...r)=>n.check(NP(...r)),n.startsWith=(...r)=>n.check(UP(...r)),n.endsWith=(...r)=>n.check(FP(...r)),n.min=(...r)=>n.check(xc(...r)),n.max=(...r)=>n.check(_0(...r)),n.length=(...r)=>n.check(k0(...r)),n.nonempty=(...r)=>n.check(xc(1,...r)),n.lowercase=r=>n.check(OP(r)),n.uppercase=r=>n.check(zP(r)),n.trim=()=>n.check(VP()),n.normalize=(...r)=>n.check(HP(...r)),n.toLowerCase=()=>n.check(ZP()),n.toUpperCase=()=>n.check(BP()),n.slugify=()=>n.check(WP())}),U2=A("ZodString",(n,t)=>{gf.init(n,t),C0.init(n,t),n.email=e=>n.check(sP(F2,e)),n.url=e=>n.check(uP(H2,e)),n.jwt=e=>n.check(xP(nL,e)),n.emoji=e=>n.check(hP(V2,e)),n.guid=e=>n.check(av(dv,e)),n.uuid=e=>n.check(oP(Fl,e)),n.uuidv4=e=>n.check(aP(Fl,e)),n.uuidv6=e=>n.check(lP(Fl,e)),n.uuidv7=e=>n.check(cP(Fl,e)),n.nanoid=e=>n.check(dP(Z2,e)),n.guid=e=>n.check(av(dv,e)),n.cuid=e=>n.check(pP(B2,e)),n.cuid2=e=>n.check(fP(W2,e)),n.ulid=e=>n.check(gP(j2,e)),n.base64=e=>n.check(_P(Q2,e)),n.base64url=e=>n.check(kP(eL,e)),n.xid=e=>n.check(mP(G2,e)),n.ksuid=e=>n.check(vP(q2,e)),n.ipv4=e=>n.check(yP(Y2,e)),n.ipv6=e=>n.check(bP(K2,e)),n.cidrv4=e=>n.check(wP(J2,e)),n.cidrv6=e=>n.check(SP(X2,e)),n.e164=e=>n.check(EP(tL,e)),n.datetime=e=>n.check(w2(e)),n.date=e=>n.check(_2(e)),n.time=e=>n.check(E2(e)),n.duration=e=>n.check(A2(e))});function p(n){return iP(U2,n)}const we=A("ZodStringFormat",(n,t)=>{me.init(n,t),C0.init(n,t)}),F2=A("ZodEmail",(n,t)=>{hR.init(n,t),we.init(n,t)}),dv=A("ZodGUID",(n,t)=>{cR.init(n,t),we.init(n,t)}),Fl=A("ZodUUID",(n,t)=>{uR.init(n,t),we.init(n,t)}),H2=A("ZodURL",(n,t)=>{dR.init(n,t),we.init(n,t)}),V2=A("ZodEmoji",(n,t)=>{pR.init(n,t),we.init(n,t)}),Z2=A("ZodNanoID",(n,t)=>{fR.init(n,t),we.init(n,t)}),B2=A("ZodCUID",(n,t)=>{gR.init(n,t),we.init(n,t)}),W2=A("ZodCUID2",(n,t)=>{mR.init(n,t),we.init(n,t)}),j2=A("ZodULID",(n,t)=>{vR.init(n,t),we.init(n,t)}),G2=A("ZodXID",(n,t)=>{yR.init(n,t),we.init(n,t)}),q2=A("ZodKSUID",(n,t)=>{bR.init(n,t),we.init(n,t)}),Y2=A("ZodIPv4",(n,t)=>{ER.init(n,t),we.init(n,t)}),K2=A("ZodIPv6",(n,t)=>{xR.init(n,t),we.init(n,t)}),J2=A("ZodCIDRv4",(n,t)=>{AR.init(n,t),we.init(n,t)}),X2=A("ZodCIDRv6",(n,t)=>{TR.init(n,t),we.init(n,t)}),Q2=A("ZodBase64",(n,t)=>{$R.init(n,t),we.init(n,t)}),eL=A("ZodBase64URL",(n,t)=>{IR.init(n,t),we.init(n,t)}),tL=A("ZodE164",(n,t)=>{RR.init(n,t),we.init(n,t)}),nL=A("ZodJWT",(n,t)=>{LR.init(n,t),we.init(n,t)}),I0=A("ZodNumber",(n,t)=>{v0.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>QP(n,r,i),n.gt=(r,i)=>n.check(cv(r,i)),n.gte=(r,i)=>n.check(xh(r,i)),n.min=(r,i)=>n.check(xh(r,i)),n.lt=(r,i)=>n.check(lv(r,i)),n.lte=(r,i)=>n.check(Eh(r,i)),n.max=(r,i)=>n.check(Eh(r,i)),n.int=r=>n.check(pv(r)),n.safe=r=>n.check(pv(r)),n.positive=r=>n.check(cv(0,r)),n.nonnegative=r=>n.check(xh(0,r)),n.negative=r=>n.check(lv(0,r)),n.nonpositive=r=>n.check(Eh(0,r)),n.multipleOf=(r,i)=>n.check(uv(r,i)),n.step=(r,i)=>n.check(uv(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 B(n){return IP(I0,n)}const rL=A("ZodNumberFormat",(n,t)=>{DR.init(n,t),I0.init(n,t)});function pv(n){return RP(rL,n)}const iL=A("ZodBoolean",(n,t)=>{MR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>e2(n,e,r)});function Ne(n){return PP(iL,n)}const sL=A("ZodUnknown",(n,t)=>{OR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>n2()});function _(){return LP(sL)}const oL=A("ZodNever",(n,t)=>{zR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>t2(n,e,r)});function aL(n){return DP(oL,n)}const lL=A("ZodArray",(n,t)=>{NR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>a2(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(xc(e,r)),n.nonempty=e=>n.check(xc(1,e)),n.max=(e,r)=>n.check(_0(e,r)),n.length=(e,r)=>n.check(k0(e,r)),n.unwrap=()=>n.element});function M(n,t){return jP(lL,n,t)}const R0=A("ZodObject",(n,t)=>{FR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>l2(n,e,r,i),re(n,"shape",()=>t.shape),n.keyof=()=>D0(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:_()}),n.loose=()=>n.clone({...n._zod.def,catchall:_()}),n.strict=()=>n.clone({...n._zod.def,catchall:aL()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>aI(n,e),n.safeExtend=e=>lI(n,e),n.merge=e=>cI(n,e),n.pick=e=>sI(n,e),n.omit=e=>oI(n,e),n.partial=(...e)=>uI(M0,n,e[0]),n.required=(...e)=>hI(O0,n,e[0])});function P0(n,t){const e={type:"object",shape:n??{},...O(t)};return new R0(e)}function w(n,t){return new R0({type:"object",shape:n,catchall:_(),...O(t)})}const L0=A("ZodUnion",(n,t)=>{w0.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>c2(n,e,r,i),n.options=t.options});function j(n,t){return new L0({type:"union",options:n,...O(t)})}const cL=A("ZodDiscriminatedUnion",(n,t)=>{L0.init(n,t),HR.init(n,t)});function uL(n,t,e){return new cL({type:"union",options:t,discriminator:n,...O(e)})}const hL=A("ZodIntersection",(n,t)=>{VR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>u2(n,e,r,i)});function bu(n,t){return new hL({type:"intersection",left:n,right:t})}const dL=A("ZodRecord",(n,t)=>{ZR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>h2(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function k(n,t,e){return new dL({type:"record",keyType:n,valueType:t,...O(e)})}const dd=A("ZodEnum",(n,t)=>{BR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(r,i,s)=>r2(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 o of r)if(e.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new dd({...t,checks:[],...O(i),entries:s})},n.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(e.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new dd({...t,checks:[],...O(i),entries:s})}});function D0(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new dd({type:"enum",entries:e,...O(t)})}const pL=A("ZodLiteral",(n,t)=>{WR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>i2(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 T(n,t){return new pL({type:"literal",values:Array.isArray(n)?n:[n],...O(t)})}const fL=A("ZodTransform",(n,t)=>{jR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>o2(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new t0(n.constructor.name);e.addIssue=s=>{if(typeof s=="string")e.issues.push(Wo(s,e.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=e.value),o.inst??(o.inst=n),e.issues.push(Wo(o))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(s=>(e.value=s,e)):(e.value=i,e)}});function gL(n){return new fL({type:"transform",transform:n})}const M0=A("ZodOptional",(n,t)=>{S0.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>T0(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function fv(n){return new M0({type:"optional",innerType:n})}const mL=A("ZodExactOptional",(n,t)=>{GR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>T0(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function vL(n){return new mL({type:"optional",innerType:n})}const yL=A("ZodNullable",(n,t)=>{qR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>d2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function gv(n){return new yL({type:"nullable",innerType:n})}const bL=A("ZodDefault",(n,t)=>{YR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>f2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function wL(n,t){return new bL({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():s0(t)}})}const SL=A("ZodPrefault",(n,t)=>{KR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>g2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function _L(n,t){return new SL({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():s0(t)}})}const O0=A("ZodNonOptional",(n,t)=>{JR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>p2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function kL(n,t){return new O0({type:"nonoptional",innerType:n,...O(t)})}const EL=A("ZodCatch",(n,t)=>{XR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>m2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function xL(n,t){return new EL({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const AL=A("ZodPipe",(n,t)=>{QR.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>v2(n,e,r,i),n.in=t.in,n.out=t.out});function mv(n,t){return new AL({type:"pipe",in:n,out:t})}const TL=A("ZodReadonly",(n,t)=>{eP.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>y2(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function $L(n){return new TL({type:"readonly",innerType:n})}const CL=A("ZodCustom",(n,t)=>{tP.init(n,t),be.init(n,t),n._zod.processJSONSchema=(e,r,i)=>s2(n,e)});function IL(n,t={}){return GP(CL,n,t)}function RL(n){return qP(n)}const PL=[".md",".markdown"];function z0(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function N0(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function LL(n){return N0(n).toLowerCase()}function DL(n,t){const e=LL(n);return t.some(r=>e.endsWith(r))}function U0(n){return!z0(n)&&DL(n,PL)}function ML(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function xn(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const OL=P0({id:p().min(1),kind:T("path"),title:p(),path:p()}).strict(),zL=P0({id:p().min(1),kind:T("url"),title:p(),url:p().refine(ML,{message:"url must be an http(s) URL"})}).strict();uL("kind",[OL,zL]);function F0(n){return typeof n=="object"&&n!==null}function H0(n){return!F0(n)||n.type!=="ready"?!1:!("id"in n)}function V0(n){return!(!F0(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const NL="/views/markdown/",UL="/views/url-unsupported/";function Z0(n){return`/artifact/${encodeURIComponent(n)}`}function FL(n,t){return`${Z0(n)}/${encodeURIComponent(t)}`}function HL(n){return`/markdown/${encodeURIComponent(n)}`}function Tc(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:xn(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:UL,contentURL:null};if(U0(n.path)){const r={viewURL:NL,contentURL:HL(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=z0(n.path)?`${Z0(n.id)}/`:FL(n.id,N0(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const VL="serverURL",ZL="token",BL="mode",WL="desktopAppVersion",jL="electron";function B0(n=window.location.search,t=window.location.origin){const r=new URLSearchParams(n).get(VL);return r?new URL(r).origin:new URL(t).origin}function GL(n=window.location.search){return new URLSearchParams(n).get(ZL)}function Wt(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(BL)===jL}function W0(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(WL)}const vv="tv.telemetry.clientId",qL=5,YL=60,KL=1e3,JL=qL*YL*KL,yv=["pointerdown","scroll","keydown"],bv=["focus"],wv=["visibilitychange"],XL="hidden";function QL(n,t=iD){const e=n.getItem(vv);if(e)return e;const r=t();return n.setItem(vv,r),r}function eD(n){return{clientId:QL(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function tD(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 nD(n){return new rD(n)}var ra,Rn,Qn,ia,sa,yt,Yr,oa,zc,j0;class rD{constructor(t){b(this,zc);b(this,ra);b(this,Rn);b(this,Qn);b(this,ia);b(this,sa);b(this,yt);b(this,Yr,!1);b(this,oa,Number.NEGATIVE_INFINITY);m(this,ra,t.meta),m(this,Rn,t.documentTarget),m(this,Qn,t.windowTarget),m(this,ia,t.send),m(this,sa,t.nowMs??Date.now),m(this,yt,()=>d(this,zc,j0).call(this))}start(){if(!l(this,Yr)){m(this,Yr,!0);for(const t of yv)l(this,Qn).addEventListener(t,l(this,yt)),l(this,Rn).addEventListener(t,l(this,yt));for(const t of bv)l(this,Qn).addEventListener(t,l(this,yt));for(const t of wv)l(this,Rn).addEventListener(t,l(this,yt))}}stop(){if(l(this,Yr)){m(this,Yr,!1);for(const t of yv)l(this,Qn).removeEventListener(t,l(this,yt)),l(this,Rn).removeEventListener(t,l(this,yt));for(const t of bv)l(this,Qn).removeEventListener(t,l(this,yt));for(const t of wv)l(this,Rn).removeEventListener(t,l(this,yt))}}}ra=new WeakMap,Rn=new WeakMap,Qn=new WeakMap,ia=new WeakMap,sa=new WeakMap,yt=new WeakMap,Yr=new WeakMap,oa=new WeakMap,zc=new WeakSet,j0=function(){if(l(this,Rn).visibilityState===XL)return;const t=l(this,sa).call(this);t-l(this,oa)<JL||(m(this,oa,t),l(this,ia).call(this,{type:uC,clientId:l(this,ra).clientId}))};function iD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():fu().toLowerCase()}const fe={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"},En={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"},sD=1,oD=w({_meta:k(p(),_()).nullish(),terminal:Ne().optional().default(!1)}),aD=w({_meta:k(p(),_()).nullish(),label:p().nullish(),name:p(),optional:Ne().optional().default(!1),secret:Ne().optional().default(!0)}),lD=w({_meta:k(p(),_()).nullish(),description:p().nullish(),id:p(),name:p()}),cD=w({_meta:k(p(),_()).nullish(),description:p().nullish(),id:p(),link:p().nullish(),name:p(),vars:M(aD)}),uD=w({_meta:k(p(),_()).nullish(),args:M(p()).optional(),description:p().nullish(),env:k(p(),p()).optional(),id:p(),name:p()}),hD=j([cD.and(w({type:T("env_var")})),uD.and(w({type:T("terminal")})),lD]),dD=w({_meta:k(p(),_()).nullish(),methodId:p()}),pD=w({_meta:k(p(),_()).nullish()}),fD=w({_meta:k(p(),_()).nullish(),blob:p(),mimeType:p().nullish(),uri:p()}),gD=w({default:Ne().nullish(),description:p().nullish(),title:p().nullish()}),mD=w({_meta:k(p(),_()).nullish()}),vD=w({_meta:k(p(),_()).nullish()}),yD=w({amount:B(),currency:p()}),bD=w({_meta:k(p(),_()).nullish(),terminalId:p()}),wD=w({_meta:k(p(),_()).nullish(),newText:p(),oldText:p().nullish(),path:p()}),SD=j([p(),B(),B(),Ne(),M(p())]),_D=w({content:k(p(),SD).nullish()}),kD=j([_D.and(w({action:T("accept")})),w({action:T("decline")}),w({action:T("cancel")})]),ED=w({_meta:k(p(),_()).nullish()}),G0=p(),xD=w({_meta:k(p(),_()).nullish(),elicitationId:G0}),AD=w({_meta:k(p(),_()).nullish(),action:kD}),TD=T("object"),$D=T("string"),CD=w({_meta:k(p(),_()).nullish()}),ID=w({_meta:k(p(),_()).nullish(),form:ED.nullish(),url:CD.nullish()}),RD=w({elicitationId:G0,url:p().url()}),q0=w({const:p(),title:p()}),Y0=w({_meta:k(p(),_()).nullish(),name:p(),value:p()}),PD=j([T(-32700),T(-32600),T(-32601),T(-32602),T(-32603),T(-32800),T(-32e3),T(-32002),T(-32042),B().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),K0=w({code:PD,data:_().optional(),message:p()}),J0=_(),X0=_(),Q0=_(),LD=w({_meta:k(p(),_()).nullish(),readTextFile:Ne().optional().default(!1),writeTextFile:Ne().optional().default(!1)}),ew=w({_meta:k(p(),_()).nullish(),name:p(),value:p()}),tw=w({_meta:k(p(),_()).nullish(),name:p(),title:p().nullish(),version:p()}),DD=w({default:B().nullish(),description:p().nullish(),maximum:B().nullish(),minimum:B().nullish(),title:p().nullish()}),MD=w({_meta:k(p(),_()).nullish()}),OD=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cursor:p().nullish(),cwd:p().nullish()}),zD=w({_meta:k(p(),_()).nullish()}),ND=w({_meta:k(p(),_()).nullish(),logout:zD.nullish()}),UD=w({_meta:k(p(),_()).nullish()}),FD=w({_meta:k(p(),_()).nullish()}),HD=w({_meta:k(p(),_()).nullish(),http:Ne().optional().default(!1),sse:Ne().optional().default(!1)}),VD=w({_meta:k(p(),_()).nullish(),headers:M(ew),name:p(),url:p()}),ZD=w({_meta:k(p(),_()).nullish(),headers:M(ew),name:p(),url:p()}),BD=w({_meta:k(p(),_()).nullish(),args:M(p()),command:p(),env:M(Y0),name:p()}),wu=j([VD.and(w({type:T("http")})),ZD.and(w({type:T("sse")})),BD]),mf=p(),WD=w({_meta:k(p(),_()).nullish(),description:p().nullish(),modelId:mf,name:p()}),jD=j([T("error"),T("warning"),T("information"),T("hint")]),GD=w({_meta:k(p(),_()).nullish()}),qD=w({_meta:k(p(),_()).nullish()}),YD=w({_meta:k(p(),_()).nullish()}),KD=w({_meta:k(p(),_()).nullish()}),JD=w({_meta:k(p(),_()).nullish()}),XD=w({_meta:k(p(),_()).nullish(),maxCount:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),QD=w({diff:p(),uri:p()}),e6=w({endLine:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:p()}),t6=w({_meta:k(p(),_()).nullish()}),n6=w({_meta:k(p(),_()).nullish()}),r6=w({languageId:p(),text:p(),uri:p()}),i6=w({_meta:k(p(),_()).nullish(),maxCount:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),s6=j([T("rejected"),T("ignored"),T("replaced"),T("cancelled")]),o6=w({excerpts:M(e6),uri:p()}),a6=w({_meta:k(p(),_()).nullish()}),l6=w({_meta:k(p(),_()).nullish()}),c6=w({name:p(),owner:p(),remoteUrl:p()}),u6=w({_meta:k(p(),_()).nullish()}),h6=w({_meta:k(p(),_()).nullish(),jump:t6.nullish(),rename:l6.nullish(),searchAndReplace:u6.nullish()}),d6=w({id:p(),isRegex:Ne().nullish(),replace:p(),search:p(),uri:p()}),p6=j([T("automatic"),T("diagnostic"),T("manual")]),f6=w({_meta:k(p(),_()).nullish(),maxCount:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),g6=w({_meta:k(p(),_()).nullish(),diagnostics:GD.nullish(),editHistory:XD.nullish(),openFiles:n6.nullish(),recentFiles:i6.nullish(),relatedSnippets:a6.nullish(),userActions:f6.nullish()}),m6=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cwd:p(),mcpServers:M(wu)}),v6=w({default:B().nullish(),description:p().nullish(),maximum:B().nullish(),minimum:B().nullish(),title:p().nullish()}),nw=p(),y6=j([T("allow_once"),T("allow_always"),T("reject_once"),T("reject_always")]),b6=w({_meta:k(p(),_()).nullish(),kind:y6,name:p(),optionId:nw}),w6=j([T("high"),T("medium"),T("low")]),S6=j([T("pending"),T("in_progress"),T("completed")]),_6=w({_meta:k(p(),_()).nullish(),content:p(),priority:w6,status:S6}),k6=w({_meta:k(p(),_()).nullish(),entries:M(_6)}),gr=w({character:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),E6=w({id:p(),position:gr,uri:p()}),x6=w({id:p(),newName:p(),position:gr,uri:p()}),A6=w({action:p(),position:gr,timestampMs:B(),uri:p()}),rw=j([T("utf-16"),T("utf-32"),T("utf-8")]),T6=w({_meta:k(p(),_()).nullish(),auth:oD.optional().default({terminal:!1}),elicitation:ID.nullish(),fs:LD.optional().default({readTextFile:!1,writeTextFile:!1}),nes:h6.nullish(),positionEncodings:M(rw).optional(),terminal:Ne().optional().default(!1)}),$6=w({_meta:k(p(),_()).nullish(),audio:Ne().optional().default(!1),embeddedContext:Ne().optional().default(!1),image:Ne().optional().default(!1)}),iw=B().int().gte(0).lte(65535),C6=w({_meta:k(p(),_()).nullish(),clientCapabilities:T6.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:tw.nullish(),protocolVersion:iw}),to=w({end:gr,start:gr}),I6=w({message:p(),range:to,severity:jD,uri:p()}),R6=w({languageId:p(),lastFocusedMs:B().nullish(),uri:p(),visibleRange:to.nullish()}),P6=w({_meta:k(p(),_()).nullish(),diagnostics:M(I6).nullish(),editHistory:M(QD).nullish(),openFiles:M(R6).nullish(),recentFiles:M(r6).nullish(),relatedSnippets:M(o6).nullish(),userActions:M(A6).nullish()}),L6=w({newText:p(),range:to}),D6=w({cursorPosition:gr.nullish(),edits:M(L6),id:p(),uri:p()}),M6=j([D6.and(w({kind:T("edit")})),E6.and(w({kind:T("jump")})),x6.and(w({kind:T("rename")})),d6.and(w({kind:T("searchAndReplace")}))]),O6=w({_meta:k(p(),_()).nullish(),content:p()}),z6=w({_meta:k(p(),_()).nullish()}),bi=j([B(),p()]).nullable();w({_meta:k(p(),_()).nullish(),requestId:bi});const N6=D0(["assistant","user"]),ml=w({_meta:k(p(),_()).nullish(),audience:M(N6).nullish(),lastModified:p().nullish(),priority:B().nullish()}),U6=w({_meta:k(p(),_()).nullish(),annotations:ml.nullish(),data:p(),mimeType:p()}),F6=w({_meta:k(p(),_()).nullish(),annotations:ml.nullish(),data:p(),mimeType:p(),uri:p().nullish()}),H6=w({_meta:k(p(),_()).nullish(),annotations:ml.nullish(),description:p().nullish(),mimeType:p().nullish(),name:p(),size:B().nullish(),title:p().nullish(),uri:p()}),V6=w({_meta:k(p(),_()).nullish(),optionId:nw}),Z6=j([w({outcome:T("cancelled")}),V6.and(w({outcome:T("selected")}))]),B6=w({_meta:k(p(),_()).nullish(),outcome:Z6}),W6=w({_meta:k(p(),_()).nullish()}),j6=w({_meta:k(p(),_()).nullish()}),G6=w({currentValue:Ne()}),q6=p(),sw=p(),Y6=j([T("mode"),T("model"),T("thought_level"),p()]),vf=p(),ow=w({_meta:k(p(),_()).nullish(),description:p().nullish(),name:p(),value:vf}),K6=w({_meta:k(p(),_()).nullish(),group:q6,name:p(),options:M(ow)}),J6=j([M(ow),M(K6)]),X6=w({currentValue:vf,options:J6}),no=bu(j([X6.and(w({type:T("select")})),G6.and(w({type:T("boolean")}))]),w({_meta:k(p(),_()).nullish(),category:Y6.nullish(),description:p().nullish(),id:sw,name:p()})),Q6=w({_meta:k(p(),_()).nullish(),configOptions:M(no)}),eM=w({_meta:k(p(),_()).nullish()}),te=p(),tM=w({_meta:k(p(),_()).nullish(),id:p(),sessionId:te}),nM=w({_meta:k(p(),_()).nullish(),sessionId:te}),rM=w({_meta:k(p(),_()).nullish(),sessionId:te}),iM=w({_meta:k(p(),_()).nullish(),sessionId:te}),aw=w({_meta:k(p(),_()).nullish(),args:M(p()).optional(),command:p(),cwd:p().nullish(),env:M(Y0).optional(),outputByteLimit:B().nullish(),sessionId:te}),sM=w({_meta:k(p(),_()).nullish(),sessionId:te,uri:p()}),oM=w({_meta:k(p(),_()).nullish(),position:gr,sessionId:te,uri:p(),version:B(),visibleRange:to}),aM=w({_meta:k(p(),_()).nullish(),languageId:p(),sessionId:te,text:p(),uri:p(),version:B()}),lM=w({_meta:k(p(),_()).nullish(),sessionId:te,uri:p()}),cM=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cwd:p(),mcpServers:M(wu).optional(),sessionId:te}),lw=w({_meta:k(p(),_()).nullish(),sessionId:te,terminalId:p()}),uM=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cwd:p(),mcpServers:M(wu),sessionId:te}),cw=w({_meta:k(p(),_()).nullish(),limit:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p(),sessionId:te}),hM=w({_meta:k(p(),_()).nullish(),id:p(),reason:s6.nullish(),sessionId:te}),uw=w({_meta:k(p(),_()).nullish(),sessionId:te,terminalId:p()}),dM=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cwd:p(),mcpServers:M(wu).optional(),sessionId:te}),pM=w({_meta:k(p(),_()).nullish(),additionalDirectories:M(p()).optional(),cwd:p(),sessionId:te,title:p().nullish(),updatedAt:p().nullish()}),fM=w({_meta:k(p(),_()).nullish(),nextCursor:p().nullish(),sessions:M(pM)}),gM=w({_meta:k(p(),_()).nullish(),title:p().nullish(),updatedAt:p().nullish()}),mM=w({_meta:k(p(),_()).nullish()}),Su=p(),vM=w({_meta:k(p(),_()).nullish(),currentModeId:Su}),yM=w({_meta:k(p(),_()).nullish(),description:p().nullish(),id:Su,name:p()}),_u=w({_meta:k(p(),_()).nullish(),availableModes:M(yM),currentModeId:Su}),ku=w({_meta:k(p(),_()).nullish(),availableModels:M(WD),currentModelId:mf}),bM=w({_meta:k(p(),_()).nullish(),configOptions:M(no).nullish(),models:ku.nullish(),modes:_u.nullish(),sessionId:te}),wM=w({_meta:k(p(),_()).nullish(),configOptions:M(no).nullish(),models:ku.nullish(),modes:_u.nullish()}),SM=w({_meta:k(p(),_()).nullish(),configOptions:M(no).nullish(),models:ku.nullish(),modes:_u.nullish(),sessionId:te}),_M=w({_meta:k(p(),_()).nullish(),configOptions:M(no).nullish(),models:ku.nullish(),modes:_u.nullish()}),kM=w({_meta:k(p(),_()).nullish()}),EM=w({_meta:k(p(),_()).nullish(),additionalDirectories:W6.nullish(),close:j6.nullish(),fork:eM.nullish(),list:mM.nullish(),resume:kM.nullish()}),xM=bu(j([w({type:T("boolean"),value:Ne()}),w({value:vf})]),w({_meta:k(p(),_()).nullish(),configId:sw,sessionId:te})),AM=w({_meta:k(p(),_()).nullish(),configOptions:M(no)}),TM=w({_meta:k(p(),_()).nullish(),modeId:Su,sessionId:te}),$M=w({_meta:k(p(),_()).nullish()}),CM=w({_meta:k(p(),_()).nullish(),modelId:mf,sessionId:te}),IM=w({_meta:k(p(),_()).nullish()}),RM=w({_meta:k(p(),_()).nullish(),sessionId:te}),PM=j([T("end_turn"),T("max_tokens"),T("max_turn_requests"),T("refusal"),T("cancelled")]),LM=j([T("email"),T("uri"),T("date"),T("date-time")]),DM=w({default:p().nullish(),description:p().nullish(),enum:M(p()).nullish(),format:LM.nullish(),maxLength:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:M(q0).nullish(),pattern:p().nullish(),title:p().nullish()}),MM=w({_meta:k(p(),_()).nullish(),context:P6.nullish(),position:gr,selection:to.nullish(),sessionId:te,triggerKind:p6,uri:p(),version:B()}),OM=w({_meta:k(p(),_()).nullish(),suggestions:M(M6)}),zM=w({_meta:k(p(),_()).nullish(),terminalId:p()}),NM=w({_meta:k(p(),_()).nullish(),exitCode:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),hw=w({_meta:k(p(),_()).nullish(),sessionId:te,terminalId:p()}),UM=w({_meta:k(p(),_()).nullish(),exitStatus:NM.nullish(),output:p(),truncated:Ne()}),FM=w({_meta:k(p(),_()).nullish(),annotations:ml.nullish(),text:p()}),HM=w({range:to.nullish(),text:p()}),VM=w({_meta:k(p(),_()).nullish(),contentChanges:M(HM),sessionId:te,uri:p(),version:B()});w({method:p(),params:j([nM,aM,VM,sM,lM,oM,tM,hM,J0]).nullish()});const ZM=j([T("full"),T("incremental")]),BM=w({_meta:k(p(),_()).nullish(),syncKind:ZM}),WM=w({_meta:k(p(),_()).nullish(),didChange:BM.nullish(),didClose:qD.nullish(),didFocus:YD.nullish(),didOpen:KD.nullish(),didSave:JD.nullish()}),jM=w({_meta:k(p(),_()).nullish(),document:WM.nullish()}),GM=w({_meta:k(p(),_()).nullish(),context:g6.nullish(),events:jM.nullish()}),qM=w({_meta:k(p(),_()).nullish(),auth:ND.optional().default({}),loadSession:Ne().optional().default(!1),mcpCapabilities:HD.optional().default({http:!1,sse:!1}),nes:GM.nullish(),positionEncoding:rw.nullish(),promptCapabilities:$6.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:EM.optional().default({})}),YM=w({_meta:k(p(),_()).nullish(),agentCapabilities:qM.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:tw.nullish(),authMethods:M(hD).optional().default([]),protocolVersion:iw}),KM=w({_meta:k(p(),_()).nullish(),mimeType:p().nullish(),text:p(),uri:p()}),JM=j([KM,fD]),XM=w({_meta:k(p(),_()).nullish(),annotations:ml.nullish(),resource:JM}),yf=j([FM.and(w({type:T("text")})),F6.and(w({type:T("image")})),U6.and(w({type:T("audio")})),H6.and(w({type:T("resource_link")})),XM.and(w({type:T("resource")}))]),QM=w({_meta:k(p(),_()).nullish(),content:yf}),Ah=w({_meta:k(p(),_()).nullish(),content:yf,messageId:p().nullish()}),eO=w({_meta:k(p(),_()).nullish(),messageId:p().nullish(),prompt:M(yf),sessionId:te}),tO=w({anyOf:M(q0)}),dw=j([QM.and(w({type:T("content")})),wD.and(w({type:T("diff")})),zM.and(w({type:T("terminal")}))]),pw=p(),fw=w({_meta:k(p(),_()).nullish(),line:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:p()}),gw=j([T("pending"),T("in_progress"),T("completed"),T("failed")]),mw=j([T("read"),T("edit"),T("delete"),T("move"),T("search"),T("execute"),T("think"),T("fetch"),T("switch_mode"),T("other")]),nO=w({_meta:k(p(),_()).nullish(),content:M(dw).optional(),kind:mw.optional(),locations:M(fw).optional(),rawInput:_().optional(),rawOutput:_().optional(),status:gw.optional(),title:p(),toolCallId:pw}),vw=w({_meta:k(p(),_()).nullish(),content:M(dw).nullish(),kind:mw.nullish(),locations:M(fw).nullish(),rawInput:_().optional(),rawOutput:_().optional(),status:gw.nullish(),title:p().nullish(),toolCallId:pw}),yw=w({_meta:k(p(),_()).nullish(),options:M(b6),sessionId:te,toolCall:vw}),rO=w({_meta:k(p(),_()).nullish(),hint:p()}),iO=rO,sO=w({_meta:k(p(),_()).nullish(),description:p(),input:iO.nullish(),name:p()}),oO=w({_meta:k(p(),_()).nullish(),availableCommands:M(sO)}),aO=w({enum:M(p()),type:$D}),lO=j([aO,tO]),cO=w({default:M(p()).nullish(),description:p().nullish(),items:lO,maxItems:B().nullish(),minItems:B().nullish(),title:p().nullish()}),uO=j([DM.and(w({type:T("string")})),v6.and(w({type:T("number")})),DD.and(w({type:T("integer")})),gD.and(w({type:T("boolean")})),cO.and(w({type:T("array")}))]),hO=w({description:p().nullish(),properties:k(p(),uO).optional().default({}),required:M(p()).nullish(),title:p().nullish(),type:TD.optional().default("object")}),dO=w({requestedSchema:hO}),pO=bu(j([dO.and(w({mode:T("form")})),RD.and(w({mode:T("url")}))]),w({_meta:k(p(),_()).nullish(),message:p(),sessionId:te})),fO=w({cachedReadTokens:B().nullish(),cachedWriteTokens:B().nullish(),inputTokens:B(),outputTokens:B(),thoughtTokens:B().nullish(),totalTokens:B()}),gO=w({_meta:k(p(),_()).nullish(),stopReason:PM,usage:fO.nullish(),userMessageId:p().nullish()});j([w({id:bi,result:j([YM,pD,FD,SM,wM,fM,bM,_M,vD,$M,AM,gO,IM,RM,OM,mD,Q0])}),w({error:K0,id:bi})]);const mO=w({_meta:k(p(),_()).nullish(),cost:yD.nullish(),size:B(),used:B()}),vO=j([Ah.and(w({sessionUpdate:T("user_message_chunk")})),Ah.and(w({sessionUpdate:T("agent_message_chunk")})),Ah.and(w({sessionUpdate:T("agent_thought_chunk")})),nO.and(w({sessionUpdate:T("tool_call")})),vw.and(w({sessionUpdate:T("tool_call_update")})),k6.and(w({sessionUpdate:T("plan")})),oO.and(w({sessionUpdate:T("available_commands_update")})),vM.and(w({sessionUpdate:T("current_mode_update")})),Q6.and(w({sessionUpdate:T("config_option_update")})),gM.and(w({sessionUpdate:T("session_info_update")})),mO.and(w({sessionUpdate:T("usage_update")}))]),bw=w({_meta:k(p(),_()).nullish(),sessionId:te,update:vO});w({method:p(),params:j([bw,xD,J0]).nullish()});const ww=w({_meta:k(p(),_()).nullish(),sessionId:te,terminalId:p()}),yO=w({_meta:k(p(),_()).nullish(),exitCode:B().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:p().nullish()}),bO=w({name:p(),uri:p()}),wO=w({_meta:k(p(),_()).nullish(),repository:c6.nullish(),workspaceFolders:M(bO).nullish(),workspaceUri:p().nullish()});w({id:bi,method:p(),params:j([C6,dD,UD,m6,uM,OD,cM,dM,iM,TM,xM,eO,CM,wO,MM,rM,X0]).nullish()});const Sw=w({_meta:k(p(),_()).nullish(),content:p(),path:p(),sessionId:te});w({id:bi,method:p(),params:j([Sw,cw,yw,aw,hw,uw,ww,lw,pO,X0]).nullish()});const SO=w({_meta:k(p(),_()).nullish()});j([w({id:bi,result:j([SO,O6,B6,bD,UM,z6,yO,MD,AD,Q0])}),w({error:K0,id:bi})]);var Q;class _O{constructor(t,e){b(this,Q);const r=t(this),i=async(o,a)=>{var c,u,h,f,v,y,E;switch(o){case En.fs_write_text_file:{const x=Sw.parse(a);return(c=r.writeTextFile)==null?void 0:c.call(r,x)}case En.fs_read_text_file:{const x=cw.parse(a);return(u=r.readTextFile)==null?void 0:u.call(r,x)}case En.session_request_permission:{const x=yw.parse(a);return r.requestPermission(x)}case En.terminal_create:{const x=aw.parse(a);return(h=r.createTerminal)==null?void 0:h.call(r,x)}case En.terminal_output:{const x=hw.parse(a);return(f=r.terminalOutput)==null?void 0:f.call(r,x)}case En.terminal_release:{const x=uw.parse(a);return await((v=r.releaseTerminal)==null?void 0:v.call(r,x))??{}}case En.terminal_wait_for_exit:{const x=ww.parse(a);return(y=r.waitForTerminalExit)==null?void 0:y.call(r,x)}case En.terminal_kill:{const x=lw.parse(a);return await((E=r.killTerminal)==null?void 0:E.call(r,x))??{}}default:if(r.extMethod)return r.extMethod(o,a);throw Le.methodNotFound(o)}},s=async(o,a)=>{switch(o){case En.session_update:{const c=bw.parse(a);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(o,a);throw Le.methodNotFound(o)}};m(this,Q,new kO(i,s,e))}async initialize(t){return await l(this,Q).sendRequest(fe.initialize,t)}async newSession(t){return await l(this,Q).sendRequest(fe.session_new,t)}async loadSession(t){return await l(this,Q).sendRequest(fe.session_load,t)??{}}async unstable_forkSession(t){return await l(this,Q).sendRequest(fe.session_fork,t)}async listSessions(t){return await l(this,Q).sendRequest(fe.session_list,t)}async unstable_resumeSession(t){return await l(this,Q).sendRequest(fe.session_resume,t)}async unstable_closeSession(t){return await l(this,Q).sendRequest(fe.session_close,t)}async setSessionMode(t){return await l(this,Q).sendRequest(fe.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await l(this,Q).sendRequest(fe.session_set_model,t)??{}}async setSessionConfigOption(t){return await l(this,Q).sendRequest(fe.session_set_config_option,t)}async authenticate(t){return await l(this,Q).sendRequest(fe.authenticate,t)??{}}async unstable_logout(t){return await l(this,Q).sendRequest(fe.logout,t)??{}}async prompt(t){return await l(this,Q).sendRequest(fe.session_prompt,t)}async cancel(t){return await l(this,Q).sendNotification(fe.session_cancel,t)}async unstable_startNes(t){return await l(this,Q).sendRequest(fe.nes_start,t)}async unstable_suggestNes(t){return await l(this,Q).sendRequest(fe.nes_suggest,t)}async unstable_closeNes(t){return await l(this,Q).sendRequest(fe.nes_close,t)??{}}async unstable_didOpenDocument(t){return await l(this,Q).sendNotification(fe.document_did_open,t)}async unstable_didChangeDocument(t){return await l(this,Q).sendNotification(fe.document_did_change,t)}async unstable_didCloseDocument(t){return await l(this,Q).sendNotification(fe.document_did_close,t)}async unstable_didSaveDocument(t){return await l(this,Q).sendNotification(fe.document_did_save,t)}async unstable_didFocusDocument(t){return await l(this,Q).sendNotification(fe.document_did_focus,t)}async unstable_acceptNes(t){return await l(this,Q).sendNotification(fe.nes_accept,t)}async unstable_rejectNes(t){return await l(this,Q).sendNotification(fe.nes_reject,t)}async extMethod(t,e){return await l(this,Q).sendRequest(t,e)}async extNotification(t,e){return await l(this,Q).sendNotification(t,e)}get signal(){return l(this,Q).signal}get closed(){return l(this,Q).closed}}Q=new WeakMap;var er,Nc,aa,la,cs,us,nn,ca,ve,_w,pd,kw,Ew,xw,Aw,fd,Eo;class kO{constructor(t,e,r){b(this,ve);b(this,er,new Map);b(this,Nc,0);b(this,aa);b(this,la);b(this,cs);b(this,us,Promise.resolve());b(this,nn,new AbortController);b(this,ca);m(this,aa,t),m(this,la,e),m(this,cs,r),m(this,ca,new Promise(i=>{l(this,nn).signal.addEventListener("abort",()=>i())})),d(this,ve,_w).call(this)}get signal(){return l(this,nn).signal}get closed(){return l(this,ca)}async sendRequest(t,e){d(this,ve,fd).call(this);const r=Bu(this,Nc)._++,i=new Promise((s,o)=>{l(this,er).set(r,{resolve:s,reject:o})});return await d(this,ve,Eo).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){d(this,ve,fd).call(this),await d(this,ve,Eo).call(this,{jsonrpc:"2.0",method:t,params:e})}}er=new WeakMap,Nc=new WeakMap,aa=new WeakMap,la=new WeakMap,cs=new WeakMap,us=new WeakMap,nn=new WeakMap,ca=new WeakMap,ve=new WeakSet,_w=async function(){let t;try{const e=l(this,cs).readable.getReader();try{for(;!l(this,nn).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{d(this,ve,kw).call(this,r)}catch(s){console.error("Unexpected error during message processing:",r,s),"id"in r&&r.id!==void 0&&d(this,ve,Eo).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{d(this,ve,pd).call(this,t)}},pd=function(t){if(l(this,nn).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of l(this,er).values())r.reject(e);l(this,er).clear(),l(this,nn).abort(e)},kw=async function(t){if("method"in t&&"id"in t){const e=await d(this,ve,Ew).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await d(this,ve,Eo).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await d(this,ve,xw).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?d(this,ve,Aw).call(this,t):console.error("Invalid message",{message:t})},Ew=async function(t,e){try{return{result:await l(this,aa).call(this,t,e)??null}}catch(r){if(r instanceof Le)return r.toResult();if(r instanceof hv)return Le.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 Le.internalError(i?JSON.parse(i):{}).toResult()}catch{return Le.internalError({details:i}).toResult()}}},xw=async function(t,e){try{return await l(this,la).call(this,t,e),{result:null}}catch(r){if(r instanceof Le)return r.toResult();if(r instanceof hv)return Le.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 Le.internalError(i?JSON.parse(i):{}).toResult()}catch{return Le.internalError({details:i}).toResult()}}},Aw=function(t){const e=l(this,er).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 Le(r,i,s))}l(this,er).delete(t.id)}else console.error("Got response to unknown request",t.id)},fd=function(){if(l(this,nn).signal.aborted)throw l(this,nn).signal.reason??new Error("ACP connection closed")},Eo=async function(t){return m(this,us,l(this,us).then(async()=>{const e=l(this,cs).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{d(this,ve,pd).call(this,e)})),l(this,us)};class Le extends Error{constructor(e,r,i){super(r);g(this,"code");g(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new Le(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new Le(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new Le(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new Le(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new Le(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new Le(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new Le(-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}}}const EO=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,xO=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,AO=/\[Television screen context\][\s\S]*?\[\/Television screen context\]\n*/,TO=/\b(tv|television|screen|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,$O=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,CO="single_session",IO={name:"television-acp-client",version:"0.0.0"},Tw="agent:main:television",RO=gl(It);var hs,rn,pt,sn,tr,Mt,Pn,on,an,nr,Ot,ds,ps,ln,et,Ln,fs,Kr,Dn,rr,ua,zt,cn,Uc,un,$,gd,$w,Cw,Iw,rc,Rw,Pw,Lw,Dw,Mw,Ow,zw,Rr,ji,Gi,An,Nw,qi,md,vd,ic,Uw,sc,yd,bd,ha,da,oc,Yi,wd,Fw;class PO extends RO{constructor(e){super();b(this,$);b(this,hs,"disconnected");b(this,rn,null);b(this,pt,new Map);b(this,sn,null);b(this,tr,null);b(this,Mt,null);b(this,Pn,null);b(this,on,null);b(this,an,null);b(this,nr);b(this,Ot,null);b(this,ds,0);b(this,ps,1);b(this,ln,null);b(this,et,null);b(this,Ln,!1);b(this,fs,!1);b(this,Kr,!1);b(this,Dn,null);b(this,rr,new Set);b(this,ua);b(this,zt);b(this,cn);b(this,Uc,e=>{d(this,$,Cw).call(this,e)});b(this,un,null);b(this,ha,()=>{d(this,$,Yi).call(this,"ACP bridge websocket closed")});b(this,da,()=>{d(this,$,Yi).call(this,"ACP bridge websocket error")});m(this,zt,e),m(this,cn,e.sessionMode??CO),m(this,nr,e.mappedSessionStore??LO()),m(this,ua,e.createSocket??(r=>new WebSocket(r)))}get status(){return l(this,hs)}get messages(){return[...l(this,pt).values()]}get enabled(){return l(this,zt).enabled??!1}setToken(e){l(this,zt).token=e??""}setEnabled(e){l(this,zt).enabled=e,e||(d(this,$,oc).call(this),m(this,rn,null),d(this,$,An).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){l(this,tr)===null&&(m(this,rn,null),m(this,tr,d(this,$,$w).call(this)));try{await l(this,tr),await d(this,$,rc).call(this)}catch(e){throw d(this,$,Yi).call(this,Th(e)),e}}}dispose(){d(this,$,oc).call(this),m(this,rn,null),d(this,$,An).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await d(this,$,gd).call(this,"ready")),(l(this,on)===null||l(this,Ot)!==d(this,$,sc).call(this))&&await d(this,$,rc).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");d(this,$,ji).call(this,{id:d(this,$,qi).call(this,"user"),kind:"user",text:r,status:"final"}),d(this,$,An).call(this,"running");try{const i=await d(this,$,ic).call(this).prompt({sessionId:d(this,$,vd).call(this),prompt:[{type:"text",text:d(this,$,Nw).call(this,r)}]});d(this,$,Rr).call(this,i.stopReason==="cancelled"?"cancelled":"final"),d(this,$,An).call(this,"ready")}catch(i){throw d(this,$,Fw).call(this)||(d(this,$,Rr).call(this,"error"),d(this,$,An).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await d(this,$,gd).call(this,"ready"));const e=d(this,$,sc).call(this);((r=l(this,an))==null?void 0:r.sessionIdStrategy)==="mapped"?l(this,nr).clearActualSessionId(e):m(this,ds,l(this,ds)+1),m(this,Mt,null),m(this,Pn,null),m(this,on,null),m(this,Ot,null),d(this,$,wd).call(this)}async cancel(){this.status==="running"&&(d(this,$,An).call(this,"cancelling"),await d(this,$,ic).call(this).cancel({sessionId:d(this,$,vd).call(this)}))}setScreenContext(e){var s,o,a;if(e===null){if(l(this,et)===null)return;m(this,et,null),m(this,Ln,!1);return}const r={screenID:e.screenID,screenName:e.screenName};if(((s=l(this,et))==null?void 0:s.screenID)===r.screenID&&((o=l(this,et))==null?void 0:o.screenName)===r.screenName)return;const i=((a=l(this,et))==null?void 0:a.screenID)??null;if(m(this,et,r),l(this,cn)==="single_session"){(!l(this,Ot)||i!==r.screenID)&&m(this,Ln,!0);return}l(this,Ot)!==d(this,$,yd).call(this,r.screenID)&&(m(this,Mt,null),m(this,Pn,null),l(this,sn)&&this.status==="ready"&&d(this,$,rc).call(this).catch(c=>{d(this,$,Yi).call(this,Th(c))}))}}hs=new WeakMap,rn=new WeakMap,pt=new WeakMap,sn=new WeakMap,tr=new WeakMap,Mt=new WeakMap,Pn=new WeakMap,on=new WeakMap,an=new WeakMap,nr=new WeakMap,Ot=new WeakMap,ds=new WeakMap,ps=new WeakMap,ln=new WeakMap,et=new WeakMap,Ln=new WeakMap,fs=new WeakMap,Kr=new WeakMap,Dn=new WeakMap,rr=new WeakMap,ua=new WeakMap,zt=new WeakMap,cn=new WeakMap,Uc=new WeakMap,un=new WeakMap,$=new WeakSet,gd=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(l(this,rn)??"ACPClient is disconnected");await new Promise((r,i)=>{const s=()=>{this.removeEventListener("status-changed",o)},o=()=>{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(l(this,rn)??"ACPClient is disconnected")))};this.addEventListener("status-changed",o)})}},$w=async function(){try{const{stream:e,socket:r,metadata:i}=await zO({serverURL:l(this,zt).serverURL,token:l(this,zt).token,createSocket:l(this,ua),onDisconnect:l(this,Uc)});m(this,an,i),m(this,un,r),r.addEventListener("close",l(this,ha)),r.addEventListener("error",l(this,da)),m(this,sn,new _O(s=>({connection:s,sessionUpdate:async o=>{await d(this,$,Pw).call(this,o)},requestPermission:async o=>d(this,$,Lw).call(this,o)}),e)),await l(this,sn).initialize({protocolVersion:sD,clientCapabilities:{},clientInfo:IO})}catch(e){throw e}},Cw=function(e){d(this,$,Yi).call(this,Th(e))},Iw=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})`)},rc=async function(){const e=d(this,$,sc).call(this);if(l(this,Mt)&&l(this,Pn)===e){await l(this,Mt);return}m(this,Pn,e),m(this,Mt,d(this,$,Rw).call(this,e)),await l(this,Mt)},Rw=async function(e){var c;const r=d(this,$,ic).call(this);d(this,$,wd).call(this);let i,s=!1,o=null;const a={cwd:d(this,$,Uw).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(m(this,Kr,!0),m(this,Dn,null),((c=l(this,an))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=l(this,nr).getActualSessionId(e);if(u)try{const h=await r.loadSession({...a,sessionId:u});if(DO(h))throw new Error("Mapped ACP session was not found");o=h,i=u,s=!0}catch{const h=await r.newSession(a);o=h,i=h.sessionId,l(this,nr).setActualSessionId(e,i),s=!1}else{const h=await r.newSession(a);o=h,i=h.sessionId,l(this,nr).setActualSessionId(e,i),s=!1}}else try{o=await r.loadSession({...a,sessionId:e}),i=e,s=l(this,pt).size>0}catch{const u=await r.newSession(a);o=u,i=u.sessionId,s=!1}}finally{m(this,Kr,!1),m(this,Dn,null),d(this,$,Rr).call(this,"final")}d(this,$,Iw).call(this,o),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),m(this,on,i),m(this,Ot,e),m(this,fs,!0),s?(l(this,rr).add(e),l(this,cn)==="single_session"&&m(this,Ln,!1)):(l(this,rr).delete(e),m(this,Ln,l(this,cn)==="single_session")),m(this,rn,null),d(this,$,An).call(this,"ready")},Pw=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&d(this,$,zw).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&d(this,$,Dw).call(this,r.content.text);return;case"tool_call":d(this,$,Mw).call(this,r);return;case"tool_call_update":d(this,$,Ow).call(this,r);return;case"agent_thought_chunk":return;default:return}},Lw=async function(e){return{outcome:{outcome:"cancelled"}}},Dw=function(e){m(this,Dn,null);const r=OO(e);if(!r)return;if(!l(this,ln)){const s={id:d(this,$,qi).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};m(this,ln,s.id),d(this,$,ji).call(this,s);return}const i=l(this,pt).get(l(this,ln));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");d(this,$,Gi).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},Mw=function(e){d(this,$,Rr).call(this,"final");const r=d(this,$,md).call(this,e.toolCallId),i=_v("content"in e?e.content:void 0),s={id:(r==null?void 0:r.id)??d(this,$,qi).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){d(this,$,Gi).call(this,s);return}d(this,$,ji).call(this,s)},Ow=function(e){const r=d(this,$,md).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",s=_v(e.content),o=s?`${i}${s}`:i,a={id:(r==null?void 0:r.id)??d(this,$,qi).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:o,locations:e.locations??(r==null?void 0:r.locations)};if(r){d(this,$,Gi).call(this,a);return}d(this,$,ji).call(this,a)},zw=function(e){if(d(this,$,Rr).call(this,"final"),!e)return;const r=l(this,Kr)?l(this,Dn):null;if(!r){const s=Sv(e);if(!s)return;const o={id:d(this,$,qi).call(this,"user"),kind:"user",text:s,status:"final"};d(this,$,ji).call(this,o),l(this,Kr)&&m(this,Dn,o.id);return}const i=l(this,pt).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");d(this,$,Gi).call(this,{...i,text:Sv(`${i.text}${e}`)})},Rr=function(e){if(!l(this,ln))return;const r=l(this,pt).get(l(this,ln));(r==null?void 0:r.kind)==="assistant"&&d(this,$,Gi).call(this,{...r,status:e}),m(this,ln,null)},ji=function(e){l(this,pt).set(e.id,e),this.dispatchEvent(new Sh("messages-changed"))},Gi=function(e){l(this,pt).set(e.id,e),this.dispatchEvent(new Sh("messages-changed"))},An=function(e){l(this,hs)!==e&&(m(this,hs,e),this.dispatchEvent(new K$("status-changed")))},Nw=function(e){const r=l(this,Ot);if(!r)return e;const i=l(this,et)?l(this,cn)==="single_session"?l(this,Ln)||!l(this,rr).has(r):!l(this,rr).has(r):!1,s=l(this,fs)&&(l(this,et)!==null||TO.test(e));if(!(s||i))return e;s&&m(this,fs,!1),i&&(m(this,Ln,!1),l(this,rr).add(r));const a=["[Television screen 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 l(this,et)?(a.push("This conversation is currently attached to the screen below."),a.push(`screen_id: ${l(this,et).screenID}`),a.push(`screen_name: ${l(this,et).screenName??""}`),a.push("When the user asks to inspect or change Television state with the tv CLI, use this screen ID with the --screen argument.")):a.push("There is currently no active Television screen."),a.push("[/Television screen context]","",e),a.join(`
|
|
43
|
-
`)},qi=function(e){const r=`${e}-${l(this,ps)}`;return m(this,ps,l(this,ps)+1),r},md=function(e){for(const r of l(this,pt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},vd=function(){if(!l(this,on))throw new Error("ACP session is not ready");return l(this,on)},ic=function(){if(!l(this,sn))throw new Error("ACP connection is not ready");return l(this,sn)},Uw=function(){var r;const e=(r=l(this,an))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},sc=function(){var r;if(l(this,cn)==="single_session")return d(this,$,bd).call(this,`${Tw}-${(l(this,zt).clientGUID??"default-client").toLowerCase()}`);const e=(r=l(this,et))==null?void 0:r.screenID;if(!e)throw new Error("Screen context is required for per-screen session mode");return d(this,$,yd).call(this,e)},yd=function(e){return d(this,$,bd).call(this,MO(l(this,cn),e,l(this,zt).clientGUID??"default-client"))},bd=function(e){var r;return((r=l(this,an))==null?void 0:r.sessionIdStrategy)==="deterministic"&&l(this,ds)>0?`${e}:epoch-${l(this,ds)}`:e},ha=new WeakMap,da=new WeakMap,oc=function(){m(this,sn,null),m(this,tr,null),m(this,Mt,null),m(this,Pn,null),m(this,on,null),m(this,Ot,null),m(this,an,null),l(this,un)&&(l(this,un).removeEventListener("close",l(this,ha)),l(this,un).removeEventListener("error",l(this,da)),l(this,un).close(),m(this,un,null))},Yi=function(e){const r=l(this,sn)!==null||l(this,tr)!==null||l(this,Mt)!==null||l(this,Pn)!==null||l(this,on)!==null||l(this,Ot)!==null||l(this,an)!==null||l(this,un)!==null;this.disposed||this.status==="disconnected"&&!r||(d(this,$,Rr).call(this,"error"),d(this,$,oc).call(this),m(this,rn,e??null),d(this,$,An).call(this,"disconnected"))},wd=function(){const e=l(this,pt).size>0;m(this,ln,null),m(this,Dn,null),m(this,ps,1),l(this,pt).clear(),e&&this.dispatchEvent(new Sh("messages-changed"))},Fw=function(){return this.status==="disconnected"};function LO(){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 DO(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function MO(n,t,e){return n==="single_session"?`${Tw}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function Hw(n){return n.replace(/^(?:\s*\n)+/,"")}function Sv(n){let t=n;return t=t.replace(EO,""),t=t.replace(xO,""),t=t.replace(AO,""),t=Hw(t),t}function OO(n){let t=n;return t=t.replace($O,""),t=Hw(t),t}function _v(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function zO(n){const t=n.createSocket(FO(n.serverURL,n.token));let e=!1,r,i;const s=new Promise((u,h)=>{r=u,i=h}),o=new ReadableStream({start(u){let h=!1;const f=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},v=x=>{const C=UO(x);if(!C)return;let L;try{L=JSON.parse(C)}catch(R){const W=R instanceof Error?R:new Error(String(R));i(W),u.error(W);return}switch(L.type){case"acp-bridge-status":if(L.status==="ready"){let R;try{R=NO(L)}catch(W){const N=W instanceof Error?W:new Error(String(W));e||i(N),u.error(N);return}e||(e=!0,r(R));return}if(L.status==="error"||L.status==="exited"){const R=new Error(L.error??`ACP bridge ${L.status}`);e||i(R),u.error(R)}return;case"acp-bridge-message":u.enqueue(L.message);return}},y=()=>{var C;if(h)return;h=!0;const x=new Error("ACP bridge websocket closed");e||i(x),(C=n.onDisconnect)==null||C.call(n,x),u.close()},E=()=>{var C;if(h)return;h=!0;const x=new Error("ACP bridge websocket error");e||i(x),(C=n.onDisconnect)==null||C.call(n,x),u.error(x)};t.addEventListener("open",f),t.addEventListener("message",v),t.addEventListener("close",y),t.addEventListener("error",E)}}),a=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:o,writable:a},socket:t,metadata:c}}function NO(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 UO(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 FO(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 Th(n){return n instanceof Error?n.message:String(n)}const kv="television.acpClientGUID",Ev="television.acpMappedSessions",xv=1;var gs;class HO{constructor(){b(this,gs,new Map)}getActualSessionId(t){return l(this,gs).get(t)??null}setActualSessionId(t,e){l(this,gs).set(t,e)}clearActualSessionId(t){l(this,gs).delete(t)}}gs=new WeakMap;var ms,pa,mt,ac,lc,Sd;class VO{constructor(t,e){b(this,mt);b(this,ms);b(this,pa);m(this,ms,t),m(this,pa,e)}getActualSessionId(t){const e=d(this,mt,lc).call(this)[d(this,mt,ac).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=d(this,mt,lc).call(this);r[d(this,mt,ac).call(this,t)]=e,d(this,mt,Sd).call(this,r)}clearActualSessionId(t){const e=d(this,mt,lc).call(this);delete e[d(this,mt,ac).call(this,t)],d(this,mt,Sd).call(this,e)}}ms=new WeakMap,pa=new WeakMap,mt=new WeakSet,ac=function(t){return JSON.stringify([l(this,pa),t])},lc=function(){const t=l(this,ms).getItem(Ev);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!==xv?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},Sd=function(t){const e={version:xv,entries:t};l(this,ms).setItem(Ev,JSON.stringify(e))};function Vw(){return typeof window>"u"?null:window.localStorage}function ZO(n){const t=n.getItem(kv);if(t)return t;const e=fu().toLowerCase();return n.setItem(kv,e),e}const Av=4401,BO=401,Hl=1e3,WO=3e4;class zo extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class Zw extends It{constructor(e){var o,a;super();g(this,"url");g(this,"name");g(this,"telemetryMeta");g(this,"status","unauthorized");g(this,"screens",new Map);g(this,"client");g(this,"acpClient");g(this,"_token");g(this,"attempting",!1);g(this,"nextRetryAt",null);g(this,"hasEverConnected",!1);g(this,"hasAuthRejected",!1);g(this,"bootState","pending");g(this,"serverVersion",null);g(this,"updateState",null);g(this,"decideBoot");g(this,"navigationPending");g(this,"createSocket");g(this,"createClient");g(this,"socket",null);g(this,"connectAttempt",0);g(this,"autoReconnect",!1);g(this,"retryTimer",null);g(this,"retryDelay",Hl);g(this,"visibilityEventTarget");g(this,"networkEventTarget");g(this,"onVisibilityChange");g(this,"onNetworkOnline");g(this,"telemetryActivityAgent");this.url=ee(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,h)=>new kC(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...h?{telemetryMeta:h}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new VO(e.acpStorage,this.url):new HO);this.acpClient=new PO({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()},(o=this.visibilityEventTarget)==null||o.addEventListener("visibilitychange",this.onVisibilityChange),(a=this.networkEventTarget)==null||a.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?nD({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.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Hl,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=Tc(e,{electron:Wt()});return Wt()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(e){const r=Tc(e,{electron:Wt()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createScreen(e){const{screen:r}=await this.client.screens.create({name:e});return this.screens.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"screen-created":this.screens.set(e.screen.id,structuredClone(e.screen)),this.dispatchEvent(new So("screens-changed"));break;case"screen-updated":this.screens.set(e.screen.id,structuredClone(e.screen)),this.dispatchEvent(new So("screens-changed"));break;case"screen-removed":this.screens.delete(e.screenID),this.dispatchEvent(new So("screens-changed"));break;case"artifact-created":{const r=this.screens.get(e.screenID);r&&!ec(r).includes(e.artifact.id)&&(r.layout=[...r.layout,Zb(e.artifact.id)]);break}case"artifact-removed":{const r=this.screens.get(e.screenID);r&&(r.layout=Lb(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"screen-changed":case"theme-changed":case"artifact-focus":break;default:return jO(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 ie("change"));const r=this.createSocket(GO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,o)=>{let a=!1;const c=()=>{var f;a||this.connectAttempt!==e||(a=!0,this.retryDelay=Hl,this.hasEverConnected=!0,this.setStatus("connected"),(f=this.telemetryActivityAgent)==null||f.start(),s())},u=f=>{a||this.connectAttempt!==e||(a=!0,o(f))},h=async()=>{const f=this.hasEverConnected;try{const[{screens:v},y]=await Promise.all([this.client.screens.list(),this.client.display.get()]);this.screens=new Map(v.map(E=>[E.id,structuredClone(E)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new ie("change")),f&&this.dispatchEvent(new So("screens-changed")),this.dispatchEvent(new id("server-event",{serverURL:this.url,event:{type:"screen-changed",screenID:y.activeScreenID}})),c(),f&&this.connectAttempt===e&&this.dispatchEvent(new Ib("server-reconnected",{serverURL:this.url}))}catch(v){if(QO(v)){u(new zo);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||h())}),r.addEventListener("message",f=>{const v=XO(f);if(!v)return;if(v.type==="server-status"){const E=v;this.serverVersion=E.version,this.updateState=E.update??null;let x=!1,C=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(E)==="boot"?(this.bootState="booted",x=!0):(this.bootState="halted",this.attempting=!1,C=!0)),this.dispatchEvent(new Rb("server-status",{serverURL:this.url,message:E})),x?this.navigationPending()||h():C&&this.dispatchEvent(new ie("change"));return}if(!JO(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new id("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",f=>{if(this.connectAttempt!==e)return;this.socket=null;const v=qO(f);if(!a){u(v===Av?new zo:new Error("Connection closed before initialization"));return}if(v===Av){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(a){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.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof zo){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,WO),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new ie("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new ie("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Hl,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:hC,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 ie("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function jO(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function GO(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 tD(e))r.searchParams.set(i,s);return r.hash="",r.toString()}function qO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const YO={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"screen-created":!0,"screen-updated":!0,"screen-removed":!0,"screen-changed":!0,"theme-changed":!0,"artifact-focus":!0},KO=new Set(Object.keys(YO));function JO(n){return KO.has(n)}function XO(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 QO(n){return n instanceof lf&&n.status===BO}const ez="Local";var fa,_d;class tz extends It{constructor(e){super();b(this,fa);g(this,"servers",new Map);g(this,"localServerURL");g(this,"clientGUID");g(this,"acpStorage");g(this,"telemetryMeta");g(this,"localStore");g(this,"bootBarrier");g(this,"navigationPending");g(this,"createSocket");g(this,"lastActiveServerURL");g(this,"serverListeners",new Map);g(this,"handleLocalStoreChange",()=>{const e=this.localStore.get().activeServerURL;e!==this.lastActiveServerURL&&(this.lastActiveServerURL=e,this.dispatchEvent(new ie("change")))});this.localStore=e.localStore,this.bootBarrier=e.bootBarrier??null,this.navigationPending=e.navigationPending??null,this.localServerURL=e.localServerURL?ee(e.localServerURL):null,this.createSocket=e.createSocket??(i=>new WebSocket(i)),this.lastActiveServerURL=this.localStore.get().activeServerURL;const r=e.acpStorage===void 0?Vw():e.acpStorage;this.acpStorage=r,this.clientGUID=e.clientGUID??(r?ZO(r):fu().toLowerCase()),this.telemetryMeta=e.telemetryMeta??null,this.localStore.addEventListener("change",this.handleLocalStoreChange)}get activeServer(){const e=this.localStore.get().activeServerURL;return e===null?null:this.servers.get(e)??null}add(e){const r=ee(e.url);this.servers.get(r)&&this.remove(r),this.servers.set(r,e),this.bootBarrier&&ee(this.bootBarrier.serverURL)===r&&(e.decideBoot=this.bootBarrier.decideBoot),this.navigationPending!==null&&(e.navigationPending=this.navigationPending);const s=()=>{this.dispatchEvent(new ie("change"))},o=h=>{this.dispatchEvent(new id("server-event",{serverURL:h.serverURL,event:h.event}))},a=()=>{this.dispatchEvent(new So("screens-changed"))},c=h=>{this.dispatchEvent(new Ib("server-reconnected",{serverURL:h.serverURL}))},u=h=>{this.dispatchEvent(new Rb("server-status",{serverURL:h.serverURL,message:h.message}))};e.addEventListener("change",s),e.addEventListener("server-event",o),e.addEventListener("screens-changed",a),e.addEventListener("server-reconnected",c),e.addEventListener("server-status",u),this.serverListeners.set(r,{onServerChange:s,onServerEvent:o,onScreensChanged:a,onServerReconnected:c,onServerStatus:u}),this.dispatchEvent(new ie("change"))}remove(e){const r=ee(e);if(this.localServerURL&&r===this.localServerURL)return;const i=this.servers.get(r);if(!i)return;const s=this.serverListeners.get(r);s&&(i.removeEventListener("change",s.onServerChange),i.removeEventListener("server-event",s.onServerEvent),i.removeEventListener("screens-changed",s.onScreensChanged),i.removeEventListener("server-reconnected",s.onServerReconnected),i.removeEventListener("server-status",s.onServerStatus),this.serverListeners.delete(r)),i.dispose(),this.servers.delete(r);const o=this.localStore.get(),a=o.activeServerURL===r;this.localStore.set({...o,servers:o.servers.filter(c=>c.url!==r),activeServerURL:a?null:o.activeServerURL}),this.dispatchEvent(new ie("change"))}getStoredAuthToken(e){return kh(this.localStore.get(),e)}setStoredAuthToken(e,r){this.localStore.set(zC(this.localStore.get(),e,r))}clearStoredAuthToken(e){const r=this.localStore.get(),i=NC(r,e);i!==r&&this.localStore.set(i)}setActive(e){const r=this.localStore.get(),i=e?ee(e.url):null;r.activeServerURL!==i&&this.localStore.set({...r,activeServerURL:i})}connectConfiguredServers(e,r){const i=e?ee(e):null;if(i){const a=this.localStore.get();a.servers.some(u=>ee(u.url)===i)||this.localStore.set({...a,servers:[...a.servers,{url:i,name:ez}]})}const s=this.localStore.get().servers;for(const a of s){const c=ee(a.url),h=i!==null&&c===i?r??kh(this.localStore.get(),c):kh(this.localStore.get(),c),f=d(this,fa,_d).call(this,{url:a.url,name:a.name,token:h});this.add(f),f.connect(h).catch(()=>{})}const o=i?this.servers.get(i)??null:null;this.setActive(o??this.servers.values().next().value??null)}addServer(e,r){const i=ee(e);this.remove(i);const s=this.localStore.get();this.localStore.set({...s,servers:[...s.servers.filter(a=>ee(a.url)!==i),{url:i,name:r}]});const o=d(this,fa,_d).call(this,{url:i,name:r,token:this.getStoredAuthToken(i)});this.add(o),this.setActive(o),o.connect(o.token).catch(()=>{})}removeServer(e){this.remove(e)}}fa=new WeakSet,_d=function(e){return new Zw({url:e.url,name:e.name,token:e.token,createSocket:this.createSocket,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:this.telemetryMeta})};var ga;class nz extends It{constructor(){super();b(this,ga,e=>{const r=rz(e);r!==null&&(e.preventDefault(),this.dispatchEvent(new Y$("shortcut-triggered",{shortcut:r})))});document.addEventListener("keydown",l(this,ga))}dispose(){document.removeEventListener("keydown",l(this,ga))}}ga=new WeakMap;function rz(n){for(const[t,e]of Object.entries(EC))if(iz(n,e.trigger))return t;return null}function iz(n,t){return!(n.key.toLowerCase()!==t.key.toLowerCase()||n.metaKey!==!!t.meta||n.ctrlKey!==!!t.ctrl||n.shiftKey!==!!t.shift||n.altKey!==!!t.alt)}const kd="tv-nav:",Zs="tv-reload",Tv=100,sz=1e3,oz=60,az=60,lz=24,cz=30,uz=cz*lz*az*oz*sz;function Fn(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(Zs);return t.searchParams.delete(Zs),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var ma,vs,de,oe,Jr,Ae,Bw,Gn,Ww,Ed,xd;class hz extends It{constructor(e,r){super();b(this,Ae);b(this,ma);b(this,vs);b(this,de,[]);b(this,oe,-1);b(this,Jr,0);m(this,ma,e),m(this,vs,Fn(r)),d(this,Ae,Bw).call(this)}get currentURL(){var e;return l(this,oe)===-1?null:((e=l(this,de)[l(this,oe)])==null?void 0:e.url)??null}get canGoBack(){return l(this,oe)>-1}get canGoForward(){return l(this,oe)<l(this,de).length-1}get entries(){return l(this,de).map(e=>({...e}))}get cursor(){return l(this,oe)}navigate(e){const r=Fn(e);if(r===l(this,vs)){if(l(this,oe)===-1)return;m(this,oe,-1),d(this,Ae,Gn).call(this);return}l(this,oe)<l(this,de).length-1&&m(this,de,l(this,de).slice(0,l(this,oe)+1)),l(this,de).push({url:r}),m(this,oe,l(this,de).length-1),d(this,Ae,Ed).call(this),d(this,Ae,Gn).call(this)}replace(e){var i;if(l(this,oe)===-1){this.navigate(e);return}const r=Fn(e);if(r===l(this,vs)){m(this,de,l(this,de).filter((s,o)=>o!==l(this,oe))),m(this,oe,-1),d(this,Ae,Gn).call(this);return}((i=l(this,de)[l(this,oe)])==null?void 0:i.url)!==r&&(m(this,de,l(this,de).map((s,o)=>o===l(this,oe)?{url:r}:s)),d(this,Ae,Gn).call(this))}back(){l(this,oe)!==-1&&(m(this,oe,l(this,oe)-1),d(this,Ae,Gn).call(this))}forward(){this.canGoForward&&(m(this,oe,l(this,oe)+1),d(this,Ae,Gn).call(this))}reset(){l(this,oe)===-1&&l(this,de).length===0||(m(this,de,[]),m(this,oe,-1),d(this,Ae,Gn).call(this))}}ma=new WeakMap,vs=new WeakMap,de=new WeakMap,oe=new WeakMap,Jr=new WeakMap,Ae=new WeakSet,Bw=function(){const e=localStorage.getItem(l(this,Ae,xd));if(e!==null)try{const r=JSON.parse(e);if(!jw(r))return;m(this,de,r.entries.map(i=>({url:i.url}))),m(this,oe,r.cursor),m(this,Jr,r.lastWritten),d(this,Ae,Ed).call(this)}catch{m(this,de,[]),m(this,oe,-1),m(this,Jr,0)}},Gn=function(){m(this,Jr,Date.now());try{localStorage.setItem(l(this,Ae,xd),JSON.stringify(d(this,Ae,Ww).call(this)))}catch(e){if(!fz(e))throw e}this.dispatchEvent(new ie("change"))},Ww=function(){return{v:1,entries:l(this,de).map(e=>({...e})),cursor:l(this,oe),lastWritten:l(this,Jr)}},Ed=function(){if(l(this,de).length<=Tv)return;const e=l(this,de).length-Tv;m(this,de,l(this,de).slice(e)),m(this,oe,Math.max(-1,l(this,oe)-e))},xd=function(){return dz(l(this,ma))};function dz(n){return`${kd}${n}`}function pz(n){const t=Date.now()-uz,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(kd)))continue;const s=i.slice(kd.length),o=localStorage.getItem(i);if(o===null)continue;let a;try{a=JSON.parse(o)}catch{e.push(i);continue}if(!jw(a)){e.push(i);continue}!n.has(s)&&a.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function fz(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function jw(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 gz="0.1.183";function bf(n=gz){return n!==void 0&&n.length>0?n:"0.0.0"}function wf(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const Ad="tv-reload-attempted";function mz(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:TC(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 vz(n){const t=n.getItem(Ad);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 yz(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??wf(),i=n.bundleVersion??bf();if(t===null)return{dispose(){}};let s=null;const o=()=>{if(s===null)return;const u=n.manager.servers.get(n.primaryServerURL);if(!u||u.status!=="connected")return;const h=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:h.fromVersion,to_version:h.toVersion})},a=u=>{if(r.pending)return;const h=mz({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:vz(t)});switch(h.action){case"reload":t.setItem(Ad,JSON.stringify(h.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(Ad),s={fromVersion:h.fromVersion,toVersion:h.toVersion},o();return;case"none":return}},c=()=>{o()};return n.manager.addEventListener("server-status",a),n.manager.addEventListener("change",c),{dispose(){n.manager.removeEventListener("server-status",a),n.manager.removeEventListener("change",c)}}}function bz(n){const t=Wt(n.search),e=W0(n.search),r=e!==null&&cf(e)?e:null;return{electron:t,shellVersion:r}}function wz(n){return!n.electron||n.requiredDesktopVersion===null||!cf(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===sd?!1:jb(n.requiredDesktopVersion,n.shellVersion)}const Sz=`# Desktop app upgrade required
|
|
43
|
+
`)},qi=function(e){const r=`${e}-${l(this,ps)}`;return m(this,ps,l(this,ps)+1),r},md=function(e){for(const r of l(this,pt).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},vd=function(){if(!l(this,on))throw new Error("ACP session is not ready");return l(this,on)},ic=function(){if(!l(this,sn))throw new Error("ACP connection is not ready");return l(this,sn)},Uw=function(){var r;const e=(r=l(this,an))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},sc=function(){var r;if(l(this,cn)==="single_session")return d(this,$,bd).call(this,`${Tw}-${(l(this,zt).clientGUID??"default-client").toLowerCase()}`);const e=(r=l(this,et))==null?void 0:r.screenID;if(!e)throw new Error("Screen context is required for per-screen session mode");return d(this,$,yd).call(this,e)},yd=function(e){return d(this,$,bd).call(this,MO(l(this,cn),e,l(this,zt).clientGUID??"default-client"))},bd=function(e){var r;return((r=l(this,an))==null?void 0:r.sessionIdStrategy)==="deterministic"&&l(this,ds)>0?`${e}:epoch-${l(this,ds)}`:e},ha=new WeakMap,da=new WeakMap,oc=function(){m(this,sn,null),m(this,tr,null),m(this,Mt,null),m(this,Pn,null),m(this,on,null),m(this,Ot,null),m(this,an,null),l(this,un)&&(l(this,un).removeEventListener("close",l(this,ha)),l(this,un).removeEventListener("error",l(this,da)),l(this,un).close(),m(this,un,null))},Yi=function(e){const r=l(this,sn)!==null||l(this,tr)!==null||l(this,Mt)!==null||l(this,Pn)!==null||l(this,on)!==null||l(this,Ot)!==null||l(this,an)!==null||l(this,un)!==null;this.disposed||this.status==="disconnected"&&!r||(d(this,$,Rr).call(this,"error"),d(this,$,oc).call(this),m(this,rn,e??null),d(this,$,An).call(this,"disconnected"))},wd=function(){const e=l(this,pt).size>0;m(this,ln,null),m(this,Dn,null),m(this,ps,1),l(this,pt).clear(),e&&this.dispatchEvent(new Sh("messages-changed"))},Fw=function(){return this.status==="disconnected"};function LO(){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 DO(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function MO(n,t,e){return n==="single_session"?`${Tw}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function Hw(n){return n.replace(/^(?:\s*\n)+/,"")}function Sv(n){let t=n;return t=t.replace(EO,""),t=t.replace(xO,""),t=t.replace(AO,""),t=Hw(t),t}function OO(n){let t=n;return t=t.replace($O,""),t=Hw(t),t}function _v(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function zO(n){const t=n.createSocket(FO(n.serverURL,n.token));let e=!1,r,i;const s=new Promise((u,h)=>{r=u,i=h}),o=new ReadableStream({start(u){let h=!1;const f=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},v=x=>{const C=UO(x);if(!C)return;let L;try{L=JSON.parse(C)}catch(R){const W=R instanceof Error?R:new Error(String(R));i(W),u.error(W);return}switch(L.type){case"acp-bridge-status":if(L.status==="ready"){let R;try{R=NO(L)}catch(W){const N=W instanceof Error?W:new Error(String(W));e||i(N),u.error(N);return}e||(e=!0,r(R));return}if(L.status==="error"||L.status==="exited"){const R=new Error(L.error??`ACP bridge ${L.status}`);e||i(R),u.error(R)}return;case"acp-bridge-message":u.enqueue(L.message);return}},y=()=>{var C;if(h)return;h=!0;const x=new Error("ACP bridge websocket closed");e||i(x),(C=n.onDisconnect)==null||C.call(n,x),u.close()},E=()=>{var C;if(h)return;h=!0;const x=new Error("ACP bridge websocket error");e||i(x),(C=n.onDisconnect)==null||C.call(n,x),u.error(x)};t.addEventListener("open",f),t.addEventListener("message",v),t.addEventListener("close",y),t.addEventListener("error",E)}}),a=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:o,writable:a},socket:t,metadata:c}}function NO(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 UO(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 FO(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 Th(n){return n instanceof Error?n.message:String(n)}const kv="television.acpClientGUID",Ev="television.acpMappedSessions",xv=1;var gs;class HO{constructor(){b(this,gs,new Map)}getActualSessionId(t){return l(this,gs).get(t)??null}setActualSessionId(t,e){l(this,gs).set(t,e)}clearActualSessionId(t){l(this,gs).delete(t)}}gs=new WeakMap;var ms,pa,mt,ac,lc,Sd;class VO{constructor(t,e){b(this,mt);b(this,ms);b(this,pa);m(this,ms,t),m(this,pa,e)}getActualSessionId(t){const e=d(this,mt,lc).call(this)[d(this,mt,ac).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=d(this,mt,lc).call(this);r[d(this,mt,ac).call(this,t)]=e,d(this,mt,Sd).call(this,r)}clearActualSessionId(t){const e=d(this,mt,lc).call(this);delete e[d(this,mt,ac).call(this,t)],d(this,mt,Sd).call(this,e)}}ms=new WeakMap,pa=new WeakMap,mt=new WeakSet,ac=function(t){return JSON.stringify([l(this,pa),t])},lc=function(){const t=l(this,ms).getItem(Ev);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!==xv?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},Sd=function(t){const e={version:xv,entries:t};l(this,ms).setItem(Ev,JSON.stringify(e))};function Vw(){return typeof window>"u"?null:window.localStorage}function ZO(n){const t=n.getItem(kv);if(t)return t;const e=fu().toLowerCase();return n.setItem(kv,e),e}const Av=4401,BO=401,Hl=1e3,WO=3e4;class zo extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class Zw extends It{constructor(e){var o,a;super();g(this,"url");g(this,"name");g(this,"telemetryMeta");g(this,"status","unauthorized");g(this,"screens",new Map);g(this,"client");g(this,"acpClient");g(this,"_token");g(this,"attempting",!1);g(this,"nextRetryAt",null);g(this,"hasEverConnected",!1);g(this,"hasAuthRejected",!1);g(this,"bootState","pending");g(this,"serverVersion",null);g(this,"updateState",null);g(this,"decideBoot");g(this,"navigationPending");g(this,"createSocket");g(this,"createClient");g(this,"socket",null);g(this,"connectAttempt",0);g(this,"autoReconnect",!1);g(this,"retryTimer",null);g(this,"retryDelay",Hl);g(this,"visibilityEventTarget");g(this,"networkEventTarget");g(this,"onVisibilityChange");g(this,"onNetworkOnline");g(this,"telemetryActivityAgent");this.url=ee(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,h)=>new kC(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...h?{telemetryMeta:h}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new VO(e.acpStorage,this.url):new HO);this.acpClient=new PO({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()},(o=this.visibilityEventTarget)==null||o.addEventListener("visibilitychange",this.onVisibilityChange),(a=this.networkEventTarget)==null||a.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?nD({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.acpClient.setToken(e),this.cancelRetryTimer(),this.retryDelay=Hl,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=Tc(e,{electron:Wt()});return Wt()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}getContentURL(e){const r=Tc(e,{electron:Wt()}).contentURL;return r===null?null:new URL(r,this.url).toString()}async createScreen(e){const{screen:r}=await this.client.screens.create({name:e});return this.screens.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"screen-created":this.screens.set(e.screen.id,structuredClone(e.screen)),this.dispatchEvent(new So("screens-changed"));break;case"screen-updated":this.screens.set(e.screen.id,structuredClone(e.screen)),this.dispatchEvent(new So("screens-changed"));break;case"screen-removed":this.screens.delete(e.screenID),this.dispatchEvent(new So("screens-changed"));break;case"artifact-created":{const r=this.screens.get(e.screenID);r&&!ec(r).includes(e.artifact.id)&&(r.layout=[...r.layout,Zb(e.artifact.id)]);break}case"artifact-removed":{const r=this.screens.get(e.screenID);r&&(r.layout=Lb(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"screen-changed":case"theme-changed":case"artifact-focus":break;default:return jO(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 ie("change"));const r=this.createSocket(GO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((s,o)=>{let a=!1;const c=()=>{var f;a||this.connectAttempt!==e||(a=!0,this.retryDelay=Hl,this.hasEverConnected=!0,this.setStatus("connected"),(f=this.telemetryActivityAgent)==null||f.start(),s())},u=f=>{a||this.connectAttempt!==e||(a=!0,o(f))},h=async()=>{const f=this.hasEverConnected;try{const[{screens:v},y]=await Promise.all([this.client.screens.list(),this.client.display.get()]);this.screens=new Map(v.map(E=>[E.id,structuredClone(E)])),this.acpClient.setEnabled(y.acpEnabled),this.dispatchEvent(new ie("change")),f&&this.dispatchEvent(new So("screens-changed")),this.dispatchEvent(new id("server-event",{serverURL:this.url,event:{type:"screen-changed",screenID:y.activeScreenID}})),c(),f&&this.connectAttempt===e&&this.dispatchEvent(new Ib("server-reconnected",{serverURL:this.url}))}catch(v){if(QO(v)){u(new zo);return}u(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||h())}),r.addEventListener("message",f=>{const v=XO(f);if(!v)return;if(v.type==="server-status"){const E=v;this.serverVersion=E.version,this.updateState=E.update??null;let x=!1,C=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(E)==="boot"?(this.bootState="booted",x=!0):(this.bootState="halted",this.attempting=!1,C=!0)),this.dispatchEvent(new Rb("server-status",{serverURL:this.url,message:E})),x?this.navigationPending()||h():C&&this.dispatchEvent(new ie("change"));return}if(!JO(v.type))return;const y=v;this.applyServerEvent(y),this.dispatchEvent(new id("server-event",{serverURL:this.url,event:y}))}),r.addEventListener("close",f=>{if(this.connectAttempt!==e)return;this.socket=null;const v=qO(f);if(!a){u(v===Av?new zo:new Error("Connection closed before initialization"));return}if(v===Av){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(a){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.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof zo){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,WO),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new ie("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new ie("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=Hl,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:hC,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 ie("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function jO(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function GO(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 tD(e))r.searchParams.set(i,s);return r.hash="",r.toString()}function qO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const YO={"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"screen-created":!0,"screen-updated":!0,"screen-removed":!0,"screen-changed":!0,"theme-changed":!0,"artifact-focus":!0},KO=new Set(Object.keys(YO));function JO(n){return KO.has(n)}function XO(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 QO(n){return n instanceof lf&&n.status===BO}const ez="Local";var fa,_d;class tz extends It{constructor(e){super();b(this,fa);g(this,"servers",new Map);g(this,"localServerURL");g(this,"clientGUID");g(this,"acpStorage");g(this,"telemetryMeta");g(this,"localStore");g(this,"bootBarrier");g(this,"navigationPending");g(this,"createSocket");g(this,"lastActiveServerURL");g(this,"serverListeners",new Map);g(this,"handleLocalStoreChange",()=>{const e=this.localStore.get().activeServerURL;e!==this.lastActiveServerURL&&(this.lastActiveServerURL=e,this.dispatchEvent(new ie("change")))});this.localStore=e.localStore,this.bootBarrier=e.bootBarrier??null,this.navigationPending=e.navigationPending??null,this.localServerURL=e.localServerURL?ee(e.localServerURL):null,this.createSocket=e.createSocket??(i=>new WebSocket(i)),this.lastActiveServerURL=this.localStore.get().activeServerURL;const r=e.acpStorage===void 0?Vw():e.acpStorage;this.acpStorage=r,this.clientGUID=e.clientGUID??(r?ZO(r):fu().toLowerCase()),this.telemetryMeta=e.telemetryMeta??null,this.localStore.addEventListener("change",this.handleLocalStoreChange)}get activeServer(){const e=this.localStore.get().activeServerURL;return e===null?null:this.servers.get(e)??null}add(e){const r=ee(e.url);this.servers.get(r)&&this.remove(r),this.servers.set(r,e),this.bootBarrier&&ee(this.bootBarrier.serverURL)===r&&(e.decideBoot=this.bootBarrier.decideBoot),this.navigationPending!==null&&(e.navigationPending=this.navigationPending);const s=()=>{this.dispatchEvent(new ie("change"))},o=h=>{this.dispatchEvent(new id("server-event",{serverURL:h.serverURL,event:h.event}))},a=()=>{this.dispatchEvent(new So("screens-changed"))},c=h=>{this.dispatchEvent(new Ib("server-reconnected",{serverURL:h.serverURL}))},u=h=>{this.dispatchEvent(new Rb("server-status",{serverURL:h.serverURL,message:h.message}))};e.addEventListener("change",s),e.addEventListener("server-event",o),e.addEventListener("screens-changed",a),e.addEventListener("server-reconnected",c),e.addEventListener("server-status",u),this.serverListeners.set(r,{onServerChange:s,onServerEvent:o,onScreensChanged:a,onServerReconnected:c,onServerStatus:u}),this.dispatchEvent(new ie("change"))}remove(e){const r=ee(e);if(this.localServerURL&&r===this.localServerURL)return;const i=this.servers.get(r);if(!i)return;const s=this.serverListeners.get(r);s&&(i.removeEventListener("change",s.onServerChange),i.removeEventListener("server-event",s.onServerEvent),i.removeEventListener("screens-changed",s.onScreensChanged),i.removeEventListener("server-reconnected",s.onServerReconnected),i.removeEventListener("server-status",s.onServerStatus),this.serverListeners.delete(r)),i.dispose(),this.servers.delete(r);const o=this.localStore.get(),a=o.activeServerURL===r;this.localStore.set({...o,servers:o.servers.filter(c=>c.url!==r),activeServerURL:a?null:o.activeServerURL}),this.dispatchEvent(new ie("change"))}getStoredAuthToken(e){return kh(this.localStore.get(),e)}setStoredAuthToken(e,r){this.localStore.set(zC(this.localStore.get(),e,r))}clearStoredAuthToken(e){const r=this.localStore.get(),i=NC(r,e);i!==r&&this.localStore.set(i)}setActive(e){const r=this.localStore.get(),i=e?ee(e.url):null;r.activeServerURL!==i&&this.localStore.set({...r,activeServerURL:i})}connectConfiguredServers(e,r){const i=e?ee(e):null;if(i){const a=this.localStore.get();a.servers.some(u=>ee(u.url)===i)||this.localStore.set({...a,servers:[...a.servers,{url:i,name:ez}]})}const s=this.localStore.get().servers;for(const a of s){const c=ee(a.url),h=i!==null&&c===i?r??kh(this.localStore.get(),c):kh(this.localStore.get(),c),f=d(this,fa,_d).call(this,{url:a.url,name:a.name,token:h});this.add(f),f.connect(h).catch(()=>{})}const o=i?this.servers.get(i)??null:null;this.setActive(o??this.servers.values().next().value??null)}addServer(e,r){const i=ee(e);this.remove(i);const s=this.localStore.get();this.localStore.set({...s,servers:[...s.servers.filter(a=>ee(a.url)!==i),{url:i,name:r}]});const o=d(this,fa,_d).call(this,{url:i,name:r,token:this.getStoredAuthToken(i)});this.add(o),this.setActive(o),o.connect(o.token).catch(()=>{})}removeServer(e){this.remove(e)}}fa=new WeakSet,_d=function(e){return new Zw({url:e.url,name:e.name,token:e.token,createSocket:this.createSocket,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:this.telemetryMeta})};var ga;class nz extends It{constructor(){super();b(this,ga,e=>{const r=rz(e);r!==null&&(e.preventDefault(),this.dispatchEvent(new Y$("shortcut-triggered",{shortcut:r})))});document.addEventListener("keydown",l(this,ga))}dispose(){document.removeEventListener("keydown",l(this,ga))}}ga=new WeakMap;function rz(n){for(const[t,e]of Object.entries(EC))if(iz(n,e.trigger))return t;return null}function iz(n,t){return!(n.key.toLowerCase()!==t.key.toLowerCase()||n.metaKey!==!!t.meta||n.ctrlKey!==!!t.ctrl||n.shiftKey!==!!t.shift||n.altKey!==!!t.alt)}const kd="tv-nav:",Zs="tv-reload",Tv=100,sz=1e3,oz=60,az=60,lz=24,cz=30,uz=cz*lz*az*oz*sz;function Fn(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(Zs);return t.searchParams.delete(Zs),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var ma,vs,de,oe,Jr,Ae,Bw,Gn,Ww,Ed,xd;class hz extends It{constructor(e,r){super();b(this,Ae);b(this,ma);b(this,vs);b(this,de,[]);b(this,oe,-1);b(this,Jr,0);m(this,ma,e),m(this,vs,Fn(r)),d(this,Ae,Bw).call(this)}get currentURL(){var e;return l(this,oe)===-1?null:((e=l(this,de)[l(this,oe)])==null?void 0:e.url)??null}get canGoBack(){return l(this,oe)>-1}get canGoForward(){return l(this,oe)<l(this,de).length-1}get entries(){return l(this,de).map(e=>({...e}))}get cursor(){return l(this,oe)}navigate(e){const r=Fn(e);if(r===l(this,vs)){if(l(this,oe)===-1)return;m(this,oe,-1),d(this,Ae,Gn).call(this);return}l(this,oe)<l(this,de).length-1&&m(this,de,l(this,de).slice(0,l(this,oe)+1)),l(this,de).push({url:r}),m(this,oe,l(this,de).length-1),d(this,Ae,Ed).call(this),d(this,Ae,Gn).call(this)}replace(e){var i;if(l(this,oe)===-1){this.navigate(e);return}const r=Fn(e);if(r===l(this,vs)){m(this,de,l(this,de).filter((s,o)=>o!==l(this,oe))),m(this,oe,-1),d(this,Ae,Gn).call(this);return}((i=l(this,de)[l(this,oe)])==null?void 0:i.url)!==r&&(m(this,de,l(this,de).map((s,o)=>o===l(this,oe)?{url:r}:s)),d(this,Ae,Gn).call(this))}back(){l(this,oe)!==-1&&(m(this,oe,l(this,oe)-1),d(this,Ae,Gn).call(this))}forward(){this.canGoForward&&(m(this,oe,l(this,oe)+1),d(this,Ae,Gn).call(this))}reset(){l(this,oe)===-1&&l(this,de).length===0||(m(this,de,[]),m(this,oe,-1),d(this,Ae,Gn).call(this))}}ma=new WeakMap,vs=new WeakMap,de=new WeakMap,oe=new WeakMap,Jr=new WeakMap,Ae=new WeakSet,Bw=function(){const e=localStorage.getItem(l(this,Ae,xd));if(e!==null)try{const r=JSON.parse(e);if(!jw(r))return;m(this,de,r.entries.map(i=>({url:i.url}))),m(this,oe,r.cursor),m(this,Jr,r.lastWritten),d(this,Ae,Ed).call(this)}catch{m(this,de,[]),m(this,oe,-1),m(this,Jr,0)}},Gn=function(){m(this,Jr,Date.now());try{localStorage.setItem(l(this,Ae,xd),JSON.stringify(d(this,Ae,Ww).call(this)))}catch(e){if(!fz(e))throw e}this.dispatchEvent(new ie("change"))},Ww=function(){return{v:1,entries:l(this,de).map(e=>({...e})),cursor:l(this,oe),lastWritten:l(this,Jr)}},Ed=function(){if(l(this,de).length<=Tv)return;const e=l(this,de).length-Tv;m(this,de,l(this,de).slice(e)),m(this,oe,Math.max(-1,l(this,oe)-e))},xd=function(){return dz(l(this,ma))};function dz(n){return`${kd}${n}`}function pz(n){const t=Date.now()-uz,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(kd)))continue;const s=i.slice(kd.length),o=localStorage.getItem(i);if(o===null)continue;let a;try{a=JSON.parse(o)}catch{e.push(i);continue}if(!jw(a)){e.push(i);continue}!n.has(s)&&a.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function fz(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function jw(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 gz="0.1.185";function bf(n=gz){return n!==void 0&&n.length>0?n:"0.0.0"}function wf(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const Ad="tv-reload-attempted";function mz(n){return n.originMatch?n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:TC(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 vz(n){const t=n.getItem(Ad);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 yz(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??wf(),i=n.bundleVersion??bf();if(t===null)return{dispose(){}};let s=null;const o=()=>{if(s===null)return;const u=n.manager.servers.get(n.primaryServerURL);if(!u||u.status!=="connected")return;const h=s;s=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:h.fromVersion,to_version:h.toVersion})},a=u=>{if(r.pending)return;const h=mz({bundleVersion:i,serverVersion:u.message.version,originMatch:u.serverURL===n.primaryServerURL,marker:vz(t)});switch(h.action){case"reload":t.setItem(Ad,JSON.stringify(h.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(Ad),s={fromVersion:h.fromVersion,toVersion:h.toVersion},o();return;case"none":return}},c=()=>{o()};return n.manager.addEventListener("server-status",a),n.manager.addEventListener("change",c),{dispose(){n.manager.removeEventListener("server-status",a),n.manager.removeEventListener("change",c)}}}function bz(n){const t=Wt(n.search),e=W0(n.search),r=e!==null&&cf(e)?e:null;return{electron:t,shellVersion:r}}function wz(n){return!n.electron||n.requiredDesktopVersion===null||!cf(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===sd?!1:jb(n.requiredDesktopVersion,n.shellVersion)}const Sz=`# 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:
|