@telepath-computer/television 1.5.10 → 1.6.0
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/THIRD-PARTY-NOTICES.txt +701 -0
- package/dist/cli.cjs +9035 -596
- package/dist/onboarding/tv-guide/welcome.html +14 -4
- package/dist/skills/television/SKILL.md +39 -33
- package/dist/skills/television/resources.md +4 -4
- package/dist/skills/television/templates.md +77 -0
- package/dist/skills/television/theming.md +31 -17
- package/dist/templates/calendar/README.md +17 -0
- package/dist/{skills/tv-tasks → templates/calendar}/THIRD-PARTY-NOTICES.txt +22 -22
- package/dist/templates/calendar/calendar-attendees.js +131 -0
- package/dist/templates/calendar/calendar-event.js +22 -0
- package/dist/templates/calendar/calendar-motion.js +273 -0
- package/dist/templates/calendar/calendar-page.js +403 -0
- package/dist/templates/calendar/calendar-time-axis.js +32 -0
- package/dist/templates/calendar/calendar-week.js +711 -0
- package/dist/templates/calendar/data.json +3 -0
- package/dist/templates/calendar/icon.svg +1 -0
- package/dist/templates/calendar/index.html +27 -0
- package/dist/templates/calendar/manifest.json +148 -0
- package/dist/templates/calendar/styles.css +771 -0
- package/dist/templates/checklist/README.md +45 -0
- package/dist/templates/checklist/THIRD-PARTY-NOTICES.txt +29 -0
- package/dist/templates/checklist/data.json +1 -0
- package/dist/templates/checklist/icon.svg +8 -0
- package/dist/templates/checklist/icons.css +61 -0
- package/dist/templates/checklist/index.html +47 -0
- package/dist/templates/checklist/manifest.json +49 -0
- package/dist/templates/checklist/model.d.ts +30 -0
- package/dist/templates/checklist/model.js +60 -0
- package/dist/templates/checklist/page.js +425 -0
- package/dist/templates/checklist/styles.css +206 -0
- package/dist/templates/document/README.md +55 -0
- package/dist/templates/document/THIRD-PARTY-NOTICES.txt +1080 -0
- package/dist/templates/document/data.json +3 -0
- package/dist/templates/document/editor.css +1 -0
- package/dist/templates/document/editor.js +37 -0
- package/dist/templates/document/icon.svg +6 -0
- package/dist/templates/document/index.html +29 -0
- package/dist/templates/document/manifest.json +22 -0
- package/dist/templates/document/page.js +190 -0
- package/dist/templates/document/styles.css +76 -0
- package/dist/templates/map/README.md +85 -0
- package/dist/templates/map/THIRD-PARTY-NOTICES.txt +84 -0
- package/dist/templates/map/data.json +1 -0
- package/dist/templates/map/icon.svg +8 -0
- package/dist/templates/map/icons.svg +43 -0
- package/dist/templates/map/index.html +95 -0
- package/dist/templates/map/manifest.json +227 -0
- package/dist/templates/map/map-model.js +18 -0
- package/dist/templates/map/map.css +202 -0
- package/dist/templates/map/map.js +728 -0
- package/dist/templates/map/vendor/LICENSE +26 -0
- package/dist/templates/map/vendor/README.md +11 -0
- package/dist/templates/map/vendor/leaflet.css +661 -0
- package/dist/templates/map/vendor/leaflet.js +6 -0
- package/dist/templates/map/vendor/lucide/LICENSE +43 -0
- package/dist/templates/map/vendor/lucide/README.md +46 -0
- package/dist/templates/map/vendor/lucide/icons.js +832 -0
- package/dist/templates/map/vendor/lucide/svg/airport.svg +15 -0
- package/dist/templates/map/vendor/lucide/svg/bar.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/beach.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/bridge.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/bus.svg +21 -0
- package/dist/templates/map/vendor/lucide/svg/church.svg +19 -0
- package/dist/templates/map/vendor/lucide/svg/coffee.svg +18 -0
- package/dist/templates/map/vendor/lucide/svg/ferry.svg +19 -0
- package/dist/templates/map/vendor/lucide/svg/flag.svg +15 -0
- package/dist/templates/map/vendor/lucide/svg/heart.svg +15 -0
- package/dist/templates/map/vendor/lucide/svg/home.svg +16 -0
- package/dist/templates/map/vendor/lucide/svg/hospital.svg +19 -0
- package/dist/templates/map/vendor/lucide/svg/hotel.svg +24 -0
- package/dist/templates/map/vendor/lucide/svg/info.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/landmark.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/mountain.svg +15 -0
- package/dist/templates/map/vendor/lucide/svg/museum.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/music.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/park.svg +18 -0
- package/dist/templates/map/vendor/lucide/svg/parking.svg +16 -0
- package/dist/templates/map/vendor/lucide/svg/pin.svg +16 -0
- package/dist/templates/map/vendor/lucide/svg/restaurant.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/school.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/shop.svg +17 -0
- package/dist/templates/map/vendor/lucide/svg/sports.svg +19 -0
- package/dist/templates/map/vendor/lucide/svg/star.svg +15 -0
- package/dist/templates/map/vendor/lucide/svg/theatre.svg +23 -0
- package/dist/templates/map/vendor/lucide/svg/train.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/viewpoint.svg +20 -0
- package/dist/templates/map/vendor/lucide/svg/work.svg +18 -0
- package/dist/templates/sticky-note/Caveat-Medium.woff2 +0 -0
- package/dist/templates/sticky-note/README.md +47 -0
- package/dist/templates/sticky-note/THIRD-PARTY-NOTICES.txt +127 -0
- package/dist/templates/sticky-note/data.json +1 -0
- package/dist/templates/sticky-note/icon.svg +16 -0
- package/dist/templates/sticky-note/icons.css +61 -0
- package/dist/templates/sticky-note/index.html +31 -0
- package/dist/templates/sticky-note/manifest.json +27 -0
- package/dist/templates/sticky-note/model.d.ts +33 -0
- package/dist/templates/sticky-note/model.js +152 -0
- package/dist/templates/sticky-note/page.js +84 -0
- package/dist/templates/sticky-note/styles.css +140 -0
- package/dist/templates/table/README.md +107 -0
- package/dist/templates/table/data.json +4 -0
- package/dist/templates/table/icon.svg +6 -0
- package/dist/templates/table/index.html +15 -0
- package/dist/templates/table/manifest.json +70 -0
- package/dist/templates/table/model.d.ts +164 -0
- package/dist/templates/table/model.js +395 -0
- package/dist/templates/table/page.js +1045 -0
- package/dist/templates/table/selection-model.d.ts +67 -0
- package/dist/templates/table/selection-model.js +163 -0
- package/dist/templates/table/styles.css +522 -0
- package/dist/views/markdown/THIRD-PARTY-NOTICES.txt +408 -0
- package/dist/views/markdown/index.html +21 -21
- package/dist/web/assets/main-CRSNodQt.js +864 -0
- package/dist/web/assets/main-DnvQkpg4.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/skills/tv-calendar/SKILL.md +0 -100
- package/dist/skills/tv-calendar/calendar.css +0 -1
- package/dist/skills/tv-calendar/calendar.js +0 -400
- package/dist/skills/tv-table/SKILL.md +0 -95
- package/dist/skills/tv-tasks/SKILL.md +0 -269
- package/dist/skills/tv-tasks/task.css +0 -180
- package/dist/skills/tv-tasks/task.js +0 -304
- package/dist/web/assets/calendar-DToAnkzj.png +0 -0
- package/dist/web/assets/main-CekDfJPz.js +0 -848
- package/dist/web/assets/main-CunC2_Nx.css +0 -1
- package/dist/web/assets/markdown-DdDrJuVK.png +0 -0
- package/dist/web/assets/table-oeG9uAN1.png +0 -0
- package/dist/web/assets/tasks-D4xqXFPl.png +0 -0
|
@@ -0,0 +1,864 @@
|
|
|
1
|
+
var cE=Object.defineProperty;var Cy=n=>{throw TypeError(n)};var uE=(n,t,e)=>t in n?cE(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var I=(n,t,e)=>uE(n,typeof t!="symbol"?t+"":t,e),Bp=(n,t,e)=>t.has(n)||Cy("Cannot "+e);var s=(n,t,e)=>(Bp(n,t,"read from private field"),e?e.call(n):t.get(n)),m=(n,t,e)=>t.has(n)?Cy("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(n):t.set(n,e),d=(n,t,e,r)=>(Bp(n,t,"write to private field"),r?r.call(n,e):t.set(n,e),e),h=(n,t,e)=>(Bp(n,t,"access private method"),e);var ro=(n,t,e,r)=>({set _(i){d(n,t,i,e)},get _(){return s(n,t,r)}});import{i as hE,a as dE,b as fE,c as pE,d as mE,e as gE,f as vE,g as yE,U as wE,A as bE,h as SE}from"./artifact-bridge-DTPacxDw.js";import{m as _E,a as AE,b as EE}from"./missing-artifact-page-DVzJ41AE.js";var po=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function kE(n){if(Object.prototype.hasOwnProperty.call(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 Ry={},Iy={},jp,$y;function X8(){if($y)return jp;$y=1;var n=Object.prototype.toString;return jp=function(e){var r=n.call(e),i=r==="[object Arguments]";return i||(i=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&n.call(e.callee)==="[object Function]"),i},jp}var Wp,xy;function TE(){if(xy)return Wp;xy=1;var n;if(!Object.keys){var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,r=X8(),i=Object.prototype.propertyIsEnumerable,o=!i.call({toString:null},"toString"),a=i.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(y){var v=y.constructor;return v&&v.prototype===y},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},f=(function(){if(typeof window>"u")return!1;for(var y in window)try{if(!u["$"+y]&&t.call(window,y)&&window[y]!==null&&typeof window[y]=="object")try{c(window[y])}catch{return!0}}catch{return!0}return!1})(),p=function(y){if(typeof window>"u"||!f)return c(y);try{return c(y)}catch{return!1}};n=function(v){var S=v!==null&&typeof v=="object",_=e.call(v)==="[object Function]",R=r(v),H=S&&e.call(v)==="[object String]",P=[];if(!S&&!_&&!R)throw new TypeError("Object.keys called on a non-object");var N=a&&_;if(H&&v.length>0&&!t.call(v,0))for(var D=0;D<v.length;++D)P.push(String(D));if(R&&v.length>0)for(var B=0;B<v.length;++B)P.push(String(B));else for(var q in v)!(N&&q==="prototype")&&t.call(v,q)&&P.push(String(q));if(o)for(var F=p(v),Q=0;Q<l.length;++Q)!(F&&l[Q]==="constructor")&&t.call(v,l[Q])&&P.push(l[Q]);return P}}return Wp=n,Wp}var Gp,Py;function CE(){if(Py)return Gp;Py=1;var n=Array.prototype.slice,t=X8(),e=Object.keys,r=e?function(a){return e(a)}:TE(),i=Object.keys;return r.shim=function(){if(Object.keys){var a=(function(){var l=Object.keys(arguments);return l&&l.length===arguments.length})(1,2);a||(Object.keys=function(c){return t(c)?i(n.call(c)):i(c)})}else Object.keys=r;return Object.keys||r},Gp=r,Gp}var Jp,Dy;function Kh(){if(Dy)return Jp;Dy=1;var n=Object.defineProperty||!1;if(n)try{n({},"a",{value:1})}catch{n=!1}return Jp=n,Jp}var Yp,Oy;function Oi(){return Oy||(Oy=1,Yp=SyntaxError),Yp}var Kp,Ly;function pe(){return Ly||(Ly=1,Kp=TypeError),Kp}var Xp,My;function RE(){return My||(My=1,Xp=Object.getOwnPropertyDescriptor),Xp}var Qp,Ny;function Sc(){if(Ny)return Qp;Ny=1;var n=RE();if(n)try{n([],"length")}catch{n=null}return Qp=n,Qp}var e0,zy;function Q8(){if(zy)return e0;zy=1;var n=Kh(),t=Oi(),e=pe(),r=Sc();return e0=function(o,a,l){if(!o||typeof o!="object"&&typeof o!="function")throw new e("`obj` must be an object or a function`");if(typeof a!="string"&&typeof a!="symbol")throw new e("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new e("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new e("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new e("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new e("`loose`, if provided, must be a boolean");var c=arguments.length>3?arguments[3]:null,u=arguments.length>4?arguments[4]:null,f=arguments.length>5?arguments[5]:null,p=arguments.length>6?arguments[6]:!1,y=!!r&&r(o,a);if(n)n(o,a,{configurable:f===null&&y?y.configurable:!f,enumerable:c===null&&y?y.enumerable:!c,value:l,writable:u===null&&y?y.writable:!u});else if(p||!c&&!u&&!f)o[a]=l;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},e0}var t0,Hy;function _p(){if(Hy)return t0;Hy=1;var n=Kh(),t=function(){return!!n};return t.hasArrayLengthDefineBug=function(){if(!n)return null;try{return n([],"length",{value:1}).length!==1}catch{return!0}},t0=t,t0}var n0,Zy;function Ea(){if(Zy)return n0;Zy=1;var n=CE(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",e=Object.prototype.toString,r=Array.prototype.concat,i=Q8(),o=function(u){return typeof u=="function"&&e.call(u)==="[object Function]"},a=_p()(),l=function(u,f,p,y){if(f in u){if(y===!0){if(u[f]===p)return}else if(!o(y)||!y())return}a?i(u,f,p,!0):i(u,f,p)},c=function(u,f){var p=arguments.length>2?arguments[2]:{},y=n(f);t&&(y=r.call(y,Object.getOwnPropertySymbols(f)));for(var v=0;v<y.length;v+=1)l(u,y[v],f[y[v]],p[y[v]])};return c.supportsDescriptors=!!a,n0=c,n0}var qc={exports:{}},Uy;function e6(){return Uy||(Uy=1,typeof self<"u"?qc.exports=self:typeof window<"u"?qc.exports=window:qc.exports=Function("return this")()),qc.exports}var r0,qy;function t6(){if(qy)return r0;qy=1;var n=e6();return r0=function(){return typeof po!="object"||!po||po.Math!==Math||po.Array!==Array?n:po},r0}var i0,Fy;function IE(){if(Fy)return i0;Fy=1;var n=Ea(),t=Sc(),e=t6();return i0=function(){var i=e();if(n.supportsDescriptors){var o=t(i,"globalThis");(!o||o.configurable&&(o.enumerable||!o.writable||globalThis!==i))&&Object.defineProperty(i,"globalThis",{configurable:!0,enumerable:!1,value:i,writable:!0})}else(typeof globalThis!="object"||globalThis!==i)&&(i.globalThis=i);return i},i0}var s0,Vy;function Sv(){if(Vy)return s0;Vy=1;var n=Ea(),t=e6(),e=t6(),r=IE(),i=e(),o=function(){return i};return n(o,{getPolyfill:e,implementation:t,shim:r}),s0=o,s0}var o0,By;function Li(){return By||(By=1,o0=function(t){return!!t&&(typeof t=="function"||typeof t=="object")}),o0}var a0,jy;function _v(){return jy||(jy=1,a0=Object),a0}var l0,Wy;function n6(){return Wy||(Wy=1,l0=Error),l0}var c0,Gy;function $E(){return Gy||(Gy=1,c0=EvalError),c0}var u0,Jy;function xE(){return Jy||(Jy=1,u0=RangeError),u0}var h0,Yy;function Av(){return Yy||(Yy=1,h0=ReferenceError),h0}var d0,Ky;function PE(){return Ky||(Ky=1,d0=URIError),d0}var f0,Xy;function DE(){return Xy||(Xy=1,f0=Math.abs),f0}var p0,Qy;function OE(){return Qy||(Qy=1,p0=Math.floor),p0}var m0,ew;function LE(){return ew||(ew=1,m0=Math.max),m0}var g0,tw;function ME(){return tw||(tw=1,g0=Math.min),g0}var v0,nw;function NE(){return nw||(nw=1,v0=Math.pow),v0}var y0,rw;function zE(){return rw||(rw=1,y0=Math.round),y0}var w0,iw;function Ev(){return iw||(iw=1,w0=Number.isNaN||function(t){return t!==t}),w0}var b0,sw;function HE(){if(sw)return b0;sw=1;var n=Ev();return b0=function(e){return n(e)||e===0?e:e<0?-1:1},b0}var S0,ow;function _c(){return ow||(ow=1,S0=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 o in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(t,e);if(l.value!==i||l.enumerable!==!0)return!1}return!0}),S0}var _0,aw;function kv(){if(aw)return _0;aw=1;var n=typeof Symbol<"u"&&Symbol,t=_c();return _0=function(){return typeof n!="function"||typeof Symbol!="function"||typeof n("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},_0}var A0,lw;function r6(){return lw||(lw=1,A0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),A0}var E0,cw;function i6(){if(cw)return E0;cw=1;var n=_v();return E0=n.getPrototypeOf||null,E0}var k0,uw;function ZE(){if(uw)return k0;uw=1;var n="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,e=Math.max,r="[object Function]",i=function(c,u){for(var f=[],p=0;p<c.length;p+=1)f[p]=c[p];for(var y=0;y<u.length;y+=1)f[y+c.length]=u[y];return f},o=function(c,u){for(var f=[],p=u,y=0;p<c.length;p+=1,y+=1)f[y]=c[p];return f},a=function(l,c){for(var u="",f=0;f<l.length;f+=1)u+=l[f],f+1<l.length&&(u+=c);return u};return k0=function(c){var u=this;if(typeof u!="function"||t.apply(u)!==r)throw new TypeError(n+u);for(var f=o(arguments,1),p,y=function(){if(this instanceof p){var H=u.apply(this,i(f,arguments));return Object(H)===H?H:this}return u.apply(c,i(f,arguments))},v=e(0,u.length-f.length),S=[],_=0;_<v;_++)S[_]="$"+_;if(p=Function("binder","return function ("+a(S,",")+"){ return binder.apply(this,arguments); }")(y),u.prototype){var R=function(){};R.prototype=u.prototype,p.prototype=new R,R.prototype=null}return p},k0}var T0,hw;function Xh(){if(hw)return T0;hw=1;var n=ZE();return T0=Function.prototype.bind||n,T0}var C0,dw;function Tv(){return dw||(dw=1,C0=Function.prototype.call),C0}var R0,fw;function Cv(){return fw||(fw=1,R0=Function.prototype.apply),R0}var I0,pw;function UE(){return pw||(pw=1,I0=typeof Reflect<"u"&&Reflect&&Reflect.apply),I0}var $0,mw;function s6(){if(mw)return $0;mw=1;var n=Xh(),t=Cv(),e=Tv(),r=UE();return $0=r||n.call(e,t),$0}var x0,gw;function Ap(){if(gw)return x0;gw=1;var n=Xh(),t=pe(),e=Tv(),r=s6();return x0=function(o){if(o.length<1||typeof o[0]!="function")throw new t("a function is required");return r(n,e,o)},x0}var P0,vw;function qE(){if(vw)return P0;vw=1;var n=Ap(),t=Sc(),e;try{e=[].__proto__===Array.prototype}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var r=!!e&&t&&t(Object.prototype,"__proto__"),i=Object,o=i.getPrototypeOf;return P0=r&&typeof r.get=="function"?n([r.get]):typeof o=="function"?function(l){return o(l==null?l:i(l))}:!1,P0}var D0,yw;function o6(){if(yw)return D0;yw=1;var n=r6(),t=i6(),e=qE();return D0=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,D0}var O0,ww;function Mi(){if(ww)return O0;ww=1;var n=Function.prototype.call,t=Object.prototype.hasOwnProperty,e=Xh();return O0=e.call(n,t),O0}var L0,bw;function On(){if(bw)return L0;bw=1;var n,t=_v(),e=n6(),r=$E(),i=xE(),o=Av(),a=Oi(),l=pe(),c=PE(),u=DE(),f=OE(),p=LE(),y=ME(),v=NE(),S=zE(),_=HE(),R=Function,H=function(Et){try{return R('"use strict"; return ('+Et+").constructor;")()}catch{}},P=Sc(),N=Kh(),D=function(){throw new l},B=P?(function(){try{return arguments.callee,D}catch{try{return P(arguments,"callee").get}catch{return D}}})():D,q=kv()(),F=o6(),Q=i6(),K=r6(),he=Cv(),le=Tv(),Ae={},at=typeof Uint8Array>"u"||!F?n:F(Uint8Array),se={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?n:ArrayBuffer,"%ArrayIteratorPrototype%":q&&F?F([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":Ae,"%AsyncGenerator%":Ae,"%AsyncGeneratorFunction%":Ae,"%AsyncIteratorPrototype%":Ae,"%Atomics%":typeof Atomics>"u"?n:Atomics,"%BigInt%":typeof BigInt>"u"?n:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?n:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":e,"%eval%":eval,"%EvalError%":r,"%Float16Array%":typeof Float16Array>"u"?n:Float16Array,"%Float32Array%":typeof Float32Array>"u"?n:Float32Array,"%Float64Array%":typeof Float64Array>"u"?n:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?n:FinalizationRegistry,"%Function%":R,"%GeneratorFunction%":Ae,"%Int8Array%":typeof Int8Array>"u"?n:Int8Array,"%Int16Array%":typeof Int16Array>"u"?n:Int16Array,"%Int32Array%":typeof Int32Array>"u"?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":q&&F?F(F([][Symbol.iterator]())):n,"%JSON%":typeof JSON=="object"?JSON:n,"%Map%":typeof Map>"u"?n:Map,"%MapIteratorPrototype%":typeof Map>"u"||!q||!F?n:F(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":P,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?n:Promise,"%Proxy%":typeof Proxy>"u"?n:Proxy,"%RangeError%":i,"%ReferenceError%":o,"%Reflect%":typeof Reflect>"u"?n:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?n:Set,"%SetIteratorPrototype%":typeof Set>"u"||!q||!F?n:F(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":q&&F?F(""[Symbol.iterator]()):n,"%Symbol%":q?Symbol:n,"%SyntaxError%":a,"%ThrowTypeError%":B,"%TypedArray%":at,"%TypeError%":l,"%Uint8Array%":typeof Uint8Array>"u"?n:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?n:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?n:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?n:Uint32Array,"%URIError%":c,"%WeakMap%":typeof WeakMap>"u"?n:WeakMap,"%WeakRef%":typeof WeakRef>"u"?n:WeakRef,"%WeakSet%":typeof WeakSet>"u"?n:WeakSet,"%Function.prototype.call%":le,"%Function.prototype.apply%":he,"%Object.defineProperty%":N,"%Object.getPrototypeOf%":Q,"%Math.abs%":u,"%Math.floor%":f,"%Math.max%":p,"%Math.min%":y,"%Math.pow%":v,"%Math.round%":S,"%Math.sign%":_,"%Reflect.getPrototypeOf%":K};if(F)try{null.error}catch(Et){var Pe=F(F(Et));se["%Error.prototype%"]=Pe}var pt=function Et($e){var je;if($e==="%AsyncFunction%")je=H("async function () {}");else if($e==="%GeneratorFunction%")je=H("function* () {}");else if($e==="%AsyncGeneratorFunction%")je=H("async function* () {}");else if($e==="%AsyncGenerator%"){var Oe=Et("%AsyncGeneratorFunction%");Oe&&(je=Oe.prototype)}else if($e==="%AsyncIteratorPrototype%"){var Ge=Et("%AsyncGenerator%");Ge&&F&&(je=F(Ge.prototype))}return se[$e]=je,je},Nn={__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"]},mt=Xh(),At=Mi(),Gs=mt.call(le,Array.prototype.concat),Ra=mt.call(he,Array.prototype.splice),Js=mt.call(le,String.prototype.replace),Ni=mt.call(le,String.prototype.slice),Te=mt.call(le,RegExp.prototype.exec),Dc=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,zn=/\\(\\)?/g,Ys=function($e){var je=Ni($e,0,1),Oe=Ni($e,-1);if(je==="%"&&Oe!=="%")throw new a("invalid intrinsic syntax, expected closing `%`");if(Oe==="%"&&je!=="%")throw new a("invalid intrinsic syntax, expected opening `%`");var Ge=[];return Js($e,Dc,function(ue,vn,ae,lt){Ge[Ge.length]=ae?Js(lt,zn,"$1"):vn||ue}),Ge},Oc=function($e,je){var Oe=$e,Ge;if(At(Nn,Oe)&&(Ge=Nn[Oe],Oe="%"+Ge[0]+"%"),At(se,Oe)){var ue=se[Oe];if(ue===Ae&&(ue=pt(Oe)),typeof ue>"u"&&!je)throw new l("intrinsic "+$e+" exists, but is not available. Please file an issue!");return{alias:Ge,name:Oe,value:ue}}throw new a("intrinsic "+$e+" does not exist!")};return L0=function($e,je){if(typeof $e!="string"||$e.length===0)throw new l("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof je!="boolean")throw new l('"allowMissing" argument must be a boolean');if(Te(/^%?[^%]*%?$/,$e)===null)throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Oe=Ys($e),Ge=Oe.length>0?Oe[0]:"",ue=Oc("%"+Ge+"%",je),vn=ue.name,ae=ue.value,lt=!1,He=ue.alias;He&&(Ge=He[0],Ra(Oe,Gs([0,1],He)));for(var yn=1,Hn=!0;yn<Oe.length;yn+=1){var Je=Oe[yn],Hr=Ni(Je,0,1),rr=Ni(Je,-1);if((Hr==='"'||Hr==="'"||Hr==="`"||rr==='"'||rr==="'"||rr==="`")&&Hr!==rr)throw new a("property names with quotes must have matching quotes");if((Je==="constructor"||!Hn)&&(lt=!0),Ge+="."+Je,vn="%"+Ge+"%",At(se,vn))ae=se[vn];else if(ae!=null){if(!(Je in ae)){if(!je)throw new l("base intrinsic for "+$e+" exists, but the property is not available.");return}if(P&&yn+1>=Oe.length){var Zr=P(ae,Je);Hn=!!Zr,Hn&&"get"in Zr&&!("originalValue"in Zr.get)?ae=Zr.get:ae=ae[Je]}else Hn=At(ae,Je),ae=ae[Je];Hn&&!lt&&(se[vn]=ae)}}return ae},L0}var M0,Sw;function Bs(){if(Sw)return M0;Sw=1;var n=On(),t=Ap(),e=t([n("%String.prototype.indexOf%")]);return M0=function(i,o){var a=n(i,!!o);return typeof a=="function"&&e(i,".prototype.")>-1?t([a]):a},M0}var N0,_w;function Rv(){if(_w)return N0;_w=1;var n=On(),t=n("%Array%"),e=!t.isArray&&Bs()("Object.prototype.toString");return N0=t.isArray||function(i){return e(i)==="[object Array]"},N0}var z0,Aw;function Iv(){if(Aw)return z0;Aw=1;var n=_p(),t=Kh(),e=n.hasArrayLengthDefineBug(),r=e&&Rv(),i=Bs(),o=i("Object.prototype.propertyIsEnumerable");return z0=function(l,c,u,f,p,y){if(!t){if(!l(y)||!y["[[Configurable]]"]||!y["[[Writable]]"]||p in f&&o(f,p)!==!!y["[[Enumerable]]"])return!1;var v=y["[[Value]]"];return f[p]=v,c(f[p],v)}return e&&p==="length"&&"[[Value]]"in y&&r(f)&&f.length!==y["[[Value]]"]?(f.length=y["[[Value]]"],f.length===y["[[Value]]"]):(t(f,p,u(y)),!0)},z0}var H0,Ew;function Ac(){if(Ew)return H0;Ew=1;var n=pe(),t=Mi(),e={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return H0=function(i){if(!i||typeof i!="object")return!1;for(var o in i)if(t(i,o)&&!e[o])return!1;var a=t(i,"[[Value]]")||t(i,"[[Writable]]"),l=t(i,"[[Get]]")||t(i,"[[Set]]");if(a&&l)throw new n("Property Descriptors may not be both accessor and data descriptors");return!0},H0}var Z0,kw;function a6(){return kw||(kw=1,Z0=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}),Z0}var U0,Tw;function l6(){if(Tw)return U0;Tw=1;var n=pe(),t=Ac(),e=a6();return U0=function(i){if(typeof i<"u"&&!t(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return e(i)},U0}var q0,Cw;function c6(){if(Cw)return q0;Cw=1;var n=pe(),t=Mi(),e=Ac();return q0=function(i){if(typeof i>"u")return!1;if(!e(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!t(i,"[[Value]]")&&!t(i,"[[Writable]]"))},q0}var F0,Rw;function Ec(){return Rw||(Rw=1,F0=function(t){return typeof t=="string"||typeof t=="symbol"}),F0}var V0,Iw;function u6(){if(Iw)return V0;Iw=1;var n=Ev();return V0=function(e,r){return e===r?e===0?1/e===1/r:!0:n(e)&&n(r)},V0}var B0,$w;function $v(){if($w)return B0;$w=1;var n=pe(),t=Li(),e=Iv(),r=l6(),i=c6(),o=Ec(),a=u6();return B0=function(c,u,f){if(!t(c))throw new n("Assertion failed: Type(O) is not Object");if(!o(u))throw new n("Assertion failed: P is not a Property Key");var p={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":f,"[[Writable]]":!0};return e(i,a,r,c,u,p)},B0}var j0,xw;function h6(){if(xw)return j0;xw=1;var n=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,e,r;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{e=Object.defineProperty({},"length",{get:function(){throw r}}),r={},t(function(){throw 42},null,e)}catch(P){P!==r&&(t=null)}else t=null;var i=/^\s*class\b/,o=function(N){try{var D=n.call(N);return i.test(D)}catch{return!1}},a=function(N){try{return o(N)?!1:(n.call(N),!0)}catch{return!1}},l=Object.prototype.toString,c="[object Object]",u="[object Function]",f="[object GeneratorFunction]",p="[object HTMLAllCollection]",y="[object HTML document.all class]",v="[object HTMLCollection]",S=typeof Symbol=="function"&&!!Symbol.toStringTag,_=!(0 in[,]),R=function(){return!1};if(typeof document=="object"){var H=document.all;l.call(H)===l.call(document.all)&&(R=function(N){if((_||!N)&&(typeof N>"u"||typeof N=="object"))try{var D=l.call(N);return(D===p||D===y||D===v||D===c)&&N("")==null}catch{}return!1})}return j0=t?function(N){if(R(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;try{t(N,null,e)}catch(D){if(D!==r)return!1}return!o(N)&&a(N)}:function(N){if(R(N))return!0;if(!N||typeof N!="function"&&typeof N!="object")return!1;if(S)return a(N);if(o(N))return!1;var D=l.call(N);return D!==u&&D!==f&&!/^\[object HTML/.test(D)?!1:a(N)},j0}var W0,Pw;function FE(){return Pw||(Pw=1,W0=h6()),W0}var G0,Dw;function VE(){return Dw||(Dw=1,G0=function(t){return!!t}),G0}var J0,Ow;function BE(){if(Ow)return J0;Ow=1;var n=Mi(),t=pe(),e=Li(),r=FE(),i=VE();return J0=function(a){if(!e(a))throw new t("ToPropertyDescriptor requires an object");var l={};if(n(a,"enumerable")&&(l["[[Enumerable]]"]=i(a.enumerable)),n(a,"configurable")&&(l["[[Configurable]]"]=i(a.configurable)),n(a,"value")&&(l["[[Value]]"]=a.value),n(a,"writable")&&(l["[[Writable]]"]=i(a.writable)),n(a,"get")){var c=a.get;if(typeof c<"u"&&!r(c))throw new t("getter must be a function");l["[[Get]]"]=c}if(n(a,"set")){var u=a.set;if(typeof u<"u"&&!r(u))throw new t("setter must be a function");l["[[Set]]"]=u}if((n(l,"[[Get]]")||n(l,"[[Set]]"))&&(n(l,"[[Value]]")||n(l,"[[Writable]]")))throw new t("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return l},J0}var Y0,Lw;function jE(){if(Lw)return Y0;Lw=1;var n=pe(),t=Li(),e=Ac(),r=Iv(),i=l6(),o=c6(),a=Ec(),l=u6(),c=BE();return Y0=function(f,p,y){if(!t(f))throw new n("Assertion failed: Type(O) is not Object");if(!a(p))throw new n("Assertion failed: P is not a Property Key");var v=e(y)?y:c(y);if(!e(v))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return r(o,l,i,f,p,v)},Y0}var K0,Mw;function WE(){if(Mw)return K0;Mw=1;var n=pe(),t=Li(),e=jE(),r=Ec();return K0=function(o,a,l){if(!t(o))throw new n("Assertion failed: Type(O) is not Object");if(!r(a))throw new n("Assertion failed: P is not a Property Key");var c={"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Value]]":l,"[[Writable]]":!0};return e(o,a,c)},K0}var X0,Nw;function GE(){return Nw||(Nw=1,X0=typeof Reflect<"u"&&Reflect.setPrototypeOf||null),X0}var Q0,zw;function JE(){if(zw)return Q0;zw=1;var n=_v();return Q0=n.setPrototypeOf||null,Q0}var em,Hw;function YE(){if(Hw)return em;Hw=1;var n=Ap(),t=Sc(),e=pe(),r={};try{r.__proto__=null}catch(a){if(!a||typeof a!="object"||!("code"in a)||a.code!=="ERR_PROTO_ACCESS")throw a}var i=!("toString"in r),o=t&&t(Object.prototype,"__proto__");return em=i&&(!!o&&typeof o.set=="function"&&n([o.set])||function(l,c){if(l==null)throw new e("set Object.prototype.__proto__ called on null or undefined");return l.__proto__=c,c}),em}var tm,Zw;function KE(){if(Zw)return tm;Zw=1;var n=GE(),t=JE(),e=YE(),r=pe();return tm=n?function(o,a){if(n(o,a))return o;throw new r("Reflect.setPrototypeOf: failed to set [[Prototype]]")}:t||(e?function(o,a){return e(o,a),o}:null),tm}var nm,Uw;function XE(){if(Uw)return nm;Uw=1;var n=pe(),t=Li(),e=o6();return nm=function(i){if(!t(i))throw new n("Assertion failed: O must be an Object");if(!e)throw new n("This environment does not support fetching prototypes.");return e(i)},nm}var rm,qw;function QE(){if(qw)return rm;qw=1;var n=pe(),t=KE(),e=Li(),r=XE();return rm=function(o,a){if(a!==null&&!e(a))throw new n("Assertion failed: V must be Object or Null");try{t(o,a)}catch{return!1}return r(o)===a},rm}var im,Fw;function ek(){if(Fw)return im;Fw=1;var n=$v(),t=WE(),e=QE(),r=_p()(),i=n6();function o(l,c,u){var f=new i(u);return e(f,a),delete f.constructor,t(f,"error",l),t(f,"suppressed",c),f}r&&Object.defineProperty(o,"prototype",{writable:!1});var a=o.prototype;if(!n(a,"constructor",o)||!n(a,"message","")||!n(a,"name","SuppressedError"))throw new i("unable to install SuppressedError.prototype properties; please report this!");return e(o.prototype,i.prototype),im=o,im}var sm,Vw;function d6(){if(Vw)return sm;Vw=1;var n=ek();return sm=function(){return typeof SuppressedError=="function"?SuppressedError:n},sm}var om,Bw;function tk(){if(Bw)return om;Bw=1;var n=Ea(),t=Sv()(),e=d6();return om=function(){var i=e();return n(t,{SuppressedError:i},{SuppressedError:function(){return t.SuppressedError!==i}}),i},om}var jw;function nk(){return jw||(jw=1,tk()()),Iy}var am,Ww;function rk(){if(Ww)return am;Ww=1;var n=pe(),t=Ac(),e=a6();return am=function(i){if(typeof i<"u"&&!t(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return e(i)},am}var lm,Gw;function ik(){if(Gw)return lm;Gw=1;var n=pe(),t=Mi(),e=Ac();return lm=function(i){if(typeof i>"u")return!1;if(!e(i))throw new n("Assertion failed: `Desc` must be a Property Descriptor");return!(!t(i,"[[Value]]")&&!t(i,"[[Writable]]"))},lm}var cm,Jw;function sk(){if(Jw)return cm;Jw=1;var n=Ev();return cm=function(e,r){return e===r?e===0?1/e===1/r:!0:n(e)&&n(r)},cm}var um,Yw;function kc(){return Yw||(Yw=1,um=h6()),um}var hm,Kw;function ok(){return Kw||(Kw=1,hm=function(t){return!!t}),hm}var dm,Xw;function ak(){if(Xw)return dm;Xw=1;var n=Mi(),t=pe(),e=Li(),r=kc(),i=ok();return dm=function(a){if(!e(a))throw new t("ToPropertyDescriptor requires an object");var l={};if(n(a,"enumerable")&&(l["[[Enumerable]]"]=i(a.enumerable)),n(a,"configurable")&&(l["[[Configurable]]"]=i(a.configurable)),n(a,"value")&&(l["[[Value]]"]=a.value),n(a,"writable")&&(l["[[Writable]]"]=i(a.writable)),n(a,"get")){var c=a.get;if(typeof c<"u"&&!r(c))throw new t("getter must be a function");l["[[Get]]"]=c}if(n(a,"set")){var u=a.set;if(typeof u<"u"&&!r(u))throw new t("setter must be a function");l["[[Set]]"]=u}if((n(l,"[[Get]]")||n(l,"[[Set]]"))&&(n(l,"[[Value]]")||n(l,"[[Writable]]")))throw new t("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return l},dm}var fm,Qw;function Qh(){if(Qw)return fm;Qw=1;var n=pe(),t=Li(),e=Ac(),r=Iv(),i=rk(),o=ik(),a=Ec(),l=sk(),c=ak();return fm=function(f,p,y){if(!t(f))throw new n("Assertion failed: Type(O) is not Object");if(!a(p))throw new n("Assertion failed: P is not a Property Key");var v=e(y)?y:c(y);if(!e(v))throw new n("Assertion failed: Desc is not a valid Property Descriptor");return r(o,l,i,f,p,v)},fm}var pm,e2;function lk(){if(e2)return pm;e2=1;var n=_c()();return pm=n?Symbol.dispose||Symbol("Symbol.dispose"):null,pm}var mm,t2;function xv(){if(t2)return mm;t2=1;var n=_c(),t=lk();return mm=function(){return n()&&Symbol.dispose||t},mm}var gm,n2;function ck(){if(n2)return gm;n2=1;var n=kv(),t=Qh(),e=xv();return gm=function(){var i=e();return n()&&t(Symbol,"dispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":i}),i},gm}var vm,r2;function uk(){if(r2)return vm;r2=1;var n=_c()();return vm=n?Symbol.asyncDispose||Symbol("Symbol.asyncDispose"):null,vm}var ym,i2;function Pv(){if(i2)return ym;i2=1;var n=_c(),t=uk();return ym=function(){return n()&&Symbol.asyncDispose||t},ym}var wm,s2;function hk(){if(s2)return wm;s2=1;var n=kv(),t=Qh(),e=Pv();return wm=function(){var i=e();return n()&&t(Symbol,"asyncDispose",{"[[Configurable]]":!1,"[[Enumerable]]":!1,"[[Writable]]":!1,"[[Value]]":i}),i},wm}var bm,o2;function dk(){return o2||(o2=1,bm=Rv()),bm}var Sm,a2;function Ep(){if(a2)return Sm;a2=1;var n=On(),t=Bs(),e=pe(),r=dk(),i=n("%Reflect.apply%",!0)||t("Function.prototype.apply");return Sm=function(a,l){var c=arguments.length>2?arguments[2]:[];if(!r(c))throw new e("Assertion failed: optional `argumentsList`, if provided, must be a List");return i(a,l,c)},Sm}const fk={},pk=Object.freeze(Object.defineProperty({__proto__:null,default:fk},Symbol.toStringTag,{value:"Module"})),mk=kE(pk);var _m,l2;function Tc(){if(l2)return _m;l2=1;var n=typeof Map=="function"&&Map.prototype,t=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,e=n&&t&&typeof t.get=="function"?t.get:null,r=n&&Map.prototype.forEach,i=typeof Set=="function"&&Set.prototype,o=Object.getOwnPropertyDescriptor&&i?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,a=i&&o&&typeof o.get=="function"?o.get:null,l=i&&Set.prototype.forEach,c=typeof WeakMap=="function"&&WeakMap.prototype,u=c?WeakMap.prototype.has:null,f=typeof WeakSet=="function"&&WeakSet.prototype,p=f?WeakSet.prototype.has:null,y=typeof WeakRef=="function"&&WeakRef.prototype,v=y?WeakRef.prototype.deref:null,S=Boolean.prototype.valueOf,_=Object.prototype.toString,R=Function.prototype.toString,H=String.prototype.match,P=String.prototype.slice,N=String.prototype.replace,D=String.prototype.toUpperCase,B=String.prototype.toLowerCase,q=RegExp.prototype.test,F=Array.prototype.concat,Q=Array.prototype.join,K=Array.prototype.slice,he=Math.floor,le=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ae=Object.getOwnPropertySymbols,at=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,se=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Pe=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===se||!0)?Symbol.toStringTag:null,pt=Object.prototype.propertyIsEnumerable,Nn=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(k){return k.__proto__}:null);function mt(k,C){if(k===1/0||k===-1/0||k!==k||k&&k>-1e3&&k<1e3||q.call(/e/,C))return C;var me=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof k=="number"){var Ee=k<0?-he(-k):he(k);if(Ee!==k){var Ce=String(Ee),ne=P.call(C,Ce.length+1);return N.call(Ce,me,"$&_")+"."+N.call(N.call(ne,/([0-9]{3})/g,"$&_"),/_$/,"")}}return N.call(C,me,"$&_")}var At=mk,Gs=At.custom,Ra=ue(Gs)?Gs:null,Js={__proto__:null,double:'"',single:"'"},Ni={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};_m=function k(C,me,Ee,Ce){var ne=me||{};if(lt(ne,"quoteStyle")&&!lt(Js,ne.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lt(ne,"maxStringLength")&&(typeof ne.maxStringLength=="number"?ne.maxStringLength<0&&ne.maxStringLength!==1/0:ne.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var kt=lt(ne,"customInspect")?ne.customInspect:!0;if(typeof kt!="boolean"&&kt!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lt(ne,"indent")&&ne.indent!==null&&ne.indent!==" "&&!(parseInt(ne.indent,10)===ne.indent&&ne.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lt(ne,"numericSeparator")&&typeof ne.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var or=ne.numericSeparator;if(typeof C>"u")return"undefined";if(C===null)return"null";if(typeof C=="boolean")return C?"true":"false";if(typeof C=="string")return sr(C,ne);if(typeof C=="number"){if(C===0)return 1/0/C>0?"0":"-0";var gt=String(C);return or?mt(C,gt):gt}if(typeof C=="bigint"){var Zn=String(C)+"n";return or?mt(C,Zn):Zn}var Ia=typeof ne.depth>"u"?5:ne.depth;if(typeof Ee>"u"&&(Ee=0),Ee>=Ia&&Ia>0&&typeof C=="object")return Ys(C)?"[Array]":"[Object]";var Vr=Hi(ne,Ee);if(typeof Ce>"u")Ce=[];else if(Hn(Ce,C)>=0)return"[Circular]";function vt(qi,to,Hc){if(to&&(Ce=K.call(Ce),Ce.push(to)),Hc){var Zc={depth:ne.depth};return lt(ne,"quoteStyle")&&(Zc.quoteStyle=ne.quoteStyle),k(qi,Zc,Ee+1,Ce)}return k(qi,ne,Ee+1,Ce)}if(typeof C=="function"&&!Et(C)){var Xs=yn(C),en=Fr(C,vt);return"[Function"+(Xs?": "+Xs:" (anonymous)")+"]"+(en.length>0?" { "+Q.call(en,", ")+" }":"")}if(ue(C)){var Br=se?N.call(String(C),/^(Symbol\(.*\))_[^)]*$/,"$1"):at.call(C);return typeof C=="object"&&!se?qr(Br):Br}if(ir(C)){for(var jr="<"+B.call(String(C.nodeName)),Qs=C.attributes||[],$a=0;$a<Qs.length;$a++)jr+=" "+Qs[$a].name+"="+Te(Dc(Qs[$a].value),"double",ne);return jr+=">",C.childNodes&&C.childNodes.length&&(jr+="..."),jr+="</"+B.call(String(C.nodeName))+">",jr}if(Ys(C)){if(C.length===0)return"[]";var xa=Fr(C,vt);return Vr&&!Lc(xa)?"["+Zi(xa,Vr)+"]":"[ "+Q.call(xa,", ")+" ]"}if($e(C)){var eo=Fr(C,vt);return!("cause"in Error.prototype)&&"cause"in C&&!pt.call(C,"cause")?"{ ["+String(C)+"] "+Q.call(F.call("[cause]: "+vt(C.cause),eo),", ")+" }":eo.length===0?"["+String(C)+"]":"{ ["+String(C)+"] "+Q.call(eo,", ")+" }"}if(typeof C=="object"&&kt){if(Ra&&typeof C[Ra]=="function"&&At)return At(C,{depth:Ia-Ee});if(kt!=="symbol"&&typeof C.inspect=="function")return C.inspect()}if(Je(C)){var Mc=[];return r&&r.call(C,function(qi,to){Mc.push(vt(to,C,!0)+" => "+vt(qi,C))}),Ks("Map",e.call(C),Mc,Vr)}if(Zr(C)){var Pa=[];return l&&l.call(C,function(qi){Pa.push(vt(qi,C))}),Ks("Set",a.call(C),Pa,Vr)}if(Hr(C))return zi("WeakMap");if(id(C))return zi("WeakSet");if(rr(C))return zi("WeakRef");if(Oe(C))return qr(vt(Number(C)));if(vn(C))return qr(vt(le.call(C)));if(Ge(C))return qr(S.call(C));if(je(C))return qr(vt(String(C)));if(typeof window<"u"&&C===window)return"{ [object Window] }";if(typeof globalThis<"u"&&C===globalThis||typeof po<"u"&&C===po)return"{ [object globalThis] }";if(!Oc(C)&&!Et(C)){var Nc=Fr(C,vt),Ui=Nn?Nn(C)===Object.prototype:C instanceof Object||C.constructor===Object,zc=C instanceof Object?"":"null prototype",sd=!Ui&&Pe&&Object(C)===C&&Pe in C?P.call(He(C),8,-1):zc?"Object":"",Ze=Ui||typeof C.constructor!="function"?"":C.constructor.name?C.constructor.name+" ":"",ar=Ze+(sd||zc?"["+Q.call(F.call([],sd||[],zc||[]),": ")+"] ":"");return Nc.length===0?ar+"{}":Vr?ar+"{"+Zi(Nc,Vr)+"}":ar+"{ "+Q.call(Nc,", ")+" }"}return String(C)};function Te(k,C,me){var Ee=me.quoteStyle||C,Ce=Js[Ee];return Ce+k+Ce}function Dc(k){return N.call(String(k),/"/g,""")}function zn(k){return!Pe||!(typeof k=="object"&&(Pe in k||typeof k[Pe]<"u"))}function Ys(k){return He(k)==="[object Array]"&&zn(k)}function Oc(k){return He(k)==="[object Date]"&&zn(k)}function Et(k){return He(k)==="[object RegExp]"&&zn(k)}function $e(k){return He(k)==="[object Error]"&&zn(k)}function je(k){return He(k)==="[object String]"&&zn(k)}function Oe(k){return He(k)==="[object Number]"&&zn(k)}function Ge(k){return He(k)==="[object Boolean]"&&zn(k)}function ue(k){if(se)return k&&typeof k=="object"&&k instanceof Symbol;if(typeof k=="symbol")return!0;if(!k||typeof k!="object"||!at)return!1;try{return at.call(k),!0}catch{}return!1}function vn(k){if(!k||typeof k!="object"||!le)return!1;try{return le.call(k),!0}catch{}return!1}var ae=Object.prototype.hasOwnProperty||function(k){return k in this};function lt(k,C){return ae.call(k,C)}function He(k){return _.call(k)}function yn(k){if(k.name)return k.name;var C=H.call(R.call(k),/^function\s*([\w$]+)/);return C?C[1]:null}function Hn(k,C){if(k.indexOf)return k.indexOf(C);for(var me=0,Ee=k.length;me<Ee;me++)if(k[me]===C)return me;return-1}function Je(k){if(!e||!k||typeof k!="object")return!1;try{e.call(k);try{a.call(k)}catch{return!0}return k instanceof Map}catch{}return!1}function Hr(k){if(!u||!k||typeof k!="object")return!1;try{u.call(k,u);try{p.call(k,p)}catch{return!0}return k instanceof WeakMap}catch{}return!1}function rr(k){if(!v||!k||typeof k!="object")return!1;try{return v.call(k),!0}catch{}return!1}function Zr(k){if(!a||!k||typeof k!="object")return!1;try{a.call(k);try{e.call(k)}catch{return!0}return k instanceof Set}catch{}return!1}function id(k){if(!p||!k||typeof k!="object")return!1;try{p.call(k,p);try{u.call(k,u)}catch{return!0}return k instanceof WeakSet}catch{}return!1}function ir(k){return!k||typeof k!="object"?!1:typeof HTMLElement<"u"&&k instanceof HTMLElement?!0:typeof k.nodeName=="string"&&typeof k.getAttribute=="function"}function sr(k,C){if(k.length>C.maxStringLength){var me=k.length-C.maxStringLength,Ee="... "+me+" more character"+(me>1?"s":"");return sr(P.call(k,0,C.maxStringLength),C)+Ee}var Ce=Ni[C.quoteStyle||"single"];Ce.lastIndex=0;var ne=N.call(N.call(k,Ce,"\\$1"),/[\x00-\x1f]/g,Ur);return Te(ne,"single",C)}function Ur(k){var C=k.charCodeAt(0),me={8:"b",9:"t",10:"n",12:"f",13:"r"}[C];return me?"\\"+me:"\\x"+(C<16?"0":"")+D.call(C.toString(16))}function qr(k){return"Object("+k+")"}function zi(k){return k+" { ? }"}function Ks(k,C,me,Ee){var Ce=Ee?Zi(me,Ee):Q.call(me,", ");return k+" ("+C+") {"+Ce+"}"}function Lc(k){for(var C=0;C<k.length;C++)if(Hn(k[C],`
|
|
2
|
+
`)>=0)return!1;return!0}function Hi(k,C){var me;if(k.indent===" ")me=" ";else if(typeof k.indent=="number"&&k.indent>0)me=Q.call(Array(k.indent+1)," ");else return null;return{base:me,prev:Q.call(Array(C+1),me)}}function Zi(k,C){if(k.length===0)return"";var me=`
|
|
3
|
+
`+C.prev+C.base;return me+Q.call(k,","+me)+`
|
|
4
|
+
`+C.prev}function Fr(k,C){var me=Ys(k),Ee=[];if(me){Ee.length=k.length;for(var Ce=0;Ce<k.length;Ce++)Ee[Ce]=lt(k,Ce)?C(k[Ce],k):""}var ne=typeof Ae=="function"?Ae(k):[],kt;if(se){kt={};for(var or=0;or<ne.length;or++)kt["$"+ne[or]]=ne[or]}for(var gt in k)lt(k,gt)&&(me&&String(Number(gt))===gt&><k.length||se&&kt["$"+gt]instanceof Symbol||(q.call(/[^\w$]/,gt)?Ee.push(C(gt,k)+": "+C(k[gt],k)):Ee.push(gt+": "+C(k[gt],k))));if(typeof Ae=="function")for(var Zn=0;Zn<ne.length;Zn++)pt.call(k,ne[Zn])&&Ee.push("["+C(ne[Zn])+"]: "+C(k[ne[Zn]],k));return Ee}return _m}var Am,c2;function gk(){if(c2)return Am;c2=1;var n=Tc(),t=pe(),e=function(l,c,u){for(var f=l,p;(p=f.next)!=null;f=p)if(p.key===c)return f.next=p.next,u||(p.next=l.next,l.next=p),p},r=function(l,c){if(l){var u=e(l,c);return u&&u.value}},i=function(l,c,u){var f=e(l,c);f?f.value=u:l.next={key:c,next:l.next,value:u}},o=function(l,c){return l?!!e(l,c):!1},a=function(l,c){if(l)return e(l,c,!0)};return Am=function(){var c,u={assert:function(f){if(!u.has(f))throw new t("Side channel does not contain "+n(f))},delete:function(f){var p=a(c,f);return p&&c&&!c.next&&(c=void 0),!!p},get:function(f){return r(c,f)},has:function(f){return o(c,f)},set:function(f,p){c||(c={next:void 0}),i(c,f,p)}};return u},Am}var Em,u2;function f6(){if(u2)return Em;u2=1;var n=On(),t=Bs(),e=Tc(),r=pe(),i=n("%Map%",!0),o=t("Map.prototype.get",!0),a=t("Map.prototype.set",!0),l=t("Map.prototype.has",!0),c=t("Map.prototype.delete",!0),u=t("Map.prototype.size",!0);return Em=!!i&&function(){var p,y={assert:function(v){if(!y.has(v))throw new r("Side channel does not contain "+e(v))},delete:function(v){if(p){var S=c(p,v);return u(p)===0&&(p=void 0),S}return!1},get:function(v){if(p)return o(p,v)},has:function(v){return p?l(p,v):!1},set:function(v,S){p||(p=new i),a(p,v,S)}};return y},Em}var km,h2;function vk(){if(h2)return km;h2=1;var n=On(),t=Bs(),e=Tc(),r=f6(),i=pe(),o=n("%WeakMap%",!0),a=t("WeakMap.prototype.get",!0),l=t("WeakMap.prototype.set",!0),c=t("WeakMap.prototype.has",!0),u=t("WeakMap.prototype.delete",!0);return km=o?function(){var p,y,v={assert:function(S){if(!v.has(S))throw new i("Side channel does not contain "+e(S))},delete:function(S){if(o&&S&&(typeof S=="object"||typeof S=="function")){if(p)return u(p,S)}else if(r&&y)return y.delete(S);return!1},get:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&p?a(p,S):y&&y.get(S)},has:function(S){return o&&S&&(typeof S=="object"||typeof S=="function")&&p?c(p,S):!!y&&y.has(S)},set:function(S,_){o&&S&&(typeof S=="object"||typeof S=="function")?(p||(p=new o),l(p,S,_)):r&&(y||(y=r()),y.set(S,_))}};return v}:r,km}var Tm,d2;function yk(){if(d2)return Tm;d2=1;var n=pe(),t=Tc(),e=gk(),r=f6(),i=vk(),o=i||r||e;return Tm=function(){var l,c={assert:function(u){if(!c.has(u)){var f=u&&Object(u)===u?"the given object key":t(u);throw new n("Side channel does not contain "+f)}},delete:function(u){return!!l&&l.delete(u)},get:function(u){return l&&l.get(u)},has:function(u){return!!l&&l.has(u)},set:function(u,f){l||(l=o()),l.set(u,f)}};return c},Tm}var Cm,f2;function Dv(){if(f2)return Cm;f2=1;var n=Mi(),t=yk()(),e=pe(),r={assert:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");if(t.assert(i),!r.has(i,o))throw new e("`"+o+"` is not present on `O`")},get:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var a=t.get(i);return a&&a["$"+o]},has:function(i,o){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var a=t.get(i);return!!a&&n(a,"$"+o)},set:function(i,o,a){if(!i||typeof i!="object"&&typeof i!="function")throw new e("`O` is not an object");if(typeof o!="string")throw new e("`slot` must be a string");var l=t.get(i);l||(l={},t.set(i,l)),l["$"+o]=a}};return Object.freeze&&Object.freeze(r),Cm=r,Cm}var Rm,p2;function Ov(){if(p2)return Rm;p2=1;var n=Oi(),t=Dv(),e=function r(i,o){if(!(this instanceof r))return new r(i,o);if(i!=="normal"&&i!=="break"&&i!=="continue"&&i!=="return"&&i!=="throw")throw new n('Assertion failed: `type` must be one of "normal", "break", "continue", "return", or "throw"');t.set(this,"[[Type]]",i),t.set(this,"[[Value]]",o)};return e.prototype.type=function(){return t.get(this,"[[Type]]")},e.prototype.value=function(){return t.get(this,"[[Value]]")},e.prototype["?"]=function(){var i=t.get(this,"[[Type]]"),o=t.get(this,"[[Value]]");if(i==="throw")throw o;return o},e.prototype["!"]=function(){var i=t.get(this,"[[Type]]");if(i!=="normal")throw new n('Assertion failed: Completion Record is not of type "normal"');return t.get(this,"[[Value]]")},Rm=e,Rm}var Im,m2;function Lv(){if(m2)return Im;m2=1;var n=Ov();return Im=function(e){return new n("normal",e)},Im}var $m,g2;function wk(){if(g2)return $m;g2=1;var n=_c();return $m=function(){return n()&&!!Symbol.toStringTag},$m}var xm,v2;function p6(){if(v2)return xm;v2=1;var n=On(),t=n("%Object.defineProperty%",!0),e=wk()(),r=Mi(),i=pe(),o=e?Symbol.toStringTag:null;return xm=function(l,c){var u=arguments.length>2&&!!arguments[2]&&arguments[2].force,f=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof u<"u"&&typeof u!="boolean"||typeof f<"u"&&typeof f!="boolean")throw new i("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");o&&(u||!r(l,o))&&(t?t(l,o,{configurable:!f,enumerable:!1,value:c,writable:!1}):l[o]=c)},xm}var Pm={exports:{}},Dm,y2;function bk(){if(y2)return Dm;y2=1;var n=On(),t=Q8(),e=_p()(),r=Sc(),i=pe(),o=n("%Math.floor%");return Dm=function(l,c){if(typeof l!="function")throw new i("`fn` is not a function");if(typeof c!="number"||c<0||c>4294967295||o(c)!==c)throw new i("`length` must be a positive 32-bit integer");var u=arguments.length>2&&!!arguments[2],f=!0,p=!0;if("length"in l&&r){var y=r(l,"length");y&&!y.configurable&&(f=!1),y&&!y.writable&&(p=!1)}return(f||p||!u)&&(e?t(l,"length",c,!0,!0):t(l,"length",c)),l},Dm}var Om,w2;function Sk(){if(w2)return Om;w2=1;var n=Xh(),t=Cv(),e=s6();return Om=function(){return e(n,t,arguments)},Om}var b2;function Mv(){return b2||(b2=1,(function(n){var t=bk(),e=Kh(),r=Ap(),i=Sk();n.exports=function(a){var l=r(arguments),c=1+a.length-(arguments.length-1);return t(l,c>0?c:0,!0)},e?e(n.exports,"apply",{value:i}):n.exports.apply=i})(Pm)),Pm.exports}var Lm,S2;function _k(){return S2||(S2=1,Lm=function(t,e){for(var r=0;r<t.length;r+=1)if(!e(t[r],r,t))return!1;return!0}),Lm}var Mm,_2;function Ak(){if(_2)return Mm;_2=1;var n=Object;return Mm=function(e){return e&&typeof e=="object"&&(typeof e["[[ResourceValue]]"]>"u"||n(e["[[ResourceValue]]"])===e["[[ResourceValue]]"])&&(e["[[Hint]]"]==="SYNC-DISPOSE"||e["[[Hint]]"]==="ASYNC-DISPOSE")&&(typeof e["[[DisposeMethod]]"]=="function"||typeof e["[[DisposeMethod]]"]>"u")},Mm}var Nm,A2;function Ek(){if(A2)return Nm;A2=1;var n=Mi(),t=Rv(),e=_k(),r=Ak();return Nm=function(o){return o&&typeof o=="object"&&n(o,"[[DisposableResourceStack]]")&&t(o["[[DisposableResourceStack]]"])&&(o["[[DisposableResourceStack]]"].length===0||e(o["[[DisposableResourceStack]]"],r))},Nm}var zm,E2;function kk(){if(E2)return zm;E2=1;var n=Li();return zm=function(e){if(e===null)return"Null";if(typeof e>"u")return"Undefined";if(n(e))return"Object";if(typeof e=="number")return"Number";if(typeof e=="boolean")return"Boolean";if(typeof e=="string")return"String"},zm}var Hm,k2;function Nv(){if(k2)return Hm;k2=1;var n=kk();return Hm=function(e){return typeof e=="symbol"?"Symbol":typeof e=="bigint"?"BigInt":n(e)},Hm}var Zm,T2;function Tk(){if(T2)return Zm;T2=1;var n=pe(),t=Tc(),e=Ec();return Zm=function(i,o){if(!e(o))throw new n("Assertion failed: P is not a Property Key, got "+t(o));return i[o]},Zm}var Um,C2;function Ck(){if(C2)return Um;C2=1;var n=pe(),t=Tk(),e=kc(),r=Ec(),i=Tc();return Um=function(a,l){if(!r(l))throw new n("Assertion failed: P is not a Property Key");var c=t(a,l);if(c!=null){if(!e(c))throw new n(i(l)+" is not a function: "+i(c));return c}},Um}var dd={exports:{}},qm,R2;function Rk(){return R2||(R2=1,qm=On()),qm}var I2;function Ik(){if(I2)return dd.exports;I2=1;var n=Rk(),t=n("%Reflect.construct%",!0),e=Qh();try{e({},"",{"[[Get]]":function(){}})}catch{e=null}if(e&&t){var r={},i={};e(i,"length",{"[[Get]]":function(){throw r},"[[Enumerable]]":!0}),dd.exports=function(a){try{t(a,i)}catch(l){return l===r}}}else dd.exports=function(a){return typeof a=="function"&&!!a.prototype};return dd.exports}var Fm,$2;function $k(){if($2)return Fm;$2=1;var n=pe(),t=kc(),e=Ik();return Fm=function(i){if(!e(i))throw new n("C must be a constructor");var o={"[[Resolve]]":void 0,"[[Reject]]":void 0},a=new i(function(l,c){if(typeof o["[[Resolve]]"]<"u"||typeof o["[[Reject]]"]<"u")throw new n("executor has already been called");o["[[Resolve]]"]=l,o["[[Reject]]"]=c});if(!t(o["[[Resolve]]"])||!t(o["[[Reject]]"]))throw new n("executor must provide valid resolve and reject functions");return{"[[Promise]]":a,"[[Resolve]]":o["[[Resolve]]"],"[[Reject]]":o["[[Reject]]"]}},Fm}var Vm,x2;function xk(){if(x2)return Vm;x2=1;var n=Oi(),t=pe(),e=Ep(),r=Ck(),i=$k(),o=Nv(),a=xv()(),l=Pv()();return Vm=function(u,f){if(o(u)!=="Object")throw new t("`V` must be an Object");if(f!=="SYNC-DISPOSE"&&f!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var p;if(f==="ASYNC-DISPOSE"&&l&&(p=r(u,l)),!p){if(!a)throw new n("`Symbol.dispose` is not supported");if(p=r(u,a),typeof p<"u")return function(){var y=this;if(f==="ASYNC-DISPOSE"){var v=i(Promise);try{e(p,y),e(v["[[Resolve]]"],void 0,[void 0])}catch(S){v["[[Reject]]"](S)}return v["[[Promise]]"]}e(p,y)}}return p},Vm}var Bm,P2;function Pk(){if(P2)return Bm;P2=1;var n=Oi(),t=pe(),e=kc(),r=Nv(),i=xk();return Bm=function(a,l){if(l!=="SYNC-DISPOSE"&&l!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var c;if(arguments.length<3)if(a==null)a=void 0,c=void 0;else{if(typeof a<"u"&&r(a)!=="Object")throw new t("`V` must be an Object, or `null` or `undefined`");if(c=i(a,l),typeof c>"u")throw new t("dispose method must not be `undefined` on `V` when an object `V` is provided")}else if(c=arguments[2],!e(c))throw new t("`method`, when provided, must be a function");return{"[[ResourceValue]]":a,"[[Hint]]":l,"[[DisposeMethod]]":c}},Bm}var jm,D2;function m6(){if(D2)return jm;D2=1;var n=Oi(),t=pe(),e=Ek(),r=Pk(),i=Bs(),o=i("Array.prototype.push");return jm=function(l,c,u){if(!e(l))throw new t("Assertion failed: `disposeCapability` must be a DisposeCapability Record");if(u!=="SYNC-DISPOSE"&&u!=="ASYNC-DISPOSE")throw new n("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");var f=arguments.length>3?arguments[3]:void 0;if(arguments.length>3&&typeof f!="function")throw new t("Assertion failed: `method`, when present, must be a function");if(!l["[[DisposableResourceStack]]"])throw new t("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");var p;if(arguments.length<4){if(c==null&&u==="SYNC_DISPOSE")return"UNUSED";p=r(c,u)}else{if(typeof c<"u")throw new t("Assertion failed: `V` must be undefined when `method` is present");p=r(void 0,u,f)}return o(l["[[DisposableResourceStack]]"],p),"UNUSED"},jm}var Wm,O2;function zv(){if(O2)return Wm;O2=1;var n=On(),t=Mv(),e=Oi(),r=n("%Promise.resolve%",!0),i=r&&t(r);return Wm=function(a,l){if(!i)throw new e("This environment does not support Promises.");return i(a,l)},Wm}var Gm,L2;function Dk(){if(L2)return Gm;L2=1;var n=On(),t=Oi(),e=n("%Promise%",!0),r=Ep(),i=zv(),o=Nv();return Gm=function(l,c,u){if(typeof l<"u"&&o(l)!=="Object")throw new t("Assertion failed: `V` must be `undefined` or an Object");if(c!=="SYNC-DISPOSE"&&c!=="ASYNC-DISPOSE")throw new t("Assertion failed: `hint` must be `~SYNC-DISPOSE~` or `~ASYNC-DISPOSE~`");if(typeof u<"u"&&typeof u!="function")throw new t("Assertion failed: `method` must be `undefined` or a function");var f=typeof u>"u"?u:r(u,l);if(c==="ASYNC-DISPOSE")return i(e,f)},Gm}var Jm,M2;function Ok(){if(M2)return Jm;M2=1;var n=Ov();return Jm=function(e){return new n("throw",e)},Jm}var Ym,N2;function g6(){if(N2)return Ym;N2=1;var n=On(),t=Oi(),e=pe(),r=n("%Promise%",!0),i=Bs(),o=i("Promise.prototype.then",!0),a=Ov(),l=Dk(),c=Lv(),u=zv(),f=Ok(),p=d6()();return Ym=function(v,S){if(!(S instanceof a))throw new e("`completion` must be a Completion Record");var _=v["[[DisposableResourceStack]]"];if(!_)throw new e("Assertion failed: `disposeCapability.[[DisposableResourceStack]]` must not be ~EMPTY~");for(var R,H=_.length-1;H>=0;H-=1)if(!R)R=_[H]["[[Hint]]"];else if(R!==_[H]["[[Hint]]"])throw new t("mixed hint stacks are not supported");for(var P=R==="ASYNC-DISPOSE"&&u(r,S),N=function(Q){if(S.type()==="throw"){var K=S.value(),he=new p(Q,K);S=f(he)}else S=f(Q)},D=R==="ASYNC-DISPOSE"&&function(K){return o(P,function(){var he=l(K["[[ResourceValue]]"],K["[[Hint]]"],K["[[DisposeMethod]]"]);if(!he)throw new t("Assertion failed: non-`~ASYNC-DISPOSE~` resource returned a promise from Dispose");return o(he,c)},N)},B=_.length-1;B>=0;B-=1)if(R==="ASYNC-DISPOSE")P=D(_[B]);else{var q=_[B];try{var F=l(q["[[ResourceValue]]"],q["[[Hint]]"],q["[[DisposeMethod]]"]);if(F)throw new t("Assertion failed: `~SYNC-DISPOSE~` resource returned something from Dispose")}catch(Q){N(Q)}}return v["[[DisposableResourceStack]]"]=null,R==="ASYNC-DISPOSE"?P:S},Ym}var Km,z2;function v6(){return z2||(z2=1,Km=function(){var t=[];return{"[[DisposableResourceStack]]":t}}),Km}var Xm,H2;function Lk(){if(H2)return Xm;H2=1;var n=Av(),t=pe(),e=Ep(),r=$v(),i=Qh(),o=kc(),a=Lv(),l=Dv(),c=p6(),u=Ea().supportsDescriptors,f=Mv(),p=m6(),y=g6(),v=v6(),S=xv()(),_=function N(){if(!(this instanceof N)||l.has(this,"[[DisposableState]]")||l.has(this,"[[DisposeCapability]]"))throw new t("can only be used with new");l.set(this,"[[DisposableState]]","PENDING"),l.set(this,"[[DisposeCapability]]",v())},R=function(){var D=this;return l.assert(D,"[[DisposableState]]"),l.get(D,"[[DisposableState]]")==="DISPOSED"},H=f(R);u?i(_.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":R}):_.prototype.disposed=!1;var P=function(D){l.set(D,"[[DisposableState]]","DISPOSED"),u||(D.disposed=!0)};return r(_.prototype,"dispose",function(){var D=this;if(!H(D))return P(D),y(l.get(D,"[[DisposeCapability]]"),a())["?"]()}),r(_.prototype,"use",function(D){var B=this;if(H(B))throw new n("a disposed stack can not use anything new");return p(l.get(B,"[[DisposeCapability]]"),D,"SYNC-DISPOSE"),D}),r(_.prototype,"adopt",function(D,B){var q=this;if(H(q))throw new n("a disposed stack can not use anything new");if(!o(B))throw new t("`onDispose` must be a function");var F=(function(){return e(B,void 0,[D])});return p(l.get(q,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",F),D}),r(_.prototype,"defer",function(D){var B=this;if(H(B))throw new n("a disposed stack can not defer anything new");if(!o(D))throw new t("`onDispose` must be a function");p(l.get(B,"[[DisposeCapability]]"),void 0,"SYNC-DISPOSE",D)}),r(_.prototype,"move",function(){var D=this;if(H(D))throw new n("a disposed stack can not use anything new");var B=new _;return l.set(B,"[[DisposeCapability]]",l.get(D,"[[DisposeCapability]]")),l.set(D,"[[DisposeCapability]]",v()),P(D),B}),S&&r(_.prototype,S,_.prototype.dispose),c(_.prototype,"DisposableStack"),Xm=_,Xm}var Qm,Z2;function Mk(){if(Z2)return Qm;Z2=1;var n=Lk();return Qm=function(){return typeof DisposableStack=="function"?DisposableStack:n},Qm}var eg,U2;function Nk(){if(U2)return eg;U2=1;var n=Ea(),t=Sv()(),e=Mk();return eg=function(){var i=e();return n(t,{DisposableStack:i},{DisposableStack:!0}),i},eg}var tg,q2;function zk(){if(q2)return tg;q2=1;var n=On(),t=Av(),e=pe(),r=n("%Promise%",!0),i=m6(),o=Ep(),a=$v(),l=Qh(),c=g6(),u=kc(),f=v6(),p=Lv(),y=zv(),v=Dv(),S=p6(),_=Ea().supportsDescriptors,R=Mv(),H=Bs(),P=H("Promise.prototype.then",!0),N=Pv()(),D=function Q(){if(!(this instanceof Q)||v.has(this,"[[AsyncDisposableState]]")||v.has(this,"[[DisposeCapability]]"))throw new e("can only be used with new");v.set(this,"[[AsyncDisposableState]]","pending"),v.set(this,"[[DisposeCapability]]",f())},B=function(){var K=this;return v.assert(K,"[[AsyncDisposableState]]"),v.get(K,"[[AsyncDisposableState]]")==="disposed"},q=R(B);_?l(D.prototype,"disposed",{"[[Configurable]]":!0,"[[Enumerable]]":!1,"[[Get]]":B}):D.prototype.disposed=!1;var F=function(K){v.set(K,"[[AsyncDisposableState]]","disposed"),_||(K.disposed=!0)};return a(D.prototype,"disposeAsync",function(){var K=this;return q(K)?y(r):(F(K),P(y(r,c(v.get(K,"[[DisposeCapability]]"),p())),function(he){return he["?"]()}))}),a(D.prototype,"use",function(K){var he=this;if(q(he))throw new t("a disposed stack can not use anything new");return i(v.get(he,"[[DisposeCapability]]"),K,"ASYNC-DISPOSE"),K}),a(D.prototype,"adopt",function(K,he){var le=this;if(q(le))throw new t("a disposed stack can not use anything new");if(!u(he))throw new e("`onDisposeAsync` must be a function");var Ae=(function(){return o(he,void 0,[K])});return Ae.value=K,i(v.get(le,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",Ae),K}),a(D.prototype,"defer",function(K){var he=this;if(q(he))throw new t("a disposed stack can not defer anything new");if(!u(K))throw new e("`onDispose` must be a function");i(v.get(he,"[[DisposeCapability]]"),void 0,"ASYNC-DISPOSE",K)}),a(D.prototype,"move",function(){var K=this;if(q(K))throw new t("a disposed stack can not use anything new");var he=new D;return v.set(he,"[[DisposeCapability]]",v.get(K,"[[DisposeCapability]]")),v.set(K,"[[DisposeCapability]]",f()),F(K),he}),N&&a(D.prototype,N,D.prototype.disposeAsync),S(D.prototype,"AsyncDisposableStack"),tg=D,tg}var ng,F2;function Hk(){if(F2)return ng;F2=1;var n=zk();return ng=function(){return typeof AsyncDisposableStack=="function"?AsyncDisposableStack:n},ng}var rg,V2;function Zk(){if(V2)return rg;V2=1;var n=Ea(),t=Sv()(),e=Hk();return rg=function(){var i=e();return n(t,{AsyncDisposableStack:i},{AsyncDisposableStack:!0}),i},rg}var ig,B2;function Uk(){if(B2)return ig;B2=1;var n=ck(),t=hk(),e=Nk(),r=Zk();return ig=function(){n(),t(),e(),r()},ig}var j2;function qk(){return j2||(j2=1,nk(),Uk()()),Ry}qk();const W2=new WeakMap;function Fk(n){return(typeof n=="object"||typeof n=="function")&&n!==null&&"then"in n&&typeof n.then=="function"}function Ma(n){return typeof n=="string"?n:typeof n=="symbol"?n.description??n.toString():n.name||"(anonymous class)"}function G2(){return new Error("register(Key, factory) requires a factory function. Wrap existing instances as () => instance.")}function Vk(){return new Error("register(Key, factory) does not accept async factories. Await setup before registering.")}class Bk{constructor(){I(this,"entries",new Map);I(this,"constructionStack",[])}register(t,e){if(e===void 0){if(typeof t!="function")throw G2();this.validateClassRegistration(t),this.storeFactory(t,()=>this.instantiateClass(t));return}if(typeof e!="function")throw G2();if(e.constructor.name==="AsyncFunction")throw Vk();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=W2.get(t);if(e){if(t.length!==e.length)throw new Error(`${Ma(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(`${Ma(t)} cannot be registered with register(Class). Undecorated classes must have zero required constructor parameters. Use register(Key, () => value) instead.`)}instantiateClass(t){const e=W2.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),o=Reflect.get(i,r,i);return typeof o=="function"?o.bind(i):o},set:(e,r,i)=>{const o=this.getInstance(t);return Reflect.set(o,r,i,o)},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(`${Ma(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=>Ma(i)).join(" -> ");throw new Error(`Circular dependency detected: ${r}`)}this.constructionStack.push(t.key);try{const r=t.factory();if(Fk(r))throw new Error(`Factory for ${Ma(t.key)} returned a Promise. Await setup before registering.`);if(typeof r!="object"||r===null)throw new Error(`Factory for ${Ma(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 y6=new Bk,jk=new Set(["target","currentTarget","eventPhase","defaultPrevented","isTrusted","timeStamp","srcElement","returnValue","cancelBubble","NONE","CAPTURING_PHASE","AT_TARGET","BUBBLING_PHASE","composedPath","stopPropagation","stopImmediatePropagation","preventDefault","initEvent"]);function Wk(n){for(const t of Object.keys(n))if(jk.has(t))throw new Error(`Event payload key "${t}" is reserved; choose a different property name`)}function Gk(n,t){Wk(t);for(const e of Object.keys(t))Object.defineProperty(n,e,{value:t[e],writable:!0,enumerable:!0,configurable:!0})}function Ln(){class n extends Event{constructor(e,r){const{type:i,bubbles:o,cancelable:a,composed:l,...c}=r??{};if(i!==void 0)throw new Error('Do not pass "type" in init; use the constructor argument instead');super(e,{bubbles:o,cancelable:a,composed:l}),Gk(this,c)}}return n}class zr extends globalThis.EventTarget{}const Jk="X-Television-Client-Meta",Yk="telemetry-activity",Kk="telemetry-signal",w6={kind:"single",full_screen:!1},b6={width:760,height:770};function Xk(n){return n.layout.flatMap(t=>t.artifactIds)}function Qk(n){if(!Array.isArray(n))return{valid:!1,errors:["Layout must be an array of pages"]};const t=[];for(const[e,r]of n.entries())eT(r,e,t);return{valid:t.length===0,errors:t}}function Tu(n){return n.flatMap(t=>t.artifactIds)}function Tg(n,t){return n.flatMap(e=>{if(!e.artifactIds.includes(t))return[e];const r=e.artifactIds.filter(i=>i!==t);return r.length===0?[]:[{...e,artifactIds:r}]})}function eT(n,t,e){if(!sg(n)){e.push(`Page ${t} must be an object`);return}for(const r of Object.keys(n))r!=="artifactIds"&&r!=="geometry"&&r!=="size"&&e.push(`Page ${t} has unknown field: ${r}`);if(!Array.isArray(n.artifactIds)||n.artifactIds.length===0?e.push(`Page ${t} must contain at least one artifact id`):n.artifactIds.some(r=>typeof r!="string"||r.length===0)&&e.push(`Page ${t} artifact ids must be non-empty strings`),!sg(n.geometry)){e.push(`Page ${t} geometry must be an object`);return}for(const r of Object.keys(n.geometry))r!=="kind"&&r!=="full_screen"&&e.push(`Page ${t} geometry has unknown field: ${r}`);if(n.geometry.kind!=="single"){e.push(`Page ${t} has unknown geometry kind: ${String(n.geometry.kind)}`);return}if(typeof n.geometry.full_screen!="boolean"&&e.push(`Page ${t} single geometry must include a boolean full_screen`),!sg(n.size)){e.push(`Page ${t} size must be an object`);return}for(const r of Object.keys(n.size))r!=="width"&&r!=="height"&&e.push(`Page ${t} size has unknown field: ${r}`);for(const r of["width","height"]){const i=n.size[r];(typeof i!="number"||!Number.isFinite(i)||i<=0)&&e.push(`Page ${t} size ${r} must be a finite positive number`)}}function sg(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const dt=Ln(),Rd=Ln(),J2=Ln(),tT=Ln(),nT=Ln(),rT=Ln();function S6(n){class t extends Error{constructor(r,i){super(r),this.name=n,i&&Object.assign(this,i)}}return t}const Cc=S6("RequestError"),Y2=S6("ValidationError");function mc(n,t){return Object.assign(new Error(t),{code:n})}const iT=new TextEncoder;function _6(n){return iT.encode(n).length}const A6=768,Cu=32;function K2(n){const t=n.split("/").filter(e=>e.length>0);return sT(t),t}function sT(n){if(n.length>Cu)throw mc("invalid-path",`A path has at most ${Cu} segments.`);for(const t of n)if(!E6(t))throw mc("invalid-path",`A path key is at most ${A6} bytes.`)}function X2(){return mc("invalid-path",`A value can be at most ${Cu} keys below the store's root.`)}function E6(n){return n.length>0&&!n.includes("/")&&_6(n)<=A6}function oT(n,t){const e=n.length<=t.length?n:t,r=e===n?t:n;return e.every((i,o)=>r[o]===i)}function Cg(n,t){if(n===t)return!0;if(n===void 0||t===void 0||n===null||t===null)return!1;if(Array.isArray(n)||Array.isArray(t))return!Array.isArray(n)||!Array.isArray(t)||n.length!==t.length?!1:n.every((r,i)=>Cg(r,t[i]));if(typeof n!="object"||typeof t!="object")return!1;const e=Object.keys(n);return e.length!==Object.keys(t).length?!1:e.every(r=>Object.hasOwn(t,r)&&Cg(n[r],t[r]))}class aT{constructor(t){I(this,"serverValue");this.serverValue=t,Object.freeze(this)}}class lT{constructor(){Object.freeze(this)}}function Na(n){return mc("invalid-value",n)}function cT(n){const t=Object.getPrototypeOf(n);return t===Object.prototype||t===null}function Rg(n,t,e,r){if(!(n===null||typeof n=="boolean"||typeof n=="string")){if(typeof n=="number"){if(!Number.isFinite(n))throw Na("A stored number must be finite.");return}if(typeof n!="object")throw Na(`A ${typeof n} is not a JSON value.`);if(e.has(n))throw Na("A value cannot contain itself.");if(e.add(n),Array.isArray(n)){if(n.length>0&&r>=Cu)throw X2();for(let i=0;i<n.length;i++){if(!(i in n))throw Na("An array cannot have holes.");Rg(n[i],t,e,r+1)}}else{if(!cT(n))throw Na("Only plain objects, arrays, strings, finite numbers, booleans and null are JSON values.");const i=Object.keys(n);if(i.length>0&&r>=Cu)throw X2();for(const o of i){if(!E6(o))throw Na("An object key must be non-empty, contain no /, and be at most 768 bytes.");Rg(n[o],t,e,r+1)}}e.delete(n)}}function uT(n){Rg(n,!1,new Set,0)}function hT(n,t,e){Object.defineProperty(n,t,{value:e,enumerable:!0,writable:!0,configurable:!0})}function Ig(n){const t=[],e=(i,o)=>{if(i instanceof aT)return t.push({at:o,serverValue:{...i.serverValue}}),null;if(Array.isArray(i))return i.map((a,l)=>e(a,[...o,String(l)]));if(i!==null&&typeof i=="object"){const a={};for(const l of Object.keys(i))hT(a,l,e(i[l],[...o,l]));return a}return i},r=e(n,[]);return t.length>0?{value:r,serverValues:t}:{value:r}}function dT(n){return Object.keys(n).map(t=>{const e=n[t];return e instanceof lT?{key:t,delete:!0}:{key:t,value:Ig(e)}})}const k6=16777216;function fT(n){if(_6(n)>k6)throw pT()}function pT(){return mc("too-large",`A write is at most ${k6} bytes as sent.`)}/**
|
|
5
|
+
* @license
|
|
6
|
+
* Adapted from the Firebase JavaScript SDK, https://github.com/firebase/firebase-js-sdk:
|
|
7
|
+
* the push-ID generator in packages/database/src/core/util/NextPushId.ts, at
|
|
8
|
+
* commit 6cde0c0230b4c1da01d4a058333daa7663322fd1 (@firebase/database 1.1.5).
|
|
9
|
+
* Modified by Television: rewritten as one function that reads the clock
|
|
10
|
+
* itself, draws its random characters from crypto.getRandomValues, and stops
|
|
11
|
+
* the same-millisecond increment at the first character.
|
|
12
|
+
*
|
|
13
|
+
* Copyright 2017 Google LLC
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License.
|
|
17
|
+
* You may obtain a copy of the License at
|
|
18
|
+
*
|
|
19
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
22
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
+
* See the License for the specific language governing permissions and
|
|
25
|
+
* limitations under the License.
|
|
26
|
+
*/const mT=12;new Array(mT).fill(0);const Yr="/api/resources/v1",Fc=(n,t="")=>`${Yr}/resources/${encodeURIComponent(n)}${t===""?"":`/${t}`}`,Q2=(n,t)=>`${Yr}/artifacts/${encodeURIComponent(n)}/${t}`,Yt={list:`${Yr}/resources`,info:n=>Fc(n),describe:n=>Fc(n,"describe"),bind:n=>Fc(n,"bind"),unbind:n=>Fc(n,"unbind"),destroy:n=>Fc(n,"destroy"),share:n=>Q2(n,"share"),unshare:n=>Q2(n,"unshare"),jsonCreate:`${Yr}/json/create`,jsonGet:`${Yr}/json/value`,jsonSet:`${Yr}/json/set`,jsonUpdate:`${Yr}/json/update`,jsonPush:`${Yr}/json/push`,jsonRemove:`${Yr}/json/remove`},eb={artifactID:"artifact",resourceID:"resourceID"};function gT(n){return"artifactID"in n?new URLSearchParams({[eb.artifactID]:n.artifactID}):new URLSearchParams({[eb.resourceID]:n.resourceID})}const vT=200,yT=300,za=401,wT="/events",bT=4401;class ST{constructor(t,e){I(this,"serverURL");I(this,"token");I(this,"onUnauthorized");I(this,"telemetryMeta");this.serverURL=t.replace(/\/$/,""),this.token=e.token,this.onUnauthorized=e.onUnauthorized,this.telemetryMeta=e.telemetryMeta}async requestJSON(t,e,r){return this.requestSerializedJSON(t,e,r!==void 0?JSON.stringify(r):void 0)}async requestSerializedJSON(t,e,r){var a;const i=await this.request(t,e,r,r!==void 0?{"content-type":"application/json"}:void 0),o=await _T(i);if(!i.ok||i.status<vT||i.status>=yT)throw i.status===za&&((a=this.onUnauthorized)==null||a.call(this)),this.createError(typeof o.error=="string"?o.error:i.statusText,i.status);return o}async requestVoid(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);if(!i.ok)throw i.status===za&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await fd(i,i.statusText),i.status)}async requestText(t,e){var i;const r=await this.request(t,e);if(!r.ok)throw r.status===za&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await fd(r,r.statusText),r.status);return r.text()}async requestBytes(t,e){var i,o;const r=await this.request(t,e);if(!r.ok)throw r.status===za&&((i=this.onUnauthorized)==null||i.call(this)),this.createError(await fd(r,r.statusText),r.status);return{bytes:new Uint8Array(await r.arrayBuffer()),contentType:((o=r.headers.get("content-type"))==null?void 0:o.split(";")[0])??""}}async requestRawVoid(t,e,r){var o;const i=await this.request(t,e,r,{"content-type":"text/markdown; charset=utf-8"});if(!i.ok)throw i.status===za&&((o=this.onUnauthorized)==null||o.call(this)),this.createError(await fd(i,i.statusText),i.status)}webSocketURL(t){const e=new URL(`${this.serverURL}${t}`);return e.protocol=e.protocol==="https:"?"wss:":"ws:",this.token&&e.searchParams.set("token",this.token),e.toString()}unauthorizedError(t){var e;return(e=this.onUnauthorized)==null||e.call(this),this.createError(t,za)}createError(t,e){const r={serverURL:this.serverURL};return e!==void 0&&(r.status=e),new Cc(t,r)}async request(t,e,r,i){const o=`${this.serverURL}${e}`;try{return await fetch(o,{method:t,headers:this.buildHeaders(i),body:r})}catch(a){throw this.createError(a instanceof Error?a.message:"Failed to reach server")}}buildHeaders(t){const e={...t??{}};return this.token&&(e.Authorization=`Bearer ${this.token}`),this.telemetryMeta&&(e[Jk]=JSON.stringify(this.telemetryMeta)),Object.keys(e).length>0?e:void 0}}async function _T(n){try{return await n.json()}catch{const t=await n.text().catch(()=>"");return t?{message:t}:{}}}async function fd(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 AT(n){return n.map(t=>`${t.name} (${t.id})`).join(", ")}var Xr,Ef,T6;class ET{constructor(t){m(this,Ef);m(this,Xr);d(this,Xr,t)}list(){return s(this,Xr).requestJSON("GET","/channels")}async get(t={}){const e=await h(this,Ef,T6).call(this,t.channelID);return s(this,Xr).requestJSON("GET",`/channels/${encodeURIComponent(e)}`)}create(t){const e={name:t.name};return t.id!==void 0&&(e.id=t.id),s(this,Xr).requestJSON("POST","/channels",e)}update(t){const{channelID:e,...r}=t;return s(this,Xr).requestJSON("PATCH",`/channels/${encodeURIComponent(e)}`,r)}remove(t){return s(this,Xr).requestJSON("DELETE",`/channels/${encodeURIComponent(t.channelID)}`)}}Xr=new WeakMap,Ef=new WeakSet,T6=async function(t){if(t!==void 0)return t;const{channels:e}=await this.list();if(e.length===1)return e[0].id;throw e.length===0?new Y2("channelID is required, but no channels exist."):new Y2(`channelID is required when multiple channels exist. Available channels: ${AT(e)}`)};var hr;class kT{constructor(t){m(this,hr);d(this,hr,t)}create(t){const e={kind:t.kind,title:t.title};switch(t.kind){case"path":e.path=t.path;break;case"url":e.url=t.url;break}return e.channelID=t.channelID,t.display!==void 0&&(e.display=t.display),t.before!==void 0&&(e.before=t.before),t.after!==void 0&&(e.after=t.after),s(this,hr).requestJSON("POST","/artifacts",e)}list(t={}){const e=new URLSearchParams;t.channelID!==void 0&&e.set("channelID",t.channelID);const r=e.toString();return s(this,hr).requestJSON("GET",r?`/artifacts?${r}`:"/artifacts")}get(t){return s(this,hr).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),t.transparent!==void 0&&(e.transparent=t.transparent),s(this,hr).requestJSON("PATCH",`/artifacts/${encodeURIComponent(t.artifactID)}`,e)}delete(t){return s(this,hr).requestJSON("DELETE",`/artifacts/${encodeURIComponent(t.artifactID)}`)}move(t){return s(this,hr).requestJSON("POST",`/artifacts/${encodeURIComponent(t.artifactID)}/move`,{channelID:t.channelID,...t.before!==void 0?{before:t.before}:{},...t.after!==void 0?{after:t.after}:{}})}}hr=new WeakMap;var bo;class TT{constructor(t){m(this,bo);d(this,bo,t)}list(t){return s(this,bo).requestJSON("GET",t!=null&&t.fresh?"/templates?fresh=true":"/templates")}create(t){return s(this,bo).requestJSON("POST","/templates/artifacts",{...t})}async icon(t){const e=await s(this,bo).requestBytes("GET",`/templates/${encodeURIComponent(t)}/icon`);if(e.contentType!=="image/svg+xml"&&e.contentType!=="image/png")throw new Error("Unsupported template icon type");return{bytes:e.bytes,contentType:e.contentType}}}bo=new WeakMap;var cl;class CT{constructor(t){m(this,cl);d(this,cl,t)}list(){return s(this,cl).requestJSON("GET","/themes")}refresh(){return s(this,cl).requestJSON("POST","/themes/refresh")}}cl=new WeakMap;var ul;class RT{constructor(t){m(this,ul);d(this,ul,t)}get(t){return s(this,ul).requestText("GET",`/markdown/${encodeURIComponent(t.artifactID)}`)}update(t){return s(this,ul).requestRawVoid("PUT",`/markdown/${encodeURIComponent(t.artifactID)}`,t.content)}}ul=new WeakMap;var So;class IT{constructor(t){m(this,So);d(this,So,t)}status(){return s(this,So).requestJSON("GET","/telemetry")}enable(){return s(this,So).requestJSON("POST","/telemetry/enable")}disable(){return s(this,So).requestJSON("POST","/telemetry/disable")}}So=new WeakMap;var _o;class $T{constructor(t){m(this,_o);d(this,_o,t)}get(){return s(this,_o).requestJSON("GET","/display")}patch(t){const e={};return t.focusedChannelId!==void 0&&(e.focusedChannelId=t.focusedChannelId),t.pinnedChannelIds!==void 0&&(e.pinnedChannelIds=t.pinnedChannelIds),t.activeThemeName!==void 0&&(e.activeThemeName=t.activeThemeName),t.appearanceMode!==void 0&&(e.appearanceMode=t.appearanceMode),t.themeJavaScriptConsentIds!==void 0&&(e.themeJavaScriptConsentIds=t.themeJavaScriptConsentIds),s(this,_o).requestVoid("PATCH","/display",e)}focus(t){return s(this,_o).requestJSON("POST","/display/focus",{artifactID:t.artifactID})}}_o=new WeakMap;function C6(n,t,e){let r=!1,i=()=>{};return{finished:new Promise((a,l)=>{let c=null;i=v=>{r||(r=!0,e==null||e.removeEventListener("abort",u),c==null||c.close(),v?l(v):a())};const u=()=>i();if(e!=null&&e.aborted){i();return}e==null||e.addEventListener("abort",u,{once:!0}),c=new WebSocket(n.webSocketURL(wT));let f=!1,p=!1;const y=v=>{try{v()}catch(S){i(S instanceof Error?S:new Error(String(S)))}};c.addEventListener("open",()=>{f=!0}),c.addEventListener("message",v=>{if(r)return;p||(p=!0,t.onReady&&y(t.onReady));let S;try{S=JSON.parse(String(v.data))}catch{return}if(r||S.type!=="resource-event"||S.event===void 0)return;const _=S.event;y(()=>t.onEvent(_))}),c.addEventListener("close",v=>{v.code===bT?i(n.unauthorizedError("Unauthorized")):i(n.createError(f?"The event stream ended.":"Could not open the event stream."))})}),get ended(){return r},end:a=>i(a)}}function xT(n,t){return!n.exists||!t.exists?n.exists===t.exists:Cg(n.value,t.value)}function pd(n){return uT(n),n}var Ao,Qi,Za;class PT{constructor(t){m(this,Qi);m(this,Ao);d(this,Ao,t)}async create(t){const e={description:t.description};return t.usage!==void 0&&(e.usage=t.usage),t.value!==void 0&&(e.value=pd(t.value)),(await h(this,Qi,Za).call(this,Yt.jsonCreate,e)).resource}get(t){const e=gT(t.store);return e.set("path",t.path),s(this,Ao).requestJSON("GET",`${Yt.jsonGet}?${e.toString()}`)}async set(t){await h(this,Qi,Za).call(this,Yt.jsonSet,{store:t.store,path:t.path,value:Ig(pd(t.value))})}async update(t){for(const e of Object.keys(t.values))pd(t.values[e]);await h(this,Qi,Za).call(this,Yt.jsonUpdate,{store:t.store,path:t.path,entries:dT(t.values)})}async push(t){await h(this,Qi,Za).call(this,Yt.jsonPush,{store:t.store,path:t.path,key:t.key,value:Ig(pd(t.value))})}async remove(t){await h(this,Qi,Za).call(this,Yt.jsonRemove,{store:t.store,path:t.path})}watch(t){let e;try{e=K2(t.path)}catch(c){return Promise.reject(c)}let r=null,i=!1,o=!1;const a=()=>{if(i){o=!0;return}i=!0,this.get({store:t.store,path:t.path}).then(c=>{if(i=!1,!l.ended){if(r===null||!xT(c,r)){r=c;try{t.onValue(c)}catch(u){l.end(u instanceof Error?u:new Error(String(u)));return}}o&&(o=!1,a())}},c=>l.end(c instanceof Error?c:new Error(String(c))))},l=C6(s(this,Ao),{onReady:a,onEvent:c=>{const{store:u}=t,f=p=>"artifactID"in u?p.artifactID===u.artifactID:p.resourceID===u.resourceID;if(c.event==="destroyed"&&f(c)){if("resourceID"in u)throw mc("not-found",`Resource not found: ${u.resourceID}`);a();return}c.event!=="changed"||!f(c)||c.paths.some(p=>oT(K2(p),e))&&a()}},t.signal);return l.finished}}Ao=new WeakMap,Qi=new WeakSet,Za=function(t,e){const r=JSON.stringify(e);return fT(r),s(this,Ao).requestSerializedJSON("POST",t,r)};var sn;class DT{constructor(t){I(this,"json");m(this,sn);d(this,sn,t),this.json=new PT(t)}share(t){return s(this,sn).requestJSON("POST",Yt.share(t.artifactID),t.access===void 0?{}:{access:t.access})}async unshare(t){await s(this,sn).requestJSON("POST",Yt.unshare(t.artifactID),{})}async list(t={}){const e=t.artifactID===void 0?"":`?${new URLSearchParams({artifact:t.artifactID}).toString()}`;return(await s(this,sn).requestJSON("GET",`${Yt.list}${e}`)).resources}async info(t){return(await s(this,sn).requestJSON("GET",Yt.info(t.resourceID))).resource}async describe(t){const e={};return t.description!==void 0&&(e.description=t.description),t.usage!==void 0&&(e.usage=t.usage),(await s(this,sn).requestJSON("POST",Yt.describe(t.resourceID),e)).resource}destroy(t){return s(this,sn).requestJSON("POST",Yt.destroy(t.resourceID),t.force===void 0?{}:{force:t.force})}bind(t){return s(this,sn).requestJSON("POST",Yt.bind(t.resourceID),{artifactID:t.artifactID,access:t.access})}async unbind(t){await s(this,sn).requestJSON("POST",Yt.unbind(t.resourceID),{artifactID:t.artifactID})}events(t){return C6(s(this,sn),{onEvent:t.onEvent},t.signal).finished}}sn=new WeakMap;var Nt;class OT{constructor(t,e={}){I(this,"channels");I(this,"artifacts");I(this,"templates");I(this,"display");I(this,"themes");I(this,"markdown");I(this,"telemetry");I(this,"resources");m(this,Nt);d(this,Nt,new ST(t,e)),this.channels=new ET(s(this,Nt)),this.artifacts=new kT(s(this,Nt)),this.templates=new TT(s(this,Nt)),this.display=new $T(s(this,Nt)),this.themes=new CT(s(this,Nt)),this.markdown=new RT(s(this,Nt)),this.telemetry=new IT(s(this,Nt)),this.resources=new DT(s(this,Nt))}health(){return s(this,Nt).requestJSON("GET","/health")}demoMode(){return s(this,Nt).requestJSON("GET","/demo-mode")}}Nt=new WeakMap;const af="0.0.0",LT=/^\d+\.\d+\.\d+$/,MT=3;function kp(n){return LT.test(n)}function Hv(n,t){const e=n.split(".").map(Number),r=t.split(".").map(Number);for(let i=0;i<MT;i++)if(e[i]!==r[i])return e[i]>r[i];return!1}function NT(n,t){return n===af||t===af?!1:n!==t}const zT=400,HT=404,R6=500,ZT=600,UT={focusedChannelId:null,pinnedChannelIds:[],activeThemeName:null,activeThemeColorScheme:null,appearanceMode:"system",themeJavaScriptConsentIds:[],acpEnabled:!1};var fe,Lu,Mu,Qr,Ye,we,Eo,es,ko,ei,on,hl,Nu,U,cr,$g,Ua,xg,Pg,I6,Dg,Id,Og,$6,qa,x6,Gr,Lg,P6,tt;class qT extends zr{constructor(e){super();m(this,U);m(this,fe);m(this,Lu);m(this,Mu);m(this,Qr,new Set);I(this,"pendingPageWrites",new Map);m(this,Ye,new Map);m(this,we,BT());m(this,Eo);m(this,es,!1);m(this,ko,!1);m(this,ei,0);m(this,on,!1);m(this,hl,()=>{if(s(this,on))return;const e=s(this,fe).connection.status==="connected";e&&!s(this,ko)?(d(this,ko,!0),h(this,U,x6).call(this)):!e&&s(this,ko)&&(d(this,ko,!1),d(this,ei,s(this,ei)+1)),h(this,U,Gr).call(this)});m(this,Nu,e=>{if(s(this,on))return;for(const i of s(this,Qr))i.push(e.event);const r=e.event;if(r.type==="artifact-content-changed"){this.dispatchEvent(new J2("artifact-content-changed",{artifactID:r.artifactID}));return}if(r.type==="artifact-focus"){s(this,es)&&lf(s(this,we),s(this,Ye),r.channelID,r.artifactID)&&h(this,U,Gr).call(this),this.dispatchEvent(new tT("artifact-focus",{channelID:r.channelID,artifactID:r.artifactID}));return}r.type==="theme-changed"&&this.dispatchEvent(new nT("theme-changed",{themeName:r.themeName,activeThemeColorScheme:r.activeThemeColorScheme,themeJavaScriptConsentIds:[...r.themeJavaScriptConsentIds]})),r.type==="appearance-changed"&&this.dispatchEvent(new rT("appearance-changed",{appearanceMode:r.appearanceMode})),s(this,es)&&(md(s(this,we),r,this.pendingPageWrites,s(this,Ye)),og(s(this,we),s(this,Ye)),h(this,U,Gr).call(this))});d(this,fe,e.connectionOwner),d(this,Lu,e.navigationKeyHandler),d(this,Mu,e.retainedGateHalted??(()=>!1)),d(this,Eo,h(this,U,Lg).call(this)),s(this,fe).addEventListener("change",s(this,hl)),s(this,fe).addEventListener("server-event",s(this,Nu)),s(this,hl).call(this)}get snapshot(){return s(this,Eo)}handleNavigationKey(e){var r;h(this,U,tt).call(this),(r=s(this,Lu))==null||r.call(this,e)}async createChannel(e){h(this,U,tt).call(this);const{channel:r}=await h(this,U,cr).call(this,s(this,fe).connection.client.channels.create({name:e}),()=>h(this,U,xg).call(this));return r}focusChannel(e){return h(this,U,tt).call(this),h(this,U,cr).call(this,s(this,fe).connection.client.display.patch({focusedChannelId:e}),()=>h(this,U,Ua).call(this))}setPinnedChannelIds(e){return h(this,U,tt).call(this),h(this,U,cr).call(this,s(this,fe).connection.client.display.patch({pinnedChannelIds:[...e]}),()=>h(this,U,Ua).call(this))}listThemes(){return h(this,U,tt).call(this),s(this,fe).connection.client.themes.list()}refreshThemes(){return h(this,U,tt).call(this),s(this,fe).connection.client.themes.refresh()}setActiveTheme(e){return h(this,U,tt).call(this),h(this,U,cr).call(this,s(this,fe).connection.client.display.patch({activeThemeName:e}),()=>h(this,U,Ua).call(this))}setAppearanceMode(e){return h(this,U,tt).call(this),h(this,U,cr).call(this,s(this,fe).connection.client.display.patch({appearanceMode:e}),()=>h(this,U,Ua).call(this))}setThemeJavaScriptConsent(e,r){h(this,U,tt).call(this);const i=s(this,we).display.themeJavaScriptConsentIds,o=r?i.includes(e)?[...i]:[...i,e]:i.filter(a=>a!==e);return h(this,U,cr).call(this,s(this,fe).connection.client.display.patch({themeJavaScriptConsentIds:o}),()=>h(this,U,Ua).call(this))}selectPage(e,r){h(this,U,tt).call(this),lf(s(this,we),s(this,Ye),e,r)&&h(this,U,Gr).call(this)}async renameChannel(e,r){h(this,U,tt).call(this),await h(this,U,cr).call(this,s(this,fe).connection.client.channels.update({channelID:e,name:r}),()=>h(this,U,Pg).call(this,e))}async deleteChannel(e){h(this,U,tt).call(this);const r=s(this,we).channels.size===1&&s(this,we).channels.has(e);await h(this,U,cr).call(this,s(this,fe).connection.client.channels.remove({channelID:e}),()=>r?h(this,U,xg).call(this):h(this,U,I6).call(this,e))}updateChannelPages(e,r){h(this,U,tt).call(this);const i=Qk(r),o=s(this,we).channels.get(e);if(!i.valid||!o)return Promise.resolve();const a=go(r),l=go(o.channel.layout),c={previousPages:l};return ba(s(this,Ye),e,l,a),o.channel={...o.channel,layout:a},this.pendingPageWrites.set(e,c),h(this,U,Gr).call(this),s(this,fe).connection.client.channels.update({channelID:e,layout:go(a)}).then(()=>{this.pendingPageWrites.get(e)===c&&this.pendingPageWrites.delete(e)},async u=>{if(s(this,on))throw u;const f=this.pendingPageWrites.get(e)===c;if(f&&this.pendingPageWrites.delete(e),nb(u))throw await h(this,U,$g).call(this,()=>h(this,U,Pg).call(this,e)),u;if(!f||!YT(u))throw u;const p=s(this,we).channels.get(e);if(!p)throw u;const y=go(c.previousPages);throw ba(s(this,Ye),e,p.channel.layout,y),p.channel={...p.channel,layout:y},h(this,U,Gr).call(this),u})}async deleteArtifact(e){h(this,U,tt).call(this);const r=rb(s(this,we),e);await h(this,U,cr).call(this,s(this,fe).connection.client.artifacts.delete({artifactID:e}),()=>h(this,U,$6).call(this,e,r))}readMarkdown(e){return h(this,U,tt).call(this),s(this,fe).connection.client.markdown.get({artifactID:e})}writeMarkdown(e,r){return h(this,U,tt).call(this),s(this,fe).connection.client.markdown.update({artifactID:e,content:r})}get browserDemoMode(){return s(this,fe).connection.browserDemoMode}getArtifactViewURL(e){return h(this,U,tt).call(this),s(this,fe).connection.getViewURL(e)}getArtifactContentURL(e){return h(this,U,tt).call(this),s(this,fe).connection.getContentURL(e)}dispose(){s(this,on)||(d(this,on,!0),d(this,ei,s(this,ei)+1),s(this,Qr).clear(),this.pendingPageWrites.clear(),s(this,Ye).clear(),s(this,fe).removeEventListener("change",s(this,hl)),s(this,fe).removeEventListener("server-event",s(this,Nu)))}}fe=new WeakMap,Lu=new WeakMap,Mu=new WeakMap,Qr=new WeakMap,Ye=new WeakMap,we=new WeakMap,Eo=new WeakMap,es=new WeakMap,ko=new WeakMap,ei=new WeakMap,on=new WeakMap,hl=new WeakMap,Nu=new WeakMap,U=new WeakSet,cr=async function(e,r){try{return await e}catch(i){throw!s(this,on)&&nb(i)&&await h(this,U,$g).call(this,r),i}},$g=async function(e){try{await e()}catch{}},Ua=function(){const e=s(this,fe).connection.client;return h(this,U,qa).call(this,()=>e.display.get(),r=>h(this,U,Id).call(this,r))},xg=function(){const e=s(this,fe).connection.client;return h(this,U,qa).call(this,async()=>{const[{channels:r},i]=await Promise.all([e.channels.list(),e.display.get()]);return{channels:r,display:i}},({channels:r,display:i})=>{h(this,U,Dg).call(this,r),h(this,U,Id).call(this,i)})},Pg=function(e){const r=s(this,fe).connection.client;return h(this,U,qa).call(this,()=>ag(()=>r.channels.get({channelID:e})),i=>h(this,U,Og).call(this,e,i))},I6=function(e){const r=s(this,fe).connection.client;return h(this,U,qa).call(this,async()=>{const[i,o]=await Promise.all([ag(()=>r.channels.get({channelID:e})),r.display.get()]),a=o.focusedChannelId,c=a!==null&&(a===e?i!==null:s(this,we).channels.has(a))?null:(await r.channels.list()).channels;return{detail:i,display:o,channels:c}},({detail:i,display:o,channels:a})=>{a===null?h(this,U,Og).call(this,e,i):h(this,U,Dg).call(this,a),h(this,U,Id).call(this,o)})},Dg=function(e){const r=new Set(e.map(({id:i})=>i));for(const i of s(this,we).channels.keys())r.has(i)||(this.pendingPageWrites.delete(i),s(this,Ye).delete(i),s(this,we).channels.delete(i));for(const i of e)s(this,we).channels.has(i.id)||s(this,we).channels.set(i.id,{channel:ol(i),artifacts:new Map})},Id=function(e){s(this,we).display=Ng(e),s(this,fe).connection.acpClient.setEnabled(e.acpEnabled)},Og=function(e,r){this.pendingPageWrites.delete(e);const i=s(this,we).channels.get(e);if(r===null){s(this,Ye).delete(e),s(this,we).channels.delete(e);return}ba(s(this,Ye),e,(i==null?void 0:i.channel.layout)??[],r.channel.layout),s(this,we).channels.set(e,{channel:ol(r.channel),artifacts:new Map(r.artifacts.map(o=>[o.id,structuredClone(o)]))})},$6=function(e,r){const i=s(this,fe).connection.client;return h(this,U,qa).call(this,()=>ag(()=>i.artifacts.get({artifactID:e})),o=>{const a=rb(s(this,we),e)??r;if(o===null){a!==null&&md(s(this,we),{type:"artifact-removed",channelID:a,artifactID:e},this.pendingPageWrites,s(this,Ye));return}const l=a===null?void 0:s(this,we).channels.get(a);l==null||l.artifacts.set(e,structuredClone(o.artifact))})},qa=async function(e,r){const i=s(this,ei),o=[];s(this,Qr).add(o);try{const a=await e();if(s(this,on)||i!==s(this,ei))return;r(a);for(const l of o)md(s(this,we),l,this.pendingPageWrites,s(this,Ye));og(s(this,we),s(this,Ye)),h(this,U,Gr).call(this)}finally{s(this,Qr).delete(o)}},x6=async function(){const e=++ro(this,ei)._,r=s(this,fe).connection,i=r.client,o=[];s(this,Qr).add(o);try{const[{channels:a},l]=await Promise.all([i.channels.list(),i.display.get()]),c=await Promise.all(a.map(({id:p})=>i.channels.get({channelID:p})));if(s(this,on)||e!==s(this,ei))return;const u={channels:new Map,display:Ng(l)};for(const p of c)u.channels.set(p.channel.id,{channel:ol(p.channel),artifacts:new Map(p.artifacts.map(y=>[y.id,structuredClone(y)]))});jT(s(this,Ye),s(this,we),u);for(const p of o)md(u,p,this.pendingPageWrites,s(this,Ye));og(u,s(this,Ye));const f=s(this,es)?FT(s(this,we),u):[];this.pendingPageWrites.clear(),d(this,we,u),d(this,es,!0),r.acpClient.setEnabled(l.acpEnabled),h(this,U,Gr).call(this);for(const p of f)this.dispatchEvent(new J2("artifact-content-changed",{artifactID:p}))}catch{}finally{s(this,Qr).delete(o)}},Gr=function(){s(this,on)||(d(this,Eo,h(this,U,Lg).call(this)),h(this,U,P6).call(this),this.dispatchEvent(new dt("change")))},Lg=function(){var o;const e=[...s(this,we).channels.values()].map(a=>GT(a,s(this,Ye).get(a.channel.id))),r=e.find(({id:a})=>a===s(this,we).display.focusedChannelId)??null,i=s(this,fe).connection;return Object.freeze({ready:s(this,es),channels:Object.freeze(e),display:JT(s(this,we).display),focusedChannel:r,connection:Object.freeze({authorizationRequired:i.hasAuthRejected,gateHalted:i.bootState==="halted"||s(this,Mu).call(this),status:i.status,hasEverConnected:i.hasEverConnected,failedReconnectAttempts:i.failedReconnectAttempts,firstConnectError:i.hasEverConnected?null:s(this,fe).connectError,nextRetryAt:i.nextRetryAt,upgradeInstructions:VT(((o=i.updateState)==null?void 0:o.desktop)??null)})})},P6=function(){const e=s(this,Eo).focusedChannel;s(this,fe).connection.acpClient.setChannelContext(e?{channelID:e.id,channelName:e.name}:null)},tt=function(){if(s(this,on))throw new Error("ApplicationService is disposed")};function FT(n,t){const e=t.display.focusedChannelId;if(e===null||n.display.focusedChannelId!==e)return[];const r=n.channels.get(e),i=t.channels.get(e);if(!r||!i)return[];const o=new Set(Tu(r.channel.layout));return Tu(i.channel.layout).filter(a=>{var l,c;return o.has(a)&&((l=r.artifacts.get(a))==null?void 0:l.kind)==="path"&&((c=i.artifacts.get(a))==null?void 0:c.kind)==="path"})}function VT(n){return n===null?null:Object.freeze({...n})}function BT(){return{channels:new Map,display:Ng(UT)}}function md(n,t,e,r){switch(t.type){case"channel-created":r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ol(t.channel),artifacts:new Map});return;case"channel-updated":{e.delete(t.channel.id);const i=n.channels.get(t.channel.id);if(!i){r.delete(t.channel.id),n.channels.set(t.channel.id,{channel:ol(t.channel),artifacts:new Map});return}ba(r,t.channel.id,i.channel.layout,t.channel.layout);const o=new Set(Tu(t.channel.layout));i.channel=ol(t.channel);for(const a of i.artifacts.keys())o.has(a)||i.artifacts.delete(a);return}case"channel-removed":e.delete(t.channelID),r.delete(t.channelID),n.channels.delete(t.channelID);return;case"channel-changed":n.display.focusedChannelId=t.channelID;return;case"pinned-channels-changed":n.display.pinnedChannelIds=[...t.pinnedChannelIds];return;case"theme-changed":n.display.activeThemeName=t.themeName,n.display.activeThemeColorScheme=t.activeThemeColorScheme,n.display.themeJavaScriptConsentIds=[...t.themeJavaScriptConsentIds];return;case"templates-changed":return;case"appearance-changed":n.display.appearanceMode=t.appearanceMode;return;case"artifact-created":{const i=n.channels.get(t.channelID);if(!i)return;const o=e.get(t.channelID);if(o&&(o.previousPages=tb(o.previousPages,t.artifact.id)),!Tu(i.channel.layout).includes(t.artifact.id)){const a=i.channel.layout,l=tb(a,t.artifact.id);ba(r,t.channelID,a,l),i.channel={...i.channel,layout:l}}i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}case"artifact-updated":for(const i of n.channels.values())if(i.artifacts.has(t.artifact.id)){i.artifacts.set(t.artifact.id,structuredClone(t.artifact));return}return;case"artifact-removed":{const i=n.channels.get(t.channelID);if(!i)return;const o=e.get(t.channelID);o&&(o.previousPages=Tg(o.previousPages,t.artifactID)),i.artifacts.delete(t.artifactID);const a=i.channel.layout,l=Tg(a,t.artifactID);ba(r,t.channelID,a,l),i.channel={...i.channel,layout:l};return}case"artifact-focus":lf(n,r,t.channelID,t.artifactID);return;case"artifact-content-changed":return;default:return KT(t)}}function jT(n,t,e){var r;for(const i of n.keys())e.channels.has(i)||n.delete(i);for(const[i,o]of e.channels)ba(n,i,((r=t.channels.get(i))==null?void 0:r.channel.layout)??[],o.channel.layout)}function ba(n,t,e,r){const i=n.get(t);if(i===void 0)return;if(r.length===0){n.delete(t);return}const o=Mg(r,i);if(o!==-1){n.set(t,[...r[o].artifactIds]);return}const a=Mg(e,i),l=a===-1?0:Math.min(a,r.length-1);n.set(t,[...r[l].artifactIds])}function lf(n,t,e,r){const i=n.channels.get(e),o=i==null?void 0:i.channel.layout.find(({artifactIds:l})=>l.includes(r));if(!o)return!1;const a=t.get(e);return a&&WT(a,o.artifactIds)?!1:(t.set(e,[...o.artifactIds]),!0)}function og(n,t){var i,o;const e=n.display.focusedChannelId;if(e===null||t.has(e))return;const r=(o=(i=n.channels.get(e))==null?void 0:i.channel.layout[0])==null?void 0:o.artifactIds[0];r!==void 0&&lf(n,t,e,r)}function Mg(n,t){const e=new Set(t);return n.findIndex(r=>r.artifactIds.some(i=>e.has(i)))}function WT(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function GT(n,t){const e=Object.freeze(n.channel.layout.map(l=>Object.freeze({artifactIds:Object.freeze([...l.artifactIds]),geometry:Object.freeze({...l.geometry}),size:Object.freeze({...l.size})}))),r=t===void 0?0:Mg(n.channel.layout,t),i=e[r]??e[0]??null,o=Object.freeze([...n.artifacts.values()].map(l=>Object.freeze(structuredClone(l)))),a={id:n.channel.id,name:n.channel.name,pages:e,selectedPage:i,artifacts:o};return Object.freeze(n.channel.onboarding?{...a,onboarding:Object.freeze({...n.channel.onboarding})}:a)}function JT(n){return Object.freeze({focusedChannelId:n.focusedChannelId,pinnedChannelIds:Object.freeze([...n.pinnedChannelIds]),activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:Object.freeze([...n.themeJavaScriptConsentIds]),acpEnabled:n.acpEnabled})}function tb(n,t){return Tu(n).includes(t)?go(n):[...go(n),{artifactIds:[t],geometry:{...w6},size:{...b6}}]}function YT(n){return n instanceof Cc&&n.status!==void 0&&n.status>=zT&&n.status<R6}function nb(n){return n instanceof Cc&&(n.status===void 0||n.status>=R6&&n.status<ZT)}async function ag(n){try{return await n()}catch(t){if(t instanceof Cc&&t.status===HT)return null;throw t}}function rb(n,t){for(const[e,r]of n.channels)if(r.artifacts.has(t))return e;return null}function go(n){return n.map(t=>({artifactIds:[...t.artifactIds],geometry:{...t.geometry},size:{...t.size}}))}function ol(n){return{id:n.id,name:n.name,layout:go(n.layout),...n.onboarding?{onboarding:{...n.onboarding}}:{}}}function Ng(n){return{focusedChannelId:n.focusedChannelId,pinnedChannelIds:[...n.pinnedChannelIds],activeThemeName:n.activeThemeName,activeThemeColorScheme:n.activeThemeColorScheme,appearanceMode:n.appearanceMode,themeJavaScriptConsentIds:[...n.themeJavaScriptConsentIds],acpEnabled:n.acpEnabled}}function KT(n){throw new Error(`Unexpected server event: ${JSON.stringify(n)}`)}function XT(n,t){var c;const e=n.snapshot,r=e.focusedChannel;if(t==="ArrowLeft"||t==="ArrowRight"){if(r===null||r.selectedPage===null)return!1;const u=r.pages.indexOf(r.selectedPage),f=u+(t==="ArrowLeft"?-1:1),p=(c=r.pages[f])==null?void 0:c.artifactIds[0];return u===-1||p===void 0?!1:(ib(),n.selectPage(r.id,p),!0)}const i=QT(e),o=r===null?-1:i.indexOf(r.id),a=o+(t==="ArrowUp"?-1:1),l=i[a];return o===-1||l===void 0?!1:(ib(),n.focusChannel(l).catch(()=>{}),!0)}function QT(n){const t=new Map(n.channels.map(o=>[o.id,o])),e=n.display.pinnedChannelIds.filter(o=>t.has(o)),r=new Set(e),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return[...e,...i]}function ib(){const n=document.activeElement;n instanceof HTMLElement&&n.blur()}const D6="0123456789ABCDEFGHJKMNPQRSTVWXYZ",cf=32,eC=16,O6=10,sb=0xffffffffffff;var vo;(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"})(vo||(vo={}));class tu extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function tC(n){const t=Math.floor(n()*cf)%cf;return D6.charAt(t)}function nC(n){const t=rC(),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 tu(vo.PRNGDetectFailure,"Failed to find a reliable PRNG")}function rC(){return oC()?self:typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:null}function iC(n,t){let e="";for(;n>0;n--)e=tC(t)+e;return e}function sC(n,t=O6){if(isNaN(n))throw new tu(vo.EncodeTimeValueMalformed,`Time must be a number: ${n}`);if(n>sb)throw new tu(vo.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${sb}: ${n}`);if(n<0)throw new tu(vo.EncodeTimeNegative,`Time must be positive: ${n}`);if(Number.isInteger(n)===!1)throw new tu(vo.EncodeTimeValueMalformed,`Time must be an integer: ${n}`);let e,r="";for(let i=t;i>0;i--)e=n%cf,r=D6.charAt(e)+r,n=(n-e)/cf;return r}function oC(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Zv(n,t){const e=nC(),r=Date.now();return sC(r,O6)+iC(eC,e)}const nu=Ln(),L6=Ln(),M6=Ln(),aC=Ln(),lg=Ln(),lC="store-";function ka(n){return new URL(n).origin}function cC(){return{authTokens:{}}}var To,Co,Ro;class uC extends zr{constructor(e,r,i={}){super();m(this,To);m(this,Co);m(this,Ro);d(this,To,`${lC}${e}`),d(this,Co,i.storage??fC());const o=s(this,Co).getItem(s(this,To));o===null?(d(this,Ro,r),s(this,Co).setItem(s(this,To),JSON.stringify(r))):d(this,Ro,pC(JSON.parse(o),r))}get(){return s(this,Ro)}set(e){d(this,Ro,e),s(this,Co).setItem(s(this,To),JSON.stringify(e)),this.dispatchEvent(new dt("change"))}}To=new WeakMap,Co=new WeakMap,Ro=new WeakMap;function ob(n,t){return n.authTokens[ka(t)]??null}function hC(n,t,e){return{authTokens:{...n.authTokens,[ka(t)]:e}}}function dC(n,t){const e=ka(t);if(!(e in n.authTokens))return n;const r={...n.authTokens};return delete r[e],{authTokens:r}}function fC(){const n=globalThis.localStorage;if(!n)throw new Error("LocalStore: no storage adapter supplied and window.localStorage is unavailable");return n}function pC(n,t){if(typeof n!="object"||n===null||Array.isArray(n))return t;const e=n.authTokens;if(typeof e!="object"||e===null||Array.isArray(e))return t;const r={};for(const[i,o]of Object.entries(e))if(typeof o=="string")try{r[ka(i)]=o}catch{}return{authTokens:r}}function $(n,t,e){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:a,traits:new Set},enumerable:!1}),l._zod.traits.has(n))return;l._zod.traits.add(n),t(l,c);const u=a.prototype,f=Object.keys(u);for(let p=0;p<f.length;p++){const y=f[p];y in l||(l[y]=u[y].bind(l))}}const i=(e==null?void 0:e.Parent)??Object;class o extends i{}Object.defineProperty(o,"name",{value:n});function a(l){var c;const u=e!=null&&e.Parent?new o:this;r(u,l),(c=u._zod).deferred??(c.deferred=[]);for(const f of u._zod.deferred)f();return u}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:l=>{var c,u;return e!=null&&e.Parent&&l instanceof e.Parent?!0:(u=(c=l==null?void 0:l._zod)==null?void 0:c.traits)==null?void 0:u.has(n)}}),Object.defineProperty(a,"name",{value:n}),a}class al extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class N6 extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}const z6={};function Us(n){return z6}function H6(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 zg(n,t){return typeof t=="bigint"?t.toString():t}function Tp(n){return{get value(){{const t=n();return Object.defineProperty(this,"value",{value:t}),t}}}}function Uv(n){return n==null}function qv(n){const t=n.startsWith("^")?1:0,e=n.endsWith("$")?n.length-1:n.length;return n.slice(t,e)}function mC(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 o=e>i?e:i,a=Number.parseInt(n.toFixed(o).replace(".","")),l=Number.parseInt(t.toFixed(o).replace(".",""));return a%l/10**o}const ab=Symbol("evaluating");function ke(n,t,e){let r;Object.defineProperty(n,t,{get(){if(r!==ab)return r===void 0&&(r=ab,r=e()),r},set(i){Object.defineProperty(n,t,{value:i})},configurable:!0})}function Ta(n,t,e){Object.defineProperty(n,t,{value:e,writable:!0,enumerable:!0,configurable:!0})}function js(...n){const t={};for(const e of n){const r=Object.getOwnPropertyDescriptors(e);Object.assign(t,r)}return Object.defineProperties({},t)}function lb(n){return JSON.stringify(n)}function gC(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const Z6="captureStackTrace"in Error?Error.captureStackTrace:(...n)=>{};function Ru(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)}const vC=Tp(()=>{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 gc(n){if(Ru(n)===!1)return!1;const t=n.constructor;if(t===void 0||typeof t!="function")return!0;const e=t.prototype;return!(Ru(e)===!1||Object.prototype.hasOwnProperty.call(e,"isPrototypeOf")===!1)}function U6(n){return gc(n)?{...n}:Array.isArray(n)?[...n]:n}const yC=new Set(["string","number","symbol"]);function vc(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ws(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 J(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 wC(n){return Object.keys(n).filter(t=>n[t]._zod.optin==="optional"&&n[t]._zod.optout==="optional")}const bC={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 SC(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 o=js(n._zod.def,{get shape(){const a={};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(a[l]=e.shape[l])}return Ta(this,"shape",a),a},checks:[]});return Ws(n,o)}function _C(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 o=js(n._zod.def,{get shape(){const a={...n._zod.def.shape};for(const l in t){if(!(l in e.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete a[l]}return Ta(this,"shape",a),a},checks:[]});return Ws(n,o)}function AC(n,t){if(!gc(t))throw new Error("Invalid input to extend: expected a plain object");const e=n._zod.def.checks;if(e&&e.length>0){const o=n._zod.def.shape;for(const a in t)if(Object.getOwnPropertyDescriptor(o,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=js(n._zod.def,{get shape(){const o={...n._zod.def.shape,...t};return Ta(this,"shape",o),o}});return Ws(n,i)}function EC(n,t){if(!gc(t))throw new Error("Invalid input to safeExtend: expected a plain object");const e=js(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t};return Ta(this,"shape",r),r}});return Ws(n,e)}function kC(n,t){const e=js(n._zod.def,{get shape(){const r={...n._zod.def.shape,...t._zod.def.shape};return Ta(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return Ws(n,e)}function TC(n,t,e){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const a=js(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(e)for(const u in e){if(!(u in l))throw new Error(`Unrecognized key: "${u}"`);e[u]&&(c[u]=n?new n({type:"optional",innerType:l[u]}):l[u])}else for(const u in l)c[u]=n?new n({type:"optional",innerType:l[u]}):l[u];return Ta(this,"shape",c),c},checks:[]});return Ws(t,a)}function CC(n,t,e){const r=js(t._zod.def,{get shape(){const i=t._zod.def.shape,o={...i};if(e)for(const a in e){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);e[a]&&(o[a]=new n({type:"nonoptional",innerType:i[a]}))}else for(const a in i)o[a]=new n({type:"nonoptional",innerType:i[a]});return Ta(this,"shape",o),o}});return Ws(t,r)}function rl(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 il(n,t){return t.map(e=>{var r;return(r=e).path??(r.path=[]),e.path.unshift(n),e})}function gd(n){return typeof n=="string"?n:n==null?void 0:n.message}function qs(n,t,e){var i,o,a,l,c,u;const r={...n,path:n.path??[]};if(!n.message){const f=gd((a=(o=(i=n.inst)==null?void 0:i._zod.def)==null?void 0:o.error)==null?void 0:a.call(o,n))??gd((l=t==null?void 0:t.error)==null?void 0:l.call(t,n))??gd((c=e.customError)==null?void 0:c.call(e,n))??gd((u=e.localeError)==null?void 0:u.call(e,n))??"Invalid input";r.message=f}return delete r.inst,delete r.continue,t!=null&&t.reportInput||delete r.input,r}function Fv(n){return Array.isArray(n)?"array":typeof n=="string"?"string":"unknown"}function Iu(...n){const[t,e,r]=n;return typeof t=="string"?{message:t,code:"custom",input:e,inst:r}:{...t}}const q6=(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,zg,2),Object.defineProperty(n,"toString",{value:()=>n.message,enumerable:!1})},F6=$("$ZodError",q6),V6=$("$ZodError",q6,{Parent:Error});function RC(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 IC(n,t=e=>e.message){const e={_errors:[]},r=i=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(a=>r({issues:a}));else if(o.code==="invalid_key")r({issues:o.issues});else if(o.code==="invalid_element")r({issues:o.issues});else if(o.path.length===0)e._errors.push(t(o));else{let a=e,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(a[c]=a[c]||{_errors:[]},a[c]._errors.push(t(o))):a[c]=a[c]||{_errors:[]},a=a[c],l++}}};return r(n),e}const Vv=n=>(t,e,r,i)=>{const o=r?Object.assign(r,{async:!1}):{async:!1},a=t._zod.run({value:e,issues:[]},o);if(a instanceof Promise)throw new al;if(a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qs(c,o,Us())));throw Z6(l,i==null?void 0:i.callee),l}return a.value},Bv=n=>async(t,e,r,i)=>{const o=r?Object.assign(r,{async:!0}):{async:!0};let a=t._zod.run({value:e,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){const l=new((i==null?void 0:i.Err)??n)(a.issues.map(c=>qs(c,o,Us())));throw Z6(l,i==null?void 0:i.callee),l}return a.value},Cp=n=>(t,e,r)=>{const i=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:e,issues:[]},i);if(o instanceof Promise)throw new al;return o.issues.length?{success:!1,error:new(n??F6)(o.issues.map(a=>qs(a,i,Us())))}:{success:!0,data:o.value}},$C=Cp(V6),Rp=n=>async(t,e,r)=>{const i=r?Object.assign(r,{async:!0}):{async:!0};let o=t._zod.run({value:e,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new n(o.issues.map(a=>qs(a,i,Us())))}:{success:!0,data:o.value}},xC=Rp(V6),PC=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Vv(n)(t,e,i)},DC=n=>(t,e,r)=>Vv(n)(t,e,r),OC=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Bv(n)(t,e,i)},LC=n=>async(t,e,r)=>Bv(n)(t,e,r),MC=n=>(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Cp(n)(t,e,i)},NC=n=>(t,e,r)=>Cp(n)(t,e,r),zC=n=>async(t,e,r)=>{const i=r?Object.assign(r,{direction:"backward"}):{direction:"backward"};return Rp(n)(t,e,i)},HC=n=>async(t,e,r)=>Rp(n)(t,e,r),ZC=/^[cC][^\s-]{8,}$/,UC=/^[0-9a-z]+$/,qC=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,FC=/^[0-9a-vA-V]{20}$/,VC=/^[A-Za-z0-9]{27}$/,BC=/^[a-zA-Z0-9_-]{21}$/,jC=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,WC=/^([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})$/,cb=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)$/,GC=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,JC="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function YC(){return new RegExp(JC,"u")}const KC=/^(?:(?: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])$/,XC=/^(([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}|:))$/,QC=/^((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])$/,eR=/^(([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])$/,tR=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,B6=/^[A-Za-z0-9_-]*$/,nR=/^\+[1-9]\d{6,14}$/,j6="(?:(?:\\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])))",rR=new RegExp(`^${j6}$`);function W6(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 iR(n){return new RegExp(`^${W6(n)}$`)}function sR(n){const t=W6({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(`^${j6}T(?:${r})$`)}const oR=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}$`)},aR=/^-?\d+$/,G6=/^-?\d+(?:\.\d+)?$/,lR=/^(?:true|false)$/i,cR=/^[^A-Z]*$/,uR=/^[^a-z]*$/,Qt=$("$ZodCheck",(n,t)=>{var e;n._zod??(n._zod={}),n._zod.def=t,(e=n._zod).onattach??(e.onattach=[])}),J6={number:"number",bigint:"bigint",object:"date"},Y6=$("$ZodCheckLessThan",(n,t)=>{Qt.init(n,t);const e=J6[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<o&&(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})}}),K6=$("$ZodCheckGreaterThan",(n,t)=>{Qt.init(n,t);const e=J6[typeof t.value];n._zod.onattach.push(r=>{const i=r._zod.bag,o=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>o&&(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})}}),hR=$("$ZodCheckMultipleOf",(n,t)=>{Qt.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):mC(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})}}),dR=$("$ZodCheckNumberFormat",(n,t)=>{var a;Qt.init(n,t),t.format=t.format||"float64";const e=(a=t.format)==null?void 0:a.includes("int"),r=e?"int":"number",[i,o]=bC[t.format];n._zod.onattach.push(l=>{const c=l._zod.bag;c.format=t.format,c.minimum=i,c.maximum=o,e&&(c.pattern=aR)}),n._zod.check=l=>{const c=l.value;if(e){if(!Number.isInteger(c)){l.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:n});return}if(!Number.isSafeInteger(c)){c>0?l.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort}):l.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:n,origin:r,inclusive:!0,continue:!t.abort});return}}c<i&&l.issues.push({origin:"number",input:c,code:"too_small",minimum:i,inclusive:!0,inst:n,continue:!t.abort}),c>o&&l.issues.push({origin:"number",input:c,code:"too_big",maximum:o,inclusive:!0,inst:n,continue:!t.abort})}}),fR=$("$ZodCheckMaxLength",(n,t)=>{var e;Qt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Uv(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),n._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const a=Fv(i);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),pR=$("$ZodCheckMinLength",(n,t)=>{var e;Qt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Uv(i)&&i.length!==void 0}),n._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),n._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const a=Fv(i);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:n,continue:!t.abort})}}),mR=$("$ZodCheckLengthEquals",(n,t)=>{var e;Qt.init(n,t),(e=n._zod.def).when??(e.when=r=>{const i=r.value;return!Uv(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,o=i.length;if(o===t.length)return;const a=Fv(i),l=o>t.length;r.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:n,continue:!t.abort})}}),Ip=$("$ZodCheckStringFormat",(n,t)=>{var e,r;Qt.init(n,t),n._zod.onattach.push(i=>{const o=i._zod.bag;o.format=t.format,t.pattern&&(o.patterns??(o.patterns=new Set),o.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=()=>{})}),gR=$("$ZodCheckRegex",(n,t)=>{Ip.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})}}),vR=$("$ZodCheckLowerCase",(n,t)=>{t.pattern??(t.pattern=cR),Ip.init(n,t)}),yR=$("$ZodCheckUpperCase",(n,t)=>{t.pattern??(t.pattern=uR),Ip.init(n,t)}),wR=$("$ZodCheckIncludes",(n,t)=>{Qt.init(n,t);const e=vc(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${e}`:e);t.pattern=r,n._zod.onattach.push(i=>{const o=i._zod.bag;o.patterns??(o.patterns=new Set),o.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})}}),bR=$("$ZodCheckStartsWith",(n,t)=>{Qt.init(n,t);const e=new RegExp(`^${vc(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=$("$ZodCheckEndsWith",(n,t)=>{Qt.init(n,t);const e=new RegExp(`.*${vc(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})}}),_R=$("$ZodCheckOverwrite",(n,t)=>{Qt.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(`
|
|
27
|
+
`).filter(a=>a),i=Math.min(...r.map(a=>a.length-a.trimStart().length)),o=r.map(a=>a.slice(i)).map(a=>" ".repeat(this.indent*2)+a);for(const a of o)this.content.push(a)}compile(){const t=Function,e=this==null?void 0:this.args,i=[...((this==null?void 0:this.content)??[""]).map(o=>` ${o}`)];return new t(...e,i.join(`
|
|
28
|
+
`))}}const ER={major:4,minor:3,patch:6},qe=$("$ZodType",(n,t)=>{var i;var e;n??(n={}),n._zod.def=t,n._zod.bag=n._zod.bag||{},n._zod.version=ER;const r=[...n._zod.def.checks??[]];n._zod.traits.has("$ZodCheck")&&r.unshift(n);for(const o of r)for(const a of o._zod.onattach)a(n);if(r.length===0)(e=n._zod).deferred??(e.deferred=[]),(i=n._zod.deferred)==null||i.push(()=>{n._zod.run=n._zod.parse});else{const o=(l,c,u)=>{let f=rl(l),p;for(const y of c){if(y._zod.def.when){if(!y._zod.def.when(l))continue}else if(f)continue;const v=l.issues.length,S=y._zod.check(l);if(S instanceof Promise&&(u==null?void 0:u.async)===!1)throw new al;if(p||S instanceof Promise)p=(p??Promise.resolve()).then(async()=>{await S,l.issues.length!==v&&(f||(f=rl(l,v)))});else{if(l.issues.length===v)continue;f||(f=rl(l,v))}}return p?p.then(()=>l):l},a=(l,c,u)=>{if(rl(l))return l.aborted=!0,l;const f=o(c,r,u);if(f instanceof Promise){if(u.async===!1)throw new al;return f.then(p=>n._zod.parse(p,u))}return n._zod.parse(f,u)};n._zod.run=(l,c)=>{if(c.skipChecks)return n._zod.parse(l,c);if(c.direction==="backward"){const f=n._zod.parse({value:l.value,issues:[]},{...c,skipChecks:!0});return f instanceof Promise?f.then(p=>a(p,l,c)):a(f,l,c)}const u=n._zod.parse(l,c);if(u instanceof Promise){if(c.async===!1)throw new al;return u.then(f=>o(f,r,c))}return o(u,r,c)}}ke(n,"~standard",()=>({validate:o=>{var a;try{const l=$C(n,o);return l.success?{value:l.data}:{issues:(a=l.error)==null?void 0:a.issues}}catch{return xC(n,o).then(c=>{var u;return c.success?{value:c.data}:{issues:(u=c.error)==null?void 0:u.issues}})}},vendor:"zod",version:1}))}),jv=$("$ZodString",(n,t)=>{var e;qe.init(n,t),n._zod.pattern=[...((e=n==null?void 0:n._zod.bag)==null?void 0:e.patterns)??[]].pop()??oR(n._zod.bag),n._zod.parse=(r,i)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:n}),r}}),ze=$("$ZodStringFormat",(n,t)=>{Ip.init(n,t),jv.init(n,t)}),kR=$("$ZodGUID",(n,t)=>{t.pattern??(t.pattern=WC),ze.init(n,t)}),TR=$("$ZodUUID",(n,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=cb(r))}else t.pattern??(t.pattern=cb());ze.init(n,t)}),CR=$("$ZodEmail",(n,t)=>{t.pattern??(t.pattern=GC),ze.init(n,t)}),RR=$("$ZodURL",(n,t)=>{ze.init(n,t),n._zod.check=e=>{try{const r=e.value.trim(),i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:e.value,inst:n,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||e.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:e.value,inst:n,continue:!t.abort})),t.normalize?e.value=i.href:e.value=r;return}catch{e.issues.push({code:"invalid_format",format:"url",input:e.value,inst:n,continue:!t.abort})}}}),IR=$("$ZodEmoji",(n,t)=>{t.pattern??(t.pattern=YC()),ze.init(n,t)}),$R=$("$ZodNanoID",(n,t)=>{t.pattern??(t.pattern=BC),ze.init(n,t)}),xR=$("$ZodCUID",(n,t)=>{t.pattern??(t.pattern=ZC),ze.init(n,t)}),PR=$("$ZodCUID2",(n,t)=>{t.pattern??(t.pattern=UC),ze.init(n,t)}),DR=$("$ZodULID",(n,t)=>{t.pattern??(t.pattern=qC),ze.init(n,t)}),OR=$("$ZodXID",(n,t)=>{t.pattern??(t.pattern=FC),ze.init(n,t)}),LR=$("$ZodKSUID",(n,t)=>{t.pattern??(t.pattern=VC),ze.init(n,t)}),MR=$("$ZodISODateTime",(n,t)=>{t.pattern??(t.pattern=sR(t)),ze.init(n,t)}),NR=$("$ZodISODate",(n,t)=>{t.pattern??(t.pattern=rR),ze.init(n,t)}),zR=$("$ZodISOTime",(n,t)=>{t.pattern??(t.pattern=iR(t)),ze.init(n,t)}),HR=$("$ZodISODuration",(n,t)=>{t.pattern??(t.pattern=jC),ze.init(n,t)}),ZR=$("$ZodIPv4",(n,t)=>{t.pattern??(t.pattern=KC),ze.init(n,t),n._zod.bag.format="ipv4"}),UR=$("$ZodIPv6",(n,t)=>{t.pattern??(t.pattern=XC),ze.init(n,t),n._zod.bag.format="ipv6",n._zod.check=e=>{try{new URL(`http://[${e.value}]`)}catch{e.issues.push({code:"invalid_format",format:"ipv6",input:e.value,inst:n,continue:!t.abort})}}}),qR=$("$ZodCIDRv4",(n,t)=>{t.pattern??(t.pattern=QC),ze.init(n,t)}),FR=$("$ZodCIDRv6",(n,t)=>{t.pattern??(t.pattern=eR),ze.init(n,t),n._zod.check=e=>{const r=e.value.split("/");try{if(r.length!==2)throw new Error;const[i,o]=r;if(!o)throw new Error;const a=Number(o);if(`${a}`!==o)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${i}]`)}catch{e.issues.push({code:"invalid_format",format:"cidrv6",input:e.value,inst:n,continue:!t.abort})}}});function X6(n){if(n==="")return!0;if(n.length%4!==0)return!1;try{return atob(n),!0}catch{return!1}}const VR=$("$ZodBase64",(n,t)=>{t.pattern??(t.pattern=tR),ze.init(n,t),n._zod.bag.contentEncoding="base64",n._zod.check=e=>{X6(e.value)||e.issues.push({code:"invalid_format",format:"base64",input:e.value,inst:n,continue:!t.abort})}});function BR(n){if(!B6.test(n))return!1;const t=n.replace(/[-_]/g,r=>r==="-"?"+":"/"),e=t.padEnd(Math.ceil(t.length/4)*4,"=");return X6(e)}const jR=$("$ZodBase64URL",(n,t)=>{t.pattern??(t.pattern=B6),ze.init(n,t),n._zod.bag.contentEncoding="base64url",n._zod.check=e=>{BR(e.value)||e.issues.push({code:"invalid_format",format:"base64url",input:e.value,inst:n,continue:!t.abort})}}),WR=$("$ZodE164",(n,t)=>{t.pattern??(t.pattern=nR),ze.init(n,t)});function GR(n,t=null){try{const e=n.split(".");if(e.length!==3)return!1;const[r]=e;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const JR=$("$ZodJWT",(n,t)=>{ze.init(n,t),n._zod.check=e=>{GR(e.value,t.alg)||e.issues.push({code:"invalid_format",format:"jwt",input:e.value,inst:n,continue:!t.abort})}}),Q6=$("$ZodNumber",(n,t)=>{qe.init(n,t),n._zod.pattern=n._zod.bag.pattern??G6,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=Number(e.value)}catch{}const i=e.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return e;const o=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return e.issues.push({expected:"number",code:"invalid_type",input:i,inst:n,...o?{received:o}:{}}),e}}),YR=$("$ZodNumberFormat",(n,t)=>{dR.init(n,t),Q6.init(n,t)}),KR=$("$ZodBoolean",(n,t)=>{qe.init(n,t),n._zod.pattern=lR,n._zod.parse=(e,r)=>{if(t.coerce)try{e.value=!!e.value}catch{}const i=e.value;return typeof i=="boolean"||e.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:n}),e}}),XR=$("$ZodUnknown",(n,t)=>{qe.init(n,t),n._zod.parse=e=>e}),QR=$("$ZodNever",(n,t)=>{qe.init(n,t),n._zod.parse=(e,r)=>(e.issues.push({expected:"never",code:"invalid_type",input:e.value,inst:n}),e)});function ub(n,t,e){n.issues.length&&t.issues.push(...il(e,n.issues)),t.value[e]=n.value}const e3=$("$ZodArray",(n,t)=>{qe.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!Array.isArray(i))return e.issues.push({expected:"array",code:"invalid_type",input:i,inst:n}),e;e.value=Array(i.length);const o=[];for(let a=0;a<i.length;a++){const l=i[a],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?o.push(c.then(u=>ub(u,e,a))):ub(c,e,a)}return o.length?Promise.all(o).then(()=>e):e}});function uf(n,t,e,r,i){if(n.issues.length){if(i&&!(e in r))return;t.issues.push(...il(e,n.issues))}n.value===void 0?e in r&&(t.value[e]=void 0):t.value[e]=n.value}function eS(n){var r,i,o,a;const t=Object.keys(n.shape);for(const l of t)if(!((a=(o=(i=(r=n.shape)==null?void 0:r[l])==null?void 0:i._zod)==null?void 0:o.traits)!=null&&a.has("$ZodType")))throw new Error(`Invalid element at key "${l}": expected a Zod schema`);const e=wC(n.shape);return{...n,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(e)}}function tS(n,t,e,r,i,o){const a=[],l=i.keySet,c=i.catchall._zod,u=c.def.type,f=c.optout==="optional";for(const p in t){if(l.has(p))continue;if(u==="never"){a.push(p);continue}const y=c.run({value:t[p],issues:[]},r);y instanceof Promise?n.push(y.then(v=>uf(v,e,p,t,f))):uf(y,e,p,t,f)}return a.length&&e.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:o}),n.length?Promise.all(n).then(()=>e):e}const t3=$("$ZodObject",(n,t)=>{qe.init(n,t);const e=Object.getOwnPropertyDescriptor(t,"shape");if(!(e!=null&&e.get)){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Tp(()=>eS(t));ke(n._zod,"propValues",()=>{const l=t.shape,c={};for(const u in l){const f=l[u]._zod;if(f.values){c[u]??(c[u]=new Set);for(const p of f.values)c[u].add(p)}}return c});const i=Ru,o=t.catchall;let a;n._zod.parse=(l,c)=>{a??(a=r.value);const u=l.value;if(!i(u))return l.issues.push({expected:"object",code:"invalid_type",input:u,inst:n}),l;l.value={};const f=[],p=a.shape;for(const y of a.keys){const v=p[y],S=v._zod.optout==="optional",_=v._zod.run({value:u[y],issues:[]},c);_ instanceof Promise?f.push(_.then(R=>uf(R,l,y,u,S))):uf(_,l,y,u,S)}return o?tS(f,u,l,c,r.value,n):f.length?Promise.all(f).then(()=>l):l}}),n3=$("$ZodObjectJIT",(n,t)=>{t3.init(n,t);const e=n._zod.parse,r=Tp(()=>eS(t)),i=y=>{var N;const v=new AR(["shape","payload","ctx"]),S=r.value,_=D=>{const B=lb(D);return`shape[${B}]._zod.run({ value: input[${B}], issues: [] }, ctx)`};v.write("const input = payload.value;");const R=Object.create(null);let H=0;for(const D of S.keys)R[D]=`key_${H++}`;v.write("const newResult = {};");for(const D of S.keys){const B=R[D],q=lb(D),F=y[D],Q=((N=F==null?void 0:F._zod)==null?void 0:N.optout)==="optional";v.write(`const ${B} = ${_(D)};`),Q?v.write(`
|
|
29
|
+
if (${B}.issues.length) {
|
|
30
|
+
if (${q} in input) {
|
|
31
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
32
|
+
...iss,
|
|
33
|
+
path: iss.path ? [${q}, ...iss.path] : [${q}]
|
|
34
|
+
})));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (${B}.value === undefined) {
|
|
39
|
+
if (${q} in input) {
|
|
40
|
+
newResult[${q}] = undefined;
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
newResult[${q}] = ${B}.value;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
`):v.write(`
|
|
47
|
+
if (${B}.issues.length) {
|
|
48
|
+
payload.issues = payload.issues.concat(${B}.issues.map(iss => ({
|
|
49
|
+
...iss,
|
|
50
|
+
path: iss.path ? [${q}, ...iss.path] : [${q}]
|
|
51
|
+
})));
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (${B}.value === undefined) {
|
|
55
|
+
if (${q} in input) {
|
|
56
|
+
newResult[${q}] = undefined;
|
|
57
|
+
}
|
|
58
|
+
} else {
|
|
59
|
+
newResult[${q}] = ${B}.value;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
`)}v.write("payload.value = newResult;"),v.write("return payload;");const P=v.compile();return(D,B)=>P(y,D,B)};let o;const a=Ru,l=!z6.jitless,u=l&&vC.value,f=t.catchall;let p;n._zod.parse=(y,v)=>{p??(p=r.value);const S=y.value;return a(S)?l&&u&&(v==null?void 0:v.async)===!1&&v.jitless!==!0?(o||(o=i(t.shape)),y=o(y,v),f?tS([],S,y,v,p,n):y):e(y,v):(y.issues.push({expected:"object",code:"invalid_type",input:S,inst:n}),y)}});function hb(n,t,e,r){for(const o of n)if(o.issues.length===0)return t.value=o.value,t;const i=n.filter(o=>!rl(o));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(o=>o.issues.map(a=>qs(a,r,Us())))}),t)}const nS=$("$ZodUnion",(n,t)=>{qe.init(n,t),ke(n._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),ke(n._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),ke(n._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),ke(n._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){const i=t.options.map(o=>o._zod.pattern);return new RegExp(`^(${i.map(o=>qv(o.source)).join("|")})$`)}});const e=t.options.length===1,r=t.options[0]._zod.run;n._zod.parse=(i,o)=>{if(e)return r(i,o);let a=!1;const l=[];for(const c of t.options){const u=c._zod.run({value:i.value,issues:[]},o);if(u instanceof Promise)l.push(u),a=!0;else{if(u.issues.length===0)return u;l.push(u)}}return a?Promise.all(l).then(c=>hb(c,i,n,o)):hb(l,i,n,o)}}),r3=$("$ZodDiscriminatedUnion",(n,t)=>{t.inclusive=!1,nS.init(n,t);const e=n._zod.parse;ke(n._zod,"propValues",()=>{const i={};for(const o of t.options){const a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const[l,c]of Object.entries(a)){i[l]||(i[l]=new Set);for(const u of c)i[l].add(u)}}return i});const r=Tp(()=>{var a;const i=t.options,o=new Map;for(const l of i){const c=(a=l._zod.propValues)==null?void 0:a[t.discriminator];if(!c||c.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(l)}"`);for(const u of c){if(o.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);o.set(u,l)}}return o});n._zod.parse=(i,o)=>{const a=i.value;if(!Ru(a))return i.issues.push({code:"invalid_type",expected:"object",input:a,inst:n}),i;const l=r.value.get(a==null?void 0:a[t.discriminator]);return l?l._zod.run(i,o):t.unionFallback?e(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:a,path:[t.discriminator],inst:n}),i)}}),i3=$("$ZodIntersection",(n,t)=>{qe.init(n,t),n._zod.parse=(e,r)=>{const i=e.value,o=t.left._zod.run({value:i,issues:[]},r),a=t.right._zod.run({value:i,issues:[]},r);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([c,u])=>db(e,c,u)):db(e,o,a)}});function Hg(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(gc(n)&&gc(t)){const e=Object.keys(t),r=Object.keys(n).filter(o=>e.indexOf(o)!==-1),i={...n,...t};for(const o of r){const a=Hg(n[o],t[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};i[o]=a.data}return{valid:!0,data:i}}if(Array.isArray(n)&&Array.isArray(t)){if(n.length!==t.length)return{valid:!1,mergeErrorPath:[]};const e=[];for(let r=0;r<n.length;r++){const i=n[r],o=t[r],a=Hg(i,o);if(!a.valid)return{valid:!1,mergeErrorPath:[r,...a.mergeErrorPath]};e.push(a.data)}return{valid:!0,data:e}}return{valid:!1,mergeErrorPath:[]}}function db(n,t,e){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else n.issues.push(l);for(const l of e.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else n.issues.push(l);const o=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(o.length&&i&&n.issues.push({...i,keys:o}),rl(n))return n;const a=Hg(t.value,e.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return n.value=a.data,n}const s3=$("$ZodRecord",(n,t)=>{qe.init(n,t),n._zod.parse=(e,r)=>{const i=e.value;if(!gc(i))return e.issues.push({expected:"record",code:"invalid_type",input:i,inst:n}),e;const o=[],a=t.keyType._zod.values;if(a){e.value={};const l=new Set;for(const u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){l.add(typeof u=="number"?u.toString():u);const f=t.valueType._zod.run({value:i[u],issues:[]},r);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&e.issues.push(...il(u,p.issues)),e.value[u]=p.value})):(f.issues.length&&e.issues.push(...il(u,f.issues)),e.value[u]=f.value)}let c;for(const u in i)l.has(u)||(c=c??[],c.push(u));c&&c.length>0&&e.issues.push({code:"unrecognized_keys",input:i,inst:n,keys:c})}else{e.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__")continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&G6.test(l)&&c.issues.length){const p=t.keyType._zod.run({value:Number(l),issues:[]},r);if(p instanceof Promise)throw new Error("Async schemas not supported in object keys currently");p.issues.length===0&&(c=p)}if(c.issues.length){t.mode==="loose"?e.value[l]=i[l]:e.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(p=>qs(p,r,Us())),input:l,path:[l],inst:n});continue}const f=t.valueType._zod.run({value:i[l],issues:[]},r);f instanceof Promise?o.push(f.then(p=>{p.issues.length&&e.issues.push(...il(l,p.issues)),e.value[c.value]=p.value})):(f.issues.length&&e.issues.push(...il(l,f.issues)),e.value[c.value]=f.value)}}return o.length?Promise.all(o).then(()=>e):e}}),o3=$("$ZodEnum",(n,t)=>{qe.init(n,t);const e=H6(t.entries),r=new Set(e);n._zod.values=r,n._zod.pattern=new RegExp(`^(${e.filter(i=>yC.has(typeof i)).map(i=>typeof i=="string"?vc(i):i.toString()).join("|")})$`),n._zod.parse=(i,o)=>{const a=i.value;return r.has(a)||i.issues.push({code:"invalid_value",values:e,input:a,inst:n}),i}}),a3=$("$ZodLiteral",(n,t)=>{if(qe.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"?vc(r):r?vc(r.toString()):String(r)).join("|")})$`),n._zod.parse=(r,i)=>{const o=r.value;return e.has(o)||r.issues.push({code:"invalid_value",values:t.values,input:o,inst:n}),r}}),l3=$("$ZodTransform",(n,t)=>{qe.init(n,t),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new N6(n.constructor.name);const i=t.transform(e.value,e);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(a=>(e.value=a,e));if(i instanceof Promise)throw new al;return e.value=i,e}});function fb(n,t){return n.issues.length&&t===void 0?{issues:[],value:void 0}:n}const rS=$("$ZodOptional",(n,t)=>{qe.init(n,t),n._zod.optin="optional",n._zod.optout="optional",ke(n._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),ke(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qv(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(o=>fb(o,e.value)):fb(i,e.value)}return e.value===void 0?e:t.innerType._zod.run(e,r)}}),c3=$("$ZodExactOptional",(n,t)=>{rS.init(n,t),ke(n._zod,"values",()=>t.innerType._zod.values),ke(n._zod,"pattern",()=>t.innerType._zod.pattern),n._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),u3=$("$ZodNullable",(n,t)=>{qe.init(n,t),ke(n._zod,"optin",()=>t.innerType._zod.optin),ke(n._zod,"optout",()=>t.innerType._zod.optout),ke(n._zod,"pattern",()=>{const e=t.innerType._zod.pattern;return e?new RegExp(`^(${qv(e.source)}|null)$`):void 0}),ke(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)}),h3=$("$ZodDefault",(n,t)=>{qe.init(n,t),n._zod.optin="optional",ke(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(o=>pb(o,t)):pb(i,t)}});function pb(n,t){return n.value===void 0&&(n.value=t.defaultValue),n}const d3=$("$ZodPrefault",(n,t)=>{qe.init(n,t),n._zod.optin="optional",ke(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))}),f3=$("$ZodNonOptional",(n,t)=>{qe.init(n,t),ke(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(o=>mb(o,n)):mb(i,n)}});function mb(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 p3=$("$ZodCatch",(n,t)=>{qe.init(n,t),ke(n._zod,"optin",()=>t.innerType._zod.optin),ke(n._zod,"optout",()=>t.innerType._zod.optout),ke(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(o=>(e.value=o.value,o.issues.length&&(e.value=t.catchValue({...e,error:{issues:o.issues.map(a=>qs(a,r,Us()))},input:e.value}),e.issues=[]),e)):(e.value=i.value,i.issues.length&&(e.value=t.catchValue({...e,error:{issues:i.issues.map(o=>qs(o,r,Us()))},input:e.value}),e.issues=[]),e)}}),m3=$("$ZodPipe",(n,t)=>{qe.init(n,t),ke(n._zod,"values",()=>t.in._zod.values),ke(n._zod,"optin",()=>t.in._zod.optin),ke(n._zod,"optout",()=>t.out._zod.optout),ke(n._zod,"propValues",()=>t.in._zod.propValues),n._zod.parse=(e,r)=>{if(r.direction==="backward"){const o=t.out._zod.run(e,r);return o instanceof Promise?o.then(a=>vd(a,t.in,r)):vd(o,t.in,r)}const i=t.in._zod.run(e,r);return i instanceof Promise?i.then(o=>vd(o,t.out,r)):vd(i,t.out,r)}});function vd(n,t,e){return n.issues.length?(n.aborted=!0,n):t._zod.run({value:n.value,issues:n.issues},e)}const g3=$("$ZodReadonly",(n,t)=>{qe.init(n,t),ke(n._zod,"propValues",()=>t.innerType._zod.propValues),ke(n._zod,"values",()=>t.innerType._zod.values),ke(n._zod,"optin",()=>{var e,r;return(r=(e=t.innerType)==null?void 0:e._zod)==null?void 0:r.optin}),ke(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(gb):gb(i)}});function gb(n){return n.value=Object.freeze(n.value),n}const v3=$("$ZodCustom",(n,t)=>{Qt.init(n,t),qe.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(o=>vb(o,e,r,n));vb(i,e,r,n)}});function vb(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(Iu(i))}}var yb;class y3{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 w3(){return new y3}(yb=globalThis).__zod_globalRegistry??(yb.__zod_globalRegistry=w3());const ru=globalThis.__zod_globalRegistry;function b3(n,t){return new n({type:"string",...J(t)})}function S3(n,t){return new n({type:"string",format:"email",check:"string_format",abort:!1,...J(t)})}function wb(n,t){return new n({type:"string",format:"guid",check:"string_format",abort:!1,...J(t)})}function _3(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,...J(t)})}function A3(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...J(t)})}function E3(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...J(t)})}function k3(n,t){return new n({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...J(t)})}function T3(n,t){return new n({type:"string",format:"url",check:"string_format",abort:!1,...J(t)})}function C3(n,t){return new n({type:"string",format:"emoji",check:"string_format",abort:!1,...J(t)})}function R3(n,t){return new n({type:"string",format:"nanoid",check:"string_format",abort:!1,...J(t)})}function I3(n,t){return new n({type:"string",format:"cuid",check:"string_format",abort:!1,...J(t)})}function $3(n,t){return new n({type:"string",format:"cuid2",check:"string_format",abort:!1,...J(t)})}function x3(n,t){return new n({type:"string",format:"ulid",check:"string_format",abort:!1,...J(t)})}function P3(n,t){return new n({type:"string",format:"xid",check:"string_format",abort:!1,...J(t)})}function D3(n,t){return new n({type:"string",format:"ksuid",check:"string_format",abort:!1,...J(t)})}function O3(n,t){return new n({type:"string",format:"ipv4",check:"string_format",abort:!1,...J(t)})}function L3(n,t){return new n({type:"string",format:"ipv6",check:"string_format",abort:!1,...J(t)})}function M3(n,t){return new n({type:"string",format:"cidrv4",check:"string_format",abort:!1,...J(t)})}function N3(n,t){return new n({type:"string",format:"cidrv6",check:"string_format",abort:!1,...J(t)})}function z3(n,t){return new n({type:"string",format:"base64",check:"string_format",abort:!1,...J(t)})}function H3(n,t){return new n({type:"string",format:"base64url",check:"string_format",abort:!1,...J(t)})}function Z3(n,t){return new n({type:"string",format:"e164",check:"string_format",abort:!1,...J(t)})}function U3(n,t){return new n({type:"string",format:"jwt",check:"string_format",abort:!1,...J(t)})}function q3(n,t){return new n({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...J(t)})}function F3(n,t){return new n({type:"string",format:"date",check:"string_format",...J(t)})}function V3(n,t){return new n({type:"string",format:"time",check:"string_format",precision:null,...J(t)})}function B3(n,t){return new n({type:"string",format:"duration",check:"string_format",...J(t)})}function j3(n,t){return new n({type:"number",checks:[],...J(t)})}function W3(n,t){return new n({type:"number",check:"number_format",abort:!1,format:"safeint",...J(t)})}function G3(n,t){return new n({type:"boolean",...J(t)})}function J3(n){return new n({type:"unknown"})}function Y3(n,t){return new n({type:"never",...J(t)})}function bb(n,t){return new Y6({check:"less_than",...J(t),value:n,inclusive:!1})}function cg(n,t){return new Y6({check:"less_than",...J(t),value:n,inclusive:!0})}function Sb(n,t){return new K6({check:"greater_than",...J(t),value:n,inclusive:!1})}function ug(n,t){return new K6({check:"greater_than",...J(t),value:n,inclusive:!0})}function _b(n,t){return new hR({check:"multiple_of",...J(t),value:n})}function iS(n,t){return new fR({check:"max_length",...J(t),maximum:n})}function hf(n,t){return new pR({check:"min_length",...J(t),minimum:n})}function sS(n,t){return new mR({check:"length_equals",...J(t),length:n})}function K3(n,t){return new gR({check:"string_format",format:"regex",...J(t),pattern:n})}function X3(n){return new vR({check:"string_format",format:"lowercase",...J(n)})}function Q3(n){return new yR({check:"string_format",format:"uppercase",...J(n)})}function eI(n,t){return new wR({check:"string_format",format:"includes",...J(t),includes:n})}function tI(n,t){return new bR({check:"string_format",format:"starts_with",...J(t),prefix:n})}function nI(n,t){return new SR({check:"string_format",format:"ends_with",...J(t),suffix:n})}function Rc(n){return new _R({check:"overwrite",tx:n})}function rI(n){return Rc(t=>t.normalize(n))}function iI(){return Rc(n=>n.trim())}function sI(){return Rc(n=>n.toLowerCase())}function oI(){return Rc(n=>n.toUpperCase())}function aI(){return Rc(n=>gC(n))}function lI(n,t,e){return new n({type:"array",element:t,...J(e)})}function cI(n,t,e){return new n({type:"custom",check:"custom",fn:t,...J(e)})}function uI(n){const t=hI(e=>(e.addIssue=r=>{if(typeof r=="string")e.issues.push(Iu(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(Iu(i))}},n(e.value,e)));return t}function hI(n,t){const e=new Qt({check:"custom",...J(t)});return e._zod.check=n,e}function oS(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)??ru,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 Xe(n,t,e={path:[],schemaPath:[]}){var f,p;var r;const i=n._zod.def,o=t.seen.get(n);if(o)return o.count++,e.schemaPath.includes(n)&&(o.cycle=e.path),o.schema;const a={schema:{},count:1,cycle:void 0,path:e.path};t.seen.set(n,a);const l=(p=(f=n._zod).toJSONSchema)==null?void 0:p.call(f);if(l)a.schema=l;else{const y={...e,schemaPath:[...e.schemaPath,n],path:e.path};if(n._zod.processJSONSchema)n._zod.processJSONSchema(t,a.schema,y);else{const S=a.schema,_=t.processors[i.type];if(!_)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);_(n,t,S,y)}const v=n._zod.parent;v&&(a.ref||(a.ref=v),Xe(v,t,y),t.seen.get(v).isParent=!0)}const c=t.metadataRegistry.get(n);return c&&Object.assign(a.schema,c),t.io==="input"&&Ct(n)&&(delete a.schema.examples,delete a.schema.default),t.io==="input"&&a.schema._prefault&&((r=a.schema).default??(r.default=a.schema._prefault)),delete a.schema._prefault,t.seen.get(n).schema}function aS(n,t){var a,l,c,u;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const f of n.seen.entries()){const p=(a=n.metadataRegistry.get(f[0]))==null?void 0:a.id;if(p){const y=r.get(p);if(y&&y!==f[0])throw new Error(`Duplicate schema id "${p}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(p,f[0])}}const i=f=>{var _;const p=n.target==="draft-2020-12"?"$defs":"definitions";if(n.external){const R=(_=n.external.registry.get(f[0]))==null?void 0:_.id,H=n.external.uri??(N=>N);if(R)return{ref:H(R)};const P=f[1].defId??f[1].schema.id??`schema${n.counter++}`;return f[1].defId=P,{defId:P,ref:`${H("__shared")}#/${p}/${P}`}}if(f[1]===e)return{ref:"#"};const v=`#/${p}/`,S=f[1].schema.id??`__schema${n.counter++}`;return{defId:S,ref:v+S}},o=f=>{if(f[1].schema.$ref)return;const p=f[1],{ref:y,defId:v}=i(f);p.def={...p.schema},v&&(p.defId=v);const S=p.schema;for(const _ in S)delete S[_];S.$ref=y};if(n.cycles==="throw")for(const f of n.seen.entries()){const p=f[1];if(p.cycle)throw new Error(`Cycle detected: #/${(l=p.cycle)==null?void 0:l.join("/")}/<root>
|
|
63
|
+
|
|
64
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const f of n.seen.entries()){const p=f[1];if(t===f[0]){o(f);continue}if(n.external){const v=(c=n.external.registry.get(f[0]))==null?void 0:c.id;if(t!==f[0]&&v){o(f);continue}}if((u=n.metadataRegistry.get(f[0]))==null?void 0:u.id){o(f);continue}if(p.cycle){o(f);continue}if(p.count>1&&n.reused==="ref"){o(f);continue}}}function lS(n,t){var a,l,c;const e=n.seen.get(t);if(!e)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=u=>{const f=n.seen.get(u);if(f.ref===null)return;const p=f.def??f.schema,y={...p},v=f.ref;if(f.ref=null,v){r(v);const _=n.seen.get(v),R=_.schema;if(R.$ref&&(n.target==="draft-07"||n.target==="draft-04"||n.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(R)):Object.assign(p,R),Object.assign(p,y),u._zod.parent===v)for(const P in p)P==="$ref"||P==="allOf"||P in y||delete p[P];if(R.$ref&&_.def)for(const P in p)P==="$ref"||P==="allOf"||P in _.def&&JSON.stringify(p[P])===JSON.stringify(_.def[P])&&delete p[P]}const S=u._zod.parent;if(S&&S!==v){r(S);const _=n.seen.get(S);if(_!=null&&_.schema.$ref&&(p.$ref=_.schema.$ref,_.def))for(const R in p)R==="$ref"||R==="allOf"||R in _.def&&JSON.stringify(p[R])===JSON.stringify(_.def[R])&&delete p[R]}n.override({zodSchema:u,jsonSchema:p,path:f.path??[]})};for(const u of[...n.seen.entries()].reverse())r(u[0]);const i={};if(n.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":n.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":n.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":n.target,(a=n.external)!=null&&a.uri){const u=(l=n.external.registry.get(t))==null?void 0:l.id;if(!u)throw new Error("Schema is missing an `id` property");i.$id=n.external.uri(u)}Object.assign(i,e.def??e.schema);const o=((c=n.external)==null?void 0:c.defs)??{};for(const u of n.seen.entries()){const f=u[1];f.def&&f.defId&&(o[f.defId]=f.def)}n.external||Object.keys(o).length>0&&(n.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const u=JSON.parse(JSON.stringify(i));return Object.defineProperty(u,"~standard",{value:{...t["~standard"],jsonSchema:{input:df(t,"input",n.processors),output:df(t,"output",n.processors)}},enumerable:!1,writable:!1}),u}catch{throw new Error("Error converting schema to JSON.")}}function Ct(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 Ct(r.element,e);if(r.type==="set")return Ct(r.valueType,e);if(r.type==="lazy")return Ct(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 Ct(r.innerType,e);if(r.type==="intersection")return Ct(r.left,e)||Ct(r.right,e);if(r.type==="record"||r.type==="map")return Ct(r.keyType,e)||Ct(r.valueType,e);if(r.type==="pipe")return Ct(r.in,e)||Ct(r.out,e);if(r.type==="object"){for(const i in r.shape)if(Ct(r.shape[i],e))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Ct(i,e))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Ct(i,e))return!0;return!!(r.rest&&Ct(r.rest,e))}return!1}const dI=(n,t={})=>e=>{const r=oS({...e,processors:t});return Xe(n,r),aS(r,n),lS(r,n)},df=(n,t,e={})=>r=>{const{libraryOptions:i,target:o}=r??{},a=oS({...i??{},target:o,io:t,processors:e});return Xe(n,a),aS(a,n),lS(a,n)},fI={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},pI=(n,t,e,r)=>{const i=e;i.type="string";const{minimum:o,maximum:a,format:l,patterns:c,contentEncoding:u}=n._zod.bag;if(typeof o=="number"&&(i.minLength=o),typeof a=="number"&&(i.maxLength=a),l&&(i.format=fI[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){const f=[...c];f.length===1?i.pattern=f[0].source:f.length>1&&(i.allOf=[...f.map(p=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:p.source}))])}},mI=(n,t,e,r)=>{const i=e,{minimum:o,maximum:a,format:l,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:f}=n._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number",typeof f=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.minimum=f,i.exclusiveMinimum=!0):i.exclusiveMinimum=f),typeof o=="number"&&(i.minimum=o,typeof f=="number"&&t.target!=="draft-04"&&(f>=o?delete i.minimum:delete i.exclusiveMinimum)),typeof u=="number"&&(t.target==="draft-04"||t.target==="openapi-3.0"?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),typeof a=="number"&&(i.maximum=a,typeof u=="number"&&t.target!=="draft-04"&&(u<=a?delete i.maximum:delete i.exclusiveMaximum)),typeof c=="number"&&(i.multipleOf=c)},gI=(n,t,e,r)=>{e.type="boolean"},vI=(n,t,e,r)=>{e.not={}},yI=(n,t,e,r)=>{},wI=(n,t,e,r)=>{const i=n._zod.def,o=H6(i.entries);o.every(a=>typeof a=="number")&&(e.type="number"),o.every(a=>typeof a=="string")&&(e.type="string"),e.enum=o},bI=(n,t,e,r)=>{const i=n._zod.def,o=[];for(const a of i.values)if(a===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof a=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(a))}else o.push(a);if(o.length!==0)if(o.length===1){const a=o[0];e.type=a===null?"null":typeof a,t.target==="draft-04"||t.target==="openapi-3.0"?e.enum=[a]:e.const=a}else o.every(a=>typeof a=="number")&&(e.type="number"),o.every(a=>typeof a=="string")&&(e.type="string"),o.every(a=>typeof a=="boolean")&&(e.type="boolean"),o.every(a=>a===null)&&(e.type="null"),e.enum=o},SI=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},_I=(n,t,e,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},AI=(n,t,e,r)=>{const i=e,o=n._zod.def,{minimum:a,maximum:l}=n._zod.bag;typeof a=="number"&&(i.minItems=a),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Xe(o.element,t,{...r,path:[...r.path,"items"]})},EI=(n,t,e,r)=>{var u;const i=e,o=n._zod.def;i.type="object",i.properties={};const a=o.shape;for(const f in a)i.properties[f]=Xe(a[f],t,{...r,path:[...r.path,"properties",f]});const l=new Set(Object.keys(a)),c=new Set([...l].filter(f=>{const p=o.shape[f]._zod;return t.io==="input"?p.optin===void 0:p.optout===void 0}));c.size>0&&(i.required=Array.from(c)),((u=o.catchall)==null?void 0:u._zod.def.type)==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=Xe(o.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},kI=(n,t,e,r)=>{const i=n._zod.def,o=i.inclusive===!1,a=i.options.map((l,c)=>Xe(l,t,{...r,path:[...r.path,o?"oneOf":"anyOf",c]}));o?e.oneOf=a:e.anyOf=a},TI=(n,t,e,r)=>{const i=n._zod.def,o=Xe(i.left,t,{...r,path:[...r.path,"allOf",0]}),a=Xe(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=u=>"allOf"in u&&Object.keys(u).length===1,c=[...l(o)?o.allOf:[o],...l(a)?a.allOf:[a]];e.allOf=c},CI=(n,t,e,r)=>{const i=e,o=n._zod.def;i.type="object";const a=o.keyType,l=a._zod.bag,c=l==null?void 0:l.patterns;if(o.mode==="loose"&&c&&c.size>0){const f=Xe(o.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const p of c)i.patternProperties[p.source]=f}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Xe(o.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Xe(o.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const u=a._zod.values;if(u){const f=[...u].filter(p=>typeof p=="string"||typeof p=="number");f.length>0&&(i.required=f)}},RI=(n,t,e,r)=>{const i=n._zod.def,o=Xe(i.innerType,t,r),a=t.seen.get(n);t.target==="openapi-3.0"?(a.ref=i.innerType,e.nullable=!0):e.anyOf=[o,{type:"null"}]},II=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType},$I=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,e.default=JSON.parse(JSON.stringify(i.defaultValue))},xI=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,t.io==="input"&&(e._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},PI=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType;let a;try{a=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}e.default=a},DI=(n,t,e,r)=>{const i=n._zod.def,o=t.io==="input"?i.in._zod.def.type==="transform"?i.out:i.in:i.out;Xe(o,t,r);const a=t.seen.get(n);a.ref=o},OI=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType,e.readOnly=!0},cS=(n,t,e,r)=>{const i=n._zod.def;Xe(i.innerType,t,r);const o=t.seen.get(n);o.ref=i.innerType},LI=$("ZodISODateTime",(n,t)=>{MR.init(n,t),Ve.init(n,t)});function MI(n){return q3(LI,n)}const NI=$("ZodISODate",(n,t)=>{NR.init(n,t),Ve.init(n,t)});function zI(n){return F3(NI,n)}const HI=$("ZodISOTime",(n,t)=>{zR.init(n,t),Ve.init(n,t)});function ZI(n){return V3(HI,n)}const UI=$("ZodISODuration",(n,t)=>{HR.init(n,t),Ve.init(n,t)});function qI(n){return B3(UI,n)}const uS=(n,t)=>{F6.init(n,t),n.name="ZodError",Object.defineProperties(n,{format:{value:e=>IC(n,e)},flatten:{value:e=>RC(n,e)},addIssue:{value:e=>{n.issues.push(e),n.message=JSON.stringify(n.issues,zg,2)}},addIssues:{value:e=>{n.issues.push(...e),n.message=JSON.stringify(n.issues,zg,2)}},isEmpty:{get(){return n.issues.length===0}}})},Ab=$("ZodError",uS),Mn=$("ZodError",uS,{Parent:Error}),FI=Vv(Mn),VI=Bv(Mn),BI=Cp(Mn),jI=Rp(Mn),WI=PC(Mn),GI=DC(Mn),JI=OC(Mn),YI=LC(Mn),KI=MC(Mn),XI=NC(Mn),QI=zC(Mn),e$=HC(Mn),Fe=$("ZodType",(n,t)=>(qe.init(n,t),Object.assign(n["~standard"],{jsonSchema:{input:df(n,"input"),output:df(n,"output")}}),n.toJSONSchema=dI(n,{}),n.def=t,n.type=t.type,Object.defineProperty(n,"_def",{value:t}),n.check=(...e)=>n.clone(js(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)=>Ws(n,e,r),n.brand=()=>n,n.register=((e,r)=>(e.add(n,r),n)),n.parse=(e,r)=>FI(n,e,r,{callee:n.parse}),n.safeParse=(e,r)=>BI(n,e,r),n.parseAsync=async(e,r)=>VI(n,e,r,{callee:n.parseAsync}),n.safeParseAsync=async(e,r)=>jI(n,e,r),n.spa=n.safeParseAsync,n.encode=(e,r)=>WI(n,e,r),n.decode=(e,r)=>GI(n,e,r),n.encodeAsync=async(e,r)=>JI(n,e,r),n.decodeAsync=async(e,r)=>YI(n,e,r),n.safeEncode=(e,r)=>KI(n,e,r),n.safeDecode=(e,r)=>XI(n,e,r),n.safeEncodeAsync=async(e,r)=>QI(n,e,r),n.safeDecodeAsync=async(e,r)=>e$(n,e,r),n.refine=(e,r)=>n.check(j$(e,r)),n.superRefine=e=>n.check(W$(e)),n.overwrite=e=>n.check(Rc(e)),n.optional=()=>Tb(n),n.exactOptional=()=>D$(n),n.nullable=()=>Cb(n),n.nullish=()=>Tb(Cb(n)),n.nonoptional=e=>H$(n,e),n.array=()=>G(n),n.or=e=>ce([n,e]),n.and=e=>$p(n,e),n.transform=e=>Rb(n,x$(e)),n.default=e=>M$(n,e),n.prefault=e=>z$(n,e),n.catch=e=>U$(n,e),n.pipe=e=>Rb(n,e),n.readonly=()=>V$(n),n.describe=e=>{const r=n.clone();return ru.add(r,{description:e}),r},Object.defineProperty(n,"description",{get(){var e;return(e=ru.get(n))==null?void 0:e.description},configurable:!0}),n.meta=(...e)=>{if(e.length===0)return ru.get(n);const r=n.clone();return ru.add(r,e[0]),r},n.isOptional=()=>n.safeParse(void 0).success,n.isNullable=()=>n.safeParse(null).success,n.apply=e=>e(n),n)),hS=$("_ZodString",(n,t)=>{jv.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>pI(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(K3(...r)),n.includes=(...r)=>n.check(eI(...r)),n.startsWith=(...r)=>n.check(tI(...r)),n.endsWith=(...r)=>n.check(nI(...r)),n.min=(...r)=>n.check(hf(...r)),n.max=(...r)=>n.check(iS(...r)),n.length=(...r)=>n.check(sS(...r)),n.nonempty=(...r)=>n.check(hf(1,...r)),n.lowercase=r=>n.check(X3(r)),n.uppercase=r=>n.check(Q3(r)),n.trim=()=>n.check(iI()),n.normalize=(...r)=>n.check(rI(...r)),n.toLowerCase=()=>n.check(sI()),n.toUpperCase=()=>n.check(oI()),n.slugify=()=>n.check(aI())}),t$=$("ZodString",(n,t)=>{jv.init(n,t),hS.init(n,t),n.email=e=>n.check(S3(n$,e)),n.url=e=>n.check(T3(r$,e)),n.jwt=e=>n.check(U3(y$,e)),n.emoji=e=>n.check(C3(i$,e)),n.guid=e=>n.check(wb(Eb,e)),n.uuid=e=>n.check(_3(yd,e)),n.uuidv4=e=>n.check(A3(yd,e)),n.uuidv6=e=>n.check(E3(yd,e)),n.uuidv7=e=>n.check(k3(yd,e)),n.nanoid=e=>n.check(R3(s$,e)),n.guid=e=>n.check(wb(Eb,e)),n.cuid=e=>n.check(I3(o$,e)),n.cuid2=e=>n.check($3(a$,e)),n.ulid=e=>n.check(x3(l$,e)),n.base64=e=>n.check(z3(m$,e)),n.base64url=e=>n.check(H3(g$,e)),n.xid=e=>n.check(P3(c$,e)),n.ksuid=e=>n.check(D3(u$,e)),n.ipv4=e=>n.check(O3(h$,e)),n.ipv6=e=>n.check(L3(d$,e)),n.cidrv4=e=>n.check(M3(f$,e)),n.cidrv6=e=>n.check(N3(p$,e)),n.e164=e=>n.check(Z3(v$,e)),n.datetime=e=>n.check(MI(e)),n.date=e=>n.check(zI(e)),n.time=e=>n.check(ZI(e)),n.duration=e=>n.check(qI(e))});function g(n){return b3(t$,n)}const Ve=$("ZodStringFormat",(n,t)=>{ze.init(n,t),hS.init(n,t)}),n$=$("ZodEmail",(n,t)=>{CR.init(n,t),Ve.init(n,t)}),Eb=$("ZodGUID",(n,t)=>{kR.init(n,t),Ve.init(n,t)}),yd=$("ZodUUID",(n,t)=>{TR.init(n,t),Ve.init(n,t)}),r$=$("ZodURL",(n,t)=>{RR.init(n,t),Ve.init(n,t)}),i$=$("ZodEmoji",(n,t)=>{IR.init(n,t),Ve.init(n,t)}),s$=$("ZodNanoID",(n,t)=>{$R.init(n,t),Ve.init(n,t)}),o$=$("ZodCUID",(n,t)=>{xR.init(n,t),Ve.init(n,t)}),a$=$("ZodCUID2",(n,t)=>{PR.init(n,t),Ve.init(n,t)}),l$=$("ZodULID",(n,t)=>{DR.init(n,t),Ve.init(n,t)}),c$=$("ZodXID",(n,t)=>{OR.init(n,t),Ve.init(n,t)}),u$=$("ZodKSUID",(n,t)=>{LR.init(n,t),Ve.init(n,t)}),h$=$("ZodIPv4",(n,t)=>{ZR.init(n,t),Ve.init(n,t)}),d$=$("ZodIPv6",(n,t)=>{UR.init(n,t),Ve.init(n,t)}),f$=$("ZodCIDRv4",(n,t)=>{qR.init(n,t),Ve.init(n,t)}),p$=$("ZodCIDRv6",(n,t)=>{FR.init(n,t),Ve.init(n,t)}),m$=$("ZodBase64",(n,t)=>{VR.init(n,t),Ve.init(n,t)}),g$=$("ZodBase64URL",(n,t)=>{jR.init(n,t),Ve.init(n,t)}),v$=$("ZodE164",(n,t)=>{WR.init(n,t),Ve.init(n,t)}),y$=$("ZodJWT",(n,t)=>{JR.init(n,t),Ve.init(n,t)}),dS=$("ZodNumber",(n,t)=>{Q6.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>mI(n,r,i),n.gt=(r,i)=>n.check(Sb(r,i)),n.gte=(r,i)=>n.check(ug(r,i)),n.min=(r,i)=>n.check(ug(r,i)),n.lt=(r,i)=>n.check(bb(r,i)),n.lte=(r,i)=>n.check(cg(r,i)),n.max=(r,i)=>n.check(cg(r,i)),n.int=r=>n.check(kb(r)),n.safe=r=>n.check(kb(r)),n.positive=r=>n.check(Sb(0,r)),n.nonnegative=r=>n.check(ug(0,r)),n.negative=r=>n.check(bb(0,r)),n.nonpositive=r=>n.check(cg(0,r)),n.multipleOf=(r,i)=>n.check(_b(r,i)),n.step=(r,i)=>n.check(_b(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 ie(n){return j3(dS,n)}const w$=$("ZodNumberFormat",(n,t)=>{YR.init(n,t),dS.init(n,t)});function kb(n){return W3(w$,n)}const b$=$("ZodBoolean",(n,t)=>{KR.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>gI(n,e,r)});function Qe(n){return G3(b$,n)}const S$=$("ZodUnknown",(n,t)=>{XR.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>yI()});function E(){return J3(S$)}const _$=$("ZodNever",(n,t)=>{QR.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>vI(n,e,r)});function A$(n){return Y3(_$,n)}const E$=$("ZodArray",(n,t)=>{e3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>AI(n,e,r,i),n.element=t.element,n.min=(e,r)=>n.check(hf(e,r)),n.nonempty=e=>n.check(hf(1,e)),n.max=(e,r)=>n.check(iS(e,r)),n.length=(e,r)=>n.check(sS(e,r)),n.unwrap=()=>n.element});function G(n,t){return lI(E$,n,t)}const fS=$("ZodObject",(n,t)=>{n3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>EI(n,e,r,i),ke(n,"shape",()=>t.shape),n.keyof=()=>Wv(Object.keys(n._zod.def.shape)),n.catchall=e=>n.clone({...n._zod.def,catchall:e}),n.passthrough=()=>n.clone({...n._zod.def,catchall:E()}),n.loose=()=>n.clone({...n._zod.def,catchall:E()}),n.strict=()=>n.clone({...n._zod.def,catchall:A$()}),n.strip=()=>n.clone({...n._zod.def,catchall:void 0}),n.extend=e=>AC(n,e),n.safeExtend=e=>EC(n,e),n.merge=e=>kC(n,e),n.pick=e=>SC(n,e),n.omit=e=>_C(n,e),n.partial=(...e)=>TC(mS,n,e[0]),n.required=(...e)=>CC(gS,n,e[0])});function Zg(n,t){const e={type:"object",shape:n??{},...J(t)};return new fS(e)}function b(n,t){return new fS({type:"object",shape:n,catchall:E(),...J(t)})}const pS=$("ZodUnion",(n,t)=>{nS.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>kI(n,e,r,i),n.options=t.options});function ce(n,t){return new pS({type:"union",options:n,...J(t)})}const k$=$("ZodDiscriminatedUnion",(n,t)=>{pS.init(n,t),r3.init(n,t)});function T$(n,t,e){return new k$({type:"union",options:t,discriminator:n,...J(e)})}const C$=$("ZodIntersection",(n,t)=>{i3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>TI(n,e,r,i)});function $p(n,t){return new C$({type:"intersection",left:n,right:t})}const R$=$("ZodRecord",(n,t)=>{s3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>CI(n,e,r,i),n.keyType=t.keyType,n.valueType=t.valueType});function T(n,t,e){return new R$({type:"record",keyType:n,valueType:t,...J(e)})}const Ug=$("ZodEnum",(n,t)=>{o3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(r,i,o)=>wI(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 o={};for(const a of r)if(e.has(a))o[a]=t.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Ug({...t,checks:[],...J(i),entries:o})},n.exclude=(r,i)=>{const o={...t.entries};for(const a of r)if(e.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Ug({...t,checks:[],...J(i),entries:o})}});function Wv(n,t){const e=Array.isArray(n)?Object.fromEntries(n.map(r=>[r,r])):n;return new Ug({type:"enum",entries:e,...J(t)})}const I$=$("ZodLiteral",(n,t)=>{a3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>bI(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 O(n,t){return new I$({type:"literal",values:Array.isArray(n)?n:[n],...J(t)})}const $$=$("ZodTransform",(n,t)=>{l3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>_I(n,e),n._zod.parse=(e,r)=>{if(r.direction==="backward")throw new N6(n.constructor.name);e.addIssue=o=>{if(typeof o=="string")e.issues.push(Iu(o,e.value,t));else{const a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=e.value),a.inst??(a.inst=n),e.issues.push(Iu(a))}};const i=t.transform(e.value,e);return i instanceof Promise?i.then(o=>(e.value=o,e)):(e.value=i,e)}});function x$(n){return new $$({type:"transform",transform:n})}const mS=$("ZodOptional",(n,t)=>{rS.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>cS(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function Tb(n){return new mS({type:"optional",innerType:n})}const P$=$("ZodExactOptional",(n,t)=>{c3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>cS(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function D$(n){return new P$({type:"optional",innerType:n})}const O$=$("ZodNullable",(n,t)=>{u3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>RI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function Cb(n){return new O$({type:"nullable",innerType:n})}const L$=$("ZodDefault",(n,t)=>{h3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>$I(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeDefault=n.unwrap});function M$(n,t){return new L$({type:"default",innerType:n,get defaultValue(){return typeof t=="function"?t():U6(t)}})}const N$=$("ZodPrefault",(n,t)=>{d3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>xI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function z$(n,t){return new N$({type:"prefault",innerType:n,get defaultValue(){return typeof t=="function"?t():U6(t)}})}const gS=$("ZodNonOptional",(n,t)=>{f3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>II(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function H$(n,t){return new gS({type:"nonoptional",innerType:n,...J(t)})}const Z$=$("ZodCatch",(n,t)=>{p3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>PI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType,n.removeCatch=n.unwrap});function U$(n,t){return new Z$({type:"catch",innerType:n,catchValue:typeof t=="function"?t:()=>t})}const q$=$("ZodPipe",(n,t)=>{m3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>DI(n,e,r,i),n.in=t.in,n.out=t.out});function Rb(n,t){return new q$({type:"pipe",in:n,out:t})}const F$=$("ZodReadonly",(n,t)=>{g3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>OI(n,e,r,i),n.unwrap=()=>n._zod.def.innerType});function V$(n){return new F$({type:"readonly",innerType:n})}const B$=$("ZodCustom",(n,t)=>{v3.init(n,t),Fe.init(n,t),n._zod.processJSONSchema=(e,r,i)=>SI(n,e)});function j$(n,t={}){return cI(B$,n,t)}function W$(n){return uI(n)}const G$=[".md",".markdown"];function vS(n){if(n.length===0)return!1;const t=n.at(-1);return t==="/"||t==="\\"}function yS(n){const t=n.lastIndexOf("/"),e=n.lastIndexOf("\\");return n.slice(Math.max(t,e)+1)}function J$(n){return yS(n).toLowerCase()}function Y$(n,t){const e=J$(n);return t.some(r=>e.endsWith(r))}function qg(n){return!vS(n)&&Y$(n,G$)}function K$(n){let t;try{t=new URL(n)}catch{return!1}return t.protocol==="http:"||t.protocol==="https:"}function Kr(n){try{const{pathname:t}=new URL(n);return/^\/artifact\/[0-9A-Za-z]{26}(\/|$)/.test(t)}catch{return!1}}const X$=Zg({id:g().min(1),kind:O("path"),title:g(),path:g(),transparent:Qe().optional(),store:g().optional(),share:Zg({id:g().min(1),access:Wv(["read","read-write"])}).strict().optional()}).strict(),Q$=Zg({id:g().min(1),kind:O("url"),title:g(),url:g().refine(K$,{message:"url must be an http(s) URL"}),transparent:Qe().optional()}).strict();T$("kind",[X$,Q$]);const ex=new Set(["about:","blob:","chrome-extension:","chrome:","data:","devtools:","file:","filesystem:","javascript:","view-source:"]);function tx(n,t){try{const e=new URL(t),r=new URL(n,e);return r.protocol==="http:"||r.protocol==="https:"?{kind:"web",url:r.href}:ex.has(r.protocol)?{kind:"browser-local",url:r.href}:{kind:"application",url:r.href}}catch{return{kind:"invalid"}}}function Ib(n,t){return tx(n,t).kind==="web"}const nx="/views/markdown/",rx="/views/url-unsupported/";function ix(n){try{const{protocol:t}=new URL(n);return t==="http:"||t==="https:"}catch{return!1}}function wS(n){return`/artifact/${encodeURIComponent(n)}`}function sx(n,t){return`${wS(n)}/${encodeURIComponent(t)}`}function ox(n){return`/markdown/${encodeURIComponent(n)}`}function $u(n,t={electron:!1}){if(n.kind==="url")return t.electron?{renderer:"url-webview",viewURL:n.url,contentURL:null}:Kr(n.url)?{renderer:"proxy-iframe",viewURL:n.url,contentURL:null}:t.browserDemo&&ix(n.url)?{renderer:"url-direct",viewURL:n.url,contentURL:null}:{renderer:"url-unsupported",viewURL:rx,contentURL:null};if(qg(n.path)){const r={viewURL:nx,contentURL:ox(n.id)};return t.electron?{renderer:"url-webview",...r}:{renderer:"markdown",...r}}const e=vS(n.path)?`${wS(n.id)}/`:sx(n.id,yS(n.path));return t.electron?{renderer:"url-webview",viewURL:e,contentURL:null}:{renderer:"proxy-iframe",viewURL:e,contentURL:null}}const ax="token",lx="mode",cx="desktopAppVersion",ux="electron";function hx(n=window.location.search){return new URLSearchParams(n).get(ax)}function Ri(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(lx)===ux}function bS(n=typeof window>"u"?"":window.location.search){return new URLSearchParams(n).get(cx)}const $b="tv.telemetry.clientId",dx=5,fx=60,px=1e3,mx=dx*fx*px,xb=["pointerdown","scroll","keydown"],Pb=["focus"],Db=["visibilitychange"],gx="hidden";function vx(n,t=_x){const e=n.getItem($b);if(e)return e;const r=t();return n.setItem($b,r),r}function yx(n){return{clientId:vx(n.storage,n.idFactory),userAgent:n.userAgent??(typeof navigator>"u"?"":navigator.userAgent),clientApp:n.clientApp,...n.desktopAppVersion?{desktopAppVersion:n.desktopAppVersion}:{}}}function wx(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 bx(n){return new Sx(n)}var zu,ti,ts,Hu,Zu,Sn,Io,Uu,kf,SS;class Sx{constructor(t){m(this,kf);m(this,zu);m(this,ti);m(this,ts);m(this,Hu);m(this,Zu);m(this,Sn);m(this,Io,!1);m(this,Uu,Number.NEGATIVE_INFINITY);d(this,zu,t.meta),d(this,ti,t.documentTarget),d(this,ts,t.windowTarget),d(this,Hu,t.send),d(this,Zu,t.nowMs??Date.now),d(this,Sn,()=>h(this,kf,SS).call(this))}start(){if(!s(this,Io)){d(this,Io,!0);for(const t of xb)s(this,ts).addEventListener(t,s(this,Sn)),s(this,ti).addEventListener(t,s(this,Sn));for(const t of Pb)s(this,ts).addEventListener(t,s(this,Sn));for(const t of Db)s(this,ti).addEventListener(t,s(this,Sn))}}stop(){if(s(this,Io)){d(this,Io,!1);for(const t of xb)s(this,ts).removeEventListener(t,s(this,Sn)),s(this,ti).removeEventListener(t,s(this,Sn));for(const t of Pb)s(this,ts).removeEventListener(t,s(this,Sn));for(const t of Db)s(this,ti).removeEventListener(t,s(this,Sn))}}}zu=new WeakMap,ti=new WeakMap,ts=new WeakMap,Hu=new WeakMap,Zu=new WeakMap,Sn=new WeakMap,Io=new WeakMap,Uu=new WeakMap,kf=new WeakSet,SS=function(){if(s(this,ti).visibilityState===gx)return;const t=s(this,Zu).call(this);t-s(this,Uu)<mx||(d(this,Uu,t),s(this,Hu).call(this,{type:Yk,clientId:s(this,zu).clientId}))};function _x(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():Zv().toLowerCase()}var ns,_n,rs,$o,dl,fl,ni,pl,Lr,Fg,iu;class Ax extends zr{constructor(e){super();m(this,Lr);I(this,"scan",null);I(this,"icons",new Map);m(this,ns,0);m(this,_n,new Map);m(this,rs,null);m(this,$o,!0);m(this,dl,!1);m(this,fl,!1);m(this,ni,!1);m(this,pl);d(this,pl,e)}reset(){ro(this,ns)._++,s(this,_n).clear(),d(this,dl,!0),d(this,rs,null),d(this,$o,!0)}load(e=!1){if(s(this,ni))return Promise.resolve();const r=++ro(this,ns)._,i=(async()=>{try{const o=await s(this,pl).call(this).list(e?{fresh:!0}:void 0);if(s(this,ni)||r!==s(this,ns))return;h(this,Lr,Fg).call(this,o,[...this.icons.keys(),...s(this,_n).keys()])}catch{r===s(this,ns)&&d(this,$o,!0)}})();return d(this,rs,i),i.then(()=>{s(this,rs)===i&&d(this,rs,null)}),i}apply(e){var i;if(s(this,ni))return;const r=e.scan.watching===!1&&((i=this.scan)==null?void 0:i.watching)!==!1;ro(this,ns)._++,h(this,Lr,Fg).call(this,e.scan,e.invalidatedIDs),r&&s(this,fl)&&this.load(!0)}setOpen(e){var r;s(this,ni)||e===s(this,fl)||(d(this,fl,e),e&&(((r=this.scan)==null?void 0:r.watching)===!1?this.load(!0):s(this,$o)&&!s(this,rs)&&this.load()))}dispose(){d(this,ni,!0),this.reset();for(const e of this.icons.keys())h(this,Lr,iu).call(this,e)}}ns=new WeakMap,_n=new WeakMap,rs=new WeakMap,$o=new WeakMap,dl=new WeakMap,fl=new WeakMap,ni=new WeakMap,pl=new WeakMap,Lr=new WeakSet,Fg=function(e,r){this.scan=e,d(this,$o,!1);const i=new Set(s(this,dl)?e.templates.map(({id:a})=>a):r);d(this,dl,!1);const o=new Set(e.templates.filter(({hasIcon:a})=>a).map(({id:a})=>a));for(const a of new Set([...this.icons.keys(),...s(this,_n).keys()]))o.has(a)?i.has(a)&&s(this,_n).delete(a):h(this,Lr,iu).call(this,a);for(const a of o){if(s(this,_n).has(a)||this.icons.has(a)&&!i.has(a))continue;const l={};s(this,_n).set(a,l),s(this,pl).call(this).icon(a).then(({bytes:c,contentType:u})=>{if(s(this,ni)||s(this,_n).get(a)!==l)return;const f=URL.createObjectURL(new Blob([Uint8Array.from(c)],{type:u}));h(this,Lr,iu).call(this,a),this.icons.set(a,f),this.dispatchEvent(new dt("change"))}).catch(()=>{s(this,_n).get(a)===l&&(h(this,Lr,iu).call(this,a),this.dispatchEvent(new dt("change")))})}this.dispatchEvent(new dt("change"))},iu=function(e){const r=this.icons.get(e);r&&URL.revokeObjectURL(r),this.icons.delete(e),s(this,_n).delete(e)};const Le={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"},Wr={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"},Ex=1,kx=b({_meta:T(g(),E()).nullish(),terminal:Qe().optional().default(!1)}),Tx=b({_meta:T(g(),E()).nullish(),label:g().nullish(),name:g(),optional:Qe().optional().default(!1),secret:Qe().optional().default(!0)}),Cx=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:g(),name:g()}),Rx=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:g(),link:g().nullish(),name:g(),vars:G(Tx)}),Ix=b({_meta:T(g(),E()).nullish(),args:G(g()).optional(),description:g().nullish(),env:T(g(),g()).optional(),id:g(),name:g()}),$x=ce([Rx.and(b({type:O("env_var")})),Ix.and(b({type:O("terminal")})),Cx]),xx=b({_meta:T(g(),E()).nullish(),methodId:g()}),Px=b({_meta:T(g(),E()).nullish()}),Dx=b({_meta:T(g(),E()).nullish(),blob:g(),mimeType:g().nullish(),uri:g()}),Ox=b({default:Qe().nullish(),description:g().nullish(),title:g().nullish()}),Lx=b({_meta:T(g(),E()).nullish()}),Mx=b({_meta:T(g(),E()).nullish()}),Nx=b({amount:ie(),currency:g()}),zx=b({_meta:T(g(),E()).nullish(),terminalId:g()}),Hx=b({_meta:T(g(),E()).nullish(),newText:g(),oldText:g().nullish(),path:g()}),Zx=ce([g(),ie(),ie(),Qe(),G(g())]),Ux=b({content:T(g(),Zx).nullish()}),qx=ce([Ux.and(b({action:O("accept")})),b({action:O("decline")}),b({action:O("cancel")})]),Fx=b({_meta:T(g(),E()).nullish()}),_S=g(),Vx=b({_meta:T(g(),E()).nullish(),elicitationId:_S}),Bx=b({_meta:T(g(),E()).nullish(),action:qx}),jx=O("object"),Wx=O("string"),Gx=b({_meta:T(g(),E()).nullish()}),Jx=b({_meta:T(g(),E()).nullish(),form:Fx.nullish(),url:Gx.nullish()}),Yx=b({elicitationId:_S,url:g().url()}),AS=b({const:g(),title:g()}),ES=b({_meta:T(g(),E()).nullish(),name:g(),value:g()}),Kx=ce([O(-32700),O(-32600),O(-32601),O(-32602),O(-32603),O(-32800),O(-32e3),O(-32002),O(-32042),ie().int().min(-2147483648,{message:"Invalid value: Expected int32 to be >= -2147483648"}).max(2147483647,{message:"Invalid value: Expected int32 to be <= 2147483647"})]),kS=b({code:Kx,data:E().optional(),message:g()}),TS=E(),CS=E(),RS=E(),Xx=b({_meta:T(g(),E()).nullish(),readTextFile:Qe().optional().default(!1),writeTextFile:Qe().optional().default(!1)}),IS=b({_meta:T(g(),E()).nullish(),name:g(),value:g()}),$S=b({_meta:T(g(),E()).nullish(),name:g(),title:g().nullish(),version:g()}),Qx=b({default:ie().nullish(),description:g().nullish(),maximum:ie().nullish(),minimum:ie().nullish(),title:g().nullish()}),eP=b({_meta:T(g(),E()).nullish()}),tP=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cursor:g().nullish(),cwd:g().nullish()}),nP=b({_meta:T(g(),E()).nullish()}),rP=b({_meta:T(g(),E()).nullish(),logout:nP.nullish()}),iP=b({_meta:T(g(),E()).nullish()}),sP=b({_meta:T(g(),E()).nullish()}),oP=b({_meta:T(g(),E()).nullish(),http:Qe().optional().default(!1),sse:Qe().optional().default(!1)}),aP=b({_meta:T(g(),E()).nullish(),headers:G(IS),name:g(),url:g()}),lP=b({_meta:T(g(),E()).nullish(),headers:G(IS),name:g(),url:g()}),cP=b({_meta:T(g(),E()).nullish(),args:G(g()),command:g(),env:G(ES),name:g()}),xp=ce([aP.and(b({type:O("http")})),lP.and(b({type:O("sse")})),cP]),Gv=g(),uP=b({_meta:T(g(),E()).nullish(),description:g().nullish(),modelId:Gv,name:g()}),hP=ce([O("error"),O("warning"),O("information"),O("hint")]),dP=b({_meta:T(g(),E()).nullish()}),fP=b({_meta:T(g(),E()).nullish()}),pP=b({_meta:T(g(),E()).nullish()}),mP=b({_meta:T(g(),E()).nullish()}),gP=b({_meta:T(g(),E()).nullish()}),vP=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),yP=b({diff:g(),uri:g()}),wP=b({endLine:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),startLine:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),text:g()}),bP=b({_meta:T(g(),E()).nullish()}),SP=b({_meta:T(g(),E()).nullish()}),_P=b({languageId:g(),text:g(),uri:g()}),AP=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),EP=ce([O("rejected"),O("ignored"),O("replaced"),O("cancelled")]),kP=b({excerpts:G(wP),uri:g()}),TP=b({_meta:T(g(),E()).nullish()}),CP=b({_meta:T(g(),E()).nullish()}),RP=b({name:g(),owner:g(),remoteUrl:g()}),IP=b({_meta:T(g(),E()).nullish()}),$P=b({_meta:T(g(),E()).nullish(),jump:bP.nullish(),rename:CP.nullish(),searchAndReplace:IP.nullish()}),xP=b({id:g(),isRegex:Qe().nullish(),replace:g(),search:g(),uri:g()}),PP=ce([O("automatic"),O("diagnostic"),O("manual")]),DP=b({_meta:T(g(),E()).nullish(),maxCount:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish()}),OP=b({_meta:T(g(),E()).nullish(),diagnostics:dP.nullish(),editHistory:vP.nullish(),openFiles:SP.nullish(),recentFiles:AP.nullish(),relatedSnippets:TP.nullish(),userActions:DP.nullish()}),LP=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(xp)}),MP=b({default:ie().nullish(),description:g().nullish(),maximum:ie().nullish(),minimum:ie().nullish(),title:g().nullish()}),xS=g(),NP=ce([O("allow_once"),O("allow_always"),O("reject_once"),O("reject_always")]),zP=b({_meta:T(g(),E()).nullish(),kind:NP,name:g(),optionId:xS}),HP=ce([O("high"),O("medium"),O("low")]),ZP=ce([O("pending"),O("in_progress"),O("completed")]),UP=b({_meta:T(g(),E()).nullish(),content:g(),priority:HP,status:ZP}),qP=b({_meta:T(g(),E()).nullish(),entries:G(UP)}),Fs=b({character:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"})}),FP=b({id:g(),position:Fs,uri:g()}),VP=b({id:g(),newName:g(),position:Fs,uri:g()}),BP=b({action:g(),position:Fs,timestampMs:ie(),uri:g()}),PS=ce([O("utf-16"),O("utf-32"),O("utf-8")]),jP=b({_meta:T(g(),E()).nullish(),auth:kx.optional().default({terminal:!1}),elicitation:Jx.nullish(),fs:Xx.optional().default({readTextFile:!1,writeTextFile:!1}),nes:$P.nullish(),positionEncodings:G(PS).optional(),terminal:Qe().optional().default(!1)}),WP=b({_meta:T(g(),E()).nullish(),audio:Qe().optional().default(!1),embeddedContext:Qe().optional().default(!1),image:Qe().optional().default(!1)}),DS=ie().int().gte(0).lte(65535),GP=b({_meta:T(g(),E()).nullish(),clientCapabilities:jP.optional().default({auth:{terminal:!1},fs:{readTextFile:!1,writeTextFile:!1},terminal:!1}),clientInfo:$S.nullish(),protocolVersion:DS}),Ic=b({end:Fs,start:Fs}),JP=b({message:g(),range:Ic,severity:hP,uri:g()}),YP=b({languageId:g(),lastFocusedMs:ie().nullish(),uri:g(),visibleRange:Ic.nullish()}),KP=b({_meta:T(g(),E()).nullish(),diagnostics:G(JP).nullish(),editHistory:G(yP).nullish(),openFiles:G(YP).nullish(),recentFiles:G(_P).nullish(),relatedSnippets:G(kP).nullish(),userActions:G(BP).nullish()}),XP=b({newText:g(),range:Ic}),QP=b({cursorPosition:Fs.nullish(),edits:G(XP),id:g(),uri:g()}),e5=ce([QP.and(b({kind:O("edit")})),FP.and(b({kind:O("jump")})),VP.and(b({kind:O("rename")})),xP.and(b({kind:O("searchAndReplace")}))]),t5=b({_meta:T(g(),E()).nullish(),content:g()}),n5=b({_meta:T(g(),E()).nullish()}),Sa=ce([ie(),g()]).nullable();b({_meta:T(g(),E()).nullish(),requestId:Sa});const r5=Wv(["assistant","user"]),ed=b({_meta:T(g(),E()).nullish(),audience:G(r5).nullish(),lastModified:g().nullish(),priority:ie().nullish()}),i5=b({_meta:T(g(),E()).nullish(),annotations:ed.nullish(),data:g(),mimeType:g()}),s5=b({_meta:T(g(),E()).nullish(),annotations:ed.nullish(),data:g(),mimeType:g(),uri:g().nullish()}),o5=b({_meta:T(g(),E()).nullish(),annotations:ed.nullish(),description:g().nullish(),mimeType:g().nullish(),name:g(),size:ie().nullish(),title:g().nullish(),uri:g()}),a5=b({_meta:T(g(),E()).nullish(),optionId:xS}),l5=ce([b({outcome:O("cancelled")}),a5.and(b({outcome:O("selected")}))]),c5=b({_meta:T(g(),E()).nullish(),outcome:l5}),u5=b({_meta:T(g(),E()).nullish()}),h5=b({_meta:T(g(),E()).nullish()}),d5=b({currentValue:Qe()}),f5=g(),OS=g(),p5=ce([O("mode"),O("model"),O("thought_level"),g()]),Jv=g(),LS=b({_meta:T(g(),E()).nullish(),description:g().nullish(),name:g(),value:Jv}),m5=b({_meta:T(g(),E()).nullish(),group:f5,name:g(),options:G(LS)}),g5=ce([G(LS),G(m5)]),v5=b({currentValue:Jv,options:g5}),$c=$p(ce([v5.and(b({type:O("select")})),d5.and(b({type:O("boolean")}))]),b({_meta:T(g(),E()).nullish(),category:p5.nullish(),description:g().nullish(),id:OS,name:g()})),y5=b({_meta:T(g(),E()).nullish(),configOptions:G($c)}),w5=b({_meta:T(g(),E()).nullish()}),_e=g(),b5=b({_meta:T(g(),E()).nullish(),id:g(),sessionId:_e}),S5=b({_meta:T(g(),E()).nullish(),sessionId:_e}),_5=b({_meta:T(g(),E()).nullish(),sessionId:_e}),A5=b({_meta:T(g(),E()).nullish(),sessionId:_e}),MS=b({_meta:T(g(),E()).nullish(),args:G(g()).optional(),command:g(),cwd:g().nullish(),env:G(ES).optional(),outputByteLimit:ie().nullish(),sessionId:_e}),E5=b({_meta:T(g(),E()).nullish(),sessionId:_e,uri:g()}),k5=b({_meta:T(g(),E()).nullish(),position:Fs,sessionId:_e,uri:g(),version:ie(),visibleRange:Ic}),T5=b({_meta:T(g(),E()).nullish(),languageId:g(),sessionId:_e,text:g(),uri:g(),version:ie()}),C5=b({_meta:T(g(),E()).nullish(),sessionId:_e,uri:g()}),R5=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(xp).optional(),sessionId:_e}),NS=b({_meta:T(g(),E()).nullish(),sessionId:_e,terminalId:g()}),I5=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(xp),sessionId:_e}),zS=b({_meta:T(g(),E()).nullish(),limit:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:g(),sessionId:_e}),$5=b({_meta:T(g(),E()).nullish(),id:g(),reason:EP.nullish(),sessionId:_e}),HS=b({_meta:T(g(),E()).nullish(),sessionId:_e,terminalId:g()}),x5=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),mcpServers:G(xp).optional(),sessionId:_e}),P5=b({_meta:T(g(),E()).nullish(),additionalDirectories:G(g()).optional(),cwd:g(),sessionId:_e,title:g().nullish(),updatedAt:g().nullish()}),D5=b({_meta:T(g(),E()).nullish(),nextCursor:g().nullish(),sessions:G(P5)}),O5=b({_meta:T(g(),E()).nullish(),title:g().nullish(),updatedAt:g().nullish()}),L5=b({_meta:T(g(),E()).nullish()}),Pp=g(),M5=b({_meta:T(g(),E()).nullish(),currentModeId:Pp}),N5=b({_meta:T(g(),E()).nullish(),description:g().nullish(),id:Pp,name:g()}),Dp=b({_meta:T(g(),E()).nullish(),availableModes:G(N5),currentModeId:Pp}),Op=b({_meta:T(g(),E()).nullish(),availableModels:G(uP),currentModelId:Gv}),z5=b({_meta:T(g(),E()).nullish(),configOptions:G($c).nullish(),models:Op.nullish(),modes:Dp.nullish(),sessionId:_e}),H5=b({_meta:T(g(),E()).nullish(),configOptions:G($c).nullish(),models:Op.nullish(),modes:Dp.nullish()}),Z5=b({_meta:T(g(),E()).nullish(),configOptions:G($c).nullish(),models:Op.nullish(),modes:Dp.nullish(),sessionId:_e}),U5=b({_meta:T(g(),E()).nullish(),configOptions:G($c).nullish(),models:Op.nullish(),modes:Dp.nullish()}),q5=b({_meta:T(g(),E()).nullish()}),F5=b({_meta:T(g(),E()).nullish(),additionalDirectories:u5.nullish(),close:h5.nullish(),fork:w5.nullish(),list:L5.nullish(),resume:q5.nullish()}),V5=$p(ce([b({type:O("boolean"),value:Qe()}),b({value:Jv})]),b({_meta:T(g(),E()).nullish(),configId:OS,sessionId:_e})),B5=b({_meta:T(g(),E()).nullish(),configOptions:G($c)}),j5=b({_meta:T(g(),E()).nullish(),modeId:Pp,sessionId:_e}),W5=b({_meta:T(g(),E()).nullish()}),G5=b({_meta:T(g(),E()).nullish(),modelId:Gv,sessionId:_e}),J5=b({_meta:T(g(),E()).nullish()}),Y5=b({_meta:T(g(),E()).nullish(),sessionId:_e}),K5=ce([O("end_turn"),O("max_tokens"),O("max_turn_requests"),O("refusal"),O("cancelled")]),X5=ce([O("email"),O("uri"),O("date"),O("date-time")]),Q5=b({default:g().nullish(),description:g().nullish(),enum:G(g()).nullish(),format:X5.nullish(),maxLength:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),minLength:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),oneOf:G(AS).nullish(),pattern:g().nullish(),title:g().nullish()}),eD=b({_meta:T(g(),E()).nullish(),context:KP.nullish(),position:Fs,selection:Ic.nullish(),sessionId:_e,triggerKind:PP,uri:g(),version:ie()}),tD=b({_meta:T(g(),E()).nullish(),suggestions:G(e5)}),nD=b({_meta:T(g(),E()).nullish(),terminalId:g()}),rD=b({_meta:T(g(),E()).nullish(),exitCode:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:g().nullish()}),ZS=b({_meta:T(g(),E()).nullish(),sessionId:_e,terminalId:g()}),iD=b({_meta:T(g(),E()).nullish(),exitStatus:rD.nullish(),output:g(),truncated:Qe()}),sD=b({_meta:T(g(),E()).nullish(),annotations:ed.nullish(),text:g()}),oD=b({range:Ic.nullish(),text:g()}),aD=b({_meta:T(g(),E()).nullish(),contentChanges:G(oD),sessionId:_e,uri:g(),version:ie()});b({method:g(),params:ce([S5,T5,aD,E5,C5,k5,b5,$5,TS]).nullish()});const lD=ce([O("full"),O("incremental")]),cD=b({_meta:T(g(),E()).nullish(),syncKind:lD}),uD=b({_meta:T(g(),E()).nullish(),didChange:cD.nullish(),didClose:fP.nullish(),didFocus:pP.nullish(),didOpen:mP.nullish(),didSave:gP.nullish()}),hD=b({_meta:T(g(),E()).nullish(),document:uD.nullish()}),dD=b({_meta:T(g(),E()).nullish(),context:OP.nullish(),events:hD.nullish()}),fD=b({_meta:T(g(),E()).nullish(),auth:rP.optional().default({}),loadSession:Qe().optional().default(!1),mcpCapabilities:oP.optional().default({http:!1,sse:!1}),nes:dD.nullish(),positionEncoding:PS.nullish(),promptCapabilities:WP.optional().default({audio:!1,embeddedContext:!1,image:!1}),sessionCapabilities:F5.optional().default({})}),pD=b({_meta:T(g(),E()).nullish(),agentCapabilities:fD.optional().default({auth:{},loadSession:!1,mcpCapabilities:{http:!1,sse:!1},promptCapabilities:{audio:!1,embeddedContext:!1,image:!1},sessionCapabilities:{}}),agentInfo:$S.nullish(),authMethods:G($x).optional().default([]),protocolVersion:DS}),mD=b({_meta:T(g(),E()).nullish(),mimeType:g().nullish(),text:g(),uri:g()}),gD=ce([mD,Dx]),vD=b({_meta:T(g(),E()).nullish(),annotations:ed.nullish(),resource:gD}),Yv=ce([sD.and(b({type:O("text")})),s5.and(b({type:O("image")})),i5.and(b({type:O("audio")})),o5.and(b({type:O("resource_link")})),vD.and(b({type:O("resource")}))]),yD=b({_meta:T(g(),E()).nullish(),content:Yv}),hg=b({_meta:T(g(),E()).nullish(),content:Yv,messageId:g().nullish()}),wD=b({_meta:T(g(),E()).nullish(),messageId:g().nullish(),prompt:G(Yv),sessionId:_e}),bD=b({anyOf:G(AS)}),US=ce([yD.and(b({type:O("content")})),Hx.and(b({type:O("diff")})),nD.and(b({type:O("terminal")}))]),qS=g(),FS=b({_meta:T(g(),E()).nullish(),line:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),path:g()}),VS=ce([O("pending"),O("in_progress"),O("completed"),O("failed")]),BS=ce([O("read"),O("edit"),O("delete"),O("move"),O("search"),O("execute"),O("think"),O("fetch"),O("switch_mode"),O("other")]),SD=b({_meta:T(g(),E()).nullish(),content:G(US).optional(),kind:BS.optional(),locations:G(FS).optional(),rawInput:E().optional(),rawOutput:E().optional(),status:VS.optional(),title:g(),toolCallId:qS}),jS=b({_meta:T(g(),E()).nullish(),content:G(US).nullish(),kind:BS.nullish(),locations:G(FS).nullish(),rawInput:E().optional(),rawOutput:E().optional(),status:VS.nullish(),title:g().nullish(),toolCallId:qS}),WS=b({_meta:T(g(),E()).nullish(),options:G(zP),sessionId:_e,toolCall:jS}),_D=b({_meta:T(g(),E()).nullish(),hint:g()}),AD=_D,ED=b({_meta:T(g(),E()).nullish(),description:g(),input:AD.nullish(),name:g()}),kD=b({_meta:T(g(),E()).nullish(),availableCommands:G(ED)}),TD=b({enum:G(g()),type:Wx}),CD=ce([TD,bD]),RD=b({default:G(g()).nullish(),description:g().nullish(),items:CD,maxItems:ie().nullish(),minItems:ie().nullish(),title:g().nullish()}),ID=ce([Q5.and(b({type:O("string")})),MP.and(b({type:O("number")})),Qx.and(b({type:O("integer")})),Ox.and(b({type:O("boolean")})),RD.and(b({type:O("array")}))]),$D=b({description:g().nullish(),properties:T(g(),ID).optional().default({}),required:G(g()).nullish(),title:g().nullish(),type:jx.optional().default("object")}),xD=b({requestedSchema:$D}),PD=$p(ce([xD.and(b({mode:O("form")})),Yx.and(b({mode:O("url")}))]),b({_meta:T(g(),E()).nullish(),message:g(),sessionId:_e})),DD=b({cachedReadTokens:ie().nullish(),cachedWriteTokens:ie().nullish(),inputTokens:ie(),outputTokens:ie(),thoughtTokens:ie().nullish(),totalTokens:ie()}),OD=b({_meta:T(g(),E()).nullish(),stopReason:K5,usage:DD.nullish(),userMessageId:g().nullish()});ce([b({id:Sa,result:ce([pD,Px,sP,Z5,H5,D5,z5,U5,Mx,W5,B5,OD,J5,Y5,tD,Lx,RS])}),b({error:kS,id:Sa})]);const LD=b({_meta:T(g(),E()).nullish(),cost:Nx.nullish(),size:ie(),used:ie()}),MD=ce([hg.and(b({sessionUpdate:O("user_message_chunk")})),hg.and(b({sessionUpdate:O("agent_message_chunk")})),hg.and(b({sessionUpdate:O("agent_thought_chunk")})),SD.and(b({sessionUpdate:O("tool_call")})),jS.and(b({sessionUpdate:O("tool_call_update")})),qP.and(b({sessionUpdate:O("plan")})),kD.and(b({sessionUpdate:O("available_commands_update")})),M5.and(b({sessionUpdate:O("current_mode_update")})),y5.and(b({sessionUpdate:O("config_option_update")})),O5.and(b({sessionUpdate:O("session_info_update")})),LD.and(b({sessionUpdate:O("usage_update")}))]),GS=b({_meta:T(g(),E()).nullish(),sessionId:_e,update:MD});b({method:g(),params:ce([GS,Vx,TS]).nullish()});const JS=b({_meta:T(g(),E()).nullish(),sessionId:_e,terminalId:g()}),ND=b({_meta:T(g(),E()).nullish(),exitCode:ie().int().gte(0).max(4294967295,{message:"Invalid value: Expected uint32 to be <= 4294967295"}).nullish(),signal:g().nullish()}),zD=b({name:g(),uri:g()}),HD=b({_meta:T(g(),E()).nullish(),repository:RP.nullish(),workspaceFolders:G(zD).nullish(),workspaceUri:g().nullish()});b({id:Sa,method:g(),params:ce([GP,xx,iP,LP,I5,tP,R5,x5,A5,j5,V5,wD,G5,HD,eD,_5,CS]).nullish()});const YS=b({_meta:T(g(),E()).nullish(),content:g(),path:g(),sessionId:_e});b({id:Sa,method:g(),params:ce([YS,zS,WS,MS,ZS,HS,JS,NS,PD,CS]).nullish()});const ZD=b({_meta:T(g(),E()).nullish()});ce([b({id:Sa,result:ce([ZD,t5,c5,zx,iD,n5,ND,eP,Bx,RS])}),b({error:kS,id:Sa})]);var Se;class UD{constructor(t,e){m(this,Se);const r=t(this),i=async(a,l)=>{var c,u,f,p,y,v,S;switch(a){case Wr.fs_write_text_file:{const _=YS.parse(l);return(c=r.writeTextFile)==null?void 0:c.call(r,_)}case Wr.fs_read_text_file:{const _=zS.parse(l);return(u=r.readTextFile)==null?void 0:u.call(r,_)}case Wr.session_request_permission:{const _=WS.parse(l);return r.requestPermission(_)}case Wr.terminal_create:{const _=MS.parse(l);return(f=r.createTerminal)==null?void 0:f.call(r,_)}case Wr.terminal_output:{const _=ZS.parse(l);return(p=r.terminalOutput)==null?void 0:p.call(r,_)}case Wr.terminal_release:{const _=HS.parse(l);return await((y=r.releaseTerminal)==null?void 0:y.call(r,_))??{}}case Wr.terminal_wait_for_exit:{const _=JS.parse(l);return(v=r.waitForTerminalExit)==null?void 0:v.call(r,_)}case Wr.terminal_kill:{const _=NS.parse(l);return await((S=r.killTerminal)==null?void 0:S.call(r,_))??{}}default:if(r.extMethod)return r.extMethod(a,l);throw rt.methodNotFound(a)}},o=async(a,l)=>{switch(a){case Wr.session_update:{const c=GS.parse(l);return r.sessionUpdate(c)}default:if(r.extNotification)return r.extNotification(a,l);throw rt.methodNotFound(a)}};d(this,Se,new qD(i,o,e))}async initialize(t){return await s(this,Se).sendRequest(Le.initialize,t)}async newSession(t){return await s(this,Se).sendRequest(Le.session_new,t)}async loadSession(t){return await s(this,Se).sendRequest(Le.session_load,t)??{}}async unstable_forkSession(t){return await s(this,Se).sendRequest(Le.session_fork,t)}async listSessions(t){return await s(this,Se).sendRequest(Le.session_list,t)}async unstable_resumeSession(t){return await s(this,Se).sendRequest(Le.session_resume,t)}async unstable_closeSession(t){return await s(this,Se).sendRequest(Le.session_close,t)}async setSessionMode(t){return await s(this,Se).sendRequest(Le.session_set_mode,t)??{}}async unstable_setSessionModel(t){return await s(this,Se).sendRequest(Le.session_set_model,t)??{}}async setSessionConfigOption(t){return await s(this,Se).sendRequest(Le.session_set_config_option,t)}async authenticate(t){return await s(this,Se).sendRequest(Le.authenticate,t)??{}}async unstable_logout(t){return await s(this,Se).sendRequest(Le.logout,t)??{}}async prompt(t){return await s(this,Se).sendRequest(Le.session_prompt,t)}async cancel(t){return await s(this,Se).sendNotification(Le.session_cancel,t)}async unstable_startNes(t){return await s(this,Se).sendRequest(Le.nes_start,t)}async unstable_suggestNes(t){return await s(this,Se).sendRequest(Le.nes_suggest,t)}async unstable_closeNes(t){return await s(this,Se).sendRequest(Le.nes_close,t)??{}}async unstable_didOpenDocument(t){return await s(this,Se).sendNotification(Le.document_did_open,t)}async unstable_didChangeDocument(t){return await s(this,Se).sendNotification(Le.document_did_change,t)}async unstable_didCloseDocument(t){return await s(this,Se).sendNotification(Le.document_did_close,t)}async unstable_didSaveDocument(t){return await s(this,Se).sendNotification(Le.document_did_save,t)}async unstable_didFocusDocument(t){return await s(this,Se).sendNotification(Le.document_did_focus,t)}async unstable_acceptNes(t){return await s(this,Se).sendNotification(Le.nes_accept,t)}async unstable_rejectNes(t){return await s(this,Se).sendNotification(Le.nes_reject,t)}async extMethod(t,e){return await s(this,Se).sendRequest(t,e)}async extNotification(t,e){return await s(this,Se).sendNotification(t,e)}get signal(){return s(this,Se).signal}get closed(){return s(this,Se).closed}}Se=new WeakMap;var is,Tf,qu,Fu,ml,gl,dr,Vu,Ue,KS,Vg,XS,QS,e_,t_,Bg,su;class qD{constructor(t,e,r){m(this,Ue);m(this,is,new Map);m(this,Tf,0);m(this,qu);m(this,Fu);m(this,ml);m(this,gl,Promise.resolve());m(this,dr,new AbortController);m(this,Vu);d(this,qu,t),d(this,Fu,e),d(this,ml,r),d(this,Vu,new Promise(i=>{s(this,dr).signal.addEventListener("abort",()=>i())})),h(this,Ue,KS).call(this)}get signal(){return s(this,dr).signal}get closed(){return s(this,Vu)}async sendRequest(t,e){h(this,Ue,Bg).call(this);const r=ro(this,Tf)._++,i=new Promise((o,a)=>{s(this,is).set(r,{resolve:o,reject:a})});return await h(this,Ue,su).call(this,{jsonrpc:"2.0",id:r,method:t,params:e}),i}async sendNotification(t,e){h(this,Ue,Bg).call(this),await h(this,Ue,su).call(this,{jsonrpc:"2.0",method:t,params:e})}}is=new WeakMap,Tf=new WeakMap,qu=new WeakMap,Fu=new WeakMap,ml=new WeakMap,gl=new WeakMap,dr=new WeakMap,Vu=new WeakMap,Ue=new WeakSet,KS=async function(){let t;try{const e=s(this,ml).readable.getReader();try{for(;!s(this,dr).signal.aborted;){const{value:r,done:i}=await e.read();if(i)break;if(r)try{h(this,Ue,XS).call(this,r)}catch(o){console.error("Unexpected error during message processing:",r,o),"id"in r&&r.id!==void 0&&h(this,Ue,su).call(this,{jsonrpc:"2.0",id:r.id,error:{code:-32700,message:"Parse error"}})}}}finally{e.releaseLock()}}catch(e){t=e}finally{h(this,Ue,Vg).call(this,t)}},Vg=function(t){if(s(this,dr).signal.aborted)return;const e=t??new Error("ACP connection closed");for(const r of s(this,is).values())r.reject(e);s(this,is).clear(),s(this,dr).abort(e)},XS=async function(t){if("method"in t&&"id"in t){const e=await h(this,Ue,QS).call(this,t.method,t.params);"error"in e&&console.error("Error handling request",t,e.error),await h(this,Ue,su).call(this,{jsonrpc:"2.0",id:t.id,...e})}else if("method"in t){const e=await h(this,Ue,e_).call(this,t.method,t.params);"error"in e&&console.error("Error handling notification",t,e.error)}else"id"in t?h(this,Ue,t_).call(this,t):console.error("Invalid message",{message:t})},QS=async function(t,e){try{return{result:await s(this,qu).call(this,t,e)??null}}catch(r){if(r instanceof rt)return r.toResult();if(r instanceof Ab)return rt.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 rt.internalError(i?JSON.parse(i):{}).toResult()}catch{return rt.internalError({details:i}).toResult()}}},e_=async function(t,e){try{return await s(this,Fu).call(this,t,e),{result:null}}catch(r){if(r instanceof rt)return r.toResult();if(r instanceof Ab)return rt.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 rt.internalError(i?JSON.parse(i):{}).toResult()}catch{return rt.internalError({details:i}).toResult()}}},t_=function(t){const e=s(this,is).get(t.id);if(e){if("result"in t)e.resolve(t.result);else if("error"in t){const{code:r,message:i,data:o}=t.error;e.reject(new rt(r,i,o))}s(this,is).delete(t.id)}else console.error("Got response to unknown request",t.id)},Bg=function(){if(s(this,dr).signal.aborted)throw s(this,dr).signal.reason??new Error("ACP connection closed")},su=async function(t){return d(this,gl,s(this,gl).then(async()=>{const e=s(this,ml).writable.getWriter();try{await e.write(t)}finally{e.releaseLock()}}).catch(e=>{h(this,Ue,Vg).call(this,e)})),s(this,gl)};class rt extends Error{constructor(e,r,i){super(r);I(this,"code");I(this,"data");this.code=e,this.name="RequestError",this.data=i}static parseError(e,r){return new rt(-32700,`Parse error${r?`: ${r}`:""}`,e)}static invalidRequest(e,r){return new rt(-32600,`Invalid request${r?`: ${r}`:""}`,e)}static methodNotFound(e){return new rt(-32601,`"Method not found": ${e}`,{method:e})}static invalidParams(e,r){return new rt(-32602,`Invalid params${r?`: ${r}`:""}`,e)}static internalError(e,r){return new rt(-32603,`Internal error${r?`: ${r}`:""}`,e)}static authRequired(e,r){return new rt(-32e3,`Authentication required${r?`: ${r}`:""}`,e)}static resourceNotFound(e){return new rt(-32002,`Resource not found${e?`: ${e}`:""}`,e&&{uri:e})}toResult(){return{error:{code:this.code,message:this.message,data:this.data}}}toErrorResponse(){return{code:this.code,message:this.message,data:this.data}}}function FD(n,t,e){const r=n.dispose.bind(n);n.dispose=(()=>{if(!t())return e(),r()})}function n_(n){var e;class t extends n{constructor(...o){super(...o);m(this,e,!1);FD(this,()=>s(this,e),()=>{d(this,e,!0)})}[Symbol.dispose](){this.dispose()}get disposed(){return s(this,e)}}return e=new WeakMap,t}const VD=/^Sender \(untrusted metadata\):\n```json\n[\s\S]*?\n```\n\n?/,BD=/^\[[^\n]*Working directory:[^\n]*\]\n\n?/,jD=/\[Television channel context\][\s\S]*?\[\/Television channel context\]\n*/,WD=/\b(tv|television|channel|artifact|artifacts|viewer|filmstrip|layout|focus)\b/i,GD=/^[A-Za-z0-9_@%+=:,./-]+$/,JD=/\[\[\s*(?:reply_to_current|reply_to\s*:\s*[^\]\n]+|audio_as_voice)\s*\]\]\s*/gi,YD="single_session",KD={name:"television-acp-client",version:"0.0.0"},r_="agent:main:television",XD=n_(zr);var vl,fr,an,pr,ss,qn,ri,mr,Fn,os,Vn,yl,wl,gr,Rt,ii,bl,xo,si,as,Bu,Bn,vr,Cf,yr,L,jg,i_,s_,o_,$d,a_,l_,c_,u_,h_,d_,f_,ao,Fa,Va,Jr,p_,Ba,Wg,Gg,xd,m_,Pd,Jg,Yg,ju,Wu,Dd,ja,Kg,g_;class QD extends XD{constructor(e){super();m(this,L);m(this,vl,"disconnected");m(this,fr,null);m(this,an,new Map);m(this,pr,null);m(this,ss,null);m(this,qn,null);m(this,ri,null);m(this,mr,null);m(this,Fn,null);m(this,os);m(this,Vn,null);m(this,yl,0);m(this,wl,1);m(this,gr,null);m(this,Rt,null);m(this,ii,!1);m(this,bl,!1);m(this,xo,!1);m(this,si,null);m(this,as,new Set);m(this,Bu);m(this,Bn);m(this,vr);m(this,Cf,e=>{h(this,L,s_).call(this,e)});m(this,yr,null);m(this,ju,()=>{h(this,L,ja).call(this,"ACP bridge websocket closed")});m(this,Wu,()=>{h(this,L,ja).call(this,"ACP bridge websocket error")});d(this,Bn,e),d(this,vr,e.sessionMode??YD),d(this,os,e.mappedSessionStore??eO()),d(this,Bu,e.createSocket??(r=>new WebSocket(r)))}get status(){return s(this,vl)}get messages(){return[...s(this,an).values()]}get enabled(){return s(this,Bn).enabled??!1}setToken(e){s(this,Bn).token=e??""}setEnabled(e){s(this,Bn).enabled=e,e||(h(this,L,Dd).call(this),d(this,fr,null),h(this,L,Jr).call(this,"disconnected"))}async connect(){if(this.disposed)throw new Error("ACPClient has been disposed");if(this.enabled&&this.status==="disconnected"){s(this,ss)===null&&(d(this,fr,null),d(this,ss,h(this,L,i_).call(this)));try{await s(this,ss),await h(this,L,$d).call(this)}catch(e){throw h(this,L,ja).call(this,dg(e)),e}}}dispose(){h(this,L,Dd).call(this),d(this,fr,null),h(this,L,Jr).call(this,"disposed")}async sendMessage(e){if(await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,L,jg).call(this,"ready")),(s(this,mr)===null||s(this,Vn)!==h(this,L,Pd).call(this))&&await h(this,L,$d).call(this),this.status!=="ready")throw new Error("ACPClient is not ready to send a new message");const r=e.text.trim();if(!r)throw new Error("Cannot send an empty message");h(this,L,Fa).call(this,{id:h(this,L,Ba).call(this,"user"),kind:"user",text:r,status:"final"}),h(this,L,Jr).call(this,"running");try{const i=await h(this,L,xd).call(this).prompt({sessionId:h(this,L,Gg).call(this),prompt:[{type:"text",text:h(this,L,p_).call(this,r)}]});h(this,L,ao).call(this,i.stopReason==="cancelled"?"cancelled":"final"),h(this,L,Jr).call(this,"ready")}catch(i){throw h(this,L,g_).call(this)||(h(this,L,ao).call(this,"error"),h(this,L,Jr).call(this,"ready")),i}}async startNewSession(){var r;await this.connect(),(this.status==="running"||this.status==="cancelling")&&(await this.cancel(),await h(this,L,jg).call(this,"ready"));const e=h(this,L,Pd).call(this);((r=s(this,Fn))==null?void 0:r.sessionIdStrategy)==="mapped"?s(this,os).clearActualSessionId(e):d(this,yl,s(this,yl)+1),d(this,qn,null),d(this,ri,null),d(this,mr,null),d(this,Vn,null),h(this,L,Kg).call(this)}async cancel(){this.status==="running"&&(h(this,L,Jr).call(this,"cancelling"),await h(this,L,xd).call(this).cancel({sessionId:h(this,L,Gg).call(this)}))}setChannelContext(e){var o,a,l;if(e===null){if(s(this,Rt)===null)return;d(this,Rt,null),d(this,ii,!1);return}const r={channelID:e.channelID,channelName:e.channelName};if(((o=s(this,Rt))==null?void 0:o.channelID)===r.channelID&&((a=s(this,Rt))==null?void 0:a.channelName)===r.channelName)return;const i=((l=s(this,Rt))==null?void 0:l.channelID)??null;if(d(this,Rt,r),s(this,vr)==="single_session"){(!s(this,Vn)||i!==r.channelID)&&d(this,ii,!0);return}s(this,Vn)!==h(this,L,Jg).call(this,r.channelID)&&(d(this,qn,null),d(this,ri,null),s(this,pr)&&this.status==="ready"&&h(this,L,$d).call(this).catch(c=>{h(this,L,ja).call(this,dg(c))}))}}vl=new WeakMap,fr=new WeakMap,an=new WeakMap,pr=new WeakMap,ss=new WeakMap,qn=new WeakMap,ri=new WeakMap,mr=new WeakMap,Fn=new WeakMap,os=new WeakMap,Vn=new WeakMap,yl=new WeakMap,wl=new WeakMap,gr=new WeakMap,Rt=new WeakMap,ii=new WeakMap,bl=new WeakMap,xo=new WeakMap,si=new WeakMap,as=new WeakMap,Bu=new WeakMap,Bn=new WeakMap,vr=new WeakMap,Cf=new WeakMap,yr=new WeakMap,L=new WeakSet,jg=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(s(this,fr)??"ACPClient is disconnected");await new Promise((r,i)=>{const o=()=>{this.removeEventListener("status-changed",a)},a=()=>{if(this.status===e){o(),r();return}if(this.status==="disposed"){o(),i(new Error("ACPClient has been disposed"));return}this.status==="disconnected"&&(o(),i(new Error(s(this,fr)??"ACPClient is disconnected")))};this.addEventListener("status-changed",a)})}},i_=async function(){try{const{stream:e,socket:r,metadata:i}=await iO({serverURL:s(this,Bn).serverURL,token:s(this,Bn).token,createSocket:s(this,Bu),onDisconnect:s(this,Cf)});d(this,Fn,i),d(this,yr,r),r.addEventListener("close",s(this,ju)),r.addEventListener("error",s(this,Wu)),d(this,pr,new UD(o=>({connection:o,sessionUpdate:async a=>{await h(this,L,l_).call(this,a)},requestPermission:async a=>h(this,L,c_).call(this,a)}),e)),await s(this,pr).initialize({protocolVersion:Ex,clientCapabilities:{},clientInfo:KD})}catch(e){throw e}},s_=function(e){h(this,L,ja).call(this,dg(e))},o_=function(e){const r=e==null?void 0:e.models;if(!(r!=null&&r.currentModelId))return;const i=r.availableModels.find(o=>o.modelId===r.currentModelId);console.info("[ACPClient] Current model:",(i==null?void 0:i.name)??r.currentModelId,`(${r.currentModelId})`)},$d=async function(){const e=h(this,L,Pd).call(this);if(s(this,qn)&&s(this,ri)===e){await s(this,qn);return}d(this,ri,e),d(this,qn,h(this,L,a_).call(this,e)),await s(this,qn)},a_=async function(e){var c;const r=h(this,L,xd).call(this);h(this,L,Kg).call(this);let i,o=!1,a=null;const l={cwd:h(this,L,m_).call(this),mcpServers:[],_meta:{sessionKey:e}};try{if(d(this,xo,!0),d(this,si,null),((c=s(this,Fn))==null?void 0:c.sessionIdStrategy)==="mapped"){const u=s(this,os).getActualSessionId(e);if(u)try{const f=await r.loadSession({...l,sessionId:u});if(tO(f))throw new Error("Mapped ACP session was not found");a=f,i=u,o=!0}catch{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,os).setActualSessionId(e,i),o=!1}else{const f=await r.newSession(l);a=f,i=f.sessionId,s(this,os).setActualSessionId(e,i),o=!1}}else try{a=await r.loadSession({...l,sessionId:e}),i=e,o=s(this,an).size>0}catch{const u=await r.newSession(l);a=u,i=u.sessionId,o=!1}}finally{d(this,xo,!1),d(this,si,null),h(this,L,ao).call(this,"final")}h(this,L,o_).call(this,a),await r.setSessionConfigOption({sessionId:i,configId:"verbose_level",value:"full"}),d(this,mr,i),d(this,Vn,e),d(this,bl,!0),o?(s(this,as).add(e),s(this,vr)==="single_session"&&d(this,ii,!1)):(s(this,as).delete(e),d(this,ii,s(this,vr)==="single_session")),d(this,fr,null),h(this,L,Jr).call(this,"ready")},l_=async function(e){const r=e.update;switch(r.sessionUpdate){case"user_message_chunk":r.content.type==="text"&&h(this,L,f_).call(this,r.content.text);return;case"agent_message_chunk":r.content.type==="text"&&h(this,L,u_).call(this,r.content.text);return;case"tool_call":h(this,L,h_).call(this,r);return;case"tool_call_update":h(this,L,d_).call(this,r);return;case"agent_thought_chunk":return;default:return}},c_=async function(e){return{outcome:{outcome:"cancelled"}}},u_=function(e){d(this,si,null);const r=rO(e);if(!r)return;if(!s(this,gr)){const o={id:h(this,L,Ba).call(this,"assistant"),kind:"assistant",text:r,status:"streaming"};d(this,gr,o.id),h(this,L,Fa).call(this,o);return}const i=s(this,an).get(s(this,gr));if(!i||i.kind!=="assistant")throw new Error("Open assistant message invariant violated");h(this,L,Va).call(this,{...i,text:`${i.text}${r}`,status:"streaming"})},h_=function(e){h(this,L,ao).call(this,"final");const r=h(this,L,Wg).call(this,e.toolCallId),i=Lb("content"in e?e.content:void 0),o={id:(r==null?void 0:r.id)??h(this,L,Ba).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:e.title,toolKind:e.kind??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:(r==null?void 0:r.text)??i,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,L,Va).call(this,o);return}h(this,L,Fa).call(this,o)},d_=function(e){const r=h(this,L,Wg).call(this,e.toolCallId),i=(r==null?void 0:r.text)??"",o=Lb(e.content),a=o?`${i}${o}`:i,l={id:(r==null?void 0:r.id)??h(this,L,Ba).call(this,"tool"),kind:"tool_call",toolCallId:e.toolCallId,title:(r==null?void 0:r.title)??e.toolCallId,toolKind:(r==null?void 0:r.toolKind)??"other",status:e.status==="failed"?"failed":e.status==="completed"?"completed":"in_progress",text:a,locations:e.locations??(r==null?void 0:r.locations)};if(r){h(this,L,Va).call(this,l);return}h(this,L,Fa).call(this,l)},f_=function(e){if(h(this,L,ao).call(this,"final"),!e)return;const r=s(this,xo)?s(this,si):null;if(!r){const o=Ob(e);if(!o)return;const a={id:h(this,L,Ba).call(this,"user"),kind:"user",text:o,status:"final"};h(this,L,Fa).call(this,a),s(this,xo)&&d(this,si,a.id);return}const i=s(this,an).get(r);if(!i||i.kind!=="user")throw new Error("Replay user message invariant violated");h(this,L,Va).call(this,{...i,text:Ob(`${i.text}${e}`)})},ao=function(e){if(!s(this,gr))return;const r=s(this,an).get(s(this,gr));(r==null?void 0:r.kind)==="assistant"&&h(this,L,Va).call(this,{...r,status:e}),d(this,gr,null)},Fa=function(e){s(this,an).set(e.id,e),this.dispatchEvent(new lg("messages-changed"))},Va=function(e){s(this,an).set(e.id,e),this.dispatchEvent(new lg("messages-changed"))},Jr=function(e){s(this,vl)!==e&&(d(this,vl,e),this.dispatchEvent(new aC("status-changed")))},p_=function(e){var u;const r=s(this,Vn);if(!r)return e;const i=s(this,Rt)?s(this,vr)==="single_session"?s(this,ii)||!s(this,as).has(r):!s(this,as).has(r):!1,o=s(this,bl)&&(s(this,Rt)!==null||WD.test(e));if(!(o||i))return e;o&&d(this,bl,!1),i&&(d(this,ii,!1),s(this,as).add(r));const l=["[Television channel context]","This chat session is coming from a Television client.","Using Television requires the knowledge in the `television` skill. Re-read it only if it is not already in context or you know it changed.","If the skill is not installed, it can be installed via `tv skills install <your agent skills path>`."],c=((u=s(this,Fn))==null?void 0:u.tvArgs)??[];return c.length>0&&l.push(`To reach this Television server, add these arguments to each tv command that contacts it: ${c.map(aO).join(" ")}`),s(this,Rt)?(l.push("This conversation is currently attached to the channel below."),l.push(`channel_id: ${s(this,Rt).channelID}`),l.push(`channel_name: ${s(this,Rt).channelName??""}`),l.push("When the user asks to inspect or change Television state with the tv CLI, use this channel ID with the --channel argument.")):l.push("There is currently no active Television channel."),l.push("[/Television channel context]","",e),l.join(`
|
|
65
|
+
`)},Ba=function(e){const r=`${e}-${s(this,wl)}`;return d(this,wl,s(this,wl)+1),r},Wg=function(e){for(const r of s(this,an).values())if((r==null?void 0:r.kind)==="tool_call"&&r.toolCallId===e)return r;return null},Gg=function(){if(!s(this,mr))throw new Error("ACP session is not ready");return s(this,mr)},xd=function(){if(!s(this,pr))throw new Error("ACP connection is not ready");return s(this,pr)},m_=function(){var r;const e=(r=s(this,Fn))==null?void 0:r.sessionCwd;if(!e)throw new Error("ACP bridge session cwd is not ready");return e},Pd=function(){var r;if(s(this,vr)==="single_session")return h(this,L,Yg).call(this,`${r_}-${(s(this,Bn).clientGUID??"default-client").toLowerCase()}`);const e=(r=s(this,Rt))==null?void 0:r.channelID;if(!e)throw new Error("Channel context is required for per-channel session mode");return h(this,L,Jg).call(this,e)},Jg=function(e){return h(this,L,Yg).call(this,nO(s(this,vr),e,s(this,Bn).clientGUID??"default-client"))},Yg=function(e){var r;return((r=s(this,Fn))==null?void 0:r.sessionIdStrategy)==="deterministic"&&s(this,yl)>0?`${e}:epoch-${s(this,yl)}`:e},ju=new WeakMap,Wu=new WeakMap,Dd=function(){d(this,pr,null),d(this,ss,null),d(this,qn,null),d(this,ri,null),d(this,mr,null),d(this,Vn,null),d(this,Fn,null),s(this,yr)&&(s(this,yr).removeEventListener("close",s(this,ju)),s(this,yr).removeEventListener("error",s(this,Wu)),s(this,yr).close(),d(this,yr,null))},ja=function(e){const r=s(this,pr)!==null||s(this,ss)!==null||s(this,qn)!==null||s(this,ri)!==null||s(this,mr)!==null||s(this,Vn)!==null||s(this,Fn)!==null||s(this,yr)!==null;this.disposed||this.status==="disconnected"&&!r||(h(this,L,ao).call(this,"error"),h(this,L,Dd).call(this),d(this,fr,e??null),h(this,L,Jr).call(this,"disconnected"))},Kg=function(){const e=s(this,an).size>0;d(this,gr,null),d(this,si,null),d(this,wl,1),s(this,an).clear(),e&&this.dispatchEvent(new lg("messages-changed"))},g_=function(){return this.status==="disconnected"};function eO(){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 tO(n){return n==null?!0:typeof n=="object"&&Object.keys(n).length===0}function nO(n,t,e){return n==="single_session"?`${r_}-${e.toLowerCase()}`:`agent:main:television-${e.toLowerCase()}-${t.toLowerCase()}`}function v_(n){return n.replace(/^(?:\s*\n)+/,"")}function Ob(n){let t=n;return t=t.replace(VD,""),t=t.replace(BD,""),t=t.replace(jD,""),t=v_(t),t}function rO(n){let t=n;return t=t.replace(JD,""),t=v_(t),t}function Lb(n){return!n||n.length===0?"":n.flatMap(t=>t.type==="content"&&t.content.type==="text"?[t.content.text]:[]).join("")}async function iO(n){const t=n.createSocket(cO(n.serverURL,n.token));let e=!1,r,i;const o=new Promise((u,f)=>{r=u,i=f}),a=new ReadableStream({start(u){let f=!1;const p=()=>{t.send(JSON.stringify({type:"acp-bridge-connect"}))},y=_=>{const R=lO(_);if(!R)return;let H;try{H=JSON.parse(R)}catch(P){const N=P instanceof Error?P:new Error(String(P));i(N),u.error(N);return}switch(H.type){case"acp-bridge-status":if(H.status==="ready"){let P;try{P=sO(H)}catch(N){const D=N instanceof Error?N:new Error(String(N));e||i(D),u.error(D);return}e||(e=!0,r(P));return}if(H.status==="error"||H.status==="exited"){const P=new Error(H.error??`ACP bridge ${H.status}`);e||i(P),u.error(P)}return;case"acp-bridge-message":u.enqueue(H.message);return}},v=()=>{var R;if(f)return;f=!0;const _=new Error("ACP bridge websocket closed");e||i(_),(R=n.onDisconnect)==null||R.call(n,_),u.close()},S=()=>{var R;if(f)return;f=!0;const _=new Error("ACP bridge websocket error");e||i(_),(R=n.onDisconnect)==null||R.call(n,_),u.error(_)};t.addEventListener("open",p),t.addEventListener("message",y),t.addEventListener("close",v),t.addEventListener("error",S)}}),l=new WritableStream({async write(u){await o,t.send(JSON.stringify({type:"acp-bridge-message",message:u}))},close(){t.close()},abort(){t.close()}}),c=await o;return{stream:{readable:a,writable:l},socket:t,metadata:c}}function sO(n){const{agent:t,sessionIdStrategy:e,sessionCwd:r,tvArgs:i}=n;if((t==="openclaw"||t==="hermes")&&(e==="deterministic"||e==="mapped")&&typeof r=="string"&&r.length>0&&oO(i))return{agent:t,sessionIdStrategy:e,sessionCwd:r,tvArgs:i};throw new Error("ACP bridge ready status missing bootstrap metadata")}function oO(n){return Array.isArray(n)&&n.every(t=>typeof t=="string")}function aO(n){return GD.test(n)?n:`'${n.replace(/'/g,"'\\''")}'`}function lO(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 cO(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 dg(n){return n instanceof Error?n.message:String(n)}const Mb="television.acpClientGUID",Nb="television.acpMappedSessions",zb=1;var Sl;class uO{constructor(){m(this,Sl,new Map)}getActualSessionId(t){return s(this,Sl).get(t)??null}setActualSessionId(t,e){s(this,Sl).set(t,e)}clearActualSessionId(t){s(this,Sl).delete(t)}}Sl=new WeakMap;var _l,Gu,pn,Od,Ld,Xg;class hO{constructor(t,e){m(this,pn);m(this,_l);m(this,Gu);d(this,_l,t),d(this,Gu,e)}getActualSessionId(t){const e=h(this,pn,Ld).call(this)[h(this,pn,Od).call(this,t)];return typeof e=="string"&&e.length>0?e:null}setActualSessionId(t,e){const r=h(this,pn,Ld).call(this);r[h(this,pn,Od).call(this,t)]=e,h(this,pn,Xg).call(this,r)}clearActualSessionId(t){const e=h(this,pn,Ld).call(this);delete e[h(this,pn,Od).call(this,t)],h(this,pn,Xg).call(this,e)}}_l=new WeakMap,Gu=new WeakMap,pn=new WeakSet,Od=function(t){return JSON.stringify([s(this,Gu),t])},Ld=function(){const t=s(this,_l).getItem(Nb);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!==zb?{}:typeof r.entries!="object"||r.entries===null||Array.isArray(r.entries)?{}:Object.fromEntries(Object.entries(r.entries).filter(i=>typeof i[1]=="string"))},Xg=function(t){const e={version:zb,entries:t};s(this,_l).setItem(Nb,JSON.stringify(e))};function y_(){return typeof window>"u"?null:window.localStorage}function dO(n){const t=n.getItem(Mb);if(t)return t;const e=Zv().toLowerCase();return n.setItem(Mb,e),e}const Hb=4401,fO=401,wd=1e3,pO=3e4;class Md extends Error{constructor(t="Authentication required"){super(t),this.name="AuthError"}}class mO extends zr{constructor(e){var a,l;super();I(this,"url");I(this,"name");I(this,"telemetryMeta");I(this,"status","unauthorized");I(this,"channels",new Map);I(this,"client");I(this,"acpClient");I(this,"templates",new Ax(()=>this.client.templates));I(this,"_token");I(this,"attempting",!1);I(this,"nextRetryAt",null);I(this,"hasEverConnected",!1);I(this,"failedReconnectAttempts",0);I(this,"browserDemoMode",!1);I(this,"hasAuthRejected",!1);I(this,"bootState","pending");I(this,"serverVersion",null);I(this,"updateState",null);I(this,"decideBoot");I(this,"navigationPending");I(this,"createSocket");I(this,"createClient");I(this,"socket",null);I(this,"connectAttempt",0);I(this,"autoReconnect",!1);I(this,"retryTimer",null);I(this,"retryDelay",wd);I(this,"visibilityEventTarget");I(this,"networkEventTarget");I(this,"onVisibilityChange");I(this,"onNetworkOnline");I(this,"telemetryActivityAgent");this.url=ka(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,f)=>new OT(c,{token:u??void 0,onUnauthorized:()=>this.handleAuthRejected(),...f?{telemetryMeta:f}:{}})),this.client=this.createClient(this.url,this._token,this.telemetryMeta);const r=e.mappedSessionStore??(e.acpStorage?new hO(e.acpStorage,this.url):new uO);this.acpClient=new QD({serverURL:this.url,token:this._token??"",...e.createACPSocket?{createSocket:e.createACPSocket}:e.createSocket?{createSocket:e.createSocket}:{},...e.clientGUID?{clientGUID:e.clientGUID}:{},mappedSessionStore:r}),this.visibilityEventTarget=e.visibilityEventTarget!==void 0?e.visibilityEventTarget:typeof document<"u"?document:null,this.networkEventTarget=e.networkEventTarget!==void 0?e.networkEventTarget:typeof window<"u"?window:null,this.onVisibilityChange=()=>{this.isPageVisible()&&this.kickReconnect()},this.onNetworkOnline=()=>{this.kickReconnect()},(a=this.visibilityEventTarget)==null||a.addEventListener("visibilitychange",this.onVisibilityChange),(l=this.networkEventTarget)==null||l.addEventListener("online",this.onNetworkOnline);const i=e.telemetryDocumentTarget!==void 0?e.telemetryDocumentTarget:typeof document<"u"?document:null,o=e.telemetryWindowTarget!==void 0?e.telemetryWindowTarget:typeof window<"u"?window:null;this.telemetryActivityAgent=this.telemetryMeta&&i&&o?bx({meta:this.telemetryMeta,documentTarget:i,windowTarget:o,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=wd,this.autoReconnect=!0,await this.attempt()}dispose(){var e,r,i,o;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),(o=this.telemetryActivityAgent)==null||o.stop(),this.acpClient.dispose(),this.templates.dispose()}getViewURL(e){const r=$u(e,this.renderOptions());return Ri()?new URL(r.viewURL,this.url).toString():r.renderer==="proxy-iframe"?new URL(r.viewURL,this.url).toString():r.viewURL}async readDemoMode(){try{return await this.client.demoMode()}catch{return null}}renderOptions(){return{electron:Ri(),browserDemo:this.browserDemoMode}}getContentURL(e){const r=$u(e,this.renderOptions()).contentURL;return r===null?null:new URL(r,this.url).toString()}async createChannel(e){const{channel:r}=await this.client.channels.create({name:e});return this.channels.set(r.id,structuredClone(r)),r}applyServerEvent(e){switch(e.type){case"templates-changed":this.templates.apply(e);break;case"channel-created":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new nu("channels-changed"));break;case"channel-updated":this.channels.set(e.channel.id,structuredClone(e.channel)),this.dispatchEvent(new nu("channels-changed"));break;case"channel-removed":this.channels.delete(e.channelID),this.dispatchEvent(new nu("channels-changed"));break;case"artifact-created":{const r=this.channels.get(e.channelID);r&&!Xk(r).includes(e.artifact.id)&&(r.layout=[...r.layout,{artifactIds:[e.artifact.id],geometry:{...w6},size:{...b6}}]);break}case"artifact-removed":{const r=this.channels.get(e.channelID);r&&(r.layout=Tg(r.layout,e.artifactID));break}case"artifact-updated":case"artifact-content-changed":case"channel-changed":case"pinned-channels-changed":case"theme-changed":case"appearance-changed":case"artifact-focus":break;default:return gO(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.templates.reset(),this.setStatus("disconnected"),this.dispatchEvent(new dt("change"));const r=this.createSocket(vO(this.url,this._token,this.telemetryMeta));return this.socket=r,await new Promise((o,a)=>{let l=!1,c=!1;const u=()=>{var y;l||this.connectAttempt!==e||(l=!0,c=!0,this.retryDelay=wd,this.hasEverConnected=!0,this.failedReconnectAttempts=0,this.setStatus("connected"),(y=this.telemetryActivityAgent)==null||y.start(),o())},f=y=>{l||this.connectAttempt!==e||(l=!0,a(y))},p=async()=>{const y=this.hasEverConnected;this.templates.load();try{const[{channels:v},S,_]=await Promise.all([this.client.channels.list(),this.client.display.get(),y?null:this.readDemoMode()]);y||(this.browserDemoMode=(_==null?void 0:_.browserExternalPages)===!0),this.channels=new Map(v.map(R=>[R.id,structuredClone(R)])),this.acpClient.setEnabled(S.acpEnabled),this.dispatchEvent(new dt("change")),y&&this.dispatchEvent(new nu("channels-changed")),this.dispatchEvent(new Rd("server-event",{event:{type:"channel-changed",channelID:S.focusedChannelId}})),this.dispatchEvent(new Rd("server-event",{event:{type:"pinned-channels-changed",pinnedChannelIds:[...S.pinnedChannelIds]}})),u(),y&&this.connectAttempt===e&&this.dispatchEvent(new L6("server-reconnected"))}catch(v){if(AO(v)){f(new Md);return}f(v instanceof Error?v:new Error(String(v)))}};r.addEventListener("open",()=>{this.decideBoot===null&&(this.bootState="booted",this.navigationPending()||p())}),r.addEventListener("message",y=>{if(this.connectAttempt!==e)return;const v=_O(y);if(!v)return;if(v.type==="server-status"){const _=v;this.serverVersion=_.version,this.updateState=_.update??null;let R=!1;this.decideBoot!==null&&this.bootState==="pending"&&this.connectAttempt===e&&(this.decideBoot(_)==="boot"?(this.bootState="booted",R=!0):(this.bootState="halted",this.attempting=!1)),this.dispatchEvent(new M6("server-status",{message:_})),R?this.navigationPending()||p():this.bootState==="halted"&&!this.navigationPending()&&this.dispatchEvent(new dt("change"));return}if(!SO(v.type)||v.type==="templates-changed"&&(this.bootState!=="booted"||this.navigationPending()))return;const S=v;this.applyServerEvent(S),this.dispatchEvent(new Rd("server-event",{event:S}))}),r.addEventListener("close",y=>{if(this.connectAttempt!==e)return;this.socket=null;const v=yO(y);if(!l){f(v===Hb?new Md:new Error("Connection closed before initialization"));return}if(c){if(v===Hb){this.handleAuthRejected();return}this.handleTransportFailure(new Error("Connection closed"))}}),r.addEventListener("error",()=>{if(this.connectAttempt===e){if(l){if(!c)return;this.handleTransportFailure(new Error("WebSocket error"));return}f(new Error("WebSocket connection failed"))}})}).then(()=>{this.attempting=!1},o=>{throw this.attempting=!1,this.handleAttemptFailure(o),o})}handleAuthRejected(){this.hasAuthRejected=!0,this.autoReconnect=!1,this.cancelRetryTimer(),this.setStatus("unauthorized")}handleAttemptFailure(e){if(e instanceof Md){this.handleAuthRejected();return}this.autoReconnect&&(this.hasEverConnected&&(this.failedReconnectAttempts+=1),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,pO),this.nextRetryAt=Date.now()+e,this.retryTimer=setTimeout(()=>{this.retryTimer=null,this.attempt().catch(()=>{})},e),this.dispatchEvent(new dt("change"))}cancelRetryTimer(){this.retryTimer!==null&&(clearTimeout(this.retryTimer),this.retryTimer=null),this.nextRetryAt!==null&&(this.nextRetryAt=null,this.dispatchEvent(new dt("change")))}kickReconnect(){this.autoReconnect&&this.status!=="connected"&&(this.attempting||(this.cancelRetryTimer(),this.retryDelay=wd,this.attempt().catch(()=>{})))}sendTelemetryActivity(e){var r;this.status==="connected"&&((r=this.socket)==null||r.send(JSON.stringify(e)))}sendTelemetrySignal(e,r){var o;if(!this.telemetryMeta||this.status!=="connected"&&this.bootState!=="halted")return;const i={type:Kk,clientId:this.telemetryMeta.clientId,event:e,properties:r};(o=this.socket)==null||o.send(JSON.stringify(i))}setStatus(e){this.status!==e&&(this.status=e,this.dispatchEvent(new dt("change")))}isPageVisible(){return this.visibilityEventTarget===null?!0:this.visibilityEventTarget.visibilityState==="visible"}}function gO(n,t){throw new Error(`Unexpected ${t}: ${JSON.stringify(n)}`)}function vO(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,o]of wx(e))r.searchParams.set(i,o);return r.hash="",r.toString()}function yO(n){return typeof n=="object"&&n!==null&&"code"in n&&typeof n.code=="number"?n.code:null}const wO={"templates-changed":!0,"artifact-created":!0,"artifact-updated":!0,"artifact-content-changed":!0,"artifact-removed":!0,"channel-created":!0,"channel-updated":!0,"channel-removed":!0,"channel-changed":!0,"pinned-channels-changed":!0,"theme-changed":!0,"appearance-changed":!0,"artifact-focus":!0},bO=new Set(Object.keys(wO));function SO(n){return bO.has(n)}function _O(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 AO(n){return n instanceof Cc&&n.status===fO}const EO="Local";var wr,jn,Di,w_,Qg,b_,Ju,Yu,Ku,Xu,Qu;class kO extends zr{constructor(e){super();m(this,Di);I(this,"connection");I(this,"clientGUID");I(this,"acpStorage");I(this,"connectError",null);m(this,wr);m(this,jn,!1);m(this,Ju,()=>{s(this,jn)||(h(this,Di,b_).call(this),this.dispatchEvent(new dt("change")))});m(this,Yu,e=>{s(this,jn)||this.dispatchEvent(new Rd("server-event",{event:e.event}))});m(this,Ku,()=>{s(this,jn)||this.dispatchEvent(new nu("channels-changed"))});m(this,Xu,()=>{s(this,jn)||this.dispatchEvent(new L6("server-reconnected"))});m(this,Qu,e=>{s(this,jn)||this.dispatchEvent(new M6("server-status",{message:e.message}))});d(this,wr,e.localStore),this.acpStorage=e.acpStorage===void 0?y_():e.acpStorage,this.clientGUID=e.clientGUID??(this.acpStorage?dO(this.acpStorage):Zv().toLowerCase());const r=ka(e.serverURL);e.launchToken!==void 0&&e.launchToken!==null&&s(this,wr).set(hC(s(this,wr).get(),r,e.launchToken));const i=e.launchToken??ob(s(this,wr).get(),r),o=e.createSocket??(l=>new WebSocket(l)),a=e.createConnection??(l=>new mO(l));this.connection=a({url:r,name:e.connectionName??EO,token:i,createSocket:o,clientGUID:this.clientGUID,acpStorage:this.acpStorage,telemetryMeta:e.telemetryMeta??null,decideBoot:e.decideBoot,navigationPending:e.navigationPending}),this.connection.addEventListener("change",s(this,Ju)),this.connection.addEventListener("server-event",s(this,Yu)),this.connection.addEventListener("channels-changed",s(this,Ku)),this.connection.addEventListener("server-reconnected",s(this,Xu)),this.connection.addEventListener("server-status",s(this,Qu))}get storedAuthToken(){return ob(s(this,wr).get(),this.connection.url)}async connect(){await h(this,Di,w_).call(this,this.connection.token)}dispose(){s(this,jn)||(d(this,jn,!0),this.connection.removeEventListener("change",s(this,Ju)),this.connection.removeEventListener("server-event",s(this,Yu)),this.connection.removeEventListener("channels-changed",s(this,Ku)),this.connection.removeEventListener("server-reconnected",s(this,Xu)),this.connection.removeEventListener("server-status",s(this,Qu)),this.connection.dispose())}}wr=new WeakMap,jn=new WeakMap,Di=new WeakSet,w_=async function(e){if(!s(this,jn)){h(this,Di,Qg).call(this,null);try{await this.connection.connect(e)}catch(r){h(this,Di,Qg).call(this,r instanceof Md?null:r instanceof Error?r.message:String(r))}}},Qg=function(e){this.connectError!==e&&(this.connectError=e,this.dispatchEvent(new dt("change")))},b_=function(){if(this.connection.status!=="unauthorized"||!this.connection.hasAuthRejected)return;const e=s(this,wr).get(),r=dC(e,this.connection.url);r!==e&&s(this,wr).set(r),this.connection.token!==null&&this.connection.clearToken()},Ju=new WeakMap,Yu=new WeakMap,Ku=new WeakMap,Xu=new WeakMap,Qu=new WeakMap;const e1="tv-nav:",yc="tv-reload",Zb=100,TO=1e3,CO=60,RO=60,IO=24,$O=30,xO=$O*IO*RO*CO*TO;function $i(n){try{const t=new URL(n,window.location.href),e=t.searchParams.has(yc);return t.searchParams.delete(yc),t.origin===window.location.origin?`${t.pathname}${t.search}${t.hash}`:e?t.toString():n}catch{return n}}var eh,Al,De,Ie,Po,Ke,S_,ji,__,t1,n1;class PO extends zr{constructor(e,r){super();m(this,Ke);m(this,eh);m(this,Al);m(this,De,[]);m(this,Ie,-1);m(this,Po,0);d(this,eh,e),d(this,Al,$i(r)),h(this,Ke,S_).call(this)}get currentURL(){var e;return s(this,Ie)===-1?null:((e=s(this,De)[s(this,Ie)])==null?void 0:e.url)??null}get canGoBack(){return s(this,Ie)>-1}get canGoForward(){return s(this,Ie)<s(this,De).length-1}get entries(){return s(this,De).map(e=>({...e}))}get cursor(){return s(this,Ie)}navigate(e){const r=$i(e);if(r===s(this,Al)){if(s(this,Ie)===-1)return;d(this,Ie,-1),h(this,Ke,ji).call(this);return}s(this,Ie)<s(this,De).length-1&&d(this,De,s(this,De).slice(0,s(this,Ie)+1)),s(this,De).push({url:r}),d(this,Ie,s(this,De).length-1),h(this,Ke,t1).call(this),h(this,Ke,ji).call(this)}replace(e){var i;if(s(this,Ie)===-1){this.navigate(e);return}const r=$i(e);if(r===s(this,Al)){d(this,De,s(this,De).filter((o,a)=>a!==s(this,Ie))),d(this,Ie,-1),h(this,Ke,ji).call(this);return}((i=s(this,De)[s(this,Ie)])==null?void 0:i.url)!==r&&(d(this,De,s(this,De).map((o,a)=>a===s(this,Ie)?{url:r}:o)),h(this,Ke,ji).call(this))}back(){s(this,Ie)!==-1&&(d(this,Ie,s(this,Ie)-1),h(this,Ke,ji).call(this))}forward(){this.canGoForward&&(d(this,Ie,s(this,Ie)+1),h(this,Ke,ji).call(this))}reset(){s(this,Ie)===-1&&s(this,De).length===0||(d(this,De,[]),d(this,Ie,-1),h(this,Ke,ji).call(this))}}eh=new WeakMap,Al=new WeakMap,De=new WeakMap,Ie=new WeakMap,Po=new WeakMap,Ke=new WeakSet,S_=function(){const e=localStorage.getItem(s(this,Ke,n1));if(e!==null)try{const r=JSON.parse(e);if(!A_(r))return;d(this,De,r.entries.map(i=>({url:i.url}))),d(this,Ie,r.cursor),d(this,Po,r.lastWritten),h(this,Ke,t1).call(this)}catch{d(this,De,[]),d(this,Ie,-1),d(this,Po,0)}},ji=function(){d(this,Po,Date.now());try{localStorage.setItem(s(this,Ke,n1),JSON.stringify(h(this,Ke,__).call(this)))}catch(e){if(!LO(e))throw e}this.dispatchEvent(new dt("change"))},__=function(){return{v:1,entries:s(this,De).map(e=>({...e})),cursor:s(this,Ie),lastWritten:s(this,Po)}},t1=function(){if(s(this,De).length<=Zb)return;const e=s(this,De).length-Zb;d(this,De,s(this,De).slice(e)),d(this,Ie,Math.max(-1,s(this,Ie)-e))},n1=function(){return DO(s(this,eh))};function DO(n){return`${e1}${n}`}function OO(n){const t=Date.now()-xO,e=[];for(let r=0;r<localStorage.length;r+=1){const i=localStorage.key(r);if(!(i!=null&&i.startsWith(e1)))continue;const o=i.slice(e1.length),a=localStorage.getItem(i);if(a===null)continue;let l;try{l=JSON.parse(a)}catch{e.push(i);continue}if(!A_(l)){e.push(i);continue}!n.has(o)&&l.lastWritten<t&&e.push(i)}for(const r of e)localStorage.removeItem(r)}function LO(n){return n instanceof DOMException&&n.name==="QuotaExceededError"}function A_(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 fg="tv-channel-sidebar-collapsed";var Do;class MO{constructor(t){m(this,Do);d(this,Do,t)}read(){return s(this,Do).getItem(fg)==="true"}setCollapsed(t){try{t?s(this,Do).setItem(fg,"true"):s(this,Do).removeItem(fg)}catch{}}}Do=new WeakMap;const pg="tv-channel-sidebar-width",r1=160,i1=350,bd=260,NO=/^-?\d+$/;var Oo;class zO{constructor(t){m(this,Oo);d(this,Oo,t)}read(){const t=s(this,Oo).getItem(pg);if(t===null||!NO.test(t))return null;const e=BigInt(t);return e<BigInt(r1)?r1:e>BigInt(i1)?i1:Number(e)}commit(t){const e=E_(Math.round(t));try{s(this,Oo).setItem(pg,String(e))}catch{}return e}clear(){try{s(this,Oo).removeItem(pg)}catch{}}}Oo=new WeakMap;function E_(n){return Math.min(Math.max(n,r1),i1)}const HO="1.6.0";function Kv(n=HO){return n!==void 0&&n.length>0?n:"0.0.0"}function Xv(){let n=!1;return{get pending(){return n},begin(t){n||(n=!0,t())}}}const s1="tv-reload-attempted";function ZO(n){return n.marker!==null&&n.bundleVersion===n.serverVersion?{action:"signal-autoreloaded",fromVersion:n.marker.fromVersion,toVersion:n.bundleVersion}:NT(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"}}function UO(n){const t=n.getItem(s1);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 qO(n){const t=n.storage!==void 0?n.storage:typeof sessionStorage<"u"?sessionStorage:null,e=n.reload??(()=>location.reload()),r=n.navigationLatch??Xv(),i=n.bundleVersion??Kv();if(t===null)return{dispose(){}};let o=null;const a=()=>{if(o===null)return;const u=n.owner.connection;if(u.status!=="connected")return;const f=o;o=null,u.sendTelemetrySignal("client_autoreloaded",{from_version:f.fromVersion,to_version:f.toVersion})},l=u=>{if(r.pending)return;const f=ZO({bundleVersion:i,serverVersion:u.message.version,marker:UO(t)});switch(f.action){case"reload":t.setItem(s1,JSON.stringify(f.marker)),r.begin(e);return;case"signal-autoreloaded":t.removeItem(s1),o={fromVersion:f.fromVersion,toVersion:f.toVersion},a();return;case"none":return}},c=()=>{a()};return n.owner.addEventListener("server-status",l),n.owner.addEventListener("change",c),{dispose(){n.owner.removeEventListener("server-status",l),n.owner.removeEventListener("change",c)}}}function FO(n){const t=Ri(n.search),e=bS(n.search),r=e!==null&&kp(e)?e:null;return{electron:t,shellVersion:r}}function VO(n){return!n.electron||n.requiredDesktopVersion===null||!kp(n.requiredDesktopVersion)?!1:n.shellVersion===null?!0:n.shellVersion===af?!1:Hv(n.requiredDesktopVersion,n.shellVersion)}const BO=`# Desktop app update required
|
|
66
|
+
|
|
67
|
+
This version of the Television desktop app does not work with this server and needs to be updated. The new version has already downloaded and installs when you restart the app.`,jO=`# Desktop app update required
|
|
68
|
+
|
|
69
|
+
This version of the Television desktop app does not work with this server and needs to be updated. [Download the latest version for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64) and install it.`;function k_(n,t=!1){return t?BO:n===null?jO:n.upgradeMarkdown}function WO(n){const t=VO(n);return{gated:t,instructionsMarkdown:t?k_(n.desktop):null,suppressUpdateToast:t}}function GO(n){const t=n.reload??(()=>location.reload()),e=n.navigationLatch??Xv();let r=null,i=!1;const o=new Set,a=f=>{var p;return WO({electron:n.detection.electron,shellVersion:n.detection.shellVersion,requiredDesktopVersion:f.requiredDesktopVersion,desktop:((p=f.update)==null?void 0:p.desktop)??null})};function l(){var f;(f=n.presentation)==null||f.suppressToasts()}function c(f){const p=f.requiredDesktopVersion;p===null||o.has(p)||(o.add(p),r==null||r.connection.sendTelemetrySignal("desktop_upgrade_gate_shown",{...n.detection.shellVersion===null?{}:{desktop_app_version:n.detection.shellVersion},required_desktop_version:p}))}const u=f=>{e.pending||(a(f.message).gated?(i=!0,l(),c(f.message)):i&&e.begin(t))};return{get gated(){return i},decideBoot(f){return a(f).gated?"halt":"boot"},attach(f){r=f,f.addEventListener("server-status",u)},dispose(){r==null||r.removeEventListener("server-status",u),r=null}}}var El;class JO extends zr{constructor(){super(...arguments);m(this,El,!1)}get toastsSuppressed(){return s(this,El)}suppressToasts(){s(this,El)||(d(this,El,!0),this.dispatchEvent(new dt("change")))}}El=new WeakMap;const YO=`### Desktop app update ready
|
|
70
|
+
|
|
71
|
+
Television updates its desktop app automatically. Version {version} has downloaded and installs when you restart the app.`,KO="tv-desktop-self-update-dismissed";function XO(n){return YO.replace("{version}",n)}var th,kl,nh,Lo,Tl;class QO extends zr{constructor({electron:e,bridge:r}){super();m(this,th);m(this,kl);m(this,nh,!1);m(this,Lo,null);m(this,Tl,!1);d(this,th,e),d(this,kl,r??null)}get version(){return s(this,Lo)}get restarting(){return s(this,Tl)}subscribe(){if(s(this,nh))return;d(this,nh,!0);const e=s(this,kl);!s(this,th)||typeof(e==null?void 0:e.onDesktopUpdateDownloaded)!="function"||e.onDesktopUpdateDownloaded(r=>{typeof r!="string"||r.length===0||r===s(this,Lo)||(d(this,Lo,r),this.dispatchEvent(new dt("change")))})}restart(){var e,r;s(this,Lo)===null||s(this,Tl)||(d(this,Tl,!0),(r=(e=s(this,kl))==null?void 0:e.restartToInstallUpdate)==null||r.call(e),this.dispatchEvent(new dt("change")))}}th=new WeakMap,kl=new WeakMap,nh=new WeakMap,Lo=new WeakMap,Tl=new WeakMap;function eL(n,t=window){const e=t.__televisionAppearanceResolver;if(e!==void 0)return e;const r=t.matchMedia("(prefers-color-scheme: dark)");let i=n;const o=c=>c==="system"||c==="light"||c==="dark",a=()=>{const c=i==="system"?r.matches?"dark":"light":i;t.document.documentElement.dataset.theme=c},l={setPreference(c){o(c)&&(i=c,a())}};return t.__televisionAppearanceResolver=l,r.addEventListener("change",()=>{i==="system"&&a()}),a(),l}function T_(n){return typeof n=="object"&&n!==null}function C_(n){return!T_(n)||n.type!=="ready"?!1:!("id"in n)}function R_(n){return!(!T_(n)||n.type!=="update-content"||typeof n.id!="string"||typeof n.content!="string")}const I_=Ln(),$_="No handler registered for update-content",x_="handleUpdateContent: handler already registered",Ub="television-artifact-bridge";function P_(n){return n instanceof Error&&typeof n.message=="string"?n.message:String(n)}const D_=n_(zr);var Cl,Rl,Il,Mo,No,$l,it,o1,O_,L_,Wa,Nd,K8;let tL=(K8=class extends D_{constructor(e){super();m(this,it);m(this,Cl);m(this,Rl);m(this,Il);m(this,Mo,null);m(this,No,null);m(this,$l,!1);d(this,Cl,e);const r=e.ownerDocument.defaultView;if(!r)throw new Error("ArtifactView: iframe has no owner window");d(this,Rl,r),d(this,Il,i=>h(this,it,O_).call(this,i)),s(this,Rl).addEventListener("message",s(this,Il))}get content(){return s(this,No)}set content(e){h(this,it,Nd).call(this),d(this,No,e),s(this,$l)&&h(this,it,o1).call(this,e)}handleUpdateContent(e){if(h(this,it,Nd).call(this),s(this,Mo)!==null)throw new Error(x_);d(this,Mo,e)}notifyStylesChanged(){if(h(this,it,Nd).call(this),!s(this,$l))return;const e={type:"styles-changed"};h(this,it,Wa).call(this,e)}dispose(){s(this,Rl).removeEventListener("message",s(this,Il)),d(this,Mo,null)}},Cl=new WeakMap,Rl=new WeakMap,Il=new WeakMap,Mo=new WeakMap,No=new WeakMap,$l=new WeakMap,it=new WeakSet,o1=function(e){const r={type:"content-updated",content:e};h(this,it,Wa).call(this,r)},O_=function(e){if(this.disposed||e.source!==s(this,Cl).contentWindow)return;const r=e.data;if(C_(r)){d(this,$l,!0),this.dispatchEvent(new I_("ready")),s(this,No)!==null&&h(this,it,o1).call(this,s(this,No));return}if(R_(r)){h(this,it,L_).call(this,r);return}},L_=async function(e){const r=s(this,Mo);if(r===null){h(this,it,Wa).call(this,{type:"response",id:e.id,error:{message:$_}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,it,Wa).call(this,{type:"response",id:e.id,error:{message:P_(i)}});return}this.disposed||h(this,it,Wa).call(this,{type:"response",id:e.id,result:{}})},Wa=function(e){const r=s(this,Cl).contentWindow;r&&r.postMessage(e,"*")},Nd=function(){if(this.disposed)throw new Error("ArtifactView is disposed")},K8);var zo,xl,Ho,Zo,Pl,st,a1,M_,N_,Ga,zd;class nL extends D_{constructor(e){super();m(this,st);m(this,zo);m(this,xl);m(this,Ho,null);m(this,Zo,null);m(this,Pl,!1);d(this,zo,e),d(this,xl,r=>h(this,st,M_).call(this,r)),s(this,zo).addEventListener("ipc-message",s(this,xl))}get content(){return s(this,Zo)}set content(e){h(this,st,zd).call(this),d(this,Zo,e),s(this,Pl)&&h(this,st,a1).call(this,e)}handleUpdateContent(e){if(h(this,st,zd).call(this),s(this,Ho)!==null)throw new Error(x_);d(this,Ho,e)}notifyStylesChanged(){if(h(this,st,zd).call(this),!s(this,Pl))return;const e={type:"styles-changed"};h(this,st,Ga).call(this,e)}dispose(){s(this,zo).removeEventListener("ipc-message",s(this,xl)),d(this,Ho,null)}}zo=new WeakMap,xl=new WeakMap,Ho=new WeakMap,Zo=new WeakMap,Pl=new WeakMap,st=new WeakSet,a1=function(e){const r={type:"content-updated",content:e};h(this,st,Ga).call(this,r)},M_=function(e){var o;if(this.disposed)return;const r=e.detail??e;if(!r||r.channel!==Ub)return;const i=(o=r.args)==null?void 0:o[0];if(C_(i)){d(this,Pl,!0),this.dispatchEvent(new I_("ready")),s(this,Zo)!==null&&h(this,st,a1).call(this,s(this,Zo));return}if(R_(i)){h(this,st,N_).call(this,i);return}},N_=async function(e){const r=s(this,Ho);if(r===null){h(this,st,Ga).call(this,{type:"response",id:e.id,error:{message:$_}});return}try{await r(e.content)}catch(i){if(this.disposed)return;h(this,st,Ga).call(this,{type:"response",id:e.id,error:{message:P_(i)}});return}this.disposed||h(this,st,Ga).call(this,{type:"response",id:e.id,result:{}})},Ga=function(e){var r,i;(i=(r=s(this,zo)).send)==null||i.call(r,Ub,e)},zd=function(){if(this.disposed)throw new Error("WebviewArtifactViewRuntime is disposed")};/**
|
|
72
|
+
* @license
|
|
73
|
+
* Copyright 2017 Google LLC
|
|
74
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
+
*/const Au=globalThis,qb=n=>n,ff=Au.trustedTypes,Fb=ff?ff.createPolicy("lit-html",{createHTML:n=>n}):void 0,z_="$lit$",Ki=`lit$${Math.random().toFixed(9).slice(2)}$`,H_="?"+Ki,rL=`<${H_}>`,_a=document,xu=()=>_a.createComment(""),Pu=n=>n===null||typeof n!="object"&&typeof n!="function",Qv=Array.isArray,iL=n=>Qv(n)||typeof(n==null?void 0:n[Symbol.iterator])=="function",mg=`[
|
|
76
|
+
\f\r]`,Vc=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Vb=/-->/g,Bb=/>/g,io=RegExp(`>|${mg}(?:([^\\s"'>=/]+)(${mg}*=${mg}*(?:[^
|
|
77
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),jb=/'/g,Wb=/"/g,Z_=/^(?:script|style|textarea|title)$/i,sL=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),V=sL(1),Dt=Symbol.for("lit-noChange"),oe=Symbol.for("lit-nothing"),Gb=new WeakMap,yo=_a.createTreeWalker(_a,129);function U_(n,t){if(!Qv(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return Fb!==void 0?Fb.createHTML(t):t}const oL=(n,t)=>{const e=n.length-1,r=[];let i,o=t===2?"<svg>":t===3?"<math>":"",a=Vc;for(let l=0;l<e;l++){const c=n[l];let u,f,p=-1,y=0;for(;y<c.length&&(a.lastIndex=y,f=a.exec(c),f!==null);)y=a.lastIndex,a===Vc?f[1]==="!--"?a=Vb:f[1]!==void 0?a=Bb:f[2]!==void 0?(Z_.test(f[2])&&(i=RegExp("</"+f[2],"g")),a=io):f[3]!==void 0&&(a=io):a===io?f[0]===">"?(a=i??Vc,p=-1):f[1]===void 0?p=-2:(p=a.lastIndex-f[2].length,u=f[1],a=f[3]===void 0?io:f[3]==='"'?Wb:jb):a===Wb||a===jb?a=io:a===Vb||a===Bb?a=Vc:(a=io,i=void 0);const v=a===io&&n[l+1].startsWith("/>")?" ":"";o+=a===Vc?c+rL:p>=0?(r.push(u),c.slice(0,p)+z_+c.slice(p)+Ki+v):c+Ki+(p===-2?l:v)}return[U_(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),r]};class Du{constructor({strings:t,_$litType$:e},r){let i;this.parts=[];let o=0,a=0;const l=t.length-1,c=this.parts,[u,f]=oL(t,e);if(this.el=Du.createElement(u,r),yo.currentNode=this.el.content,e===2||e===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(i=yo.nextNode())!==null&&c.length<l;){if(i.nodeType===1){if(i.hasAttributes())for(const p of i.getAttributeNames())if(p.endsWith(z_)){const y=f[a++],v=i.getAttribute(p).split(Ki),S=/([.?@])?(.*)/.exec(y);c.push({type:1,index:o,name:S[2],strings:v,ctor:S[1]==="."?lL:S[1]==="?"?cL:S[1]==="@"?uL:Mp}),i.removeAttribute(p)}else p.startsWith(Ki)&&(c.push({type:6,index:o}),i.removeAttribute(p));if(Z_.test(i.tagName)){const p=i.textContent.split(Ki),y=p.length-1;if(y>0){i.textContent=ff?ff.emptyScript:"";for(let v=0;v<y;v++)i.append(p[v],xu()),yo.nextNode(),c.push({type:2,index:++o});i.append(p[y],xu())}}}else if(i.nodeType===8)if(i.data===H_)c.push({type:2,index:o});else{let p=-1;for(;(p=i.data.indexOf(Ki,p+1))!==-1;)c.push({type:7,index:o}),p+=Ki.length-1}o++}}static createElement(t,e){const r=_a.createElement("template");return r.innerHTML=t,r}}function wc(n,t,e=n,r){var a,l;if(t===Dt)return t;let i=r!==void 0?(a=e._$Co)==null?void 0:a[r]:e._$Cl;const o=Pu(t)?void 0:t._$litDirective$;return(i==null?void 0:i.constructor)!==o&&((l=i==null?void 0:i._$AO)==null||l.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,e,r)),r!==void 0?(e._$Co??(e._$Co=[]))[r]=i:e._$Cl=i),i!==void 0&&(t=wc(n,i._$AS(n,t.values),i,r)),t}class aL{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:r}=this._$AD,i=((t==null?void 0:t.creationScope)??_a).importNode(e,!0);yo.currentNode=i;let o=yo.nextNode(),a=0,l=0,c=r[0];for(;c!==void 0;){if(a===c.index){let u;c.type===2?u=new Lp(o,o.nextSibling,this,t):c.type===1?u=new c.ctor(o,c.name,c.strings,this,t):c.type===6&&(u=new hL(o,this,t)),this._$AV.push(u),c=r[++l]}a!==(c==null?void 0:c.index)&&(o=yo.nextNode(),a++)}return yo.currentNode=_a,i}p(t){let e=0;for(const r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(t,r,e),e+=r.strings.length-2):r._$AI(t[e])),e++}}let Lp=class q_{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,r,i){this.type=2,this._$AH=oe,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=r,this.options=i,this._$Cv=(i==null?void 0:i.isConnected)??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&(t==null?void 0:t.nodeType)===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=wc(this,t,e),Pu(t)?t===oe||t==null||t===""?(this._$AH!==oe&&this._$AR(),this._$AH=oe):t!==this._$AH&&t!==Dt&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):iL(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==oe&&Pu(this._$AH)?this._$AA.nextSibling.data=t:this.T(_a.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:r}=t,i=typeof r=="number"?this._$AC(t):(r.el===void 0&&(r.el=Du.createElement(U_(r.h,r.h[0]),this.options)),r);if(((o=this._$AH)==null?void 0:o._$AD)===i)this._$AH.p(e);else{const a=new aL(i,this),l=a.u(this.options);a.p(e),this.T(l),this._$AH=a}}_$AC(t){let e=Gb.get(t.strings);return e===void 0&&Gb.set(t.strings,e=new Du(t)),e}k(t){Qv(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let r,i=0;for(const o of t)i===e.length?e.push(r=new q_(this.O(xu()),this.O(xu()),this,this.options)):r=e[i],r._$AI(o),i++;i<e.length&&(this._$AR(r&&r._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,e);t!==this._$AB;){const i=qb(t).nextSibling;qb(t).remove(),t=i}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}},Mp=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,r,i,o){this.type=1,this._$AH=oe,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=oe}_$AI(t,e=this,r,i){const o=this.strings;let a=!1;if(o===void 0)t=wc(this,t,e,0),a=!Pu(t)||t!==this._$AH&&t!==Dt,a&&(this._$AH=t);else{const l=t;let c,u;for(t=o[0],c=0;c<o.length-1;c++)u=wc(this,l[r+c],e,c),u===Dt&&(u=this._$AH[c]),a||(a=!Pu(u)||u!==this._$AH[c]),u===oe?t=oe:t!==oe&&(t+=(u??"")+o[c+1]),this._$AH[c]=u}a&&!i&&this.j(t)}j(t){t===oe?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}},lL=class extends Mp{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===oe?void 0:t}},cL=class extends Mp{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==oe)}},uL=class extends Mp{constructor(t,e,r,i,o){super(t,e,r,i,o),this.type=5}_$AI(t,e=this){if((t=wc(this,t,e,0)??oe)===Dt)return;const r=this._$AH,i=t===oe&&r!==oe||t.capture!==r.capture||t.once!==r.once||t.passive!==r.passive,o=t!==oe&&(r===oe||i);i&&this.element.removeEventListener(this.name,this,r),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}};class hL{constructor(t,e,r){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(t){wc(this,t)}}const dL={I:Lp},gg=Au.litHtmlPolyfillSupport;gg==null||gg(Du,Lp),(Au.litHtmlVersions??(Au.litHtmlVersions=[])).push("3.3.2");const l1=(n,t,e)=>{const r=t;let i=r._$litPart$;return i===void 0&&(r._$litPart$=i=new Lp(t.insertBefore(xu(),null),null,void 0,{})),i._$AI(n),i};/**
|
|
78
|
+
* @license
|
|
79
|
+
* Copyright 2020 Google LLC
|
|
80
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
81
|
+
*/const{I:fL}=dL,Jb=n=>n,F_=n=>n.strings===void 0,Yb=()=>document.createComment(""),Bc=(n,t,e)=>{var o;const r=n._$AA.parentNode,i=t===void 0?n._$AB:t._$AA;if(e===void 0){const a=r.insertBefore(Yb(),i),l=r.insertBefore(Yb(),i);e=new fL(a,l,n,n.options)}else{const a=e._$AB.nextSibling,l=e._$AM,c=l!==n;if(c){let u;(o=e._$AQ)==null||o.call(e,n),e._$AM=n,e._$AP!==void 0&&(u=n._$AU)!==l._$AU&&e._$AP(u)}if(a!==i||c){let u=e._$AA;for(;u!==a;){const f=Jb(u).nextSibling;Jb(r).insertBefore(u,i),u=f}}}return e},so=(n,t,e=n)=>(n._$AI(t,e),n),pL={},V_=(n,t=pL)=>n._$AH=t,mL=n=>n._$AH,vg=n=>{n._$AR(),n._$AA.remove()};/**
|
|
82
|
+
* @license
|
|
83
|
+
* Copyright 2017 Google LLC
|
|
84
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
85
|
+
*/const Or={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},xc=n=>(...t)=>({_$litDirective$:n,values:t});let td=class{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,r){this._$Ct=t,this._$AM=e,this._$Ci=r}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};/**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright 2017 Google LLC
|
|
88
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
89
|
+
*/const Eu=(n,t)=>{var r;const e=n._$AN;if(e===void 0)return!1;for(const i of e)(r=i._$AO)==null||r.call(i,t,!1),Eu(i,t);return!0},pf=n=>{let t,e;do{if((t=n._$AM)===void 0)break;e=t._$AN,e.delete(n),n=t}while((e==null?void 0:e.size)===0)},B_=n=>{for(let t;t=n._$AM;n=t){let e=t._$AN;if(e===void 0)t._$AN=e=new Set;else if(e.has(n))break;e.add(n),yL(t)}};function gL(n){this._$AN!==void 0?(pf(this),this._$AM=n,B_(this)):this._$AM=n}function vL(n,t=!1,e=0){const r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(t)if(Array.isArray(r))for(let o=e;o<r.length;o++)Eu(r[o],!1),pf(r[o]);else r!=null&&(Eu(r,!1),pf(r));else Eu(this,n)}const yL=n=>{n.type==Or.CHILD&&(n._$AP??(n._$AP=vL),n._$AQ??(n._$AQ=gL))};class j_ extends td{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,r){super._$AT(t,e,r),B_(this),this.isConnected=t._$AU}_$AO(t,e=!0){var r,i;t!==this.isConnected&&(this.isConnected=t,t?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),e&&(Eu(this,t),pf(this))}setValue(t){if(F_(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}var rh,ih,ls,Uo;class mn extends j_{constructor(){super(...arguments);m(this,rh,[]);m(this,ih,!1);m(this,ls,!1);m(this,Uo,!1)}connected(){}template(...e){return Dt}render(...e){return!this.isConnected||s(this,ls)||this.setValue(e.length?e[0]:this.template(...s(this,rh))),Dt}update(e,r){d(this,rh,r),d(this,Uo,!1),d(this,ls,!0);try{return s(this,ih)||(d(this,ih,!0),this.connected()),this.template(...r)}finally{d(this,ls,!1)}}reconnected(){d(this,ls,!0);try{this.connected()}finally{d(this,ls,!1)}d(this,Uo,!0),queueMicrotask(()=>{s(this,Uo)&&(d(this,Uo,!1),this.render())})}}rh=new WeakMap,ih=new WeakMap,ls=new WeakMap,Uo=new WeakMap;function gn(n){return xc(n)}const wL=3;function bL(n,t){var r;const e=n.connection;return e.gateHalted?{kind:"needs-upgrade",instructions:e.upgradeInstructions}:e.authorizationRequired?{kind:"unauthorized"}:e.status!=="connected"?e.failedReconnectAttempts>=wL||!e.hasEverConnected&&e.firstConnectError!==null?{kind:"error",serverURL:t,nextRetryAt:e.nextRetryAt}:e.hasEverConnected?{kind:"disconnected",nextRetryAt:e.nextRetryAt}:{kind:"connecting"}:n.ready?n.channels.length===0?{kind:"no-channel"}:((r=n.focusedChannel)==null?void 0:r.pages.length)===0?{kind:"empty-channel"}:{kind:"connected"}:{kind:"connecting"}}const SL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"/></svg>',_L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>',AL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"/></svg>',EL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.32,81.37,174.63,20.69a16,16,0,0,0-22.63,0L98.37,74.49c-10.66-3.34-35-7.37-60.4,13.14a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33c19.64-26.1,17.75-47.32,13.19-60L235.33,104A16,16,0,0,0,235.32,81.37ZM224,92.69h0l-57.27,57.46a8,8,0,0,0-1.49,9.22c9.46,18.93-1.8,38.59-9.34,48.62L48,100.08c12.08-9.74,23.64-12.31,32.48-12.31A40.13,40.13,0,0,1,96.81,91a8,8,0,0,0,9.25-1.51L163.32,32,224,92.68Z"/></svg>',kL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"/></svg>',TL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>',CL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z"/></svg>',RL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,80a48,48,0,1,0,48,48A48.05,48.05,0,0,0,128,80Zm0,80a32,32,0,1,1,32-32A32,32,0,0,1,128,160Zm88-29.84q.06-2.16,0-4.32l14.92-18.64a8,8,0,0,0,1.48-7.06,107.21,107.21,0,0,0-10.88-26.25,8,8,0,0,0-6-3.93l-23.72-2.64q-1.48-1.56-3-3L186,40.54a8,8,0,0,0-3.94-6,107.71,107.71,0,0,0-26.25-10.87,8,8,0,0,0-7.06,1.49L130.16,40Q128,40,125.84,40L107.2,25.11a8,8,0,0,0-7.06-1.48A107.6,107.6,0,0,0,73.89,34.51a8,8,0,0,0-3.93,6L67.32,64.27q-1.56,1.49-3,3L40.54,70a8,8,0,0,0-6,3.94,107.71,107.71,0,0,0-10.87,26.25,8,8,0,0,0,1.49,7.06L40,125.84Q40,128,40,130.16L25.11,148.8a8,8,0,0,0-1.48,7.06,107.21,107.21,0,0,0,10.88,26.25,8,8,0,0,0,6,3.93l23.72,2.64q1.49,1.56,3,3L70,215.46a8,8,0,0,0,3.94,6,107.71,107.71,0,0,0,26.25,10.87,8,8,0,0,0,7.06-1.49L125.84,216q2.16.06,4.32,0l18.64,14.92a8,8,0,0,0,7.06,1.48,107.21,107.21,0,0,0,26.25-10.88,8,8,0,0,0,3.93-6l2.64-23.72q1.56-1.48,3-3L215.46,186a8,8,0,0,0,6-3.94,107.71,107.71,0,0,0,10.87-26.25,8,8,0,0,0-1.49-7.06Zm-16.1-6.5a73.93,73.93,0,0,1,0,8.68,8,8,0,0,0,1.74,5.48l14.19,17.73a91.57,91.57,0,0,1-6.23,15L187,173.11a8,8,0,0,0-5.1,2.64,74.11,74.11,0,0,1-6.14,6.14,8,8,0,0,0-2.64,5.1l-2.51,22.58a91.32,91.32,0,0,1-15,6.23l-17.74-14.19a8,8,0,0,0-5-1.75h-.48a73.93,73.93,0,0,1-8.68,0,8,8,0,0,0-5.48,1.74L100.45,215.8a91.57,91.57,0,0,1-15-6.23L82.89,187a8,8,0,0,0-2.64-5.1,74.11,74.11,0,0,1-6.14-6.14,8,8,0,0,0-5.1-2.64L46.43,170.6a91.32,91.32,0,0,1-6.23-15l14.19-17.74a8,8,0,0,0,1.74-5.48,73.93,73.93,0,0,1,0-8.68,8,8,0,0,0-1.74-5.48L40.2,100.45a91.57,91.57,0,0,1,6.23-15L69,82.89a8,8,0,0,0,5.1-2.64,74.11,74.11,0,0,1,6.14-6.14A8,8,0,0,0,82.89,69L85.4,46.43a91.32,91.32,0,0,1,15-6.23l17.74,14.19a8,8,0,0,0,5.48,1.74,73.93,73.93,0,0,1,8.68,0,8,8,0,0,0,5.48-1.74L155.55,40.2a91.57,91.57,0,0,1,15,6.23L173.11,69a8,8,0,0,0,2.64,5.1,74.11,74.11,0,0,1,6.14,6.14,8,8,0,0,0,5.1,2.64l22.58,2.51a91.32,91.32,0,0,1,6.23,15l-14.19,17.74A8,8,0,0,0,199.87,123.66Z"/></svg>',IL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"/></svg>',$L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z"/></svg>',xL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z"/></svg>',PL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="none" stroke="currentColor" stroke-width="16" stroke-linecap="round" stroke-linejoin="round"><path d="M74 96 128 46 182 96"/><path d="M74 160 128 210 182 160"/></svg>',DL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M71.59,61.47a8,8,0,0,0-15.18,0l-40,120A8,8,0,0,0,24,192h80a8,8,0,0,0,7.59-10.53ZM35.1,176,64,89.3,92.9,176ZM208,76a52,52,0,1,0-52,52A52.06,52.06,0,0,0,208,76Zm-88,0a36,36,0,1,1,36,36A36,36,0,0,1,120,76Zm104,68H136a8,8,0,0,0-8,8v56a8,8,0,0,0,8,8h88a8,8,0,0,0,8-8V152A8,8,0,0,0,224,144Zm-8,56H144V160h72Z"/></svg>',OL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,71.1a8,8,0,0,1-10.78-3.42,94.13,94.13,0,0,0-33.46-36.91,8,8,0,1,1,8.54-13.54,111.46,111.46,0,0,1,39.12,43.09A8,8,0,0,1,224,71.1ZM35.71,72a8,8,0,0,0,7.1-4.32A94.13,94.13,0,0,1,76.27,30.77a8,8,0,1,0-8.54-13.54A111.46,111.46,0,0,0,28.61,60.32,8,8,0,0,0,35.71,72Zm186.1,103.94A16,16,0,0,1,208,200H167.2a40,40,0,0,1-78.4,0H48a16,16,0,0,1-13.79-24.06C43.22,160.39,48,138.28,48,112a80,80,0,0,1,160,0C208,138.27,212.78,160.38,221.81,175.94ZM150.62,200H105.38a24,24,0,0,0,45.24,0ZM208,184c-10.64-18.27-16-42.49-16-72a64,64,0,0,0-128,0c0,29.52-5.38,53.74-16,72Z"/></svg>',LL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,96V216H96V160h64V96Z" opacity="0.2"/><path d="M216,88H168V40a8,8,0,0,0-8-8H40a8,8,0,0,0-8,8V160a8,8,0,0,0,8,8H88v48a8,8,0,0,0,8,8H216a8,8,0,0,0,8-8V96A8,8,0,0,0,216,88ZM48,48H152V152H48ZM208,208H104V168h56a8,8,0,0,0,8-8V104h40Z"/></svg>',ML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,128a104,104,0,0,1-208,0c0-41,23.81-78.36,60.66-95.27a8,8,0,0,1,6.68,14.54C60.15,61.59,40,93.27,40,128a88,88,0,0,0,176,0c0-34.73-20.15-66.41-51.34-80.73a8,8,0,0,1,6.68-14.54C208.19,49.64,232,87,232,128Z"/></svg>',NL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,112a28,28,0,0,0-8,54.83V184a8,8,0,0,0,16,0V166.83A28,28,0,0,0,128,112Zm0,40a12,12,0,1,1,12-12A12,12,0,0,1,128,152Zm80-72H176V56a48,48,0,0,0-96,0V80H48A16,16,0,0,0,32,96V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V96A16,16,0,0,0,208,80ZM96,56a32,32,0,0,1,64,0V80H96ZM208,208H48V96H208V208Z"/></svg>',zL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M53.92,34.62A8,8,0,1,0,42.08,45.38L67.37,73.2A69.82,69.82,0,0,0,38,87.63a16,16,0,0,0-1.29,23.78L85,159.71,42.34,202.34a8,8,0,0,0,11.32,11.32L96.29,171l48.29,48.29A16,16,0,0,0,155.9,224c.38,0,.75,0,1.13,0a15.93,15.93,0,0,0,11.64-6.33,89.75,89.75,0,0,0,11.58-20.27l21.84,24a8,8,0,1,0,11.84-10.76ZM155.9,208,48,100.08C58.23,91.83,69.2,87.72,80.66,87.81l87.16,95.88C165.59,193.56,160.24,202.23,155.9,208Zm79.42-104-44.64,44.79a8,8,0,1,1-11.33-11.3L224,92.7,163.32,32,122.1,73.35a8,8,0,0,1-11.33-11.29L152,20.7a16,16,0,0,1,22.63,0l60.69,60.68A16,16,0,0,1,235.32,104Z"/></svg>',HL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z"/></svg>',ZL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"/></svg>',UL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H147.31l34.35-34.34a8,8,0,1,0-11.32-11.32L128,60.69,85.66,18.34A8,8,0,0,0,74.34,29.66L108.69,64H40A16,16,0,0,0,24,80V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64ZM40,80H144V200H40ZM216,200H160V80h56V200Zm-16-84a12,12,0,1,1-12-12A12,12,0,0,1,200,116Zm0,48a12,12,0,1,1-12-12A12,12,0,0,1,200,164Z"/></svg>',qL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H184V24a8,8,0,0,0-16,0v8H88V24a8,8,0,0,0-16,0v8H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM72,48v8a8,8,0,0,0,16,0V48h80v8a8,8,0,0,0,16,0V48h24V80H48V48ZM208,208H48V96H208V208Z"/></svg>',FL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z"/></svg>',VL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,88H175.4l8.47-46.57a8,8,0,0,0-15.74-2.86l-9,49.43H111.4l8.47-46.57a8,8,0,0,0-15.74-2.86L95.14,88H48a8,8,0,0,0,0,16H92.23L83.5,152H32a8,8,0,0,0,0,16H80.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,80,224a8,8,0,0,0,7.86-6.57l9-49.43H144.6l-8.47,46.57a8,8,0,0,0,6.44,9.3A7.79,7.79,0,0,0,144,224a8,8,0,0,0,7.86-6.57l9-49.43H208a8,8,0,0,0,0-16H163.77l8.73-48H224a8,8,0,0,0,0-16Zm-76.5,64H99.77l8.73-48h47.73Z"/></svg>',BL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>',jL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z"/></svg>',WL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,88.23a54.43,54.43,0,0,1-16,37L189.25,160a54.27,54.27,0,0,1-38.63,16h-.05A54.63,54.63,0,0,1,96,119.84a8,8,0,0,1,16,.45A38.62,38.62,0,0,0,150.58,160h0a38.39,38.39,0,0,0,27.31-11.31l34.75-34.75a38.63,38.63,0,0,0-54.63-54.63l-11,11A8,8,0,0,1,135.7,59l11-11A54.65,54.65,0,0,1,224,48,54.86,54.86,0,0,1,240,88.23ZM109,185.66l-11,11A38.41,38.41,0,0,1,70.6,208h0a38.63,38.63,0,0,1-27.29-65.94L78,107.31A38.63,38.63,0,0,1,144,135.71a8,8,0,0,0,16,.45A54.86,54.86,0,0,0,144,96a54.65,54.65,0,0,0-77.27,0L32,130.75A54.62,54.62,0,0,0,70.56,224h0a54.28,54.28,0,0,0,38.64-16l11-11A8,8,0,0,0,109,185.66Z"/></svg>',GL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,104a8,8,0,0,1-16,0V59.32l-66.33,66.34a8,8,0,0,1-11.32-11.32L196.68,48H152a8,8,0,0,1,0-16h64a8,8,0,0,1,8,8Zm-40,24a8,8,0,0,0-8,8v72H48V80h72a8,8,0,0,0,0-16H48A16,16,0,0,0,32,80V208a16,16,0,0,0,16,16H176a16,16,0,0,0,16-16V136A8,8,0,0,0,184,128Z"/></svg>',JL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"/></svg>',YL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z"/></svg>',KL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M236.8,188.09,149.35,36.22h0a24.76,24.76,0,0,0-42.7,0L19.2,188.09a23.51,23.51,0,0,0,0,23.72A24.35,24.35,0,0,0,40.55,224h174.9a24.35,24.35,0,0,0,21.33-12.19A23.51,23.51,0,0,0,236.8,188.09ZM222.93,203.8a8.5,8.5,0,0,1-7.48,4.2H40.55a8.5,8.5,0,0,1-7.48-4.2,7.59,7.59,0,0,1,0-7.72L120.52,44.21a8.75,8.75,0,0,1,15,0l87.45,151.87A7.59,7.59,0,0,1,222.93,203.8ZM120,144V104a8,8,0,0,1,16,0v40a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,180Z"/></svg>',XL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"/></svg>',QL='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"/></svg>',eM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H131.31L104,44.69A15.86,15.86,0,0,0,92.69,40H40A16,16,0,0,0,24,56V200.62A15.4,15.4,0,0,0,39.38,216H216.89A15.13,15.13,0,0,0,232,200.89V88A16,16,0,0,0,216,72ZM40,56H92.69l16,16H40ZM216,200H40V88H216Z"/></svg>',tM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z"/></svg>',nM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.92,212c-15.23-26.33-38.7-45.21-66.09-54.16a72,72,0,1,0-73.66,0C63.78,166.78,40.31,185.66,25.08,212a8,8,0,1,0,13.85,8c18.84-32.56,52.14-52,89.07-52s70.23,19.44,89.07,52a8,8,0,1,0,13.85-8ZM72,96a56,56,0,1,1,56,56A56.06,56.06,0,0,1,72,96Z"/></svg>',rM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0ZM93.66,77.66,120,51.31V144a8,8,0,0,0,16,0V51.31l26.34,26.35a8,8,0,0,0,11.32-11.32l-40-40a8,8,0,0,0-11.32,0l-40,40A8,8,0,0,0,93.66,77.66Z"/></svg>',iM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M239.18,97.26A16.38,16.38,0,0,0,224.92,86l-59-4.76L143.14,26.15a16.36,16.36,0,0,0-30.27,0L90.11,81.23,31.08,86a16.46,16.46,0,0,0-9.37,28.86l45,38.83L53,211.75a16.38,16.38,0,0,0,24.5,17.82L128,198.49l50.53,31.08A16.4,16.4,0,0,0,203,211.75l-13.76-58.07,45-38.83A16.43,16.43,0,0,0,239.18,97.26Zm-15.34,5.47-48.7,42a8,8,0,0,0-2.56,7.91l14.88,62.8a.37.37,0,0,1-.17.48c-.18.14-.23.11-.38,0l-54.72-33.65a8,8,0,0,0-8.38,0L69.09,215.94c-.15.09-.19.12-.38,0a.37.37,0,0,1-.17-.48l14.88-62.8a8,8,0,0,0-2.56-7.91l-48.7-42c-.12-.1-.23-.19-.13-.5s.18-.27.33-.29l63.92-5.16A8,8,0,0,0,103,91.86l24.62-59.61c.08-.17.11-.25.35-.25s.27.08.35.25L153,91.86a8,8,0,0,0,6.75,4.92l63.92,5.16c.15,0,.24,0,.33.29S224,102.63,223.84,102.73Z"/></svg>',sM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M219.31,108.68l-80-80a16,16,0,0,0-22.62,0l-80,80A15.87,15.87,0,0,0,32,120v96a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V160h32v56a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8V120A15.87,15.87,0,0,0,219.31,108.68ZM208,208H160V152a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8v56H48V120l80-80,80,80Z"/></svg>',oM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z"/></svg>',aM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M230.6,49.53A15.81,15.81,0,0,0,216,40H40A16,16,0,0,0,28.19,66.76l.08.09L96,139.17V216a16,16,0,0,0,24.87,13.32l32-21.34A16,16,0,0,0,160,194.66V139.17l67.74-72.32.08-.09A15.8,15.8,0,0,0,230.6,49.53ZM40,56h0Zm106.18,74.58A8,8,0,0,0,144,136v58.66L112,216V136a8,8,0,0,0-2.16-5.47L40,56H216Z"/></svg>',lM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.66,170.34a8,8,0,0,1,0,11.32l-32,32a8,8,0,0,1-11.32,0l-32-32a8,8,0,0,1,11.32-11.32L72,188.69V48a8,8,0,0,1,16,0V188.69l18.34-18.35A8,8,0,0,1,117.66,170.34Zm96-96-32-32a8,8,0,0,0-11.32,0l-32,32a8,8,0,0,0,11.32,11.32L168,67.31V208a8,8,0,0,0,16,0V67.31l18.34,18.35a8,8,0,0,0,11.32-11.32Z"/></svg>',cM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M140,180a12,12,0,1,1-12-12A12,12,0,0,1,140,180ZM128,72c-22.06,0-40,16.15-40,36v4a8,8,0,0,0,16,0v-4c0-11,10.77-20,24-20s24,9,24,20-10.77,20-24,20a8,8,0,0,0-8,8v8a8,8,0,0,0,16,0v-.72c18.24-3.35,32-17.9,32-35.28C168,88.15,150.06,72,128,72Zm104,56A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',uM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,200h-8V40a8,8,0,0,0-8-8H152a8,8,0,0,0-8,8V80H96a8,8,0,0,0-8,8v40H48a8,8,0,0,0-8,8v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16ZM160,48h40V200H160ZM104,96h40V200H104ZM56,144H88v56H56Z"/></svg>',hM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"/></svg>',dM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-6.54-.67L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Z"/></svg>',fM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,64a40,40,0,1,0,40,40A40,40,0,0,0,128,64Zm0,64a24,24,0,1,1,24-24A24,24,0,0,1,128,128Zm0-112a88.1,88.1,0,0,0-88,88c0,31.4,14.51,64.68,42,96.25a254.19,254.19,0,0,0,41.45,38.3,8,8,0,0,0,9.18,0A254.19,254.19,0,0,0,174,200.25c27.45-31.57,42-64.85,42-96.25A88.1,88.1,0,0,0,128,16Zm0,206c-16.53-13-72-60.75-72-118a72,72,0,0,1,144,0C200,161.23,144.53,209,128,222Z"/></svg>',pM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232.4,114.49,88.32,26.35a16,16,0,0,0-16.2-.3A15.86,15.86,0,0,0,64,39.87V216.13A15.94,15.94,0,0,0,80,232a16.07,16.07,0,0,0,8.36-2.35L232.4,141.51a15.81,15.81,0,0,0,0-27ZM80,215.94V40l143.83,88Z"/></svg>',mM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,32H160a16,16,0,0,0-16,16V208a16,16,0,0,0,16,16h40a16,16,0,0,0,16-16V48A16,16,0,0,0,200,32Zm0,176H160V48h40ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Zm0,176H56V48H96Z"/></svg>',gM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z"/></svg>',vM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M251.77,73a8,8,0,0,0-8.21.39L208,97.05V72a16,16,0,0,0-16-16H32A16,16,0,0,0,16,72V184a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V159l35.56,23.71A8,8,0,0,0,248,184a8,8,0,0,0,8-8V80A8,8,0,0,0,251.77,73ZM192,184H32V72H192V184Zm48-22.95-32-21.33V116.28L240,95Z"/></svg>',yM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M212.92,17.69a8,8,0,0,0-6.86-1.45l-128,32A8,8,0,0,0,72,56V166.08A36,36,0,1,0,88,196V110.25l112-28v51.83A36,36,0,1,0,216,164V24A8,8,0,0,0,212.92,17.69ZM52,216a20,20,0,1,1,20-20A20,20,0,0,1,52,216ZM88,93.75V62.25l112-28v31.5ZM180,184a20,20,0,1,1,20-20A20,20,0,0,1,180,184Z"/></svg>',wM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M165.66,101.66,139.31,128l26.35,26.34a8,8,0,0,1-11.32,11.32L128,139.31l-26.34,26.35a8,8,0,0,1-11.32-11.32L116.69,128,90.34,101.66a8,8,0,0,1,11.32-11.32L128,116.69l26.34-26.35a8,8,0,0,1,11.32,11.32ZM232,128A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128Z"/></svg>',bM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM203.43,64,128,133.15,52.57,64ZM216,192H40V74.19l82.59,75.71a8,8,0,0,0,10.82,0L216,74.19V192Z"/></svg>',SM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M222.37,158.46l-47.11-21.11-.13-.06a16,16,0,0,0-15.17,1.4,8.12,8.12,0,0,0-.75.56L134.87,160c-15.42-7.49-31.34-23.29-38.83-38.51l20.78-24.71c.2-.25.39-.5.57-.77a16,16,0,0,0,1.32-15.06l0-.12L97.54,33.64a16,16,0,0,0-16.62-9.52A56.26,56.26,0,0,0,32,80c0,79.4,64.6,144,144,144a56.26,56.26,0,0,0,55.88-48.92A16,16,0,0,0,222.37,158.46ZM176,208A128.14,128.14,0,0,1,48,80,40.2,40.2,0,0,1,82.87,40a.61.61,0,0,0,0,.12l21,47L83.2,111.86a6.13,6.13,0,0,0-.57.77,16,16,0,0,0-1,15.7c9.06,18.53,27.73,37.06,46.46,46.11a16,16,0,0,0,15.75-1.14,8.44,8.44,0,0,0,.74-.56L168.89,152l47,21.05h0s.08,0,.11,0A40.21,40.21,0,0,1,176,208Z"/></svg>',_M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24h0A104,104,0,1,0,232,128,104.12,104.12,0,0,0,128,24Zm88,104a87.61,87.61,0,0,1-3.33,24H174.16a157.44,157.44,0,0,0,0-48h38.51A87.61,87.61,0,0,1,216,128ZM102,168H154a115.11,115.11,0,0,1-26,45A115.27,115.27,0,0,1,102,168Zm-3.9-16a140.84,140.84,0,0,1,0-48h59.88a140.84,140.84,0,0,1,0,48ZM40,128a87.61,87.61,0,0,1,3.33-24H81.84a157.44,157.44,0,0,0,0,48H43.33A87.61,87.61,0,0,1,40,128ZM154,88H102a115.11,115.11,0,0,1,26-45A115.27,115.27,0,0,1,154,88Zm52.33,0H170.71a135.28,135.28,0,0,0-22.3-45.6A88.29,88.29,0,0,1,206.37,88ZM107.59,42.4A135.28,135.28,0,0,0,85.29,88H49.63A88.29,88.29,0,0,1,107.59,42.4ZM49.63,168H85.29a135.28,135.28,0,0,0,22.3,45.6A88.29,88.29,0,0,1,49.63,168Zm98.78,45.6a135.28,135.28,0,0,0,22.3-45.6h35.66A88.29,88.29,0,0,1,148.41,213.6Z"/></svg>',AM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63Zm-96,96L48,132.69V48h84.69L232,147.31ZM96,84A12,12,0,1,1,84,72,12,12,0,0,1,96,84Z"/></svg>',EM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A16,16,0,0,0,56,48V224a8,8,0,0,0,12.24,6.78L128,193.43l59.77,37.35A8,8,0,0,0,200,224V48A16,16,0,0,0,184,32Zm0,177.57-51.77-32.35a8,8,0,0,0-8.48,0L72,209.57V48H184Z"/></svg>',kM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32a8,8,0,0,0-8,8V192a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A8,8,0,0,0,224,48ZM40,112H80v32H40Zm56,0H216v32H96ZM216,64V96H40V64ZM40,160H80v32H40Zm176,32H96V160H216v32Z"/></svg>',TM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"/></svg>',CM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M117.25,157.92a60,60,0,1,0-66.5,0A95.83,95.83,0,0,0,3.53,195.63a8,8,0,1,0,13.4,8.74,80,80,0,0,1,134.14,0,8,8,0,0,0,13.4-8.74A95.83,95.83,0,0,0,117.25,157.92ZM40,108a44,44,0,1,1,44,44A44.05,44.05,0,0,1,40,108Zm210.14,98.7a8,8,0,0,1-11.07-2.33A79.83,79.83,0,0,0,172,168a8,8,0,0,1,0-16,44,44,0,1,0-16.34-84.87,8,8,0,1,1-5.94-14.85,60,60,0,0,1,55.53,105.64,95.83,95.83,0,0,1,47.22,37.71A8,8,0,0,1,250.14,206.7Z"/></svg>',RM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"/></svg>',IM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,149.66l-72,72a8,8,0,0,1-11.32,0l-72-72a8,8,0,0,1,11.32-11.32L120,196.69V40a8,8,0,0,1,16,0V196.69l58.34-58.35a8,8,0,0,1,11.32,11.32Z"/></svg>',$M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,120H136V56h8a32,32,0,0,1,32,32,8,8,0,0,0,16,0,48.05,48.05,0,0,0-48-48h-8V24a8,8,0,0,0-16,0V40h-8a48,48,0,0,0,0,96h8v64H104a32,32,0,0,1-32-32,8,8,0,0,0-16,0,48.05,48.05,0,0,0,48,48h16v16a8,8,0,0,0,16,0V216h16a48,48,0,0,0,0-96Zm-40,0a32,32,0,0,1,0-64h8v64Zm40,80H136V136h16a32,32,0,0,1,0,64Z"/></svg>',xM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M24,104H48v64H32a8,8,0,0,0,0,16H224a8,8,0,0,0,0-16H208V104h24a8,8,0,0,0,4.19-14.81l-104-64a8,8,0,0,0-8.38,0l-104,64A8,8,0,0,0,24,104Zm40,0H96v64H64Zm80,0v64H112V104Zm48,64H160V104h32ZM128,41.39,203.74,88H52.26ZM248,208a8,8,0,0,1-8,8H16a8,8,0,0,1,0-16H240A8,8,0,0,1,248,208Z"/></svg>',PM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,16V88H32V64Zm0,128H32V104H224v88Zm-16-24a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h32A8,8,0,0,1,208,168Zm-64,0a8,8,0,0,1-8,8H120a8,8,0,0,1,0-16h16A8,8,0,0,1,144,168Z"/></svg>',DM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,64H56a8,8,0,0,1,0-16H192a8,8,0,0,0,0-16H56A24,24,0,0,0,32,56V184a24,24,0,0,0,24,24H216a16,16,0,0,0,16-16V80A16,16,0,0,0,216,64Zm0,128H56a8,8,0,0,1-8-8V78.63A23.84,23.84,0,0,0,56,80H216Zm-48-60a12,12,0,1,1,12,12A12,12,0,0,1,168,132Z"/></svg>',OM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"/></svg>',LM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a8,8,0,0,1-8,8H204.94l-37.78,75.58A8,8,0,0,1,160,216h-.4a8,8,0,0,1-7.08-5.14L95.35,60.76,63.28,131.31A8,8,0,0,1,56,136H24a8,8,0,0,1,0-16H50.85L88.72,36.69a8,8,0,0,1,14.76.46l57.51,151,31.85-63.71A8,8,0,0,1,200,120h32A8,8,0,0,1,240,128Z"/></svg>',MM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,56v64a8,8,0,0,1-16,0V75.31l-82.34,82.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,212.69,64H168a8,8,0,0,1,0-16h64A8,8,0,0,1,240,56Z"/></svg>',NM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1,0-16h44.69L136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L224,172.69V128a8,8,0,0,1,16,0Z"/></svg>',zM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24C74.17,24,32,48.6,32,80v96c0,31.4,42.17,56,96,56s96-24.6,96-56V80C224,48.6,181.83,24,128,24Zm80,104c0,9.62-7.88,19.43-21.61,26.92C170.93,163.35,150.19,168,128,168s-42.93-4.65-58.39-13.08C55.88,147.43,48,137.62,48,128V111.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64ZM69.61,53.08C85.07,44.65,105.81,40,128,40s42.93,4.65,58.39,13.08C200.12,60.57,208,70.38,208,80s-7.88,19.43-21.61,26.92C170.93,115.35,150.19,120,128,120s-42.93-4.65-58.39-13.08C55.88,99.43,48,89.62,48,80S55.88,60.57,69.61,53.08ZM186.39,202.92C170.93,211.35,150.19,216,128,216s-42.93-4.65-58.39-13.08C55.88,195.43,48,185.62,48,176V159.36c17.06,15,46.23,24.64,80,24.64s62.94-9.68,80-24.64V176C208,185.62,200.12,195.43,186.39,202.92Z"/></svg>',HM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,136H48a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V152A16,16,0,0,0,208,136Zm0,64H48V152H208v48Zm0-160H48A16,16,0,0,0,32,56v48a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V56A16,16,0,0,0,208,40Zm0,64H48V56H208v48ZM192,80a12,12,0,1,1-12-12A12,12,0,0,1,192,80Zm0,96a12,12,0,1,1-12-12A12,12,0,0,1,192,176Z"/></svg>',ZM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M223.85,47.12a16,16,0,0,0-15-15c-12.58-.75-44.73.4-71.41,27.07L132.69,64H74.36A15.91,15.91,0,0,0,63,68.68L28.7,103a16,16,0,0,0,9.07,27.16l38.47,5.37,44.21,44.21,5.37,38.49a15.94,15.94,0,0,0,10.78,12.92,16.11,16.11,0,0,0,5.1.83A15.91,15.91,0,0,0,153,227.3L187.32,193A15.91,15.91,0,0,0,192,181.64V123.31l4.77-4.77C223.45,91.86,224.6,59.71,223.85,47.12ZM74.36,80h42.33L77.16,119.52,40,114.34Zm74.41-9.45a76.65,76.65,0,0,1,59.11-22.47,76.46,76.46,0,0,1-22.42,59.16L128,164.68,91.32,128ZM176,181.64,141.67,216l-5.19-37.17L176,139.31Zm-74.16,9.5C97.34,201,82.29,224,40,224a8,8,0,0,1-8-8c0-42.29,23-57.34,32.86-61.85a8,8,0,0,1,6.64,14.56c-6.43,2.93-20.62,12.36-23.12,38.91,26.55-2.5,36-16.69,38.91-23.12a8,8,0,1,1,14.56,6.64Z"/></svg>',UM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z"/></svg>',qM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,128a8,8,0,0,1-3,6.25l-40,32a8,8,0,1,1-10-12.5L107.19,128,75,102.25a8,8,0,1,1,10-12.5l40,32A8,8,0,0,1,128,128Zm48,24H136a8,8,0,0,0,0,16h40a8,8,0,0,0,0-16Zm56-96V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"/></svg>',FM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,64a32,32,0,1,0-40,31v17a8,8,0,0,1-8,8H96a23.84,23.84,0,0,0-8,1.38V95a32,32,0,1,0-16,0v66a32,32,0,1,0,16,0V144a8,8,0,0,1,8-8h88a24,24,0,0,0,24-24V95A32.06,32.06,0,0,0,232,64ZM64,64A16,16,0,1,1,80,80,16,16,0,0,1,64,64ZM96,192a16,16,0,1,1-16-16A16,16,0,0,1,96,192ZM200,80a16,16,0,1,1,16-16A16,16,0,0,1,200,80Z"/></svg>',VM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,40H48A16,16,0,0,0,32,56v56c0,52.72,25.52,84.67,46.93,102.19,23.06,18.86,46,25.27,47,25.53a8,8,0,0,0,4.2,0c1-.26,23.91-6.67,47-25.53C198.48,196.67,224,164.72,224,112V56A16,16,0,0,0,208,40Zm0,72c0,37.07-13.66,67.16-40.6,89.42A129.3,129.3,0,0,1,128,223.62a128.25,128.25,0,0,1-38.92-21.81C61.82,179.51,48,149.3,48,112l0-56,160,0Z"/></svg>',BM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM40,56H80V200H40ZM216,200H96V56H216V200Z"/></svg>',jM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M235.58,128.84,160,91.06V48a32,32,0,0,0-64,0V91.06L20.42,128.84A8,8,0,0,0,16,136v32a8,8,0,0,0,9.57,7.84L96,161.76v18.93L82.34,194.34A8,8,0,0,0,80,200v32a8,8,0,0,0,11,7.43l37-14.81,37,14.81A8,8,0,0,0,176,232V200a8,8,0,0,0-2.34-5.66L160,180.69V161.76l70.43,14.08A8,8,0,0,0,240,168V136A8,8,0,0,0,235.58,128.84ZM224,158.24l-70.43-14.08A8,8,0,0,0,144,152v32a8,8,0,0,0,2.34,5.66L160,203.31v16.87l-29-11.61a8,8,0,0,0-5.94,0L96,220.18V203.31l13.66-13.65A8,8,0,0,0,112,184V152a8,8,0,0,0-9.57-7.84L32,158.24v-17.3l75.58-37.78A8,8,0,0,0,112,96V48a16,16,0,0,1,32,0V96a8,8,0,0,0,4.42,7.16L224,140.94Z"/></svg>',WM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,104H229.2L201.42,41.5A16,16,0,0,0,186.8,32H69.2a16,16,0,0,0-14.62,9.5L26.8,104H16a8,8,0,0,0,0,16h8v80a16,16,0,0,0,16,16H64a16,16,0,0,0,16-16V184h96v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V120h8a8,8,0,0,0,0-16ZM69.2,48H186.8l24.89,56H44.31ZM64,200H40V184H64Zm128,0V184h24v16Zm24-32H40V120H216ZM56,144a8,8,0,0,1,8-8H80a8,8,0,0,1,0,16H64A8,8,0,0,1,56,144Zm112,0a8,8,0,0,1,8-8h16a8,8,0,0,1,0,16H176A8,8,0,0,1,168,144Z"/></svg>',GM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,32H72A32,32,0,0,0,40,64V208a16,16,0,0,0,16,16H80a16,16,0,0,0,16-16V192h64v16a16,16,0,0,0,16,16h24a16,16,0,0,0,16-16V64A32,32,0,0,0,184,32ZM56,176V120H200v56Zm0-96H200v24H56ZM72,48H184a16,16,0,0,1,16,16H56A16,16,0,0,1,72,48Zm8,160H56V192H80Zm96,0V192h24v16Zm-72-60a12,12,0,1,1-12-12A12,12,0,0,1,104,148Zm72,0a12,12,0,1,1-12-12A12,12,0,0,1,176,148Zm72-68v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0ZM24,80v24a8,8,0,0,1-16,0V80a8,8,0,0,1,16,0Z"/></svg>',JM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H32V48a8,8,0,0,0-16,0V208a8,8,0,0,0,16,0V176H240v32a8,8,0,0,0,16,0V112A40,40,0,0,0,216,72ZM32,88h72v72H32Zm88,72V88h96a24,24,0,0,1,24,24v48Z"/></svg>',YM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M72,88V40a8,8,0,0,1,16,0V88a8,8,0,0,1-16,0ZM216,40V224a8,8,0,0,1-16,0V176H152a8,8,0,0,1-8-8,268.75,268.75,0,0,1,7.22-56.88c9.78-40.49,28.32-67.63,53.63-78.47A8,8,0,0,1,216,40ZM200,53.9c-32.17,24.57-38.47,84.42-39.7,106.1H200ZM119.89,38.69a8,8,0,1,0-15.78,2.63L112,88.63a32,32,0,0,1-64,0l7.88-47.31a8,8,0,1,0-15.78-2.63l-8,48A8.17,8.17,0,0,0,32,88a48.07,48.07,0,0,0,40,47.32V224a8,8,0,0,0,16,0V135.32A48.07,48.07,0,0,0,128,88a8.17,8.17,0,0,0-.11-1.31Z"/></svg>',KM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,112a24,24,0,0,0-24-24H136V79a32.06,32.06,0,0,0,24-31c0-28-26.44-45.91-27.56-46.66a8,8,0,0,0-8.88,0C122.44,2.09,96,20,96,48a32.06,32.06,0,0,0,24,31v9H48a24,24,0,0,0-24,24v23.33a40.84,40.84,0,0,0,8,24.24V200a24,24,0,0,0,24,24H200a24,24,0,0,0,24-24V159.57a40.84,40.84,0,0,0,8-24.24ZM112,48c0-13.57,10-24.46,16-29.79,6,5.33,16,16.22,16,29.79a16,16,0,0,1-32,0ZM40,112a8,8,0,0,1,8-8H208a8,8,0,0,1,8,8v23.33c0,13.25-10.46,24.31-23.32,24.66A24,24,0,0,1,168,136a8,8,0,0,0-16,0,24,24,0,0,1-48,0,8,8,0,0,0-16,0,24,24,0,0,1-24.68,24C50.46,159.64,40,148.58,40,135.33Zm160,96H56a8,8,0,0,1-8-8V172.56A38.77,38.77,0,0,0,62.88,176a39.69,39.69,0,0,0,29-11.31A40.36,40.36,0,0,0,96,160a40,40,0,0,0,64,0,40.36,40.36,0,0,0,4.13,4.67A39.67,39.67,0,0,0,192,176c.38,0,.76,0,1.14,0A38.77,38.77,0,0,0,208,172.56V200A8,8,0,0,1,200,208Z"/></svg>',XM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M255.31,188.75l-64-144A8,8,0,0,0,184,40H72a8,8,0,0,0-7.27,4.69.21.21,0,0,0,0,.06l0,.12,0,0L.69,188.75A8,8,0,0,0,8,200H248a8,8,0,0,0,7.31-11.25ZM64,184H20.31L64,85.7Zm16,0V85.7L123.69,184Zm61.2,0L84.31,56H178.8l56.89,128Z"/></svg>',QM='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,176a48.05,48.05,0,0,0,48-48V64a48,48,0,0,0-96,0v64A48.05,48.05,0,0,0,128,176ZM96,64a32,32,0,0,1,64,0v64a32,32,0,0,1-64,0Zm40,143.6V240a8,8,0,0,1-16,0V207.6A80.11,80.11,0,0,1,48,128a8,8,0,0,1,16,0,64,64,0,0,0,128,0,8,8,0,0,1,16,0A80.11,80.11,0,0,1,136,207.6Z"/></svg>',eN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm64,24V200H96V72ZM40,72H80V200H40ZM216,200H176V72h40V200Z"/></svg>',tN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.57,39.43A80,80,0,0,0,83.91,120.78L28.69,176A15.86,15.86,0,0,0,24,187.31V216a16,16,0,0,0,16,16H72a8,8,0,0,0,8-8V208H96a8,8,0,0,0,8-8V184h16a8,8,0,0,0,5.66-2.34l9.56-9.57A79.73,79.73,0,0,0,160,176h.1A80,80,0,0,0,216.57,39.43ZM224,98.1c-1.09,34.09-29.75,61.86-63.89,61.9H160a63.7,63.7,0,0,1-23.65-4.51,8,8,0,0,0-8.84,1.68L116.69,168H96a8,8,0,0,0-8,8v16H72a8,8,0,0,0-8,8v16H40V187.31l58.83-58.82a8,8,0,0,0,1.68-8.84A63.72,63.72,0,0,1,96,95.92c0-34.14,27.81-62.8,61.9-63.89A64,64,0,0,1,224,98.1ZM192,76a12,12,0,1,1-12-12A12,12,0,0,1,192,76Z"/></svg>',nN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"/></svg>',rN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"/></svg>',iN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24a104,104,0,0,0,0,208c21.51,0,44.1-6.48,60.43-17.33a8,8,0,0,0-8.86-13.33C166,210.38,146.21,216,128,216a88,88,0,1,1,88-88c0,26.45-10.88,32-20,32s-20-5.55-20-32V88a8,8,0,0,0-16,0v4.26a48,48,0,1,0,5.93,65.1c6,12,16.35,18.64,30.07,18.64,22.54,0,36-17.94,36-48A104.11,104.11,0,0,0,128,24Zm0,136a32,32,0,1,1,32-32A32,32,0,0,1,128,160Z"/></svg>',sN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,56H176V48a24,24,0,0,0-24-24H104A24,24,0,0,0,80,48v8H40A16,16,0,0,0,24,72V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V72A16,16,0,0,0,216,56ZM96,48a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96ZM216,72v41.61A184,184,0,0,1,128,136a184.07,184.07,0,0,1-88-22.38V72Zm0,128H40V131.64A200.19,200.19,0,0,0,128,152a200.25,200.25,0,0,0,88-20.37V200ZM104,112a8,8,0,0,1,8-8h32a8,8,0,0,1,0,16H112A8,8,0,0,1,104,112Z"/></svg>',oN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,112a47.81,47.81,0,0,0-16.93,3.09L165.93,72H192a8,8,0,0,1,8,8,8,8,0,0,0,16,0,24,24,0,0,0-24-24H152a8,8,0,0,0-6.91,12l11.65,20H99.26L82.91,60A8,8,0,0,0,76,56H48a8,8,0,0,0,0,16H71.41L85.12,95.51,69.41,117.06a48.13,48.13,0,1,0,12.92,9.44l11.59-15.9L125.09,164A8,8,0,1,0,138.91,156l-30.32-52h57.48l11.19,19.17A48,48,0,1,0,208,112ZM80,160a32,32,0,1,1-20.21-29.74l-18.25,25a8,8,0,1,0,12.92,9.42l18.25-25A31.88,31.88,0,0,1,80,160Zm128,32a32,32,0,0,1-22.51-54.72L201.09,164A8,8,0,1,0,214.91,156L199.3,129.21A32,32,0,1,1,208,192Z"/></svg>',aN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184,24H72A32,32,0,0,0,40,56V184a32,32,0,0,0,32,32h8L65.6,235.2a8,8,0,1,0,12.8,9.6L100,216h56l21.6,28.8a8,8,0,1,0,12.8-9.6L176,216h8a32,32,0,0,0,32-32V56A32,32,0,0,0,184,24ZM56,120V80h64v40Zm80-40h64v40H136ZM72,40H184a16,16,0,0,1,16,16v8H56V56A16,16,0,0,1,72,40ZM184,200H72a16,16,0,0,1-16-16V136H200v48A16,16,0,0,1,184,200ZM96,172a12,12,0,1,1-12-12A12,12,0,0,1,96,172Zm88,0a12,12,0,1,1-12-12A12,12,0,0,1,184,172Z"/></svg>',lN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,72H180.92c.39-.33.79-.65,1.17-1A29.53,29.53,0,0,0,192,49.57,32.62,32.62,0,0,0,158.44,16,29.53,29.53,0,0,0,137,25.91a54.94,54.94,0,0,0-9,14.48,54.94,54.94,0,0,0-9-14.48A29.53,29.53,0,0,0,97.56,16,32.62,32.62,0,0,0,64,49.57,29.53,29.53,0,0,0,73.91,71c.38.33.78.65,1.17,1H40A16,16,0,0,0,24,88v32a16,16,0,0,0,16,16v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V136a16,16,0,0,0,16-16V88A16,16,0,0,0,216,72ZM149,36.51a13.69,13.69,0,0,1,10-4.5h.49A16.62,16.62,0,0,1,176,49.08a13.69,13.69,0,0,1-4.5,10c-9.49,8.4-25.24,11.36-35,12.4C137.7,60.89,141,45.5,149,36.51Zm-64.09.36A16.63,16.63,0,0,1,96.59,32h.49a13.69,13.69,0,0,1,10,4.5c8.39,9.48,11.35,25.2,12.39,34.92-9.72-1-25.44-4-34.92-12.39a13.69,13.69,0,0,1-4.5-10A16.6,16.6,0,0,1,84.87,36.87ZM40,88h80v32H40Zm16,48h64v64H56Zm144,64H136V136h64Zm16-80H136V88h80v32Z"/></svg>',cN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z"/></svg>',uN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,56H180.28L166.65,35.56A8,8,0,0,0,160,32H96a8,8,0,0,0-6.65,3.56L75.71,56H48A24,24,0,0,0,24,80V192a24,24,0,0,0,24,24H208a24,24,0,0,0,24-24V80A24,24,0,0,0,208,56Zm8,136a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V80a8,8,0,0,1,8-8H80a8,8,0,0,0,6.66-3.56L100.28,48h55.43l13.63,20.44A8,8,0,0,0,176,72h32a8,8,0,0,1,8,8ZM128,88a44,44,0,1,0,44,44A44.05,44.05,0,0,0,128,88Zm0,72a28,28,0,1,1,28-28A28,28,0,0,1,128,160Z"/></svg>',hN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32Zm0,16V152h-28.7A15.86,15.86,0,0,0,168,156.69L148.69,176H107.31L88,156.69A15.86,15.86,0,0,0,76.69,152H48V48Zm0,160H48V168H76.69L96,187.31A15.86,15.86,0,0,0,107.31,192h41.38A15.86,15.86,0,0,0,160,187.31L179.31,168H208v40Z"/></svg>',dN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M200,75.64V40a16,16,0,0,0-16-16H72A16,16,0,0,0,56,40V76a16.07,16.07,0,0,0,6.4,12.8L114.67,128,62.4,167.2A16.07,16.07,0,0,0,56,180v36a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V180.36a16.09,16.09,0,0,0-6.35-12.77L141.27,128l52.38-39.6A16.05,16.05,0,0,0,200,75.64ZM184,216H72V180l56-42,56,42.35Zm0-140.36L128,118,72,76V40H184Z"/></svg>',fN='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M214.67,72H200V40a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8V72H41.33C27.36,72,16,82.77,16,96v80a8,8,0,0,0,8,8H56v32a8,8,0,0,0,8,8H192a8,8,0,0,0,8-8V184h32a8,8,0,0,0,8-8V96C240,82.77,228.64,72,214.67,72ZM72,48H184V72H72ZM184,208H72V160H184Zm40-40H200V152a8,8,0,0,0-8-8H64a8,8,0,0,0-8,8v16H32V96c0-4.41,4.19-8,9.33-8H214.67c5.14,0,9.33,3.59,9.33,8Zm-24-52a12,12,0,1,1-12-12A12,12,0,0,1,200,116Z"/></svg>',pN=':host,tv-icon:not(:defined){display:inline-flex;flex:none;width:1em;height:1em;vertical-align:-.125em}:host([size="sm"]),tv-icon:not(:defined)[size=sm]{font-size:16px}:host([size="md"]),tv-icon:not(:defined)[size=md]{font-size:20px}:host([size="lg"]),tv-icon:not(:defined)[size=lg]{font-size:24px}:host([size="xl"]),tv-icon:not(:defined)[size=xl]{font-size:32px}svg{width:100%;height:100%}:host([spinning])>svg{animation:tv-icon-spin 1s linear infinite}@keyframes tv-icon-spin{to{rotate:1turn}}@media(prefers-reduced-motion:reduce){:host([spinning])>svg{animation:none}}',W_=new CSSStyleSheet;W_.replaceSync(pN);const G_={check:SL,close:_L,copy:AL,pin:EL,search:kL,add:TL,more:CL,settings:RL,expand:IL,collapse:$L,"collapse-up":xL,select:PL,skills:DL,notification:OL,artifact:LL,spinner:ML,locked:NL,unpin:zL,back:HL,forward:ZL,television:UL,calendar:qL,grid:FL,hash:VL,delete:BL,edit:jL,link:WL,external:GL,download:JL,reload:YL,warning:KL,info:XL,file:QL,folder:eM,clock:tM,user:nM,upload:rM,star:iM,home:sM,send:oM,filter:aM,sort:lM,help:cM,chart:uM,image:hM,chat:dM,location:fM,play:pM,pause:mM,stop:gM,video:vM,music:yM,error:wM,email:bM,phone:SM,web:_M,tag:AM,bookmark:EM,table:kM,code:TM,group:CM,up:RM,down:IM,money:$M,bank:xM,card:PM,wallet:DM,gauge:OM,activity:LM,"trend-up":MM,"trend-down":NM,database:zM,server:HM,deploy:ZM,list:UM,terminal:qM,branch:FM,shield:VM,sidebar:BM,plane:jM,car:WM,bus:GM,bed:JM,food:YM,cake:KM,tent:XM,microphone:QM,luggage:eN,key:tN,sun:nN,moon:rN,at:iN,briefcase:sN,bicycle:oN,train:aN,gift:lN,book:cN,camera:uN,inbox:hN,hourglass:dN,printer:fN};function mN(n){return n!==null&&Object.hasOwn(G_,n)}var sh,c1;class J_ extends HTMLElement{constructor(){super(...arguments);m(this,sh)}connectedCallback(){h(this,sh,c1).call(this)}attributeChangedCallback(){this.isConnected&&h(this,sh,c1).call(this)}}sh=new WeakSet,c1=function(){const e=this.shadowRoot??this.attachShadow({mode:"open"});e.adoptedStyleSheets=[W_],this.replaceChildren();const r=this.getAttribute("name");e.innerHTML=mN(r)?G_[r]:""},I(J_,"observedAttributes",["name"]);customElements.get("tv-icon")||customElements.define("tv-icon",J_);function Np(n,t=null){return V`<div class="dialog-overlay"><dialog open>${t}<div class="dialog-content">${n}</div></dialog></div>`}function zp(n,t){let e=!1;const r=o=>{o.preventDefault(),t("escape")},i=o=>{if(o.target!==n)return;const a=n.getBoundingClientRect();o.clientX>=a.left&&o.clientX<=a.right&&o.clientY>=a.top&&o.clientY<=a.bottom||t("backdrop")};n.addEventListener("cancel",r),n.addEventListener("click",i);for(const o of n.ownerDocument.querySelectorAll("tv-popover[open], tv-menu[open], tv-select[open]"))o.removeAttribute("open");return n.removeAttribute("open"),n.showModal(),{withdraw(){e||(e=!0,n.removeEventListener("cancel",r),n.removeEventListener("click",i),n.open&&n.close())}}}function Ou(n){n==null||n.focus({preventScroll:!0}),n==null||n.scrollIntoView({block:"nearest"})}function Y_(n,t){if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"||t.length===0)return!1;const e=t.indexOf(t[0].ownerDocument.activeElement),r=n.key==="ArrowDown",i=e<0?r?0:t.length-1:Math.max(0,Math.min(t.length-1,e+(r?1:-1)));return n.preventDefault(),n.stopImmediatePropagation(),Ou(t[i]),!0}const u1=new WeakMap;function Ja(n,t,e){e===null?n.hasAttribute(t)&&n.removeAttribute(t):n.getAttribute(t)!==e&&n.setAttribute(t,e)}var oi,oh,ah,Dl,cs,Vs,h1,Rf,If,$f,xf,Pf,d1;class gN{constructor(t){m(this,Vs);I(this,"document");I(this,"panels",new Set);m(this,oi,new Map);m(this,oh,new WeakMap);m(this,ah,new AbortController);m(this,Dl);m(this,cs,0);m(this,Rf,t=>{if(!(t.target instanceof Element))return;const e=t.target;s(this,oh).set(t,{inside:new Set([...this.panels].filter(r=>{var i;return this.contains(r,e)||((i=r.trigger)==null?void 0:i.contains(e))})),open:[...this.panels].filter(r=>r.open)})});m(this,If,t=>{var o,a,l;if(!(t.target instanceof Element))return;const e=t.target,r=s(this,oh).get(t),i=[...this.panels].find(c=>{var u;return(u=c.trigger)==null?void 0:u.contains(e)});for(const c of(r==null?void 0:r.open)??[])c.open&&!c.manual&&c!==i&&!(r!=null&&r.inside.has(c))&&c.close();if(i&&!((o=i.trigger)!=null&&o.disabled))i.toggle(t.detail===0);else for(const c of[...this.panels])c.open&&c.host.contains(e)&&((l=(a=c.behavior).click)==null||l.call(a,e))});m(this,$f,t=>{var e,r;if(t.target instanceof Element)for(const i of this.panels)i.open&&i.host.contains(t.target)&&((r=(e=i.behavior).pointermove)==null||r.call(e,t.target))});m(this,xf,t=>{var o,a,l,c;const e=h(this,Vs,h1).call(this),r=e.find(u=>u.behavior.select),i=r??e.find(u=>u.behavior.keydown);if(!((a=i==null?void 0:(o=i.behavior).keydown)!=null&&a.call(o,t))){if(t.key==="Escape"&&r){h(this,Vs,d1).call(this,t,e,r);return}for(const u of this.panels)if(!u.open&&u.trigger===this.document.activeElement&&((c=(l=u.behavior).keydown)!=null&&c.call(l,t)))return}});m(this,Pf,t=>{if(t.key!=="Escape"||t.defaultPrevented)return;const e=h(this,Vs,h1).call(this);h(this,Vs,d1).call(this,t,e)});this.document=t;const e={signal:s(this,ah).signal};t.addEventListener("click",s(this,Rf),{...e,capture:!0}),t.addEventListener("click",s(this,If),e),t.addEventListener("keydown",s(this,xf),{...e,capture:!0}),t.addEventListener("keydown",s(this,Pf),e),t.addEventListener("pointermove",s(this,$f),e),d(this,Dl,new MutationObserver(()=>{for(const r of[...this.panels])r.refresh()})),s(this,Dl).observe(t,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:["id","trigger","selected","value","aria-expanded","role","aria-haspopup","aria-controls","aria-activedescendant"]})}animate(){if(s(this,cs))return;const t=()=>{d(this,cs,0);for(const e of this.panels)e.open&&e.place();[...this.panels].some(e=>e.open)&&d(this,cs,this.document.defaultView.requestAnimationFrame(t))};d(this,cs,this.document.defaultView.requestAnimationFrame(t))}remove(t){this.closed(t),this.panels.delete(t),!this.panels.size&&(s(this,ah).abort(),s(this,Dl).disconnect(),this.document.defaultView.cancelAnimationFrame(s(this,cs)),u1.delete(this.document))}prepareOpen(t){let e=null;for(const r of this.panels)r===t||!r.open||!t.trigger||!r.host.contains(t.trigger)||(e===null||e.host.contains(r.host))&&(e=r);if(s(this,oi).set(t,e),!(t.manual||t.behavior.select))for(const r of this.panels)r.open&&r!==t&&!r.manual&&!r.behavior.select&&!this.isDescendant(t,r)&&r.close()}isDescendant(t,e){for(let r=s(this,oi).get(t);r;r=s(this,oi).get(r))if(r===e)return!0;return!1}contains(t,e){return e?t.host.contains(e)||[...this.panels].some(r=>this.isDescendant(r,t)&&r.host.contains(e)):!1}closeDescendants(t){for(const e of[...this.panels])this.isDescendant(e,t)&&e.close(!1)}closed(t){s(this,oi).delete(t)}}oi=new WeakMap,oh=new WeakMap,ah=new WeakMap,Dl=new WeakMap,cs=new WeakMap,Vs=new WeakSet,h1=function(){const t=e=>{let r=0;for(let i=s(this,oi).get(e);i;i=s(this,oi).get(i))r++;return r};return[...this.panels].filter(e=>e.open).reverse().sort((e,r)=>t(r)-t(e))},Rf=new WeakMap,If=new WeakMap,$f=new WeakMap,xf=new WeakMap,Pf=new WeakMap,d1=function(t,e,r){if(!r&&e.some(o=>o.manual&&t.composedPath().includes(o.host)))return;const i=r??e.find(o=>!o.manual);i&&!i.manual&&(t.preventDefault(),t.stopImmediatePropagation(),i.close())};var We,us,qo,Ol,hs,ds,Mt,f1,K_,p1,lh,X_,m1;class ey{constructor(t,e={}){m(this,Mt);I(this,"host");I(this,"behavior");I(this,"trigger",null);m(this,We);m(this,us,!1);m(this,qo,!1);m(this,Ol,!0);m(this,hs,new Map);m(this,ds,new Set);m(this,lh,t=>{const e=t.target;e instanceof HTMLElement&&e!==this.host&&this.host.contains(e)&&s(this,ds).add(e)});this.host=t,this.behavior=e}get open(){return this.host.hasAttribute("open")&&s(this,us)}get manual(){return this.host.hasAttribute("manual")}connect(){if(s(this,We))return;const t=this.host.ownerDocument;d(this,We,u1.get(t)),s(this,We)||(d(this,We,new gN(t)),u1.set(t,s(this,We))),s(this,We).panels.add(this),this.refresh()}disconnect(){var e,r,i,o;if(!s(this,We))return;const t=s(this,We).contains(this,this.host.ownerDocument.activeElement);d(this,us,!1),s(this,We).closeDescendants(this),s(this,We).closed(this),this.host.removeAttribute("open"),(r=(e=this.behavior).closed)==null||r.call(e),h(this,Mt,p1).call(this),h(this,Mt,m1).call(this),t&&((i=this.trigger)!=null&&i.isConnected)&&this.trigger.focus({preventScroll:!0}),h(this,Mt,f1).call(this),(o=s(this,We))==null||o.remove(this),d(this,We,void 0)}refresh(){var r,i,o,a,l,c,u;if(!s(this,We))return;const t=this.host.ownerDocument.getElementById(this.host.getAttribute("trigger")??""),e=t instanceof HTMLButtonElement?t:null;if(e!==this.trigger&&(h(this,Mt,f1).call(this),this.trigger=e),this.trigger&&Ja(this.trigger,"aria-expanded",this.host.hasAttribute("open")?"true":"false"),(i=(r=this.behavior).refresh)==null||i.call(r),this.host.hasAttribute("open")&&!this.trigger){this.host.removeAttribute("open");return}if(this.host.hasAttribute("open")!==s(this,us))if(this.host.hasAttribute("open"))s(this,We).prepareOpen(this),d(this,us,!0),h(this,Mt,K_).call(this),h(this,Mt,X_).call(this),this.place(),(a=(o=this.behavior).opened)==null||a.call(o,s(this,qo)),d(this,qo,!1),s(this,We).animate();else{const f=s(this,We).contains(this,this.host.ownerDocument.activeElement);d(this,us,!1),s(this,We).closeDescendants(this),s(this,We).closed(this),(c=(l=this.behavior).closed)==null||c.call(l),h(this,Mt,p1).call(this),h(this,Mt,m1).call(this),f&&s(this,Ol)&&((u=this.trigger)!=null&&u.isConnected)&&this.trigger.focus({preventScroll:!0})}}toggle(t=!1){d(this,qo,t),this.host.toggleAttribute("open")}show(t=!1){d(this,qo,t),this.host.setAttribute("open","")}close(t=!0){d(this,Ol,t),this.host.removeAttribute("open"),this.refresh(),d(this,Ol,!0)}place(){var le,Ae,at;if(!this.open||!this.trigger)return;const t=this.host,e=t.ownerDocument.defaultView,r=this.trigger.getBoundingClientRect();if(!this.trigger.isConnected){this.close();return}const i=Number.parseFloat(e.getComputedStyle(t).getPropertyValue("--popover-distance"));if(!Number.isFinite(i))return;const o=t.scrollTop,a=t.scrollLeft,l=[];for(const se of s(this,ds)){if(!se.isConnected||!t.contains(se)){s(this,ds).delete(se);continue}l.push({element:se,scrollTop:se.scrollTop,scrollLeft:se.scrollLeft})}t.style.maxWidth="none";const c=s(this,hs).get("max-height");c!=null&&c.value?t.style.setProperty("max-height",c.value,c.priority):t.style.removeProperty("max-height");const u=e.getComputedStyle(t).maxHeight;t.style.minWidth=this.behavior.select?`${Math.min(r.width,e.innerWidth-2*i)}px`:((le=s(this,hs).get("min-width"))==null?void 0:le.value)??"";const f=t.getBoundingClientRect(),p=Math.max(0,e.innerWidth-i-r.left),y=Math.max(0,r.right-i),v=f.width>p&&y>p,S=Math.min(e.innerWidth-2*i,v?y:p),_=Number.parseFloat(e.getComputedStyle(t).minWidth)||0;t.style.minWidth=`${Math.max(0,Math.min(_,S))}px`,t.style.maxWidth=`${Math.max(0,S)}px`;const R=t.getBoundingClientRect(),H=R.width,P=R.height,N=Math.max(i,Math.min(v?r.right-H:r.left,e.innerWidth-i-H));let D,B;if(this.behavior.select){const se=(at=(Ae=this.behavior).selectedRow)==null?void 0:at.call(Ae),Pe=se?se.getBoundingClientRect().top+se.offsetHeight/2-R.top:0,pt=r.top+r.height/2-Pe;if(pt>=i&&pt+P<=e.innerHeight-i)D=pt,B=e.innerHeight-i-pt;else{const Nn=e.innerHeight-i-r.top,mt=r.bottom-i,At=P>Nn&&mt>Nn;B=At?mt:Nn,D=At?r.bottom-Math.min(P,B):r.top}}else{const se=Math.max(0,e.innerHeight-i-r.bottom-i),Pe=Math.max(0,r.top-2*i),pt=P>se&&Pe>se;B=pt?Pe:se,D=pt?r.top-i-Math.min(P,Pe):r.bottom+i}const q=`${Math.max(0,B)}px`;t.style.maxHeight=u==="none"?q:`min(${u}, ${q})`,t.style.left=`${N}px`,t.style.top=`${Math.max(i,Math.min(D,e.innerHeight-i-Math.min(P,B)))}px`;const F=e.getComputedStyle(t),Q=F.boxSizing==="border-box",K=parseFloat(F.width)+(Q?0:parseFloat(F.paddingLeft)+parseFloat(F.paddingRight)+parseFloat(F.borderLeftWidth)+parseFloat(F.borderRightWidth)),he=parseFloat(F.height)+(Q?0:parseFloat(F.paddingTop)+parseFloat(F.paddingBottom)+parseFloat(F.borderTopWidth)+parseFloat(F.borderBottomWidth));t.style.setProperty("--_panel-edge-inset",`${t.style.top} auto auto ${t.style.left}`),t.style.setProperty("--_panel-edge-width",`${K}px`),t.style.setProperty("--_panel-edge-height",`${he}px`),t.scrollTop=o,t.scrollLeft=a;for(const se of l)se.element.scrollTop=se.scrollTop,se.element.scrollLeft=se.scrollLeft}}We=new WeakMap,us=new WeakMap,qo=new WeakMap,Ol=new WeakMap,hs=new WeakMap,ds=new WeakMap,Mt=new WeakSet,f1=function(){var t,e;this.trigger&&(this.trigger.removeAttribute("aria-expanded"),(e=(t=this.behavior).unpair)==null||e.call(t,this.trigger),this.trigger=null)},K_=function(){s(this,ds).clear(),this.host.addEventListener("scroll",s(this,lh),!0)},p1=function(){this.host.removeEventListener("scroll",s(this,lh),!0),s(this,ds).clear()},lh=new WeakMap,X_=function(){const t=this.host;for(const e of["position","z-index","left","top","margin","max-width","max-height","min-width","overflow","--_panel-edge-position","--_panel-edge-inset","--_panel-edge-width","--_panel-edge-height"])s(this,hs).set(e,{value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)});t.style.position="fixed",t.style.zIndex="var(--layer-panel)",t.style.margin="0",t.style.overflow="auto",t.style.setProperty("--_panel-edge-position","fixed")},m1=function(){for(const[t,{value:e,priority:r}]of s(this,hs))e?this.host.style.setProperty(t,e,r):this.host.style.removeProperty(t);s(this,hs).clear()};class vN extends HTMLElement{constructor(){super(),this.attachInternals().role="menuitem"}connectedCallback(){this.tabIndex=-1}}var fs,Nr,g1,v1,eA;class Q_ extends HTMLElement{constructor(){super();m(this,Nr);m(this,fs,new ey(this,{opened:e=>{e&&Ou(h(this,Nr,g1).call(this)[0])},keydown:e=>h(this,Nr,eA).call(this,e),pointermove:e=>Ou(h(this,Nr,v1).call(this,e)??void 0),click:e=>{h(this,Nr,v1).call(this,e)&&s(this,fs).close()}}));this.attachInternals().role="menu"}connectedCallback(){s(this,fs).connect()}disconnectedCallback(){s(this,fs).disconnect()}attributeChangedCallback(){s(this,fs).refresh()}}fs=new WeakMap,Nr=new WeakSet,g1=function(){return[...this.querySelectorAll("tv-menu-item")]},v1=function(e){const r=e.closest("tv-menu-item");return(r==null?void 0:r.closest("tv-menu"))===this?r:null},eA=function(e){if(!s(this,fs).open)return!1;const r=h(this,Nr,g1).call(this),i=r.indexOf(this.ownerDocument.activeElement);return Y_(e,r)?!0:e.key==="Enter"&&i>=0?(e.preventDefault(),e.stopImmediatePropagation(),r[i].click(),!0):!1},I(Q_,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-menu-item")||customElements.define("tv-menu-item",vN);customElements.get("tv-menu")||customElements.define("tv-menu",Q_);let yN=0;var ch;class wN extends mn{constructor(){super(...arguments);m(this,ch,`menu-trigger-${++yN}`)}template(e,{trigger:r}){return V`${r(s(this,ch))}<tv-menu trigger=${s(this,ch)}>
|
|
90
|
+
${e.map(i=>"separator"in i?V`<hr>`:V`<tv-menu-item intent=${i.destructive?"danger":oe} @click=${i.action}>${i.label}</tv-menu-item>`)}
|
|
91
|
+
</tv-menu>`}}ch=new WeakMap;const tA=gn(wN);/**
|
|
92
|
+
* @license
|
|
93
|
+
* Copyright 2020 Google LLC
|
|
94
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
95
|
+
*/const er=()=>new bN;class bN{}const yg=new WeakMap,ft=xc(class extends j_{render(n){return oe}update(n,[t]){var r;const e=t!==this.G;return e&&this.G!==void 0&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=t,this.ht=(r=n.options)==null?void 0:r.host,this.rt(this.ct=n.element)),oe}rt(n){if(this.isConnected||(n=void 0),typeof this.G=="function"){const t=this.ht??globalThis;let e=yg.get(t);e===void 0&&(e=new WeakMap,yg.set(t,e)),e.get(this.G)!==void 0&&this.G.call(this.ht,void 0),e.set(this.G,n),n!==void 0&&this.G.call(this.ht,n)}else this.G.value=n}get lt(){var n,t;return typeof this.G=="function"?(n=yg.get(this.ht??globalThis))==null?void 0:n.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/**
|
|
96
|
+
* @license
|
|
97
|
+
* Copyright 2017 Google LLC
|
|
98
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
+
*/const Kb=(n,t,e)=>{const r=new Map;for(let i=t;i<=e;i++)r.set(n[i],i);return r},mf=xc(class extends td{constructor(n){if(super(n),n.type!==Or.CHILD)throw Error("repeat() can only be used in text expressions")}dt(n,t,e){let r;e===void 0?e=t:t!==void 0&&(r=t);const i=[],o=[];let a=0;for(const l of n)i[a]=r?r(l,a):a,o[a]=e(l,a),a++;return{values:o,keys:i}}render(n,t,e){return this.dt(n,t,e).values}update(n,[t,e,r]){const i=mL(n),{values:o,keys:a}=this.dt(t,e,r);if(!Array.isArray(i))return this.ut=a,o;const l=this.ut??(this.ut=[]),c=[];let u,f,p=0,y=i.length-1,v=0,S=o.length-1;for(;p<=y&&v<=S;)if(i[p]===null)p++;else if(i[y]===null)y--;else if(l[p]===a[v])c[v]=so(i[p],o[v]),p++,v++;else if(l[y]===a[S])c[S]=so(i[y],o[S]),y--,S--;else if(l[p]===a[S])c[S]=so(i[p],o[S]),Bc(n,c[S+1],i[p]),p++,S--;else if(l[y]===a[v])c[v]=so(i[y],o[v]),Bc(n,i[p],i[y]),y--,v++;else if(u===void 0&&(u=Kb(a,v,S),f=Kb(l,p,y)),u.has(l[p]))if(u.has(l[y])){const _=f.get(a[v]),R=_!==void 0?i[_]:null;if(R===null){const H=Bc(n,i[p]);so(H,o[v]),c[v]=H}else c[v]=so(R,o[v]),Bc(n,i[p],R),i[_]=null;v++}else vg(i[y]),y--;else vg(i[p]),p++;for(;v<=S;){const _=Bc(n,c[S+1]);so(_,o[v]),c[v++]=_}for(;p<=y;){const _=i[p++];_!==null&&vg(_)}return this.ut=a,V_(n,c),Dt}});/**
|
|
100
|
+
* @license
|
|
101
|
+
* Copyright 2018 Google LLC
|
|
102
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
103
|
+
*/const nA="important",SN=" !"+nA,gf=xc(class extends td{constructor(n){var t;if(super(n),n.type!==Or.ATTRIBUTE||n.name!=="style"||((t=n.strings)==null?void 0:t.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(n){return Object.keys(n).reduce((t,e)=>{const r=n[e];return r==null?t:t+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(n,[t]){const{style:e}=n.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(t)),this.render(t);for(const r of this.ft)t[r]==null&&(this.ft.delete(r),r.includes("-")?e.removeProperty(r):e[r]=null);for(const r in t){const i=t[r];if(i!=null){this.ft.add(r);const o=typeof i=="string"&&i.endsWith(SN);r.includes("-")||o?e.setProperty(r,o?i.slice(0,-11):i,o?nA:""):e[r]=i}}return Dt}}),_N=24;function AN(n){return!Xb(n.source)||!Xb(n.current)||!$N(n.source,n.current)||!xN(n)||!IN(n.geometry)?{kind:"invalidated"}:TN(n.pointer,n.geometry)==="pinned"?EN(n):kN(n)}function EN(n){var c;const{source:t,current:e,pointer:r,geometry:i}=n,a=(((c=i.placeholder)==null?void 0:c.side)==="pinned"&&r.y>=i.placeholder.top&&r.y<=i.placeholder.bottom?i.placeholder.index:null)??CN(r.y,i.pinnedRows),l=e.pinnedChannelIds.filter(u=>u!==t.channelId);return l.splice(a,0,t.channelId),{kind:"placement",side:"pinned",placeholder:{side:"pinned",index:a},operation:l}}function kN(n){const{source:t,current:e}=n,r=t.pinnedChannelIds.includes(t.channelId),i=r?RN(e.unpinnedChannelIds,t.channelId):t.unpinnedChannelIds.indexOf(t.channelId);return{kind:"placement",side:"unpinned",placeholder:r&&e.unpinnedChannelIds.length===0?null:{side:"unpinned",index:i},operation:r?e.pinnedChannelIds.filter(o=>o!==t.channelId):null}}function TN(n,t){const{sidebar:e}=t;if(n.x<e.left||n.x>e.right||n.y<e.top||n.y>e.bottom)return"unpinned";const i=t.unpinnedGroupTop??(t.pinnedContentBottom===null?Number.NEGATIVE_INFINITY:t.pinnedContentBottom+_N);return n.y<i?"pinned":"unpinned"}function CN(n,t){const e=t.findIndex(({top:r,bottom:i})=>n<r+(i-r)/2);return e===-1?t.length:e}function RN(n,t){const e=n.filter(i=>i!==t),r=e.findIndex(i=>i<t);return r===-1?e.length:r}function IN(n){return n.unpinnedGroupTop!==null||n.pinnedContentBottom!==null}function Xb(n){const t=[...n.pinnedChannelIds,...n.unpinnedChannelIds];return new Set(t).size===t.length}function $N(n,t){return y1(n.pinnedChannelIds,t.pinnedChannelIds)&&y1(n.unpinnedChannelIds,t.unpinnedChannelIds)}function xN(n){const t=n.current.pinnedChannelIds.filter(o=>o!==n.source.channelId),e=n.geometry.pinnedRows.map(({channelId:o})=>o),r=n.geometry.placeholder,i=r===null||Number.isInteger(r.index)&&r.index>=0&&r.index<=(r.side==="pinned"?t.length:n.current.unpinnedChannelIds.length);return n.source.pinnedChannelIds.includes(n.source.channelId)!==n.source.unpinnedChannelIds.includes(n.source.channelId)&&y1(t,e)&&i}function y1(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}const rA=4,sl=200,Dn=28,vf=800,Sd="ease",Qb=.5,jc=.5,PN="New channel",oo=".channel-group:not(.channel-group-withdrawal) .channel-row",DN=24;var zt,ln,It,wt,cn,Ht,br,Fo,Me,be,An,En,kn,Zt,Ut,qt,Tn,Ft,Sr,ai,Ll,Ml,ps,x,w1,sA,oA,aA,lA,Hd,cA,uA,hA,dA,ou,Ya,fA,pA,b1,au,Df,Of,Lf,Mf,mA,S1,_1,gA,uh,hh,vA,Nf,dh,yA,wA,lu,A1,bA,SA,cu,E1,k1,T1,_A,Zd,fh,ph,mh,gh,AA,C1,Ud,qd,uu,R1,I1;class iA{constructor(t){m(this,x);m(this,zt);m(this,ln,null);m(this,It,null);m(this,wt,{management:!0});m(this,cn,!1);m(this,Ht,null);m(this,br,"");m(this,Fo,!1);m(this,Me,null);m(this,be,null);m(this,An,!1);m(this,En,null);m(this,kn,null);m(this,Zt,null);m(this,Ut,null);m(this,qt,null);m(this,Tn,null);m(this,Ft,null);m(this,Sr,null);m(this,ai,er());m(this,Ll,er());m(this,Ml,er());m(this,ps,null);I(this,"create",()=>{const t=s(this,ln),e=s(this,It);if(t===null||e===null||s(this,En)!==null)return;const r={resultChannelId:null};d(this,En,r),s(this,zt).call(this),t.createChannel(PN).then(i=>{r.resultChannelId=i.id,t.focusChannel(i.id).catch(()=>{}),s(this,En)===r&&s(this,zt).call(this)},()=>{s(this,En)!==r||s(this,kn)!==null||(d(this,En,null),s(this,zt).call(this))})});m(this,Df,t=>{d(this,br,t.currentTarget.value)});m(this,Of,t=>{t.key==="Enter"?(t.preventDefault(),h(this,x,au).call(this,!0)):t.key==="Escape"&&(t.preventDefault(),h(this,x,au).call(this,!1))});m(this,Lf,()=>{h(this,x,au).call(this,!0)});m(this,Mf,t=>{t.preventDefault(),h(this,x,au).call(this,!0)});m(this,uh,()=>{d(this,An,!1)});m(this,hh,t=>{!s(this,An)||t.detail===0||(d(this,An,!1),t.preventDefault(),t.stopImmediatePropagation())});m(this,Nf,t=>{var e;!s(this,wt).highlightOnPointerMove||s(this,be)!==null||s(this,Ht)!==null||(e=s(this,ai).value)!=null&&e.querySelector("tv-menu[open]")||Ou(t.currentTarget)});m(this,dh,t=>{if(s(this,cn)){d(this,Me,null);return}const e=s(this,be);if(e!==null){if(e.pointerId!==t.pointerId)return;t.preventDefault(),h(this,x,lu).call(this,e,t);return}const r=s(this,Me);if(!(r===null||r.pointerId!==t.pointerId)){if(t.buttons===0){d(this,Me,null);return}Math.hypot(t.clientX-r.x,t.clientY-r.y)<=rA||h(this,x,yA).call(this,r,t)}});m(this,fh,t=>{var r;const e=s(this,be);if(e!==null&&e.pointerId===t.pointerId){if(e.completed)return;const i=e.captureTarget.hasPointerCapture(t.pointerId);h(this,x,lu).call(this,e,t);const o=i&&e.placement.kind==="placement"?e.placement.operation:null,a=s(this,ln);if(o===null||a===null){h(this,x,uu).call(this,e,!1);return}e.completed=!0,h(this,x,cu).call(this,e),e.operation=[...o],a.setPinnedChannelIds([...o]).then(()=>{s(this,be)===e&&(e.operationResolved=!0,h(this,x,C1).call(this,s(this,It)))},()=>{s(this,be)===e&&(e.operationResolved=!0,e.operationRejected=!0,h(this,x,Ud).call(this,e))});return}((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&d(this,Me,null)});m(this,ph,t=>{var e,r;((e=s(this,be))==null?void 0:e.pointerId)===t.pointerId&&!s(this,be).completed?h(this,x,qd).call(this):((r=s(this,Me))==null?void 0:r.pointerId)===t.pointerId&&d(this,Me,null)});m(this,mh,t=>{const e=s(this,be);e===null||e.pointerId!==t.pointerId||e.completed||h(this,x,uu).call(this,e,!1)});m(this,gh,t=>{t.key!=="Escape"||s(this,be)===null||s(this,be).completed||(t.preventDefault(),t.stopImmediatePropagation(),h(this,x,qd).call(this))});d(this,zt,t)}get creating(){return s(this,En)!==null}get dragging(){return s(this,be)!==null}connect(){window.addEventListener("pointermove",s(this,dh)),window.addEventListener("pointerup",s(this,fh)),window.addEventListener("pointercancel",s(this,ph)),window.addEventListener("lostpointercapture",s(this,mh)),window.addEventListener("keydown",s(this,gh),!0),window.addEventListener("click",s(this,hh),!0),window.addEventListener("pointerdown",s(this,uh),!0)}update(t,e,r){const i=s(this,It),o=s(this,cn);d(this,ln,t),d(this,It,e),d(this,wt,r),d(this,cn,r.motionSuppressed??!1),!o&&s(this,cn)&&h(this,x,fA).call(this),h(this,x,AA).call(this,e),h(this,x,aA).call(this,e),h(this,x,hA).call(this,i,e),s(this,Ht)!==null&&!e.channels.some(({id:l})=>l===s(this,Ht))&&(d(this,Ht,null),d(this,br,"")),h(this,x,C1).call(this,e);const a=s(this,ps);a!==null&&e.display.pinnedChannelIds.includes(a.channelId)===a.pinned&&(d(this,ps,null),queueMicrotask(()=>{const l=h(this,x,S1).call(this,a.channelId);l==null||l.scrollIntoView({block:"nearest"}),a.focus&&(l==null||l.focus({preventScroll:!0}))})),o&&!s(this,cn)&&h(this,x,pA).call(this)}template(){var r;const t=s(this,It);if(t===null)return oe;const e=h(this,x,dA).call(this,e8(t,(r=s(this,be))==null?void 0:r.source));return V`
|
|
104
|
+
<div
|
|
105
|
+
class="channel-list"
|
|
106
|
+
role="listbox"
|
|
107
|
+
aria-label="Channels"
|
|
108
|
+
${ft(s(this,ai))}
|
|
109
|
+
>
|
|
110
|
+
${h(this,x,w1).call(this,"Pinned",e.pinned)}
|
|
111
|
+
${h(this,x,w1).call(this,"Recent",e.unpinned)}
|
|
112
|
+
</div>
|
|
113
|
+
`}overlayTemplate(){return s(this,wt).management?h(this,x,uA).call(this):oe}disconnect(){var t,e,r;window.removeEventListener("pointermove",s(this,dh)),window.removeEventListener("pointerup",s(this,fh)),window.removeEventListener("pointercancel",s(this,ph)),window.removeEventListener("lostpointercapture",s(this,mh)),window.removeEventListener("keydown",s(this,gh),!0),window.removeEventListener("click",s(this,hh),!0),window.removeEventListener("pointerdown",s(this,uh),!0),h(this,x,R1).call(this),(t=s(this,Sr))==null||t.withdraw(),d(this,Sr,null),(e=s(this,Tn))==null||e.cancel(),d(this,Tn,null),(r=s(this,Ft))==null||r.cancel(),d(this,Ft,null),d(this,ln,null),d(this,It,null),d(this,Ht,null),d(this,br,""),d(this,Fo,!1),d(this,Me,null),d(this,An,!1),d(this,En,null),d(this,kn,null),d(this,Zt,null),d(this,Ut,null),d(this,qt,null),d(this,ps,null)}}zt=new WeakMap,ln=new WeakMap,It=new WeakMap,wt=new WeakMap,cn=new WeakMap,Ht=new WeakMap,br=new WeakMap,Fo=new WeakMap,Me=new WeakMap,be=new WeakMap,An=new WeakMap,En=new WeakMap,kn=new WeakMap,Zt=new WeakMap,Ut=new WeakMap,qt=new WeakMap,Tn=new WeakMap,Ft=new WeakMap,Sr=new WeakMap,ai=new WeakMap,Ll=new WeakMap,Ml=new WeakMap,ps=new WeakMap,x=new WeakSet,w1=function(t,e){var f;const r=t==="Pinned"?"pinned":"unpinned",i=s(this,be);if(i===null&&e.length===0)return null;const o=i===null?void 0:e.find(({channel:p})=>p.id===i.channelId),a=i===null?e:e.filter(({channel:p})=>p.id!==i.channelId),l=(i==null?void 0:i.placement.kind)==="placement"&&((f=i.placement.placeholder)==null?void 0:f.side)===r?i.placement.placeholder:null,c=a.map(p=>({kind:"row",row:p}));l!==null&&c.splice(l.index,0,{kind:"placeholder",key:`channel-placeholder-${r}`}),o!==void 0&&c.push({kind:"row",row:o});const u=i!==null&&a.length===0&&l===null;return V`
|
|
114
|
+
<div
|
|
115
|
+
class="channel-group"
|
|
116
|
+
role="group"
|
|
117
|
+
aria-labelledby=${`channel-group-${r}`}
|
|
118
|
+
data-channel-side=${r}
|
|
119
|
+
?drag-collapsed=${u}
|
|
120
|
+
>
|
|
121
|
+
<div class="channel-group-label" id=${`channel-group-${r}`}>${t}</div>
|
|
122
|
+
${mf(c,p=>p.kind==="row"?p.row.channel.id:p.key,p=>p.kind==="row"?h(this,x,sA).call(this,p.row):V`
|
|
123
|
+
<span
|
|
124
|
+
class="channel-placeholder"
|
|
125
|
+
aria-hidden="true"
|
|
126
|
+
data-channel-side=${r}
|
|
127
|
+
data-channel-index=${(l==null?void 0:l.index)??0}
|
|
128
|
+
style=${gf({height:`${(i==null?void 0:i.rowHeight)??0}px`})}
|
|
129
|
+
></span>
|
|
130
|
+
`)}
|
|
131
|
+
</div>
|
|
132
|
+
`},sA=function(t){var c;const{channel:e,pinned:r,selected:i}=t,o=((c=s(this,be))==null?void 0:c.channelId)===e.id?s(this,be):null,a=o!==null&&r&&o.placement.kind==="placement"&&o.placement.side==="unpinned",l=e.id===s(this,Ht);return V`
|
|
133
|
+
<div
|
|
134
|
+
class=${`channel-row${o!==null?" dragged":""}${a?" unpinning":""}`}
|
|
135
|
+
data-channel-id=${e.id}
|
|
136
|
+
style=${gf(o===null?{}:{left:`${o.currentX-o.grip.previewOffsetX}px`,top:`${o.currentY-o.grip.offsetY}px`,width:`${o.rowWidth}px`,height:`${o.rowHeight}px`})}
|
|
137
|
+
>
|
|
138
|
+
${a?V`
|
|
139
|
+
<span class="channel-drag-action" aria-hidden="true">
|
|
140
|
+
<tv-icon name="unpin"></tv-icon>
|
|
141
|
+
Unpin
|
|
142
|
+
</span>
|
|
143
|
+
`:null}
|
|
144
|
+
${l?V`
|
|
145
|
+
<input
|
|
146
|
+
class="channel-rename"
|
|
147
|
+
aria-label="Channel name"
|
|
148
|
+
.value=${s(this,br)}
|
|
149
|
+
@input=${s(this,Df)}
|
|
150
|
+
@keydown=${s(this,Of)}
|
|
151
|
+
@blur=${s(this,Lf)}
|
|
152
|
+
${ft(s(this,Ll))}
|
|
153
|
+
/>
|
|
154
|
+
<button
|
|
155
|
+
class="channel-rename-commit"
|
|
156
|
+
variant="ghost"
|
|
157
|
+
icon
|
|
158
|
+
size="sm"
|
|
159
|
+
type="button"
|
|
160
|
+
tabindex="-1"
|
|
161
|
+
aria-label="Rename"
|
|
162
|
+
@pointerdown=${s(this,Mf)}
|
|
163
|
+
>
|
|
164
|
+
<tv-icon name="check"></tv-icon>
|
|
165
|
+
</button>
|
|
166
|
+
`:V`
|
|
167
|
+
<div
|
|
168
|
+
class="channel"
|
|
169
|
+
role="option"
|
|
170
|
+
tabindex="-1"
|
|
171
|
+
@keydown=${u=>{u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),u.stopPropagation(),u.currentTarget.click())}}
|
|
172
|
+
@pointermove=${s(this,Nf)}
|
|
173
|
+
aria-selected=${i?"true":oe}
|
|
174
|
+
@pointerdown=${u=>s(this,wt).dragging??s(this,wt).management?h(this,x,gA).call(this,e.id,u):void 0}
|
|
175
|
+
@click=${u=>h(this,x,vA).call(this,e.id,u)}
|
|
176
|
+
>
|
|
177
|
+
${e.name}
|
|
178
|
+
</div>
|
|
179
|
+
${s(this,wt).management?tA(h(this,x,oA).call(this,t),{trigger:u=>V`
|
|
180
|
+
<button
|
|
181
|
+
class="channel-menu-trigger"
|
|
182
|
+
variant="ghost"
|
|
183
|
+
icon
|
|
184
|
+
size="sm"
|
|
185
|
+
type="button"
|
|
186
|
+
tabindex="-1"
|
|
187
|
+
id=${u}
|
|
188
|
+
aria-haspopup="menu"
|
|
189
|
+
title=${`${e.name} menu`}
|
|
190
|
+
>
|
|
191
|
+
<tv-icon name="expand"></tv-icon>
|
|
192
|
+
</button>
|
|
193
|
+
`}):oe}
|
|
194
|
+
`}
|
|
195
|
+
</div>
|
|
196
|
+
`},oA=function(t){const{channel:e,pinned:r}=t;return[{label:"Rename",action:()=>h(this,x,b1).call(this,e.id)},{label:r?"Unpin":"Pin",action:()=>h(this,x,mA).call(this,e.id,!r)},{separator:!0},{label:"Delete",destructive:!0,action:()=>h(this,x,lA).call(this,e.id,e.name)}]},aA=function(t){const e=s(this,En);if(e===null||s(this,kn)!==null||e.resultChannelId===null)return;const r=t.channels.find(({id:i})=>i===e.resultChannelId);r!==void 0&&(d(this,kn,r.id),queueMicrotask(()=>h(this,x,ou).call(this,"create",r.id)))},lA=function(t,e){var i,o,a,l,c;if(s(this,Zt)!==null||s(this,Ut)!==null)return;h(this,x,_1).call(this,t),d(this,Zt,{channelId:t,name:e}),(o=(i=s(this,wt)).onDeleteStart)==null||o.call(i,t),s(this,zt).call(this);const r=(a=s(this,Ml).value)==null?void 0:a.closest("dialog");r instanceof HTMLDialogElement&&(d(this,Sr,zp(r,()=>{h(this,x,Hd).call(this)})),(c=(l=s(this,Ml).value)==null?void 0:l.querySelector(".dialog-actions button"))==null||c.focus())},Hd=function(t=!1){var i,o;const e=s(this,Zt),r=s(this,Sr);d(this,Sr,null),d(this,Zt,null),r==null||r.withdraw(),s(this,zt).call(this),!t&&e!==null&&((o=(i=s(this,wt)).onDeleteEnd)==null||o.call(i,e.channelId,!1))},cA=function(){const t=s(this,ln),e=s(this,Zt);if(t===null||e===null||s(this,Ut)!==null)return;d(this,Ut,e.channelId),h(this,x,Hd).call(this,!0);const r=s(this,wt).onDeleteEnd;t.deleteChannel(e.channelId).then(()=>{r==null||r(e.channelId,!0)}).catch(()=>{s(this,Ut)===e.channelId&&s(this,qt)===null&&(d(this,Ut,null),s(this,zt).call(this)),r==null||r(e.channelId,!1)})},uA=function(){const t=s(this,Zt);return t===null?null:Np(V`
|
|
197
|
+
<div
|
|
198
|
+
class="dialog-alert channel-delete-alert"
|
|
199
|
+
role="alertdialog"
|
|
200
|
+
aria-labelledby="channel-delete-title"
|
|
201
|
+
aria-describedby="channel-delete-body"
|
|
202
|
+
${ft(s(this,Ml))}
|
|
203
|
+
>
|
|
204
|
+
<h2 id="channel-delete-title">Delete “${t.name}”?</h2>
|
|
205
|
+
<p id="channel-delete-body">
|
|
206
|
+
This will permanently delete this channel from Television.
|
|
207
|
+
</p>
|
|
208
|
+
<div class="dialog-actions">
|
|
209
|
+
<button type="button" autofocus @click=${()=>h(this,x,Hd).call(this)}>
|
|
210
|
+
Cancel
|
|
211
|
+
</button>
|
|
212
|
+
<button type="button" intent="danger" @click=${()=>h(this,x,cA).call(this)}>
|
|
213
|
+
Delete
|
|
214
|
+
</button>
|
|
215
|
+
</div>
|
|
216
|
+
</div>
|
|
217
|
+
`)},hA=function(t,e){var u,f;if(s(this,Zt)!==null&&!e.channels.some(({id:p})=>{var y;return p===((y=s(this,Zt))==null?void 0:y.channelId)})){const p=s(this,Zt);(u=s(this,Sr))==null||u.withdraw(),d(this,Sr,null),d(this,Zt,null),queueMicrotask(()=>{var y,v;return(v=(y=s(this,wt)).onDeleteEnd)==null?void 0:v.call(y,p.channelId,!0)})}const r=s(this,qt);if(r!==null&&e.channels.some(({id:p})=>p===r.row.channel.id)){(f=s(this,Ft))==null||f.cancel(),d(this,Ft,null),d(this,qt,null),d(this,Ut,null);return}const i=s(this,Ut);if(i===null||r!==null||e.channels.some(({id:p})=>p===i))return;if(t===null){d(this,Ut,null);return}const o=e8(t),a=o.pinned.findIndex(({channel:p})=>p.id===i),l=o.unpinned.findIndex(({channel:p})=>p.id===i),c=a>=0?o.pinned[a]:o.unpinned[l];if(c===void 0){d(this,Ut,null);return}d(this,qt,{row:{...c,selected:!1},side:a>=0?"pinned":"unpinned",index:a>=0?a:l}),queueMicrotask(()=>h(this,x,ou).call(this,"delete",i))},dA=function(t){const e=s(this,qt);if(e===null)return t;const r=[...t[e.side]];return r.some(({channel:i})=>i.id===e.row.channel.id)||r.splice(e.index,0,e.row),{...t,[e.side]:r}},ou=function(t,e){var l,c;if(t==="create"&&s(this,kn)!==e||t==="delete"&&((l=s(this,qt))==null?void 0:l.row.channel.id)!==e||s(this,cn))return;const r=[...((c=s(this,ai).value)==null?void 0:c.querySelectorAll(oo))??[]].find(u=>u.dataset.channelId===e);if(r===void 0){t==="delete"&&h(this,x,Ya).call(this,t,e);return}if(typeof r.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches){h(this,x,Ya).call(this,t,e);return}const i=r.getBoundingClientRect().height,o=t==="create"?[{maxHeight:"0px",opacity:0},{maxHeight:`${i}px`,opacity:1}]:[{maxHeight:`${i}px`,opacity:1},{maxHeight:"0px",opacity:0}],a=r.animate(o,{duration:sl,easing:Sd});t==="create"?d(this,Tn,a):d(this,Ft,a),a.finished.then(()=>{t==="create"&&s(this,Tn)!==a||t==="delete"&&s(this,Ft)!==a||(t==="create"?d(this,Tn,null):d(this,Ft,null),h(this,x,Ya).call(this,t,e))},()=>{})},Ya=function(t,e){var r;if(t==="create"){if(s(this,kn)!==e)return;d(this,kn,null),d(this,En,null),h(this,x,b1).call(this,e);return}((r=s(this,qt))==null?void 0:r.row.channel.id)===e&&(d(this,qt,null),d(this,Ut,null),s(this,zt).call(this))},fA=function(){var r;d(this,Me,null),h(this,x,R1).call(this);const t=s(this,kn);s(this,Tn)!==null&&(s(this,Tn).cancel(),d(this,Tn,null),t!==null&&queueMicrotask(()=>h(this,x,Ya).call(this,"create",t)));const e=((r=s(this,qt))==null?void 0:r.row.channel.id)??null;s(this,Ft)!==null&&(s(this,Ft).cancel(),d(this,Ft,null),e!==null&&queueMicrotask(()=>h(this,x,Ya).call(this,"delete",e)))},pA=function(){var r;const t=s(this,kn),e=((r=s(this,qt))==null?void 0:r.row.channel.id)??null;t!==null&&s(this,Tn)===null&&queueMicrotask(()=>h(this,x,ou).call(this,"create",t)),e!==null&&s(this,Ft)===null&&queueMicrotask(()=>h(this,x,ou).call(this,"delete",e))},b1=function(t){var r;const e=(r=s(this,It))==null?void 0:r.channels.find(({id:i})=>i===t);e!==void 0&&(d(this,Ht,t),d(this,br,e.name),d(this,Me,null),s(this,zt).call(this),queueMicrotask(()=>{var i,o;s(this,Ht)===t&&((i=s(this,Ll).value)==null||i.focus(),(o=s(this,Ll).value)==null||o.select())}))},au=function(t){if(s(this,Ht)===null||s(this,Fo)||s(this,ln)===null)return;d(this,Fo,!0);const e=s(this,Ht),r=s(this,br).trim();d(this,Ht,null),d(this,br,""),s(this,zt).call(this),d(this,Fo,!1),t&&r.length>0&&s(this,ln).renameChannel(e,r).catch(()=>{})},Df=new WeakMap,Of=new WeakMap,Lf=new WeakMap,Mf=new WeakMap,mA=function(t,e){var o;if(s(this,ln)===null||s(this,It)===null)return;if(h(this,x,_1).call(this,t),s(this,wt).revealMovedRow){const a=h(this,x,S1).call(this,t);d(this,ps,{channelId:t,pinned:e,focus:((o=a==null?void 0:a.parentElement)==null?void 0:o.contains(document.activeElement))??!1})}const r=s(this,It).display.pinnedChannelIds,i=e?[...r.filter(a=>a!==t),t]:r.filter(a=>a!==t);s(this,ln).setPinnedChannelIds(i).catch(()=>{d(this,ps,null)})},S1=function(t){var e,r;return((r=[...((e=s(this,ai).value)==null?void 0:e.querySelectorAll(oo))??[]].find(i=>i.dataset.channelId===t))==null?void 0:r.querySelector(".channel"))??void 0},_1=function(t){var i,o,a;const e=[...((i=s(this,ai).value)==null?void 0:i.querySelectorAll(oo))??[]].find(l=>l.dataset.channelId===t),r=e==null?void 0:e.querySelector(".channel-menu-trigger");r&&((a=(o=s(this,ai).value)==null?void 0:o.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||a.removeAttribute("open"))},gA=function(t,e){if(e.button!==0||s(this,Me)!==null||s(this,be)!==null||s(this,It)===null)return;d(this,An,!1);const i=e.currentTarget.closest(".sidebar, .channel-switcher-pop");if(i===null)return;const o=hu(s(this,It));!o.pinnedChannelIds.includes(t)&&!o.unpinnedChannelIds.includes(t)||d(this,Me,{channelId:t,pointerId:e.pointerId,x:e.clientX,y:e.clientY,source:{channelId:t,...o},captureTarget:i})},uh=new WeakMap,hh=new WeakMap,vA=function(t,e){var r;if(e.detail!==0&&s(this,An)){d(this,An,!1);return}d(this,An,!1),s(this,be)===null&&(s(this,wt).selectChannel?s(this,wt).selectChannel(t):(r=s(this,ln))==null||r.focusChannel(t).catch(()=>{}))},Nf=new WeakMap,dh=new WeakMap,yA=function(t,e){if(s(this,cn)){d(this,Me,null);return}const r=[...t.captureTarget.querySelectorAll(oo)].find(f=>f.dataset.channelId===t.channelId);if(r===void 0){d(this,Me,null);return}const i=r.getBoundingClientRect(),o=h(this,x,wA).call(this,r),a=ON({wideRow:i,compactPreviewWidth:o,pointer:{x:t.x,y:t.y}}),l=t.captureTarget.querySelector('[data-channel-side="pinned"]'),c=t.captureTarget.querySelector('[data-channel-side="unpinned"]');try{t.captureTarget.setPointerCapture(t.pointerId)}catch{d(this,Me,null);return}t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-x",`${a.previewOffsetX}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-y",`${a.offsetY}px`),t.captureTarget.style.setProperty("--channel-sidebar-drag-grip-correction-x",`${a.correctionX}px`),d(this,An,!0);const u={...t,placement:{kind:"invalidated"},currentX:e.clientX,currentY:e.clientY,grip:a,rowWidth:o,rowHeight:i.height,originPinnedContentBottom:(l==null?void 0:l.getBoundingClientRect().bottom)??null,originUnpinnedGroupTop:(c==null?void 0:c.getBoundingClientRect().top)??null,displacementAnimations:new Set,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,completed:!1,operation:null,operationResolved:!1,operationRejected:!1,restorationQueued:!1};d(this,Me,null),d(this,be,u),h(this,x,lu).call(this,u,e)},wA=function(t){const e=t.cloneNode(!0);for(const i of[e,...e.querySelectorAll("[id], [trigger]")])i.removeAttribute("id"),i.removeAttribute("trigger");e.classList.add("dragged"),e.style.position="fixed",e.style.left="-10000px",e.style.top="-10000px",e.style.visibility="hidden",e.style.pointerEvents="none",document.body.append(e);const r=e.getBoundingClientRect().width;return e.remove(),r},lu=function(t,e,r=!0){if(t.completed)return;const i=s(this,It);if(i===null){t.placement={kind:"invalidated"};return}t.currentX=e.clientX,t.currentY=e.clientY;const o=hu(i),a=new Map([...t.captureTarget.querySelectorAll(oo)].map(P=>[P.dataset.channelId,P])),l=o.pinnedChannelIds.filter(P=>P!==t.channelId).flatMap(P=>{const N=a.get(P);if(N===void 0)return[];const D=N.getBoundingClientRect();return[{channelId:P,top:D.top,bottom:D.bottom}]}),c=t.captureTarget.querySelector('.channel-group[data-channel-side="pinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),u=t.captureTarget.querySelector('.channel-group[data-channel-side="unpinned"]:not([drag-collapsed]):not(.channel-group-withdrawal)'),f=t.captureTarget.querySelector(".channel-group:not(.channel-group-withdrawal) .channel-placeholder"),p=f==null?void 0:f.getBoundingClientRect(),y=f==null?void 0:f.dataset.channelSide,v=Number(f==null?void 0:f.dataset.channelIndex),S=t.captureTarget.getBoundingClientRect(),_=AN({source:t.source,current:o,pointer:{x:e.clientX,y:e.clientY},geometry:{sidebar:{left:S.left,right:S.right,top:S.top,bottom:S.bottom},pinnedRows:l,unpinnedGroupTop:(u==null?void 0:u.getBoundingClientRect().top)??t.originUnpinnedGroupTop,pinnedContentBottom:(c==null?void 0:c.getBoundingClientRect().bottom)??t.originPinnedContentBottom,placeholder:p!==void 0&&(y==="pinned"||y==="unpinned")&&Number.isInteger(v)?{side:y,index:v,top:p.top,bottom:p.bottom}:null}}),R=!LN(t.placement,_),H=R?h(this,x,k1).call(this,t):null;t.placement=_,(R||r)&&h(this,x,T1).call(this,t,H,!1),h(this,x,A1).call(this,t)},A1=function(t){const e=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),r=e?h(this,x,E1).call(this,e,t.currentY):0,i=e?Math.max(0,e.scrollHeight-e.clientHeight):0,o=r<0?((e==null?void 0:e.scrollTop)??0)<=Qb:((e==null?void 0:e.scrollTop)??0)>=i-Qb;if(s(this,cn)||t.completed||r===0||i===0||o||typeof requestAnimationFrame!="function"){h(this,x,cu).call(this,t);return}t.edgeScrollFrame===0&&(t.edgeScrollFrame=requestAnimationFrame(a=>{h(this,x,bA).call(this,t,a)}))},bA=function(t,e){if(t.edgeScrollFrame=0,s(this,cn)||s(this,be)!==t||t.completed){t.edgeScrollTimestamp=null;return}const r=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");if(r===null){t.edgeScrollTimestamp=null;return}const i=h(this,x,E1).call(this,r,t.currentY),o=t.edgeScrollTimestamp;if(t.edgeScrollTimestamp=e,i!==0&&o!==null){const a=Math.max(0,e-o)/1e3,l=Math.max(0,r.scrollHeight-r.clientHeight),c=r.scrollTop,u=i*a+t.edgeScrollRemainder,f=Math.max(0,Math.min(l,c+u));r.scrollTop=f;const p=r.scrollTop-c;if(t.edgeScrollRemainder=f===0||f===l?0:u-p,p!==0){r.toggleAttribute("continues-start",r.scrollTop>0),h(this,x,SA).call(this,t);return}}h(this,x,A1).call(this,t)},SA=function(t){h(this,x,lu).call(this,t,{clientX:t.currentX,clientY:t.currentY},!1)},cu=function(t){t.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(t.edgeScrollFrame),t.edgeScrollFrame=0,t.edgeScrollTimestamp=null,t.edgeScrollRemainder=0},E1=function(t,e){const r=t.getBoundingClientRect();return e>=r.top&&e<r.top+Dn?-vf*(r.top+Dn-e)/Dn:e>r.bottom-Dn&&e<=r.bottom?vf*(e-(r.bottom-Dn))/Dn:0},k1=function(t){var i;for(const o of t.displacementAnimations)o.cancel();t.displacementAnimations.clear();const e=new Map;for(const o of t.captureTarget.querySelectorAll(oo)){const a=o.dataset.channelId;if(a===void 0)continue;const l=o.getBoundingClientRect();e.set(a,{left:l.left,top:l.top})}const r=new Map;for(const o of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const a=o.dataset.channelSide;if(a!=="pinned"&&a!=="unpinned")continue;const l=o.getBoundingClientRect(),c=o.cloneNode(!0);for(const u of[c,...c.querySelectorAll("[id], [trigger]")])u.removeAttribute("id"),u.removeAttribute("trigger");(i=c.querySelector(".channel-row.dragged"))==null||i.remove(),c.classList.add("channel-group-withdrawal"),c.setAttribute("aria-hidden","true"),c.removeAttribute("drag-collapsed"),r.set(a,{left:l.left,top:l.top,width:l.width,height:o.hasAttribute("drag-collapsed")?0:l.height,withdrawal:c})}return{rows:e,groups:r}},T1=function(t,e,r){const i=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body"),o=(i==null?void 0:i.scrollTop)??0;s(this,zt).call(this),queueMicrotask(()=>{const a=t.captureTarget.querySelector(".sidebar-body, .channel-switcher-pop-body");a!==null&&(a.scrollTop=o),e!==null&&h(this,x,_A).call(this,t,e,r)})},_A=function(t,e,r){if(!(s(this,cn)||typeof HTMLElement.prototype.animate!="function"||matchMedia("(prefers-reduced-motion: reduce)").matches)){for(const i of t.captureTarget.querySelectorAll(oo)){const o=i.dataset.channelId;if(o===void 0||!r&&o===t.channelId)continue;const a=e.rows.get(o);if(a===void 0)continue;const l=i.getBoundingClientRect(),c=a.left-l.left,u=a.top-l.top;Math.hypot(c,u)<=jc||h(this,x,Zd).call(this,t,i.animate({translate:[`${c}px ${u}px`,"0px 0px"]},{duration:sl,easing:Sd}))}for(const i of t.captureTarget.querySelectorAll(".channel-group:not(.channel-group-withdrawal)")){const o=i.dataset.channelSide;if(o!=="pinned"&&o!=="unpinned")continue;const a=e.groups.get(o),l=i.getBoundingClientRect(),c=i.hasAttribute("drag-collapsed")?0:l.height;if(a!==void 0){if(a.height<=jc&&c>jc)h(this,x,Zd).call(this,t,i.animate([{opacity:0,translate:`0px -${c}px`},{opacity:1,translate:"0px 0px"}],{duration:sl,easing:Sd}));else if(a.height>jc&&c<=jc&&a.withdrawal.childElementCount>0){const u=a.withdrawal;u.style.left=`${a.left}px`,u.style.top=`${a.top}px`,u.style.width=`${a.width}px`,u.style.height=`${a.height}px`,t.captureTarget.append(u);const f=u.animate([{opacity:1,translate:"0px 0px"},{opacity:0,translate:`0px -${a.height}px`}],{duration:sl,easing:Sd});h(this,x,Zd).call(this,t,f),f.finished.finally(()=>u.remove()).catch(()=>{})}}}}},Zd=function(t,e){t.displacementAnimations.add(e),e.finished.finally(()=>{t.displacementAnimations.delete(e)}).catch(()=>{})},fh=new WeakMap,ph=new WeakMap,mh=new WeakMap,gh=new WeakMap,AA=function(t){const e=hu(t);s(this,be)!==null&&!s(this,be).completed&&!t8(s(this,be).source,e)&&h(this,x,qd).call(this),s(this,Me)!==null&&!t8(s(this,Me).source,e)&&d(this,Me,null)},C1=function(t){const e=s(this,be);if(t===null||e===null||!e.completed||!e.operationResolved||e.restorationQueued)return;if(e.operationRejected){h(this,x,Ud).call(this,e);return}const r=e.operation;r!==null&&yf(hu(t).pinnedChannelIds,r)&&h(this,x,Ud).call(this,e)},Ud=function(t){s(this,be)!==t||t.restorationQueued||(t.restorationQueued=!0,queueMicrotask(()=>{s(this,be)===t&&h(this,x,uu).call(this,t,!1)}))},qd=function(){d(this,Me,null);const t=s(this,be);t!==null&&h(this,x,uu).call(this,t,!0)},uu=function(t,e){if(s(this,be)!==t)return;h(this,x,cu).call(this,t);const r=h(this,x,k1).call(this,t);d(this,be,null),h(this,x,I1).call(this,t),e&&t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId),h(this,x,T1).call(this,t,r,!0)},R1=function(){d(this,Me,null);const t=s(this,be);if(d(this,be,null),t!==null){h(this,x,cu).call(this,t);for(const e of t.displacementAnimations)e.cancel();t.displacementAnimations.clear(),h(this,x,I1).call(this,t),t.captureTarget.hasPointerCapture(t.pointerId)&&t.captureTarget.releasePointerCapture(t.pointerId)}},I1=function(t){t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-x"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-y"),t.captureTarget.style.removeProperty("--channel-sidebar-drag-grip-correction-x")};function ON(n){const t=Math.max(0,n.wideRow.right-n.wideRow.left),e=Math.max(0,n.wideRow.bottom-n.wideRow.top),r=n8(n.pointer.x-n.wideRow.left,0,t),i=Math.min(r,Math.max(0,n.compactPreviewWidth-DN));return{wideOffsetX:r,previewOffsetX:i,correctionX:r-i,offsetY:n8(n.pointer.y-n.wideRow.top,0,e)}}function e8(n,t=hu(n)){var l,c;const e=new Map(n.channels.map(u=>[u.id,u])),r=t.pinnedChannelIds.flatMap(u=>{const f=e.get(u);return f===void 0?[]:[f]}),i=t.unpinnedChannelIds.flatMap(u=>{const f=e.get(u);return f===void 0?[]:[f]}),o=n.display.focusedChannelId,a=o!==null&&e.has(o)?o:((l=r[0])==null?void 0:l.id)??((c=i[0])==null?void 0:c.id)??null;return{pinned:r.map(u=>({channel:u,pinned:!0,selected:u.id===a})),unpinned:i.map(u=>({channel:u,pinned:!1,selected:u.id===a}))}}function hu(n){const t=new Set(n.channels.map(({id:o})=>o)),e=n.display.pinnedChannelIds.filter(o=>t.has(o)),r=new Set(e),i=n.channels.filter(({id:o})=>!r.has(o)).map(({id:o})=>o).sort((o,a)=>a.localeCompare(o));return{pinnedChannelIds:e,unpinnedChannelIds:i}}function t8(n,t){return yf(n.pinnedChannelIds,t.pinnedChannelIds)&&yf(n.unpinnedChannelIds,t.unpinnedChannelIds)}function yf(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function LN(n,t){var e,r,i,o;return n.kind!==t.kind?!1:n.kind==="invalidated"||t.kind==="invalidated"?!0:n.side===t.side&&((e=n.placeholder)==null?void 0:e.side)===((r=t.placeholder)==null?void 0:r.side)&&((i=n.placeholder)==null?void 0:i.index)===((o=t.placeholder)==null?void 0:o.index)&&n.operation===null==(t.operation===null)&&(n.operation===null||t.operation===null||yf(n.operation,t.operation))}function n8(n,t,e){return Math.max(t,Math.min(e,n))}var Wn,zf;class MN extends mn{constructor(){super(...arguments);m(this,Wn,new iA(()=>this.render()));m(this,zf,e=>{const r=e.currentTarget;r.toggleAttribute("continues-start",r.scrollTop>0)})}connected(){s(this,Wn).connect()}template(e,r,i,o,a,l=!1){return s(this,Wn).update(e,r,{management:!0,motionSuppressed:l}),V`
|
|
218
|
+
<nav class="sidebar" ?dragging=${s(this,Wn).dragging}>
|
|
219
|
+
<header
|
|
220
|
+
class="sidebar-titlebar"
|
|
221
|
+
?electron-draggable=${i}
|
|
222
|
+
>
|
|
223
|
+
<button
|
|
224
|
+
class="channel-create"
|
|
225
|
+
variant="ghost"
|
|
226
|
+
icon
|
|
227
|
+
aria-label="New channel"
|
|
228
|
+
title="New channel"
|
|
229
|
+
type="button"
|
|
230
|
+
?disabled=${s(this,Wn).creating}
|
|
231
|
+
@click=${s(this,Wn).create}
|
|
232
|
+
>
|
|
233
|
+
<tv-icon name="add"></tv-icon>
|
|
234
|
+
</button>
|
|
235
|
+
<span
|
|
236
|
+
class="toolbar-separator"
|
|
237
|
+
role="separator"
|
|
238
|
+
aria-orientation="vertical"
|
|
239
|
+
></span>
|
|
240
|
+
${a===void 0?V`
|
|
241
|
+
<button
|
|
242
|
+
class="sidebar-collapse"
|
|
243
|
+
variant="ghost"
|
|
244
|
+
icon
|
|
245
|
+
aria-label="Collapse sidebar"
|
|
246
|
+
title="Collapse sidebar"
|
|
247
|
+
type="button"
|
|
248
|
+
@click=${o}
|
|
249
|
+
>
|
|
250
|
+
<tv-icon name="sidebar" size="sm"></tv-icon>
|
|
251
|
+
</button>
|
|
252
|
+
`:a??V`
|
|
253
|
+
<span class="sidebar-toggle-seat" aria-hidden="true"></span>
|
|
254
|
+
`}
|
|
255
|
+
</header>
|
|
256
|
+
|
|
257
|
+
<div class="sidebar-body" @scroll=${s(this,zf)}>
|
|
258
|
+
${s(this,Wn).template()}
|
|
259
|
+
</div>
|
|
260
|
+
</nav>
|
|
261
|
+
${s(this,Wn).overlayTemplate()}
|
|
262
|
+
`}disconnected(){s(this,Wn).disconnect()}}Wn=new WeakMap,zf=new WeakMap;const NN=gn(MN),zN=1280,HN=800,r8=.4,i8=.4,EA=280,s8=180,ZN=14,UN=45,qN=16,o8=64,FN=90,VN=1,BN=24,jN=230,WN=230;function GN(n,t){const{expandedSidebarWidth:e,expandedToggleLeft:r,collapsedToggleLeft:i,toggleWidth:o,toggleSwitcherGap:a,collapsedLeadReservation:l,hasSwitcher:c}=t,u=e*(1-n),f=e-r,p=Math.max(u-f,i),y=i+f,v=Math.max(0,Math.min(o,u-p)),S=$1((u-y)/(e-y)),_=o+a,R=i+_,H=c?$1((R-u)/_):0;let P=n*l;if(l>e){const N=1-R/e,D=Math.min(1,n/N);P=n*e+D*(l-e)}return{sidebarBoundary:u,toggleLeft:p,toggleWipe:v,titlebarOpacity:S,switcherOpacity:H,leadReservation:P}}function JN(n,t,e,r){const i=r*Math.abs(t-n);if(i===0)return t;const a=1-(1-$1(e/i))**2;return n+(t-n)*a}function $1(n){return Math.max(0,Math.min(1,n))}var li,ms,ci,Nl,zl,Vo,Pi,Fd,x1;class YN{constructor(t){m(this,Pi);m(this,li,null);m(this,ms,0);m(this,ci);m(this,Nl);m(this,zl);m(this,Vo,1);d(this,ci,t),d(this,Nl,t),d(this,zl,t)}get boundary(){return h(this,Pi,Fd).call(this),s(this,ci)}move(t){const e=this.boundary;if(h(this,Pi,x1).call(this),d(this,Nl,e),d(this,zl,t.target),d(this,Vo,t.width),t.onFrame(e),matchMedia("(prefers-reduced-motion: reduce)").matches||Math.abs(t.target-e)<Number.EPSILON){d(this,ci,t.target),t.onFrame(t.target),t.onFinish(t.target);return}const r=Math.abs(t.target-e)/t.width,i=t.root.animate([{},{}],{duration:s8*r,easing:"linear"});i.id="sidebar-collapse-boundary",d(this,li,i);const o=()=>{if(s(this,li)===i){if(h(this,Pi,Fd).call(this),t.onFrame(s(this,ci)),i.playState==="finished"){d(this,li,null),d(this,ms,0),d(this,ci,t.target),t.onFrame(t.target),t.onFinish(t.target);return}d(this,ms,requestAnimationFrame(o))}};d(this,ms,requestAnimationFrame(o))}cancel(){h(this,Pi,Fd).call(this),h(this,Pi,x1).call(this)}}li=new WeakMap,ms=new WeakMap,ci=new WeakMap,Nl=new WeakMap,zl=new WeakMap,Vo=new WeakMap,Pi=new WeakSet,Fd=function(){const t=s(this,li);if(t===null)return;const e=JN(1-s(this,Nl)/s(this,Vo),1-s(this,zl)/s(this,Vo),Number(t.currentTime??0),s8);d(this,ci,s(this,Vo)*(1-e))},x1=function(){var t;cancelAnimationFrame(s(this,ms)),d(this,ms,0),(t=s(this,li))==null||t.cancel(),d(this,li,null)};const kA="television-active-theme",ty="tv-theme";let Xi=null,xi=null,Hs=null,Zs=null,Wi=null,a8=0,wf=0;function KN(n){const t=document.createElement("link"),e=new URL("/theme/theme.css",n);e.searchParams.set(ty,ny()),t.rel="stylesheet",t.href=e.toString(),t.dataset.televisionStyle=kA;const r=()=>{Xi===t&&document.dispatchEvent(new Event("television-theme-styles-changed"))};return t.addEventListener("load",r,{once:!0}),t.addEventListener("error",r,{once:!0}),Xi==null||Xi.remove(),document.head.append(t),Xi=t,t}function XN(){Xi&&(Xi.remove(),Xi=null,document.dispatchEvent(new Event("television-theme-styles-changed")))}function l8(n){const t=document.createElement("script"),e=new URL("/theme/main.js",n);return e.searchParams.set(ty,ny()),t.src=e.toString(),t.dataset.televisionScript=kA,xi==null||xi.remove(),document.head.append(t),xi=t,t}function QN(){xi==null||xi.remove(),xi=null}function e9(){return xi}async function t9(n,t,e){const r=TA();if(t===null)return;let i;try{i=await e()}catch{return}if(r!==wf)return;const o=i.themes.find(f=>f.id===t);if(o===void 0)return;const a=document.querySelector("#app"),l=document.querySelector("#foreground-overlay");if(a===null||l===null)return;const c=o.enableIframeBackgroundJS===!0?c8(n,"background"):null,u=o.enableIframeOverlayJS===!0?c8(n,"overlay"):null;r===wf&&(c!==null&&(a.before(c),Hs=c),u!==null&&(l.after(u),Zs=u))}function n9(){TA()}function TA(){return wf+=1,Hs==null||Hs.remove(),Zs==null||Zs.remove(),Hs=null,Zs=null,wf}function c8(n,t){const e=t==="background"?new URL("/theme/iframe-background.js",n):new URL("/theme/iframe-overlay.js",n);e.searchParams.set(ty,ny());const r=document.createElement("iframe");return r.id=t==="background"?"theme-iframe-background":"theme-iframe-overlay",r.setAttribute("sandbox","allow-scripts"),r.setAttribute("inert",""),r.setAttribute("tabindex","-1"),r.setAttribute("aria-hidden","true"),r.srcdoc=i9(e.toString(),r9()),r}function r9(){const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n}function i9(n,t){return`<!doctype html>
|
|
263
|
+
<html data-theme="${t}">
|
|
264
|
+
<head>
|
|
265
|
+
<meta charset="utf-8">
|
|
266
|
+
<style>
|
|
267
|
+
html, body {
|
|
268
|
+
width: 100%;
|
|
269
|
+
height: 100%;
|
|
270
|
+
margin: 0;
|
|
271
|
+
overflow: hidden;
|
|
272
|
+
background: transparent;
|
|
273
|
+
color-scheme: ${t};
|
|
274
|
+
}
|
|
275
|
+
</style>
|
|
276
|
+
</head>
|
|
277
|
+
<body>
|
|
278
|
+
<script src="${n}"><\/script>
|
|
279
|
+
</body>
|
|
280
|
+
</html>`}function CA(n){var o;let t,e=n.button,r=n.buttons;switch(n.eventType){case"pointermove":t="television-theme-pointer-move",e=-1;break;case"pointerdown":t="television-theme-pointer-down";break;case"pointerup":t="television-theme-pointer-up";break;case"pointercancel":t="television-theme-pointer-cancel",e=-1,r=0;break;case"click":t="television-theme-pointer-click",r=0;break}const i={type:t,clientX:n.clientX,clientY:n.clientY,button:e,buttons:r};for(const a of[Hs,Zs])(a==null?void 0:a.isConnected)===!0&&((o=a.contentWindow)==null||o.postMessage(i,"*"))}function nd(n){n.isTrusted&&CA({eventType:n.type,clientX:n.clientX,clientY:n.clientY,button:n.button,buttons:n.buttons})}document.addEventListener("pointermove",nd,{capture:!0});document.addEventListener("pointerdown",nd,{capture:!0});document.addEventListener("pointerup",nd,{capture:!0});document.addEventListener("pointercancel",nd,{capture:!0});document.addEventListener("click",nd,{capture:!0});function RA(n){if(n!==Hs&&n!==Zs)return!1;const e=((Wi==null?void 0:Wi.isConnected)===!0&&Wi!==Hs&&Wi!==Zs&&Wi.closest("#foreground-overlay")===null?Wi:null)??document.querySelector("#app");return e==null||e.focus({preventScroll:!0}),!0}document.addEventListener("focusin",n=>{const t=n.target;t instanceof HTMLElement&&(RA(t)||t.isConnected&&t.closest("#foreground-overlay")===null&&(Wi=t))},{capture:!0});window.addEventListener("blur",()=>{queueMicrotask(()=>RA(document.activeElement))},{capture:!0});function ny(){return a8+=1,`${Date.now()}-${a8}`}const s9=404,o9="/views/url-unsupported/",a9="allow-scripts allow-forms allow-modals allow-popups allow-popups-to-escape-sandbox allow-downloads",l9="clipboard-write; fullscreen; autoplay; picture-in-picture; web-share; encrypted-media",c9="tv-artifact:",u9="tv-url-artifact";function Vd(n){const t=$u(n.artifact,{electron:n.electron,browserDemo:n.browserDemo??!1});let e;if(t.renderer==="url-direct")e=t;else if(n.currentURL===null){const r=n.viewURL??t.viewURL;t.renderer==="markdown"?e={renderer:"markdown",viewURL:r,contentURL:n.contentURL??t.contentURL}:t.renderer==="url-webview"&&t.contentURL!==null?e={renderer:"url-webview",viewURL:r,contentURL:n.contentURL??t.contentURL}:e={...t,viewURL:r}}else u8(n.currentURL)&&!n.electron?e=Kr(n.currentURL)?{renderer:"proxy-iframe",viewURL:n.currentURL,contentURL:null}:{renderer:"proxy-iframe",viewURL:o9,contentURL:null}:u8(n.currentURL)?e={renderer:"url-webview",viewURL:n.currentURL,contentURL:null}:e={renderer:n.electron?"url-webview":"proxy-iframe",viewURL:m9(n.currentURL,n.viewURL),contentURL:null};return n.frameSrcOverride?{...e,viewURL:n.frameSrcOverride}:e}var ct,un,Hl,Bo,jo,Gn,Wo,Zl,Vt,Ul,ql,_r,gs,vs,Go,te,P1,IA,Bd,$A,xA,D1,PA,Ar,jd,du,O1,DA,L1,M1,lo;class h9 extends mn{constructor(){super(...arguments);m(this,te);m(this,ct,null);m(this,un,null);m(this,Hl,"");m(this,Bo,()=>{});m(this,jo,()=>{});m(this,Gn,null);m(this,Wo,null);m(this,Zl,null);m(this,Vt,null);m(this,Ul,null);m(this,ql,null);m(this,_r,null);m(this,gs,null);m(this,vs,null);m(this,Go,null);m(this,Ar,()=>{!s(this,un)||s(this,un)!==s(this,Gn)||s(this,Bo).call(this,!0)})}get currentFrame(){return s(this,un)}connected(){h(this,te,jd).call(this),h(this,te,O1).call(this)}disconnected(){h(this,te,du).call(this),h(this,te,lo).call(this)}template(e,r,i=()=>{}){return d(this,Bo,r),d(this,jo,i),e(this),s(this,Hl)}assignSource(e){const r=s(this,ct),i=r?!g9(r.artifact,e.artifact):!0;((r==null?void 0:r.artifact.id)!==e.artifact.id||(r==null?void 0:r.artifact.kind)==="path"&&e.artifact.kind==="path"&&r.artifact.path!==e.artifact.path)&&d(this,Go,null),i&&(d(this,_r,null),s(this,Vt)&&(s(this,Vt).content=""),d(this,gs,null),d(this,vs,null)),d(this,ct,e),h(this,te,Bd).call(this)}handleArtifactContentChanged(e){const r=s(this,ct);return e!==(r==null?void 0:r.artifact.id)||!s(this,Vt)&&!h(this,te,M1).call(this)?!1:(h(this,te,L1).call(this),!0)}handleThemeChanged(){var r;const e=(r=s(this,ct))==null?void 0:r.artifact;return(e==null?void 0:e.kind)!=="path"||!qg(e.path)||s(this,Vt)===null?!1:(s(this,Vt).notifyStylesChanged(),!0)}refreshFrameLoadState(){h(this,te,jd).call(this)}assignFrameSrc(e){s(this,un)&&h(this,te,P1).call(this,s(this,un),e)}}ct=new WeakMap,un=new WeakMap,Hl=new WeakMap,Bo=new WeakMap,jo=new WeakMap,Gn=new WeakMap,Wo=new WeakMap,Zl=new WeakMap,Vt=new WeakMap,Ul=new WeakMap,ql=new WeakMap,_r=new WeakMap,gs=new WeakMap,vs=new WeakMap,Go=new WeakMap,te=new WeakSet,P1=function(e,r){e.tagName.toLowerCase()==="iframe"&&(!h(this,te,IA).call(this)&&p9(r)?e.setAttribute("sandbox",a9):e.removeAttribute("sandbox")),e.setAttribute("src",r)},IA=function(){const e=s(this,ct);return e!==null&&$u(e.artifact,{electron:e.electron,browserDemo:e.browserDemo??!1}).renderer==="url-direct"},Bd=function(){const e=s(this,ct);if(!e)return;if(e.artifact.kind==="path"&&h(this,te,M1).call(this)){h(this,te,PA).call(this,e.artifact);return}const r=Vd(e),i=h(this,te,$A).call(this,r.renderer,f9(e));h(this,te,xA).call(this,i,r),h(this,te,D1).call(this,i),h(this,te,jd).call(this),h(this,te,O1).call(this)},$A=function(e,r){const i=e==="url-webview"?"webview":"iframe",o=s(this,un);if((o==null?void 0:o.tagName.toLowerCase())===i&&(i!=="webview"||o.getAttribute("partition")===r))return o;h(this,te,du).call(this),h(this,te,lo).call(this);const a=document.createElement(i);return a.className="artifact-content",i==="webview"?(r!==null&&a.setAttribute("partition",r),a.setAttribute("allowpopups","")):a.setAttribute("allow",l9),d(this,un,a),a},xA=function(e,r){e.getAttribute("src")!==r.viewURL&&(s(this,jo).call(this,null),s(this,jo).call(this,e),h(this,te,P1).call(this,e,r.viewURL)),r.contentURL===null?delete e.dataset.contentUrl:e.dataset.contentUrl=r.contentURL},D1=function(e){s(this,Hl)!==e&&(d(this,Hl,e),this.render(e))},PA=function(e){s(this,jo).call(this,null),h(this,te,du).call(this),h(this,te,lo).call(this),d(this,un,null),s(this,Bo).call(this,!1),h(this,te,D1).call(this,V`
|
|
281
|
+
<section class="artifact-missing artifact-content" role="status" aria-label="Artifact file not found">
|
|
282
|
+
<div class="artifact-missing-wrapper">
|
|
283
|
+
<h1>${_E()}</h1>
|
|
284
|
+
<p>${AE()}</p>
|
|
285
|
+
<section class="artifact-missing-path" aria-label="Missing artifact path">
|
|
286
|
+
<p class="artifact-missing-path-label">Registered path:</p>
|
|
287
|
+
<p><code>${e.path}</code></p>
|
|
288
|
+
</section>
|
|
289
|
+
<p>${EE()}</p>
|
|
290
|
+
</div>
|
|
291
|
+
</section>
|
|
292
|
+
`)},Ar=new WeakMap,jd=function(){var o;const e=s(this,un),r=e?`${e.tagName.toLowerCase()}:${e.getAttribute("src")??""}:${e.dataset.contentUrl??""}`:null;if(e&&e===s(this,Gn)&&r===s(this,Wo)||(h(this,te,du).call(this),s(this,Bo).call(this,!1),!e||!r||!this.isConnected))return;if(d(this,Gn,e),d(this,Wo,r),e.tagName.toLowerCase()==="webview"){e.addEventListener("did-finish-load",s(this,Ar)),e.addEventListener("did-fail-load",s(this,Ar));return}e.addEventListener("load",s(this,Ar));const i=e;try{i.isConnected&&((o=i.contentDocument)==null?void 0:o.readyState)==="complete"&&s(this,Ar).call(this)}catch{}},du=function(){if(!s(this,Gn)){d(this,Wo,null);return}s(this,Gn).removeEventListener("load",s(this,Ar)),s(this,Gn).removeEventListener("did-finish-load",s(this,Ar)),s(this,Gn).removeEventListener("did-fail-load",s(this,Ar)),d(this,Gn,null),d(this,Wo,null)},O1=function(){const e=s(this,ct),r=s(this,un),i=(r==null?void 0:r.dataset.contentUrl)??null,o=(e==null?void 0:e.artifact.id)??null;if(!e||!r||!i||!o){h(this,te,lo).call(this,{clearContent:!0});return}if(r!==s(this,Zl)||o!==s(this,ql)){h(this,te,lo).call(this),d(this,Zl,r),d(this,Ul,i),d(this,ql,o);const a=r.tagName.toLowerCase()==="webview"?new nL(r):new tL(r);d(this,Vt,a),a.handleUpdateContent(async l=>{const c=s(this,ct),u=c==null?void 0:c.application;if(!c||!u)throw new Error("No markdown artifact selected");await u.writeMarkdown(c.artifact.id,l),d(this,_r,l),s(this,Vt)===a&&(a.content=l)}),s(this,_r)!==null&&(a.content=s(this,_r))}else d(this,Ul,i);h(this,te,DA).call(this)},DA=function(){const e=s(this,ct),r=e==null?void 0:e.application;!e||!r||!s(this,Vt)||s(this,gs)===e.artifact.id&&s(this,vs)===r||(d(this,gs,e.artifact.id),d(this,vs,r),h(this,te,L1).call(this))},L1=async function(){var o,a;const e=s(this,ct),r=e==null?void 0:e.application;if(!e||!r)return;const i=e.artifact.id;try{const l=await r.readMarkdown(i);if(((o=s(this,ct))==null?void 0:o.artifact.id)!==i||s(this,ct).application!==r)return;d(this,Go,null),d(this,_r,l);const c=s(this,Vt);if(!c){h(this,te,Bd).call(this);return}c.content=l}catch(l){if(((a=s(this,ct))==null?void 0:a.artifact.id)!==i||s(this,ct).application!==r)return;if(l instanceof Cc&&l.status===s9){d(this,Go,i),d(this,_r,null),h(this,te,lo).call(this),h(this,te,Bd).call(this);return}d(this,gs,null),d(this,vs,null)}},M1=function(){var r;const e=(r=s(this,ct))==null?void 0:r.artifact;return s(this,Go)===(e==null?void 0:e.id)&&e.kind==="path"&&qg(e.path)},lo=function(e={}){var r;(r=s(this,Vt))==null||r.dispose(),d(this,Vt,null),d(this,Zl,null),d(this,Ul,null),d(this,ql,null),d(this,gs,null),d(this,vs,null),e.clearContent&&d(this,_r,null)};const d9=gn(h9);function f9(n){const t=globalThis.__televisionNativeBridge;return!n.electron||(t==null?void 0:t.artifactPartitions)!==1?null:n.artifact.kind==="path"?`${c9}${n.artifact.id}`:u9}function u8(n){return n.startsWith("http://")||n.startsWith("https://")}function p9(n){try{return/^\/artifact\/[^/]+(\/|$)/.test(new URL(n,window.location.href).pathname)}catch{return!1}}function m9(n,t){if(!n.startsWith("/")||!t)return n;try{return new URL(n,t).toString()}catch{return n}}function g9(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?n.url===t.url:!0}var vh,Fl,yh,Er,ui,ys,hi,ws,wh,bh,Lt,OA,Sh,_h,N1,Wd,Gd;class v9{constructor(t,e=()=>{},r=()=>{}){m(this,Lt);m(this,vh);m(this,Fl);m(this,yh);m(this,Er,null);m(this,ui,null);m(this,ys,null);m(this,hi,null);m(this,ws,!1);m(this,wh,t=>{const e=f8(t.data);if(!e)return;const r=s(this,ys);if(!r||r.tagName.toLowerCase()!=="iframe"||!r.isConnected)return;const i=r,o=i.contentWindow;if(o===null)return;const a=e.type==="leaving",l=e.type==="navigation-request"&&e.native===!0&&e.sameDocument!==!0,c=o===t.source,u=(a||l)&&s(this,ui)!==null&&s(this,ui)===t.source,f=a&&S9(i)===t.origin;!c&&!u&&!f||h(this,Lt,N1).call(this,e,i,{send:p=>{var y;return(y=i.contentWindow)==null?void 0:y.postMessage(p,"*")}})});m(this,bh,t=>{var o,a;const e=t.detail??t;if((e==null?void 0:e.channel)===y9){h(this,Lt,OA).call(this,(o=e.args)==null?void 0:o[0]);return}if(!e||e.channel!==h8)return;const r=f8((a=e.args)==null?void 0:a[0]),i=s(this,hi);!r||!i||h(this,Lt,N1).call(this,r,i,{send:l=>{var c;return(c=i.send)==null?void 0:c.call(i,h8,l)}})});m(this,Sh,t=>{const e=p8(t);e.isMainFrame===!0&&e.isInPlace!==!0&&this.reset()});m(this,_h,t=>{p8(t).isMainFrame!==!1&&this.reset()});d(this,vh,t),d(this,Fl,e),d(this,yh,r)}get currentGuid(){return s(this,Er)}get lifecycleWindow(){return s(this,ui)}get trustState(){return{currentGuid:s(this,Er),lifecycleWindow:s(this,ui)}}connect(){s(this,ws)||(d(this,ws,!0),window.addEventListener("message",s(this,wh)),h(this,Lt,Wd).call(this))}disconnect(){s(this,ws)&&(window.removeEventListener("message",s(this,wh)),d(this,ws,!1),h(this,Lt,Gd).call(this))}reset(){d(this,Er,null),d(this,ui,null),s(this,Fl).call(this)}setCurrentFrame(t){if(t===s(this,ys)){h(this,Lt,Wd).call(this);return}h(this,Lt,Gd).call(this),s(this,ys)!==null&&this.reset(),d(this,ys,b9(t)?t:null),h(this,Lt,Wd).call(this)}}vh=new WeakMap,Fl=new WeakMap,yh=new WeakMap,Er=new WeakMap,ui=new WeakMap,ys=new WeakMap,hi=new WeakMap,ws=new WeakMap,wh=new WeakMap,bh=new WeakMap,Lt=new WeakSet,OA=function(t){const e=s(this,hi);!e||typeof t!="string"||!w9(e)||s(this,yh).call(this,t)},Sh=new WeakMap,_h=new WeakMap,N1=function(t,e,r){t.type==="bridge-ready"&&t.guid!==s(this,Er)?(s(this,Er)!==null&&s(this,Fl).call(this),d(this,Er,t.guid),d(this,ui,e.tagName.toLowerCase()==="iframe"?e.contentWindow:null)):t.type==="leaving"&&t.guid===s(this,Er)&&this.reset(),s(this,vh).call(this,t,r)},Wd=function(){if(!s(this,ws))return;const t=s(this,ys),e=(t==null?void 0:t.tagName.toLowerCase())==="webview"?t:null;e!==s(this,hi)&&(h(this,Lt,Gd).call(this),e&&(e.addEventListener("ipc-message",s(this,bh)),e.addEventListener("did-start-navigation",s(this,Sh)),e.addEventListener("did-fail-load",s(this,_h)),d(this,hi,e)))},Gd=function(){const t=s(this,hi);t&&(t.removeEventListener("ipc-message",s(this,bh)),t.removeEventListener("did-start-navigation",s(this,Sh)),t.removeEventListener("did-fail-load",s(this,_h)),d(this,hi,null))};const h8="television-artifact-bridge",y9="television-application-link";function d8(n){return n.protocol==="http:"||n.protocol==="https:"}function w9(n){var e;const t=window.location;if(!d8(t))return!1;try{const r=new URL(((e=n.getURL)==null?void 0:e.call(n))??"");return d8(r)&&r.origin===t.origin}catch{return!1}}function f8(n){return hE(n)||dE(n)||fE(n)||pE(n)||mE(n)||gE(n)||vE(n)||yE(n)?n:null}function b9(n){if(!n)return!1;const t=n.tagName.toLowerCase();return t==="iframe"||t==="webview"}function S9(n){if(n.hasAttribute("sandbox"))return"null";try{return new URL(n.getAttribute("src")??n.src,window.location.href).origin}catch{return null}}function p8(n){return n.detail??n}const _9="/views/url-unsupported/";class A9 extends mn{constructor(){super(...arguments);I(this,"_artifact",null);I(this,"_viewURL",null);I(this,"_contentURL",null);I(this,"_application",null);I(this,"_fullScreen",!1);I(this,"_inert",!1);I(this,"_onFullScreenChange",()=>{});I(this,"_connected",!1);I(this,"_deleteConfirmationOpen",!1);I(this,"_dialogPresentation",null);I(this,"_subscribedWebview",null);I(this,"_documentHost",null);I(this,"_pendingDocumentSource",null);I(this,"_rootRef",er());I(this,"_trustedChannel",new v9((e,r)=>{this.handleTrustedFrameMessage(e,r)},()=>{this._missingArtifactReplyTransport=null},e=>T9(e)));I(this,"_activeReloadFrameSrc",null);I(this,"_applicationSubscriptionsAttached",!1);I(this,"_proxyReloadVersion",0);I(this,"_navigationState",null);I(this,"_navigationArtifactId",null);I(this,"_navigationCanonicalURL",null);I(this,"_preserveFrameSrcOnNavigationRender",!1);I(this,"_missingArtifactReplyTransport",null);I(this,"handleNavigationChange",()=>{const e=this._preserveFrameSrcOnNavigationRender,r=!e;r&&!Ri()?(this.renderArtifact({preserveFrameSrc:!0}),this.forceCurrentFrameSrc()):this.renderArtifact({preserveFrameSrc:e,resetTrust:r}),this._preserveFrameSrcOnNavigationRender=!1});I(this,"handleArtifactContentChanged",e=>{var o;const r=e.artifactID,i=this._artifact;!i||r!==i.id||i.kind!=="path"||typeof r=="string"&&((o=this._documentHost)!=null&&o.handleArtifactContentChanged(r))||this.reloadProxyFrame()});I(this,"handleThemeChanged",()=>{var e,r;((e=this._artifact)==null?void 0:e.kind)==="url"&&Kr(this._artifact.url)||this.isDemoPage()||(r=this._documentHost)!=null&&r.handleThemeChanged()||this.reloadProxyFrame()});I(this,"handleWebviewDidNavigate",e=>{this.handleWebviewNavigationEvent(e)});I(this,"handleWebviewDidNavigateInPage",e=>{if(e.isMainFrame===!1)return;this._preserveFrameSrcOnNavigationRender=!0,this.handleWebviewNavigationEvent(e)||(this._preserveFrameSrcOnNavigationRender=!1)});I(this,"captureDocumentHost",e=>{this._documentHost=e,this._pendingDocumentSource&&(e.assignSource(this._pendingDocumentSource),this.syncFrameSubscriptions())});I(this,"handleEmbedLoadChange",e=>{var r;(r=this._rootRef.value)==null||r.toggleAttribute("data-embed-loaded",e)});I(this,"handleDocumentFrameChange",e=>{e===null&&this.resetTrustedFrame(),this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(this.bridgeFrame(e)),this.syncWebviewSubscription(e)});I(this,"handleTitleBarDoubleClick",e=>{const r=e.target;r instanceof Element&&r.closest("button")||this.requestFullScreen(!this._fullScreen)})}update(e,r){var u;const[i,o,a]=r;let l=!1;this._application!==i&&(this.detachApplicationSubscriptions(),this._application=i,this.attachApplicationSubscriptions(),this._connected&&(this.assignDocumentSource({preserveFrameSrc:!0}),l=!0));const c=this._artifact;if(c!==o){const f=c?!C9(c,o):!0;if(f&&(this._activeReloadFrameSrc=null),this._artifact=o,this.syncNavigationState(),this._connected){if(this.renderArtifact({resetTrust:f}),l=!0,c&&R9(c,o)){const p=this.currentMissingArtifactMessage();p&&((u=this._missingArtifactReplyTransport)==null||u.send(p))}}else f&&this.resetTrustedFrame()}return this._viewURL!==a.viewURL&&(this._viewURL=a.viewURL,this.syncNavigationState(),this._connected?(this.renderArtifact({resetTrust:!0}),l=!0):this._trustedChannel.reset()),this._contentURL!==a.contentURL&&(this._contentURL=a.contentURL,this._connected&&(this.renderArtifact(),l=!0)),this._fullScreen!==a.fullScreen&&(this._fullScreen=a.fullScreen,this._connected&&this._artifact&&(this.renderArtifact({preserveFrameSrc:!0}),l=!0)),this._inert=a.inert,this._onFullScreenChange=a.onFullScreenChange,this._connected&&!l&&this.renderArtifact({preserveFrameSrc:!0}),super.update(e,r)}attachApplicationSubscriptions(){!this._application||this._applicationSubscriptionsAttached||(this._application.addEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.addEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!0)}detachApplicationSubscriptions(){!this._application||!this._applicationSubscriptionsAttached||(this._application.removeEventListener("artifact-content-changed",this.handleArtifactContentChanged),this._application.removeEventListener("theme-changed",this.handleThemeChanged),this._applicationSubscriptionsAttached=!1)}get activeView(){return null}connected(){this._connected=!0,this._trustedChannel.connect(),this.attachApplicationSubscriptions(),this.resetTrustedFrame(),this.syncNavigationState(),this.renderArtifact(),this.syncFrameSubscriptions()}disconnected(){var e;this._connected=!1,(e=this._dialogPresentation)==null||e.withdraw(),this._dialogPresentation=null,this._deleteConfirmationOpen=!1,this.resetTrustedFrame(),this._trustedChannel.disconnect(),this.unsubscribeFromWebview(),this.syncNavigationState(),this.detachApplicationSubscriptions()}handleTrustedFrameMessage(e,r){var i;switch(e.type){case"url-target-request":r.send({type:wE,url:this.currentExternalTargetURL()});return;case"artifact-missing-request":{const o=this.currentMissingArtifactMessage();o&&(this._missingArtifactReplyTransport=r,r.send(o));return}case"proxy-content-changed":this.handleProxyContentChanged();return;case"navigation-request":this.handleNavigationRequest(e);return;case"navigation-key":(i=this._application)==null||i.handleNavigationKey(e.key);return;case"artifact-pointer":this.handleArtifactPointer(e);return;case"bridge-ready":case"leaving":return}}handleArtifactPointer(e){const r=this.currentFrame;if(r===null||r.clientWidth<=0||r.clientHeight<=0)return;const i=r.getBoundingClientRect();CA({eventType:e.eventType,clientX:i.left+e.clientX*i.width/r.clientWidth,clientY:i.top+e.clientY*i.height/r.clientHeight,button:e.button,buttons:e.buttons})}currentExternalTargetURL(){var r,i;const e=((r=this._navigationState)==null?void 0:r.currentURL)??null;return e&&k9(e)?e:((i=this._artifact)==null?void 0:i.kind)==="url"?this._artifact.url:null}currentMissingArtifactMessage(){const e=this._artifact;return(e==null?void 0:e.kind)!=="path"?null:{type:bE,title:e.title,path:e.path}}handleProxyContentChanged(){var e;((e=this._artifact)==null?void 0:e.kind)!=="url"||!Kr(this._artifact.url)||this.reloadProxyFrame()}handleNavigationRequest(e){if(!Ib(e.url,window.location.href))return;this.syncNavigationState();const r=this._navigationState;if(!r)return;const i=this.convertIframeNavigationURL(e.url);if(i===_9||i===r.currentURL)return;const o=e.native===!0;(e.sameDocument||o)&&(this._preserveFrameSrcOnNavigationRender=!0),e.replace?r.replace(i):r.navigate(i),this._preserveFrameSrcOnNavigationRender=!1}syncNavigationState(){if(!this._connected||!this._artifact||this.isDemoPage()){this.disposeNavigationState();return}const e=this.canonicalURLForArtifact(this._artifact);this._navigationState&&this._navigationArtifactId===this._artifact.id&&this._navigationCanonicalURL===e||(this.disposeNavigationState(),this._navigationState=new PO(this._artifact.id,e),this._navigationArtifactId=this._artifact.id,this._navigationCanonicalURL=e,this._navigationState.addEventListener("change",this.handleNavigationChange),this._navigationState.currentURL!==null?this.renderArtifact():this._navigationState.canGoForward&&this.renderArtifact({preserveFrameSrc:!0}))}disposeNavigationState(){var e;(e=this._navigationState)==null||e.removeEventListener("change",this.handleNavigationChange),this._navigationState=null,this._navigationArtifactId=null,this._navigationCanonicalURL=null,this._preserveFrameSrcOnNavigationRender=!1}canonicalURLForArtifact(e){const r=Vd({artifact:e,application:this._application,electron:Ri(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:null}),i=r.viewURL;return e.kind==="url"&&Kr(e.url)||r.renderer==="url-webview"?$i(i):m8(i,i)}convertIframeNavigationURL(e){var r;return((r=this._artifact)==null?void 0:r.kind)==="url"&&Kr(this._artifact.url)&&Kr(e)?$i(e):m8(e,this._viewURL??this._navigationCanonicalURL??null)}handleWebviewNavigationEvent(e){const r=e.url;if(typeof r!="string"||!Ib(r,window.location.href))return!1;this.syncNavigationState();const i=this._navigationState;if(!i)return!1;const o=$i(r);return o===i.currentURL?!1:(i.navigate(o),!0)}syncWebviewSubscription(e=this.currentFrame){const r=(e==null?void 0:e.tagName.toLowerCase())==="webview"?e:null;r!==this._subscribedWebview&&(this.unsubscribeFromWebview(),r&&(r.addEventListener("did-navigate",this.handleWebviewDidNavigate),r.addEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=r))}unsubscribeFromWebview(){this._subscribedWebview&&(this._subscribedWebview.removeEventListener("did-navigate",this.handleWebviewDidNavigate),this._subscribedWebview.removeEventListener("did-navigate-in-page",this.handleWebviewDidNavigateInPage),this._subscribedWebview=null)}get currentFrame(){var e;return((e=this._documentHost)==null?void 0:e.currentFrame)??null}syncFrameSubscriptions(){const e=this.currentFrame;this.syncFrameTitle(e),this._trustedChannel.setCurrentFrame(this.bridgeFrame(e)),this.syncWebviewSubscription(e)}bridgeFrame(e){return this.isDemoPage()?null:e}get browserDemo(){var e;return((e=this._application)==null?void 0:e.browserDemoMode)===!0}isDemoPage(){const e=this._artifact;return e?$u(e,{electron:Ri(),browserDemo:this.browserDemo}).renderer==="url-direct":!1}returnToOriginalPage(){var i,o,a;const e=this._artifact,r=this.currentFrame;(e==null?void 0:e.kind)!=="url"||(r==null?void 0:r.tagName.toLowerCase())!=="iframe"||((i=this._rootRef.value)==null||i.removeAttribute("data-embed-loaded"),(o=this._documentHost)==null||o.assignFrameSrc(e.url),(a=this._documentHost)==null||a.refreshFrameLoadState())}syncFrameTitle(e){e&&this._artifact&&e.getAttribute("title")!==this._artifact.title&&e.setAttribute("title",this._artifact.title)}resetTrustedFrame(){this._missingArtifactReplyTransport=null,this._trustedChannel.reset()}assignDocumentSource(e={}){var f,p,y;const r=this._artifact;if(!r)return;e.resetTrust&&this.resetTrustedFrame();const i={artifact:r,application:this._application,electron:Ri(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((f=this._navigationState)==null?void 0:f.currentURL)??null},o=Vd(i),a=(p=this.currentFrame)==null?void 0:p.getAttribute("src");let l=null;this._activeReloadFrameSrc&&(LA(this._activeReloadFrameSrc,o.viewURL)?l=this._activeReloadFrameSrc:this._activeReloadFrameSrc=null);const c=e.frameSrcOverride??l??(e.preserveFrameSrc&&a?a:o.viewURL),u={...i,frameSrcOverride:c};this._pendingDocumentSource=u,(y=this._documentHost)==null||y.assignSource(u),this.syncFrameSubscriptions()}reloadProxyFrame(){var a,l,c,u,f;const e=this.currentFrame;if(!e||e.hasAttribute("data-content-url")||e.tagName.toLowerCase()==="webview"&&!(((a=this._artifact)==null?void 0:a.kind)==="path"||((l=this._artifact)==null?void 0:l.kind)==="url"&&Kr(this._artifact.url)))return;const r=((c=this._artifact)==null?void 0:c.kind)==="url"&&Kr(this._artifact.url)?((u=this._navigationState)==null?void 0:u.currentURL)??e.getAttribute("src"):e.getAttribute("src");if(r===null)return;const i=new URL(r,window.location.href);i.searchParams.set(yc,String(++this._proxyReloadVersion));const o=r.startsWith("/")?`${i.pathname}${i.search}${i.hash}`:i.href;this._activeReloadFrameSrc=o,(f=this._rootRef.value)==null||f.removeAttribute("data-embed-loaded"),this.renderArtifact({frameSrcOverride:o,resetTrust:!0})}forceCurrentFrameSrc(){var o,a,l,c;if(!this._artifact)return;const e=Vd({artifact:this._artifact,application:this._application,electron:Ri(),browserDemo:this.browserDemo,viewURL:this._viewURL,contentURL:this._contentURL,currentURL:((o=this._navigationState)==null?void 0:o.currentURL)??null});if(e.renderer==="url-webview")return;const r=this.currentFrame;(r==null?void 0:r.tagName.toLowerCase())==="iframe"&&r&&(this.resetTrustedFrame(),this._activeReloadFrameSrc=null,(a=this._rootRef.value)==null||a.removeAttribute("data-embed-loaded"),(l=this._documentHost)==null||l.assignFrameSrc(e.viewURL),(c=this._documentHost)==null||c.refreshFrameLoadState())}menuEntries(){return[{label:this._fullScreen?"Exit full-screen":"Make full-screen",action:()=>this.requestFullScreen(!this._fullScreen)},{separator:!0},{label:"Delete",destructive:!0,action:()=>this.showDeleteConfirmation()}]}closeMenu(){var i;const e=this._rootRef.value,r=e==null?void 0:e.querySelector(".artifact-menu-trigger");r&&((i=e==null?void 0:e.ownerDocument.querySelector(`tv-menu[trigger="${r.id}"]`))==null||i.removeAttribute("open"))}requestFullScreen(e){this.closeMenu(),this._onFullScreenChange(e)}showDeleteConfirmation(){var r,i,o;if(this._deleteConfirmationOpen)return;this.closeMenu(),this._deleteConfirmationOpen=!0,this.renderArtifact({preserveFrameSrc:!0});const e=(r=this._rootRef.value)==null?void 0:r.querySelector("dialog");e&&(this._dialogPresentation=zp(e,()=>this.dismissDeleteConfirmation()),(o=(i=this._rootRef.value)==null?void 0:i.querySelector(".dialog-actions button"))==null||o.focus())}dismissDeleteConfirmation(){const e=this._dialogPresentation;this._dialogPresentation=null,this._deleteConfirmationOpen=!1,e==null||e.withdraw(),this.isConnected&&this._artifact&&this.renderArtifact({preserveFrameSrc:!0})}confirmDelete(){var i;const e=(i=this._artifact)==null?void 0:i.id,r=this._application;this.dismissDeleteConfirmation(),!(!e||!r)&&r.deleteArtifact(e).catch(()=>{})}artifactIconTemplate(){return this.isDemoPage()?V`
|
|
293
|
+
<button
|
|
294
|
+
icon
|
|
295
|
+
size="sm"
|
|
296
|
+
variant="ghost"
|
|
297
|
+
class="artifact-return"
|
|
298
|
+
@click=${()=>this.returnToOriginalPage()}
|
|
299
|
+
aria-label="Return to the original page"
|
|
300
|
+
>
|
|
301
|
+
<tv-icon name="artifact"></tv-icon>
|
|
302
|
+
</button>
|
|
303
|
+
`:V`<tv-icon name="artifact"></tv-icon>`}navigationControlsTemplate(){const e=this._navigationState;return!e||!e.canGoBack&&!e.canGoForward?null:V`
|
|
304
|
+
<button
|
|
305
|
+
icon
|
|
306
|
+
size="sm"
|
|
307
|
+
variant="ghost"
|
|
308
|
+
class="artifact-back"
|
|
309
|
+
?disabled=${!e.canGoBack}
|
|
310
|
+
@click=${()=>e.back()}
|
|
311
|
+
aria-label="Back"
|
|
312
|
+
>
|
|
313
|
+
<tv-icon name="back" size="sm"></tv-icon>
|
|
314
|
+
</button>
|
|
315
|
+
<button
|
|
316
|
+
icon
|
|
317
|
+
size="sm"
|
|
318
|
+
variant="ghost"
|
|
319
|
+
class="artifact-forward"
|
|
320
|
+
?disabled=${!e.canGoForward}
|
|
321
|
+
@click=${()=>e.forward()}
|
|
322
|
+
aria-label="Forward"
|
|
323
|
+
>
|
|
324
|
+
<tv-icon name="forward" size="sm"></tv-icon>
|
|
325
|
+
</button>
|
|
326
|
+
<span class="artifact-bar-divider" aria-hidden="true"></span>
|
|
327
|
+
`}deleteConfirmationTemplate(){return!this._deleteConfirmationOpen||!this._artifact?null:Np(V`
|
|
328
|
+
<div class="dialog-alert" role="alertdialog">
|
|
329
|
+
<h2>Delete “${this._artifact.title}”?</h2>
|
|
330
|
+
<p>It’s removed from this channel; the file or web page it points to is not deleted.</p>
|
|
331
|
+
<div class="dialog-actions">
|
|
332
|
+
<button @click=${()=>this.dismissDeleteConfirmation()}>Cancel</button>
|
|
333
|
+
<button intent="danger" @click=${()=>this.confirmDelete()}>Delete</button>
|
|
334
|
+
</div>
|
|
335
|
+
</div>
|
|
336
|
+
`)}template(e,r,i){const o=this._artifact;return V`
|
|
337
|
+
<div
|
|
338
|
+
class="artifact-view artifact-frame${o.transparent?" artifact-frame-transparent":""}"
|
|
339
|
+
kind=${o.kind}
|
|
340
|
+
?full-screen=${this._fullScreen}
|
|
341
|
+
?inert=${this._inert}
|
|
342
|
+
._trustedChannel=${this._trustedChannel}
|
|
343
|
+
${ft(this._rootRef)}
|
|
344
|
+
>
|
|
345
|
+
<div class="artifact-frame-clip">
|
|
346
|
+
${d9(this.captureDocumentHost,this.handleEmbedLoadChange,this.handleDocumentFrameChange)}
|
|
347
|
+
<footer class="artifact-title-bar" @dblclick=${this.handleTitleBarDoubleClick}>
|
|
348
|
+
${this.artifactIconTemplate()}
|
|
349
|
+
<span class="artifact-title">${o.title}</span>
|
|
350
|
+
${this.navigationControlsTemplate()}
|
|
351
|
+
${tA(this.menuEntries(),{trigger:a=>V`
|
|
352
|
+
<button
|
|
353
|
+
icon
|
|
354
|
+
size="sm"
|
|
355
|
+
variant="ghost"
|
|
356
|
+
class="artifact-menu-trigger"
|
|
357
|
+
id=${a}
|
|
358
|
+
aria-label=${`${o.title} menu`}
|
|
359
|
+
>
|
|
360
|
+
<tv-icon name="expand"></tv-icon>
|
|
361
|
+
</button>
|
|
362
|
+
`})}
|
|
363
|
+
</footer>
|
|
364
|
+
</div>
|
|
365
|
+
${this.deleteConfirmationTemplate()}
|
|
366
|
+
</div>
|
|
367
|
+
`}renderArtifact(e={}){this._artifact&&(this.assignDocumentSource({preserveFrameSrc:e.preserveFrameSrc??!1,frameSrcOverride:e.frameSrcOverride,resetTrust:e.resetTrust}),this.render(),e.forceFrameSrc&&this.forceCurrentFrameSrc(),this.syncFrameSubscriptions())}}const E9=gn(A9);function k9(n){return n.startsWith("http://")||n.startsWith("https://")}function T9(n){var e;const t=globalThis.__televisionNativeBridge;(e=t==null?void 0:t.openApplicationLink)==null||e.call(t,n)}function C9(n,t){return n.id!==t.id||n.kind!==t.kind?!1:n.kind==="path"&&t.kind==="path"?n.path===t.path:n.kind==="url"&&t.kind==="url"?LA(n.url,t.url):!0}function R9(n,t){return n.kind==="path"&&t.kind==="path"&&n.id===t.id&&(n.title!==t.title||n.path!==t.path)}function LA(n,t){try{const e=new URL(n,window.location.href),r=new URL(t,window.location.href);return e.searchParams.delete(yc),r.searchParams.delete(yc),e.origin===r.origin&&e.pathname===r.pathname&&e.search===r.search}catch{return!1}}function m8(n,t){try{const e=new URL(n,window.location.href);if(t){const r=new URL(t,window.location.href);if(e.origin!=="null"&&e.origin===r.origin)return e.searchParams.delete(yc),`${e.pathname}${e.search}${e.hash}`}}catch{return $i(n)}return $i(n)}function MA(n,t,e,r,i){const o=t.pages.map(a=>({artifactIds:[...a.artifactIds],geometry:{...a.geometry,full_screen:a===e?i:a.geometry.full_screen},size:a===e?{...r}:{...a.size}}));n.updateChannelPages(t.id,o).catch(()=>{})}function z1(n,t,e,r){MA(n,t,e,e.size,r)}function ry(n){return{width:1-r8+r8*n.width/zN,height:1-i8+i8*n.height/HN}}function NA(n){return{width:Math.min(jN,n.width),height:Math.min(WN,n.height)}}function g8(n,t){const e=ry(t),r=NA(t);return{width:Math.min(t.width,Math.max(r.width,n.width*e.width)),height:Math.min(t.height,Math.max(r.height,n.height*e.height))}}function I9(n,t){const e=ry(t);return{width:n.width/e.width,height:n.height/e.height}}const v8=.5,_d=2,$9=120,x9=["left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"];var Jo,kr,Vl,di,Bl,Yo,bs,Ko,Ss,_s,fi,Xo,Qo,Tr,jl,pi,Cr,bt,Wl,mi,Rr,W,zA,HA,fu,ZA,pu,H1,Jd,Ah,Ka,UA,Eh,kh,Th,Ch,ea,Rh,Z1,Un,U1,Xa,qA,FA,mu;class P9 extends mn{constructor(){super(...arguments);m(this,W);m(this,Jo,er());m(this,kr,er());m(this,Vl);m(this,di);m(this,Bl);m(this,Yo);m(this,bs);m(this,Ko);m(this,Ss,0);m(this,_s,0);m(this,fi,null);m(this,Xo,null);m(this,Qo,null);m(this,Tr,null);m(this,jl,[]);m(this,pi,null);m(this,Cr,null);m(this,bt,null);m(this,Wl,null);m(this,mi,new Set);m(this,Rr,!1);m(this,Ah,e=>{var i;if(s(this,bt))return;const r=e.type==="pointerout"?e.relatedTarget:e.target;h(this,W,Ka).call(this,r instanceof Element?((i=r.closest(".page-handle"))==null?void 0:i.closest(".page"))??null:null)});m(this,Eh,e=>{const r=s(this,bt);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},r.option=e.altKey,h(this,W,Z1).call(this,r))});m(this,kh,e=>{const r=s(this,bt);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},h(this,W,Un).call(this,!0))});m(this,Th,e=>{var r;e.pointerId===((r=s(this,bt))==null?void 0:r.pointerId)&&h(this,W,Un).call(this,!1)});m(this,Ch,e=>{const r=s(this,bt);!r||e.pointerId!==r.pointerId||(r.lastPointer={x:e.clientX,y:e.clientY},h(this,W,Un).call(this,!1))});m(this,ea,e=>{const r=s(this,bt);if(r){if(e.type==="keydown"&&e.key==="Escape"){e.preventDefault(),h(this,W,Un).call(this,!1);return}r.option!==e.altKey&&(r.option=e.altKey,h(this,W,Z1).call(this,r))}});m(this,Rh,()=>{const e=s(this,bt);!e||y8(h(this,W,fu).call(this,e.filmstrip),e.pageBox)||(h(this,W,H1).call(this),h(this,W,Un).call(this,!1))})}connected(){d(this,Vl,void 0),d(this,di,void 0),d(this,Bl,void 0),d(this,Yo,void 0),d(this,bs,void 0),d(this,Ko,void 0)}template(e,r,i,o=!1){var he;const a=!s(this,Rr)&&o;if(d(this,Rr,o),a){h(this,W,Un).call(this,!1),h(this,W,mu).call(this);for(const le of s(this,mi))le.cancel();s(this,mi).clear()}const l=(i==null?void 0:i.channelId)===(r==null?void 0:r.id)?i:null,c=O9(r,(l==null?void 0:l.pages)??(r==null?void 0:r.pages)),u=(r==null?void 0:r.selectedPage)??null,f=(r==null?void 0:r.id)??null,p=(u==null?void 0:u.artifactIds[0])??null,y=(u==null?void 0:u.geometry.full_screen)??null,v=s(this,Yo)!==void 0,S=c.map(({key:le,page:Ae})=>`${le}:${Ae.geometry.full_screen}:${Ae.size.width}:${Ae.size.height}`).sort().join("|"),_=l===null?null:c.map(({key:le})=>le).join("|"),R=f!==s(this,Vl),H=p!==s(this,di),P=y!==s(this,Bl),N=S!==s(this,Yo),D=_!==s(this,bs),B=c.map(({key:le})=>le).join("|"),q=!R&&s(this,Ko)!==void 0&&B!==s(this,Ko),Q=!s(this,Rr)&&l!==null&&s(this,bs)!==void 0&&s(this,bs)!==null&&D?h(this,W,qA).call(this):null,K=!s(this,Rr)&&H&&!R&&s(this,di)!==void 0&&s(this,di)!==null&&p!==null;return s(this,bt)&&(R||H||P)&&h(this,W,Un).call(this,!1),(R||H)&&h(this,W,Ka).call(this,null),d(this,Vl,f),d(this,di,p),d(this,Bl,y),d(this,Yo,S),d(this,bs,_),d(this,Ko,B),d(this,jl,c),N&&v&&h(this,W,Jd).call(this),R&&((he=s(this,Tr))==null||he.disconnect(),d(this,Xo,null),d(this,Qo,null),d(this,pi,null)),queueMicrotask(()=>h(this,W,pu).call(this)),R||H||N||a?queueMicrotask(()=>h(this,W,zA).call(this,p,K)):(D||q)&&queueMicrotask(()=>{const le=s(this,kr).value;le&&(h(this,W,Xa).call(this,le,p,!1),Q&&h(this,W,FA).call(this,Q))}),V`
|
|
368
|
+
<section
|
|
369
|
+
class="stage"
|
|
370
|
+
${ft(s(this,Jo))}
|
|
371
|
+
style=${`--handle-band: ${ZN}px; --handle-reach: ${UN}px; --handle-thickness: ${qN}px;`}
|
|
372
|
+
>
|
|
373
|
+
${r!==null&&c.length===0?V`
|
|
374
|
+
<div class="stage-empty">
|
|
375
|
+
<tv-icon name="artifact" size="xl"></tv-icon>
|
|
376
|
+
<p>No artifacts yet — ask your agent to put something here.</p>
|
|
377
|
+
</div>
|
|
378
|
+
`:null}
|
|
379
|
+
${mf([f],le=>le,()=>V`
|
|
380
|
+
<div class="filmstrip" ${ft(s(this,kr))}>
|
|
381
|
+
<div class="filmstrip-inner">
|
|
382
|
+
${mf(c,({key:le})=>le,({page:le,artifact:Ae,key:at})=>{if(r===null)return null;const se=at===p;return V`
|
|
383
|
+
<div
|
|
384
|
+
class="page"
|
|
385
|
+
data-page-key=${at}
|
|
386
|
+
?selected=${se}
|
|
387
|
+
?full-screen=${le.geometry.full_screen}
|
|
388
|
+
style=${h(this,W,ZA).call(this,le)}
|
|
389
|
+
@click=${se||Ae===null?null:()=>e.selectPage(r.id,Ae.id)}
|
|
390
|
+
>
|
|
391
|
+
${Ae?E9(e,Ae,{viewURL:e.getArtifactViewURL(Ae),contentURL:e.getArtifactContentURL(Ae),fullScreen:le.geometry.full_screen,inert:!se,onFullScreenChange:Pe=>z1(e,r,le,Pe)}):null}
|
|
392
|
+
${se?V`
|
|
393
|
+
<div class="page-handles" aria-hidden="true"
|
|
394
|
+
@pointerover=${s(this,Ah)}
|
|
395
|
+
@pointerout=${s(this,Ah)}>
|
|
396
|
+
${x9.map(Pe=>V`
|
|
397
|
+
<span
|
|
398
|
+
class="page-handle ${Pe}"
|
|
399
|
+
@pointerdown=${pt=>h(this,W,UA).call(this,pt,Pe,e,r,le,at)}
|
|
400
|
+
></span>
|
|
401
|
+
`)}
|
|
402
|
+
</div>
|
|
403
|
+
`:null}
|
|
404
|
+
</div>
|
|
405
|
+
`})}
|
|
406
|
+
</div>
|
|
407
|
+
</div>
|
|
408
|
+
`)}
|
|
409
|
+
</section>
|
|
410
|
+
`}disconnected(){var e;h(this,W,Un).call(this,!1),h(this,W,Ka).call(this,null),h(this,W,Jd).call(this),h(this,W,mu).call(this),cancelAnimationFrame(s(this,Ss)),d(this,Ss,0),(e=s(this,Tr))==null||e.disconnect(),d(this,Tr,null),d(this,Xo,null),d(this,Qo,null),d(this,pi,null),d(this,jl,[]);for(const r of s(this,mi))r.cancel();s(this,mi).clear()}}Jo=new WeakMap,kr=new WeakMap,Vl=new WeakMap,di=new WeakMap,Bl=new WeakMap,Yo=new WeakMap,bs=new WeakMap,Ko=new WeakMap,Ss=new WeakMap,_s=new WeakMap,fi=new WeakMap,Xo=new WeakMap,Qo=new WeakMap,Tr=new WeakMap,jl=new WeakMap,pi=new WeakMap,Cr=new WeakMap,bt=new WeakMap,Wl=new WeakMap,mi=new WeakMap,Rr=new WeakMap,W=new WeakSet,zA=function(e,r){const i=s(this,kr).value;i&&(cancelAnimationFrame(s(this,Ss)),d(this,Ss,requestAnimationFrame(()=>{d(this,Ss,0),h(this,W,Xa).call(this,i,e,r)})))},HA=function(e,r){var i;typeof ResizeObserver>"u"||e===s(this,Xo)&&r===s(this,Qo)||((i=s(this,Tr))==null||i.disconnect(),d(this,Xo,e),d(this,Qo,r),d(this,Tr,new ResizeObserver(()=>{const o=h(this,W,fu).call(this,e);y8(o,s(this,pi))||(h(this,W,H1).call(this),s(this,bt)&&h(this,W,Un).call(this,!1),h(this,W,pu).call(this,e)),s(this,fi)===null&&h(this,W,Xa).call(this,e,s(this,di)??null,!1)})),s(this,Tr).observe(e),s(this,Tr).observe(r))},fu=function(e){const r=Number.parseFloat(getComputedStyle(e).getPropertyValue("--page-inset"))||0;return{width:Math.max(0,e.clientWidth-2*r),height:Math.max(0,e.clientHeight-r)}},ZA=function(e){if(e.geometry.full_screen||s(this,pi)===null)return"";const r=g8(e.size,s(this,pi));return`width: ${r.width}px; height: ${r.height}px;`},pu=function(e=s(this,kr).value){var o;if(!e)return;const r=h(this,W,fu).call(this,e);d(this,pi,r);const i=new Map(s(this,jl).map(a=>[a.key,a.page]));for(const a of e.querySelectorAll(".page")){if(a===((o=s(this,bt))==null?void 0:o.pageElement))continue;const l=i.get(a.dataset.pageKey??"");if(!l)continue;if(l.geometry.full_screen){a.style.width="",a.style.height="";continue}const c=g8(l.size,r);a.style.width=`${c.width}px`,a.style.height=`${c.height}px`}},H1=function(){const e=s(this,Jo).value;e&&(e.setAttribute("window-tracking",""),s(this,Cr)!==null&&clearTimeout(s(this,Cr)),d(this,Cr,setTimeout(()=>{d(this,Cr,null),e.removeAttribute("window-tracking")},$9)))},Jd=function(){var e;s(this,Cr)!==null&&(clearTimeout(s(this,Cr)),d(this,Cr,null)),(e=s(this,Jo).value)==null||e.removeAttribute("window-tracking")},Ah=new WeakMap,Ka=function(e){var i;const r=(e==null?void 0:e.querySelector(".artifact-frame"))??null;r!==s(this,Wl)&&((i=s(this,Wl))==null||i.removeAttribute("data-resize-active"),d(this,Wl,r),r==null||r.setAttribute("data-resize-active",""))},UA=function(e,r,i,o,a,l){if(s(this,Rr)||e.button!==0||!e.isPrimary)return;const c=e.currentTarget,u=c.closest(".page"),f=s(this,kr).value,p=s(this,Jo).value;if(!u||!f||!p)return;h(this,W,Un).call(this,!1),h(this,W,Jd).call(this),e.preventDefault(),e.stopPropagation();const y=u.getBoundingClientRect(),v=h(this,W,fu).call(this,f),S=ry(v),_=a.geometry.full_screen,R=r.includes("left")||r.includes("right"),H=r.includes("top")||r.includes("bottom");d(this,bt,{application:i,channel:o,page:a,pageKey:l,pageElement:u,filmstrip:f,stage:p,handle:c,pointerId:e.pointerId,startPointer:{x:e.clientX,y:e.clientY},lastPointer:{x:e.clientX,y:e.clientY},startRendered:{width:y.width,height:y.height},rendered:{width:y.width,height:y.height},baselineSize:_?{width:v.width/S.width,height:v.height/S.height}:{...a.size},pageBox:v,wasFullScreen:_,horizontal:R,vertical:H,leftish:r.includes("left"),topish:r.includes("top"),option:e.altKey,armed:!1,leftFullScreen:!1}),p.setAttribute("resizing",""),h(this,W,Ka).call(this,u),c.addEventListener("pointermove",s(this,Eh)),c.addEventListener("pointerup",s(this,kh)),c.addEventListener("pointercancel",s(this,Th)),c.addEventListener("lostpointercapture",s(this,Ch)),window.addEventListener("keydown",s(this,ea)),window.addEventListener("keyup",s(this,ea)),window.addEventListener("resize",s(this,Rh)),c.setPointerCapture(e.pointerId)},Eh=new WeakMap,kh=new WeakMap,Th=new WeakMap,Ch=new WeakMap,ea=new WeakMap,Rh=new WeakMap,Z1=function(e){const r=e.lastPointer.x!==e.startPointer.x||e.lastPointer.y!==e.startPointer.y;if(e.wasFullScreen&&!e.leftFullScreen){if(!r)return;e.leftFullScreen=!0,e.pageElement.removeAttribute("full-screen")}const i=NA(e.pageBox);let o=e.startRendered.width,a=e.startRendered.height;if(e.horizontal){const l=e.leftish?-_d:_d;o=Math.min(e.pageBox.width,Math.max(i.width,e.startRendered.width+(e.lastPointer.x-e.startPointer.x)*l))}if(e.vertical){const l=e.topish?-_d:_d;a=Math.min(e.pageBox.height,Math.max(i.height,e.startRendered.height+(e.lastPointer.y-e.startPointer.y)*l))}e.armed=!e.option&&e.horizontal&&e.vertical&&o>=e.pageBox.width-o8&&a>=e.pageBox.height-o8,e.rendered=e.armed?{...e.pageBox}:{width:o,height:a},e.pageElement.style.width=`${e.rendered.width}px`,e.pageElement.style.height=`${e.rendered.height}px`,h(this,W,U1).call(this,e.stage,e.armed),h(this,W,Xa).call(this,e.filmstrip,e.pageKey,!1)},Un=function(e){var o;const r=s(this,bt);if(!r)return;if(d(this,bt,null),r.handle.removeEventListener("pointermove",s(this,Eh)),r.handle.removeEventListener("pointerup",s(this,kh)),r.handle.removeEventListener("pointercancel",s(this,Th)),r.handle.removeEventListener("lostpointercapture",s(this,Ch)),window.removeEventListener("keydown",s(this,ea)),window.removeEventListener("keyup",s(this,ea)),window.removeEventListener("resize",s(this,Rh)),r.handle.hasPointerCapture(r.pointerId)&&r.handle.releasePointerCapture(r.pointerId),h(this,W,U1).call(this,r.stage,!1),e&&r.armed)r.wasFullScreen&&r.pageElement.setAttribute("full-screen",""),z1(r.application,r.channel,r.page,!0);else if(e){const a={...r.baselineSize},l=I9(r.rendered,r.pageBox);let c=r.wasFullScreen&&r.leftFullScreen;r.horizontal&&r.rendered.width!==r.startRendered.width&&(a.width=l.width,c=!0),r.vertical&&r.rendered.height!==r.startRendered.height&&(a.height=l.height,c=!0),c?MA(r.application,r.channel,r.page,a,!1):h(this,W,pu).call(this,r.filmstrip)}else r.pageElement.toggleAttribute("full-screen",r.wasFullScreen),h(this,W,pu).call(this,r.filmstrip);r.pageElement.getBoundingClientRect(),r.stage.removeAttribute("resizing"),h(this,W,Xa).call(this,r.filmstrip,r.pageKey,!1);const i=document.elementFromPoint(r.lastPointer.x,r.lastPointer.y);h(this,W,Ka).call(this,((o=i==null?void 0:i.closest(".page-handle"))==null?void 0:o.closest(".page"))??null)},U1=function(e,r){const i=e.querySelector(":scope > .snap-outline");if(!r){i==null||i.remove();return}if(i)return;const o=document.createElement("div");o.className="snap-outline",o.setAttribute("aria-hidden","true"),e.append(o)},Xa=function(e,r,i){const o=[...e.querySelectorAll(".page")].find(y=>y.dataset.pageKey===r);if(!o){h(this,W,mu).call(this);return}h(this,W,HA).call(this,e,o);const a=o.getBoundingClientRect(),l=e.getBoundingClientRect(),c=Math.max(0,Math.min(e.scrollLeft+a.left+a.width/2-(l.left+l.width/2),e.scrollWidth-e.clientWidth));if(h(this,W,mu).call(this),s(this,Rr)||!i||Math.abs(c-e.scrollLeft)<v8||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,f=e.animate([{},{}],{duration:EA,easing:"ease"});d(this,fi,f);const p=()=>{var v;if(f!==s(this,fi))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*y,f.playState==="finished"?(e.scrollLeft=c,d(this,fi,null),d(this,_s,0)):d(this,_s,requestAnimationFrame(p))};d(this,_s,requestAnimationFrame(p))},qA=function(){const e=s(this,kr).value;return e?new Map([...e.querySelectorAll(".page")].map(r=>[r.dataset.pageKey??"",r.getBoundingClientRect().left])):new Map},FA=function(e){if(s(this,Rr))return;const r=s(this,kr).value;if(r)for(const i of r.querySelectorAll(".page")){if(i.hasAttribute("selected"))continue;const o=e.get(i.dataset.pageKey??"");if(o===void 0)continue;const a=o-i.getBoundingClientRect().left;if(Math.abs(a)<=v8)continue;const l=i.animate({translate:[`${a}px 0`,"0px 0"]},{duration:sl,easing:"ease"});s(this,mi).add(l),l.finished.finally(()=>{s(this,mi).delete(l)}).catch(()=>{})}},mu=function(){var e;cancelAnimationFrame(s(this,_s)),d(this,_s,0),(e=s(this,fi))==null||e.cancel(),d(this,fi,null)};const D9=gn(P9);function O9(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{const o=r.artifactIds[0];return{page:r,artifact:o===void 0?null:e.get(o)??null,key:o??`empty-page-${i}`}})}function y8(n,t){return t!==null&&n.width===t.width&&n.height===t.height}const L9=250,M9=1e3;var As,Es,ta,ks,Xt,VA,q1,BA,F1,jA;class N9 extends mn{constructor(){super(...arguments);m(this,Xt);m(this,As,H9());m(this,Es,null);m(this,ta,!1);m(this,ks,null)}disconnected(){var e;h(this,Xt,F1).call(this),(e=s(this,Es))==null||e.withdraw(),d(this,Es,null),d(this,ta,!1),l1(null,s(this,As))}template(e,r){return h(this,Xt,BA).call(this,e),l1(Np(h(this,Xt,VA).call(this,e,r),WA(r.dragStrip)),s(this,As)),h(this,Xt,jA).call(this),s(this,As)}}As=new WeakMap,Es=new WeakMap,ta=new WeakMap,ks=new WeakMap,Xt=new WeakSet,VA=function(e,r){switch(e.kind){case"connecting":return V`
|
|
411
|
+
<div class="system-modal" role="status" aria-live="polite">
|
|
412
|
+
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
413
|
+
<h2>Connecting</h2>
|
|
414
|
+
</div>
|
|
415
|
+
`;case"disconnected":return V`
|
|
416
|
+
<div class="system-modal" role="status" aria-live="polite">
|
|
417
|
+
<tv-icon name="spinner" size="xl" spinning></tv-icon>
|
|
418
|
+
<h2>Disconnected</h2>
|
|
419
|
+
<p>${w8(e.nextRetryAt)}</p>
|
|
420
|
+
</div>
|
|
421
|
+
`;case"unauthorized":return V`
|
|
422
|
+
<div class="system-modal">
|
|
423
|
+
<tv-icon name="locked" size="xl"></tv-icon>
|
|
424
|
+
<h2>Access token required</h2>
|
|
425
|
+
<p>${{browser:"This server requires a valid access token to connect. Ask your agent for the current link, and paste the whole link into the address bar.",desktop:"This server requires a valid access token to connect. Choose Television › Disconnect from Server, then try again.",local:"This server requires a valid access token to connect. Disconnect from Server, then paste the current link from your agent."}[r.context]}</p>
|
|
426
|
+
${h(this,Xt,q1).call(this,r)}
|
|
427
|
+
</div>
|
|
428
|
+
`;case"error":return V`
|
|
429
|
+
<div class="system-modal">
|
|
430
|
+
<h2>Can’t connect with server</h2>
|
|
431
|
+
<p class="server-url">${e.serverURL}</p>
|
|
432
|
+
<p>Check your internet connection and that the server is running. ${w8(e.nextRetryAt)}</p>
|
|
433
|
+
${h(this,Xt,q1).call(this,r)}
|
|
434
|
+
</div>
|
|
435
|
+
`}},q1=function(e){return e.context==="local"?V`<button intent="danger" class="system-modal-disconnect" @click=${e.onDisconnect}>Disconnect from Server</button>`:null},BA=function(e){const r=(e.kind==="disconnected"||e.kind==="error")&&e.nextRetryAt!==null;r&&s(this,ks)===null?d(this,ks,setInterval(()=>this.render(),L9)):r||h(this,Xt,F1).call(this)},F1=function(){s(this,ks)!==null&&(clearInterval(s(this,ks)),d(this,ks,null))},jA=function(){s(this,Es)!==null||s(this,ta)||(d(this,ta,!0),queueMicrotask(()=>{if(d(this,ta,!1),!this.isConnected||!s(this,As).isConnected||s(this,Es)!==null)return;const e=s(this,As).querySelector("dialog");e!==null&&d(this,Es,zp(e,()=>{}))}))};const z9=gn(N9);function H9(){const n=document.createElement("section");return n.className="system-modal-host",n}function w8(n){if(n===null)return"Reconnecting now…";const t=n-Date.now();return t<=0?"Reconnecting now…":`Reconnecting in ${Math.ceil(t/M9)}s…`}function WA(n=!1){return n?V`<div class="window-drag-strip" electron-draggable aria-hidden="true"></div>`:null}/**
|
|
436
|
+
* @license
|
|
437
|
+
* Copyright 2017 Google LLC
|
|
438
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
439
|
+
*/class V1 extends td{constructor(t){if(super(t),this.it=oe,t.type!==Or.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===oe||t==null)return this._t=void 0,this.it=t;if(t===Dt)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}V1.directiveName="unsafeHTML",V1.resultType=1;const GA=xc(V1);/*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */function b8(n,t){(t==null||t>n.length)&&(t=n.length);for(var e=0,r=Array(t);e<t;e++)r[e]=n[e];return r}function Z9(n){if(Array.isArray(n))return n}function U9(n,t){var e=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(e!=null){var r,i,o,a,l=[],c=!0,u=!1;try{if(o=(e=e.call(n)).next,t!==0)for(;!(c=(r=o.call(e)).done)&&(l.push(r.value),l.length!==t);c=!0);}catch(f){u=!0,i=f}finally{try{if(!c&&e.return!=null&&(a=e.return(),Object(a)!==a))return}finally{if(u)throw i}}return l}}function q9(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
440
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */function F9(n,t){return Z9(n)||U9(n,t)||V9(n,t)||q9()}function V9(n,t){if(n){if(typeof n=="string")return b8(n,t);var e={}.toString.call(n).slice(8,-1);return e==="Object"&&n.constructor&&(e=n.constructor.name),e==="Map"||e==="Set"?Array.from(n):e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?b8(n,t):void 0}}const JA=Object.entries,S8=Object.setPrototypeOf,B9=Object.isFrozen,j9=Object.getPrototypeOf,W9=Object.getOwnPropertyDescriptor;let ot=Object.freeze,ht=Object.seal,Qa=Object.create,YA=typeof Reflect<"u"&&Reflect,B1=YA.apply,j1=YA.construct;ot||(ot=function(t){return t});ht||(ht=function(t){return t});B1||(B1=function(t,e){for(var r=arguments.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=arguments[o];return t.apply(e,i)});j1||(j1=function(t){for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return new t(...r)});const co=et(Array.prototype.forEach),G9=et(Array.prototype.lastIndexOf),_8=et(Array.prototype.pop),Wc=et(Array.prototype.push),J9=et(Array.prototype.splice),ll=Array.isArray,gu=et(String.prototype.toLowerCase),wg=et(String.prototype.toString),A8=et(String.prototype.match),Gc=et(String.prototype.replace),E8=et(String.prototype.indexOf),Y9=et(String.prototype.trim),K9=et(Number.prototype.toString),X9=et(Boolean.prototype.toString),k8=typeof BigInt>"u"?null:et(BigInt.prototype.toString),T8=typeof Symbol>"u"?null:et(Symbol.prototype.toString),Jt=et(Object.prototype.hasOwnProperty),Jc=et(Object.prototype.toString),yt=et(RegExp.prototype.test),Vi=Q9(TypeError);function et(n){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var e=arguments.length,r=new Array(e>1?e-1:0),i=1;i<e;i++)r[i-1]=arguments[i];return B1(n,t,r)}}function Q9(n){return function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return j1(n,e)}}function ye(n,t){let e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:gu;if(S8&&S8(n,null),!ll(t))return n;let r=t.length;for(;r--;){let i=t[r];if(typeof i=="string"){const o=e(i);o!==i&&(B9(t)||(t[r]=o),i=o)}n[i]=!0}return n}function ez(n){for(let t=0;t<n.length;t++)Jt(n,t)||(n[t]=null);return n}function rn(n){const t=Qa(null);for(const r of JA(n)){var e=F9(r,2);const i=e[0],o=e[1];Jt(n,i)&&(ll(o)?t[i]=ez(o):o&&typeof o=="object"&&o.constructor===Object?t[i]=rn(o):t[i]=o)}return t}function tz(n){switch(typeof n){case"string":return n;case"number":return K9(n);case"boolean":return X9(n);case"bigint":return k8?k8(n):"0";case"symbol":return T8?T8(n):"Symbol()";case"undefined":return Jc(n);case"function":case"object":{if(n===null)return Jc(n);const t=n,e=bn(t,"toString");if(typeof e=="function"){const r=e(t);return typeof r=="string"?r:Jc(r)}return Jc(n)}default:return Jc(n)}}function bn(n,t){for(;n!==null;){const r=W9(n,t);if(r){if(r.get)return et(r.get);if(typeof r.value=="function")return et(r.value)}n=j9(n)}function e(){return null}return e}function nz(n){try{return yt(n,""),!0}catch{return!1}}const C8=ot(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),bg=ot(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Sg=ot(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),rz=ot(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),_g=ot(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),iz=ot(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),R8=ot(["#text"]),I8=ot(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Ag=ot(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),$8=ot(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ad=ot(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),sz=ht(/{{[\w\W]*|^[\w\W]*}}/g),oz=ht(/<%[\w\W]*|^[\w\W]*%>/g),az=ht(/\${[\w\W]*/g),lz=ht(/^data-[\-\w.\u00B7-\uFFFF]+$/),cz=ht(/^aria-[\-\w]+$/),x8=ht(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),uz=ht(/^(?:\w+script|data):/i),hz=ht(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),dz=ht(/^html$/i),fz=ht(/^[a-z][.\w]*(-[.\w]+)+$/i),P8=ht(/<[/\w!]/g),D8=ht(/<[/\w]/g),pz=ht(/<\/no(script|embed|frames)/i),mz=ht(/\/>/i),nn={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},KA=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],gz=ot(ye({},KA)),vz=(function(){const n={};return co(KA,t=>{n[t]=ht(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ot(n)})(),yz=function(){return typeof window>"u"?null:window},wz=function(t,e){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let r=null;const i="data-tt-policy-suffix";e&&e.hasAttribute(i)&&(r=e.getAttribute(i));const o="dompurify"+(r?"#"+r:"");try{return t.createPolicy(o,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},O8=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Bi=function(t,e,r,i){return Jt(t,e)&&ll(t[e])?ye(i.base?rn(i.base):{},t[e],i.transform):r},Eg=function(t,e,r){const i=Jt(t,e)?t[e]:void 0;return i&&typeof i=="object"?rn(i):r()};function XA(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:yz();const t=z=>XA(z);if(t.version="3.4.16",t.removed=[],!n||!n.document||n.document.nodeType!==nn.document||!n.Element)return t.isSupported=!1,t;let e=n.document;const r=e,i=r.currentScript;n.DocumentFragment;const o=n.HTMLTemplateElement,a=n.Node,l=n.Element,c=n.NodeFilter;n.NamedNodeMap===void 0&&(n.NamedNodeMap||n.MozNamedAttrMap),n.HTMLFormElement;const u=n.DOMParser,f=n.trustedTypes,p=l.prototype,y=bn(p,"cloneNode"),v=bn(p,"remove"),S=bn(p,"removeAttributeNode"),_=bn(p,"nextSibling"),R=bn(p,"childNodes"),H=bn(p,"parentNode"),P=bn(p,"shadowRoot"),N=bn(p,"attributes"),D=a&&a.prototype?bn(a.prototype,"nodeType"):null,B=a&&a.prototype?bn(a.prototype,"nodeName"):null,q=a&&a.prototype?bn(a.prototype,"ownerDocument"):null,F=function(w){return D?D(w):w.nodeType},Q=function(w){return B?B(w):w.nodeName};if(typeof o=="function"){const z=e.createElement("template");z.content&&z.content.ownerDocument&&(e=z.content.ownerDocument)}let K,he="",le,Ae=!1,at=0;const se=function(){if(at>0)throw Vi('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Pe=function(w){se(),at++;try{return K.createHTML(w)}finally{at--}},pt=function(w){se(),at++;try{return K.createScriptURL(w)}finally{at--}},Nn=function(){return Ae||(le=wz(f,i),Ae=!0),le},mt=e,At=mt.implementation,Gs=mt.createNodeIterator,Ra=mt.createDocumentFragment,Js=mt.getElementsByTagName,Ni=r.importNode;let Te=O8();t.isSupported=typeof JA=="function"&&typeof H=="function"&&At&&At.createHTMLDocument!==void 0;const Dc=sz,zn=oz,Ys=az,Oc=lz,Et=cz,$e=uz,je=hz,Oe=fz;let Ge=x8,ue=null;const vn=ye({},[...C8,...bg,...Sg,..._g,...R8]);let ae=null;const lt=ye({},[...I8,...Ag,...$8,...Ad]);let He=Object.seal(Qa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),yn=null,Hn=null;const Je=Object.seal(Qa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Hr=!0,rr=!0,Zr=!1,id=!0,ir=!1,sr=!0,Ur=!1,qr=!1,zi=null,Ks=null,Lc=!1,Hi=!1,Zi=!1,Fr=!1,k=!0,C=!1;const me="user-content-";let Ee=!0,Ce=!1,ne={},kt=null;const or=ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let gt=null;const Zn=ye({},["audio","video","img","source","image","track"]);let Ia=null;const Vr=ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vt="http://www.w3.org/1998/Math/MathML",Xs="http://www.w3.org/2000/svg",en="http://www.w3.org/1999/xhtml";let Br=en,jr=!1,Qs=null;const $a=ye({},[vt,Xs,en],wg),xa=ot(["mi","mo","mn","ms","mtext"]);let eo=ye({},xa);const Mc=ot(["annotation-xml"]);let Pa=ye({},Mc);const Nc=ye({},["title","style","font","a","script"]);let Ui=null;const zc=["application/xhtml+xml","text/html"],sd="text/html";let Ze=null,ar=null;const qi=e.createElement("form"),to=function(w){return w instanceof RegExp||w instanceof Function},Hc=function(){let w=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ar&&ar===w)return;(!w||typeof w!="object")&&(w={}),w=rn(w),Ui=zc.indexOf(w.PARSER_MEDIA_TYPE)===-1?sd:w.PARSER_MEDIA_TYPE,Ze=Ui==="application/xhtml+xml"?wg:gu,ue=Bi(w,"ALLOWED_TAGS",vn,{transform:Ze}),ae=Bi(w,"ALLOWED_ATTR",lt,{transform:Ze}),Qs=Bi(w,"ALLOWED_NAMESPACES",$a,{transform:wg}),Ia=Bi(w,"ADD_URI_SAFE_ATTR",Vr,{transform:Ze,base:Vr}),gt=Bi(w,"ADD_DATA_URI_TAGS",Zn,{transform:Ze,base:Zn}),kt=Bi(w,"FORBID_CONTENTS",or,{transform:Ze}),yn=Bi(w,"FORBID_TAGS",rn({}),{transform:Ze}),Hn=Bi(w,"FORBID_ATTR",rn({}),{transform:Ze}),ne=Jt(w,"USE_PROFILES")?w.USE_PROFILES&&typeof w.USE_PROFILES=="object"?rn(w.USE_PROFILES):w.USE_PROFILES:!1,Hr=w.ALLOW_ARIA_ATTR!==!1,rr=w.ALLOW_DATA_ATTR!==!1,Zr=w.ALLOW_UNKNOWN_PROTOCOLS||!1,id=w.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ir=w.SAFE_FOR_TEMPLATES||!1,sr=w.SAFE_FOR_XML!==!1,Ur=w.WHOLE_DOCUMENT||!1,Hi=w.RETURN_DOM||!1,Zi=w.RETURN_DOM_FRAGMENT||!1,Fr=w.RETURN_TRUSTED_TYPE||!1,Lc=w.FORCE_BODY||!1,k=w.SANITIZE_DOM!==!1,C=w.SANITIZE_NAMED_PROPS||!1,Ee=w.KEEP_CONTENT!==!1,Ce=w.IN_PLACE||!1,Ge=nz(w.ALLOWED_URI_REGEXP)?w.ALLOWED_URI_REGEXP:x8,Br=typeof w.NAMESPACE=="string"?w.NAMESPACE:en,eo=Eg(w,"MATHML_TEXT_INTEGRATION_POINTS",()=>ye({},xa)),Pa=Eg(w,"HTML_INTEGRATION_POINTS",()=>ye({},Mc));const A=Eg(w,"CUSTOM_ELEMENT_HANDLING",()=>Qa(null));if(He=Qa(null),Jt(A,"tagNameCheck")&&to(A.tagNameCheck)&&(He.tagNameCheck=A.tagNameCheck),Jt(A,"attributeNameCheck")&&to(A.attributeNameCheck)&&(He.attributeNameCheck=A.attributeNameCheck),Jt(A,"allowCustomizedBuiltInElements")&&typeof A.allowCustomizedBuiltInElements=="boolean"&&(He.allowCustomizedBuiltInElements=A.allowCustomizedBuiltInElements),ht(He),ir&&(rr=!1),Zi&&(Hi=!0),ne&&(ue=ye({},R8),ae=Qa(null),ne.html===!0&&(ye(ue,C8),ye(ae,I8)),ne.svg===!0&&(ye(ue,bg),ye(ae,Ag),ye(ae,Ad)),ne.svgFilters===!0&&(ye(ue,Sg),ye(ae,Ag),ye(ae,Ad)),ne.mathMl===!0&&(ye(ue,_g),ye(ae,$8),ye(ae,Ad))),Je.tagCheck=null,Je.attributeCheck=null,Jt(w,"ADD_TAGS")&&(typeof w.ADD_TAGS=="function"?Je.tagCheck=w.ADD_TAGS:ll(w.ADD_TAGS)&&(ue===vn&&(ue=rn(ue)),ye(ue,w.ADD_TAGS,Ze))),Jt(w,"ADD_ATTR")&&(typeof w.ADD_ATTR=="function"?Je.attributeCheck=w.ADD_ATTR:ll(w.ADD_ATTR)&&(ae===lt&&(ae=rn(ae)),ye(ae,w.ADD_ATTR,Ze))),Jt(w,"ADD_FORBID_CONTENTS")&&ll(w.ADD_FORBID_CONTENTS)&&(kt===or&&(kt=rn(kt)),ye(kt,w.ADD_FORBID_CONTENTS,Ze)),Ee&&(ue["#text"]=!0),Ur&&ye(ue,["html","head","body"]),ue.table&&(ye(ue,["tbody"]),delete yn.tbody),w.TRUSTED_TYPES_POLICY){if(typeof w.TRUSTED_TYPES_POLICY.createHTML!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof w.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Vi('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const M=K;K=w.TRUSTED_TYPES_POLICY;try{he=Pe("")}catch(Z){throw K=M,Z}}else w.TRUSTED_TYPES_POLICY===null?(K=void 0,he=""):(K===void 0&&(K=Nn()),K&&typeof he=="string"&&(he=Pe("")));ot&&ot(w),ar=w},Zc=ye({},[...bg,...Sg,...rz]),gy=ye({},[..._g,...iz]),X4=function(w,A,M){return A.namespaceURI===en?w==="svg":A.namespaceURI===vt?w==="svg"&&(M==="annotation-xml"||eo[M]):!!Zc[w]},Q4=function(w,A,M){return A.namespaceURI===en?w==="math":A.namespaceURI===Xs?w==="math"&&Pa[M]:!!gy[w]},eE=function(w,A,M){return A.namespaceURI===Xs&&!Pa[M]||A.namespaceURI===vt&&!eo[M]?!1:!gy[w]&&(Nc[w]||!Zc[w])},tE=function(w){let A=H(w);(!A||!A.tagName)&&(A={namespaceURI:Br,tagName:"template"});const M=gu(w.tagName),Z=gu(A.tagName);return Qs[w.namespaceURI]?w.namespaceURI===Xs?X4(M,A,Z):w.namespaceURI===vt?Q4(M,A,Z):w.namespaceURI===en?eE(M,A,Z):!!(Ui==="application/xhtml+xml"&&Qs[w.namespaceURI]):!1},Fi=function(w){Wc(t.removed,{element:w});try{H(w).removeChild(w)}catch{if(v(w),!H(w))throw Vi("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},vy=function(w,A,M){try{S(w,A)}catch{try{w.removeAttribute(M)}catch{}}},od=function(w){ad(w);const A=R(w);if(A){const Z=[];co(A,X=>{Wc(Z,X)}),co(Z,X=>{try{v(X)}catch{}})}const M=N(w);if(M)for(let Z=M.length-1;Z>=0;--Z){const X=M[Z],de=X&&X.name;typeof de=="string"&&vy(w,X,de)}},no=function(w,A,M){if(!M)try{M=A.getAttributeNode(w)}catch{M=null}Wc(t.removed,{attribute:M||null,from:A});try{M?S(A,M):A.removeAttribute(w)}catch{try{A.removeAttribute(w)}catch{}}if(w==="is")if(Hi||Zi)try{Fi(A)}catch{}else try{A.setAttribute(w,"")}catch{}},nE=function(w){const A=N(w);if(A)for(let M=A.length-1;M>=0;--M){const Z=A[M],X=Z&&Z.name;typeof X!="string"||ae[Ze(X)]||vy(w,Z,X)}},ad=function(w){const A=[w];for(;A.length>0;){const M=A.pop();F(M)===nn.element&&nE(M);const Z=R(M);if(Z)for(let X=Z.length-1;X>=0;--X)A.push(Z[X])}},yy=function(w,A){return sr?w==="patchsrc"?!0:w==="for"&&A!=="label"&&A!=="output":!1},rE=function(w){if(!sr)return;const A=[w];for(;A.length>0;){const M=A.pop(),Z=F(M);if(Z===nn.processingInstruction||Z===nn.comment&&yt(D8,M.data)){try{v(M)}catch{}continue}if(Z===nn.element){const de=M,ge=Ze(Q(M));try{de.hasAttribute&&de.hasAttribute("patchsrc")&&de.removeAttribute("patchsrc"),de.hasAttribute&&de.hasAttribute("for")&&yy("for",ge)&&de.removeAttribute("for")}catch{}}const X=R(M);if(X)for(let de=X.length-1;de>=0;--de)A.push(X[de])}},wy=function(w){let A=null,M=null;if(Lc)w="<remove></remove>"+w;else{const de=A8(w,/^[\r\n\t ]+/);M=de&&de[0]}Ui==="application/xhtml+xml"&&Br===en&&(w='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+w+"</body></html>");const Z=K?Pe(w):w;if(Br===en)try{A=new u().parseFromString(Z,Ui)}catch{}if(!A||!A.documentElement){A=At.createDocument(Br,"template",null);try{A.documentElement.innerHTML=jr?he:Z}catch{}}const X=A.body||A.documentElement;return w&&M&&X.insertBefore(e.createTextNode(M),X.childNodes[0]||null),Br===en?Js.call(A,Ur?"html":"body")[0]:Ur?A.documentElement:X},by=function(w){const A=q?q(w):w.ownerDocument;return Gs.call(A||w,w,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ld=function(w){return w=Gc(w,Dc," "),w=Gc(w,zn," "),w=Gc(w,Ys," "),w},qp=function(w){var A;w.normalize();const M=q?q(w):w.ownerDocument,Z=Gs.call(M||w,w,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null);let X=Z.nextNode();for(;X;)X.data=ld(X.data),X=Z.nextNode();const de=(A=w.querySelectorAll)===null||A===void 0?void 0:A.call(w,"template");de&&co(de,ge=>{Da(ge.content)&&qp(ge.content)})},cd=function(w){const A=B?B(w):null;return typeof A!="string"||Ze(A)!=="form"?!1:typeof w.nodeName!="string"||typeof w.textContent!="string"||typeof w.removeChild!="function"||w.attributes!==N(w)||typeof w.removeAttribute!="function"||typeof w.removeAttributeNode!="function"||typeof w.getAttributeNode!="function"||typeof w.setAttribute!="function"||typeof w.namespaceURI!="string"||typeof w.insertBefore!="function"||typeof w.hasChildNodes!="function"||w.nodeType!==D(w)||w.childNodes!==R(w)},Da=function(w){if(!D||typeof w!="object"||w===null)return!1;try{return D(w)===nn.documentFragment}catch{return!1}},Uc=function(w){if(!D||typeof w!="object"||w===null)return!1;try{return typeof D(w)=="number"}catch{return!1}};function lr(z,w,A){z.length!==0&&co(z,M=>{M.call(t,w,A,ar)})}const iE=function(w,A){return!!(sr&&w.hasChildNodes()&&!Uc(w.firstElementChild)&&yt(P8,w.textContent)&&yt(P8,w.innerHTML)||sr&&w.namespaceURI===en&&gz[A]&&(Uc(w.firstElementChild)||typeof w.textContent=="string"&&yt(vz[A],w.textContent))||w.nodeType===nn.processingInstruction||sr&&w.nodeType===nn.comment&&yt(D8,w.data))},ud=function(w,A){if(w instanceof RegExp)return yt(w,A);if(w instanceof Function){for(var M=arguments.length,Z=new Array(M>2?M-2:0),X=2;X<M;X++)Z[X-2]=arguments[X];return!!w(A,...Z)}return!1},sE=function(w,A,M){if(!yn[A]&&Ey(A)&&ud(He.tagNameCheck,A))return!1;if(Ee&&!kt[A]){const Z=H(w),X=R(w);if(X&&Z){const de=X.length;for(let ge=de-1;ge>=0;--ge){const Be=w===M?y(X[ge],!0):X[ge];Z.insertBefore(Be,_(w))}}}return Fi(w),!0},Sy=function(w,A,M,Z){return w.length===0?A:A===M||A===Z?rn(A):A},Oa=function(w,A){return w===A||H(w)!==null?!1:(Ce&&ad(w),!0)},_y=function(w,A){if(lr(Te.beforeSanitizeElements,w,null),Oa(w,A))return!0;if(cd(w))return Fi(w),!0;const M=Ze(Q(w));if(ue=Sy(Te.uponSanitizeElement,ue,vn,zi),lr(Te.uponSanitizeElement,w,{tagName:M,allowedTags:ue}),Oa(w,A))return!0;if(iE(w,M))return Fi(w),!0;if(yn[M]||!(Je.tagCheck instanceof Function&&Je.tagCheck(M))&&!ue[M]){const Z=sE(w,M,A);return Z===!1&&(lr(Te.afterSanitizeElements,w,null),Oa(w,A))?!0:Z}if(F(w)===nn.element&&!tE(w)||(M==="noscript"||M==="noembed"||M==="noframes")&&yt(pz,w.innerHTML))return Fi(w),!0;if(ir&&w.nodeType===nn.text){const Z=ld(w.textContent);w.textContent!==Z&&(Wc(t.removed,{element:w.cloneNode()}),w.textContent=Z)}return lr(Te.afterSanitizeElements,w,null),Oa(w,A)},Ay=function(w,A,M){if(Hn[A]||yy(A,w)||k&&(A==="id"||A==="name")&&(M in e||M in qi))return!1;const Z=ae[A]||Je.attributeCheck instanceof Function&&Je.attributeCheck(A,w);return rr&&yt(Oc,A)||Hr&&yt(Et,A)?!0:Z?Ia[A]||yt(Ge,Gc(M,je,""))||(A==="src"||A==="xlink:href"||A==="href")&&w!=="script"&&E8(M,"data:")===0&>[w]||Zr&&!yt($e,Gc(M,je,""))?!0:!M:Ey(w)&&ud(He.tagNameCheck,w)&&ud(He.attributeNameCheck,A,w)||A==="is"&&He.allowCustomizedBuiltInElements&&ud(He.tagNameCheck,M)},oE=ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Ey=function(w){return!oE[gu(w)]&&yt(Oe,w)},aE=function(w,A,M,Z){if(K&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!M)switch(f.getAttributeType(w,A)){case"TrustedHTML":return Pe(Z);case"TrustedScriptURL":return pt(Z)}return Z},lE=function(w,A,M,Z){try{return M?w.setAttributeNS(M,A,Z):w.setAttribute(A,Z),cd(w)?(Fi(w),!1):!0}catch{return no(A,w),!1}},ky=function(w,A){if(lr(Te.beforeSanitizeAttributes,w,null),Oa(w,A))return;const M=w.attributes;if(!M||cd(w))return;ae=Sy(Te.uponSanitizeAttribute,ae,lt,Ks);const Z={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:ae,forceKeepAttr:void 0};let X=M.length;const de=Ze(w.nodeName);for(;X--;){const ge=M[X],Be=ge.name,wn=ge.namespaceURI,tn=ge.value,La=Ze(Be),Vp=tn;let Tt=Be==="value"?Vp:Y9(Vp),Ty=!1;if(Z.attrName=La,Z.attrValue=Tt,Z.keepAttr=!0,Z.forceKeepAttr=void 0,lr(Te.uponSanitizeAttribute,w,Z),Tt=Z.attrValue,C&&(La==="id"||La==="name")&&E8(Tt,me)!==0&&(no(Be,w,ge),Tt=me+Tt,Ty=!0),sr&&yt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Tt)){no(Be,w,ge);continue}if(La==="attributename"&&A8(Tt,"href")){no(Be,w,ge);continue}if(!Z.forceKeepAttr){if(!Z.keepAttr){no(Be,w,ge);continue}if(!id&&yt(mz,Tt)){no(Be,w,ge);continue}if(ir&&(Tt=ld(Tt)),!Ay(de,La,Tt)){no(Be,w,ge);continue}Tt=aE(de,La,wn,Tt),Tt!==Vp&&lE(w,Be,wn,Tt)&&Ty&&_8(t.removed)}}lr(Te.afterSanitizeAttributes,w,null),Oa(w,A)},hd=function(w){let A=null;const M=by(w);for(lr(Te.beforeSanitizeShadowDOM,w,null);A=M.nextNode();)if(lr(Te.uponSanitizeShadowNode,A,null),_y(A,w),ky(A,w),Da(A.content)&&hd(A.content),F(A)===nn.element){const Z=P(A);Da(Z)&&(Fp(Z),hd(Z))}lr(Te.afterSanitizeShadowDOM,w,null)},Fp=function(w){const A=[{node:w,shadow:null}];for(;A.length>0;){const M=A.pop();if(M.shadow){hd(M.shadow);continue}const Z=M.node,X=F(Z)===nn.element,de=R(Z);if(de)for(let ge=de.length-1;ge>=0;--ge)A.push({node:de[ge],shadow:null});if(X){const ge=B?B(Z):null;if(typeof ge=="string"&&Ze(ge)==="template"){const Be=Z.content;Da(Be)&&A.push({node:Be,shadow:null})}}if(X){const ge=P(Z);Da(ge)&&A.push({node:null,shadow:ge},{node:ge,shadow:null})}}};return t.sanitize=function(z){let w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},A=null,M=null,Z=null,X=null;if(jr=!z,jr&&(z="<!-->"),typeof z!="string"&&!Uc(z)&&(z=tz(z),typeof z!="string"))throw Vi("dirty is not a string, aborting");if(!t.isSupported)return z;qr?(ue=zi,ae=Ks):Hc(w),(Te.uponSanitizeElement.length>0||Te.uponSanitizeAttribute.length>0)&&(ue=rn(ue)),Te.uponSanitizeAttribute.length>0&&(ae=rn(ae)),t.removed=[];const de=Ce&&typeof z!="string"&&Uc(z);if(de){rE(z);const wn=Q(z);if(typeof wn=="string"){const tn=Ze(wn);if(!ue[tn]||yn[tn])throw od(z),Vi("root node is forbidden and cannot be sanitized in-place")}if(cd(z))throw od(z),Vi("root node is clobbered and cannot be sanitized in-place");try{Fp(z)}catch(tn){throw od(z),tn}}else if(Uc(z))A=wy("<!---->"),M=A.ownerDocument.importNode(z,!0),M.nodeType===nn.element&&M.nodeName==="BODY"||M.nodeName==="HTML"?A=M:A.appendChild(M),Fp(A);else{if(!Hi&&!ir&&!Ur&&z.indexOf("<")===-1)return K&&Fr?Pe(z):z;if(A=wy(z),!A)return Hi?null:Fr?he:""}A&&Lc&&Fi(A.firstChild);const ge=de?z:A;try{const wn=by(ge);for(;Z=wn.nextNode();)_y(Z,ge),ky(Z,ge),Da(Z.content)&&hd(Z.content)}catch(wn){throw de&&(od(z),co(t.removed,tn=>{tn.element&&ad(tn.element)})),wn}if(de){let wn=!1;if(co(t.removed,tn=>{tn.element&&(tn.element===z&&(wn=!0),ad(tn.element))}),wn)throw Vi("a node selected for removal could not be safely returned; refusing to sanitize in place");return ir&&qp(z),z}if(Hi){if(ir&&qp(A),Zi)for(X=Ra.call(A.ownerDocument);A.firstChild;)X.appendChild(A.firstChild);else X=A;return(ae.shadowroot||ae.shadowrootmode)&&(X=Ni.call(r,X,!0)),X}let Be=Ur?A.outerHTML:A.innerHTML;return Ur&&ue["!doctype"]&&A.ownerDocument&&A.ownerDocument.doctype&&A.ownerDocument.doctype.name&&yt(dz,A.ownerDocument.doctype.name)&&(Be="<!DOCTYPE "+A.ownerDocument.doctype.name+`>
|
|
441
|
+
`+Be),ir&&(Be=ld(Be)),K&&Fr?Pe(Be):Be},t.setConfig=function(){let z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Hc(z),qr=!0,zi=ue,Ks=ae},t.clearConfig=function(){ar=null,qr=!1,zi=null,Ks=null,K=le,he=""},t.isValidAttribute=function(z,w,A){ar||Hc({});const M=Ze(z),Z=Ze(w);return Ay(M,Z,A)},t.addHook=function(z,w){typeof w=="function"&&Jt(Te,z)&&Wc(Te[z],w)},t.removeHook=function(z,w){if(Jt(Te,z)){if(w!==void 0){const A=G9(Te[z],w);return A===-1?void 0:J9(Te[z],A,1)[0]}return _8(Te[z])}},t.removeHooks=function(z){Jt(Te,z)&&(Te[z]=[])},t.removeAllHooks=function(){Te=O8()},t}var QA=XA();function iy(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ca=iy();function e4(n){Ca=n}var mo={exec:()=>null};function ve(n,t=""){let e=typeof n=="string"?n:n.source,r={replace:(i,o)=>{let a=typeof o=="string"?o:o.source;return a=a.replace(Ot.caret,"$1"),e=e.replace(i,a),r},getRegex:()=>new RegExp(e,t)};return r}var bz=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}>`)},Sz=/^(?:[ \t]*(?:\n|$))+/,_z=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Az=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,rd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ez=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,sy=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,t4=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,n4=ve(t4).replace(/bull/g,sy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),kz=ve(t4).replace(/bull/g,sy).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),oy=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Tz=/^[^\n]+/,ay=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Cz=ve(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",ay).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Rz=ve(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,sy).getRegex(),Hp="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",ly=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Iz=ve("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",ly).replace("tag",Hp).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),r4=ve(oy).replace("hr",rd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hp).getRegex(),$z=ve(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",r4).getRegex(),cy={blockquote:$z,code:_z,def:Cz,fences:Az,heading:Ez,hr:rd,html:Iz,lheading:n4,list:Rz,newline:Sz,paragraph:r4,table:mo,text:Tz},L8=ve("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",rd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hp).getRegex(),xz={...cy,lheading:kz,table:L8,paragraph:ve(oy).replace("hr",rd).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",L8).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Hp).getRegex()},Pz={...cy,html:ve(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ly).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:mo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ve(oy).replace("hr",rd).replace("heading",` *#{1,6} *[^
|
|
442
|
+
]`).replace("lheading",n4).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Dz=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Oz=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,i4=/^( {2,}|\\)\n(?!\s*$)/,Lz=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Pc=/[\p{P}\p{S}]/u,Zp=/[\s\p{P}\p{S}]/u,uy=/[^\s\p{P}\p{S}]/u,Mz=ve(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zp).getRegex(),s4=/(?!~)[\p{P}\p{S}]/u,Nz=/(?!~)[\s\p{P}\p{S}]/u,zz=/(?:[^\s\p{P}\p{S}]|~)/u,Hz=ve(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",bz?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),o4=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Zz=ve(o4,"u").replace(/punct/g,Pc).getRegex(),Uz=ve(o4,"u").replace(/punct/g,s4).getRegex(),a4="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",qz=ve(a4,"gu").replace(/notPunctSpace/g,uy).replace(/punctSpace/g,Zp).replace(/punct/g,Pc).getRegex(),Fz=ve(a4,"gu").replace(/notPunctSpace/g,zz).replace(/punctSpace/g,Nz).replace(/punct/g,s4).getRegex(),Vz=ve("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,uy).replace(/punctSpace/g,Zp).replace(/punct/g,Pc).getRegex(),Bz=ve(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Pc).getRegex(),jz="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Wz=ve(jz,"gu").replace(/notPunctSpace/g,uy).replace(/punctSpace/g,Zp).replace(/punct/g,Pc).getRegex(),Gz=ve(/\\(punct)/,"gu").replace(/punct/g,Pc).getRegex(),Jz=ve(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Yz=ve(ly).replace("(?:-->|$)","-->").getRegex(),Kz=ve("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Yz).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),bf=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Xz=ve(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",bf).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),l4=ve(/^!?\[(label)\]\[(ref)\]/).replace("label",bf).replace("ref",ay).getRegex(),c4=ve(/^!?\[(ref)\](?:\[\])?/).replace("ref",ay).getRegex(),Qz=ve("reflink|nolink(?!\\()","g").replace("reflink",l4).replace("nolink",c4).getRegex(),M8=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,hy={_backpedal:mo,anyPunctuation:Gz,autolink:Jz,blockSkip:Hz,br:i4,code:Oz,del:mo,delLDelim:mo,delRDelim:mo,emStrongLDelim:Zz,emStrongRDelimAst:qz,emStrongRDelimUnd:Vz,escape:Dz,link:Xz,nolink:c4,punctuation:Mz,reflink:l4,reflinkSearch:Qz,tag:Kz,text:Lz,url:mo},e7={...hy,link:ve(/^!?\[(label)\]\((.*?)\)/).replace("label",bf).getRegex(),reflink:ve(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",bf).getRegex()},W1={...hy,emStrongRDelimAst:Fz,emStrongLDelim:Uz,delLDelim:Bz,delRDelim:Wz,url:ve(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",M8).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ve(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",M8).getRegex()},t7={...W1,br:ve(i4).replace("{2,}","*").getRegex(),text:ve(W1.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ed={normal:cy,gfm:xz,pedantic:Pz},Yc={normal:hy,gfm:W1,breaks:t7,pedantic:e7},n7={"&":"&","<":"<",">":">",'"':""","'":"'"},N8=n=>n7[n];function ur(n,t){if(t){if(Ot.escapeTest.test(n))return n.replace(Ot.escapeReplace,N8)}else if(Ot.escapeTestNoEncode.test(n))return n.replace(Ot.escapeReplaceNoEncode,N8);return n}function z8(n){try{n=encodeURI(n).replace(Ot.percentDecode,"%")}catch{return null}return n}function H8(n,t){var o;let e=n.replace(Ot.findPipe,(a,l,c)=>{let u=!1,f=l;for(;--f>=0&&c[f]==="\\";)u=!u;return u?"|":" |"}),r=e.split(Ot.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!((o=r.at(-1))!=null&&o.trim())&&r.pop(),t)if(r.length>t)r.splice(t);else for(;r.length<t;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(Ot.slashPipe,"|");return r}function Kc(n,t,e){let r=n.length;if(r===0)return"";let i=0;for(;i<r&&n.charAt(r-i-1)===t;)i++;return n.slice(0,r-i)}function r7(n,t){if(n.indexOf(t[1])===-1)return-1;let e=0;for(let r=0;r<n.length;r++)if(n[r]==="\\")r++;else if(n[r]===t[0])e++;else if(n[r]===t[1]&&(e--,e<0))return r;return e>0?-2:-1}function i7(n,t=0){let e=t,r="";for(let i of n)if(i===" "){let o=4-e%4;r+=" ".repeat(o),e+=o}else r+=i,e++;return r}function Z8(n,t,e,r,i){let o=t.href,a=t.title||null,l=n[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let c={type:n[0].charAt(0)==="!"?"image":"link",raw:e,href:o,title:a,text:l,tokens:r.inlineTokens(l)};return r.state.inLink=!1,c}function s7(n,t,e){let r=n.match(e.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
443
|
+
`).map(o=>{let a=o.match(e.other.beginningSpace);if(a===null)return o;let[l]=a;return l.length>=i.length?o.slice(i.length):o}).join(`
|
|
444
|
+
`)}var Sf=class{constructor(n){I(this,"options");I(this,"rules");I(this,"lexer");this.options=n||Ca}space(n){let t=this.rules.block.newline.exec(n);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(n){let t=this.rules.block.code.exec(n);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Kc(e,`
|
|
445
|
+
`)}}}fences(n){let t=this.rules.block.fences.exec(n);if(t){let e=t[0],r=s7(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(n){let t=this.rules.block.heading.exec(n);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let r=Kc(e,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(e=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(n){let t=this.rules.block.hr.exec(n);if(t)return{type:"hr",raw:Kc(t[0],`
|
|
446
|
+
`)}}blockquote(n){let t=this.rules.block.blockquote.exec(n);if(t){let e=Kc(t[0],`
|
|
447
|
+
`).split(`
|
|
448
|
+
`),r="",i="",o=[];for(;e.length>0;){let a=!1,l=[],c;for(c=0;c<e.length;c++)if(this.rules.other.blockquoteStart.test(e[c]))l.push(e[c]),a=!0;else if(!a)l.push(e[c]);else break;e=e.slice(c);let u=l.join(`
|
|
449
|
+
`),f=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
450
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
451
|
+
${u}`:u,i=i?`${i}
|
|
452
|
+
${f}`:f;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(f,o,!0),this.lexer.state.top=p,e.length===0)break;let y=o.at(-1);if((y==null?void 0:y.type)==="code")break;if((y==null?void 0:y.type)==="blockquote"){let v=y,S=v.raw+`
|
|
453
|
+
`+e.join(`
|
|
454
|
+
`),_=this.blockquote(S);o[o.length-1]=_,r=r.substring(0,r.length-v.raw.length)+_.raw,i=i.substring(0,i.length-v.text.length)+_.text;break}else if((y==null?void 0:y.type)==="list"){let v=y,S=v.raw+`
|
|
455
|
+
`+e.join(`
|
|
456
|
+
`),_=this.list(S);o[o.length-1]=_,r=r.substring(0,r.length-y.raw.length)+_.raw,i=i.substring(0,i.length-v.raw.length)+_.raw,e=S.substring(o.at(-1).raw.length).split(`
|
|
457
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:o,text:i}}}list(n){var e,r;let t=this.rules.block.list.exec(n);if(t){let i=t[1].trim(),o=i.length>1,a={type:"list",raw:"",ordered:o,start:o?+i.slice(0,-1):"",loose:!1,items:[]};i=o?`\\d{1,9}\\${i.slice(-1)}`:`\\${i}`,this.options.pedantic&&(i=o?i:"[*+-]");let l=this.rules.other.listItemRegex(i),c=!1;for(;n;){let f=!1,p="",y="";if(!(t=l.exec(n))||this.rules.block.hr.test(n))break;p=t[0],n=n.substring(p.length);let v=i7(t[2].split(`
|
|
458
|
+
`,1)[0],t[1].length),S=n.split(`
|
|
459
|
+
`,1)[0],_=!v.trim(),R=0;if(this.options.pedantic?(R=2,y=v.trimStart()):_?R=t[1].length+1:(R=v.search(this.rules.other.nonSpaceChar),R=R>4?1:R,y=v.slice(R),R+=t[1].length),_&&this.rules.other.blankLine.test(S)&&(p+=S+`
|
|
460
|
+
`,n=n.substring(S.length+1),f=!0),!f){let H=this.rules.other.nextBulletRegex(R),P=this.rules.other.hrRegex(R),N=this.rules.other.fencesBeginRegex(R),D=this.rules.other.headingBeginRegex(R),B=this.rules.other.htmlBeginRegex(R),q=this.rules.other.blockquoteBeginRegex(R);for(;n;){let F=n.split(`
|
|
461
|
+
`,1)[0],Q;if(S=F,this.options.pedantic?(S=S.replace(this.rules.other.listReplaceNesting," "),Q=S):Q=S.replace(this.rules.other.tabCharGlobal," "),N.test(S)||D.test(S)||B.test(S)||q.test(S)||H.test(S)||P.test(S))break;if(Q.search(this.rules.other.nonSpaceChar)>=R||!S.trim())y+=`
|
|
462
|
+
`+Q.slice(R);else{if(_||v.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||N.test(v)||D.test(v)||P.test(v))break;y+=`
|
|
463
|
+
`+S}_=!S.trim(),p+=F+`
|
|
464
|
+
`,n=n.substring(F.length+1),v=Q.slice(R)}}a.loose||(c?a.loose=!0:this.rules.other.doubleBlankLine.test(p)&&(c=!0)),a.items.push({type:"list_item",raw:p,task:!!this.options.gfm&&this.rules.other.listIsTask.test(y),loose:!1,text:y,tokens:[]}),a.raw+=p}let u=a.items.at(-1);if(u)u.raw=u.raw.trimEnd(),u.text=u.text.trimEnd();else return;a.raw=a.raw.trimEnd();for(let f of a.items){if(this.lexer.state.top=!1,f.tokens=this.lexer.blockTokens(f.text,[]),f.task){if(f.text=f.text.replace(this.rules.other.listReplaceTask,""),((e=f.tokens[0])==null?void 0:e.type)==="text"||((r=f.tokens[0])==null?void 0:r.type)==="paragraph"){f.tokens[0].raw=f.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),f.tokens[0].text=f.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let y=this.lexer.inlineQueue.length-1;y>=0;y--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[y].src)){this.lexer.inlineQueue[y].src=this.lexer.inlineQueue[y].src.replace(this.rules.other.listReplaceTask,"");break}}let p=this.rules.other.listTaskCheckbox.exec(f.raw);if(p){let y={type:"checkbox",raw:p[0]+" ",checked:p[0]!=="[ ]"};f.checked=y.checked,a.loose?f.tokens[0]&&["paragraph","text"].includes(f.tokens[0].type)&&"tokens"in f.tokens[0]&&f.tokens[0].tokens?(f.tokens[0].raw=y.raw+f.tokens[0].raw,f.tokens[0].text=y.raw+f.tokens[0].text,f.tokens[0].tokens.unshift(y)):f.tokens.unshift({type:"paragraph",raw:y.raw,text:y.raw,tokens:[y]}):f.tokens.unshift(y)}}if(!a.loose){let p=f.tokens.filter(v=>v.type==="space"),y=p.length>0&&p.some(v=>this.rules.other.anyLine.test(v.raw));a.loose=y}}if(a.loose)for(let f of a.items){f.loose=!0;for(let p of f.tokens)p.type==="text"&&(p.type="paragraph")}return a}}html(n){let t=this.rules.block.html.exec(n);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(n){let t=this.rules.block.def.exec(n);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:r,title:i}}}table(n){var a;let t=this.rules.block.table.exec(n);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let e=H8(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
465
|
+
`):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(e.length===r.length){for(let l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<e.length;l++)o.header.push({text:e[l],tokens:this.lexer.inline(e[l]),header:!0,align:o.align[l]});for(let l of i)o.rows.push(H8(l,o.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[u]})));return o}}lheading(n){let t=this.rules.block.lheading.exec(n);if(t){let e=t[1].trim();return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:e,tokens:this.lexer.inline(e)}}}paragraph(n){let t=this.rules.block.paragraph.exec(n);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
466
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(n){let t=this.rules.block.text.exec(n);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(n){let t=this.rules.inline.escape.exec(n);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(n){let t=this.rules.inline.tag.exec(n);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(n){let t=this.rules.inline.link.exec(n);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let o=Kc(e.slice(0,-1),"\\");if((e.length-o.length)%2===0)return}else{let o=r7(t[2],"()");if(o===-2)return;if(o>-1){let a=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,a).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){let o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?r=r.slice(1):r=r.slice(1,-1)),Z8(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(n,t){let e;if((e=this.rules.inline.reflink.exec(n))||(e=this.rules.inline.nolink.exec(n))){let r=(e[2]||e[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){let o=e[0].charAt(0);return{type:"text",raw:o,text:o}}return Z8(e,i,e[0],this.lexer,this.rules)}}emStrong(n,t,e=""){let r=this.rules.inline.emStrongLDelim.exec(n);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&e.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,o,a,l=i,c=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*n.length+i);(r=u.exec(t))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o)continue;if(a=[...o].length,r[3]||r[4]){l+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){c+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l+c);let f=[...r[0]][0].length,p=n.slice(0,i+r.index+f+a);if(Math.min(i,a)%2){let v=p.slice(1,-1);return{type:"em",raw:p,text:v,tokens:this.lexer.inlineTokens(v)}}let y=p.slice(2,-2);return{type:"strong",raw:p,text:y,tokens:this.lexer.inlineTokens(y)}}}}codespan(n){let t=this.rules.inline.code.exec(n);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return r&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(n){let t=this.rules.inline.br.exec(n);if(t)return{type:"br",raw:t[0]}}del(n,t,e=""){let r=this.rules.inline.delLDelim.exec(n);if(r&&(!r[1]||!e||this.rules.inline.punctuation.exec(e))){let i=[...r[0]].length-1,o,a,l=i,c=this.rules.inline.delRDelim;for(c.lastIndex=0,t=t.slice(-1*n.length+i);(r=c.exec(t))!=null;){if(o=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!o||(a=[...o].length,a!==i))continue;if(r[3]||r[4]){l+=a;continue}if(l-=a,l>0)continue;a=Math.min(a,a+l);let u=[...r[0]][0].length,f=n.slice(0,i+r.index+u+a),p=f.slice(i,-i);return{type:"del",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}autolink(n){let t=this.rules.inline.autolink.exec(n);if(t){let e,r;return t[2]==="@"?(e=t[1],r="mailto:"+e):(e=t[1],r=e),{type:"link",raw:t[0],text:e,href:r,tokens:[{type:"text",raw:e,text:e}]}}}url(n){var e;let t;if(t=this.rules.inline.url.exec(n)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((e=this.rules.inline._backpedal.exec(t[0]))==null?void 0:e[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let t=this.rules.inline.text.exec(n);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Xn=class G1{constructor(t){I(this,"tokens");I(this,"options");I(this,"state");I(this,"inlineQueue");I(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=t||Ca,this.options.tokenizer=this.options.tokenizer||new Sf,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let e={other:Ot,block:Ed.normal,inline:Yc.normal};this.options.pedantic?(e.block=Ed.pedantic,e.inline=Yc.pedantic):this.options.gfm&&(e.block=Ed.gfm,this.options.breaks?e.inline=Yc.breaks:e.inline=Yc.gfm),this.tokenizer.rules=e}static get rules(){return{block:Ed,inline:Yc}}static lex(t,e){return new G1(e).lex(t)}static lexInline(t,e){return new G1(e).inlineTokens(t)}lex(t){t=t.replace(Ot.carriageReturn,`
|
|
467
|
+
`),this.blockTokens(t,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let r=this.inlineQueue[e];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(t,e=[],r=!1){var i,o,a;for(this.tokenizer.lexer=this,this.options.pedantic&&(t=t.replace(Ot.tabCharGlobal," ").replace(Ot.spaceLine,""));t;){let l;if((o=(i=this.options.extensions)==null?void 0:i.block)!=null&&o.some(u=>(l=u.call({lexer:this},t,e))?(t=t.substring(l.raw.length),e.push(l),!0):!1))continue;if(l=this.tokenizer.space(t)){t=t.substring(l.raw.length);let u=e.at(-1);l.raw.length===1&&u!==void 0?u.raw+=`
|
|
468
|
+
`:e.push(l);continue}if(l=this.tokenizer.code(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
469
|
+
`)?"":`
|
|
470
|
+
`)+l.raw,u.text+=`
|
|
471
|
+
`+l.text,this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(l=this.tokenizer.fences(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.heading(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.hr(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.blockquote(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.list(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.html(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.def(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="paragraph"||(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
472
|
+
`)?"":`
|
|
473
|
+
`)+l.raw,u.text+=`
|
|
474
|
+
`+l.raw,this.inlineQueue.at(-1).src=u.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},e.push(l));continue}if(l=this.tokenizer.table(t)){t=t.substring(l.raw.length),e.push(l);continue}if(l=this.tokenizer.lheading(t)){t=t.substring(l.raw.length),e.push(l);continue}let c=t;if((a=this.options.extensions)!=null&&a.startBlock){let u=1/0,f=t.slice(1),p;this.options.extensions.startBlock.forEach(y=>{p=y.call({lexer:this},f),typeof p=="number"&&p>=0&&(u=Math.min(u,p))}),u<1/0&&u>=0&&(c=t.substring(0,u+1))}if(this.state.top&&(l=this.tokenizer.paragraph(c))){let u=e.at(-1);r&&(u==null?void 0:u.type)==="paragraph"?(u.raw+=(u.raw.endsWith(`
|
|
475
|
+
`)?"":`
|
|
476
|
+
`)+l.raw,u.text+=`
|
|
477
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l),r=c.length!==t.length,t=t.substring(l.raw.length);continue}if(l=this.tokenizer.text(t)){t=t.substring(l.raw.length);let u=e.at(-1);(u==null?void 0:u.type)==="text"?(u.raw+=(u.raw.endsWith(`
|
|
478
|
+
`)?"":`
|
|
479
|
+
`)+l.raw,u.text+=`
|
|
480
|
+
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=u.text):e.push(l);continue}if(t){let u="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(u);break}else throw new Error(u)}}return this.state.top=!0,e}inline(t,e=[]){return this.inlineQueue.push({src:t,tokens:e}),e}inlineTokens(t,e=[]){var c,u,f,p,y;this.tokenizer.lexer=this;let r=t,i=null;if(this.tokens.links){let v=Object.keys(this.tokens.links);if(v.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!=null;)v.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!=null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let o;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!=null;)o=i[2]?i[2].length:0,r=r.slice(0,i.index+o)+"["+"a".repeat(i[0].length-o-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=((u=(c=this.options.hooks)==null?void 0:c.emStrongMask)==null?void 0:u.call({lexer:this},r))??r;let a=!1,l="";for(;t;){a||(l=""),a=!1;let v;if((p=(f=this.options.extensions)==null?void 0:f.inline)!=null&&p.some(_=>(v=_.call({lexer:this},t,e))?(t=t.substring(v.raw.length),e.push(v),!0):!1))continue;if(v=this.tokenizer.escape(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.tag(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.link(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.reflink(t,this.tokens.links)){t=t.substring(v.raw.length);let _=e.at(-1);v.type==="text"&&(_==null?void 0:_.type)==="text"?(_.raw+=v.raw,_.text+=v.text):e.push(v);continue}if(v=this.tokenizer.emStrong(t,r,l)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.codespan(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.br(t)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.del(t,r,l)){t=t.substring(v.raw.length),e.push(v);continue}if(v=this.tokenizer.autolink(t)){t=t.substring(v.raw.length),e.push(v);continue}if(!this.state.inLink&&(v=this.tokenizer.url(t))){t=t.substring(v.raw.length),e.push(v);continue}let S=t;if((y=this.options.extensions)!=null&&y.startInline){let _=1/0,R=t.slice(1),H;this.options.extensions.startInline.forEach(P=>{H=P.call({lexer:this},R),typeof H=="number"&&H>=0&&(_=Math.min(_,H))}),_<1/0&&_>=0&&(S=t.substring(0,_+1))}if(v=this.tokenizer.inlineText(S)){t=t.substring(v.raw.length),v.raw.slice(-1)!=="_"&&(l=v.raw.slice(-1)),a=!0;let _=e.at(-1);(_==null?void 0:_.type)==="text"?(_.raw+=v.raw,_.text+=v.text):e.push(v);continue}if(t){let _="Infinite loop on byte: "+t.charCodeAt(0);if(this.options.silent){console.error(_);break}else throw new Error(_)}}return e}},_f=class{constructor(n){I(this,"options");I(this,"parser");this.options=n||Ca}space(n){return""}code({text:n,lang:t,escaped:e}){var o;let r=(o=(t||"").match(Ot.notSpaceStart))==null?void 0:o[0],i=n.replace(Ot.endingNewline,"")+`
|
|
481
|
+
`;return r?'<pre><code class="language-'+ur(r)+'">'+(e?i:ur(i,!0))+`</code></pre>
|
|
482
|
+
`:"<pre><code>"+(e?i:ur(i,!0))+`</code></pre>
|
|
483
|
+
`}blockquote({tokens:n}){return`<blockquote>
|
|
484
|
+
${this.parser.parse(n)}</blockquote>
|
|
485
|
+
`}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:t}){return`<h${t}>${this.parser.parseInline(n)}</h${t}>
|
|
486
|
+
`}hr(n){return`<hr>
|
|
487
|
+
`}list(n){let t=n.ordered,e=n.start,r="";for(let a=0;a<n.items.length;a++){let l=n.items[a];r+=this.listitem(l)}let i=t?"ol":"ul",o=t&&e!==1?' start="'+e+'"':"";return"<"+i+o+`>
|
|
488
|
+
`+r+"</"+i+`>
|
|
489
|
+
`}listitem(n){return`<li>${this.parser.parse(n.tokens)}</li>
|
|
490
|
+
`}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
|
|
491
|
+
`}table(n){let t="",e="";for(let i=0;i<n.header.length;i++)e+=this.tablecell(n.header[i]);t+=this.tablerow({text:e});let r="";for(let i=0;i<n.rows.length;i++){let o=n.rows[i];e="";for(let a=0;a<o.length;a++)e+=this.tablecell(o[a]);r+=this.tablerow({text:e})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
492
|
+
<thead>
|
|
493
|
+
`+t+`</thead>
|
|
494
|
+
`+r+`</table>
|
|
495
|
+
`}tablerow({text:n}){return`<tr>
|
|
496
|
+
${n}</tr>
|
|
497
|
+
`}tablecell(n){let t=this.parser.parseInline(n.tokens),e=n.header?"th":"td";return(n.align?`<${e} align="${n.align}">`:`<${e}>`)+t+`</${e}>
|
|
498
|
+
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${ur(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:t,tokens:e}){let r=this.parser.parseInline(e),i=z8(n);if(i===null)return r;n=i;let o='<a href="'+n+'"';return t&&(o+=' title="'+ur(t)+'"'),o+=">"+r+"</a>",o}image({href:n,title:t,text:e,tokens:r}){r&&(e=this.parser.parseInline(r,this.parser.textRenderer));let i=z8(n);if(i===null)return ur(e);n=i;let o=`<img src="${n}" alt="${ur(e)}"`;return t&&(o+=` title="${ur(t)}"`),o+=">",o}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:ur(n.text)}},dy=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}checkbox({raw:n}){return n}},Qn=class J1{constructor(t){I(this,"options");I(this,"renderer");I(this,"textRenderer");this.options=t||Ca,this.options.renderer=this.options.renderer||new _f,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new dy}static parse(t,e){return new J1(e).parse(t)}static parseInline(t,e){return new J1(e).parseInline(t)}parse(t){var r,i;this.renderer.parser=this;let e="";for(let o=0;o<t.length;o++){let a=t[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){let c=a,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){e+=u||"";continue}}let l=a;switch(l.type){case"space":{e+=this.renderer.space(l);break}case"hr":{e+=this.renderer.hr(l);break}case"heading":{e+=this.renderer.heading(l);break}case"code":{e+=this.renderer.code(l);break}case"table":{e+=this.renderer.table(l);break}case"blockquote":{e+=this.renderer.blockquote(l);break}case"list":{e+=this.renderer.list(l);break}case"checkbox":{e+=this.renderer.checkbox(l);break}case"html":{e+=this.renderer.html(l);break}case"def":{e+=this.renderer.def(l);break}case"paragraph":{e+=this.renderer.paragraph(l);break}case"text":{e+=this.renderer.text(l);break}default:{let c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return e}parseInline(t,e=this.renderer){var i,o;this.renderer.parser=this;let r="";for(let a=0;a<t.length;a++){let l=t[a];if((o=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&o[l.type]){let u=this.options.extensions.renderers[l.type].call({parser:this},l);if(u!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(l.type)){r+=u||"";continue}}let c=l;switch(c.type){case"escape":{r+=e.text(c);break}case"html":{r+=e.html(c);break}case"link":{r+=e.link(c);break}case"image":{r+=e.image(c);break}case"checkbox":{r+=e.checkbox(c);break}case"strong":{r+=e.strong(c);break}case"em":{r+=e.em(c);break}case"codespan":{r+=e.codespan(c);break}case"br":{r+=e.br(c);break}case"del":{r+=e.del(c);break}case"text":{r+=e.text(c);break}default:{let u='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(u),"";throw new Error(u)}}}return r}},Cd,vu=(Cd=class{constructor(n){I(this,"options");I(this,"block");this.options=n||Ca}preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?Xn.lex:Xn.lexInline}provideParser(){return this.block?Qn.parse:Qn.parseInline}},I(Cd,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),I(Cd,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Cd),o7=class{constructor(...n){I(this,"defaults",iy());I(this,"options",this.setOptions);I(this,"parse",this.parseMarkdown(!0));I(this,"parseInline",this.parseMarkdown(!1));I(this,"Parser",Qn);I(this,"Renderer",_f);I(this,"TextRenderer",dy);I(this,"Lexer",Xn);I(this,"Tokenizer",Sf);I(this,"Hooks",vu);this.use(...n)}walkTokens(n,t){var r,i;let e=[];for(let o of n)switch(e=e.concat(t.call(this,o)),o.type){case"table":{let a=o;for(let l of a.header)e=e.concat(this.walkTokens(l.tokens,t));for(let l of a.rows)for(let c of l)e=e.concat(this.walkTokens(c.tokens,t));break}case"list":{let a=o;e=e.concat(this.walkTokens(a.items,t));break}default:{let a=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{let c=a[l].flat(1/0);e=e.concat(this.walkTokens(c,t))}):a.tokens&&(e=e.concat(this.walkTokens(a.tokens,t)))}}return e}use(...n){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(e=>{let r={...e};if(r.async=this.defaults.async||r.async||!1,e.extensions&&(e.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),e.renderer){let i=this.defaults.renderer||new _f(this.defaults);for(let o in e.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;let a=o,l=e.renderer[a],c=i[a];i[a]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f||""}}r.renderer=i}if(e.tokenizer){let i=this.defaults.tokenizer||new Sf(this.defaults);for(let o in e.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;let a=o,l=e.tokenizer[a],c=i[a];i[a]=(...u)=>{let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.tokenizer=i}if(e.hooks){let i=this.defaults.hooks||new vu;for(let o in e.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;let a=o,l=e.hooks[a],c=i[a];vu.passThroughHooks.has(o)?i[a]=u=>{if(this.defaults.async&&vu.passThroughHooksRespectAsync.has(o))return(async()=>{let p=await l.call(i,u);return c.call(i,p)})();let f=l.call(i,u);return c.call(i,f)}:i[a]=(...u)=>{if(this.defaults.async)return(async()=>{let p=await l.apply(i,u);return p===!1&&(p=await c.apply(i,u)),p})();let f=l.apply(i,u);return f===!1&&(f=c.apply(i,u)),f}}r.hooks=i}if(e.walkTokens){let i=this.defaults.walkTokens,o=e.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,t){return Xn.lex(n,t??this.defaults)}parser(n,t){return Qn.parse(n,t??this.defaults)}parseMarkdown(n){return(t,e)=>{let r={...e},i={...this.defaults,...r},o=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return o(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return o(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return o(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=n),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(t):t,l=await(i.hooks?await i.hooks.provideLexer():n?Xn.lex:Xn.lexInline)(a,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser():n?Qn.parse:Qn.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(o);try{i.hooks&&(t=i.hooks.preprocess(t));let a=(i.hooks?i.hooks.provideLexer():n?Xn.lex:Xn.lexInline)(t,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():n?Qn.parse:Qn.parseInline)(a,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(a){return o(a)}}}onError(n,t){return e=>{if(e.message+=`
|
|
499
|
+
Please report this to https://github.com/markedjs/marked.`,n){let r="<p>An error occurred:</p><pre>"+ur(e.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(e);throw e}}},Aa=new o7;function Re(n,t){return Aa.parse(n,t)}Re.options=Re.setOptions=function(n){return Aa.setOptions(n),Re.defaults=Aa.defaults,e4(Re.defaults),Re};Re.getDefaults=iy;Re.defaults=Ca;Re.use=function(...n){return Aa.use(...n),Re.defaults=Aa.defaults,e4(Re.defaults),Re};Re.walkTokens=function(n,t){return Aa.walkTokens(n,t)};Re.parseInline=Aa.parseInline;Re.Parser=Qn;Re.parser=Qn.parse;Re.Renderer=_f;Re.TextRenderer=dy;Re.Lexer=Xn;Re.lexer=Xn.lex;Re.Tokenizer=Sf;Re.Hooks=vu;Re.parse=Re;Re.options;Re.setOptions;Re.use;Re.walkTokens;Re.parseInline;Qn.parse;Xn.lex;QA.addHook("afterSanitizeAttributes",n=>{n.tagName==="A"&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))});function u4(n){const t=Re.parse(n,{async:!1});return QA.sanitize(t,{USE_PROFILES:{html:!0}})}const U8={restart_to_update:"Restart to update",restarting:"Restarting…"};var na,Ih,Jn,Hf,h4,Gl,Zf;class a7 extends mn{constructor(){super(...arguments);m(this,Hf);m(this,na,null);m(this,Ih,er());m(this,Jn,null);m(this,Gl,()=>{this.render()});m(this,Zf,()=>{var e;(e=s(this,Jn))==null||e.restart()})}connected(){queueMicrotask(()=>{var r;if(!this.isConnected||s(this,na)!==null)return;const e=((r=s(this,Ih).value)==null?void 0:r.querySelector("dialog"))??null;if(e===null)throw new Error("Desktop upgrade gate requires its composed dialog");d(this,na,zp(e,()=>{}))})}disconnected(){var e,r;(e=s(this,na))==null||e.withdraw(),d(this,na,null),(r=s(this,Jn))==null||r.removeEventListener("change",s(this,Gl)),d(this,Jn,null)}template(e,r,i){var l,c;h(this,Hf,h4).call(this,r??null);const o=((l=s(this,Jn))==null?void 0:l.version)??null,a=((c=s(this,Jn))==null?void 0:c.restarting)??!1;return V`
|
|
500
|
+
<div class="desktop-upgrade-gate" ${ft(s(this,Ih))}>
|
|
501
|
+
${Np(V`<div class="upgrade-gate-body" data-testid="upgrade-gate-body">${GA(u4(k_(e,o!==null)))}</div>${o===null?oe:V`<div class="upgrade-gate-actions"><button
|
|
502
|
+
intent="primary"
|
|
503
|
+
class="upgrade-gate-restart"
|
|
504
|
+
?disabled=${a}
|
|
505
|
+
@click=${s(this,Zf)}
|
|
506
|
+
>${a?U8.restarting:U8.restart_to_update}</button></div>`}`,i)}
|
|
507
|
+
</div>
|
|
508
|
+
`}}na=new WeakMap,Ih=new WeakMap,Jn=new WeakMap,Hf=new WeakSet,h4=function(e){var r;e!==s(this,Jn)&&((r=s(this,Jn))==null||r.removeEventListener("change",s(this,Gl)),d(this,Jn,e),e==null||e.addEventListener("change",s(this,Gl)),e==null||e.subscribe())},Gl=new WeakMap,Zf=new WeakMap;const l7=gn(a7),c7=1400,kd=new WeakMap;function u7(n,t){var o;const e=t.ownerDocument,r=(o=e.defaultView)==null?void 0:o.navigator.clipboard;if(r&&typeof r.writeText=="function"){r.writeText(n).catch(()=>{});return}const i=e.createElement("textarea");i.value=n,i.setAttribute("readonly",""),i.style.position="fixed",i.style.opacity="0",e.body.append(i),i.select();try{e.execCommand("copy")}catch{}i.remove()}const h7={writeClipboard:u7,scheduler:{setTimeout(n,t){return globalThis.setTimeout(n,t)},clearTimeout(n){globalThis.clearTimeout(n)}}};function d7(n,t,e){const r=n.currentTarget;if(!r)return;t.writeClipboard(r.getAttribute("prompt")??"",r),r.toggleAttribute("copied",!0);const i=r.nextElementSibling,o=i!=null&&i.classList.contains("copy-button-status")?i:null;o&&(o.textContent="",o.textContent="Copied");const a=kd.get(r);a&&a.scheduler.clearTimeout(a.handle);const l={handle:void 0,scheduler:t.scheduler};l.handle=t.scheduler.setTimeout(()=>{kd.get(r)===l&&(kd.delete(r),r.toggleAttribute("copied",!1),o&&(o.textContent=""))},c7),kd.set(r,l),e()}function f7({label:n,prompt:t="",intent:e,size:r="sm",copied:i=!1,onActivate:o=()=>{}},a=h7){return V`
|
|
509
|
+
<button
|
|
510
|
+
class="copy-button"
|
|
511
|
+
size=${r==="default"?oe:r}
|
|
512
|
+
aria-label=${n}
|
|
513
|
+
intent=${e}
|
|
514
|
+
?copied=${i}
|
|
515
|
+
prompt=${t}
|
|
516
|
+
@click=${l=>d7(l,a,o)}
|
|
517
|
+
>
|
|
518
|
+
<span class="copy-button-idle"><tv-icon name="copy"></tv-icon>${n}</span>
|
|
519
|
+
<span class="copy-button-done"><tv-icon name="check"></tv-icon>Copied</span>
|
|
520
|
+
</button>
|
|
521
|
+
<span
|
|
522
|
+
class="copy-button-status"
|
|
523
|
+
role="status"
|
|
524
|
+
aria-live="polite"
|
|
525
|
+
>${i?"Copied":oe}</span
|
|
526
|
+
>
|
|
527
|
+
`}const d4="1.4.0",p7="tv-desktop-upgrade-recommendation-dismissed",m7=`### Recommended desktop upgrade available
|
|
528
|
+
|
|
529
|
+
The Television desktop app is now a downloaded Mac app that updates itself. This copy was installed with npm and receives no more updates.
|
|
530
|
+
|
|
531
|
+
To move to the downloaded app on an Apple Silicon Mac:
|
|
532
|
+
|
|
533
|
+
1. [Download Television for Mac](https://dl.todesktop.com/260923p52umxx/mac/dmg/arm64).
|
|
534
|
+
2. Open the downloaded disk image and drag Television to Applications.
|
|
535
|
+
3. Quit this app, then open Television from Applications. It keeps your saved server connection.
|
|
536
|
+
|
|
537
|
+
From then on, open Television from Applications, not with \`tv-desktop\`.`;function g7(n){var t;return!n.electron||n.noticesSuppressed||((t=n.updateState)==null?void 0:t.toast)!=null||n.shellVersion===null||!kp(n.shellVersion)||n.shellVersion===af?!1:Hv(d4,n.shellVersion)}var Jl;class f4 extends HTMLElement{constructor(){super(...arguments);m(this,Jl,new ey(this))}connectedCallback(){s(this,Jl).connect()}disconnectedCallback(){s(this,Jl).disconnect()}attributeChangedCallback(){s(this,Jl).refresh()}}Jl=new WeakMap,I(f4,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-popover")||customElements.define("tv-popover",f4);const v7="tv-update-dismissed",Ha={update_available:"Update available",copy_prompt:"Copy upgrade prompt",later:"Later",restart_to_update:"Restart to update",restarting:"Restarting…"},y7="update-popover";function w7(n,t){const e=n.target;if(!(e instanceof Element))return!1;const r=e.closest("button, a[href], input, select, textarea, [tabindex]");return r!==null&&t.contains(r)}var Yl,gi,Kl,$h,xh,Uf;class b7 extends mn{constructor(){super(...arguments);m(this,Yl);m(this,gi);m(this,Kl,!1);m(this,$h,()=>{});m(this,xh,()=>{});m(this,Uf,e=>{var r;(r=s(this,gi))==null||r.disconnect(),d(this,gi,void 0),d(this,Yl,e),d(this,Kl,(e==null?void 0:e.hasAttribute("open"))??!1),e&&(d(this,gi,new MutationObserver(()=>{const i=e.hasAttribute("open");i!==s(this,Kl)&&(d(this,Kl,i),i?s(this,$h).call(this):s(this,xh).call(this))})),s(this,gi).observe(e,{attributes:!0,attributeFilter:["open"]}))})}disconnected(){var e;(e=s(this,gi))==null||e.disconnect(),d(this,gi,void 0),d(this,Yl,void 0)}template({body:e,prompt:r,copied:i=!1,restart:o,panelRef:a,bellRef:l,onPresent:c=()=>{},onDismiss:u=()=>{},onCopy:f=()=>{},onRestart:p=()=>{}}){d(this,$h,c),d(this,xh,u);const y=()=>{var S;(S=s(this,Yl))==null||S.removeAttribute("open")},v=S=>{const _=S.currentTarget;S.key!=="Escape"||!w7(S,_)||(S.preventDefault(),S.stopPropagation(),_.removeAttribute("open"))};return V`
|
|
538
|
+
<button
|
|
539
|
+
class="update-bell"
|
|
540
|
+
id="update-bell"
|
|
541
|
+
icon
|
|
542
|
+
intent="alert"
|
|
543
|
+
aria-label=${Ha.update_available}
|
|
544
|
+
title=${Ha.update_available}
|
|
545
|
+
${l===void 0?oe:ft(l)}
|
|
546
|
+
>
|
|
547
|
+
<tv-icon name="notification" size="sm"></tv-icon>
|
|
548
|
+
</button>
|
|
549
|
+
|
|
550
|
+
<tv-popover
|
|
551
|
+
id=${y7}
|
|
552
|
+
manual
|
|
553
|
+
trigger="update-bell"
|
|
554
|
+
role="status"
|
|
555
|
+
class="update-popover"
|
|
556
|
+
${ft(s(this,Uf))}
|
|
557
|
+
${a===void 0?oe:ft(a)}
|
|
558
|
+
@keydown=${v}
|
|
559
|
+
>
|
|
560
|
+
${e}
|
|
561
|
+
<div class="update-actions">
|
|
562
|
+
<button size="sm" class="update-later" @click=${y}
|
|
563
|
+
>${Ha.later}</button
|
|
564
|
+
>
|
|
565
|
+
${r===void 0?oe:f7({label:Ha.copy_prompt,prompt:r,intent:"primary",copied:i,onActivate:f})}
|
|
566
|
+
${o===void 0?oe:V`<button
|
|
567
|
+
size="sm"
|
|
568
|
+
intent="primary"
|
|
569
|
+
class="update-restart"
|
|
570
|
+
?disabled=${o==="restarting"}
|
|
571
|
+
@click=${p}
|
|
572
|
+
>${o==="restarting"?Ha.restarting:Ha.restart_to_update}</button>`}
|
|
573
|
+
</div>
|
|
574
|
+
</tv-popover>
|
|
575
|
+
`}}Yl=new WeakMap,gi=new WeakMap,Kl=new WeakMap,$h=new WeakMap,xh=new WeakMap,Uf=new WeakMap;const S7=gn(b7);function _7(n,t){return t===null?!0:Hv(n,t)}const q8=new Set;var Cn,hn,Ph,dn,Xl,Ir,ra,ia,sa,Ql,St,vi,oa,ec,tc,aa,Ts,ee,Y1,K1,X1,Q1,ev,tv,nv,la,ca,Yd,yu,rv,p4,iv,sv,ov,qf,Ff,Vf,Bf,jf,Wf,wu,m4;class A7{constructor(t=()=>{}){m(this,ee);m(this,Cn,null);m(this,hn,null);m(this,Ph,null);m(this,dn,null);m(this,Xl);m(this,Ir,!1);m(this,ra,!1);m(this,ia,!1);m(this,sa,!1);m(this,Ql,null);m(this,St,!1);m(this,vi,!1);m(this,oa,null);m(this,ec,null);m(this,tc,!1);m(this,aa,[]);m(this,Ts);m(this,la,()=>{s(this,Ts).call(this)});m(this,ca,()=>{h(this,ee,ov).call(this),s(this,Ts).call(this)});m(this,qf,()=>{var e;const t=h(this,ee,yu).call(this,((e=s(this,hn))==null?void 0:e.toastsSuppressed)??!1);t===null||s(this,St)||(d(this,St,!0),t.kind==="server"&&h(this,ee,iv).call(this,t.toast),s(this,Ts).call(this))});m(this,Ff,()=>{var e,r;if(!s(this,St))return;const t=h(this,ee,yu).call(this,((e=s(this,hn))==null?void 0:e.toastsSuppressed)??!1);t!==null&&((r=h(this,ee,Y1).call(this))==null||r.setItem(h(this,ee,rv).call(this,t),t.version)),d(this,St,!1),d(this,vi,!0),s(this,Ts).call(this)});m(this,Vf,()=>{var t;(t=s(this,dn))==null||t.restart()});m(this,Bf,()=>{var e;const t=h(this,ee,yu).call(this,((e=s(this,hn))==null?void 0:e.toastsSuppressed)??!1);(t==null?void 0:t.kind)!=="server"||t.prompt===void 0||h(this,ee,sv).call(this,"update_prompt_copy_clicked",t.toast)});m(this,jf,t=>{d(this,oa,t instanceof HTMLElement?t:null),h(this,ee,wu).call(this)});m(this,Wf,t=>{d(this,ec,t instanceof HTMLElement?t:null),h(this,ee,wu).call(this)});d(this,Ts,t)}get presented(){return s(this,St)}configure({connectionOwner:t=null,presentation:e=null,dismissalStorage:r,desktopRecommendation:i=null,desktopUpdate:o=null}){t!==s(this,Cn)&&(h(this,ee,X1).call(this),d(this,Cn,t),h(this,ee,K1).call(this)),e!==s(this,hn)&&(h(this,ee,ev).call(this),d(this,hn,e),h(this,ee,Q1).call(this)),o!==s(this,dn)&&(h(this,ee,nv).call(this),d(this,dn,o),h(this,ee,tv).call(this)),d(this,Xl,r),d(this,Ph,i)}connect(){s(this,Ir)||(d(this,Ir,!0),h(this,ee,K1).call(this),h(this,ee,Q1).call(this),h(this,ee,tv).call(this))}disconnect(){s(this,Ir)&&(h(this,ee,X1).call(this),h(this,ee,ev).call(this),h(this,ee,nv).call(this),d(this,Ir,!1),d(this,oa,null),d(this,ec,null))}template(){var l,c,u;const t=((l=s(this,hn))==null?void 0:l.toastsSuppressed)??!1,e=h(this,ee,yu).call(this,t),r=e===null?null:`${e.kind}:${e.version}`;if(e===null?(d(this,Ql,null),d(this,St,!1),d(this,vi,!0)):r!==s(this,Ql)&&(d(this,Ql,r),d(this,St,h(this,ee,p4).call(this,e)),d(this,vi,!0),s(this,St)&&e.kind==="server"&&!t&&h(this,ee,iv).call(this,e.toast)),e===null||t)return d(this,St,!1),d(this,vi,!0),h(this,ee,wu).call(this),oe;const i=(c=s(this,oa))==null?void 0:c.querySelector(".copy-button"),o=s(this,St)&&!s(this,vi)&&(i==null?void 0:i.hasAttribute("copied"))===!0,a=S7({body:GA(u4(e.markdown)),prompt:e.kind==="server"?e.prompt:void 0,copied:o,restart:e.kind!=="desktop-self-update"?void 0:(u=s(this,dn))!=null&&u.restarting?"restarting":"ready",presented:s(this,St),panelRef:s(this,jf),bellRef:s(this,Wf),onPresent:s(this,qf),onDismiss:s(this,Ff),onCopy:s(this,Bf),onRestart:s(this,Vf)});return d(this,vi,!1),h(this,ee,wu).call(this),a}}Cn=new WeakMap,hn=new WeakMap,Ph=new WeakMap,dn=new WeakMap,Xl=new WeakMap,Ir=new WeakMap,ra=new WeakMap,ia=new WeakMap,sa=new WeakMap,Ql=new WeakMap,St=new WeakMap,vi=new WeakMap,oa=new WeakMap,ec=new WeakMap,tc=new WeakMap,aa=new WeakMap,Ts=new WeakMap,ee=new WeakSet,Y1=function(){return s(this,Xl)!==void 0?s(this,Xl):typeof localStorage>"u"?null:localStorage},K1=function(){!s(this,Ir)||s(this,ra)||s(this,Cn)===null||(s(this,Cn).addEventListener("server-status",s(this,ca)),s(this,Cn).addEventListener("change",s(this,ca)),d(this,ra,!0))},X1=function(){!s(this,ra)||s(this,Cn)===null||(s(this,Cn).removeEventListener("server-status",s(this,ca)),s(this,Cn).removeEventListener("change",s(this,ca)),d(this,ra,!1))},Q1=function(){!s(this,Ir)||s(this,ia)||s(this,hn)===null||(s(this,hn).addEventListener("change",s(this,la)),d(this,ia,!0))},ev=function(){!s(this,ia)||s(this,hn)===null||(s(this,hn).removeEventListener("change",s(this,la)),d(this,ia,!1))},tv=function(){!s(this,Ir)||s(this,sa)||s(this,dn)===null||(s(this,dn).addEventListener("change",s(this,la)),s(this,dn).subscribe(),d(this,sa,!0))},nv=function(){!s(this,sa)||s(this,dn)===null||(s(this,dn).removeEventListener("change",s(this,la)),d(this,sa,!1))},la=new WeakMap,ca=new WeakMap,Yd=function(){var t;return((t=s(this,Cn))==null?void 0:t.connection)??null},yu=function(t){var a,l;const e=((a=h(this,ee,Yd).call(this))==null?void 0:a.updateState)??null,r=(e==null?void 0:e.toast)??null;if(r!==null)return{kind:"server",version:r.version,markdown:r.markdown,...r.prompt===void 0?{}:{prompt:r.prompt},toast:r};const i=t?null:((l=s(this,dn))==null?void 0:l.version)??null;if(i!==null)return{kind:"desktop-self-update",version:i,markdown:XO(i)};const o=s(this,Ph);return o!==null&&g7({...o,noticesSuppressed:t,updateState:e})?{kind:"recommendation",version:d4,markdown:m7}:null},rv=function(t){switch(t.kind){case"server":return v7;case"desktop-self-update":return KO;case"recommendation":return p7}},p4=function(t){var r;const e=((r=h(this,ee,Y1).call(this))==null?void 0:r.getItem(h(this,ee,rv).call(this,t)))??null;return t.kind==="desktop-self-update"?e!==t.version:_7(t.version,e!==null&&kp(e)?e:null)},iv=function(t){q8.has(t.version)||(q8.add(t.version),h(this,ee,sv).call(this,"update_toast_shown",t))},sv=function(t,e){var r;s(this,aa).push({event:t,properties:{server_version:((r=h(this,ee,Yd).call(this))==null?void 0:r.serverVersion)??"",channel_version:e.version}}),h(this,ee,ov).call(this)},ov=function(){if(s(this,aa).length===0)return;const t=h(this,ee,Yd).call(this);if(!t||t.status!=="connected")return;const e=s(this,aa);d(this,aa,[]);for(const r of e)t.sendTelemetrySignal(r.event,r.properties)},qf=new WeakMap,Ff=new WeakMap,Vf=new WeakMap,Bf=new WeakMap,jf=new WeakMap,Wf=new WeakMap,wu=function(){s(this,tc)||(d(this,tc,!0),queueMicrotask(()=>{d(this,tc,!1),h(this,ee,m4).call(this)}))},m4=function(){const t=s(this,oa);t!==null&&(s(this,St)&&s(this,ec)===null||t.toggleAttribute("open",s(this,St)))};const Ii=3;var Dh;class E7{constructor(){I(this,"query","");I(this,"highlighted",null);m(this,Dh,[])}get matches(){const t=this.query.trim().toLowerCase();return s(this,Dh).filter(e=>e.name.toLowerCase().includes(t))}update(t){d(this,Dh,t),this.matches.some(e=>e.id===this.highlighted)||(this.highlighted=null)}search(t){var e;this.query=t,this.highlighted=t.trim()?((e=this.matches[0])==null?void 0:e.id)??null:null}move(t){var o;const e=this.matches,r=e.findIndex(a=>a.id===this.highlighted);if(e.length===0)return;if(r<0){t==="down"&&(this.highlighted=e[0].id);return}let i=r;if(t==="up"&&r<Ii){this.highlighted=null;return}t==="up"&&(i=r-Ii),t==="down"&&(i=r+Ii<e.length?r+Ii:e.length-1),t==="left"&&(i=Math.max(0,r-1)),t==="right"&&(i=Math.min(e.length-1,r+1)),this.highlighted=((o=e[i])==null?void 0:o.id)??null}}Dh=new WeakMap;const F8=["red","orange","yellow","green","cyan","blue","purple","pink","neutral"],k7=7,T7=31;function C7(n,t){var r;let e=k7;for(const i of n)e=e*T7+i.codePointAt(0)>>>0;return{letter:((r=[...t][0])==null?void 0:r.toUpperCase())??"",color:`var(--${F8[e%F8.length]}-600)`}}function R7(n,t){return n.key.toLowerCase()!=="k"||n.altKey||n.shiftKey||n.isComposing?!1:t.startsWith("Mac")?n.metaKey&&!n.ctrlKey:n.ctrlKey&&!n.metaKey}const I7={ArrowUp:"up",ArrowDown:"down",ArrowLeft:"left",ArrowRight:"right"},$7=229;var Rn,nc,Bt,Cs,Rs,ut,Is,rc,Oh,ua,Gf,ha,Kt,av,Kd,Jf,Yf,Kf,Xf,ic,Qf,lv,g4;class x7 extends mn{constructor(){super(...arguments);m(this,Kt);m(this,Rn);m(this,nc);m(this,Bt,null);m(this,Cs,null);m(this,Rs,!1);m(this,ut,new E7);m(this,Is,null);m(this,rc,!1);m(this,Oh,!1);m(this,ua,new Map);m(this,Gf,e=>{var r,i;e!==s(this,Bt)&&((r=s(this,Cs))==null||r.disconnect(),d(this,Bt,e instanceof HTMLElement?e:null),d(this,Rs,((i=s(this,Bt))==null?void 0:i.hasAttribute("open"))??!1),s(this,Bt)&&(d(this,Cs,new MutationObserver(()=>{var a,l,c,u;const o=((a=s(this,Bt))==null?void 0:a.hasAttribute("open"))??!1;o!==s(this,Rs)&&(d(this,Rs,o),(l=s(this,Rn))==null||l.setOpen(o),o&&(s(this,ut).search(""),d(this,Is,null),this.render(),(u=(c=s(this,Bt))==null?void 0:c.querySelector("input"))==null||u.focus()))})),s(this,Cs).observe(s(this,Bt),{attributes:!0,attributeFilter:["open"]})))});m(this,ha,()=>{const e=h(this,Kt,av).call(this);this.render();const r=h(this,Kt,av).call(this);(r[0]!==e[0]||r[1]!==e[1])&&h(this,Kt,Kd).call(this)});m(this,Jf,e=>{s(this,ut).search(e.currentTarget.value),this.render(),h(this,Kt,Kd).call(this)});m(this,Yf,e=>{const r=e.isComposing||e.keyCode===$7;if(e.key==="Enter"){if(r)return;const a=s(this,ut).matches.find(l=>l.id===s(this,ut).highlighted);a&&(e.preventDefault(),h(this,Kt,lv).call(this,a));return}const i=I7[e.key];!i||!s(this,Oh)||e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||r||(i==="left"||i==="right")&&s(this,ut).highlighted===null||(e.preventDefault(),e.stopPropagation(),s(this,ut).move(i),this.render(),h(this,Kt,Kd).call(this))});m(this,Kf,e=>{const r=e.currentTarget.dataset.id;s(this,ut).highlighted!==r&&(s(this,ut).highlighted=r,this.render())});m(this,Xf,e=>{e.button===0&&(e.preventDefault(),d(this,Is,e.currentTarget.dataset.id),this.render())});m(this,ic,()=>{s(this,Is)!==null&&(d(this,Is,null),this.render())});m(this,Qf,e=>{const r=e.currentTarget.dataset.id,i=s(this,ut).matches.find(o=>o.id===r);i&&h(this,Kt,lv).call(this,i)})}connected(){var e;(e=s(this,Rn))==null||e.addEventListener("change",s(this,ha))}disconnected(){var e,r,i;(e=s(this,Cs))==null||e.disconnect(),d(this,Cs,null),d(this,Bt,null),(r=s(this,Rn))==null||r.removeEventListener("change",s(this,ha)),(i=s(this,Rn))==null||i.setOpen(!1)}template(e,r){var y,v,S;s(this,Rn)!==e&&((y=s(this,Rn))==null||y.removeEventListener("change",s(this,ha)),(v=s(this,Rn))==null||v.setOpen(!1),d(this,Rn,e),e==null||e.addEventListener("change",s(this,ha)),e==null||e.setOpen(s(this,Rs))),d(this,nc,r);const i=e==null?void 0:e.scan;s(this,ut).update((i==null?void 0:i.templates)??[]);for(const[_,R]of s(this,ua))(e==null?void 0:e.icons.get(_))!==R&&s(this,ua).delete(_);const o=((S=i==null?void 0:i.errors.find(({folder:_})=>_===null))==null?void 0:S.error)??null,a=(i==null?void 0:i.errors.filter(({folder:_})=>_!==null))??[],l=s(this,ut).matches,c=o===null&&l.length>0;d(this,Oh,c);const u=l.findIndex(_=>_.id===s(this,ut).highlighted),f=s(this,ut).query,p=Array.from({length:Math.ceil(l.length/Ii)},(_,R)=>l.slice(R*Ii,R*Ii+Ii));return V`
|
|
576
|
+
<button class="toolbox-trigger" id="toolbox-trigger" icon variant="ghost" aria-label="Templates" title="Templates">
|
|
577
|
+
<tv-icon name="skills" size="sm"></tv-icon>
|
|
578
|
+
</button>
|
|
579
|
+
<tv-popover class="toolbox-popover" trigger="toolbox-trigger" role="region" aria-label="Templates" ${ft(s(this,Gf))}
|
|
580
|
+
@pointerup=${s(this,ic)} @pointercancel=${s(this,ic)}>
|
|
581
|
+
<label class="toolbox-search">
|
|
582
|
+
<tv-icon name="search"></tv-icon>
|
|
583
|
+
<input type="text" role="combobox" placeholder="Search templates…" aria-label="Search templates" autocomplete="off"
|
|
584
|
+
aria-haspopup="grid" aria-autocomplete="list"
|
|
585
|
+
aria-expanded=${c?"true":"false"}
|
|
586
|
+
aria-controls=${c?"toolbox-grid":oe}
|
|
587
|
+
aria-activedescendant=${c&&u>=0?`toolbox-item-${u}`:oe}
|
|
588
|
+
.value=${f} @input=${s(this,Jf)} @keydown=${s(this,Yf)}>
|
|
589
|
+
</label>
|
|
590
|
+
<div class="toolbox-body">
|
|
591
|
+
<div class="toolbox-scroll-content">
|
|
592
|
+
${i?o!==null?V`
|
|
593
|
+
<div class="toolbox-folder-error"><tv-icon name="warning" size="sm"></tv-icon><span class="toolbox-error-text"><span class="toolbox-error-folder">Could not read the templates folder.</span><span>${o}</span></span></div>
|
|
594
|
+
`:c?V`
|
|
595
|
+
<div class="toolbox-grid" id="toolbox-grid" role="grid" aria-label="Templates">
|
|
596
|
+
${p.map((_,R)=>V`
|
|
597
|
+
<div class="toolbox-grid-row" role="row">
|
|
598
|
+
${_.map((H,P)=>{const N=R*Ii+P;return V`
|
|
599
|
+
<div role="gridcell" id=${`toolbox-item-${N}`} class="toolbox-tile" data-id=${H.id}
|
|
600
|
+
aria-selected=${N===u?"true":"false"}
|
|
601
|
+
?data-highlighted=${N===u} ?data-pressed=${H.id===s(this,Is)}
|
|
602
|
+
@pointermove=${s(this,Kf)} @pointerdown=${s(this,Xf)}
|
|
603
|
+
@pointerleave=${s(this,ic)} @click=${s(this,Qf)}>
|
|
604
|
+
${h(this,Kt,g4).call(this,H)}<span class="toolbox-name">${H.name}</span>
|
|
605
|
+
</div>
|
|
606
|
+
`})}
|
|
607
|
+
</div>
|
|
608
|
+
`)}
|
|
609
|
+
</div>
|
|
610
|
+
`:f.trim()?V`<p class="toolbox-empty">${`Nothing matches “${f}”.`}</p>`:a.length?oe:V`<p class="toolbox-empty">Nothing here yet.</p>`:oe}
|
|
611
|
+
${i&&o===null&&a.length?V`
|
|
612
|
+
${c||f.trim()?V`<hr class="toolbox-divider">`:oe}
|
|
613
|
+
<div class="toolbox-invalid" role="note">
|
|
614
|
+
<tv-icon name="warning" size="sm"></tv-icon>
|
|
615
|
+
<span class="toolbox-error-text"><span class="toolbox-error-folder">${a.length===1?"1 template had errors":`${a.length} templates had errors`}</span><span>Ask your agent to read the Television skill and fix ${a.length===1?"it":"them"}.</span></span>
|
|
616
|
+
</div>
|
|
617
|
+
`:oe}
|
|
618
|
+
</div>
|
|
619
|
+
<p class="toolbox-footer">Add to this list by asking your agent to save an artifact as a template.</p>
|
|
620
|
+
</div>
|
|
621
|
+
</tv-popover>
|
|
622
|
+
`}}Rn=new WeakMap,nc=new WeakMap,Bt=new WeakMap,Cs=new WeakMap,Rs=new WeakMap,ut=new WeakMap,Is=new WeakMap,rc=new WeakMap,Oh=new WeakMap,ua=new WeakMap,Gf=new WeakMap,ha=new WeakMap,Kt=new WeakSet,av=function(){const e=s(this,ut).highlighted;return[e,s(this,ut).matches.findIndex(r=>r.id===e)]},Kd=function(){var c,u;if(!s(this,Rs))return;const e=(c=s(this,Bt))==null?void 0:c.querySelector(".toolbox-body"),r=e==null?void 0:e.querySelector('[aria-selected="true"]'),i=(u=s(this,Bt))==null?void 0:u.querySelector(".toolbox-footer");if(!e||!r||!i)return;const o=e.getBoundingClientRect(),a=r.getBoundingClientRect(),l=Math.min(o.bottom,i.getBoundingClientRect().top);a.top<o.top?e.scrollTop-=o.top-a.top:a.bottom>l&&(e.scrollTop+=a.bottom-l)},Jf=new WeakMap,Yf=new WeakMap,Kf=new WeakMap,Xf=new WeakMap,ic=new WeakMap,Qf=new WeakMap,lv=async function(e){var r;if(!(s(this,rc)||!s(this,nc))){d(this,rc,!0);try{await s(this,nc).call(this,e)}catch{}finally{d(this,rc,!1),(r=s(this,Bt))==null||r.removeAttribute("open")}}},g4=function(e){var a;const r=(a=s(this,Rn))==null?void 0:a.icons.get(e.id);if(r&&s(this,ua).get(e.id)!==r)return V`<img class="toolbox-icon" src=${r} alt="" draggable="false" @error=${()=>{s(this,ua).set(e.id,r),this.render()}}>`;const{letter:i,color:o}=C7(e.id,e.name);return V`<span class="toolbox-icon toolbox-letter" aria-hidden="true" style=${`background: ${o}`}>${i}</span>`};const P7=gn(x7),D7=600;let O7=0;const V8=new WeakMap,kg=n=>{if(n.id)return n.id;let t=V8.get(n);if(!t){do t=`tv-select-${++O7}`;while(n.ownerDocument.getElementById(t));V8.set(n,t)}return n.id=t,t},Td=n=>{var t;return((t=n.textContent)==null?void 0:t.trim())??""};var Lh;class v4 extends HTMLElement{constructor(){super();m(this,Lh,this.attachInternals());s(this,Lh).role="option"}connectedCallback(){this.attributeChangedCallback()}attributeChangedCallback(){s(this,Lh).ariaSelected=String(this.hasAttribute("selected"))}}Lh=new WeakMap,I(v4,"observedAttributes",["selected"]);var $t,yi,sc,$s,xs,Mh,re,Gi,el,cv,Xd,Ji,Qd,uv,w4,ef,b4;class y4 extends HTMLElement{constructor(){super();m(this,re);m(this,$t,new ey(this,{select:!0,refresh:()=>h(this,re,Qd).call(this),opened:()=>{d(this,xs,""),h(this,re,Ji).call(this,h(this,re,el).call(this))},closed:()=>{h(this,re,Ji).call(this,void 0),d(this,xs,"")},keydown:e=>h(this,re,b4).call(this,e),pointermove:e=>{const r=h(this,re,cv).call(this,e);r&&h(this,re,Ji).call(this,r)},click:e=>{const r=h(this,re,cv).call(this,e);r&&h(this,re,ef).call(this,r)},selectedRow:()=>h(this,re,el).call(this),unpair:e=>h(this,re,w4).call(this,e)}));m(this,yi);m(this,sc,"");m(this,$s);m(this,xs,"");m(this,Mh,0);this.attachInternals().role="listbox"}connectedCallback(){s(this,$t).connect()}disconnectedCallback(){s(this,$t).disconnect()}attributeChangedCallback(){s(this,$t).refresh()}get value(){var e;return((e=h(this,re,el).call(this))==null?void 0:e.getAttribute("value"))??""}set value(e){const r=h(this,re,Gi).call(this).find(i=>i.getAttribute("value")===e);r&&(h(this,re,Xd).call(this,r),h(this,re,Qd).call(this))}}$t=new WeakMap,yi=new WeakMap,sc=new WeakMap,$s=new WeakMap,xs=new WeakMap,Mh=new WeakMap,re=new WeakSet,Gi=function(){return[...this.querySelectorAll("tv-option")].filter(e=>e.closest("tv-select")===this)},el=function(){return h(this,re,Gi).call(this).find(e=>e.hasAttribute("selected"))},cv=function(e){const r=e.closest("tv-option");return(r==null?void 0:r.closest("tv-select"))===this?r:void 0},Xd=function(e){for(const r of h(this,re,Gi).call(this))r.toggleAttribute("selected",r===e)},Ji=function(e){for(const r of h(this,re,Gi).call(this))r.toggleAttribute("highlighted",r===e);if(s(this,$t).trigger&&Ja(s(this,$t).trigger,"aria-activedescendant",e?kg(e):null),e){const r=e.getBoundingClientRect(),i=this.getBoundingClientRect();r.top<i.top+this.clientTop?this.scrollTop-=i.top+this.clientTop-r.top:r.bottom>i.top+this.clientTop+this.clientHeight&&(this.scrollTop+=r.bottom-i.top-this.clientTop-this.clientHeight)}},Qd=function(){var l;const e=h(this,re,Gi).call(this),r=h(this,re,el).call(this)??e[0];r&&h(this,re,Xd).call(this,r);const i=s(this,$t).trigger;if(!i)return;Ja(i,"role","combobox"),Ja(i,"aria-haspopup","listbox"),Ja(i,"aria-controls",kg(this));for(const c of e)kg(c);const o=e.find(c=>c.hasAttribute("highlighted"));Ja(i,"aria-activedescendant",this.hasAttribute("open")&&o?o.id:null);const a=r?Td(r):"";if(!(i.firstChild instanceof Text)||i.firstChild.nodeValue!==`${a} `||i.childNodes.length!==2||((l=i.lastElementChild)==null?void 0:l.getAttribute("name"))!=="select"){const c=this.ownerDocument.createElement("tv-icon");c.setAttribute("name","select"),c.setAttribute("aria-hidden","true"),i.replaceChildren(`${a} `,c)}h(this,re,uv).call(this,i,e)},uv=function(e,r){if(s(this,$s)||(d(this,$s,new ResizeObserver(()=>{const c=s(this,$t).trigger;c&&h(this,re,uv).call(this,c,h(this,re,Gi).call(this))})),s(this,$s).observe(e)),!e.getClientRects().length)return;const i=this.ownerDocument.defaultView.getComputedStyle(e),o=JSON.stringify([e.id,r.map(Td),i.font,i.letterSpacing,i.padding,i.borderWidth,i.gap]);if(o===s(this,sc))return;d(this,sc,o);const a=e.cloneNode(!0);a.removeAttribute("id"),a.style.cssText+=";position:absolute;visibility:hidden;pointer-events:none;width:max-content;min-width:0;max-width:none;",a.style.font=i.font,a.style.letterSpacing=i.letterSpacing,e.after(a);let l=0;for(const c of r)a.firstChild.nodeValue=`${Td(c)} `,l=Math.max(l,a.getBoundingClientRect().width);a.remove(),s(this,yi)??d(this,yi,this.ownerDocument.createElement("style")),s(this,yi).textContent=`:where(button[id="${CSS.escape(e.id)}"]) { width: ${l}px; }`,s(this,yi).isConnected||this.ownerDocument.head.append(s(this,yi))},w4=function(e){var r,i;for(const o of["role","aria-haspopup","aria-controls","aria-activedescendant"])e.removeAttribute(o);(r=s(this,$s))==null||r.disconnect(),d(this,$s,void 0),(i=s(this,yi))==null||i.remove(),d(this,yi,void 0),d(this,sc,"")},ef=function(e){const r=h(this,re,el).call(this)!==e;h(this,re,Xd).call(this,e),h(this,re,Qd).call(this),s(this,$t).close(),r&&this.dispatchEvent(new Event("change",{bubbles:!0}))},b4=function(e){if(!s(this,$t).open)return this.ownerDocument.activeElement!==s(this,$t).trigger||!["Enter"," ","ArrowDown","ArrowUp"].includes(e.key)?!1:(e.preventDefault(),e.stopImmediatePropagation(),s(this,$t).show(!0),!0);const r=h(this,re,Gi).call(this),i=r.findIndex(a=>a.hasAttribute("highlighted"));if(e.key==="Tab")return e.stopImmediatePropagation(),this.ownerDocument.activeElement!==s(this,$t).trigger?(e.preventDefault(),!0):(r[i]&&h(this,re,ef).call(this,r[i]),!0);if(e.key==="Escape")return!1;const o=e.key.length===1&&!e.ctrlKey&&!e.metaKey&&!e.altKey;if(!["ArrowDown","ArrowUp","Home","End","Enter"," "].includes(e.key)&&!o)return!1;if(e.preventDefault(),e.stopImmediatePropagation(),e.key==="Enter"||e.key===" ")r[i]&&h(this,re,ef).call(this,r[i]);else if(e.key==="Home")h(this,re,Ji).call(this,r[0]);else if(e.key==="End")h(this,re,Ji).call(this,r.at(-1));else if(e.key==="ArrowDown"||e.key==="ArrowUp")h(this,re,Ji).call(this,r[Math.max(0,Math.min(r.length-1,i+(e.key==="ArrowDown"?1:-1)))]);else{const a=performance.now();d(this,xs,a-s(this,Mh)>D7?e.key.toLowerCase():s(this,xs)+e.key.toLowerCase()),d(this,Mh,a);const c=[...r.slice(i+1),...r.slice(0,i+1)].find(u=>Td(u).toLowerCase().startsWith(s(this,xs)));c&&h(this,re,Ji).call(this,c)}return!0},I(y4,"observedAttributes",["open","trigger","manual"]);customElements.get("tv-option")||customElements.define("tv-option",v4);customElements.get("tv-select")||customElements.define("tv-select",y4);/**
|
|
623
|
+
* @license
|
|
624
|
+
* Copyright 2020 Google LLC
|
|
625
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
626
|
+
*/const L7=xc(class extends td{constructor(n){if(super(n),n.type!==Or.PROPERTY&&n.type!==Or.ATTRIBUTE&&n.type!==Or.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!F_(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[t]){if(t===Dt||t===oe)return t;const e=n.element,r=n.name;if(n.type===Or.PROPERTY){if(t===e[r])return Dt}else if(n.type===Or.BOOLEAN_ATTRIBUTE){if(!!t===e.hasAttribute(r))return Dt}else if(n.type===Or.ATTRIBUTE&&e.getAttribute(r)===t+"")return Dt;return V_(n),t}}),B8="Settings",j8="Refresh themes",M7="Themes directory",N7="None";function W8(n){return n instanceof Error?n.message:String(n)}var jt,da,wi,$r,Nh,bi,Si,fa,oc,ac,tr,S4,ep,tp,hv,np,rp,ip,tf;class z7 extends mn{constructor(){super(...arguments);m(this,tr);m(this,jt,null);m(this,da,null);m(this,wi,!1);m(this,$r,null);m(this,Nh,!1);m(this,bi,0);m(this,Si,null);m(this,fa,!1);m(this,oc,er());m(this,ac,er());m(this,ep,e=>{var i;if((i=s(this,Si))==null||i.disconnect(),d(this,Si,null),d(this,fa,!1),!e)return;const r=()=>{const o=e.hasAttribute("open");o!==s(this,fa)&&(d(this,fa,o),o&&h(this,tr,hv).call(this,!1))};d(this,Si,new MutationObserver(r)),s(this,Si).observe(e,{attributes:!0,attributeFilter:["open"]}),r()});m(this,tp,()=>{h(this,tr,hv).call(this,!0)});m(this,np,e=>{var o;const r=e.currentTarget,i=r.value;r.value=((o=s(this,jt))==null?void 0:o.snapshot.display.appearanceMode)??"system",this.render(),h(this,tr,tf).call(this,()=>{var a;return(a=s(this,jt))==null?void 0:a.setAppearanceMode(i)},"Unable to change light/dark mode")});m(this,rp,e=>{var o;const r=e.currentTarget,i=r.value||null;r.value=((o=s(this,jt))==null?void 0:o.snapshot.display.activeThemeName)??"",this.render(),h(this,tr,tf).call(this,()=>{var a;return(a=s(this,jt))==null?void 0:a.setActiveTheme(i)},"Unable to change theme")});m(this,ip,e=>{var a;const r=e.currentTarget,i=r.value,o=r.checked;r.checked=((a=s(this,jt))==null?void 0:a.snapshot.display.themeJavaScriptConsentIds.includes(i))??!1,this.render(),h(this,tr,tf).call(this,()=>{var l;return(l=s(this,jt))==null?void 0:l.setThemeJavaScriptConsent(i,o)},"Unable to change theme JavaScript consent")})}template(e){var p,y;d(this,jt,e);const r=e.snapshot.connection.status==="connected";s(this,Nh)&&!r&&h(this,tr,S4).call(this),d(this,Nh,r);const{activeThemeName:i,appearanceMode:o,themeJavaScriptConsentIds:a}=e.snapshot.display,l=((p=s(this,da))==null?void 0:p.themes)??[],c=((y=s(this,da))==null?void 0:y.errors)??[],u=i===null?void 0:l.find(v=>v.id===i&&v.enableMainJS===!0),f=i!==null&&a.includes(i);return queueMicrotask(()=>{var v,S;this.isConnected&&(s(this,oc).value&&(s(this,oc).value.value=((v=s(this,jt))==null?void 0:v.snapshot.display.appearanceMode)??"system"),s(this,ac).value&&(s(this,ac).value.value=((S=s(this,jt))==null?void 0:S.snapshot.display.activeThemeName)??""))}),V`
|
|
627
|
+
<button
|
|
628
|
+
class="settings-trigger"
|
|
629
|
+
variant="ghost"
|
|
630
|
+
icon
|
|
631
|
+
id="settings-trigger"
|
|
632
|
+
aria-label=${B8}
|
|
633
|
+
title=${B8}
|
|
634
|
+
>
|
|
635
|
+
<tv-icon name="settings" size="sm"></tv-icon>
|
|
636
|
+
</button>
|
|
637
|
+
|
|
638
|
+
<tv-popover
|
|
639
|
+
id="settings-popover"
|
|
640
|
+
trigger="settings-trigger"
|
|
641
|
+
class="settings-popover"
|
|
642
|
+
${ft(s(this,ep))}
|
|
643
|
+
>
|
|
644
|
+
<div class="settings-heading">Settings</div>
|
|
645
|
+
|
|
646
|
+
<div class="settings-field">
|
|
647
|
+
<label id="settings-appearance-label">Light/dark mode</label>
|
|
648
|
+
<button id="settings-appearance" aria-labelledby="settings-appearance-label"></button>
|
|
649
|
+
<tv-select
|
|
650
|
+
trigger="settings-appearance"
|
|
651
|
+
name="appearance-mode"
|
|
652
|
+
${ft(s(this,oc))}
|
|
653
|
+
@change=${s(this,np)}
|
|
654
|
+
>
|
|
655
|
+
<tv-option value="system" ?selected=${o==="system"}>Adapt to system</tv-option>
|
|
656
|
+
<tv-option value="light" ?selected=${o==="light"}>Light</tv-option>
|
|
657
|
+
<tv-option value="dark" ?selected=${o==="dark"}>Dark</tv-option>
|
|
658
|
+
</tv-select>
|
|
659
|
+
</div>
|
|
660
|
+
|
|
661
|
+
<div class="settings-field">
|
|
662
|
+
<label id="settings-theme-label">Theme</label>
|
|
663
|
+
<div class="settings-theme-control">
|
|
664
|
+
<button id="settings-theme" aria-labelledby="settings-theme-label"></button>
|
|
665
|
+
<tv-select
|
|
666
|
+
trigger="settings-theme"
|
|
667
|
+
name="theme"
|
|
668
|
+
${ft(s(this,ac))}
|
|
669
|
+
@change=${s(this,rp)}
|
|
670
|
+
>
|
|
671
|
+
<tv-option value="" ?selected=${i===null}>${N7}</tv-option>
|
|
672
|
+
${l.map(v=>V`
|
|
673
|
+
<tv-option
|
|
674
|
+
value=${v.id}
|
|
675
|
+
?selected=${v.id===i}
|
|
676
|
+
>${v.name}</tv-option>
|
|
677
|
+
`)}
|
|
678
|
+
</tv-select>
|
|
679
|
+
<button
|
|
680
|
+
type="button"
|
|
681
|
+
variant="ghost"
|
|
682
|
+
icon
|
|
683
|
+
aria-label=${j8}
|
|
684
|
+
title=${j8}
|
|
685
|
+
?disabled=${s(this,wi)||!r}
|
|
686
|
+
@click=${s(this,tp)}
|
|
687
|
+
>
|
|
688
|
+
<tv-icon name="reload" size="sm"></tv-icon>
|
|
689
|
+
</button>
|
|
690
|
+
</div>
|
|
691
|
+
</div>
|
|
692
|
+
|
|
693
|
+
${u?V`
|
|
694
|
+
<section
|
|
695
|
+
class="settings-javascript-consent"
|
|
696
|
+
aria-label="Experimental main-page JavaScript"
|
|
697
|
+
>
|
|
698
|
+
<p class="settings-javascript-disclosure">This theme uses experimental JavaScript. JavaScript can access your Television content, so only enable for themes you trust or have had your agent inspect.</p>
|
|
699
|
+
<label class="settings-javascript-toggle">
|
|
700
|
+
<input
|
|
701
|
+
type="checkbox"
|
|
702
|
+
role="switch"
|
|
703
|
+
name="theme-javascript-consent"
|
|
704
|
+
value=${u.id}
|
|
705
|
+
.checked=${L7(f)}
|
|
706
|
+
@change=${s(this,ip)}
|
|
707
|
+
>
|
|
708
|
+
<span>Enable experimental javascript for this theme</span>
|
|
709
|
+
</label>
|
|
710
|
+
</section>
|
|
711
|
+
`:null}
|
|
712
|
+
|
|
713
|
+
${s(this,wi)?V`<p class="settings-status" role="status">Loading themes…</p>`:null}
|
|
714
|
+
${s(this,$r)?V`<p class="settings-failure" role="alert">${s(this,$r)}</p>`:null}
|
|
715
|
+
${c.length>0?V`
|
|
716
|
+
<div class="settings-errors" aria-label="Theme validation errors">
|
|
717
|
+
${c.map(v=>V`
|
|
718
|
+
<p><strong>${v.folder??M7}</strong>: ${v.error}</p>
|
|
719
|
+
`)}
|
|
720
|
+
</div>
|
|
721
|
+
`:null}
|
|
722
|
+
</tv-popover>
|
|
723
|
+
`}disconnected(){var e;(e=s(this,Si))==null||e.disconnect(),d(this,Si,null),d(this,fa,!1),d(this,jt,null),d(this,bi,s(this,bi)+1)}}jt=new WeakMap,da=new WeakMap,wi=new WeakMap,$r=new WeakMap,Nh=new WeakMap,bi=new WeakMap,Si=new WeakMap,fa=new WeakMap,oc=new WeakMap,ac=new WeakMap,tr=new WeakSet,S4=function(){d(this,da,null),d(this,$r,null),d(this,wi,!1),d(this,bi,s(this,bi)+1)},ep=new WeakMap,tp=new WeakMap,hv=async function(e){const r=s(this,jt);if(r===null||r.snapshot.connection.status!=="connected"||s(this,wi))return;const i=++ro(this,bi)._;d(this,wi,!0),d(this,$r,null),this.render();try{const o=await(e?r.refreshThemes():r.listThemes());if(i!==s(this,bi))return;d(this,da,o)}catch(o){if(i!==s(this,bi))return;d(this,$r,`${e?"Unable to refresh themes":"Unable to load themes"}: ${W8(o)}`)}finally{i===s(this,bi)&&(d(this,wi,!1),this.render())}},np=new WeakMap,rp=new WeakMap,ip=new WeakMap,tf=async function(e,r){d(this,$r,null),this.render();try{await e()}catch(i){d(this,$r,`${r}: ${W8(i)}`),this.render()}};const H7=gn(z7),Xc={start:"--item-fade-start",end:"--item-fade-end",left:"--item-fade-left",right:"--item-fade-right"},Z7=(n,{items:t,distance:e,edges:r})=>{const i=new Set;let o=0,a=!1;const l=v=>{v.removeAttribute("data-item-edge-fade");for(const S of Object.values(Xc))v.style.removeProperty(S)},c=()=>{o=0;const v=new Set(n.querySelectorAll(t)),S=[];for(const q of i)v.has(q)||(f.unobserve(q),i.delete(q),S.push(q));for(const q of v)i.has(q)||(i.add(q),f.observe(q));const R=n.getBoundingClientRect().left+n.clientLeft,H=R+n.clientWidth,P=Math.max(0,Math.min(e,n.clientWidth/2)),N=n.scrollLeft>1?P:0,D=n.scrollLeft<n.scrollWidth-n.clientWidth-1?P:0,B=[...v].map(q=>({item:q,bounds:q.getBoundingClientRect()}));for(const q of S)l(q);for(const{item:q,bounds:F}of B){const Q=N>0&&F.left<R+N&&F.right>R,K=D>0&&F.right>H-D&&F.left<H;if(!Q&&!K){l(q);continue}q.style.setProperty(Xc.start,`${R-F.left}px`),q.style.setProperty(Xc.end,`${H-F.left}px`),q.style.setProperty(Xc.left,`${N}px`),q.style.setProperty(Xc.right,`${D}px`),q.setAttribute("data-item-edge-fade","")}},u=()=>{!a&&!o&&(o=requestAnimationFrame(c))},f=new ResizeObserver(u);f.observe(n);const p=new MutationObserver(u);return p.observe(n,{childList:!0,subtree:!0,characterData:!0,attributes:!0,attributeFilter:["class"]}),n.addEventListener("scroll",u,{passive:!0}),u(),{refresh:u,dispose:()=>{if(!a){a=!0,cancelAnimationFrame(o),f.disconnect(),p.disconnect(),n.removeEventListener("scroll",u);for(const v of i)l(v);i.clear()}}}},Qc=.5;var Wt,lc,cc,pa,Ps,xr,_i,Ai,Ds,Os,Yn,Ls,uc,Ms,ma,zh,nt,Ei,ki,In,sp,j,_4,A4,Hh,Zh,Uh,op,qh,tl,dv,E4,nf,fv,pv,mv,k4,T4,hc,Fh,C4,uo,rf,R4,I4,$4,x4,nl,P4,bu;class U7 extends mn{constructor(){super(...arguments);m(this,j);m(this,Wt,er());m(this,lc);m(this,cc);m(this,pa,!1);m(this,Ps,0);m(this,xr,!1);m(this,_i,!1);m(this,Ai,!1);m(this,Ds,0);m(this,Os,null);m(this,Yn,!1);m(this,Ls,null);m(this,uc,null);m(this,Ms,null);m(this,ma,null);m(this,zh,!1);m(this,nt,null);m(this,Ei,!1);m(this,ki,!1);m(this,In,!1);m(this,sp,()=>{h(this,j,bu).call(this)});m(this,Hh,e=>{var o;const r=s(this,nt);if(r===null||r.pointerId!==e.pointerId||!r.dragging&&Math.hypot(e.clientX-r.originX,e.clientY-r.originY)<=rA)return;const i=s(this,Wt).value;if(i){if(r.currentX=e.clientX,r.currentY=e.clientY,r.dragging)this.render();else{h(this,j,nl).call(this);const a=r.tab.getBoundingClientRect();d(this,Ei,!0),r.dragging=!0,r.tabLeft=a.left,r.tabTop=a.top,r.tabWidth=a.width,r.tabHeight=a.height,i.setPointerCapture(e.pointerId),this.render(),(o=r.onReorderChange)==null||o.call(r,h(this,j,mv).call(this,r))}h(this,j,pv).call(this,r),h(this,j,dv).call(this,r)}});m(this,Zh,e=>{const r=s(this,nt);r===null||r.pointerId!==e.pointerId||h(this,j,tl).call(this,!0,!0)});m(this,Uh,e=>{var r;((r=s(this,nt))==null?void 0:r.pointerId)===e.pointerId&&h(this,j,tl).call(this,!1,!0)});m(this,op,e=>{var r;((r=s(this,nt))==null?void 0:r.pointerId)===e.pointerId&&h(this,j,tl).call(this,!1,!0)});m(this,qh,e=>{var r;e.key!=="Escape"||!((r=s(this,nt))!=null&&r.dragging)||(e.preventDefault(),h(this,j,tl).call(this,!1,!0))});m(this,hc,()=>{d(this,Yn,!0),h(this,j,uo).call(this,!1)});m(this,Fh,()=>{d(this,Yn,!0),h(this,j,uo).call(this,!0)})}connected(){var e;d(this,lc,void 0),d(this,cc,void 0),d(this,Yn,!1),h(this,j,C4).call(this),typeof document<"u"&&((e=document.fonts)==null||e.addEventListener("loadingdone",s(this,Fh))),document.addEventListener("television-theme-styles-changed",s(this,hc)),d(this,ma,new MutationObserver(s(this,hc))),s(this,ma).observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]}),window.addEventListener("pointermove",s(this,Hh)),window.addEventListener("pointerup",s(this,Zh)),window.addEventListener("pointercancel",s(this,Uh)),window.addEventListener("keydown",s(this,qh))}template(e,r,i=null,o,a=!1){var R,H;h(this,j,P4).call(this,a);const l=(R=s(this,nt))!=null&&R.dragging?s(this,nt):null,c=(l==null?void 0:l.provisionalPages)??(r==null?void 0:r.pages),u=F7(r,c),f=(l==null?void 0:l.artifactId)??i,p=((H=r==null?void 0:r.selectedPage)==null?void 0:H.artifactIds[0])??null,y=`${(r==null?void 0:r.id)??""}:${u.map(({key:P,label:N})=>`${P}:${N}`).join("|")}`,v=p!==s(this,lc),S=y!==s(this,cc);v&&d(this,ki,!1);const _=v||l===null&&S;return S&&d(this,Yn,!0),d(this,lc,p),d(this,cc,y),h(this,j,uo).call(this,_,v,v&&!S),V`
|
|
724
|
+
<div
|
|
725
|
+
class="tab-strip"
|
|
726
|
+
role="tablist"
|
|
727
|
+
${ft(s(this,Wt))}
|
|
728
|
+
?tab-held=${l!==null}
|
|
729
|
+
@scroll=${s(this,sp)}
|
|
730
|
+
@lostpointercapture=${s(this,op)}
|
|
731
|
+
>
|
|
732
|
+
${mf(u,({key:P})=>P,(P,N)=>{const D=P.artifactId!==null&&P.artifactId===p,B=P.artifactId!==null&&P.artifactId===f,q=B&&l!==null;return V`
|
|
733
|
+
${B?V`
|
|
734
|
+
<span
|
|
735
|
+
class="tab-placeholder"
|
|
736
|
+
aria-hidden="true"
|
|
737
|
+
style=${gf(q?{width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
|
|
738
|
+
></span>
|
|
739
|
+
`:null}
|
|
740
|
+
<div
|
|
741
|
+
class=${B?"tab dragged":"tab"}
|
|
742
|
+
?dragging=${q}
|
|
743
|
+
style=${gf(q?{left:`${l.tabLeft+l.currentX-l.originX}px`,top:`${l.tabTop+l.currentY-l.originY}px`,width:`${l.tabWidth}px`,height:`${l.tabHeight}px`}:{})}
|
|
744
|
+
@keydown=${F=>{F.key!=="Enter"&&F.key!==" "||(F.preventDefault(),F.currentTarget.click())}}
|
|
745
|
+
role="tab"
|
|
746
|
+
aria-selected=${D?"true":"false"}
|
|
747
|
+
tabindex=${D?"0":"-1"}
|
|
748
|
+
data-artifact-id=${P.artifactId??""}
|
|
749
|
+
@pointerdown=${f===null?F=>h(this,j,_4).call(this,F,e,r,P,o):null}
|
|
750
|
+
@click=${F=>h(this,j,A4).call(this,F,e,r,P)}
|
|
751
|
+
@dblclick=${D&&r!==null&&!q?()=>z1(e,r,P.page,!P.page.geometry.full_screen):null}
|
|
752
|
+
>
|
|
753
|
+
<span class="tab-label">${P.label}</span>
|
|
754
|
+
</div>
|
|
755
|
+
`})}
|
|
756
|
+
</div>
|
|
757
|
+
`}disconnected(){var e,r,i,o;d(this,pa,!1),typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Ps)),d(this,Ps,0),d(this,xr,!1),d(this,_i,!1),d(this,Ai,!1),h(this,j,nl).call(this),d(this,ki,!1),d(this,Yn,!1),(e=s(this,Ls))==null||e.disconnect(),d(this,Ls,null),d(this,uc,null),(r=s(this,Ms))==null||r.dispose(),d(this,Ms,null),(i=s(this,ma))==null||i.disconnect(),d(this,ma,null),document.removeEventListener("television-theme-styles-changed",s(this,hc)),typeof document<"u"&&((o=document.fonts)==null||o.removeEventListener("loadingdone",s(this,Fh))),window.removeEventListener("pointermove",s(this,Hh)),window.removeEventListener("pointerup",s(this,Zh)),window.removeEventListener("pointercancel",s(this,Uh)),window.removeEventListener("keydown",s(this,qh)),h(this,j,tl).call(this,!1,!1),d(this,Ei,!1)}}Wt=new WeakMap,lc=new WeakMap,cc=new WeakMap,pa=new WeakMap,Ps=new WeakMap,xr=new WeakMap,_i=new WeakMap,Ai=new WeakMap,Ds=new WeakMap,Os=new WeakMap,Yn=new WeakMap,Ls=new WeakMap,uc=new WeakMap,Ms=new WeakMap,ma=new WeakMap,zh=new WeakMap,nt=new WeakMap,Ei=new WeakMap,ki=new WeakMap,In=new WeakMap,sp=new WeakMap,j=new WeakSet,_4=function(e,r,i,o,a){s(this,In)||s(this,nt)!==null||i===null||o.artifactId===null||e.button!==0||!e.isPrimary||(d(this,Ei,!1),d(this,nt,{pointerId:e.pointerId,originX:e.clientX,originY:e.clientY,tab:e.currentTarget,application:r,channelId:i.id,artifactId:o.artifactId,originalPages:i.pages,onReorderChange:a,displacementAnimations:new Set,provisionalPages:[...i.pages],slot:i.pages.indexOf(o.page),currentX:e.clientX,currentY:e.clientY,tabLeft:0,tabTop:0,tabWidth:0,tabHeight:0,edgeScrollFrame:0,edgeScrollTimestamp:null,edgeScrollRemainder:0,edgeScrollMoved:!1,dragging:!1}))},A4=function(e,r,i,o){var a;if(e.detail!==0&&s(this,Ei)){d(this,Ei,!1);return}d(this,Ei,!1),!((a=s(this,nt))!=null&&a.dragging||i===null||o.artifactId===null)&&r.selectPage(i.id,o.artifactId)},Hh=new WeakMap,Zh=new WeakMap,Uh=new WeakMap,op=new WeakMap,qh=new WeakMap,tl=function(e,r){var a;const i=s(this,nt);if(i===null)return;if(h(this,j,nf).call(this,i),i.edgeScrollMoved&&d(this,ki,!0),i.dragging&&(d(this,xr,s(this,_i)),s(this,_i)||d(this,Ai,!1)),i.dragging&&e&&!V7(i.originalPages,i.provisionalPages)){const l=i.provisionalPages.map(c=>({artifactIds:[...c.artifactIds],geometry:{...c.geometry},size:{...c.size}}));i.application.updateChannelPages(i.channelId,l).catch(()=>{})}if(!e)for(const l of i.displacementAnimations)l.cancel();d(this,nt,null),(a=i.onReorderChange)==null||a.call(i,null);const o=s(this,Wt).value;i.dragging&&(o!=null&&o.hasPointerCapture(i.pointerId))&&o.releasePointerCapture(i.pointerId),r&&this.render()},dv=function(e){const r=s(this,Wt).value,i=r?h(this,j,fv).call(this,r,e.currentX):0,o=r?Math.max(0,r.scrollWidth-r.clientWidth):0,a=i<0?((r==null?void 0:r.scrollLeft)??0)<=Qc:((r==null?void 0:r.scrollLeft)??0)>=o-Qc;if(s(this,In)||!e.dragging||i===0||o===0||a||typeof requestAnimationFrame!="function"){h(this,j,nf).call(this,e);return}e.edgeScrollFrame===0&&(e.edgeScrollFrame=requestAnimationFrame(l=>{h(this,j,E4).call(this,e,l)}))},E4=function(e,r){if(e.edgeScrollFrame=0,s(this,In)||s(this,nt)!==e||!e.dragging){e.edgeScrollTimestamp=null;return}const i=s(this,Wt).value;if(!i){e.edgeScrollTimestamp=null;return}const o=h(this,j,fv).call(this,i,e.currentX),a=e.edgeScrollTimestamp;if(e.edgeScrollTimestamp=r,o!==0&&a!==null){const l=Math.max(0,r-a)/1e3,c=Math.max(0,i.scrollWidth-i.clientWidth),u=i.scrollLeft,f=o*l+e.edgeScrollRemainder,p=Math.max(0,Math.min(c,u+f));i.scrollLeft=p;const y=i.scrollLeft-u;y!==0&&(e.edgeScrollMoved=!0),e.edgeScrollRemainder=p===0||p===c?0:f-y,y!==0&&(h(this,j,bu).call(this,i),h(this,j,pv).call(this,e))}h(this,j,dv).call(this,e)},nf=function(e){e.edgeScrollFrame!==0&&typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(e.edgeScrollFrame),e.edgeScrollFrame=0,e.edgeScrollTimestamp=null,e.edgeScrollRemainder=0},fv=function(e,r){const i=e.getBoundingClientRect();return r>=i.left&&r<i.left+Dn?-vf*(i.left+Dn-r)/Dn:r>i.right-Dn&&r<=i.right?vf*(r-(i.right-Dn))/Dn:0},pv=function(e){var S;const r=s(this,Wt).value,i=r==null?void 0:r.querySelector(".tab-placeholder");if(!r||!i)return;const o=i.nextElementSibling,a=e.tab.getBoundingClientRect(),l=a.left+a.width/2;let c=e.slot,u=i.previousElementSibling;for(;u!=null&&u.classList.contains("tab");){const _=u.getBoundingClientRect();if(l>=_.left+_.width/2)break;c-=1,u=u.previousElementSibling}let f=o==null?void 0:o.nextElementSibling;for(;f!=null&&f.classList.contains("tab");){const _=f.getBoundingClientRect();if(l<=_.left+_.width/2)break;c+=1,f=f.nextElementSibling}if(c===e.slot)return;const p=h(this,j,k4).call(this,r),y=[...e.provisionalPages],[v]=y.splice(e.slot,1);v&&(y.splice(c,0,v),e.provisionalPages=y,e.slot=c,this.render(),(S=e.onReorderChange)==null||S.call(e,h(this,j,mv).call(this,e)),queueMicrotask(()=>h(this,j,T4).call(this,e,p)))},mv=function(e){return{channelId:e.channelId,pages:e.provisionalPages,carriedArtifactId:e.artifactId}},k4=function(e){return new Map([...e.querySelectorAll(".tab:not([dragging])")].map(r=>[r.dataset.artifactId??"",r.getBoundingClientRect().left]))},T4=function(e,r){if(s(this,In))return;const i=s(this,Wt).value;if(i)for(const o of i.querySelectorAll(".tab:not([dragging])")){const a=r.get(o.dataset.artifactId??"");if(a===void 0)continue;const l=a-o.getBoundingClientRect().left;if(Math.abs(l)<=Qc)continue;const c=o.animate({translate:[`${l}px 0`,"0px 0"]},{duration:sl,easing:"ease"});e.displacementAnimations.add(c),c.finished.finally(()=>{e.displacementAnimations.delete(c)}).catch(()=>{})}},hc=new WeakMap,Fh=new WeakMap,C4=function(){s(this,zh)||typeof document>"u"||!document.fonts||(d(this,zh,!0),document.fonts.ready.then(()=>{this.isConnected&&(d(this,Yn,!0),h(this,j,uo).call(this,!0))}))},uo=function(e,r=!1,i=!1){s(this,xr)||d(this,xr,e),e&&r&&(d(this,_i,!0),d(this,Ai,i&&!s(this,In))),!(s(this,pa)||s(this,Ps)!==0)&&(d(this,pa,!0),queueMicrotask(()=>{if(d(this,pa,!1),!!this.isConnected){if(typeof requestAnimationFrame!="function"){h(this,j,rf).call(this);return}d(this,Ps,requestAnimationFrame(()=>{d(this,Ps,0),h(this,j,rf).call(this)}))}}))},rf=function(){var l,c;const e=s(this,Wt).value;if(!e)return;s(this,Yn)&&(d(this,Yn,!1),h(this,j,I4).call(this,e)),h(this,j,$4).call(this,e),h(this,j,R4).call(this,e);const r=((l=s(this,nt))==null?void 0:l.dragging)===!0,i=s(this,_i),o=i&&s(this,Ai),a=!r&&(i||s(this,xr)&&!s(this,ki));r?d(this,xr,i):(d(this,xr,!1),d(this,_i,!1),d(this,Ai,!1),i&&d(this,ki,!1)),a&&h(this,j,x4).call(this,e,o),h(this,j,bu).call(this,e),(c=s(this,Ms))==null||c.refresh()},R4=function(e){for(const r of e.querySelectorAll(".tab-label"))r.toggleAttribute("data-overflow",r.scrollWidth>r.clientWidth)},I4=function(e){var r;for(const i of e.querySelectorAll(".tab")){const o=i.querySelector(".tab-label");if(!o)continue;const a=document.createRange();a.selectNodeContents(o);const l=(r=a.getBoundingClientRect)==null?void 0:r.call(a);if(!l||l.width<=0)continue;const c=getComputedStyle(i),u=eu(c.paddingLeft)+eu(c.paddingRight)+eu(c.borderLeftWidth)+eu(c.borderRightWidth),p=Math.ceil(l.width)+u>FN+VN?"capped":"hugging";i.dataset.compression!==p&&(i.dataset.compression=p)}},$4=function(e){var r,i;typeof ResizeObserver>"u"||s(this,uc)===e||((r=s(this,Ls))==null||r.disconnect(),s(this,Ls)??d(this,Ls,new ResizeObserver(()=>{s(this,In)?(d(this,xr,!0),h(this,j,rf).call(this)):h(this,j,uo).call(this,!0)})),s(this,Ls).observe(e),d(this,uc,e),(i=s(this,Ms))==null||i.dispose(),d(this,Ms,Z7(e,{items:".tab:not(.dragged)",distance:BN,edges:"both"})))},x4=function(e,r){const i=e.querySelector('.tab[aria-selected="true"]');if(!i){h(this,j,nl).call(this);return}const o=e.getBoundingClientRect(),a=i.getBoundingClientRect(),l=eu(getComputedStyle(i).translate),c=Math.max(0,Math.min(e.scrollLeft+a.left-l+a.width/2-(o.left+o.width/2),e.scrollWidth-e.clientWidth));if(h(this,j,nl).call(this),s(this,In)||!r||Math.abs(e.scrollLeft-c)<=Qc||matchMedia("(prefers-reduced-motion: reduce)").matches){e.scrollLeft=c;return}const u=e.scrollLeft,f=e.animate([{},{}],{duration:EA,easing:"ease"});d(this,Os,f);const p=()=>{var v;if(f!==s(this,Os))return;const y=f.playState==="finished"?1:((v=f.effect)==null?void 0:v.getComputedTiming().progress)??0;e.scrollLeft=u+(c-u)*y,f.playState==="finished"?(e.scrollLeft=c,d(this,Os,null),d(this,Ds,0),h(this,j,bu).call(this,e)):d(this,Ds,requestAnimationFrame(p))};d(this,Ds,requestAnimationFrame(p))},nl=function(){var e;typeof cancelAnimationFrame=="function"&&cancelAnimationFrame(s(this,Ds)),d(this,Ds,0),(e=s(this,Os))==null||e.cancel(),d(this,Os,null)},P4=function(e){var i;if(s(this,In)===e||(d(this,In,e),!e))return;h(this,j,nl).call(this),d(this,Ai,!1),d(this,ki,!1);const r=s(this,nt);if(r!==null){h(this,j,nf).call(this,r);for(const o of r.displacementAnimations)o.cancel();r.displacementAnimations.clear(),d(this,nt,null),r.dragging&&((i=s(this,Wt).value)!=null&&i.hasPointerCapture(r.pointerId))&&s(this,Wt).value.releasePointerCapture(r.pointerId),queueMicrotask(()=>{var o;return(o=r.onReorderChange)==null?void 0:o.call(r,null)})}h(this,j,uo).call(this,!0,!0,!1)},bu=function(e=s(this,Wt).value){if(!e)return;const r=Math.max(0,e.scrollWidth-e.clientWidth);e.toggleAttribute("data-overflow",r>Qc)};const q7=gn(U7);function F7(n,t){if(!n||!t)return[];const e=new Map(n.artifacts.map(r=>[r.id,r]));return t.map((r,i)=>{var a;const o=r.artifactIds[0]??null;return{page:r,artifactId:o,label:o===null?"":((a=e.get(o))==null?void 0:a.title)??"",key:o??`empty-page-${i}`}})}function V7(n,t){return n.length===t.length&&n.every((e,r)=>e===t[r])}function eu(n){const t=Number.parseFloat(n);return Number.isFinite(t)?t:0}let B7=0;var ga,Gt,Vh,xt,Ti,Pr,dc,Ci,Bh,$n,ap,lp,jh,bc,D4,cp,up,O4,hp,dp;class j7 extends mn{constructor(){super(...arguments);m(this,bc);m(this,ga,new A7(()=>this.render()));m(this,Gt,new iA(()=>this.render()));m(this,Vh,`channel-switcher-trigger-${++B7}`);m(this,xt,null);m(this,Ti,null);m(this,Pr,!1);m(this,dc,null);m(this,Ci,null);m(this,Bh,er());m(this,$n,null);m(this,ap,e=>{var r,i,o;(r=s(this,xt))==null||r.removeAttribute("open"),((i=s(this,Ci))==null?void 0:i.display.focusedChannelId)!==e&&((o=s(this,dc))==null||o.focusChannel(e).catch(()=>{}))});m(this,lp,e=>{s(this,Pr)||(d(this,Pr,!0),this.render(),e.detail===0&&requestAnimationFrame(()=>{var r;(r=s(this,xt))!=null&&r.hasAttribute("open")&&h(this,bc,D4).call(this,0)}))});m(this,jh,e=>{const r=s(this,xt);r===null||!r.hasAttribute("open")||s(this,Gt).dragging||r.querySelector("input, tv-menu[open]")||Y_(e,[...r.querySelectorAll('.channel[role="option"]')])});m(this,cp,e=>{var r,i;d(this,$n,{channelId:e,scrollTop:((i=(r=s(this,xt))==null?void 0:r.querySelector(".channel-switcher-pop-body"))==null?void 0:i.scrollTop)??0,result:null})});m(this,up,(e,r)=>{var i;((i=s(this,$n))==null?void 0:i.channelId)===e&&(s(this,$n).result=r?"deleted":"cancelled",this.render())});m(this,hp,e=>{var r;(r=s(this,Ti))==null||r.disconnect(),d(this,Ti,null),s(this,xt)!==null&&s(this,$n)===null&&s(this,Gt).disconnect(),d(this,xt,e instanceof HTMLElement?e:null),s(this,xt)!==null&&(s(this,Gt).connect(),d(this,Ti,new MutationObserver(s(this,dp))),s(this,Ti).observe(s(this,xt),{attributes:!0,attributeFilter:["open"]}))});m(this,dp,()=>{var e;(((e=s(this,xt))==null?void 0:e.hasAttribute("open"))??!0)||s(this,$n)===null&&(d(this,Pr,!1),this.render())})}connected(){s(this,ga).connect(),document.addEventListener("keydown",s(this,jh))}template(e,r,i={}){var l;d(this,dc,e),d(this,Ci,r);const o=i.collapsed||i.sidebarTransitioning;(i.sidebarTransitioning||!o||r.focusedChannel===null)&&d(this,Pr,!1),s(this,Gt).update(e,r,{management:!0,dragging:!0,revealMovedRow:!0,onDeleteStart:s(this,cp),onDeleteEnd:s(this,up),selectChannel:s(this,ap),highlightOnPointerMove:!0,motionSuppressed:i.sidebarTransitioning});const a=s(this,$n);return a!=null&&a.result&&(r.channels.length===0||r.focusedChannel!==null)&&(a.result==="cancelled"||!r.channels.some(({id:c})=>c===a.channelId))&&queueMicrotask(()=>h(this,bc,O4).call(this,a)),s(this,ga).configure({connectionOwner:i.connectionOwner,presentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,dismissalStorage:i.dismissalStorage}),i.onRenderComplete&&queueMicrotask(i.onRenderComplete),V`
|
|
758
|
+
<header class="top-bar" ${ft(s(this,Bh))}>
|
|
759
|
+
${o?V`
|
|
760
|
+
<div class="top-bar-lead">
|
|
761
|
+
${i.sidebarToggle===void 0?V`
|
|
762
|
+
<button
|
|
763
|
+
class="sidebar-expand"
|
|
764
|
+
variant="ghost"
|
|
765
|
+
icon
|
|
766
|
+
aria-label="Show sidebar"
|
|
767
|
+
title="Show sidebar"
|
|
768
|
+
type="button"
|
|
769
|
+
@click=${i.onExpandSidebar}
|
|
770
|
+
>
|
|
771
|
+
<tv-icon name="sidebar" size="sm"></tv-icon>
|
|
772
|
+
</button>
|
|
773
|
+
`:i.sidebarToggle??V`
|
|
774
|
+
<span class="sidebar-toggle-seat" aria-hidden="true"></span>
|
|
775
|
+
`}
|
|
776
|
+
${r.focusedChannel===null?null:V`
|
|
777
|
+
<button
|
|
778
|
+
class="channel-switcher"
|
|
779
|
+
variant="ghost"
|
|
780
|
+
target
|
|
781
|
+
aria-haspopup="listbox"
|
|
782
|
+
id=${s(this,Vh)}
|
|
783
|
+
type="button"
|
|
784
|
+
@click=${s(this,lp)}
|
|
785
|
+
>
|
|
786
|
+
<span class="channel-switcher-name">
|
|
787
|
+
${r.focusedChannel.name}
|
|
788
|
+
</span>
|
|
789
|
+
<tv-icon name="select" size="sm"></tv-icon>
|
|
790
|
+
</button>
|
|
791
|
+
${s(this,Pr)?V`
|
|
792
|
+
<tv-popover
|
|
793
|
+
class="channel-switcher-pop"
|
|
794
|
+
?dragging=${s(this,Gt).dragging}
|
|
795
|
+
trigger=${s(this,Vh)}
|
|
796
|
+
${ft(s(this,hp))}
|
|
797
|
+
>
|
|
798
|
+
<div class="channel-switcher-pop-body">
|
|
799
|
+
${s(this,Gt).template()}
|
|
800
|
+
</div>
|
|
801
|
+
<footer class="channel-switcher-pop-footer">
|
|
802
|
+
<button
|
|
803
|
+
class="channel-create"
|
|
804
|
+
variant="ghost"
|
|
805
|
+
icon
|
|
806
|
+
aria-label="New channel"
|
|
807
|
+
title="New channel"
|
|
808
|
+
type="button"
|
|
809
|
+
?disabled=${s(this,Gt).creating}
|
|
810
|
+
@click=${s(this,Gt).create}
|
|
811
|
+
>
|
|
812
|
+
<tv-icon name="add"></tv-icon>
|
|
813
|
+
</button>
|
|
814
|
+
</footer>
|
|
815
|
+
</tv-popover>
|
|
816
|
+
`:null}
|
|
817
|
+
`}
|
|
818
|
+
</div>
|
|
819
|
+
`:null}
|
|
820
|
+
${q7(e,r.focusedChannel,null,i.onTabReorderChange,i.sidebarTransitioning)}
|
|
821
|
+
<div class="top-bar-controls">
|
|
822
|
+
${P7((l=i.templateConnection)==null?void 0:l.templates,async c=>{var v;const u=i.templateConnection,f=e.snapshot.focusedChannel;if(!u||!f)return;const p=(v=f.selectedPage)==null?void 0:v.artifactIds[0],y=await u.client.templates.create({templateID:c.id,channelID:f.id,source:"ui",...p?{after:p}:{}});await u.client.display.focus({artifactID:y.artifactID}),e.selectPage(f.id,y.artifactID)})}
|
|
823
|
+
${H7(e)}
|
|
824
|
+
${s(this,ga).template()}
|
|
825
|
+
</div>
|
|
826
|
+
</header>
|
|
827
|
+
${s(this,Gt).overlayTemplate()}
|
|
828
|
+
`}disconnected(){var e;s(this,ga).disconnect(),document.removeEventListener("keydown",s(this,jh)),s(this,Gt).disconnect(),(e=s(this,Ti))==null||e.disconnect(),d(this,Ti,null),d(this,xt,null),d(this,Pr,!1),d(this,dc,null),d(this,Ci,null),d(this,$n,null)}}ga=new WeakMap,Gt=new WeakMap,Vh=new WeakMap,xt=new WeakMap,Ti=new WeakMap,Pr=new WeakMap,dc=new WeakMap,Ci=new WeakMap,Bh=new WeakMap,$n=new WeakMap,ap=new WeakMap,lp=new WeakMap,jh=new WeakMap,bc=new WeakSet,D4=function(e){var r;Ou((r=s(this,xt))==null?void 0:r.querySelectorAll('.channel[role="option"]')[e])},cp=new WeakMap,up=new WeakMap,O4=function(e){var u,f;if(s(this,$n)!==e||s(this,Ci)===null)return;d(this,$n,null);const r=s(this,Ci).focusedChannel;d(this,Pr,r!==null),this.render();const i=s(this,xt);if(i===null){s(this,Gt).disconnect(),(f=(u=s(this,Bh).value)==null?void 0:u.querySelector(".sidebar-expand"))==null||f.focus();return}i.setAttribute("open","");const o=i.querySelector(".channel-switcher-pop-body");o&&(o.scrollTop=e.scrollTop);const a=e.result==="cancelled"&&s(this,Ci).channels.some(({id:p})=>p===e.channelId)?e.channelId:r==null?void 0:r.id,l=[...i.querySelectorAll(".channel-row")].find(p=>p.dataset.channelId===a),c=l==null?void 0:l.querySelector(".channel");c==null||c.focus({preventScroll:!0}),e.result==="deleted"&&(c==null||c.scrollIntoView({block:"nearest"}))},hp=new WeakMap,dp=new WeakMap;const W7=gn(j7);var Dr,Wh,va,fc,Pt,fn,xn,Pn,ya,xe,Kn,Ns,pc,zs,Gh,fp,wa,pp,mp,gp,Y,sf,gv,L4,Jh,vp,Yi,ho,Su,of,vv,M4,N4,yp,wp,bp,Yh,Sp,fo,_u,z4;class G7 extends mn{constructor(){super(...arguments);m(this,Y);m(this,Dr,null);m(this,Wh);m(this,va,null);m(this,fc,null);m(this,Pt,bd);m(this,fn,!1);m(this,xn,null);m(this,Pn,null);m(this,ya,null);m(this,xe,!1);m(this,Kn,!1);m(this,Ns,bd);m(this,pc,0);m(this,zs,null);m(this,Gh,e=>{var r;if(e.key==="Escape"&&s(this,xn)!==null){e.preventDefault(),e.stopPropagation(),h(this,Y,fo).call(this);return}if(R7(e,navigator.platform)){const i=document.getElementById("toolbox-trigger");i&&(e.preventDefault(),e.stopPropagation(),i.click());return}SE(e,navigator.platform)&&(e.preventDefault(),e.stopPropagation(),(r=s(this,Dr))==null||r.handleNavigationKey(e.key))});m(this,fp,e=>{d(this,Wh,e??void 0),this.render()});m(this,wa,()=>{this.render()});m(this,pp,()=>h(this,Y,sf).call(this,!0));m(this,mp,()=>h(this,Y,sf).call(this,!1));m(this,gp,()=>{const e=s(this,xe)?!s(this,Kn):!s(this,fn);h(this,Y,sf).call(this,e)});m(this,Jh,e=>{const r=s(this,zs),i=h(this,Y,ho).call(this).closest("#app");if(!r||!i)return;d(this,Ns,e);const o=GN(1-e/r.expandedSidebarWidth,r),a=(c,u)=>{i.style.setProperty(`--motion-${c}`,`${u}px`)};a("boundary",o.sidebarBoundary),a("toggle-left",o.toggleLeft),a("toggle-top",r.toggleTop),a("toggle-width",r.toggleWidth),a("toggle-height",r.toggleHeight),a("toggle-wipe",o.toggleWipe),a("lead-reservation",o.leadReservation),a("switcher-left",r.collapsedToggleLeft+r.toggleWidth+r.toggleSwitcherGap-o.sidebarBoundary-r.barInset),i.style.setProperty("--motion-titlebar-opacity",String(o.titlebarOpacity)),i.style.setProperty("--motion-switcher-opacity",String(o.switcherOpacity));const l=h(this,Y,ho).call(this);l.style.removeProperty("left"),l.style.removeProperty("top")});m(this,vp,e=>{var o;if(!s(this,xe))return;const r=e===0;if(r!==s(this,Kn))return;const i=document.activeElement===s(this,Pn);h(this,Y,Yi).call(this,r),this.render(),i&&((o=s(this,Pn))==null||o.focus({preventScroll:!0}))});m(this,yp,e=>{if(e.button!==0||s(this,xn)!==null)return;const r=e.currentTarget,i=r.closest("#app");i!==null&&(r.setPointerCapture(e.pointerId),d(this,xn,{pointerId:e.pointerId,startX:e.clientX,startWidth:s(this,Pt),root:i}),e.preventDefault())});m(this,wp,e=>{const r=s(this,xn);r===null||e.pointerId!==r.pointerId||h(this,Y,_u).call(this,r.root,r.startWidth+e.clientX-r.startX)});m(this,bp,e=>{var o;const r=s(this,xn);if(r===null||e.pointerId!==r.pointerId)return;d(this,xn,null);const i=((o=s(this,va))==null?void 0:o.commit(s(this,Pt)))??s(this,Pt);h(this,Y,_u).call(this,r.root,i)});m(this,Yh,e=>{const r=s(this,xn);r===null||e.pointerId!==r.pointerId||h(this,Y,fo).call(this)});m(this,Sp,e=>{var i;const r=e.currentTarget.closest("#app");r!==null&&((i=s(this,va))==null||i.clear(),h(this,Y,_u).call(this,r,bd))})}update(e,r){const i=r[0],o=r[1].sidebarWidthPreference,a=r[1].sidebarCollapsedPreference;s(this,Dr)!==i&&(s(this,Dr)!==null&&this.isConnected&&(s(this,Dr).removeEventListener("change",s(this,wa)),i.addEventListener("change",s(this,wa))),d(this,Dr,i));const l=s(this,va)!==o,c=s(this,fc)!==a;return l&&(h(this,Y,fo).call(this),d(this,va,o),d(this,Pt,o.read()??bd)),c&&(h(this,Y,fo).call(this),d(this,fc,a),d(this,fn,a.read())),(l||c)&&h(this,Y,Yi).call(this,s(this,fn)),super.update(e,r)}connected(){var e;(e=s(this,Dr))==null||e.addEventListener("change",s(this,wa)),document.addEventListener("keydown",s(this,Gh),{capture:!0})}disconnected(){var e,r;h(this,Y,fo).call(this),s(this,xe)?h(this,Y,Yi).call(this,s(this,Kn)):(e=s(this,ya))==null||e.cancel(),(r=s(this,Dr))==null||r.removeEventListener("change",s(this,wa)),document.removeEventListener("keydown",s(this,Gh),{capture:!0})}template(e,r){const i=bL(e.snapshot,r.serverURL),o=e.snapshot,a=Y7(i,o.connection.hasEverConnected);return r.onRenderComplete&&queueMicrotask(()=>{var l;this.isConnected&&((l=r.onRenderComplete)==null||l.call(r,i.kind))}),V`
|
|
829
|
+
<div
|
|
830
|
+
id="app"
|
|
831
|
+
tabindex="-1"
|
|
832
|
+
data-app-state=${i.kind}
|
|
833
|
+
?data-sidebar-transition=${s(this,xe)}
|
|
834
|
+
?data-sidebar-motion=${s(this,xe)}
|
|
835
|
+
style=${h(this,Y,N4).call(this)}
|
|
836
|
+
>
|
|
837
|
+
${a?h(this,Y,z4).call(this,e,o,r):null}
|
|
838
|
+
${i.kind==="needs-upgrade"?l7(i.instructions,r.desktopUpdate,WA(r.electronMode&&!a)):K7(i)?z9(i,{context:r.electronMode?"desktop":"browser",dragStrip:r.electronMode&&!a}):null}
|
|
839
|
+
</div>
|
|
840
|
+
<div id="foreground-overlay" inert aria-hidden="true"></div>
|
|
841
|
+
`}}Dr=new WeakMap,Wh=new WeakMap,va=new WeakMap,fc=new WeakMap,Pt=new WeakMap,fn=new WeakMap,xn=new WeakMap,Pn=new WeakMap,ya=new WeakMap,xe=new WeakMap,Kn=new WeakMap,Ns=new WeakMap,pc=new WeakMap,zs=new WeakMap,Gh=new WeakMap,fp=new WeakMap,wa=new WeakMap,pp=new WeakMap,mp=new WeakMap,gp=new WeakMap,Y=new WeakSet,sf=function(e){var c,u;if(!s(this,xe)&&s(this,fn)===e||s(this,xe)&&s(this,Kn)===e)return;h(this,Y,fo).call(this);const r=document.activeElement===s(this,Pn);if((c=s(this,fc))==null||c.setCollapsed(e),matchMedia("(prefers-reduced-motion: reduce)").matches){h(this,Y,Yi).call(this,e),this.render(),r&&((u=s(this,Pn))==null||u.focus({preventScroll:!0}));return}if(d(this,Kn,e),s(this,xe)){h(this,Y,Su).call(this),h(this,Y,gv).call(this);return}const i=h(this,Y,ho).call(this),o=i.closest("#app"),a=i.getBoundingClientRect(),l=o==null?void 0:o.getBoundingClientRect();if(!o||!l||a.width===0){h(this,Y,Yi).call(this,e),this.render();return}for(const f of o.getAnimations({subtree:!0}))f.cancel();d(this,xe,!0),d(this,pc,a.top-l.top),d(this,zs,null),i.style.left=`${a.left-l.left}px`,i.style.top=`${s(this,pc)}px`,h(this,Y,Su).call(this),this.render(),queueMicrotask(()=>{s(this,xe)&&(h(this,Y,L4).call(this),r&&i.focus({preventScroll:!0}),h(this,Y,gv).call(this))})},gv=function(){const e=h(this,Y,ho).call(this).closest("#app"),r=s(this,ya);if(!e||!r||!s(this,zs))return;const i=s(this,Kn)?0:s(this,Pt);r.move({root:e,width:s(this,Pt),target:i,onFrame:s(this,Jh),onFinish:s(this,vp)})},L4=function(){const r=h(this,Y,ho).call(this).closest("#app"),i=r==null?void 0:r.querySelector(".sidebar-titlebar > .sidebar-toggle-seat"),o=r==null?void 0:r.querySelector(".top-bar > .top-bar-lead"),a=o==null?void 0:o.querySelector(":scope > .sidebar-toggle-seat"),l=o==null?void 0:o.querySelector(":scope > .channel-switcher"),c=o==null?void 0:o.closest(".top-bar");if(!r||!i||!o||!a||!c){h(this,Y,Yi).call(this,s(this,Kn)),this.render();return}const u=i.closest(".app-sidebar");r.removeAttribute("data-sidebar-motion");const f=r.getBoundingClientRect(),p=o.style.display;o.style.display="none";const y=i.getBoundingClientRect();u.style.marginLeft=`${-s(this,Pt)}px`,o.style.display=p;const v=a.getBoundingClientRect(),S=l==null?void 0:l.getBoundingClientRect();d(this,zs,{expandedSidebarWidth:s(this,Pt),expandedToggleLeft:y.left-f.left,collapsedToggleLeft:v.left-f.left,toggleTop:s(this,pc),toggleWidth:v.width,toggleHeight:v.height,toggleSwitcherGap:S?S.left-v.right:0,collapsedLeadReservation:o.getBoundingClientRect().width,hasSwitcher:!!l,barInset:c.getBoundingClientRect().left-f.left}),u.style.removeProperty("margin-left"),r.setAttribute("data-sidebar-motion",""),s(this,Jh).call(this,s(this,Ns))},Jh=new WeakMap,vp=new WeakMap,Yi=function(e){var r;(r=s(this,ya))==null||r.cancel(),d(this,fn,e),d(this,xe,!1),d(this,Ns,e?0:s(this,Pt)),d(this,ya,new YN(s(this,Ns))),d(this,zs,null),h(this,Y,M4).call(this),h(this,Y,Su).call(this)},ho=function(){if(s(this,Pn)!==null)return s(this,Pn);const e=document.createElement("button");return e.type="button",e.setAttribute("variant","ghost"),e.setAttribute("icon",""),e.append(h(this,Y,of).call(this)),e.addEventListener("pointerdown",r=>{r.button===0&&e.setPointerCapture(r.pointerId)}),e.addEventListener("click",s(this,gp)),d(this,Pn,e),h(this,Y,Su).call(this),e},Su=function(){var o;const e=s(this,Pn);if(e===null)return;const r=s(this,xe)?s(this,Kn):s(this,fn);e.className=s(this,xe)?"sidebar-motion-toggle sidebar-toggle":r?"sidebar-expand":"sidebar-collapse",s(this,xe)?e.querySelectorAll(":scope > .sidebar-toggle-paint").length!==2&&e.replaceChildren(h(this,Y,vv).call(this,"expanded-paint"),h(this,Y,vv).call(this,"collapsed-paint")):(e.children.length!==1||!((o=e.firstElementChild)!=null&&o.matches("tv-icon[name='sidebar']")))&&e.replaceChildren(h(this,Y,of).call(this));const i=r?"Show sidebar":"Collapse sidebar";e.setAttribute("aria-label",i),e.title=i},of=function(){const e=document.createElement("tv-icon");return e.setAttribute("name","sidebar"),e.setAttribute("size","sm"),e},vv=function(e){const r=document.createElement("span");return r.className=`sidebar-toggle-paint ${e}`,r.setAttribute("aria-hidden","true"),r.append(h(this,Y,of).call(this)),r},M4=function(){const e=s(this,Pn);e!==null&&(e.style.removeProperty("left"),e.style.removeProperty("top"))},N4=function(){const e=[`--sidebar-width: ${s(this,Pt)}px`];return s(this,xe)&&e.push(`--motion-boundary: ${s(this,Ns)}px`),e.join("; ")},yp=new WeakMap,wp=new WeakMap,bp=new WeakMap,Yh=new WeakMap,Sp=new WeakMap,fo=function(){const e=s(this,xn);if(e===null)return;d(this,xn,null),h(this,Y,_u).call(this,e.root,e.startWidth);const r=e.root.querySelector(".app-sidebar-resize");r!=null&&r.hasPointerCapture(e.pointerId)&&r.releasePointerCapture(e.pointerId)},_u=function(e,r){d(this,Pt,E_(r)),h(this,Y,Yi).call(this,s(this,fn)),e.style.setProperty("--sidebar-width",`${s(this,Pt)}px`)},z4=function(e,r,i){var l;const o=!s(this,fn)||s(this,xe),a=h(this,Y,ho).call(this);return V`
|
|
842
|
+
${o?V`
|
|
843
|
+
<aside class="app-sidebar">
|
|
844
|
+
${NN(e,r,i.electronMode,s(this,pp),s(this,xe)?null:a,s(this,xe))}
|
|
845
|
+
</aside>
|
|
846
|
+
${s(this,xe)?null:V`
|
|
847
|
+
<div
|
|
848
|
+
class="app-sidebar-resize"
|
|
849
|
+
aria-hidden="true"
|
|
850
|
+
@pointerdown=${s(this,yp)}
|
|
851
|
+
@pointermove=${s(this,wp)}
|
|
852
|
+
@pointerup=${s(this,bp)}
|
|
853
|
+
@pointercancel=${s(this,Yh)}
|
|
854
|
+
@lostpointercapture=${s(this,Yh)}
|
|
855
|
+
@dblclick=${s(this,Sp)}
|
|
856
|
+
></div>
|
|
857
|
+
`}
|
|
858
|
+
`:null}
|
|
859
|
+
<main class="app-main">
|
|
860
|
+
${W7(e,r,{connectionOwner:i.connectionOwner,templateConnection:(l=i.connectionOwner)==null?void 0:l.connection,updatePresentation:i.updatePresentation,desktopRecommendation:i.desktopRecommendation,desktopUpdate:i.desktopUpdate,onTabReorderChange:s(this,fp),collapsed:s(this,fn),onExpandSidebar:s(this,mp),sidebarToggle:s(this,xe)?null:s(this,fn)?a:void 0,sidebarTransitioning:s(this,xe)})}
|
|
861
|
+
${D9(e,r.focusedChannel,s(this,Wh),s(this,xe))}
|
|
862
|
+
</main>
|
|
863
|
+
${s(this,xe)?a:null}
|
|
864
|
+
`};const J7=gn(G7);function Y7(n,t){return n.kind==="connected"||n.kind==="no-channel"||n.kind==="empty-channel"||n.kind==="disconnected"||n.kind==="error"&&t}function K7(n){return n.kind!=="connected"&&n.kind!=="no-channel"&&n.kind!=="empty-channel"}const H4="television-appearance-mode";function X7(n){return n==="system"||n==="light"||n==="dark"}function Q7(){try{const n=window.localStorage.getItem(H4);return X7(n)?n:"system"}catch{return"system"}}function Z4(){return window.__televisionAppearanceResolver??eL(Q7())}function eH(n,t){return t==="light"||t==="dark"?t:n}function tH(n){Z4().setPreference(n);try{window.localStorage.setItem(H4,n)}catch{}}document.documentElement.dataset.tvBundleVersion=Kv();Object.defineProperty(window,"__tvVersion",{value:Kv(),writable:!1,configurable:!1});Z4();const nH=vH(),Mr=Ri();Mr?document.documentElement.dataset.platform="electron":delete document.documentElement.dataset.platform;const U4=ka(window.location.origin),q4=hx(),rH=new uC(Mr?"television-electron":"television-browser",cC()),iH=new zO(window.localStorage),sH=new MO(window.localStorage),G8=y_(),oH=G8?yx({storage:G8,clientApp:Mr?"desktop":"browser",desktopAppVersion:Mr?bS():null}):null,fy=FO({search:window.location.search}),nr=Xv(),F4=new JO,py=GO({detection:fy,navigationLatch:nr,presentation:F4}),Ne=new kO({localStore:rH,serverURL:U4,launchToken:q4,telemetryMeta:oH,navigationPending:()=>nr.pending,...fy.electron?{decideBoot:n=>py.decideBoot(n)}:{}}),aH=n=>{XT(_t,n)},_t=new qT({connectionOwner:Ne,navigationKeyHandler:aH,retainedGateHalted:()=>py.gated}),wo=globalThis.__televisionNativeBridge;Mr&&wo&&wo.onNavigationKey(n=>_t.handleNavigationKey(n));const lH=new QO({electron:Mr,bridge:wo});if(q4){const n=new URL(window.location.href);n.searchParams.delete("token"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`)}qO({owner:Ne,navigationLatch:nr});py.attach(Ne);const cH=()=>{const n=Ne.connection;n.status==="connected"&&n.client.artifacts.list().then(({artifacts:t})=>{const e=new Set(t.map(r=>r.id));OO(e)}).catch(()=>{})},V4=()=>{Ne.connection.status==="connected"&&KN(Ne.connection.url)};let Af=null,yv=null,B4=Ne.connection.status;const uH=()=>{nr.pending||nr.begin(()=>{const n=document.querySelector("#settings-popover");if(n!=null&&n.hasAttribute("open")){const t=new URL(window.location.href);t.searchParams.set("reopenSettings","1"),window.history.replaceState(window.history.state,"",`${t.pathname}${t.search}${t.hash}`)}window.location.reload()})},j4=(n,t,e)=>{if(nr.pending||Ne.connection.status!=="connected"||_t.snapshot.connection.status!=="connected"||!_t.snapshot.ready)return;const r={activeThemeName:n,consentIds:new Set(t)},i=Af,o=e9(),a=i!==null&&i.activeThemeName!==r.activeThemeName,l=(i==null?void 0:i.activeThemeName)!==null&&(i==null?void 0:i.activeThemeName)!==void 0&&i.consentIds.has(i.activeThemeName),c=r.activeThemeName!==null&&r.consentIds.has(r.activeThemeName),u=i!==null&&!a&&l&&!c,f=i!==null&&K4(i.consentIds,r.consentIds);if(Af=r,o!==null&&(a||u)){uH();return}if(o===null&&c){l8(Ne.connection.url);return}o!==null&&c&&e&&!a&&f&&l8(Ne.connection.url)},hH=()=>{const n=document.documentElement.dataset.theme;if(n!=="light"&&n!=="dark")throw new Error("Application root has no effective theme-frame appearance");return n},W4=(n,t)=>{if(nr.pending||Ne.connection.status!=="connected"||_t.snapshot.connection.status!=="connected"||!_t.snapshot.ready)return;const e={activeThemeName:n,serverURL:Ne.connection.url,appearance:hH()},r=yv;yv=e,!(!t&&(r==null?void 0:r.activeThemeName)===e.activeThemeName&&r.serverURL===e.serverURL&&r.appearance===e.appearance)&&t9(e.serverURL,e.activeThemeName,()=>_t.listThemes())},G4=()=>{if(!nr.pending){if(B4=Ne.connection.status,Ne.connection.status!=="connected"){XN(),QN(),n9(),Af=null,yv=null;return}V4(),cH()}};let wv,bv;const my=(n,t)=>{const e=eH(n,t);e!==wv&&(tH(e),wv=e),e!==bv&&Mr&&typeof(wo==null?void 0:wo.setAppearanceMode)=="function"&&(wo.setAppearanceMode(e),bv=e)},Up=()=>{const n=_t.snapshot;if(n.connection.status!=="connected"){wv=void 0,bv=void 0;return}n.ready&&(my(n.display.appearanceMode,n.display.activeThemeColorScheme),B4===Ne.connection.status&&(j4(n.display.activeThemeName,n.display.themeJavaScriptConsentIds,!1),W4(n.display.activeThemeName,!1)))},dH=n=>{if(nr.pending)return;my(_t.snapshot.display.appearanceMode,n.activeThemeColorScheme);const t=Af,e=t!==null&&t.activeThemeName===n.themeName&&!K4(t.consentIds,new Set(n.themeJavaScriptConsentIds));j4(n.themeName,n.themeJavaScriptConsentIds,!0),!(nr.pending||e)&&(V4(),W4(n.themeName,!0))},fH=n=>{nr.pending||my(n.appearanceMode,_t.snapshot.display.activeThemeColorScheme)};G4();Up();Ne.addEventListener("change",G4);_t.addEventListener("change",Up);_t.addEventListener("theme-changed",dH);_t.addEventListener("appearance-changed",fH);const pH=new MutationObserver(()=>{Up()});pH.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});y6.register("ServerConnectionOwner",()=>Ne);y6.register("ApplicationService",()=>_t);const ku=globalThis.__telepath??(globalThis.__telepath={});ku.applicationService=_t;ku.connectionOwner=Ne;const mH=ku.renderCompleteCallbacks??(ku.renderCompleteCallbacks=new Set);Mr&&document.body.classList.add("electron");let J8=!1,Y8=!1;const gH=n=>{if(!nH||Y8||n!=="connected"&&n!=="no-channel"&&n!=="empty-channel")return;const t=document.querySelector("#settings-popover");t!==null&&(Y8=!0,t.setAttribute("open",""))},J4=()=>{J8||(l1(J7(_t,{serverURL:U4,electronMode:Mr,connectionOwner:Ne,updatePresentation:F4,desktopRecommendation:fy,desktopUpdate:lH,sidebarWidthPreference:iH,sidebarCollapsedPreference:sH,onRenderComplete(n){gH(n);for(const t of mH)t(n)}}),document.body),J8=!0,Up())},Y4=()=>{const n=Ne.connection;n.bootState==="pending"&&!n.hasAuthRejected&&Ne.connectError===null||(Ne.removeEventListener("change",Y4),J4())};Mr?Ne.addEventListener("change",Y4):J4();Ne.connect();function vH(){const n=new URL(window.location.href);return n.searchParams.get("reopenSettings")!=="1"?!1:(n.searchParams.delete("reopenSettings"),window.history.replaceState(window.history.state,"",`${n.pathname}${n.search}${n.hash}`),!0)}function K4(n,t){if(n.size!==t.size)return!1;for(const e of n)if(!t.has(e))return!1;return!0}
|