my-durable 0.0.3 → 0.0.5
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/README.md +8 -6
- package/apps/dpi-backend/src/config.ts +20 -3
- package/apps/dpi-backend/src/main.ts +2 -0
- package/apps/dpi-backend/src/pairing.ts +42 -11
- package/apps/dpi-backend/src/routes.ts +11 -3
- package/apps/dpi-playground/README.md +7 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index--aoZ5Tj0.css +1 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-Dq0CZYr7.js +77 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/index.html +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/src/App.vue +3 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/src/client/auth.ts +108 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/src/client/pair-handoff.ts +18 -3
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/LoginCard.vue +59 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/src/components/PairDeviceWizard.vue +32 -4
- package/apps/dpi-playground/apps/dpi-playground-fe/src/main.ts +4 -0
- package/apps/dpi-playground/apps/dpi-playground-fe/src/style.css +24 -0
- package/apps/dpi-playground/apps/dpi-playground-hub/src/admin-auth.ts +168 -0
- package/apps/dpi-playground/apps/dpi-playground-hub/src/audit.ts +14 -2
- package/apps/dpi-playground/apps/dpi-playground-hub/src/main.ts +79 -6
- package/apps/dpi-playground/apps/dpi-playground-hub/src/pairing.ts +42 -7
- package/apps/dpi-sdk/src/protocol/limits.ts +17 -0
- package/apps/dpi-sdk/src/protocol/pairing.ts +201 -1
- package/apps/dpi-tui/src/app.ts +25 -1
- package/apps/dpi-tui/src/main.ts +95 -51
- package/apps/dpi-tui/src/pickers.ts +98 -0
- package/apps/dpi-tui/src/welcome.ts +394 -0
- package/bin/dpi.mjs +155 -0
- package/package.json +2 -2
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-CFGc7lHT.js +0 -77
- package/apps/dpi-playground/apps/dpi-playground-fe/dist/assets/index-DFdKpwm_.css +0 -1
- package/bin/md.mjs +0 -88
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),ee=e=>x(e).slice(8,-1),S=e=>x(e)===`[object Object]`,te=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,C=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ne=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},re=/-\w/g,w=ne(e=>e.replace(re,e=>e.slice(1).toUpperCase())),ie=/\B([A-Z])/g,ae=ne(e=>e.replace(ie,`-$1`).toLowerCase()),oe=ne(e=>e.charAt(0).toUpperCase()+e.slice(1)),se=ne(e=>e?`on${oe(e)}`:``),ce=(e,t)=>!Object.is(e,t),le=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},ue=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},de=e=>{let t=parseFloat(e);return isNaN(t)?e:t},fe=e=>{let t=g(e)?Number(e):NaN;return isNaN(t)?e:t},pe,me=()=>pe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function T(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?ve(r):T(r);if(i)for(let e in i)t[e]=i[e]}return t}if(g(e)||v(e))return e}var he=/;(?![^(]*\))/g,ge=/:([^]+)/,_e=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function ve(e){let t={};return e.replace(_e,e=>e.startsWith(`/*`)?``:e).split(he).forEach(e=>{if(e){let n=e.split(ge);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function E(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=E(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var ye=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,be=e(ye);ye+``;function xe(e){return!!e||e===``}function Se(e,t,n){if(e.length!==t.length)return!1;let r=!0;for(let i=0;r&&i<e.length;i++)r=we(e[i],t[i],n);return r}function D(e,t,n){if(e.size!==t.size)return!1;let r=Array.from(t),i=new Uint8Array(r.length);for(let t of e){let e=-1;for(let a=0;a<r.length;a++)if(!i[a]&&we(t,r[a],n)){e=a;break}if(e<0)return!1;i[e]=1}return!0}function Ce(e,t,n){let r=f(e),i=f(t);if(r||i||(r=p(e),i=p(t),r||i))return r&&i?D(e,t,n):!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e){let i=e.hasOwnProperty(r),a=t.hasOwnProperty(r);if(i&&!a||!i&&a||!we(e[r],t[r],n))return!1}return String(e)===String(t)}function O(e,t,n,r){n||=[new Map,new Map];let[i,a]=n;if(i.has(e)||a.has(t))return i.get(e)===t&&a.get(t)===e;i.set(e,t),a.set(t,e);let o=r(e,t,n);return i.delete(e),a.delete(t),o}function we(e,t,n){if(e===t)return!0;let r=m(e),i=m(t);return r||i?r&&i?e.getTime()===t.getTime():!1:(r=_(e),i=_(t),r||i?e===t:(r=d(e),i=d(t),r||i?r&&i?O(e,t,n,Se):!1:(r=v(e),i=v(t),r||i?!r||!i?!1:O(e,t,n,Ce):String(e)===String(t))))}function Te(e,t){return e.findIndex(e=>we(e,t))}var Ee=e=>!!(e&&e.__v_isRef===!0),k=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?Ee(e)?k(e.value):JSON.stringify(e,De,2):String(e),De=(e,t)=>Ee(t)?De(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[Oe(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>Oe(e))}:_(t)?Oe(t):v(t)&&!d(t)&&!S(t)?String(t):t,Oe=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,ke,Ae=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&ke&&(ke.active?(this.parent=ke,this.index=(ke.scopes||(ke.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].pause()}for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes){let n=this.scopes.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}let n=this.effects.slice();for(e=0,t=n.length;e<t;e++)n[e].resume()}}run(e){if(this._active){let t=ke;try{return ke=this,e()}finally{ke=t}}}on(){++this._on===1&&(this.prevScope=ke,ke=this)}off(){if(this._on>0&&--this._on===0){if(ke===this)ke=this.prevScope;else{let e=ke;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){let e=this.scopes.slice();for(t=0,n=e.length;t<n;t++)e[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function je(){return ke}var A,Me=new WeakSet,Ne=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,ke&&(ke.active?ke.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Me.has(this)&&(Me.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Le(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Xe(this),Be(this);let e=A,t=Ke;A=this,Ke=!0;try{return this.fn()}finally{Ve(this),A=e,Ke=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)We(e);this.deps=this.depsTail=void 0,Xe(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Me.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){He(this)&&this.run()}get dirty(){return He(this)}},Pe=0,Fe,Ie;function Le(e,t=!1){if(e.flags|=8,t){e.next=Ie,Ie=e;return}e.next=Fe,Fe=e}function Re(){Pe++}function ze(){if(--Pe>0)return;if(Ie){let e=Ie;for(Ie=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;Fe;){let t=Fe;for(Fe=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Be(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ve(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),We(r),Ge(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function He(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ue(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ue(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Ze)||(e.globalVersion=Ze,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!He(e))))return;e.flags|=2;let t=e.dep,n=A,r=Ke;A=e,Ke=!0;try{Be(e);let n=e.fn(e._value);(t.version===0||ce(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{A=n,Ke=r,Ve(e),e.flags&=-3}}function We(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)We(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ge(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var Ke=!0,qe=[];function Je(){qe.push(Ke),Ke=!1}function Ye(){let e=qe.pop();Ke=e===void 0||e}function Xe(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=A;A=void 0;try{t()}finally{A=e}}}var Ze=0,Qe=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},$e=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!A||!Ke||A===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==A)t=this.activeLink=new Qe(A,this),A.deps?(t.prevDep=A.depsTail,A.depsTail.nextDep=t,A.depsTail=t):A.deps=A.depsTail=t,et(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=A.depsTail,t.nextDep=void 0,A.depsTail.nextDep=t,A.depsTail=t,A.deps===t&&(A.deps=e)}return t}trigger(e){this.version++,Ze++,this.notify(e)}notify(e){Re();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{ze()}}};function et(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)et(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var tt=new WeakMap,nt=Symbol(``),rt=Symbol(``),it=Symbol(``);function at(e,t,n){if(Ke&&A){let t=tt.get(e);t||tt.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new $e),r.map=t,r.key=n),r.track()}}function ot(e,t,n,r,i,a){let o=tt.get(e);if(!o){Ze++;return}let s=e=>{e&&e.trigger()};if(Re(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&te(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===it||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(it)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(nt)),f(e)&&s(o.get(rt)));break;case`delete`:i||(s(o.get(nt)),f(e)&&s(o.get(rt)));break;case`set`:f(e)&&s(o.get(nt))}}ze()}function st(e){let t=M(e);return t===e||(at(t,`iterate`,it),Gt(e))?t:Wt(e)?Ut(e)?t.map(e=>Yt(Jt(e))):t.map(Yt):t.map(Jt)}function ct(e){return at(e=M(e),`iterate`,it),e}function lt(e,t){return Wt(e)?Yt(Ut(e)?Jt(t):t):Jt(t)}var ut={__proto__:null,[Symbol.iterator](){return dt(this,Symbol.iterator,e=>lt(this,e))},concat(...e){return st(this).concat(...e.map(e=>d(e)?st(e):e))},entries(){return dt(this,`entries`,e=>(e[1]=lt(this,e[1]),e))},every(e,t){return j(this,`every`,e,t,void 0,arguments)},filter(e,t){return j(this,`filter`,e,t,e=>e.map(e=>lt(this,e)),arguments)},find(e,t){return j(this,`find`,e,t,e=>lt(this,e),arguments)},findIndex(e,t){return j(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return j(this,`findLast`,e,t,e=>lt(this,e),arguments)},findLastIndex(e,t){return j(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return j(this,`forEach`,e,t,void 0,arguments)},includes(...e){return mt(this,`includes`,e)},indexOf(...e){return mt(this,`indexOf`,e)},join(e){return st(this).join(e)},lastIndexOf(...e){return mt(this,`lastIndexOf`,e)},map(e,t){return j(this,`map`,e,t,void 0,arguments)},pop(){return ht(this,`pop`)},push(...e){return ht(this,`push`,e)},reduce(e,...t){return pt(this,`reduce`,e,t)},reduceRight(e,...t){return pt(this,`reduceRight`,e,t)},shift(){return ht(this,`shift`)},some(e,t){return j(this,`some`,e,t,void 0,arguments)},splice(...e){return ht(this,`splice`,e)},toReversed(){return st(this).toReversed()},toSorted(e){return st(this).toSorted(e)},toSpliced(...e){return st(this).toSpliced(...e)},unshift(...e){return ht(this,`unshift`,e)},values(){return dt(this,`values`,e=>lt(this,e))}};function dt(e,t,n){let r=ct(e),i=r[t]();return r!==e&&!Gt(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var ft=Array.prototype;function j(e,t,n,r,i,a){let o=ct(e),s=o!==e&&!Gt(e),c=o[t];if(c!==ft[t]){let t=c.apply(e,a);return s?Jt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,lt(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function pt(e,t,n,r){let i=ct(e),a=i!==e&&!Gt(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=lt(e,t)),n.call(this,t,lt(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?lt(e,c):c}function mt(e,t,n){let r=M(e);at(r,`iterate`,it);let i=r[t](...n);return(i===-1||i===!1)&&Kt(n[0])?(n[0]=M(n[0]),r[t](...n)):i}function ht(e,t,n=[]){Je(),Re();let r=M(e)[t].apply(e,n);return ze(),Ye(),r}var gt=e(`__proto__,__v_isRef,__isVue`),_t=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function vt(e){_(e)||(e=String(e));let t=M(this);return at(t,`has`,e),t.hasOwnProperty(e)}var yt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?Lt:It:i?Ft:Pt).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=ut[t]))return e;if(t===`hasOwnProperty`)return vt}let o=Reflect.get(e,t,Xt(e)?e:n);if((_(t)?_t.has(t):gt(t))||(r||at(e,`get`,t),i))return o;if(Xt(o)){let e=a&&te(t)?o:o.value;return r&&v(e)?Vt(e):e}return v(o)?r?Vt(o):zt(o):o}},bt=class extends yt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&te(t);if(!this._isShallow){let e=Wt(i);if(!Gt(n)&&!Wt(n)&&(i=M(i),n=M(n)),!a&&Xt(i)&&!Xt(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:u(e,t),s=Reflect.set(e,t,n,Xt(e)?e:r);return e===M(r)&&s&&(o?ce(n,i)&&ot(e,`set`,t,n,i):ot(e,`add`,t,n)),s}deleteProperty(e,t){let n=u(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&ot(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!_(t)||!_t.has(t))&&at(e,`has`,t),n}ownKeys(e){return at(e,`iterate`,d(e)?`length`:nt),Reflect.ownKeys(e)}},xt=class extends yt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},St=new bt,Ct=new xt,wt=new bt(!0),Tt=e=>e,Et=e=>Reflect.getPrototypeOf(e);function Dt(e,t,n){return function(...r){let i=this.__v_raw,a=M(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?Tt:t?Yt:Jt;return!t&&at(a,`iterate`,l?rt:nt),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function Ot(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function kt(e,t){let n={get(n){let r=this.__v_raw,i=M(r),a=M(n);e||(ce(n,a)&&at(i,`get`,n),at(i,`get`,a));let{has:o}=Et(i),s=t?Tt:e?Yt:Jt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&at(M(t),`iterate`,nt),t.size},has(t){let n=this.__v_raw,r=M(n),i=M(t);return e||(ce(t,i)&&at(r,`has`,t),at(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=M(a),s=t?Tt:e?Yt:Jt;return!e&&at(o,`iterate`,nt),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:Ot(`add`),set:Ot(`set`),delete:Ot(`delete`),clear:Ot(`clear`)}:{add(e){let n=M(this),r=Et(n),i=M(e),a=!t&&!Gt(e)&&!Wt(e)?i:e;return r.has.call(n,a)||ce(e,a)&&r.has.call(n,e)||ce(i,a)&&r.has.call(n,i)||(n.add(a),ot(n,`add`,a,a)),this},set(e,n){!t&&!Gt(n)&&!Wt(n)&&(n=M(n));let r=M(this),{has:i,get:a}=Et(r),o=i.call(r,e);o||=(e=M(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?ce(n,s)&&ot(r,`set`,e,n,s):ot(r,`add`,e,n),this},delete(e){let t=M(this),{has:n,get:r}=Et(t),i=n.call(t,e);i||=(e=M(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&ot(t,`delete`,e,void 0,a),o},clear(){let e=M(this),t=e.size!==0,n=e.clear();return t&&ot(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=Dt(r,e,t)}),n}function At(e,t){let n=kt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var jt={get:At(!1,!1)},Mt={get:At(!1,!0)},Nt={get:At(!0,!1)},Pt=new WeakMap,Ft=new WeakMap,It=new WeakMap,Lt=new WeakMap;function Rt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function zt(e){return Wt(e)?e:Ht(e,!1,St,jt,Pt)}function Bt(e){return Ht(e,!1,wt,Mt,Ft)}function Vt(e){return Ht(e,!0,Ct,Nt,It)}function Ht(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=Rt(ee(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function Ut(e){return Wt(e)?Ut(e.__v_raw):!!(e&&e.__v_isReactive)}function Wt(e){return!!(e&&e.__v_isReadonly)}function Gt(e){return!!(e&&e.__v_isShallow)}function Kt(e){return e?!!e.__v_raw:!1}function M(e){let t=e&&e.__v_raw;return t?M(t):e}function qt(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&ue(e,`__v_skip`,!0),e}var Jt=e=>v(e)?zt(e):e,Yt=e=>v(e)?Vt(e):e;function Xt(e){return e?e.__v_isRef===!0:!1}function N(e){return Qt(e,!1)}function Zt(e){return Qt(e,!0)}function Qt(e,t){return Xt(e)?e:new $t(e,t)}var $t=class{constructor(e,t){this.dep=new $e,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:M(e),this._value=t?e:Jt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Gt(e)||Wt(e);e=n?e:M(e),ce(e,t)&&(this._rawValue=e,this._value=n?e:Jt(e),this.dep.trigger())}};function P(e){return Xt(e)?e.value:e}var en={get:(e,t,n)=>t===`__v_raw`?e:P(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return Xt(i)&&!Xt(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function tn(e){return Ut(e)?e:new Proxy(e,en)}var nn=class{constructor(e){this.__v_isRef=!0,this._value=void 0;let t=this.dep=new $e,{get:n,set:r}=e(t.track.bind(t),t.trigger.bind(t));this._get=n,this._set=r}get value(){return this._value=this._get()}set value(e){this._set(e)}};function rn(e){return new nn(e)}var an=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new $e(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Ze-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&A!==this)return Le(this,!0),!0}get value(){let e=this.dep.track();return Ue(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function on(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new an(r,i,n)}var sn={},cn=new WeakMap,ln=void 0;function un(e,t=!1,n=ln){if(n){let t=cn.get(n);t||cn.set(n,t=[]),t.push(e)}}function dn(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:Gt(e)||o===!1||o===0?fn(e,1):fn(e),m,g,_,v,y=!1,b=!1;if(Xt(e)?(g=()=>e.value,y=Gt(e)):Ut(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>Ut(e)||Gt(e)),g=()=>e.map(e=>{if(Xt(e))return e.value;if(Ut(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){Je();try{_()}finally{Ye()}}let t=ln;ln=m;try{return f?f(e,3,[v]):e(v)}finally{ln=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>fn(e(),t)}let x=je(),ee=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{let n=e(...t);return ee(),n}}let S=b?Array(e.length).fill(sn):sn,te=e=>{if(m.flags&1&&(m.dirty||e)){if(n){let t=m.run();if(e||o||y||(b?t.some((e,t)=>ce(e,S[t])):ce(t,S))){_&&_();let e=ln;ln=m;try{let e=[t,S===sn?void 0:b&&S[0]===sn?[]:S,v];S=t,f?f(n,3,e):n(...e)}finally{ln=e}}}else m.run()}};return u&&u(te),m=new Ne(g),m.scheduler=l?()=>l(te,!1):te,v=e=>un(e,!1,m),_=m.onStop=()=>{let e=cn.get(m);if(e){if(f)f(e,4);else for(let t of e)t();cn.delete(m)}},n?a?te(!0):S=m.run():l?l(te.bind(null,!0),!0):m.run(),ee.pause=m.pause.bind(m),ee.resume=m.resume.bind(m),ee.stop=ee,ee}function fn(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Xt(e))fn(e.value,t,n);else if(d(e))for(let r=0;r<e.length;r++)fn(e[r],t,n);else if(p(e)||f(e))e.forEach(e=>{fn(e,t,n)});else if(S(e)){for(let r in e)fn(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&fn(e[r],t,n)}return e}function pn(e,t,n,r){try{return r?e(...r):e()}catch(e){hn(e,t,n)}}function mn(e,t,n,r){if(h(e)){let i=pn(e,t,n,r);return i&&y(i)&&i.catch(e=>{hn(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a<e.length;a++)i.push(mn(e[a],t,n,r));return i}}function hn(e,n,r,i=!0){let a=n?n.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=n&&n.appContext.config||t;if(n){let t=n.parent,i=n.proxy,a=`https://vuejs.org/error-reference/#runtime-${r}`;for(;t;){let n=t.ec;if(n){for(let t=0;t<n.length;t++)if(n[t](e,i,a)===!1)return}t=t.parent}if(o){Je(),pn(o,null,10,[e,i,a]),Ye();return}}gn(e,r,a,i,s)}function gn(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var _n=[],vn=-1,yn=[],bn=null,xn=0,Sn=Promise.resolve(),Cn=null;function wn(e){let t=Cn||Sn;return e?t.then(this?e.bind(this):e):t}function Tn(e){let t=vn+1,n=_n.length;for(;t<n;){let r=t+n>>>1,i=_n[r],a=jn(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function En(e){if(!(e.flags&1)){let t=jn(e),n=_n[_n.length-1];!n||!(e.flags&2)&&t>=jn(n)?_n.push(e):_n.splice(Tn(t),0,e),e.flags|=1,Dn()}}function Dn(){Cn||=Sn.then(Mn)}function On(e){if(!d(e))bn&&e.id===-1?bn.splice(xn+1,0,e):e.flags&1||(yn.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)yn.push(e[t]);Dn()}function kn(e,t,n=vn+1){for(;n<_n.length;n++){let t=_n[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;_n.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function An(e){if(yn.length){let e=[...new Set(yn)].sort((e,t)=>jn(e)-jn(t));if(yn.length=0,bn){for(let t=0;t<e.length;t++)bn.push(e[t]);return}for(bn=e,xn=0;xn<bn.length;xn++){let e=bn[xn];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}bn=null,xn=0}}var jn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Mn(e){try{for(vn=0;vn<_n.length;vn++){let e=_n[vn];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),pn(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;vn<_n.length;vn++){let e=_n[vn];e&&(e.flags&=-2)}vn=-1,_n.length=0,An(e),Cn=null,(_n.length||yn.length)&&Mn(e)}}var Nn=null,Pn=null;function Fn(e){let t=Nn;return Nn=e,Pn=e&&e.type.__scopeId||null,t}function In(e,t=Nn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&ba(-1);let i=Fn(t),a=ga.length,o;try{o=e(...n)}finally{for(let e=ga.length;e>a;e--)va();Fn(i),r._d&&ba(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function Ln(e,n){if(Nn===null)return e;let r=Za(Nn),i=e.dirs||=[];for(let e=0;e<n.length;e++){let[a,o,s,c=t]=n[e];a&&(h(a)&&(a={mounted:a,updated:a}),a.deep&&fn(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function Rn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(Je(),mn(c,n,8,[e.el,s,e,t]),Ye())}}function zn(e,t){if(La){let n=La.provides,r=La.parent&&La.parent.provides;r===n&&(n=La.provides=Object.create(r)),n[e]=t}}function Bn(e,t,n=!1){let r=Ra();if(r||Si){let i=Si?Si._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&h(t)?t.call(r&&r.proxy):t}}var Vn=Symbol.for(`v-scx`),Hn=()=>Bn(Vn);function Un(e,t){return Gn(e,null,{flush:`sync`})}function Wn(e,t,n){return Gn(e,t,n)}function Gn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(Wa){if(c===`sync`){let e=Hn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=La;u.call=(e,t,n)=>mn(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{ea(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():En(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=dn(e,n,u);return Wa&&(f?f.push(h):d&&h()),h}function Kn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?qn(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=Va(this),s=Gn(i,a.bind(r),n);return o(),s}function qn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Jn=new WeakMap,Yn=Symbol(`_vte`),Xn=e=>e.__isTeleport,Zn=e=>e&&(e.disabled||e.disabled===``),Qn=e=>e&&(e.defer||e.defer===``),$n=e=>typeof SVGElement<`u`&&e instanceof SVGElement,er=e=>typeof MathMLElement==`function`&&e instanceof MathMLElement,tr=(e,t)=>{let n=e&&e.to;return g(n)?t?t(n):null:n},nr={name:`Teleport`,__isTeleport:!0,process(e,t,n,r,i,a,o,s,c,l){let{mc:u,pc:d,pbc:f,o:{insert:p,querySelector:m,createText:h,createComment:g,parentNode:_}}=l,v=Zn(t.props),{dynamicChildren:y}=t,b=(e,t,n)=>{e.shapeFlag&16&&u(e.children,t,n,i,a,o,s,c)},x=(e=t)=>{let n=Zn(e.props),r=e.target=tr(e.props,m),a=sr(r,e,h,p);r&&(o!==`svg`&&$n(r)?o=`svg`:o!==`mathml`&&er(r)&&(o=`mathml`),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(r),n||(b(e,r,a),or(e,!1)))},ee=e=>{let t=()=>{if(Jn.get(e)===t){if(Jn.delete(e),Zn(e.props)){let t=_(e.el)||n;b(e,t,e.anchor),or(e,!0)}x(e)}};Jn.set(e,t),ea(t,a)};if(e==null){let e=t.el=h(``),i=t.anchor=h(``);if(p(e,n,r),p(i,n,r),Qn(t.props)||a&&a.pendingBranch){ee(t);return}v&&(b(t,n,i),or(t,!0)),x()}else{t.el=e.el;let r=t.anchor=e.anchor,u=Jn.get(e);if(u){u.flags|=8,Jn.delete(e),ee(t);return}t.targetStart=e.targetStart;let p=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Zn(e.props),_=g?n:p,b=g?r:h;if(o===`svg`||$n(p)?o=`svg`:(o===`mathml`||er(p))&&(o=`mathml`),y?(f(e.dynamicChildren,y,_,i,a,o,s),oa(e,t,!0)):c||d(e,t,_,b,i,a,o,s,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):rr(t,n,r,l,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){let e=tr(t.props,m);e&&(t.target=e,rr(t,e,null,l,0))}else g&&rr(t,p,h,l,1);or(t,v)}},remove(e,t,n,{um:r,o:{remove:i}},a){let{shapeFlag:o,children:s,anchor:c,targetStart:l,targetAnchor:u,target:d,props:f}=e,p=Zn(f),m=a||!p,h=Jn.get(e);if(h&&(h.flags|=8,Jn.delete(e)),d&&(i(l),i(u)),a&&i(c),!h&&(p||d)&&o&16)for(let e=0;e<s.length;e++){let i=s[e];r(i,t,n,m,!!i.dynamicChildren)}},move:rr,hydrate:ir};function rr(e,t,n,{o:{insert:r},m:i},a=2){a===0&&r(e.targetAnchor,t,n);let{el:o,anchor:s,shapeFlag:c,children:l,props:u}=e,d=a===2;if(d&&r(o,t,n),!Jn.has(e)&&(!d||Zn(u))&&c&16)for(let e=0;e<l.length;e++)i(l[e],t,n,2);d&&r(s,t,n)}function ir(e,t,n,r,i,a,{o:{nextSibling:o,parentNode:s,querySelector:c,insert:l,createText:u}},d){function f(e,n){let r=n;for(;r;){if(r&&r.nodeType===8){if(r.data===`teleport start anchor`)t.targetStart=r;else if(r.data===`teleport anchor`){t.targetAnchor=r,e._lpa=t.targetAnchor&&o(t.targetAnchor);break}}r=o(r)}}function p(e,t){t.anchor=d(o(e),t,s(e),n,r,i,a)}let m=t.target=tr(t.props,c),h=Zn(t.props);if(m){let c=m._lpa||m.firstChild;t.shapeFlag&16&&(h?(p(e,t),f(m,c),t.targetAnchor||sr(m,t,u,l,s(e)===m?e:null)):(t.anchor=o(e),f(m,c),t.targetAnchor||sr(m,t,u,l),d(c&&o(c),t,m,n,r,i,a))),or(t,h)}else h&&t.shapeFlag&16&&(p(e,t),t.targetStart=e,t.targetAnchor=o(e));return t.anchor&&o(t.anchor)}var ar=nr;function or(e,t){let n=e.ctx;if(n&&n.ut){let r,i;for(t?(r=e.el,i=e.anchor):(r=e.targetStart,i=e.targetAnchor);r&&r!==i;)r.nodeType===1&&r.setAttribute(`data-v-owner`,n.uid),r=r.nextSibling;n.ut()}}function sr(e,t,n,r,i=null){let a=t.targetStart=n(``),o=t.targetAnchor=n(``);return a[Yn]=o,e&&(r(a,e,i),r(o,e,i)),o}var cr=Symbol(`_leaveCb`),lr=Symbol(`_enterCb`);function ur(){let e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Lr(()=>{e.isMounted=!0}),Br(()=>{e.isUnmounting=!0}),e}var dr=[Function,Array],fr={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:dr,onEnter:dr,onAfterEnter:dr,onEnterCancelled:dr,onBeforeLeave:dr,onLeave:dr,onAfterLeave:dr,onLeaveCancelled:dr,onBeforeAppear:dr,onAppear:dr,onAfterAppear:dr,onAppearCancelled:dr},pr=e=>{let t=e.subTree;return t.component?pr(t.component):t},mr={name:`BaseTransition`,props:fr,setup(e,{slots:t}){let n=Ra(),r=ur();return()=>{let i=t.default&&Sr(t.default(),!0),a=i&&i.length?hr(i):n.subTree?W():void 0;if(!a)return;let o=M(e),{mode:s}=o;if(r.isLeaving)return yr(a);let c=br(a);if(!c)return yr(a);let l=vr(c,o,r,n,e=>l=e);c.type!==ma&&xr(c,l);let u=n.subTree&&br(n.subTree);if(u&&u.type!==ma&&!Ca(u,c)&&pr(n).type!==ma){let e=vr(u,o,r,n);if(xr(u,e),s===`out-in`&&c.type!==ma)return r.isLeaving=!0,e.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete e.afterLeave,u=void 0},yr(a);s===`in-out`&&c.type!==ma?e.delayLeave=(e,t,n)=>{let i=_r(r,u);i[String(u.key)]=u,e[cr]=()=>{t(),e[cr]=void 0,delete l.delayedLeave,u=void 0},l.delayedLeave=()=>{n(),delete l.delayedLeave,u=void 0}}:u=void 0}else u&&=void 0;return a}}};function hr(e){let t=e[0];if(e.length>1){for(let n of e)if(n.type!==ma){t=n;break}}return t}var gr=mr;function _r(e,t){let{leavingVNodes:n}=e,r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function vr(e,t,n,r,i){let{appear:a,mode:o,persisted:s=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:u,onEnterCancelled:f,onBeforeLeave:p,onLeave:m,onAfterLeave:h,onLeaveCancelled:g,onBeforeAppear:_,onAppear:v,onAfterAppear:y,onAppearCancelled:b}=t,x=String(e.key),ee=_r(n,e),S=(e,t)=>{e&&mn(e,r,9,t)},te=(e,t)=>{let n=t[1];S(e,t),d(e)?e.every(e=>e.length<=1)&&n():e.length<=1&&n()},C={mode:o,persisted:s,beforeEnter(t){let r=c;if(!n.isMounted){if(a)r=_||c;else return}t[cr]&&t[cr](!0);let i=ee[x];i&&Ca(e,i)&&i.el[cr]&&i.el[cr](),S(r,[t])},enter(t){if(ee[x]===e)return;let r=l,i=u,o=f;if(!n.isMounted){if(a)r=v||l,i=y||u,o=b||f;else return}let s=!1;t[lr]=e=>{s||(s=!0,S(e?o:i,[t]),C.delayedLeave&&C.delayedLeave(),t[lr]=void 0)};let c=t[lr].bind(null,!1);r?te(r,[t,c]):c()},leave(t,r){let i=String(e.key);if(t[lr]&&t[lr](!0),n.isUnmounting)return r();S(p,[t]);let a=!1;t[cr]=n=>{a||(a=!0,r(),S(n?g:h,[t]),t[cr]=void 0,ee[i]===e&&delete ee[i])};let o=t[cr].bind(null,!1);ee[i]=e,m?te(m,[t,o]):o()},clone(e){let a=vr(e,t,n,r,i);return i&&i(a),a}};return C}function yr(e){if(kr(e))return e=Oa(e),e.children=null,e}function br(e){if(!kr(e))return Xn(e.type)&&e.children?hr(e.children):e;if(e.component)return e.component.subTree;let{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&h(n.default))return n.default()}}function xr(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;let n=e.component.subTree;xr(Xn(n.type)&&br(n)||n,t)}else e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function Sr(e,t=!1,n){let r=[],i=0;for(let a=0;a<e.length;a++){let o=e[a],s=n==null?o.key:String(n)+String(o.key==null?a:o.key);o.type===L?(o.patchFlag&128&&i++,r=r.concat(Sr(o.children,t,s))):(t||o.type!==ma)&&r.push(s==null?o:Oa(o,{key:s}))}if(i>1)for(let e=0;e<r.length;e++)r[e].patchFlag=-2;return r}function F(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function Cr(e){e.ids=[e.ids[0]+e.ids[2]+++`-`,0,0]}function wr(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Tr=new WeakMap;function Er(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>Er(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Or(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Er(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?Za(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=M(v),b=v===t?i:e=>!wr(_,e)&&u(y,e),x=(e,t)=>!(t&&wr(_,t));if(m!=null&&m!==p){if(Dr(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(Xt(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))pn(p,f,12,[l,_]);else{let t=g(p),n=Xt(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),Tr.delete(e)};t.id=-1,Tr.set(e,t),ea(t,r)}else Dr(e),i()}}}function Dr(e){let t=Tr.get(e);t&&(t.flags|=8,Tr.delete(e))}me().requestIdleCallback,me().cancelIdleCallback;var Or=e=>!!e.type.__asyncLoader,kr=e=>e.type.__isKeepAlive;function Ar(e,t){Mr(e,`a`,t)}function jr(e,t){Mr(e,`da`,t)}function Mr(e,t,n=La){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Pr(t,r,n),n){let e=n.parent;for(;e&&e.parent;)kr(e.parent.vnode)&&Nr(r,t,n,e),e=e.parent}}function Nr(e,t,n,r){let i=Pr(t,e,r,!0);Vr(()=>{c(r[t],i)},n)}function Pr(e,t,n=La,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{Je();let i=Va(n),a=mn(t,n,e,r);return i(),Ye(),a};return r?i.unshift(a):i.push(a),a}}var Fr=e=>(t,n=La)=>{(!Wa||e===`sp`)&&Pr(e,(...e)=>t(...e),n)},Ir=Fr(`bm`),Lr=Fr(`m`),Rr=Fr(`bu`),zr=Fr(`u`),Br=Fr(`bum`),Vr=Fr(`um`),Hr=Fr(`sp`),Ur=Fr(`rtg`),Wr=Fr(`rtc`);function Gr(e,t=La){Pr(`ec`,e,t)}var Kr=`components`;function qr(e,t){return Xr(Kr,e,!0,t)||e}var Jr=Symbol.for(`v-ndc`);function Yr(e){return g(e)?Xr(Kr,e,!1)||e:e||Jr}function Xr(e,t,n=!0,r=!1){let i=Nn||La;if(i){let n=i.type;if(e===Kr){let e=Qa(n,!1);if(e&&(e===t||e===w(t)||e===oe(w(t))))return n}let a=Zr(i[e]||n[e],t)||Zr(i.appContext[e],t);return!a&&r?n:a}}function Zr(e,t){return e&&(e[t]||e[w(t)]||e[oe(w(t))])}function I(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&Ut(e),r=!1,s=!1;n&&(r=!Gt(e),s=Wt(e),e=ct(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?Yt(Jt(e[n])):Jt(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(v(e)){if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}}else i=[];return n&&(n[r]=i),i}var Qr=e=>e?Ua(e)?Za(e):Qr(e.parent):null,$r=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>Qr(e.parent),$root:e=>Qr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>li(e),$forceUpdate:e=>e.f||=()=>{En(e.update)},$nextTick:e=>e.n||=wn.bind(e.proxy),$watch:e=>Kn.bind(e)}),ei=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),ti={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(ei(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else ii&&(s[n]=0)}let d=$r[n],f,p;if(d)return n===`$attrs`&&at(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return ei(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||ei(n,c)||u(o,c)||u(i,c)||u($r,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ni(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}function ri(e,t){return!e||!t?e||t:d(e)&&d(t)?e.concat(t):s({},ni(e),ni(t))}var ii=!0;function ai(e){let t=li(e),n=e.proxy,i=e.ctx;ii=!1,t.beforeCreate&&si(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:ee,destroyed:S,unmounted:te,render:C,renderTracked:ne,renderTriggered:re,errorCaptured:w,serverPrefetch:ie,expose:ae,inheritAttrs:oe,components:se,directives:ce,filters:le}=t;if(u&&oi(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=zt(t))}if(ii=!0,o)for(let e in o){let t=o[e],a=G({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)ci(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{zn(t,e[t])})}f&&si(f,e,`c`);function ue(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(ue(Ir,p),ue(Lr,m),ue(Rr,g),ue(zr,_),ue(Ar,y),ue(jr,b),ue(Gr,w),ue(Wr,ne),ue(Ur,re),ue(Br,ee),ue(Vr,te),ue(Hr,ie),d(ae)){if(ae.length){let t=e.exposed||={};ae.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={}}C&&e.render===r&&(e.render=C),oe!=null&&(e.inheritAttrs=oe),se&&(e.components=se),ce&&(e.directives=ce),ie&&Cr(e)}function oi(e,t,n=r){d(e)&&(e=mi(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?Bn(r.from||n,r.default,!0):Bn(r.from||n):Bn(r),Xt(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function si(e,t,n){mn(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ci(e,t,n,r){let i=r.includes(`.`)?qn(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&Wn(i,n)}else if(h(e))Wn(i,e.bind(n));else if(v(e)){if(d(e))e.forEach(e=>ci(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&Wn(i,r,e)}}}function li(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>ui(c,e,o,!0)),ui(c,t,o)),v(t)&&a.set(t,c),c}function ui(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&ui(e,a,n,!0),i&&i.forEach(t=>ui(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=di[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var di={data:fi,props:_i,emits:_i,methods:gi,computed:gi,beforeCreate:hi,created:hi,beforeMount:hi,mounted:hi,beforeUpdate:hi,updated:hi,beforeDestroy:hi,beforeUnmount:hi,destroyed:hi,unmounted:hi,activated:hi,deactivated:hi,errorCaptured:hi,serverPrefetch:hi,components:gi,directives:gi,watch:vi,provide:fi,inject:pi};function fi(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function pi(e,t){return gi(mi(e),mi(t))}function mi(e){if(d(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function hi(e,t){return e?[...new Set([].concat(e,t))]:t}function gi(e,t){return e?s(Object.create(null),e,t):t}function _i(e,t){return e?d(e)&&d(t)?[...new Set([...e,...t])]:s(Object.create(null),ni(e),ni(t??{})):t}function vi(e,t){if(!e)return t;if(!t)return e;let n=s(Object.create(null),e);for(let r in t)n[r]=hi(e[r],t[r]);return n}function yi(){return{app:null,config:{isNativeTag:i,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var bi=0;function xi(e,t){return function(n,r=null){h(n)||(n=s({},n)),r!=null&&!v(r)&&(r=null);let i=yi(),a=new WeakSet,o=[],c=!1,l=i.app={_uid:bi++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:to,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&h(e.install)?(a.add(e),e.install(l,...t)):h(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,s){if(!c){let u=l._ceVNode||H(n,r);return u.appContext=i,s===!0?s=`svg`:s===!1&&(s=void 0),o&&t?t(u,a):e(u,a,s),c=!0,l._container=a,a.__vue_app__=l,Za(u.component)}},onUnmount(e){o.push(e)},unmount(){c&&(mn(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=Si;Si=l;try{return e()}finally{Si=t}}};return l}}var Si=null;function Ci(e,n,r=t){let i=Ra(),a=w(n),o=ae(n),s=wi(e,a),c=rn((s,c)=>{let l,u=t,d;return Un(()=>{let t=e[a];ce(l,t)&&(l=t,c())}),{get(){return s(),r.get?r.get(l):l},set(e){let s=r.set?r.set(e):e;if(!ce(s,l)&&!(u!==t&&ce(e,u)))return;let f=i.vnode.props,p=!!(f&&(n in f||a in f||o in f)&&(`onUpdate:${n}`in f||`onUpdate:${a}`in f||`onUpdate:${o}`in f));p||(l=e,c()),i.emit(`update:${n}`,s),ce(e,u)&&(ce(e,s)&&!ce(s,d)||p&&u!==t&&!ce(s,l))&&c(),u=e,d=s}}});return c[Symbol.iterator]=()=>{let e=0;return{next(){return e<2?{value:e++?s||t:c,done:!1}:{done:!0}}}},c}var wi=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${w(t)}Modifiers`]||e[`${ae(t)}Modifiers`];function Ti(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&wi(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=a.map(de)));let c,l=i[c=se(n)]||i[c=se(w(n))];!l&&o&&(l=i[c=se(ae(n))]),l&&mn(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,mn(u,e,6,a)}}var Ei=new WeakMap;function Di(e,t,n=!1){let r=n?Ei:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Di(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function Oi(e,t){return!e||!a(t)?!1:(t=t.slice(2),t=t===`Once`?t:t.replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,ae(t))||u(e,t))}function ki(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=Fn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=ka(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=ka(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:Ai(c)}}catch(t){ga.length=0,hn(t,e,1),v=H(ma)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=ji(y,a)),b=Oa(b,y,!1,!0))}return n.dirs&&(b=Oa(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&xr(Xn(b.type)&&br(b)||b,n.transition),v=b,Fn(_),v}var Ai=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},ji=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Mi(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Ni(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Pi(o,r,n)&&!Oi(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?!o||Ni(r,o,l):!!o;return!1}function Ni(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Pi(t,e,a)&&!Oi(n,a))return!0}return!1}function Pi(e,t,n){let r=e[n],i=t[n];return n===`style`&&v(r)&&v(i)?!we(r,i):r!==i}function Fi({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Ii={},Li=()=>Object.create(Ii),Ri=e=>Object.getPrototypeOf(e)===Ii;function zi(e,t,n,r=!1){let i={},a=Li();e.propsDefaults=Object.create(null),Vi(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);e.props=n?r?i:Bt(i):e.type.props?i:a,e.attrs=a}function Bi(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=M(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(Oi(e.emitsOptions,o))continue;let d=t[o];if(c){if(u(a,o))d!==a[o]&&(a[o]=d,l=!0);else{let t=w(o);i[t]=Hi(c,s,t,d,e,!1)}}else d!==a[o]&&(a[o]=d,l=!0)}}}else{Vi(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!u(t,a)&&((r=ae(a))===a||!u(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Hi(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!u(t,e))&&(delete a[e],l=!0)}l&&ot(e.attrs,`set`,``)}function Vi(e,n,r,i){let[a,o]=e.propsOptions,s=!1,c;if(n)for(let t in n){if(C(t))continue;let l=n[t],d;a&&u(a,d=w(t))?!o||!o.includes(d)?r[d]=l:(c||={})[d]=l:Oi(e.emitsOptions,t)||(!(t in i)||l!==i[t])&&(i[t]=l,s=!0)}if(o){let n=M(r),i=c||t;for(let t=0;t<o.length;t++){let s=o[t];r[s]=Hi(a,n,s,i[s],e,!u(i,s))}}return s}function Hi(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=u(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&h(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=Va(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===ae(n))&&(r=!0))}return r}var Ui=new WeakMap;function Wi(e,r,i=!1){let a=i?Ui:r.propsCache,o=a.get(e);if(o)return o;let c=e.props,l={},f=[],p=!1;if(!h(e)){let t=e=>{p=!0;let[t,n]=Wi(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;e<c.length;e++){let n=w(c[e]);Gi(n)&&(l[n]=t)}else if(c)for(let e in c){let t=w(e);if(Gi(t)){let n=c[e],r=l[t]=d(n)||h(n)?{type:n}:s({},n),i=r.type,a=!1,o=!0;if(d(i))for(let e=0;e<i.length;++e){let t=i[e],n=h(t)&&t.name;if(n===`Boolean`){a=!0;break}n===`String`&&(o=!1)}else a=h(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||u(r,`default`))&&f.push(t)}}let m=[l,f];return v(e)&&a.set(e,m),m}function Gi(e){return e[0]!==`$`&&!C(e)}var Ki=e=>e===`_`||e===`_ctx`||e===`$stable`,qi=e=>d(e)?e.map(ka):[ka(e)],Ji=(e,t,n)=>{if(t._n)return t;let r=In((...e)=>qi(t(...e)),n);return r._c=!1,r},Yi=(e,t,n)=>{let r=e._ctx;for(let n in e){if(Ki(n))continue;let i=e[n];if(h(i))t[n]=Ji(n,i,r);else if(i!=null){let e=qi(i);t[n]=()=>e}}},Xi=(e,t)=>{let n=qi(t);e.slots.default=()=>n},Zi=(e,t,n)=>{for(let r in t)(n||!Ki(r))&&(e[r]=t[r])},Qi=(e,t,n)=>{let r=e.slots=Li();if(e.vnode.shapeFlag&32){let e=t._;e?(Zi(r,t,n),n&&ue(r,`_`,e,!0)):Yi(t,r)}else t&&Xi(e,t)},$i=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:Zi(a,n,r):(o=!n.$stable,Yi(n,a)),s=n}else n&&(Xi(e,n),s={default:1});if(o)for(let e in a)!Ki(e)&&s[e]==null&&delete a[e]},ea=fa;function ta(e){return na(e)}function na(e,i){let a=me();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,r,i=null,a=null,o=null,s=void 0,c=null,l=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ca(e,t)&&(i=Se(e),ve(e,a,o,!0),e=null),t.patchFlag===-2&&(l=!1,t.dynamicChildren=null),t.dynamicChildren&&e&&e.dynamicChildren&&e.dynamicChildren.hasOnce&&(t.dynamicChildren===n&&(t.dynamicChildren=[]),t.dynamicChildren.hasOnce=!0);let{type:u,ref:d,shapeFlag:f}=t;switch(u){case pa:y(e,t,r,i);break;case ma:b(e,t,r,i);break;case ha:e??x(t,r,i,s);break;case L:se(e,t,r,i,a,o,s,c,l);break;default:f&1?te(e,t,r,i,a,o,s,c,l):f&6?ce(e,t,r,i,a,o,s,c,l):(f&64||f&128)&&u.process(e,t,r,i,a,o,s,c,l,O)}d!=null&&a?Er(d,e&&e.ref,o,t||e,!t):d==null&&e&&e.ref!=null&&Er(e.ref,null,o,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},ee=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},S=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},te=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ne(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ie(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ne=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&w(e.children,d,null,r,i,ra(e,a),s,u),_&&Rn(e,null,r,`created`),re(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!C(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&Na(f,r,e)}_&&Rn(e,null,r,`beforeMount`);let v=aa(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&ea(()=>{try{f&&Na(f,r,e),v&&g.enter(d),_&&Rn(e,null,r,`mounted`)}finally{}},i)},re=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||da(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;re(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},w=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++){let c=e[l]=s?Aa(e[l]):ka(e[l]);v(null,c,t,n,r,i,a,o,s)}},ie=(e,n,r,i,a,o,s)=>{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&ia(r,!1),(g=h.onVnodeBeforeUpdate)&&Na(g,r,n,e),f&&Rn(n,e,r,`beforeUpdate`),r&&ia(r,!0),d&&(!e.dynamicChildren||e.dynamicChildren.length!==d.length)&&(u=0,s=!1,d=null),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?ae(e.dynamicChildren,d,l,r,i,ra(n,a),o):s||T(e,n,l,null,r,i,ra(n,a),o,!1),u>0){if(u&16)oe(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==n.children&&p(l,n.children)}else!s&&d==null&&oe(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&ea(()=>{g&&Na(g,r,n,e),f&&Rn(n,e,r,`updated`)},i)},ae=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s],u=c.el&&(c.type===L||!Ca(c,l)||c.shapeFlag&198)?m(c.el):n;v(c,l,u,null,r,i,a,o,!0)}},oe=(e,n,r,i,a)=>{if(n!==r){if(n!==t)for(let t in n)!C(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(C(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},se=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),w(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(ae(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&oa(e,t,!0)):T(e,t,n,f,i,a,s,c,l)},ce=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):ue(t,n,r,i,a,o,c):de(e,t,c)},ue=(e,t,n,r,i,a,o)=>{let s=e.component=Ia(e,r,i);if(kr(e)&&(s.ctx.renderer=O),Ga(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,fe,o),!e.el){let r=s.subTree=H(ma);b(null,r,t,n),e.placeholder=r.el}}else fe(s,e,t,n,i,a,o)},de=(e,t,n)=>{let r=t.component=e.component;if(Mi(e,t,n)){if(r.asyncDep&&!r.asyncResolved){t.el=e.el,pe(r,t,n);return}r.next=t,r.update()}else t.el=e.el,r.vnode=t},fe=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=ca(e);if(n){t&&(t.el=c.el,pe(e,t,o)),n.asyncDep.then(()=>{ea(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;ia(e,!1),t?(t.el=c.el,pe(e,t,o)):t=c,n&&le(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&Na(d,s,t,c),ia(e,!0);let f=ki(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),Se(p),e,i,a),t.el=f.el,u===null&&Fi(e,f.el),r&&ea(r,i),(d=t.props&&t.props.onVnodeUpdated)&&ea(()=>Na(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Or(t);if(ia(e,!1),l&&le(l),!m&&(o=c&&c.onVnodeBeforeMount)&&Na(o,d,t),ia(e,!0),s&&Te){let t=()=>{e.subTree=ki(e),Te(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=ki(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&ea(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ea(()=>Na(o,d,e),i)}(t.shapeFlag&256||d&&Or(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ea(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new Ne(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>En(u),ia(e,!0),l()},pe=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Bi(e,t.props,r,n),$i(e,t.children,n),Je(),kn(e),Ye()},T=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){ge(l,d,n,r,i,a,o,s,c);return}if(f&256){he(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&xe(l,i,a),d!==l&&p(n,d)):u&16?m&16?ge(l,d,n,r,i,a,o,s,c):xe(l,i,a,!0):(u&8&&p(n,``),m&16&&w(d,n,r,i,a,o,s,c))},he=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p=0;for(;p<f;p++){let n=t[p]=l?Aa(t[p]):ka(t[p]);v(e[p],n,r,null,a,o,s,c,l)}u>d?xe(e,a,o,!0,!1,f):w(t,r,i,a,o,s,c,l,f)},ge=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Aa(t[u]):ka(t[u]);if(Ca(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Aa(t[p]):ka(t[p]);if(Ca(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?Aa(t[u]):ka(t[u]),r,n,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)ve(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Aa(t[u]):ka(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,ee=0,S=Array(b);for(u=0;u<b;u++)S[u]=0;for(u=m;u<=f;u++){let n=e[u];if(y>=b){ve(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(S[_-h]===0&&Ca(n,t[_])){i=_;break}i===void 0?ve(n,a,o,!0):(S[i-h]=u+1,i>=ee?ee=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let te=x?sa(S):n;for(_=te.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1<d?f.el||ua(f):i;S[u]===0?v(null,n,r,p,a,o,s,c,l):x&&(_<0||u!==te[_]?_e(n,r,p,2):_--)}}},_e=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){_e(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,O);return}if(c===L){o(a,t,n);for(let e=0;e<u.length;e++)_e(u[e],t,n,r);o(e.anchor,t,n);return}if(c===ha){ee(e,t,n);return}if(r!==2&&d&1&&l){if(r===0)l.persisted&&!a[cr]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),ea(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[cr];a._isLeaving&&a[cr](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}}else o(a,t,n)},ve=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if((d===-2||l&&l.hasOnce)&&(i=!1),s!=null&&(Je(),Er(s,null,n,e,!0),Ye()),p!=null&&(!e.ctx||e.ctx===t)&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Or(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&Na(_,t,e),u&6)be(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&Rn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,O,r):l&&!l.hasOnce&&(a!==L||d>0&&d&64)?xe(l,t,n,!1,!0):(a===L&&d&384||!i&&u&16)&&xe(c,t,n),r&&E(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&ea(()=>{_&&Na(_,t,e),h&&Rn(e,null,t,`unmounted`),v&&(e.el=null)},n)},E=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===L){ye(n,r);return}if(t===ha){S(e),i&&!i.persisted&&i.afterLeave&&i.afterLeave();return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},ye=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},be=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;la(c),la(l),r&&le(r),i.stop(),a?(a.flags|=8,ve(o,e,t,n)):e.vnode.el&&o&&(o.transition=e.vnode.transition,ve(o,e,t,n)),s&&ea(s,t),ea(()=>{e.isUnmounted=!0},t)},xe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)ve(e[o],t,n,r,i)},Se=e=>{if(e.shapeFlag&6)return Se(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Yn];return n?h(n):t},D=!1,Ce=(e,t,n)=>{let r;e==null?t._vnode&&(ve(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,D||=(D=!0,kn(r),An(),!1)},O={p:v,um:ve,m:_e,r:E,mt:ue,mc:w,pc:T,pbc:ae,n:Se,o:e},we,Te;return i&&([we,Te]=i(O)),{render:Ce,hydrate:we,createApp:xi(Ce,we)}}function ra({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ia({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function aa(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function oa(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Aa(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&oa(t,a)),a.type===pa&&(a.patchFlag===-1&&(a=i[e]=Aa(a)),a.el=t.el),a.type===ma&&!a.el&&(a.el=t.el)}}function sa(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-->0;)n[a]=o,o=t[o];return n}function ca(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:ca(t)}function la(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function ua(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?ua(t.subTree):null}var da=e=>e.__isSuspense;function fa(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):On(e)}var L=Symbol.for(`v-fgt`),pa=Symbol.for(`v-txt`),ma=Symbol.for(`v-cmt`),ha=Symbol.for(`v-stc`),ga=[],_a=null;function R(e=!1){ga.push(_a=e?null:[])}function va(){ga.pop(),_a=ga[ga.length-1]||null}var ya=1;function ba(e,t=!1){ya+=e,e<0&&_a&&t&&(_a.hasOnce=!0)}function xa(e){return e.dynamicChildren=ya>0?_a||n:null,va(),ya>0&&_a&&_a.push(e),e}function z(e,t,n,r,i,a){return xa(V(e,t,n,r,i,a,!0))}function B(e,t,n,r,i){return xa(H(e,t,n,r,i,!0))}function Sa(e){return e?e.__v_isVNode===!0:!1}function Ca(e,t){return e.type===t.type&&e.key===t.key}var wa=({key:e})=>e??null,Ta=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||Xt(e)||h(e)?{i:Nn,r:e,k:t,f:!!n}:e);function V(e,t=null,n=null,r=0,i=null,a=e===L?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&wa(t),ref:t&&Ta(t),scopeId:Pn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:Nn};return s?(ja(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),ya>0&&!o&&_a&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&_a.push(c),c}var H=Ea;function Ea(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===Jr)&&(e=ma),Sa(e)){let r=Oa(e,t,!0);return n&&ja(r,n),ya>0&&!a&&_a&&(r.shapeFlag&6?_a[_a.indexOf(e)]=r:_a.push(r)),r.patchFlag=-2,r}if($a(e)&&(e=e.__vccOpts),t){t=Da(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=E(e)),v(n)&&(Kt(n)&&!d(n)&&(n=s({},n)),t.style=T(n))}let o=g(e)?1:da(e)?128:Xn(e)?64:v(e)?4:h(e)?2:0;return V(e,t,n,r,i,o,a,!0)}function Da(e){return e?Kt(e)||Ri(e)?s({},e):e:null}function Oa(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Ma(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&wa(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Ta(t)):[a,Ta(t)]:Ta(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==L?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Oa(e.ssContent),ssFallback:e.ssFallback&&Oa(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return c&&r&&xr(u,c.clone(u)),u}function U(e=` `,t=0){return H(pa,null,e,t)}function W(e=``,t=!1){return t?(R(),B(ma,null,e)):H(ma,null,e)}function ka(e){return e==null||typeof e==`boolean`?H(ma):d(e)?H(L,null,e.slice()):Sa(e)?Aa(e):H(pa,null,String(e))}function Aa(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Oa(e)}function ja(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`){if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),ja(e,n()),n._c&&(n._d=!0));return}{n=32;let r=t._;!r&&!Ri(t)?t._ctx=Nn:r===3&&Nn&&(Nn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}}else if(h(t)){if(r&65){ja(e,{default:t});return}t={default:t,_ctx:Nn},n=32}else t=String(t),r&64?(n=16,t=[U(t)]):n=8;e.children=t,e.shapeFlag|=n}function Ma(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=E([t.class,r.class]));else if(e===`style`)t.style=T([t.style,r.style]);else if(a(e)){let n=t[e],i=r[e];i&&n!==i&&!(d(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!o(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function Na(e,t,n,r=null){mn(e,t,7,[n,r])}var Pa=yi(),Fa=0;function Ia(e,n,r){let i=e.type,a=(n?n.appContext:e.appContext)||Pa,o={uid:Fa++,vnode:e,type:i,parent:n,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Ae(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(a.provides),ids:n?n.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Wi(i,a),emitsOptions:Di(i,a),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=n?n.root:o,o.emit=Ti.bind(null,o),e.ce&&e.ce(o),o}var La=null,Ra=()=>La||Nn,za,Ba;{let e=me(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};za=t(`__VUE_INSTANCE_SETTERS__`,e=>La=e),Ba=t(`__VUE_SSR_SETTERS__`,e=>Wa=e)}var Va=e=>{let t=La;return za(e),e.scope.on(),()=>{e.scope.off(),za(t)}},Ha=()=>{La&&La.scope.off(),za(null)};function Ua(e){return e.vnode.shapeFlag&4}var Wa=!1;function Ga(e,t=!1,n=!1){t&&Ba(t);let{props:r,children:i}=e.vnode,a=Ua(e);zi(e,r,a,t),Qi(e,i,n||t);let o=a?Ka(e,t):void 0;return t&&Ba(!1),o}function Ka(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ti);let{setup:r}=n;if(r){Je();let n=e.setupContext=r.length>1?Xa(e):null,i=Va(e),a=pn(r,e,0,[e.props,n]),o=y(a);if(Ye(),i(),(o||e.sp)&&!Or(e)&&Cr(e),o){if(a.then(Ha,Ha),t)return a.then(n=>{Ba(!0);try{qa(e,n,t)}finally{Ba(!1)}}).catch(t=>{hn(t,e,0)});e.asyncDep=a}else qa(e,a,t)}else Ja(e,t)}function qa(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=tn(t)),Ja(e,n)}function Ja(e,t,n){let i=e.type;e.render||=i.render||r;{let t=Va(e);Je();try{ai(e)}finally{Ye(),t()}}}var Ya={get(e,t){return at(e,`get`,``),e[t]}};function Xa(e){return{attrs:new Proxy(e.attrs,Ya),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function Za(e){return e.exposed?e.exposeProxy||=new Proxy(tn(qt(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in $r)return $r[n](e)},has(e,t){return t in e||t in $r}}):e.proxy}function Qa(e,t=!0){return h(e)?e.displayName||e.name:e.name||t&&e.__name}function $a(e){return h(e)&&`__vccOpts`in e}var G=(e,t)=>on(e,t,Wa);function eo(e,t,n){try{ba(-1);let r=arguments.length;return r===2?v(t)&&!d(t)?Sa(t)?H(e,null,[t]):H(e,t):H(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&Sa(n)&&(n=[n]),H(e,t,n))}finally{ba(1)}}var to=`3.5.43`,no=void 0,ro=typeof window<`u`&&window.trustedTypes;if(ro)try{no=ro.createPolicy(`vue`,{createHTML:e=>e})}catch{}var io=no?e=>no.createHTML(e):e=>e,ao=`http://www.w3.org/2000/svg`,oo=`http://www.w3.org/1998/Math/MathML`,so=typeof document<`u`?document:null,co=so&&so.createElement(`template`),lo={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?so.createElementNS(ao,e):t===`mathml`?so.createElementNS(oo,e):n?so.createElement(e,{is:n}):so.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>so.createTextNode(e),createComment:e=>so.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>so.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),i!==a&&(i=i.nextSibling););else{co.innerHTML=io(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=co.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},uo=`transition`,fo=`animation`,po=Symbol(`_vtc`),mo={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ho=s({},fr,mo),go=(e=>(e.displayName=`Transition`,e.props=ho,e))((e,{slots:t})=>eo(gr,yo(e),t)),_o=(e,t=[])=>{d(e)?e.forEach(e=>e(...t)):e&&e(...t)},vo=e=>e?d(e)?e.some(e=>e.length>1):e.length>1:!1;function yo(e){let t={};for(let n in e)n in mo||(t[n]=e[n]);if(e.css===!1)return t;let{name:n=`v`,type:r,duration:i,enterFromClass:a=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:c=`${n}-enter-to`,appearFromClass:l=a,appearActiveClass:u=o,appearToClass:d=c,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:m=`${n}-leave-to`}=e,h=bo(i),g=h&&h[0],_=h&&h[1],{onBeforeEnter:v,onEnter:y,onEnterCancelled:b,onLeave:x,onLeaveCancelled:ee,onBeforeAppear:S=v,onAppear:te=y,onAppearCancelled:C=b}=t,ne=(e,t,n,r)=>{e._enterCancelled=r,Co(e,t?d:c),Co(e,t?u:o),n&&n()},re=(e,t)=>{e._isLeaving=!1,Co(e,f),Co(e,m),Co(e,p),t&&t()},w=e=>(t,n)=>{let i=e?te:y,o=()=>ne(t,e,n);_o(i,[t,o]),wo(()=>{Co(t,e?l:a),So(t,e?d:c),vo(i)||Eo(t,r,g,o)})};return s(t,{onBeforeEnter(e){_o(v,[e]),So(e,a),So(e,o)},onBeforeAppear(e){_o(S,[e]),So(e,l),So(e,u)},onEnter:w(!1),onAppear:w(!0),onLeave(e,t){e._isLeaving=!0;let n=()=>re(e,t);So(e,f),e._enterCancelled?(So(e,p),Ao(e)):(Ao(e),So(e,p)),wo(()=>{e._isLeaving&&(Co(e,f),So(e,m),vo(x)||Eo(e,r,_,n))}),_o(x,[e,n])},onEnterCancelled(e){ne(e,!1,void 0,!0),_o(b,[e])},onAppearCancelled(e){ne(e,!0,void 0,!0),_o(C,[e])},onLeaveCancelled(e){re(e),_o(ee,[e])}})}function bo(e){if(e==null)return null;if(v(e))return[xo(e.enter),xo(e.leave)];{let t=xo(e);return[t,t]}}function xo(e){return fe(e)}function So(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.add(t)),(e[po]||(e[po]=new Set)).add(t)}function Co(e,t){t.split(/\s+/).forEach(t=>t&&e.classList.remove(t));let n=e[po];n&&(n.delete(t),n.size||(e[po]=void 0))}function wo(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}var To=0;function Eo(e,t,n,r){let i=e._endId=++To,a=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(a,n);let{type:o,timeout:s,propCount:c}=Do(e,t);if(!o)return r();let l=o+`end`,u=0,d=()=>{e.removeEventListener(l,f),a()},f=t=>{t.target===e&&++u>=c&&d()};setTimeout(()=>{u<c&&d()},s+1),e.addEventListener(l,f)}function Do(e,t){let n=window.getComputedStyle(e),r=e=>(n[e]||``).split(`, `),i=r(`${uo}Delay`),a=r(`${uo}Duration`),o=Oo(i,a),s=r(`${fo}Delay`),c=r(`${fo}Duration`),l=Oo(s,c),u=null,d=0,f=0;t===uo?o>0&&(u=uo,d=o,f=a.length):t===fo?l>0&&(u=fo,d=l,f=c.length):(d=Math.max(o,l),u=d>0?o>l?uo:fo:null,f=u?u===uo?a.length:c.length:0);let p=u===uo&&/\b(?:transform|all)(?:,|$)/.test(r(`${uo}Property`).toString());return{type:u,timeout:d,propCount:f,hasTransform:p}}function Oo(e,t){for(;e.length<t.length;)e=e.concat(e);return Math.max(...t.map((t,n)=>ko(t)+ko(e[n])))}function ko(e){return e===`auto`?0:Number(e.slice(0,-1).replace(`,`,`.`))*1e3}function Ao(e){return(e?e.ownerDocument:document).body.offsetHeight}function jo(e,t,n){let r=e[po];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var Mo=Symbol(`_vod`),No=Symbol(`_vsh`),Po=Symbol(``),Fo=/(?:^|;)\s*display\s*:/;function Io(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t){if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ro(r,t,``)}else for(let e in t)n[e]??Ro(r,e,``)}for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Ro(r,i,``):Ho(e,i,!g(t)&&t?t[i]:void 0,o)||Ro(r,i,o)}}else if(i){if(t!==n){let e=r[Po];e&&(n+=`;`+e),r.cssText=n,a=Fo.test(n)}}else t&&e.removeAttribute(`style`);Mo in e&&(e[Mo]=a?r.display:``,e[No]&&(r.display=`none`))}var Lo=/\s*!important$/;function Ro(e,t,n){if(d(n))n.forEach(n=>Ro(e,t,n));else if(n??=``,t.startsWith(`--`))Lo.test(n)?e.setProperty(t,n.replace(Lo,``),`important`):e.setProperty(t,n);else{let r=Vo(e,t);Lo.test(n)?e.setProperty(ae(r),n.replace(Lo,``),`important`):e[r]=n}}var zo=[`Webkit`,`Moz`,`ms`],Bo={};function Vo(e,t){let n=Bo[t];if(n)return n;let r=w(t);if(r!==`filter`&&r in e)return Bo[t]=r;r=oe(r);for(let n=0;n<zo.length;n++){let i=zo[n]+r;if(i in e)return Bo[t]=i}return t}function Ho(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&g(r)&&n===r}var Uo=`http://www.w3.org/1999/xlink`;function Wo(e,t,n,r,i,a=be(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Uo,t.slice(6,t.length)):e.setAttributeNS(Uo,t,n):n==null||a&&!xe(n)?e.removeAttribute(t):e.setAttribute(t,a?``:_(n)?String(n):n)}function Go(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?io(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=xe(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Ko(e,t,n,r){e.addEventListener(t,n,r)}function qo(e,t,n,r){e.removeEventListener(t,n,r)}var Jo=Symbol(`_vei`);function Yo(e,t,n,r,i=null){let a=e[Jo]||(e[Jo]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Qo(t);r?Ko(e,n,a[t]=ns(r,i),s):o&&(qo(e,n,o,s),a[t]=void 0)}}var Xo=/(Once|Passive|Capture)$/,Zo=/^on:?(?:Once|Passive|Capture)$/;function Qo(e){let t,n;for(;(n=e.match(Xo))&&!Zo.test(e);)t||={},e=e.slice(0,e.length-n[1].length),t[n[1].toLowerCase()]=!0;return[e[2]===`:`?e.slice(3):ae(e.slice(2)),t]}var $o=0,es=Promise.resolve(),ts=()=>$o||=(es.then(()=>$o=0),Date.now());function ns(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&mn(e,t,5,a)}}else mn(r,t,5,[e])};return n.value=e,n.attached=ts(),n}var rs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,is=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?jo(e,r,c):t===`style`?Io(e,n,r):a(t)?o(t)||Yo(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),1):t[0]===`^`?(t=t.slice(1),0):as(e,t,r,c))?(Go(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&Wo(e,t,r,c,s,t!==`value`)):e._isVueCE&&(os(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Go(e,w(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),Wo(e,t,r,c))};function as(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&rs(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return rs(t)&&g(n)?!1:t in e}function os(e,t){let n=e._def.props;if(!n)return!1;let r=w(t);return Array.isArray(n)?n.some(e=>w(e)===r):Object.keys(n).some(e=>w(e)===r)}var ss=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>le(t,e):t};function cs(e){e.target.composing=!0}function ls(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var us=Symbol(`_assign`),ds=Symbol(`_initialValue`);function fs(e,t,n){return t&&(e=e.trim()),n&&(e=de(e)),e}var ps={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e.parentNode&&(e.type===`text`?e[ds]=e.defaultValue.replace(/[\r\n]/g,``):e.type===`textarea`&&(e[ds]=e.defaultValue.replace(/\r\n?/g,`
|
|
2
|
-
`))),e[us]=ss(i);let a=r||i.props&&i.props.type===`number`;Ko(e,t?`change`:`input`,t=>{t.target.composing||e[us](fs(e.value,n,a))}),(n||a)&&Ko(e,`change`,()=>{e.value=fs(e.value,n,a)}),t||(Ko(e,`compositionstart`,cs),Ko(e,`compositionend`,ls),Ko(e,`change`,ls))},mounted(e,{value:t,modifiers:{trim:n,number:r}}){let i=t??``,a=e[ds];delete e[ds],a!==void 0&&(e.type===`text`||e.type===`textarea`)&&e.value!==a?e[us](fs(e.value,n,r)):e.value=i},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[us]=ss(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?de(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},ms={deep:!0,created(e,t,n){e[us]=ss(n),Ko(e,`change`,()=>{let t=e._modelValue,n=ys(e),r=e.checked,i=e[us];if(d(t)){let e=Te(t,n),a=e!==-1;if(r&&!a)i(t.concat(n));else if(!r&&a){let n=[...t];n.splice(e,1),i(n)}}else if(p(t)){let e=new Set(t);r?e.add(n):e.delete(n),i(e)}else i(bs(e,r))})},mounted:hs,beforeUpdate(e,t,n){e[us]=ss(n),hs(e,t,n)}};function hs(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(d(t))i=Te(t,r.props.value)>-1;else if(p(t))i=t.has(r.props.value);else{if(t===n)return;i=we(t,bs(e,!0))}e.checked!==i&&(e.checked=i)}var gs={deep:!0,created(e,{value:t,modifiers:{number:n}},r){e._modelValue=t,Ko(e,`change`,()=>{let t=Array.prototype.filter.call(e.options,e=>e.selected).map(e=>n?de(ys(e)):ys(e)),r=e.multiple,i=r?p(e._modelValue)?new Set(t):t:t[0],a=e._pendingValue=[r,r?d(i)?t.slice():t:i];try{e[us](i)}finally{wn(()=>{e._pendingValue===a&&(e._pendingValue=void 0)})}}),e[us]=ss(r)},mounted(e,{value:t}){vs(e,t)},beforeUpdate(e,{value:t},n){e._modelValue=t,e[us]=ss(n)},updated(e,{value:t}){let n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!_s(t,n[1],n[0]))&&vs(e,t)}};function _s(e,t,n){if(!n||d(e))return we(e,t);if(p(e)){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}return!1}function vs(e,t){let n=e.multiple,r=d(t);if(!n||r||p(t)){for(let i=0,a=e.options.length;i<a;i++){let a=e.options[i],o=ys(a);if(n){if(r){let e=typeof o;a.selected=e===`string`||e===`number`?t.some(e=>String(e)===String(o)):Te(t,o)>-1}else a.selected=t.has(o)}else if(we(ys(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function ys(e){return`_value`in e?e._value:e.value}function bs(e,t){let n=t?`_trueValue`:`_falseValue`;return n in e?e[n]:t}var xs=[`ctrl`,`shift`,`alt`,`meta`],Ss={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>xs.some(n=>e[`${n}Key`]&&!t.includes(n))},Cs=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=Ss[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},ws={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},Ts=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=ae(n.key);if(t.some(e=>e===r||ws[e]===r))return e(n)}))},Es=s({patchProp:is},lo),Ds;function Os(){return Ds||=ta(Es)}var ks=((...e)=>{let t=Os().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=js(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,As(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function As(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function js(e){return g(e)?document.querySelector(e):e}var Ms=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Ns={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`},Ps=({size:e,strokeWidth:t=2,absoluteStrokeWidth:n,color:r,iconNode:i,name:a,class:o,...s},{slots:c})=>eo(`svg`,{...Ns,width:e||Ns.width,height:e||Ns.height,stroke:r||Ns.stroke,"stroke-width":n?Number(t)*24/Number(e):t,class:[`lucide`,`lucide-${Ms(a??`icon`)}`],...s},[...i.map(e=>eo(...e)),...c.default?[c.default()]:[]]),K=(e,t)=>(n,{slots:r})=>eo(Ps,{...n,iconNode:t,name:e},r),Fs=K(`ActivityIcon`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),Is=K(`ArchiveIcon`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),Ls=K(`ArrowUpRightIcon`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),Rs=K(`ArrowUpIcon`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),zs=K(`BotIcon`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),Bs=K(`BracesIcon`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),Vs=K(`CableIcon`,[[`path`,{d:`M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1`,key:`10bnsj`}],[`path`,{d:`M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9`,key:`1eqmu1`}],[`path`,{d:`M21 21v-2h-4`,key:`14zm7j`}],[`path`,{d:`M3 5h4V3`,key:`z442eg`}],[`path`,{d:`M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3`,key:`ebdjd7`}]]),Hs=K(`CheckIcon`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),Us=K(`ChevronDownIcon`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Ws=K(`ChevronRightIcon`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),Gs=K(`CircleCheckIcon`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ks=K(`CircleHelpIcon`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),qs=K(`Clock3Icon`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`polyline`,{points:`12 6 12 12 16.5 12`,key:`1aq6pp`}]]),Js=K(`CopyIcon`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),Ys=K(`CornerDownRightIcon`,[[`polyline`,{points:`15 10 20 15 15 20`,key:`1q7qjw`}],[`path`,{d:`M4 4v7a4 4 0 0 0 4 4h12`,key:`z08zvw`}]]),Xs=K(`CornerLeftUpIcon`,[[`polyline`,{points:`14 9 9 4 4 9`,key:`m9oyvo`}],[`path`,{d:`M20 20h-7a4 4 0 0 1-4-4V4`,key:`1blwi3`}]]),Zs=K(`DatabaseIcon`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),Qs=K(`FlagIcon`,[[`path`,{d:`M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z`,key:`i9b6wo`}],[`line`,{x1:`4`,x2:`4`,y1:`22`,y2:`15`,key:`1cm3nv`}]]),$s=K(`FolderOpenIcon`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),ec=K(`FolderIcon`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),tc=K(`GitForkIcon`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),nc=K(`HandIcon`,[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]),rc=K(`HouseIcon`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`1d0kgt`}]]),ic=K(`InfoIcon`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]),ac=K(`KeyRoundIcon`,[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]),oc=K(`LaptopIcon`,[[`path`,{d:`M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0 1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16`,key:`tarvll`}]]),sc=K(`LayersIcon`,[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]]),cc=K(`Link2Icon`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),lc=K(`ListChecksIcon`,[[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`path`,{d:`m3 7 2 2 4-4`,key:`1obspn`}],[`path`,{d:`M13 6h8`,key:`15sg57`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 18h8`,key:`oe0vm4`}]]),uc=K(`LoaderCircleIcon`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),dc=K(`LoaderIcon`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]),fc=K(`MessageSquareIcon`,[[`path`,{d:`M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z`,key:`1lielz`}]]),pc=K(`MinusIcon`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}]]),mc=K(`NetworkIcon`,[[`rect`,{x:`16`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`4q2zg0`}],[`rect`,{x:`2`,y:`16`,width:`6`,height:`6`,rx:`1`,key:`8cvhb9`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`6`,rx:`1`,key:`1egb70`}],[`path`,{d:`M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3`,key:`1jsf9p`}],[`path`,{d:`M12 12V8`,key:`2874zd`}]]),hc=K(`OctagonIcon`,[[`path`,{d:`M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z`,key:`2d38gg`}]]),gc=K(`PanelLeftCloseIcon`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m16 15-3-3 3-3`,key:`14y99z`}]]),_c=K(`PanelLeftOpenIcon`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]]),vc=K(`PanelLeftIcon`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),yc=K(`PanelRightIcon`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]),bc=K(`PencilIcon`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),xc=K(`PlayIcon`,[[`polygon`,{points:`6 3 20 12 6 21 6 3`,key:`1oa8hb`}]]),Sc=K(`PlusIcon`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),Cc=K(`PuzzleIcon`,[[`path`,{d:`M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z`,key:`w46dr5`}]]),wc=K(`RefreshCwIcon`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Tc=K(`RepeatIcon`,[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]),Ec=K(`ServerIcon`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]),Dc=K(`ShieldAlertIcon`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]]),Oc=K(`ShieldCheckIcon`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),kc=K(`ShieldOffIcon`,[[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71`,key:`1jlk70`}],[`path`,{d:`M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264`,key:`18rp1v`}]]),Ac=K(`TerminalIcon`,[[`polyline`,{points:`4 17 10 11 4 5`,key:`akl6gq`}],[`line`,{x1:`12`,x2:`20`,y1:`19`,y2:`19`,key:`q2wloq`}]]),jc=K(`Trash2Icon`,[[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6`,key:`4alrt4`}],[`path`,{d:`M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2`,key:`v07s0e`}],[`line`,{x1:`10`,x2:`10`,y1:`11`,y2:`17`,key:`1uufr5`}],[`line`,{x1:`14`,x2:`14`,y1:`11`,y2:`17`,key:`xtxkd`}]]),Mc=K(`WaypointsIcon`,[[`circle`,{cx:`12`,cy:`4.5`,r:`2.5`,key:`r5ysbb`}],[`path`,{d:`m10.2 6.3-3.9 3.9`,key:`1nzqf6`}],[`circle`,{cx:`4.5`,cy:`12`,r:`2.5`,key:`jydg6v`}],[`path`,{d:`M7 12h10`,key:`b7w52i`}],[`circle`,{cx:`19.5`,cy:`12`,r:`2.5`,key:`1piiel`}],[`path`,{d:`m13.8 17.7 3.9-3.9`,key:`1wyg1y`}],[`circle`,{cx:`12`,cy:`19.5`,r:`2.5`,key:`13o1pw`}]]),Nc=K(`WifiOffIcon`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Pc=K(`WifiIcon`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M2 8.82a15 15 0 0 1 20 0`,key:`dnpr2z`}],[`path`,{d:`M5 12.859a10 10 0 0 1 14 0`,key:`1x1e6c`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}]]),Fc=K(`WorkflowIcon`,[[`rect`,{width:`8`,height:`8`,x:`3`,y:`3`,rx:`2`,key:`by2w9f`}],[`path`,{d:`M7 11v4a2 2 0 0 0 2 2h4`,key:`xkn7yn`}],[`rect`,{width:`8`,height:`8`,x:`13`,y:`13`,rx:`2`,key:`1cgmvn`}]]),Ic=K(`WrenchIcon`,[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z`,key:`cbrjhi`}]]),Lc=K(`XIcon`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Rc=e=>e.role===`assistant`,zc=e=>e.role===`toolResult`;function Bc(e){let t=e.content;return typeof t==`string`?t:Array.isArray(t)?t.map(e=>e.type===`text`?e.text??``:``).join(``):``}function Vc(e){if(e.errorMessage)return e.errorMessage;if(e.stopReason===`aborted`)return`Interrupted. Partial response preserved.`;if(e.stopReason===`error`)return`Provider request failed.`}function Hc(e){let t=e.data;return typeof t?.text==`string`?t.text:e.kind===`pi.reset`?`New context started. Earlier entries remain stored.`:e.kind===`pi.compaction`?`Context compacted. Earlier entries remain stored.`:e.kind}function Uc(e,t,n=new Map){let r=new Map,i=new Set;for(let t of e)for(let e of t.model??[])if(t.kind===`pi.tool-result`&&zc(e)&&r.set(e.toolCallId,{entryId:t.id,message:e}),t.kind===`pi.assistant`&&Rc(e))for(let t of e.content)t.type===`toolCall`&&i.add(t.id);if(t)for(let e of t.content)e.type===`toolCall`&&i.add(e.id);let a=(e,t,i)=>{let a=r.get(e),o=n.get(e),s=o?.nested;return a?{callId:e,name:t,args:i,status:a.message.isError?`error`:`done`,result:Bc(a.message),resultEntryId:a.entryId,...s?{nested:s}:{}}:o?.result?{callId:e,name:t,args:i,status:o.result.isError?`error`:`done`,result:o.result.text,...s?{nested:s}:{},...o.summary?{summary:Wc(o.summary)}:{}}:{callId:e,name:t,args:i,status:o?.status??`pending`,output:o?.output||void 0,...s?{nested:s}:{},...o?.summary?{summary:Wc(o.summary)}:{}}},o=e=>e.content.flatMap(e=>e.type===`text`?e.text?[{type:`text`,text:e.text}]:[]:e.type===`thinking`?e.thinking?[{type:`thinking`,text:e.thinking}]:[]:[{type:`tool`,call:a(e.id,e.name,e.arguments)}]),s=[];for(let t of e)if(t.kind!==`pi.system`){if(t.kind===`pi.user`)s.push({kind:`user`,id:t.id,text:(t.model??[]).map(Bc).join(`
|
|
3
|
-
`)});else if(t.kind===`pi.assistant`){let e=(t.model??[]).filter(Rc);s.push({kind:`assistant`,id:t.id,streaming:!1,blocks:e.flatMap(o),error:e.map(Vc).find(Boolean),model:e[0]?.model})}else if(t.kind===`pi.tool-result`)for(let e of(t.model??[]).filter(zc))i.has(e.toolCallId)||s.push({kind:`tool-result`,id:t.id,name:e.toolName,text:Bc(e),isError:e.isError});else s.push({kind:`event`,id:t.id,entryKind:t.kind,text:Hc(t),note:t.model?.length?(t.model??[]).map(Bc).join(`
|
|
4
|
-
`):void 0,...t.data===void 0?{}:{data:t.data}})}t&&s.push({kind:`assistant`,id:`live`,streaming:!0,blocks:o(t),model:t.model});for(let[e,t]of n)(t.status!==`done`||t.result||t.nested)&&!i.has(e)&&s.push({kind:`tool`,id:e,call:a(e,t.name,t.args)});return s}function Wc(e){let t=[];return e.durationMs!==void 0&&t.push(`${(e.durationMs/1e3).toFixed(1)}s`),e.error&&t.push(e.error),t.join(` · `)}function Gc(e){let t={tokens:0,cost:0,input:0,output:0,cacheRead:0,cacheWrite:0,inputCost:0,outputCost:0,cacheReadCost:0,cacheWriteCost:0};for(let n of Object.values(e?.models??{}))t.tokens+=n.totalTokens??n.input+n.output+n.cacheRead+n.cacheWrite,t.cost+=n.cost?.total??0,t.input+=n.input??0,t.output+=n.output??0,t.cacheRead+=n.cacheRead??0,t.cacheWrite+=n.cacheWrite??0,t.inputCost+=n.cost?.input??0,t.outputCost+=n.cost?.output??0,t.cacheReadCost+=n.cost?.cacheRead??0,t.cacheWriteCost+=n.cost?.cacheWrite??0;return t}var Kc=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>void this.listeners.delete(e)}emit(){for(let e of this.listeners)e()}},qc=()=>({items:[],entries:[],running:!1,generating:!1,inbox:[],agent:{},usage:{models:{},tools:{}},compactions:[],notices:[],docs:{},ready:!1});function Jc(e,t,n){let r=e;for(let e=0;e<t.length-1;e++){let n=t[e];(typeof r[n]!=`object`||r[n]===null)&&(r[n]=typeof t[e+1]==`number`?[]:{}),r=r[n]}let i=t[t.length-1];r[i]=String(r[i]??``)+n}function Yc(e,t){if(t.type===`message`)return structuredClone(t.message);let n=[...e.content],r=t.contentIndex;if(t.type===`block`||t.type.endsWith(`_start`))n[r]=structuredClone(t.block);else if(t.type===`text_delta`){let e=n[r];n[r]={type:`text`,text:(e?.type===`text`?e.text:``)+t.delta}}else if(t.type===`thinking_delta`){let e=n[r];n[r]={type:`thinking`,thinking:(e?.type===`thinking`?e.thinking:``)+t.delta}}else if(t.type===`toolcall_delta`){let e=structuredClone(n[r]??{type:`toolCall`,id:``,name:``,arguments:{}});Jc(e,t.path,t.delta),n[r]=e}return{...e,content:n}}var Xc=class extends Kc{state=qc();entries=new Map;live;tools=new Map;apply(e){switch(e.type){case`snapshot`:this.reset(e.snapshot),this.state.inbox=e.inbox;break;case`batch`:for(let t of e.events)this.event(t);break;case`inbox`:this.state.inbox=e.items;break;case`doc`:this.state.docs={...this.state.docs,[e.kind]:e.value};break;default:return!1}return this.rebuild(),this.emit(),!0}touch(){this.emit()}clear(){this.entries.clear(),this.tools.clear(),this.live=void 0,this.state=qc(),this.emit()}rebuild(){let e=[...this.entries.values()].sort((e,t)=>e.id-t.id);this.state.entries=e,this.state.generating=!!this.live,this.state.items=Uc(e,this.live,this.tools)}reset(e){this.entries=new Map(e.entries.map(e=>[e.id,e])),this.live=e.generation?.message?structuredClone(e.generation.message):void 0,this.tools=new Map(e.tools.map(e=>[e.callId,{name:e.name,status:e.status,output:e.output??``}]));for(let t of e.nestedTools){let e=this.tools.get(t.callId);this.tools.set(t.callId,{name:t.name,status:t.status,output:t.output??``,args:t.arguments,nested:{parentCallId:t.parentCallId,parentTaskId:t.parentTaskId,taskId:t.taskId},...t.summary?{summary:t.summary}:{},...e??{}})}this.state.running=!!e.run,this.state.agent=e.agent,this.state.usage=e.usage,this.state.retry=e.generation?.retry,this.state.compactions=e.compactions.map(e=>e.taskId),this.state.compactionFailure=e.compactionFailure,this.state.ready=!0}commit(e){if(this.entries.set(e.id,e),e.kind===`pi.reset`||e.kind===`pi.compaction`){let t=e.head??e.id;for(let e of this.entries.keys())e<t&&this.entries.delete(e)}}event(e){switch(e.type){case`snapshot`:return this.reset(e);case`run_start`:this.state.running=!0;return;case`run_end`:this.state.running=!1,this.live=void 0;return;case`message_start`:e.message.role===`assistant`&&(this.live=structuredClone(e.message));return;case`message_update`:this.live||={role:`assistant`,content:[],provider:``,model:``,usage:e.usage,stopReason:`pending`};for(let t of e.changes)this.live=Yc(this.live,t);this.live={...this.live,usage:e.usage};return;case`message_end`:return this.live=void 0,this.commit(e.entry);case`entry_appended`:return this.commit(e.entry);case`tool_execution_start`:this.tools.set(e.toolCallId,{name:e.toolName,status:`running`,output:``,args:e.args,...e.parentToolCallId!==void 0&&e.parentTaskId!==void 0&&e.taskId!==void 0?{nested:{parentCallId:e.parentToolCallId,parentTaskId:e.parentTaskId,taskId:e.taskId}}:{}});return;case`tool_execution_update`:{let t=this.tools.get(e.toolCallId)??{name:e.toolName,status:`running`,output:``},n=e.output;n&&`set`in n?t.output=n.set:n&&(t.output=t.output.slice(n.trimStart??0)+(n.append??``)),t.status=`running`,this.tools.set(e.toolCallId,t);return}case`tool_execution_end`:if(e.entry){this.tools.delete(e.toolCallId),this.entries.set(e.entry.id,e.entry);return}if(e.result){let t=this.tools.get(e.toolCallId)??{name:e.toolName,status:`done`,output:``};t.status=`done`,t.result={text:al(e.result),isError:e.result.isError},t.summary={isError:e.result.isError,durationMs:e.result.durationMs},this.tools.set(e.toolCallId,t);return}this.tools.delete(e.toolCallId);return;case`agent_changed`:this.state.agent=e.agent;return;case`usage_changed`:this.state.usage=e.usage;return;case`auto_retry_start`:this.state.retry={at:e.at,error:e.errorMessage};return;case`auto_retry_end`:this.state.retry=void 0;return;case`compaction_start`:this.state.compactions.includes(e.taskId)||this.state.compactions.push(e.taskId);return;case`compaction_end`:this.state.compactions=this.state.compactions.filter(t=>t!==e.taskId),this.state.compactionFailure=e.error?{taskId:e.taskId,reason:e.reason,error:e.error}:void 0;return;case`task_failed`:this.state.notices=[...this.state.notices.slice(-9),`${e.kind} failed: ${e.message}`];return;default:return}}},Zc=class extends Kc{state={agents:[],tasks:[],usage:{models:{},tools:{}},ready:!1};apply(e){if(e.type===`session`)this.state={agents:e.agents,tasks:e.tasks,usage:e.usage,ready:!0};else if(e.type===`agents`)this.state={...this.state,agents:e.agents};else if(e.type===`tasks`)this.state={...this.state,tasks:e.tasks};else if(e.type===`usage`)this.state={...this.state,usage:e.usage};else return!1;return this.emit(),!0}clear(){this.state={agents:[],tasks:[],usage:{models:{},tools:{}},ready:!1},this.emit()}agent(e){return this.state.agents.find(t=>t.id===e)}lineage(e){return Qc(this.state.agents,e)}foregroundBusy(e){return this.state.tasks.some(t=>!t.background&&t.conversationId===e)}backgroundTasks(e){return this.state.tasks.filter(t=>t.background&&(e===void 0||t.conversationId===e))}};function Qc(e,t){let n=new Map(e.map(e=>[e.id,e])),r=[],i=new Set,a=t;for(;a!==void 0&&!i.has(a);){i.add(a);let e=n.get(a);if(!e)break;r.unshift(e),a=e.parentId}return r}var $c=e=>e,el=(e,t)=>`${e}/s/${t}`,tl=(e,t,n)=>`${e}/s/${t}/a/${n}`;function nl(e,t,n){let r=new Map;for(let i of t.agents)r.set(i.id,{type:`agent`,key:tl(e,t.id,i.id),deviceId:e,sessionId:t.id,agent:i,stale:n,children:[]});let i=[];for(let e of r.values()){let t=r.get(e.agent.parentId??e.agent.ownerAgentId??-1);t&&t!==e?t.children.push(e):i.push(e)}return i}function rl(e){return e.map(e=>{let t=e.status!==`online`;return{type:`device`,key:$c(e.id),device:e,status:e.status,stale:t,children:(e.tree?.sessions??[]).map(n=>({type:`session`,key:el(e.id,n.id),deviceId:e.id,session:n,stale:t,children:nl(e.id,n,t)}))}})}var il=class extends Kc{devices=[];apply(e){return e.type===`network`&&(this.devices=e.devices,this.emit(),!0)}device(e){return this.devices.find(t=>t.id===e)}tree(){return rl(this.devices)}};function al(e){let t=e.structuredOutput;if(t==null)return``;let n=typeof t==`string`?t:JSON.stringify(t);return n.length>4e3?`${n.slice(0,4e3)}…`:n}var ol=3e4;function sl(e,t){return t&&/^\d+$/.test(t.trim())?Math.min(ol,Math.max(1e3,Number(t)*1e3)):Math.min(ol,1e3*2**Math.min(e,10))}function cl(e){return Math.min(ol,2e3*2**Math.min(e,10))}var ll=class{state=`connecting`;source;streamId=``;slots=new Map;fresh=new Set;applied=[];routes=new Map;networkFns=new Set;stateFns=new Set;timer;reconnectTimer;reconnects=0;failures=0;flushing=Promise.resolve();start(){clearTimeout(this.reconnectTimer),this.source?.close(),this.streamId=``,this.source=new EventSource(`/api/stream`),this.source.onmessage=e=>this.receive(JSON.parse(e.data)),this.source.onerror=()=>{this.streamId=``,this.setState(this.source?.readyState===EventSource.CLOSED?`offline`:`connecting`),this.source?.readyState===EventSource.CLOSED&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=setTimeout(()=>this.start(),cl(this.reconnects++)))}}stop(){clearTimeout(this.timer),clearTimeout(this.reconnectTimer),this.source?.close(),this.streamId=``}set(e,t){this.slots.get(e)!==t&&(t?(this.slots.set(e,t),this.fresh.add(t)):this.slots.delete(e),this.schedule())}reopen(e){let t=this.slots.get(e);t&&(this.fresh.add(t),this.schedule(0))}route(e,t){let n=this.routes.get(e)??new Set;return n.add(t),this.routes.set(e,n),()=>void n.delete(t)}onNetwork(e){return this.networkFns.add(e),()=>void this.networkFns.delete(e)}onState(e){return this.stateFns.add(e),()=>void this.stateFns.delete(e)}setState(e){if(e!==this.state){this.state=e;for(let t of this.stateFns)t(e)}}receive(e){let t=e.frame;if(t.type===`stream`){if(e.sub!==`hello`)return;this.streamId=t.streamId,this.applied=[],this.reconnects=0,this.failures=0,this.setState(`live`),this.schedule(0);return}if(t.type===`network`){if(e.sub!==`network`)return;for(let e of this.networkFns)e(t.devices);return}if(e.sub!==`hello`&&e.sub!==`network`){for(let[n,r]of this.slots)if(r===e.sub)for(let e of this.routes.get(n)??[])e(t)}}schedule(e=30){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.flushing=this.flushing.then(()=>this.flush())},e)}async flush(){let e=this.streamId;if(!e)return;let t=[...new Set(this.slots.values())],n=t.filter(e=>this.fresh.has(e)&&this.applied.includes(e));if(this.fresh.clear(),n.length&&!await this.put(e,t.filter(e=>!n.includes(e)))){for(let e of n)this.fresh.add(e);return}(t.join(`
|
|
5
|
-
`)!==this.applied.join(`
|
|
6
|
-
`)||n.length)&&await this.put(e,t)}async put(e,t){let n=null;try{let r=await fetch(`/api/stream/${e}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({subs:t})});if(e!==this.streamId)return!1;if(r.ok)return this.applied=t,this.failures=0,!0;if(r.status===404)return this.start(),!1;console.warn(`subscription rejected`,r.status,await r.text()),n=r.headers.get(`retry-after`)}catch{if(e!==this.streamId)return!1}return this.schedule(sl(this.failures++,n)),!1}},ul=`lab.png`;function dl(e){return`/icons/${typeof e==`string`&&/^[\w.-]+\.(png|svg)$/.test(e)&&!e.includes(`..`)?e:ul}`}var fl=class extends Error{code;status;constructor(e,t,n=0,r){super(t,r),this.code=e,this.status=n,this.name=`DpiError`}},pl=16777216,ml={initS:1,capS:15},hl={codeCreate:{perMinute:5,capacity:5},start:{perMinute:20,capacity:20},verifyFails:{perWindow:100,windowMinutes:15},verifyTotal:{perMinute:300,capacity:300}},gl={perMinute:60,capacity:120};ml.initS,hl.verifyFails.perWindow,hl.verifyFails.windowMinutes,gl.perMinute,gl.capacity;function _l(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);r<128?t+=1:r<2048?t+=2:r>=55296&&r<=56319&&n+1<e.length&&(e.charCodeAt(n+1)&64512)==56320?(t+=4,n++):t+=3}return t}async function*vl(e,t=45e3,n=pl){let r=e.getReader(),i=new TextDecoder,a=()=>new fl(`invalid`,`SSE event exceeds ${n} bytes`),o=[],s=0,c=``;try{for(;;){let e,l=new Promise((n,r)=>{e=setTimeout(()=>r(new fl(`offline`,`No data for ${t/1e3}s`)),t)}),u;try{u=await Promise.race([r.read(),l])}finally{clearTimeout(e)}if(u.done)return;let d=i.decode(u.value,{stream:!0}).replaceAll(`\r
|
|
7
|
-
`,`
|
|
8
|
-
`);if(!d)continue;if(c===`\r`&&d.startsWith(`
|
|
9
|
-
`)){let e=o.pop();if(e!==void 0){let t=e.slice(0,-1);t&&o.push(t),--s,c=o.length>0?o[o.length-1].slice(-1):``}}if(s+=_l(d),!(c+d).includes(`
|
|
10
|
-
|
|
11
|
-
`)){if(s>n)throw a();o.push(d),c=d.slice(-1);continue}let f=o.join(``)+d,p;for(;(p=f.indexOf(`
|
|
12
|
-
|
|
13
|
-
`))>=0;){let e=f.slice(0,p),t=_l(e);if(t>n)throw a();f=f.slice(p+2),s-=t+2;let r=yl(e);r&&(yield r)}if(s>n)throw a();o=f?[f]:[],c=f.slice(-1)}}finally{r.cancel().catch(()=>{})}}function yl(e){let t=`message`,n,r=[];for(let i of e.split(`
|
|
14
|
-
`)){if(!i||i.startsWith(`:`))continue;let e=i.indexOf(`:`),a=e<0?i:i.slice(0,e),o=e<0?``:i.slice(e+1).replace(/^ /,``);a===`event`?t=o:a===`data`?r.push(o):a===`id`&&(n=o)}return r.length?{event:t,data:r.join(`
|
|
15
|
-
`),id:n}:void 0}var bl=encodeURIComponent,xl=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2)}`,Sl=class{token;baseUrl;constructor(e,t){this.token=t,this.baseUrl=e.replace(/\/+$/,``)}headers(e,t={}){return{...this.token?{authorization:`Bearer ${this.token}`,"x-dpi-token":this.token}:{},...e?{"content-type":`application/json`}:{},...t}}async request(e,t,n,r={}){let i=AbortSignal.timeout(r.timeoutMs??2e4),a=r.signal?AbortSignal.any([r.signal,i]):i,o;try{o=await fetch(this.baseUrl+t,{method:e,signal:a,headers:this.headers(n!==void 0,r.idempotencyKey?{"idempotency-key":r.idempotencyKey}:{}),body:n===void 0?void 0:JSON.stringify(n)})}catch(e){throw r.signal?.aborted?e:new fl(`offline`,`Cannot reach ${this.baseUrl}`,0,{cause:e})}let s=await o.text(),c;try{c=s?JSON.parse(s):void 0}catch{c=void 0}if(!o.ok){let e=c?.error;throw new fl(e?.code??(o.status===401?`unauthorized`:o.status===404?`not_found`:`internal`),e?.message??`${o.status} ${o.statusText}`,o.status)}return c}async*stream(e,t,n){let r;try{r=await fetch(this.baseUrl+e,{headers:{...this.headers(!1),accept:`text/event-stream`},signal:t})}catch(e){if(t.aborted)return;throw new fl(`offline`,`Cannot reach ${this.baseUrl}`,0,{cause:e})}if(!r.ok||!r.body){let e=await r.json().catch(()=>void 0);throw new fl(e?.error?.code??(r.status===401?`unauthorized`:`unavailable`),e?.error?.message??`Stream failed (${r.status})`,r.status)}try{for await(let e of vl(r.body,n))yield JSON.parse(e.data)}catch(e){if(t.aborted)return;throw e}}device(e){return this.request(`GET`,`/v1/device`,void 0,e)}tree(){return this.request(`GET`,`/v1/tree`)}dirs(e=``){return this.request(`GET`,`/v1/fs/dirs?path=${bl(e)}`)}deviceDoc(e){return this.request(`GET`,`/v1/docs/${bl(e)}`)}deviceEvents(e,t=[]){return this.stream(`/v1/events${t.length?`?docs=${t.map(bl).join(`,`)}`:``}`,e)}sessions(){return this.request(`GET`,`/v1/sessions`)}createSession(e,t=xl()){return this.request(`POST`,`/v1/sessions`,e,{idempotencyKey:t})}session(e){return new Cl(this,e)}agent(e,t){return new wl(this,e,String(t))}},Cl=class{client;ref;constructor(e,t){this.client=e,this.ref=t}get base(){return`/v1/sessions/${bl(this.ref)}`}get(){return this.client.request(`GET`,this.base)}rename(e){return this.client.request(`PATCH`,this.base,{name:e})}archive(){return this.client.request(`DELETE`,this.base)}agents(){return this.client.request(`GET`,`${this.base}/agents`)}createAgent(e={},t=xl()){return this.client.request(`POST`,`${this.base}/agents`,e,{idempotencyKey:t})}tasks(e=`terminal`,t=20){return this.client.request(`GET`,`${this.base}/tasks?status=${e}&limit=${t}`)}abortTask(e){return this.client.request(`POST`,`${this.base}/tasks/${e}/abort`,{})}inspect(){return this.client.request(`GET`,`${this.base}/inspect`)}compaction(){return this.client.request(`GET`,`${this.base}/compaction`)}setCompaction(e){return this.client.request(`PATCH`,`${this.base}/compaction`,e)}submission(e,t=0){return this.client.request(`GET`,`${this.base}/submissions/${e}?waitMs=${t}`,void 0,{timeoutMs:t+2e4})}events(e){return this.client.stream(`${this.base}/events`,e)}},wl=class{client;session;agent;constructor(e,t,n){this.client=e,this.session=t,this.agent=n}get base(){return`/v1/sessions/${bl(this.session)}/agents/${bl(this.agent)}`}get(){return this.client.request(`GET`,this.base)}rename(e){return this.client.request(`PATCH`,this.base,{name:e})}send(e,t=`followUp`,n=xl(),r){return this.client.request(`POST`,`${this.base}/messages`,{content:e,whenBusy:t,requestId:n,waitMs:r},{timeoutMs:(r??0)+2e4})}withdraw(e){return this.client.request(`DELETE`,`${this.base}/inbox/${e}`)}abort(e=!1){return this.client.request(`POST`,`${this.base}/abort`,{background:e})}fork(e,t=xl()){return this.client.request(`POST`,`${this.base}/fork`,e,{idempotencyKey:t})}config(){return this.client.request(`GET`,`${this.base}/config`)}configure(e){return this.client.request(`PATCH`,`${this.base}/config`,e)}compact(e){return this.client.request(`POST`,`${this.base}/compact`,{instructions:e})}reset(e){return this.client.request(`POST`,`${this.base}/reset`,{note:e})}entries(e={}){let t=new URLSearchParams({scope:e.scope??`all`,limit:String(e.limit??500),...e.cursor?{cursor:e.cursor}:{}});return this.client.request(`GET`,`${this.base}/entries?${t}`)}transcript(e=`json`){return this.client.request(`GET`,`${this.base}/transcript?format=${e}`)}doc(e){return this.client.request(`GET`,`${this.base}/docs/${bl(e)}`)}extensions(){return this.client.request(`GET`,`${this.base}/extensions`)}setExtension(e){return this.client.request(`PATCH`,`${this.base}/extensions`,e)}demo(e,t,n=`POST`){return this.client.request(n,`${this.base}/demo/${e}`,t)}events(e,t=[]){return this.client.stream(`${this.base}/events${t.length?`?docs=${t.map(bl).join(`,`)}`:``}`,e)}},Tl=e=>new Sl(`/api/devices/${encodeURIComponent(e)}`);async function El(e,t,n){let r=await fetch(`/api${t}`,{method:e,headers:n===void 0?{}:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>void 0);if(!r.ok){let e=i?.error;throw new fl(e?.code??`internal`,e?.message??`${r.status} ${r.statusText}`,r.status)}return i}var Dl={network:()=>El(`GET`,`/network`),check:e=>El(`POST`,`/devices/${encodeURIComponent(e)}/check`,{}),async uiGet(e){return(await El(`GET`,`/ui-state/${encodeURIComponent(e)}`)).value??void 0},uiSet:(e,t)=>El(`PUT`,`/ui-state/${encodeURIComponent(e)}`,{value:t})},Ol=e=>e instanceof Error?e.message:String(e),kl=[`demo.job-runs`,`demo.workspace`],Al=e=>`${e.deviceId}/agent/${e.sessionId}/${e.agentId}?docs=${kl.join(`,`)}`,jl=e=>`${e.deviceId}/session/${e.sessionId}`,Ml=e=>`${e}/device?docs=app.shared-state`;function Nl(e,t,n,r=`hello`){let i=N(`idle`),a=N(``);return e.route(t,e=>{e.type===`hello`?(i.value=r===`hello`?`live`:`connecting`,r===`hello`&&(a.value=``)):e.type===`disconnected`?i.value=`reconnecting`:e.type===`fault`?(i.value=`fault`,a.value=e.error.message):(n(e),e.type===r&&(a.value=``,i.value=`live`))}),{status:i,fault:a,select:n=>{a.value=``,i.value=n?`connecting`:`idle`,e.set(t,n)},retry:()=>{i.value=`connecting`,e.reopen(t)}}}function Pl(e){let t=new il,n=N(0);return t.subscribe(()=>n.value++),e.onNetwork(e=>t.apply({type:`network`,devices:e})),{model:t,devices:G(()=>(n.value,t.devices)),tree:G(()=>(n.value,t.tree()))}}function Fl(e,t){let n=Zt(),r=Zt([]),{status:i,select:a}=Nl(e,`device`,e=>{e.type===`doc`&&e.kind===`app.shared-state`?n.value={value:e.value,revision:e.revision??0}:e.type===`activity`&&(r.value=[...r.value,...e.items].slice(-50))});return Wn(t,e=>{n.value=void 0,a(e?Ml(e):void 0)},{immediate:!0}),{sharedState:n,activity:r,status:i}}function Il(e,t){let n=new Zc,r=N(0);n.subscribe(()=>r.value++);let{status:i,fault:a,select:o}=Nl(e,`session`,e=>n.apply(e));return Wn(()=>t.value?jl(t.value):void 0,e=>{n.clear(),o(e)},{immediate:!0}),{model:n,state:G(()=>(r.value,n.state)),status:i,fault:a}}function Ll(e,t){let n=new Xc,r=N(0);n.subscribe(()=>r.value++);let{status:i,fault:a,select:o,retry:s}=Nl(e,`agent`,e=>n.apply(e),`snapshot`);return Wn(()=>t.value?Al(t.value):void 0,e=>{n.clear(),o(e)},{immediate:!0}),{model:n,state:G(()=>(r.value,{...n.state})),status:i,fault:a,version:r,retry:s}}var Rl=new ll,zl=N(Rl.state);Rl.onState(e=>zl.value=e);var Bl=Pl(Rl),Vl=N(),q=N(),Hl=N(new Set),Ul=N(300),Wl=zt({tree:!0,inspector:!0}),Gl=N(!1),Kl=G(()=>q.value?.deviceId),ql=G(()=>Bl.devices.value.find(e=>e.id===Kl.value)),Jl=G(()=>ql.value?.status===`online`),Yl=Il(Rl,G(()=>q.value?{deviceId:q.value.deviceId,sessionId:q.value.sessionId}:void 0)),Xl=Ll(Rl,q),Zl=Fl(Rl,Kl),Ql=G(()=>ql.value?.tree?.sessions.find(e=>e.id===q.value?.sessionId)),$l=G(()=>Kl.value?Tl(Kl.value):void 0),J=G(()=>q.value&&$l.value?$l.value.agent(q.value.sessionId,q.value.agentId):void 0),eu=G(()=>q.value&&$l.value?$l.value.session(q.value.sessionId):void 0);function tu(e){q.value=e,X.drawer=!1,nu=!!e,ru()}var nu=!1;function ru(){let e=q.value;if(!nu||!e)return;let t=Bl.devices.value.find(t=>t.id===e.deviceId)?.tree?.sessions.find(t=>t.id===e.sessionId)?.agents,n=new Map((t??[]).map(e=>[e.id,e])),r=[e.deviceId,`${e.deviceId}/s/${e.sessionId}`,`${e.deviceId}/s/${e.sessionId}/a/${e.agentId}`],i=n.get(e.agentId),a=new Set;for(;i&&!a.has(i.id);){a.add(i.id);let t=i.parentId??i.ownerAgentId;if(t===void 0)break;r.push(`${e.deviceId}/s/${e.sessionId}/a/${t}`),i=n.get(t)}r.some(e=>!Hl.value.has(e))&&(Hl.value=new Set([...Hl.value,...r])),n.has(e.agentId)&&(nu=!1)}Wn(()=>Bl.devices.value,ru);function iu(e,t){let n=new Set(Hl.value);t??!n.has(e)?n.add(e):n.delete(e),Hl.value=n}var au=(()=>{let e=new Map;return(t,n)=>{clearTimeout(e.get(t)),e.set(t,setTimeout(()=>void Dl.uiSet(t,n).catch(()=>{}),300))}})();Wn(q,e=>Gl.value&&void Dl.uiSet(`tree.selected`,e??null).catch(()=>{})),Wn(Ul,e=>Gl.value&&au(`tree.width`,e)),Wn(Wl,e=>Gl.value&&au(`layout.panels`,{...e}));async function ou(){Rl.start();try{let[e,t,n,r]=await Promise.all([Dl.network(),Dl.uiGet(`tree.selected`),Dl.uiGet(`tree.width`),Dl.uiGet(`layout.panels`)]);r&&Object.assign(Wl,r),Vl.value=e.configFile,Bl.model.devices.length||Bl.model.apply({type:`network`,devices:e.devices}),Hl.value=new Set,n&&(Ul.value=n),t&&e.devices.some(e=>e.id===t.deviceId)?tu(t):su(e.devices)}catch(e){X.error=Ol(e)}finally{Gl.value=!0}}function su(e){for(let t of e){let e=t.status===`online`?t.tree?.sessions[0]:void 0,n=e?.agents.find(e=>e.kind===`root`)??e?.agents[0];if(e&&n)return tu({deviceId:t.id,sessionId:e.id,agentId:n.id})}}Wn(()=>[Xl.status.value,Ql.value],([e,t])=>{e===`fault`&&!t&&Jl.value&&(yu(`That session was archived on its device.`),tu(void 0))});var cu=G(()=>ql.value?.info?.models??[]),Y=Xl.state,lu=G(()=>Yl.state.value.agents.length?Yl.state.value.agents:Ql.value?.agents??[]),uu=G(()=>q.value?Qc(lu.value,q.value.agentId):[]),du=G(()=>{let e=q.value?.agentId;if(e===void 0)return[];let t=lu.value,n=new Set([e]);for(let e=!0;e;){e=!1;for(let r of t)r.ownerAgentId!==void 0&&n.has(r.ownerAgentId)&&!n.has(r.id)&&(n.add(r.id),e=!0)}let r=Yl.state.value.tasks,i=new Map(r.map(e=>[e.id,e])),a=new Map(t.map(e=>[e.id,e.ownerTaskId]));return r.filter(e=>n.has(e.conversationId)).map(e=>{let t=e,n=!1,r=new Set;for(;t&&!r.has(t.id);){if(r.add(t.id),t.background){n=!0;break}let e=t.owner??a.get(t.conversationId);t=e===void 0?void 0:i.get(e)}return{...e,effectiveBackground:n}})}),fu=G(()=>Y.value.running||du.value.some(e=>!e.effectiveBackground&&e.conversationId===q.value?.agentId)),pu=G(()=>Gc(Y.value.usage)),mu=G(()=>{let e=Y.value.agent.model;return cu.value.find(t=>t.provider===e?.provider&&t.id===e?.modelId)}),hu=Zt(),gu=0;async function _u(){let e=J.value,t=++gu;if(!e||!Jl.value)return void(hu.value=void 0);try{let n=await e.get();t===gu&&(hu.value=n)}catch{t===gu&&(hu.value=void 0)}}Wn([J,Jl],()=>void _u(),{immediate:!0});var X=zt({error:``,toast:``,drawer:!1,inspectorOverlay:!1,tab:`session`,composer:``,dialog:void 0}),vu;function yu(e){X.toast=e,clearTimeout(vu),vu=setTimeout(()=>X.toast=``,4500)}async function bu(e){X.error=``;try{return await e()}catch(e){X.error=Ol(e);return}}function xu(e){X.composer=e,setTimeout(()=>document.querySelector(`.composer textarea`)?.focus())}var Su=e=>Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}).format(e),Cu=e=>JSON.stringify(e,null,2),wu=(e=``)=>dl(cu.value.find(t=>t.id===e)?.icon);function Tu(e){if(!e)return`never`;let t=Math.max(0,Math.round((Date.now()-e)/1e3));return t<60?`${t}s ago`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}var Eu=N(!1);async function Du(){fu.value&&!Eu.value&&J.value&&(Eu.value=!0,await bu(()=>J.value.abort(!1))&&yu(`Foreground work interrupted. Background jobs continue.`),Eu.value=!1)}var Ou=window.matchMedia(`(max-width: 1100px)`),ku=N(Ou.matches);Ou.addEventListener(`change`,e=>ku.value=e.matches);var Au=G(()=>ku.value?X.inspectorOverlay:Wl.inspector);function ju(e){e&&(X.tab=e),ku.value?(X.drawer=!1,X.inspectorOverlay=!0):Wl.inspector=!0}function Mu(){ku.value?X.inspectorOverlay=!1:Wl.inspector=!1}function Nu(){ku.value?(X.drawer=!X.drawer)&&(X.inspectorOverlay=!1,Wl.tree=!0):Wl.tree=!Wl.tree}function Pu(){Au.value?Mu():ju()}var Fu=/Mac|iPhone|iPad/.test(navigator.userAgent),Iu=Fu?{tree:`Ctrl+N`,inspector:`Ctrl+T`}:{tree:`Alt+Shift+N`,inspector:`Alt+Shift+T`};function Lu(e){if(!(!(Fu?e.ctrlKey&&!e.metaKey&&!e.altKey&&!e.shiftKey:e.altKey&&e.shiftKey&&!e.ctrlKey&&!e.metaKey)||e.repeat||e.isComposing)){if(e.code===`KeyN`)return`tree`;if(e.code===`KeyT`)return`inspector`}}var Ru={class:`topbar`},zu={class:`brand`},Bu={class:`daemon`,"data-testid":`topbar-stats`},Vu=[`title`],Hu={class:`top-actions`},Uu=[`disabled`],Wu=[`disabled`],Gu=F({__name:`TopBar`,emits:[`newSession`],setup(e,{emit:t}){let n=G(()=>Bl.devices.value.filter(e=>e.status===`online`).length),r=G(()=>Bl.devices.value.reduce((e,t)=>e+(t.tree?.sessions.length??0),0)),i=G(()=>Bl.devices.value.reduce((e,t)=>e+(t.tree?.sessions.reduce((e,t)=>e+t.agents.length,0)??0),0)),a=N(!1);async function o(){let e=eu.value,t=q.value;if(!e||!t||a.value)return;a.value=!0;let n=await bu(()=>e.createAgent({}));a.value=!1,n&&(tu({...t,agentId:n.id}),yu(`New agent. Same session, same shared App State.`))}let s=t;return(e,t)=>(R(),z(`header`,Ru,[V(`div`,zu,[V(`button`,{class:`icon-button tree-toggle`,"aria-label":`Toggle network`,title:`Network`,onClick:t[0]||=e=>P(X).drawer=!P(X).drawer},[H(P(vc),{size:19})]),t[4]||=V(`img`,{class:`brandmark`,src:`/icons/durable-pi.svg`,alt:`Durable Pi`},null,-1),t[5]||=V(`strong`,null,`Durable Pi`,-1)]),t[12]||=V(`span`,{class:`topbar-sep`,"aria-hidden":`true`},null,-1),V(`div`,Bu,[V(`span`,{class:E([`dot`,{off:!n.value}]),"aria-hidden":`true`},null,2),V(`span`,{class:`network-summary`,title:`${n.value} of ${P(Bl).devices.value.length} devices online`},[H(P(mc),{size:16}),U(k(n.value)+` of `+k(P(Bl).devices.value.length)+` online`,1)],8,Vu),t[8]||=V(`span`,{class:`sep`,"aria-hidden":`true`},`·`,-1),V(`span`,null,[V(`b`,null,k(r.value),1),t[6]||=U(` sessions`,-1)]),t[9]||=V(`span`,{class:`sep`,"aria-hidden":`true`},`·`,-1),V(`span`,null,[V(`b`,null,k(i.value),1),t[7]||=U(` agents`,-1)])]),V(`div`,Hu,[V(`span`,{class:E([`chip connection`,{accent:P(zl)===`live`}])},[V(`span`,{class:E([`dot`,{off:P(zl)!==`live`}]),"aria-hidden":`true`},null,2),U(k(P(zl)===`live`?`Connected`:`Reconnecting`),1)],2),V(`button`,{class:`icon-button`,title:`How this works`,"aria-label":`How this works`,onClick:t[1]||=e=>P(X).dialog={kind:`help`}},[H(P(Ks),{size:19})]),V(`button`,{class:`secondary small new-agent-button`,disabled:!P(q)||!P(Jl)||a.value,title:`Start a fresh agent in this session`,onClick:o},[H(P(Sc),{size:18}),t[10]||=U(`New agent `,-1)],8,Uu),V(`button`,{class:`primary small`,onClick:t[2]||=e=>s(`newSession`)},[H(P(Sc),{size:18}),t[11]||=U(`New session `,-1)]),V(`button`,{class:`icon-button inspector-toggle`,"aria-label":`Toggle inspector`,title:`Inspector`,disabled:!P(q)||!P(Jl),onClick:t[3]||=e=>P(X).inspectorOverlay?P(Mu)():P(ju)()},[H(P(yc),{size:19})],8,Wu)])]))}}),Ku={class:`mnav`,"aria-label":`Panels`},qu={key:0,class:`badge`},Ju=F({__name:`MobileNav`,setup(e){function t(){X.drawer=!1,X.inspectorOverlay=!1}return(e,n)=>(R(),z(`nav`,Ku,[V(`button`,{type:`button`,class:E({"is-on":!P(X).drawer&&!P(Au)}),onClick:t},[H(P(fc),{size:18}),n[2]||=U(`Chat `,-1)],2),V(`button`,{type:`button`,class:E({"is-on":P(Au)}),onClick:n[0]||=e=>P(Au)?P(Mu)():P(ju)()},[H(P(yc),{size:18}),n[3]||=U(`Details`,-1),P(du).length?(R(),z(`span`,qu,k(P(du).length),1)):W(``,!0)],2),V(`button`,{type:`button`,class:E({"is-on":P(X).drawer}),onClick:n[1]||=e=>P(Nu)()},[H(P(Mc),{size:18}),n[4]||=U(`Network `,-1)],2)]))}}),Yu=[`width`,`height`,`aria-label`],Xu=[`width`,`height`,`aria-label`],Zu=F({__name:`DeviceIcon`,props:{device:{},size:{default:16}},setup(e){let t=e,n=G(()=>{let e=t.device;return e?.kind===`exe-dev`||e?.url?.includes(`.exe.xyz`)?`exe`:e?.info?.platform.startsWith(`darwin`)?`apple`:e?.kind===`local`?`laptop`:`server`}),r=G(()=>{let e={exe:`exe.dev VM`,apple:`macOS`,laptop:`This computer`,server:`Server`}[n.value];return t.device?.transport===`tunnel`?`${e} (tunnel)`:e});return(t,i)=>n.value===`exe`?(R(),z(`svg`,{key:0,class:`device-icon exe`,viewBox:`0 0 512 512`,width:e.size,height:e.size,role:`img`,"aria-label":r.value},[V(`title`,null,k(r.value),1),i[0]||=V(`path`,{fill:`currentColor`,"fill-rule":`evenodd`,d:`M8 332.2l.9 1.4 1.5 .5 38.5-4.1 3.1 .4 2.7 2.2 8.8 13.2 10.1 12.8 1.1 2.6-.3 3.2-16.4 35.6 0 1.7 1 1.2 2.2 0 33.8-18.2 3.1-.8 3.4 1 12.4 8.7 15.3 9.4 1.5 2.1 .5 2.5-3.1 38.9 .4 1.5 1.3 .9 2.3-.7 25.9-29.2 2.1-1.3 2.8-.4 16.3 4.4 15.7 3.2 3 1.8 1.6 2.8 9.8 37.1 1.5 1.6 1.7-.1 1.1-1.1 14.5-35.6 1.8-2.5 3.4-1.5 15.7-1.1 16.1-2.4 3.2 .5 2.3 1.8 22.4 32 2.2 .9 1.4-.7 .6-1.5 1.4-39 1-2.7 2.4-2.2 14.7-6.8 13.8-7.8 3.4-.7 3 1 32.4 21 2.3 0 1.1-1.1 0-1.6-13.4-36.6-.3-2.5 .7-2.4 12.2-13.9 8.8-12.1 2.8-2 3.1-.3 38.4 5.4 2.1-.9 .5-1.5-.6-1.4-27.5-27.4-1.6-2.7-.2-3.1 4.6-15.8 2.9-15.8 1.3-2.6 2.5-1.9 37.3-12.2 1.6-1.9-.3-1.5-1.1-1-36.8-12.5-2.4-1.4-1.8-3.3-3.1-17.7 0-2.2 .9-2.4 3.1-2.9 10.6-15.3 3.3-1.8 3.4 .3 3.8 3 4.5 6.8 8.9 11.2 12.5 12.5 6.2 4.8 7.3 4.3 6.3 2.4 3.8 .3 4-.3 5.1-2.4 6.5-7 4.8-10.6 3.3-11.9 2-14.1 1.3-3.4 0-66.6-.8-2.6-2-13.6-3.8-14.6-7.5-18.7-4.7-9.4-4-6-7.2-7.1-5-2.1-6.5 0-2.2 .7-6 3.5-12 12-13.1 17.8-11.7 18.2-3.7 1.6-11.8-.1-3.1-1.6-1.8-2.9-.3-8.8-2.8-12.7-1.5-4-7.1-13.3-5.9-7.8-10.7-9.3-8.6-4.7-5.9-2-4.1-.5-6.7-.5-4.1 .5-7 2-7.3 3.8-7.5 7-2.2 3.2-2.5 5.5-2.8 10.5-.5 3.6 .1 17.1-.3 2.2-1.1 1.9-1.7 1.5-3.7 1.5-2.6 .3-27.5-10.5-14.5-4-15.7-3.2-2.6-1.3-1.9-3-9.9-37.5-.9-1.2-1.4-.4-1.3 .4-.8 1-14.7 36.1-1.8 2.1-2.2 1.2-17.8 1.4-15 2.2-3.4-.7-2.4-2.1-22-31.5-2-.9-1.5 .5-.7 1.5-1.4 38.6-.9 3-2.5 2.5-14.7 6.8-13.8 7.8-2.8 .7-3.1-.7-32.9-21.3-2.3 0-1.1 1.1-.1 1.6 13.6 36.9 0 3.1-1.2 2.6-10.8 12-9.5 12.9-2.8 2-3.2 .3-38.4-5.4-1.5 .4-.9 1.4 .6 2.1 27.6 27.6 1.2 1.8 .5 2.2-3 10.6-1.5 2.4-2.4 1.6-5.8 1-4.4 1.8-3.8 3-3 3.8-1.7 4-.7 4.7 .4 4.7 1.5 4.2 .3 .5 30.7 0 1.7 .6 1.4 1.1 1.1 3-1.1 2.9-2.7 1.6-31.1 .1-.6 1.1-1.2 3.6-.4 4.1 .4 4.2 1.2 3.5 2.5 4 3.2 3.1 4.1 2.3 5.6 1.8 2.4 2.1 .9 2.1 5.1 21.2-.6 2.1-1.2 1.9-28.5 26.5zM283.6 189.4l6.6 .5 5.6 1.2 6.2 2.2 5.9 3.1 4.6 3.4 4.8 4.5 3.5 4.4 3.4 5.8 2.6 6.2 1.6 6.4 .6 5.6-.2 6.7-1.1 6.5-1.7 5.4-2.9 6-3.6 5.5-7.1 7.3-8.4 5.4-9.4 3.5-9.9 1.3-11-1-40.4-10.4-2.8-1.1-3.1-2.4-1.7-.6-.9-1.1-.1-2.2-1.4-2.2 1.6-6.3 18.1-38.5 4.7-7.5 7.1-7.3 8.4-5.4 9.4-3.5zM173.9 198l-1.1 5.9-2.3 5.5-3.4 5-4.2 4.3-5 3.3-5.5 2.3-5.9 1.2-6 0-5.9-1.2-5.6-2.3-5-3.3-4.2-4.3-3.3-5-2.3-5.5-1.2-5.9 0-6 1.2-5.9 2.3-5.5 3.3-5 4.2-4.3 5-3.3 5.6-2.3 5.9-1.2 6 0 5.9 1.2 5.5 2.3 5 3.3 4.2 4.3 3.4 5 2.3 5.5 1.1 5.9zM315.1 213.5l-63.1 37.7 69.5-12.9 0-6.2-1-6.5-2.1-6.1zM237.3 260l-2.6 1.5 40.6 10.5 7.4 .9 7.4-.5 5.4-1.4 5.2-2.1 8.5-5.8 3.8-4.1 3.2-4.5 2.6-5 1.6-4.9zM284.5 196.9l-7.4 .5-8.1 2.3-7.3 4.1-6.3 5.5-5.8 8.5-17.4 37.1 3-.6 76.1-45.5-5.8-5-6.5-3.7-7.1-2.3zM141.1 183.6l-1.1-2.9-2-2.3-2.8-1.3-3.1-.1-2.9 1-2.3 2.1-1.3 2.8-.1 3 1 2.9 2.1 2.3 2.7 1.3 3.1 .2 2.9-1.1 2.3-2 1.3-2.8z`},null,-1)],8,Yu)):n.value===`apple`?(R(),z(`svg`,{key:1,class:`device-icon apple`,viewBox:`0 0 384 512`,width:e.size,height:e.size,role:`img`,"aria-label":r.value},[V(`title`,null,k(r.value),1),i[1]||=V(`path`,{fill:`currentColor`,d:`M318.7 268.7c-.2-36.7 16.4-64.4 50-84.8-18.8-26.9-47.2-41.7-84.7-44.6-35.5-2.8-74.3 20.7-88.5 20.7-15 0-49.4-19.7-76.4-19.7C63.3 141.2 4 184.8 4 273.5q0 39.3 14.4 81.2c12.8 36.7 59 126.7 107.2 125.2 25.2-.6 43-17.9 75.8-17.9 31.8 0 48.3 17.9 76.4 17.9 48.6-.7 90.4-82.5 102.6-119.3-65.2-30.7-61.7-90-61.7-91.9zm-56.6-164.2c27.3-32.4 24.8-61.9 24-72.5-24.1 1.4-52 16.4-67.9 34.9-17.5 19.8-27.8 44.3-25.6 71.9 26.1 2 49.9-11.4 69.5-34.3z`},null,-1)],8,Xu)):n.value===`laptop`?(R(),B(P(oc),{key:2,class:`device-icon`,size:e.size,"aria-label":r.value},null,8,[`size`,`aria-label`])):(R(),B(P(Ec),{key:3,class:`device-icon`,size:e.size,"aria-label":r.value},null,8,[`size`,`aria-label`]))}}),Qu=[`aria-level`,`aria-expanded`,`aria-selected`,`data-key`,`title`],$u=[`aria-label`],ed={key:1,class:`chev`},td={class:`name`},nd={class:`badge`},rd=[`aria-label`],id=[`disabled`,`aria-label`],ad=[`aria-label`],od={class:`name`},sd={class:`path`},cd={key:0,class:`dot work`,title:`Working`},ld=[`title`],ud=[`disabled`,`aria-label`],dd=[`disabled`,`aria-label`],fd=[`disabled`,`aria-label`],pd={class:`name`},md={key:3,class:`meta`},hd={key:4,class:`dot work`,title:`Working`},gd=[`title`],_d=[`disabled`,`aria-label`],vd=F({__name:`TreeRow`,props:{node:{},depth:{},open:{type:Boolean},selected:{type:Boolean},focused:{type:Boolean},online:{type:Boolean}},emits:[`toggle`,`activate`,`action`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>n.node.children.length>0),a=G(()=>n.node.type===`device`?n.node.device:void 0),o=G(()=>n.node.type===`session`?n.node.session:void 0),s=G(()=>n.node.type===`agent`?n.node.agent:void 0),c=G(()=>o.value?o.value.agents.reduce((e,t)=>e+t.background,0):s.value?.background??0),l=G(()=>o.value?.busy||s.value?.busy),u=G(()=>{let e=a.value;if(!e)return``;let t=e.tree?.sessions.length??0;switch(e.status){case`online`:return`${t} session${t===1?``:`s`}`;case`checking`:return`checking…`;case`unauthorized`:return e.hasToken?`token rejected`:`no token`;case`mismatch`:return`identity changed`;case`incompatible`:return`incompatible`;default:return`offline · ${Tu(e.lastSeenAt)}`}}),d=G(()=>{let e=a.value?.status;return e===`online`?`on`:e===`checking`?`chk`:e===`offline`?`off`:`err`}),f=G(()=>a.value?.id??o.value?.name??s.value?.name??``),p=G(()=>{if(a.value)return`${a.value.name} · ${a.value.url}${a.value.error?`\n${a.value.error}`:``}`;if(o.value)return`${o.value.name}\n${o.value.cwd}`;let e=s.value;return e.kind===`fork`?`Fork of agent #${e.parentId} at entry #${e.forkedAt}`:e.kind===`subagent`?`Subagent owned by agent #${e.ownerAgentId}`:`Root agent`});return(t,n)=>(R(),z(`div`,{class:E([`tree-row`,[e.node.type,{sel:e.selected,focus:e.focused,stale:e.node.stale}]]),style:T({"--depth":e.depth}),role:`treeitem`,"aria-level":e.depth+1,"aria-expanded":i.value?e.open:void 0,"aria-selected":e.selected,"data-key":e.node.key,title:p.value,onClick:n[11]||=e=>r(`activate`)},[i.value?(R(),z(`button`,{key:0,class:`chev`,tabindex:`-1`,"aria-label":e.open?`Collapse ${f.value}`:`Expand ${f.value}`,onClick:n[0]||=Cs(e=>r(`toggle`),[`stop`])},[e.open?(R(),B(P(Us),{key:0,size:16})):(R(),B(P(Ws),{key:1,size:16}))],8,$u)):(R(),z(`span`,ed)),a.value?(R(),z(L,{key:2},[V(`i`,{class:E([`dot`,d.value])},null,2),H(Zu,{device:a.value,size:16},null,8,[`device`]),V(`b`,td,k(f.value),1),V(`span`,nd,k(a.value.kind),1),V(`span`,{class:E([`meta`,{err:d.value===`err`}])},k(u.value),3),V(`span`,{class:`acts`,onClick:n[4]||=Cs(()=>{},[`stop`])},[a.value.pairing?(R(),z(`button`,{key:0,class:`icon-button`,"aria-label":`Manage credentials for ${f.value}`,title:`Manage device credentials, including while offline`,onClick:n[1]||=e=>r(`action`,`credentials`)},[H(P(ac),{size:16})],8,rd)):W(``,!0),V(`button`,{class:`icon-button`,disabled:!e.online,"aria-label":`New session on ${f.value}`,title:`New session on this device`,onClick:n[2]||=e=>r(`action`,`new-session`)},[H(P(Sc),{size:16})],8,id),V(`button`,{class:`icon-button`,"aria-label":`Check ${f.value}`,title:`Check connection now`,onClick:n[3]||=e=>r(`action`,`check`)},[H(P(wc),{size:16})],8,ad)])],64)):o.value?(R(),z(L,{key:3},[H(P($s),{class:`ico`,size:16}),V(`b`,od,k(f.value),1),V(`span`,sd,`…/`+k(o.value.cwd.split(`/`).filter(Boolean).at(-1)),1),l.value?(R(),z(`i`,cd)):W(``,!0),c.value?(R(),z(`span`,{key:1,class:`bg-count`,title:`${c.value} background task(s)`},[n[12]||=V(`i`,{class:`dot bg`},null,-1),U(k(c.value)+` bg`,1)],8,ld)):W(``,!0),V(`span`,{class:`acts`,onClick:n[8]||=Cs(()=>{},[`stop`])},[V(`button`,{class:`icon-button`,disabled:!e.online,"aria-label":`New agent in ${f.value}`,title:`New agent in this session`,onClick:n[5]||=e=>r(`action`,`new-agent`)},[H(P(Sc),{size:16})],8,ud),V(`button`,{class:`icon-button`,disabled:!e.online,"aria-label":`Rename session ${f.value}`,title:`Rename session`,onClick:n[6]||=e=>r(`action`,`rename`)},[H(P(bc),{size:16})],8,dd),V(`button`,{class:`icon-button`,disabled:!e.online,"aria-label":`Archive session ${f.value}`,title:`Archive session`,onClick:n[7]||=e=>r(`action`,`archive`)},[H(P(Is),{size:16})],8,fd)])],64)):s.value?(R(),z(L,{key:4},[s.value.kind===`fork`?(R(),B(P(tc),{key:0,class:`ico`,size:16})):s.value.kind===`subagent`?(R(),B(P(Ys),{key:1,class:`ico`,size:16})):(R(),B(P(fc),{key:2,class:`ico root`,size:16})),V(`span`,pd,k(f.value),1),s.value.kind===`fork`&&s.value.forkedAt!==void 0?(R(),z(`span`,md,`@ #`+k(s.value.forkedAt),1)):W(``,!0),l.value?(R(),z(`i`,hd)):W(``,!0),c.value?(R(),z(`span`,{key:5,class:`bg-count`,title:`${c.value} background task(s)`},[n[13]||=V(`i`,{class:`dot bg`},null,-1),U(k(c.value),1)],8,gd)):W(``,!0),V(`span`,{class:`acts`,onClick:n[10]||=Cs(()=>{},[`stop`])},[V(`button`,{class:`icon-button`,disabled:!e.online,"aria-label":`Rename agent ${f.value}`,title:`Rename agent`,onClick:n[9]||=e=>r(`action`,`rename`)},[H(P(bc),{size:16})],8,_d)])],64)):W(``,!0)],14,Qu))}}),yd={class:`tree-head`},bd=[`title`],xd={key:0,class:`hint tree-empty`,"data-testid":`tree-empty`},Sd={key:1,class:`panel-rail`,"aria-label":`Network (collapsed)`},Cd=[`title`],wd=[`title`,`aria-label`,`onClick`],Td=F({__name:`NetworkSidebar`,setup(e){let t=G(()=>{let e=[],t=(n,r,i)=>{for(let a of n)e.push({node:a,depth:r,parent:i}),a.children.length&&Hl.value.has(a.key)&&t(a.children,r+1,a.key)};return t(Bl.tree.value,0),e}),n=N(),r=N(),i=e=>Bl.devices.value.find(t=>t.id===(e.type===`device`?e.device.id:e.deviceId)),a=e=>i(e)?.status===`online`,o=e=>e.type===`agent`&&q.value?.deviceId===e.deviceId&&q.value.sessionId===e.sessionId&&q.value.agentId===e.agent.id;function s(e){if(n.value=e.key,e.type===`device`)return iu(e.key);if(e.type===`agent`)return tu({deviceId:e.deviceId,sessionId:e.sessionId,agentId:e.agent.id});let t=e.session.agents.find(e=>e.kind===`root`)??e.session.agents[0];iu(e.key,!0),t&&tu({deviceId:e.deviceId,sessionId:e.session.id,agentId:t.id})}async function c(e,t){let n=i(e);if(!n)return;let r=Tl(n.id);if(e.type===`device`){t===`new-session`?X.dialog={kind:`new-session`,deviceId:n.id}:t===`check`?await bu(()=>Dl.check(n.id)):t===`credentials`&&(X.dialog={kind:`credentials`,deviceId:n.id});return}if(e.type===`session`){let i=e.session;if(t===`new-agent`){let e=await bu(()=>r.session(i.id).createAgent({}));e&&(tu({deviceId:n.id,sessionId:i.id,agentId:e.id}),yu(`New agent. Same session, same shared App State.`))}else t===`rename`?X.dialog={kind:`prompt`,title:`Rename session`,label:`Session name`,value:i.name,submit:`Save name`,run:e=>r.session(i.id).rename(e)}:t===`archive`&&(X.dialog={kind:`prompt`,title:`Archive ${i.name}?`,hint:`Stops all of its work and moves its files to archive/ on ${n.id}. Nothing is deleted.`,submit:`Archive session`,danger:!0,run:async()=>{await r.session(i.id).archive(),q.value?.sessionId===i.id&&tu(void 0)}});return}let a=e.agent;t===`rename`&&(X.dialog={kind:`prompt`,title:`Rename agent`,label:`Agent name`,value:a.named?a.name:``,placeholder:a.name,submit:`Save name`,run:t=>r.agent(e.sessionId,a.id).rename(t)})}function l(e){let i=t.value.findIndex(e=>e.node.key===n.value),a=t.value[Math.max(0,Math.min(t.value.length-1,(i<0?0:i)+e))];a&&(n.value=a.node.key,wn(()=>r.value?.querySelector(`[data-key="${CSS.escape(a.node.key)}"]`)?.scrollIntoView({block:`nearest`})))}function u(){n.value??=t.value[0]?.node.key}function d(e){let r=t.value.find(e=>e.node.key===n.value);if(e.key===`ArrowDown`)l(1);else if(e.key===`ArrowUp`)l(-1);else if(e.key===`ArrowRight`&&r){if(!r.node.children.length)return;Hl.value.has(r.node.key)?l(1):iu(r.node.key,!0)}else if(e.key===`ArrowLeft`&&r)r.node.children.length&&Hl.value.has(r.node.key)?iu(r.node.key,!1):r.parent&&(n.value=r.parent);else if((e.key===`Enter`||e.key===` `)&&r)s(r.node);else return;e.preventDefault()}return(e,i)=>(R(),z(`aside`,{class:E([`network-sidebar`,{open:P(X).drawer,collapsed:!P(Wl).tree&&!P(X).drawer}]),"aria-label":`Network`},[P(Wl).tree||P(X).drawer?(R(),z(L,{key:0},[V(`header`,yd,[V(`span`,null,[H(P(mc),{size:16}),i[3]||=U(`NETWORK`,-1)]),V(`button`,{class:`icon-button`,"aria-label":`Pair a device`,title:`Pair a device`,onClick:i[0]||=e=>P(X).dialog={kind:`pair`}},[H(P(cc),{size:15})]),V(`button`,{class:`icon-button panel-toggle`,"aria-label":`Collapse network`,title:`Collapse network (${P(Iu).tree})`,onClick:i[1]||=e=>(P(Wl).tree=!1,P(X).drawer=!1)},[H(P(gc),{size:18})],8,bd)]),V(`div`,{ref_key:`list`,ref:r,class:`tree-list`,role:`tree`,tabindex:`0`,"aria-label":`Devices, sessions and agents`,onKeydown:d,onFocus:u},[(R(!0),z(L,null,I(t.value,e=>(R(),B(vd,{key:e.node.key,node:e.node,depth:e.depth,open:P(Hl).has(e.node.key),selected:o(e.node),focused:n.value===e.node.key,online:a(e.node),onToggle:t=>P(iu)(e.node.key),onActivate:t=>s(e.node),onAction:t=>c(e.node,t)},null,8,[`node`,`depth`,`open`,`selected`,`focused`,`online`,`onToggle`,`onActivate`,`onAction`]))),128)),t.value.length?W(``,!0):(R(),z(`p`,xd,[...i[4]||=[U(` No devices yet. Declare them in `,-1),V(`code`,null,`dpi-network.yaml`,-1),U(` (start from `,-1),V(`code`,null,`dpi-network.example.yaml`,-1),U(`), then run `,-1),V(`code`,null,`just net up <id>`,-1),U(`. `,-1)]]))],544)],64)):(R(),z(`div`,Sd,[V(`button`,{class:`icon-button panel-toggle`,"aria-label":`Expand network`,title:`Expand network (${P(Iu).tree})`,onClick:i[2]||=e=>P(Wl).tree=!0},[H(P(_c),{size:18})],8,Cd),(R(!0),z(L,null,I(P(Bl).devices.value,e=>(R(),z(`button`,{key:e.id,class:`rail-device`,title:`${e.id} · ${e.status}`,"aria-label":`Show ${e.id}`,onClick:t=>(P(Wl).tree=!0,P(iu)(e.id,!0))},[H(Zu,{device:e,size:20},null,8,[`device`]),V(`i`,{class:E([`dot`,e.status===`online`?`on`:e.status===`checking`?`chk`:e.status===`offline`?`off`:`err`])},null,2)],8,wd))),128))]))],2))}});function Ed(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Dd=Ed();function Od(e){Dd=e}var kd={exec:()=>null};function Z(e,t=``){let n=typeof e==`string`?e:e.source,r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(jd.caret,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}var Ad=(()=>{try{return!0}catch{return!1}})(),jd={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:e=>RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,`i`),blockquoteBeginRegex:e=>RegExp(`^ {0,${Math.min(3,e-1)}}>`)},Md=/^(?:[ \t]*(?:\n|$))+/,Nd=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Pd=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Fd=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Id=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Ld=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Rd=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,zd=Z(Rd).replace(/bull/g,Ld).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(),Bd=Z(Rd).replace(/bull/g,Ld).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(),Vd=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Hd=/^[^\n]+/,Ud=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Wd=Z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace(`label`,Ud).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Gd=Z(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ld).getRegex(),Kd=`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`,qd=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Jd=Z(`^ {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`,qd).replace(`tag`,Kd).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Yd=Z(Vd).replace(`hr`,Fd).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`,Kd).getRegex(),Xd={blockquote:Z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,Yd).getRegex(),code:Nd,def:Wd,fences:Pd,heading:Id,hr:Fd,html:Jd,lheading:zd,list:Gd,newline:Md,paragraph:Yd,table:kd,text:Hd},Zd=Z(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,Fd).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`,Kd).getRegex(),Qd={...Xd,lheading:Bd,table:Zd,paragraph:Z(Vd).replace(`hr`,Fd).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,Zd).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`,Kd).getRegex()},$d={...Xd,html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,qd).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:kd,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Z(Vd).replace(`hr`,Fd).replace(`heading`,` *#{1,6} *[^
|
|
16
|
-
]`).replace(`lheading`,zd).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ef=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,tf=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,nf=/^( {2,}|\\)\n(?!\s*$)/,rf=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,af=/[\p{P}\p{S}]/u,of=/[\s\p{P}\p{S}]/u,sf=/[^\s\p{P}\p{S}]/u,cf=Z(/^((?![*_])punctSpace)/,`u`).replace(/punctSpace/g,of).getRegex(),lf=/(?!~)[\p{P}\p{S}]/u,uf=/(?!~)[\s\p{P}\p{S}]/u,df=/(?:[^\s\p{P}\p{S}]|~)/u,ff=Z(/link|precode-code|html/,`g`).replace(`link`,/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace(`precode-`,Ad?"(?<!`)()":"(^^|[^`])").replace(`code`,/(?<b>`+)[^`]+\k<b>(?!`)/).replace(`html`,/<(?! )[^<>]*?>/).getRegex(),pf=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,mf=Z(pf,`u`).replace(/punct/g,af).getRegex(),hf=Z(pf,`u`).replace(/punct/g,lf).getRegex(),gf=`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)`,_f=Z(gf,`gu`).replace(/notPunctSpace/g,sf).replace(/punctSpace/g,of).replace(/punct/g,af).getRegex(),vf=Z(gf,`gu`).replace(/notPunctSpace/g,df).replace(/punctSpace/g,uf).replace(/punct/g,lf).getRegex(),yf=Z(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)`,`gu`).replace(/notPunctSpace/g,sf).replace(/punctSpace/g,of).replace(/punct/g,af).getRegex(),bf=Z(/^~~?(?:((?!~)punct)|[^\s~])/,`u`).replace(/punct/g,af).getRegex(),xf=Z(`^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)`,`gu`).replace(/notPunctSpace/g,sf).replace(/punctSpace/g,of).replace(/punct/g,af).getRegex(),Sf=Z(/\\(punct)/,`gu`).replace(/punct/g,af).getRegex(),Cf=Z(/^<(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(),wf=Z(qd).replace(`(?:-->|$)`,`-->`).getRegex(),Tf=Z(`^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`,wf).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ef=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Df=Z(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace(`label`,Ef).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Of=Z(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ef).replace(`ref`,Ud).getRegex(),kf=Z(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,Ud).getRegex(),Af=Z(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Of).replace(`nolink`,kf).getRegex(),jf=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mf={_backpedal:kd,anyPunctuation:Sf,autolink:Cf,blockSkip:ff,br:nf,code:tf,del:kd,delLDelim:kd,delRDelim:kd,emStrongLDelim:mf,emStrongRDelimAst:_f,emStrongRDelimUnd:yf,escape:ef,link:Df,nolink:kf,punctuation:cf,reflink:Of,reflinkSearch:Af,tag:Tf,text:rf,url:kd},Nf={...Mf,link:Z(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ef).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ef).getRegex()},Pf={...Mf,emStrongRDelimAst:vf,emStrongLDelim:hf,delLDelim:bf,delRDelim:xf,url:Z(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace(`protocol`,jf).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:Z(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace(`protocol`,jf).getRegex()},Ff={...Pf,br:Z(nf).replace(`{2,}`,`*`).getRegex(),text:Z(Pf.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},If={normal:Xd,gfm:Qd,pedantic:$d},Lf={normal:Mf,gfm:Pf,breaks:Ff,pedantic:Nf},Rf={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`},zf=e=>Rf[e];function Bf(e,t){if(t){if(jd.escapeTest.test(e))return e.replace(jd.escapeReplace,zf)}else if(jd.escapeTestNoEncode.test(e))return e.replace(jd.escapeReplaceNoEncode,zf);return e}function Vf(e){try{e=encodeURI(e).replace(jd.percentDecode,`%`)}catch{return null}return e}function Hf(e,t){let n=e.replace(jd.findPipe,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(jd.splitPipe),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(jd.slashPipe,`|`);return n}function Uf(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function Wf(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return n>0?-2:-1}function Gf(e,t=0){let n=t,r=``;for(let t of e)if(t===` `){let e=4-n%4;r+=` `.repeat(e),n+=e}else r+=t,n++;return r}function Kf(e,t,n,r,i){let a=t.href,o=t.title||null,s=e[1].replace(i.other.outputLinkReplace,`$1`);r.state.inLink=!0;let c={type:e[0].charAt(0)===`!`?`image`:`link`,raw:n,href:a,title:o,text:s,tokens:r.inlineTokens(s)};return r.state.inLink=!1,c}function qf(e,t,n){let r=e.match(n.other.indentCodeCompensation);if(r===null)return t;let i=r[1];return t.split(`
|
|
17
|
-
`).map(e=>{let t=e.match(n.other.beginningSpace);if(t===null)return e;let[r]=t;return r.length>=i.length?e.slice(i.length):e}).join(`
|
|
18
|
-
`)}var Jf=class{options;rules;lexer;constructor(e){this.options=e||Dd}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:Uf(e,`
|
|
19
|
-
`)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=qf(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:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Uf(e,`#`);(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:Uf(t[0],`
|
|
20
|
-
`)}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Uf(t[0],`
|
|
21
|
-
`).split(`
|
|
22
|
-
`),n=``,r=``,i=[];for(;e.length>0;){let t=!1,a=[],o=0;for(;o<e.length;o++)if(this.rules.other.blockquoteStart.test(e[o]))a.push(e[o]),t=!0;else if(!t)a.push(e[o]);else break;e=e.slice(o);let s=a.join(`
|
|
23
|
-
`),c=s.replace(this.rules.other.blockquoteSetextReplace,`
|
|
24
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,``);n=n?`${n}
|
|
25
|
-
${s}`:s,r=r?`${r}
|
|
26
|
-
${c}`:c;let l=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(c,i,!0),this.lexer.state.top=l,e.length===0)break;let u=i.at(-1);if(u?.type===`code`)break;if(u?.type===`blockquote`){let t=u,a=t.raw+`
|
|
27
|
-
`+e.join(`
|
|
28
|
-
`),o=this.blockquote(a);i[i.length-1]=o,n=n.substring(0,n.length-t.raw.length)+o.raw,r=r.substring(0,r.length-t.text.length)+o.text;break}if(u?.type===`list`){let t=u,a=t.raw+`
|
|
29
|
-
`+e.join(`
|
|
30
|
-
`),o=this.list(a);i[i.length-1]=o,n=n.substring(0,n.length-u.raw.length)+o.raw,r=r.substring(0,r.length-t.raw.length)+o.raw,e=a.substring(i.at(-1).raw.length).split(`
|
|
31
|
-
`);continue}}return{type:`blockquote`,raw:n,tokens:i,text:r}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=this.rules.other.listItemRegex(n),o=!1;for(;e;){let n=!1,r=``,s=``;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;r=t[0],e=e.substring(r.length);let c=Gf(t[2].split(`
|
|
32
|
-
`,1)[0],t[1].length),l=e.split(`
|
|
33
|
-
`,1)[0],u=!c.trim(),d=0;if(this.options.pedantic?(d=2,s=c.trimStart()):u?d=t[1].length+1:(d=c.search(this.rules.other.nonSpaceChar),d=d>4?1:d,s=c.slice(d),d+=t[1].length),u&&this.rules.other.blankLine.test(l)&&(r+=l+`
|
|
34
|
-
`,e=e.substring(l.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(d),n=this.rules.other.hrRegex(d),i=this.rules.other.fencesBeginRegex(d),a=this.rules.other.headingBeginRegex(d),o=this.rules.other.htmlBeginRegex(d),f=this.rules.other.blockquoteBeginRegex(d);for(;e;){let p=e.split(`
|
|
35
|
-
`,1)[0],m;if(l=p,this.options.pedantic?(l=l.replace(this.rules.other.listReplaceNesting,` `),m=l):m=l.replace(this.rules.other.tabCharGlobal,` `),i.test(l)||a.test(l)||o.test(l)||f.test(l)||t.test(l)||n.test(l))break;if(m.search(this.rules.other.nonSpaceChar)>=d||!l.trim())s+=`
|
|
36
|
-
`+m.slice(d);else{if(u||c.replace(this.rules.other.tabCharGlobal,` `).search(this.rules.other.nonSpaceChar)>=4||i.test(c)||a.test(c)||n.test(c))break;s+=`
|
|
37
|
-
`+l}u=!l.trim(),r+=p+`
|
|
38
|
-
`,e=e.substring(p.length+1),c=m.slice(d)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(r)&&(o=!0)),i.items.push({type:`list_item`,raw:r,task:!!this.options.gfm&&this.rules.other.listIsTask.test(s),loose:!1,text:s,tokens:[]}),i.raw+=r}let s=i.items.at(-1);if(s)s.raw=s.raw.trimEnd(),s.text=s.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let e of i.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,``),e.tokens[0]?.type===`text`||e.tokens[0]?.type===`paragraph`){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,``),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,``);for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,``);break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:`checkbox`,raw:t[0]+` `,checked:t[0]!==`[ ]`};e.checked=n.checked,i.loose?e.tokens[0]&&[`paragraph`,`text`].includes(e.tokens[0].type)&&`tokens`in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:`paragraph`,raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!i.loose){let t=e.tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw))}}if(i.loose)for(let e of i.items){e.loose=!0;for(let t of e.tokens)t.type===`text`&&(t.type=`paragraph`)}return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal,` `),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,`$1`).replace(this.rules.inline.anyPunctuation,`$1`):``,r=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:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=Hf(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,``).split(`|`),i=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,``).split(`
|
|
39
|
-
`):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)this.rules.other.tableAlignRight.test(e)?a.align.push(`right`):this.rules.other.tableAlignCenter.test(e)?a.align.push(`center`):this.rules.other.tableAlignLeft.test(e)?a.align.push(`left`):a.align.push(null);for(let e=0;e<n.length;e++)a.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:a.align[e]});for(let e of i)a.rows.push(Hf(e,a.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:a.align[t]})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);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(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
|
|
40
|
-
`?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);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(e){let t=this.rules.inline.link.exec(e);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 t=Uf(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=Wf(t[2],`()`);if(e===-2)return;if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Kf(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return Kf(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal,` `),n=this.rules.other.nonSpaceChar.test(e),r=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&r&&(e=e.substring(1,e.length-1)),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e,t,n=``){let r=this.rules.inline.delLDelim.exec(e);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=this.rules.inline.delRDelim;for(s.lastIndex=0,t=t.slice(-1*e.length+n);(r=s.exec(t))!==null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i||(a=[...i].length,a!==n))continue;if(r[3]||r[4]){o+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o);let t=[...r[0]][0].length,s=e.slice(0,n+r.index+t+a),c=s.slice(n,-n);return{type:`del`,raw:s,text:c,tokens:this.lexer.inlineTokens(c)}}}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=t[1],n=`mailto:`+e):(e=t[1],n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=t[0],n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=t[0],n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:`text`,raw:t[0],text:t[0],escaped:e}}}},Yf=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Dd,this.options.tokenizer=this.options.tokenizer||new Jf,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 t={other:jd,block:If.normal,inline:Lf.normal};this.options.pedantic?(t.block=If.pedantic,t.inline=Lf.pedantic):this.options.gfm&&(t.block=If.gfm,t.inline=this.options.breaks?Lf.breaks:Lf.gfm),this.tokenizer.rules=t}static get rules(){return{block:If,inline:Lf}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(jd.carriageReturn,`
|
|
41
|
-
`),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(jd.tabCharGlobal,` `).replace(jd.spaceLine,``));e;){let r;if(this.options.extensions?.block?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.space(e)){e=e.substring(r.raw.length);let n=t.at(-1);r.raw.length===1&&n!==void 0?n.raw+=`
|
|
42
|
-
`:t.push(r);continue}if(r=this.tokenizer.code(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
43
|
-
`)?``:`
|
|
44
|
-
`)+r.raw,n.text+=`
|
|
45
|
-
`+r.text,this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(r=this.tokenizer.fences(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.heading(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.hr(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.blockquote(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.list(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.html(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.def(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`paragraph`||n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
46
|
-
`)?``:`
|
|
47
|
-
`)+r.raw,n.text+=`
|
|
48
|
-
`+r.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[r.tag]||(this.tokens.links[r.tag]={href:r.href,title:r.title},t.push(r));continue}if(r=this.tokenizer.table(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.lheading(e)){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startBlock){let t=1/0,n=e.slice(1),r;this.options.extensions.startBlock.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(this.state.top&&(r=this.tokenizer.paragraph(i))){let a=t.at(-1);n&&a?.type===`paragraph`?(a.raw+=(a.raw.endsWith(`
|
|
49
|
-
`)?``:`
|
|
50
|
-
`)+r.raw,a.text+=`
|
|
51
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=a.text):t.push(r),n=i.length!==e.length,e=e.substring(r.raw.length);continue}if(r=this.tokenizer.text(e)){e=e.substring(r.raw.length);let n=t.at(-1);n?.type===`text`?(n.raw+=(n.raw.endsWith(`
|
|
52
|
-
`)?``:`
|
|
53
|
-
`)+r.raw,n.text+=`
|
|
54
|
-
`+r.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){this.tokenizer.lexer=this;let n=e,r=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(r=this.tokenizer.rules.inline.reflinkSearch.exec(n))!==null;)e.includes(r[0].slice(r[0].lastIndexOf(`[`)+1,-1))&&(n=n.slice(0,r.index)+`[`+`a`.repeat(r[0].length-2)+`]`+n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(r=this.tokenizer.rules.inline.anyPunctuation.exec(n))!==null;)n=n.slice(0,r.index)+`++`+n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let i;for(;(r=this.tokenizer.rules.inline.blockSkip.exec(n))!==null;)i=r[2]?r[2].length:0,n=n.slice(0,r.index+i)+`[`+`a`.repeat(r[0].length-i-2)+`]`+n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);n=this.options.hooks?.emStrongMask?.call({lexer:this},n)??n;let a=!1,o=``;for(;e;){a||(o=``),a=!1;let r;if(this.options.extensions?.inline?.some(n=>(r=n.call({lexer:this},e,t))?(e=e.substring(r.raw.length),t.push(r),!0):!1))continue;if(r=this.tokenizer.escape(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.tag(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.link(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(r.raw.length);let n=t.at(-1);r.type===`text`&&n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(r=this.tokenizer.emStrong(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.codespan(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.br(e)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.del(e,n,o)){e=e.substring(r.raw.length),t.push(r);continue}if(r=this.tokenizer.autolink(e)){e=e.substring(r.raw.length),t.push(r);continue}if(!this.state.inLink&&(r=this.tokenizer.url(e))){e=e.substring(r.raw.length),t.push(r);continue}let i=e;if(this.options.extensions?.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(r=this.tokenizer.inlineText(i)){e=e.substring(r.raw.length),r.raw.slice(-1)!==`_`&&(o=r.raw.slice(-1)),a=!0;let n=t.at(-1);n?.type===`text`?(n.raw+=r.raw,n.text+=r.text):t.push(r);continue}if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}return t}},Xf=class{options;parser;constructor(e){this.options=e||Dd}space(e){return``}code({text:e,lang:t,escaped:n}){let r=(t||``).match(jd.notSpaceStart)?.[0],i=e.replace(jd.endingNewline,``)+`
|
|
55
|
-
`;return r?`<pre><code class="language-`+Bf(r)+`">`+(n?i:Bf(i,!0))+`</code></pre>
|
|
56
|
-
`:`<pre><code>`+(n?i:Bf(i,!0))+`</code></pre>
|
|
57
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
58
|
-
${this.parser.parse(e)}</blockquote>
|
|
59
|
-
`}html({text:e}){return e}def(e){return``}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
60
|
-
`}hr(e){return`<hr>
|
|
61
|
-
`}list(e){let t=e.ordered,n=e.start,r=``;for(let t=0;t<e.items.length;t++){let n=e.items[t];r+=this.listitem(n)}let i=t?`ol`:`ul`,a=t&&n!==1?` start="`+n+`"`:``;return`<`+i+a+`>
|
|
62
|
-
`+r+`</`+i+`>
|
|
63
|
-
`}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>
|
|
64
|
-
`}checkbox({checked:e}){return`<input `+(e?`checked="" `:``)+`disabled="" type="checkbox"> `}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
65
|
-
`}table(e){let t=``,n=``;for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let r=``;for(let t=0;t<e.rows.length;t++){let i=e.rows[t];n=``;for(let e=0;e<i.length;e++)n+=this.tablecell(i[e]);r+=this.tablerow({text:n})}return r&&=`<tbody>${r}</tbody>`,`<table>
|
|
66
|
-
<thead>
|
|
67
|
-
`+t+`</thead>
|
|
68
|
-
`+r+`</table>
|
|
69
|
-
`}tablerow({text:e}){return`<tr>
|
|
70
|
-
${e}</tr>
|
|
71
|
-
`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?`th`:`td`;return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
72
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${Bf(e,!0)}</code>`}br(e){return`<br>`}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=Vf(e);if(i===null)return r;e=i;let a=`<a href="`+e+`"`;return t&&(a+=` title="`+Bf(t)+`"`),a+=`>`+r+`</a>`,a}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Vf(e);if(i===null)return Bf(n);e=i;let a=`<img src="${e}" alt="${Bf(n)}"`;return t&&(a+=` title="${Bf(t)}"`),a+=`>`,a}text(e){return`tokens`in e&&e.tokens?this.parser.parseInline(e.tokens):`escaped`in e&&e.escaped?e.text:Bf(e.text)}},Zf=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return``+e}image({text:e}){return``+e}br(){return``}checkbox({raw:e}){return e}},Qf=class e{options;renderer;textRenderer;constructor(e){this.options=e||Dd,this.options.renderer=this.options.renderer||new Xf,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Zf}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){this.renderer.parser=this;let t=``;for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let e=r,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(n!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`def`,`paragraph`,`text`].includes(e.type)){t+=n||``;continue}}let i=r;switch(i.type){case`space`:t+=this.renderer.space(i);break;case`hr`:t+=this.renderer.hr(i);break;case`heading`:t+=this.renderer.heading(i);break;case`code`:t+=this.renderer.code(i);break;case`table`:t+=this.renderer.table(i);break;case`blockquote`:t+=this.renderer.blockquote(i);break;case`list`:t+=this.renderer.list(i);break;case`checkbox`:t+=this.renderer.checkbox(i);break;case`html`:t+=this.renderer.html(i);break;case`def`:t+=this.renderer.def(i);break;case`paragraph`:t+=this.renderer.paragraph(i);break;case`text`:t+=this.renderer.text(i);break;default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}let a=i;switch(a.type){case`escape`:n+=t.text(a);break;case`html`:n+=t.html(a);break;case`link`:n+=t.link(a);break;case`image`:n+=t.image(a);break;case`checkbox`:n+=t.checkbox(a);break;case`strong`:n+=t.strong(a);break;case`em`:n+=t.em(a);break;case`codespan`:n+=t.codespan(a);break;case`br`:n+=t.br(a);break;case`del`:n+=t.del(a);break;case`text`:n+=t.text(a);break;default:{let e=`Token with "`+a.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},$f=class{options;block;constructor(e){this.options=e||Dd}static passThroughHooks=new Set([`preprocess`,`postprocess`,`processAllTokens`,`emStrongMask`]);static passThroughHooksRespectAsync=new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(e=this.block){return e?Yf.lex:Yf.lexInline}provideParser(e=this.block){return e?Qf.parse:Qf.parseInline}},ep=new class{defaults=Ed();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Qf;Renderer=Xf;TextRenderer=Zf;Lexer=Yf;Tokenizer=Jf;Hooks=$f;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Xf(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if([`options`,`parser`].includes(n))continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Jf(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new $f;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if([`options`,`block`].includes(n))continue;let r=n,i=e.hooks[r],a=t[r];t[r]=$f.passThroughHooks.has(n)?e=>{if(this.defaults.async&&$f.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await i.call(t,e);return a.call(t,n)})();let r=i.call(t,e);return a.call(t,r)}:(...e)=>{if(this.defaults.async)return(async()=>{let n=await i.apply(t,e);return n===!1&&(n=await a.apply(t,e)),n})();let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Yf.lex(e,t??this.defaults)}parser(e,t){return Qf.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let r={...n},i={...this.defaults,...r},a=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return a(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 a(Error(`marked(): input parameter is undefined or null`));if(typeof t!=`string`)return a(Error(`marked(): input parameter is of type `+Object.prototype.toString.call(t)+`, string expected`));if(i.hooks&&(i.hooks.options=i,i.hooks.block=e),i.async)return(async()=>{let n=i.hooks?await i.hooks.preprocess(t):t,r=await(i.hooks?await i.hooks.provideLexer(e):e?Yf.lex:Yf.lexInline)(n,i),a=i.hooks?await i.hooks.processAllTokens(r):r;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let o=await(i.hooks?await i.hooks.provideParser(e):e?Qf.parse:Qf.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(o):o})().catch(a);try{i.hooks&&(t=i.hooks.preprocess(t));let n=(i.hooks?i.hooks.provideLexer(e):e?Yf.lex:Yf.lexInline)(t,i);i.hooks&&(n=i.hooks.processAllTokens(n)),i.walkTokens&&this.walkTokens(n,i.walkTokens);let r=(i.hooks?i.hooks.provideParser(e):e?Qf.parse:Qf.parseInline)(n,i);return i.hooks&&(r=i.hooks.postprocess(r)),r}catch(e){return a(e)}}}onError(e,t){return n=>{if(n.message+=`
|
|
73
|
-
Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+Bf(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Q(e,t){return ep.parse(e,t)}Q.options=Q.setOptions=function(e){return ep.setOptions(e),Q.defaults=ep.defaults,Od(Q.defaults),Q},Q.getDefaults=Ed,Q.defaults=Dd,Q.use=function(...e){return ep.use(...e),Q.defaults=ep.defaults,Od(Q.defaults),Q},Q.walkTokens=function(e,t){return ep.walkTokens(e,t)},Q.parseInline=ep.parseInline,Q.Parser=Qf,Q.parser=Qf.parse,Q.Renderer=Xf,Q.TextRenderer=Zf,Q.Lexer=Yf,Q.lexer=Yf.lex,Q.Tokenizer=Jf,Q.Hooks=$f,Q.parse=Q,Q.options,Q.setOptions,Q.use,Q.walkTokens,Q.parseInline,Qf.parse,Yf.lex;function tp(e,t){this.v=e,this.k=t}function np(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function rp(e){if(Array.isArray(e))return e}function ip(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ap(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
74
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function op(e,t){return rp(e)||ip(e,t)||sp(e,t)||ap()}function sp(e,t){if(e){if(typeof e==`string`)return np(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?np(e,t):void 0}}function cp(e){var t,n;function r(t,n){try{var a=e[t](n),o=a.value,s=o instanceof tp;Promise.resolve(s?o.v:o).then(function(n){if(s){var c=t===`return`&&o.k?t:`next`;if(!o.k||n.done)return r(c,n);n=e[c](n).value}i(!!a.done,n)},function(e){r(`throw`,e)})}catch(e){i(2,e)}}function i(e,i){e===2?t.reject(i):t.resolve({value:i,done:e}),(t=t.next)?r(t.key,t.arg):n=null}this._invoke=function(e,i){return new Promise(function(a,o){var s={key:e,arg:i,resolve:a,reject:o,next:null};n?n=n.next=s:(t=n=s,r(e,i))})},typeof e.return!=`function`&&(this.return=void 0)}cp.prototype[typeof Symbol==`function`&&Symbol.asyncIterator||`@@asyncIterator`]=function(){return this},cp.prototype.next=function(e){return this._invoke(`next`,e)},cp.prototype.throw=function(e){return this._invoke(`throw`,e)},cp.prototype.return=function(e){return this._invoke(`return`,e)};var lp=Object.entries,up=Object.setPrototypeOf,dp=Object.isFrozen,fp=Object.getPrototypeOf,pp=Object.getOwnPropertyDescriptor,mp=Object.freeze,hp=Object.seal,gp=Object.create,_p=typeof Reflect<`u`&&Reflect,vp=_p.apply,yp=_p.construct;mp||=function(e){return e},hp||=function(e){return e},vp||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},yp||=function(e){return new e(...[...arguments].slice(1))};var bp=Bp(Array.prototype.forEach);Array.prototype.indexOf;var xp=Bp(Array.prototype.lastIndexOf),Sp=Bp(Array.prototype.pop),Cp=Bp(Array.prototype.push);Array.prototype.slice;var wp=Bp(Array.prototype.splice),Tp=Array.isArray,Ep=Bp(String.prototype.toLowerCase),Dp=Bp(String.prototype.toString),Op=Bp(String.prototype.match),kp=Bp(String.prototype.replace),Ap=Bp(String.prototype.indexOf),jp=Bp(String.prototype.trim),Mp=Bp(Number.prototype.toString),Np=Bp(Boolean.prototype.toString),Pp=typeof BigInt>`u`?null:Bp(BigInt.prototype.toString),Fp=typeof Symbol>`u`?null:Bp(Symbol.prototype.toString),Ip=Bp(Object.prototype.hasOwnProperty),Lp=Bp(Object.prototype.toString),Rp=Bp(RegExp.prototype.test),zp=Vp(TypeError);function Bp(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return vp(e,t,n)}}function Vp(e){return function(){return yp(e,[...arguments])}}function $(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ep;if(up&&up(e,null),!Tp(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(dp(t)||(t[r]=e),i=e)}e[i]=!0}return e}function Hp(e){for(let t=0;t<e.length;t++)Ip(e,t)||(e[t]=null);return e}function Up(e){let t=gp(null);for(let r of lp(e)){var n=op(r,2);let i=n[0],a=n[1];Ip(e,i)&&(t[i]=Tp(a)?Hp(a):a&&typeof a==`object`&&a.constructor===Object?Up(a):a)}return t}function Wp(e){switch(typeof e){case`string`:return e;case`number`:return Mp(e);case`boolean`:return Np(e);case`bigint`:return Pp?Pp(e):`0`;case`symbol`:return Fp?Fp(e):`Symbol()`;case`undefined`:return Lp(e);case`function`:case`object`:{if(e===null)return Lp(e);let t=e,n=Gp(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:Lp(e)}return Lp(e)}default:return Lp(e)}}function Gp(e,t){for(;e!==null;){let n=pp(e,t);if(n){if(n.get)return Bp(n.get);if(typeof n.value==`function`)return Bp(n.value)}e=fp(e)}function n(){return null}return n}function Kp(e){try{return Rp(e,``),!0}catch{return!1}}var qp=mp(`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`.split(`.`)),Jp=mp(`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`.split(`.`)),Yp=mp([`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`]),Xp=mp([`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`]),Zp=mp(`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`.split(`.`)),Qp=mp([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),$p=mp([`#text`]),em=mp(`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`.split(`.`)),tm=mp(`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`.split(`.`)),nm=mp(`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`.split(`.`)),rm=mp([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),im=hp(/{{[\w\W]*|^[\w\W]*}}/g),am=hp(/<%[\w\W]*|^[\w\W]*%>/g),om=hp(/\${[\w\W]*/g),sm=hp(/^data-[\-\w.\u00B7-\uFFFF]+$/),cm=hp(/^aria-[\-\w]+$/),lm=hp(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),um=hp(/^(?:\w+script|data):/i),dm=hp(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),fm=hp(/^html$/i),pm=hp(/^[a-z][.\w]*(-[.\w]+)+$/i),mm=hp(/<[/\w!]/g),hm=hp(/<[/\w]/g),gm=hp(/<\/no(script|embed|frames)/i),_m=hp(/\/>/i),vm={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},ym=[`style`,`script`,`xmp`,`iframe`,`noembed`,`noframes`,`plaintext`,`noscript`],bm=mp($({},ym)),xm=function(){let e={};return bp(ym,t=>{e[t]=hp(RegExp(`</`+t+`(?=[\\t\\n\\f\\r />])`,`i`))}),mp(e)}(),Sm=function(){return typeof window>`u`?null:window},Cm=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},wm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Tm=function(e,t,n,r){return Ip(e,t)&&Tp(e[t])?$(r.base?Up(r.base):{},e[t],r.transform):n},Em=function(e,t,n){let r=Ip(e,t)?e[t]:void 0;return r&&typeof r==`object`?Up(r):n()};function Dm(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Sm(),t=e=>Dm(e);if(t.version=`3.4.16`,t.removed=[],!e||!e.document||e.document.nodeType!==vm.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=Gp(d,`cloneNode`),p=Gp(d,`remove`),m=Gp(d,`removeAttributeNode`),h=Gp(d,`nextSibling`),g=Gp(d,`childNodes`),_=Gp(d,`parentNode`),v=Gp(d,`shadowRoot`),y=Gp(d,`attributes`),b=o&&o.prototype?Gp(o.prototype,`nodeType`):null,x=o&&o.prototype?Gp(o.prototype,`nodeName`):null,ee=o&&o.prototype?Gp(o.prototype,`ownerDocument`):null,S=function(e){return b?b(e):e.nodeType},te=function(e){return x?x(e):e.nodeName};if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let C,ne=``,re,w=!1,ie=0,ae=function(){if(ie>0)throw zp(`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.`)},oe=function(e){ae(),ie++;try{return C.createHTML(e)}finally{ie--}},se=function(e){ae(),ie++;try{return C.createScriptURL(e)}finally{ie--}},ce=function(){return w||=(re=Cm(u,i),!0),re},le=n,ue=le.implementation,de=le.createNodeIterator,fe=le.createDocumentFragment,pe=le.getElementsByTagName,me=r.importNode,T=wm();t.isSupported=typeof lp==`function`&&typeof _==`function`&&ue&&ue.createHTMLDocument!==void 0;let he=im,ge=am,_e=om,ve=sm,E=cm,ye=um,be=dm,xe=pm,Se=lm,D=null,Ce=$({},[...qp,...Jp,...Yp,...Zp,...$p]),O=null,we=$({},[...em,...tm,...nm,...rm]),Te=Object.seal(gp(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}})),Ee=null,k=null,De=Object.seal(gp(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oe=!0,ke=!0,Ae=!1,je=!0,A=!1,Me=!0,Ne=!1,Pe=!1,Fe=null,Ie=null,Le=!1,Re=!1,ze=!1,Be=!1,Ve=!0,He=!1,Ue=`user-content-`,We=!0,Ge=!1,Ke={},qe=null,Je=$({},`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`.split(`.`)),Ye=null,Xe=$({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ze=null,Qe=$({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),$e=`http://www.w3.org/1998/Math/MathML`,et=`http://www.w3.org/2000/svg`,tt=`http://www.w3.org/1999/xhtml`,nt=tt,rt=!1,it=null,at=$({},[$e,et,tt],Dp),ot=mp([`mi`,`mo`,`mn`,`ms`,`mtext`]),st=$({},ot),ct=mp([`annotation-xml`]),lt=$({},ct),ut=$({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],j=null,pt=null,mt=n.createElement(`form`),ht=function(e){return e instanceof RegExp||e instanceof Function},gt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pt&&pt===e)return;(!e||typeof e!=`object`)&&(e={}),e=Up(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,j=dt===`application/xhtml+xml`?Dp:Ep,D=Tm(e,`ALLOWED_TAGS`,Ce,{transform:j}),O=Tm(e,`ALLOWED_ATTR`,we,{transform:j}),it=Tm(e,`ALLOWED_NAMESPACES`,at,{transform:Dp}),Ze=Tm(e,`ADD_URI_SAFE_ATTR`,Qe,{transform:j,base:Qe}),Ye=Tm(e,`ADD_DATA_URI_TAGS`,Xe,{transform:j,base:Xe}),qe=Tm(e,`FORBID_CONTENTS`,Je,{transform:j}),Ee=Tm(e,`FORBID_TAGS`,Up({}),{transform:j}),k=Tm(e,`FORBID_ATTR`,Up({}),{transform:j}),Ke=Ip(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?Up(e.USE_PROFILES):e.USE_PROFILES:!1,Oe=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,A=e.SAFE_FOR_TEMPLATES||!1,Me=e.SAFE_FOR_XML!==!1,Ne=e.WHOLE_DOCUMENT||!1,Re=e.RETURN_DOM||!1,ze=e.RETURN_DOM_FRAGMENT||!1,Be=e.RETURN_TRUSTED_TYPE||!1,Le=e.FORCE_BODY||!1,Ve=e.SANITIZE_DOM!==!1,He=e.SANITIZE_NAMED_PROPS||!1,We=e.KEEP_CONTENT!==!1,Ge=e.IN_PLACE||!1,Se=Kp(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:lm,nt=typeof e.NAMESPACE==`string`?e.NAMESPACE:tt,st=Em(e,`MATHML_TEXT_INTEGRATION_POINTS`,()=>$({},ot)),lt=Em(e,`HTML_INTEGRATION_POINTS`,()=>$({},ct));let t=Em(e,`CUSTOM_ELEMENT_HANDLING`,()=>gp(null));if(Te=gp(null),Ip(t,`tagNameCheck`)&&ht(t.tagNameCheck)&&(Te.tagNameCheck=t.tagNameCheck),Ip(t,`attributeNameCheck`)&&ht(t.attributeNameCheck)&&(Te.attributeNameCheck=t.attributeNameCheck),Ip(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(Te.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),hp(Te),A&&(ke=!1),ze&&(Re=!0),Ke&&(D=$({},$p),O=gp(null),Ke.html===!0&&($(D,qp),$(O,em)),Ke.svg===!0&&($(D,Jp),$(O,tm),$(O,rm)),Ke.svgFilters===!0&&($(D,Yp),$(O,tm),$(O,rm)),Ke.mathMl===!0&&($(D,Zp),$(O,nm),$(O,rm))),De.tagCheck=null,De.attributeCheck=null,Ip(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?De.tagCheck=e.ADD_TAGS:Tp(e.ADD_TAGS)&&(D===Ce&&(D=Up(D)),$(D,e.ADD_TAGS,j))),Ip(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?De.attributeCheck=e.ADD_ATTR:Tp(e.ADD_ATTR)&&(O===we&&(O=Up(O)),$(O,e.ADD_ATTR,j))),Ip(e,`ADD_FORBID_CONTENTS`)&&Tp(e.ADD_FORBID_CONTENTS)&&(qe===Je&&(qe=Up(qe)),$(qe,e.ADD_FORBID_CONTENTS,j)),We&&(D[`#text`]=!0),Ne&&$(D,[`html`,`head`,`body`]),D.table&&($(D,[`tbody`]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw zp(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw zp(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=C;C=e.TRUSTED_TYPES_POLICY;try{ne=oe(``)}catch(e){throw C=t,e}}else e.TRUSTED_TYPES_POLICY===null?(C=void 0,ne=``):(C===void 0&&(C=ce()),C&&typeof ne==`string`&&(ne=oe(``)));mp&&mp(e),pt=e},_t=$({},[...Jp,...Yp,...Xp]),vt=$({},[...Zp,...Qp]),yt=function(e,t,n){return t.namespaceURI===tt?e===`svg`:t.namespaceURI===$e?e===`svg`&&(n===`annotation-xml`||st[n]):!!_t[e]},bt=function(e,t,n){return t.namespaceURI===tt?e===`math`:t.namespaceURI===et?e===`math`&<[n]:!!vt[e]},xt=function(e,t,n){return t.namespaceURI===et&&!lt[n]||t.namespaceURI===$e&&!st[n]?!1:!vt[e]&&(ut[e]||!_t[e])},St=function(e){let t=_(e);(!t||!t.tagName)&&(t={namespaceURI:nt,tagName:`template`});let n=Ep(e.tagName),r=Ep(t.tagName);return it[e.namespaceURI]?e.namespaceURI===et?yt(n,t,r):e.namespaceURI===$e?bt(n,t,r):e.namespaceURI===tt?xt(n,t,r):!!(dt===`application/xhtml+xml`&&it[e.namespaceURI]):!1},Ct=function(e){Cp(t.removed,{element:e});try{_(e).removeChild(e)}catch{if(p(e),!_(e))throw zp(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},wt=function(e,t,n){try{m(e,t)}catch{try{e.removeAttribute(n)}catch{}}},Tt=function(e){Ot(e);let t=g(e);if(t){let e=[];bp(t,t=>{Cp(e,t)}),bp(e,e=>{try{p(e)}catch{}})}let n=y(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;typeof i==`string`&&wt(e,r,i)}},Et=function(e,n,r){if(!r)try{r=n.getAttributeNode(e)}catch{r=null}Cp(t.removed,{attribute:r||null,from:n});try{r?m(n,r):n.removeAttribute(e)}catch{try{n.removeAttribute(e)}catch{}}if(e===`is`){if(Re||ze)try{Ct(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},Dt=function(e){let t=y(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;typeof i!=`string`||O[j(i)]||wt(e,r,i)}},Ot=function(e){let t=[e];for(;t.length>0;){let e=t.pop();S(e)===vm.element&&Dt(e);let n=g(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},kt=function(e,t){return Me?e===`patchsrc`||e===`for`&&t!==`label`&&t!==`output`:!1},At=function(e){if(!Me)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=S(e);if(n===vm.processingInstruction||n===vm.comment&&Rp(hm,e.data)){try{p(e)}catch{}continue}if(n===vm.element){let t=e,n=j(te(e));try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&kt(`for`,n)&&t.removeAttribute(`for`)}catch{}}let r=g(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},jt=function(e){let t=null,r=null;if(Le)e=`<remove></remove>`+e;else{let t=Op(e,/^[\r\n\t ]+/);r=t&&t[0]}dt===`application/xhtml+xml`&&nt===tt&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=C?oe(e):e;if(nt===tt)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=ue.createDocument(nt,`template`,null);try{t.documentElement.innerHTML=rt?ne:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),nt===tt?pe.call(t,Ne?`html`:`body`)[0]:Ne?t.documentElement:a},Mt=function(e){let t=ee?ee(e):e.ownerDocument;return de.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},Nt=function(e){return e=kp(e,he,` `),e=kp(e,ge,` `),e=kp(e,_e,` `),e},Pt=function(e){e.normalize();let t=ee?ee(e):e.ownerDocument,n=de.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=Nt(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&bp(i,e=>{It(e.content)&&Pt(e.content)})},Ft=function(e){let t=x?x(e):null;return typeof t!=`string`||j(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==y(e)||typeof e.removeAttribute!=`function`||typeof e.removeAttributeNode!=`function`||typeof e.getAttributeNode!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==b(e)||e.childNodes!==g(e)},It=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return b(e)===vm.documentFragment}catch{return!1}},Lt=function(e){if(!b||typeof e!=`object`||!e)return!1;try{return typeof b(e)==`number`}catch{return!1}};function Rt(e,n,r){e.length!==0&&bp(e,e=>{e.call(t,n,r,pt)})}let zt=function(e,t){return!!(Me&&e.hasChildNodes()&&!Lt(e.firstElementChild)&&Rp(mm,e.textContent)&&Rp(mm,e.innerHTML)||Me&&e.namespaceURI===tt&&bm[t]&&(Lt(e.firstElementChild)||typeof e.textContent==`string`&&Rp(xm[t],e.textContent))||e.nodeType===vm.processingInstruction||Me&&e.nodeType===vm.comment&&Rp(hm,e.data))},Bt=function(e,t){return e instanceof RegExp?Rp(e,t):e instanceof Function&&!!e(t,...[...arguments].slice(2))},Vt=function(e,t,n){if(!Ee[t]&&M(t)&&Bt(Te.tagNameCheck,t))return!1;if(We&&!qe[t]){let t=_(e),r=g(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,h(e))}}}return Ct(e),!0},Ht=function(e,t,n,r){return e.length===0?t:t===n||t===r?Up(t):t},Ut=function(e,t){return e===t||_(e)!==null?!1:(Ge&&Ot(e),!0)},Wt=function(e,n){if(Rt(T.beforeSanitizeElements,e,null),Ut(e,n))return!0;if(Ft(e))return Ct(e),!0;let r=j(te(e));if(D=Ht(T.uponSanitizeElement,D,Ce,Fe),Rt(T.uponSanitizeElement,e,{tagName:r,allowedTags:D}),Ut(e,n))return!0;if(zt(e,r))return Ct(e),!0;if(Ee[r]||!(De.tagCheck instanceof Function&&De.tagCheck(r))&&!D[r]){let t=Vt(e,r,n);return t===!1&&(Rt(T.afterSanitizeElements,e,null),Ut(e,n))?!0:t}if(S(e)===vm.element&&!St(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&Rp(gm,e.innerHTML))return Ct(e),!0;if(A&&e.nodeType===vm.text){let n=Nt(e.textContent);e.textContent!==n&&(Cp(t.removed,{element:e.cloneNode()}),e.textContent=n)}return Rt(T.afterSanitizeElements,e,null),Ut(e,n)},Gt=function(e,t,r){if(k[t]||kt(t,e)||Ve&&(t===`id`||t===`name`)&&(r in n||r in mt))return!1;let i=O[t]||De.attributeCheck instanceof Function&&De.attributeCheck(t,e);return ke&&Rp(ve,t)||Oe&&Rp(E,t)?!0:i?Ze[t]||Rp(Se,kp(r,be,``))||(t===`src`||t===`xlink:href`||t===`href`)&&e!==`script`&&Ap(r,`data:`)===0&&Ye[e]||Ae&&!Rp(ye,kp(r,be,``))?!0:!r:M(e)&&Bt(Te.tagNameCheck,e)&&Bt(Te.attributeNameCheck,t,e)||t===`is`&&Te.allowCustomizedBuiltInElements&&Bt(Te.tagNameCheck,r)},Kt=$({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),M=function(e){return!Kt[Ep(e)]&&Rp(xe,e)},qt=function(e,t,n,r){if(C&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return oe(r);case`TrustedScriptURL`:return se(r)}return r},Jt=function(e,t,n,r){try{return n?e.setAttributeNS(n,t,r):e.setAttribute(t,r),!Ft(e)||(Ct(e),!1)}catch{return Et(t,e),!1}},Yt=function(e,n){if(Rt(T.beforeSanitizeAttributes,e,null),Ut(e,n))return;let r=e.attributes;if(!r||Ft(e))return;O=Ht(T.uponSanitizeAttribute,O,we,Ie);let i={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:O,forceKeepAttr:void 0},a=r.length,o=j(e.nodeName);for(;a--;){let n=r[a],s=n.name,c=n.namespaceURI,l=n.value,u=j(s),d=l,f=s===`value`?d:jp(d),p=!1;if(i.attrName=u,i.attrValue=f,i.keepAttr=!0,i.forceKeepAttr=void 0,Rt(T.uponSanitizeAttribute,e,i),f=i.attrValue,He&&(u===`id`||u===`name`)&&Ap(f,Ue)!==0&&(Et(s,e,n),f=Ue+f,p=!0),Me&&Rp(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,f)){Et(s,e,n);continue}if(u===`attributename`&&Op(f,`href`)){Et(s,e,n);continue}if(!i.forceKeepAttr){if(!i.keepAttr){Et(s,e,n);continue}if(!je&&Rp(_m,f)){Et(s,e,n);continue}if(A&&(f=Nt(f)),!Gt(o,u,f)){Et(s,e,n);continue}f=qt(o,u,c,f),f!==d&&Jt(e,s,c,f)&&p&&Sp(t.removed)}}Rt(T.afterSanitizeAttributes,e,null),Ut(e,n)},Xt=function(e){let t=null,n=Mt(e);for(Rt(T.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if(Rt(T.uponSanitizeShadowNode,t,null),Wt(t,e),Yt(t,e),It(t.content)&&Xt(t.content),S(t)===vm.element){let e=v(t);It(e)&&(N(e),Xt(e))}Rt(T.afterSanitizeShadowDOM,e,null)},N=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){Xt(e.shadow);continue}let n=e.node,r=S(n)===vm.element,i=g(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=x?x(n):null;if(typeof e==`string`&&j(e)===`template`){let e=n.content;It(e)&&t.push({node:e,shadow:null})}}if(r){let e=v(n);It(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(rt=!e,rt&&(e=`<!-->`),typeof e!=`string`&&!Lt(e)&&(e=Wp(e),typeof e!=`string`))throw zp(`dirty is not a string, aborting`);if(!t.isSupported)return e;Pe?(D=Fe,O=Ie):gt(n),(T.uponSanitizeElement.length>0||T.uponSanitizeAttribute.length>0)&&(D=Up(D)),T.uponSanitizeAttribute.length>0&&(O=Up(O)),t.removed=[];let c=Ge&&typeof e!=`string`&&Lt(e);if(c){At(e);let t=te(e);if(typeof t==`string`){let n=j(t);if(!D[n]||Ee[n])throw Tt(e),zp(`root node is forbidden and cannot be sanitized in-place`)}if(Ft(e))throw Tt(e),zp(`root node is clobbered and cannot be sanitized in-place`);try{N(e)}catch(t){throw Tt(e),t}}else if(Lt(e))i=jt(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===vm.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),N(i);else{if(!Re&&!A&&!Ne&&e.indexOf(`<`)===-1)return C&&Be?oe(e):e;if(i=jt(e),!i)return Re?null:Be?ne:``}i&&Le&&Ct(i.firstChild);let l=c?e:i;try{let e=Mt(l);for(;o=e.nextNode();)Wt(o,l),Yt(o,l),It(o.content)&&Xt(o.content)}catch(n){throw c&&(Tt(e),bp(t.removed,e=>{e.element&&Ot(e.element)})),n}if(c){let n=!1;if(bp(t.removed,t=>{t.element&&(t.element===e&&(n=!0),Ot(t.element))}),n)throw zp(`a node selected for removal could not be safely returned; refusing to sanitize in place`);return A&&Pt(e),e}if(Re){if(A&&Pt(i),ze)for(s=fe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(O.shadowroot||O.shadowrootmode)&&(s=me.call(r,s,!0)),s}let u=Ne?i.outerHTML:i.innerHTML;return Ne&&D[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&Rp(fm,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
|
|
75
|
-
`+u),A&&(u=Nt(u)),C&&Be?oe(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};gt(e),Pe=!0,Fe=D,Ie=O},t.clearConfig=function(){pt=null,Pe=!1,Fe=null,Ie=null,C=re,ne=``},t.isValidAttribute=function(e,t,n){pt||gt({});let r=j(e),i=j(t);return Gt(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&Ip(T,e)&&Cp(T[e],t)},t.removeHook=function(e,t){if(Ip(T,e)){if(t!==void 0){let n=xp(T[e],t);return n===-1?void 0:wp(T[e],n,1)[0]}return Sp(T[e])}},t.removeHooks=function(e){Ip(T,e)&&(T[e]=[])},t.removeAllHooks=function(){T=wm()},t}var Om=Dm();function km(e,t){let n;try{n=new URL(e.trim())}catch{return null}return n.protocol!==`https:`&&n.protocol!==`http:`||n.origin===t?null:n.href}var Am=`p.br.hr.strong.b.em.i.del.s.code.pre.blockquote.ul.ol.li.a.h1.h2.h3.h4.h5.h6.small.sub.sup.table.thead.tbody.tr.th.td.img.input`.split(`.`),jm=[`form`,`style`,`script`,`button`,`select`,`textarea`,`iframe`,`object`,`embed`,`svg`,`math`],Mm={a:[`href`,`title`],img:[`src`,`alt`,`title`],th:[`colspan`,`rowspan`,`align`],td:[`colspan`,`rowspan`,`align`],ol:[`start`],code:[`class`],input:[`type`,`checked`,`disabled`]},Nm=[...new Set(Object.values(Mm).flat())],Pm=/^language-[\w-]+$/,Fm=/^\d{1,4}$/,Im=/^(left|right|center)$/i;function Lm(e,t,n){if(!Object.hasOwn(Mm,e)||!Mm[e].includes(t))return!1;switch(t){case`class`:return Pm.test(n);case`type`:return n.toLowerCase()===`checkbox`;case`colspan`:case`rowspan`:case`start`:return Fm.test(n);case`align`:return Im.test(n);default:return!0}}var Rm=/^data:image\/(png|jpeg|gif|webp);base64,[A-Za-z0-9+/]+={0,2}$/i,zm=/^\/api(\/|$)/i;function Bm(e,t){if(Rm.test(e))return!0;if(!e.trim())return!1;let n;try{n=new URL(e,t)}catch{return!1}return(n.protocol===`https:`||n.protocol===`http:`)&&n.origin===t&&!zm.test(n.pathname)}Om.isSupported&&Om.addHook(`afterSanitizeAttributes`,e=>{let t=e.nodeName.toLowerCase();for(let{name:n,value:r}of Array.from(e.attributes))Lm(t,n,r)||e.removeAttribute(n);if(t===`img`&&!Bm(e.getAttribute(`src`)??``,location.origin)){e.replaceWith(document.createTextNode(e.getAttribute(`alt`)??``));return}if(t===`input`){e.getAttribute(`type`)===null?e.remove():e.setAttribute(`disabled`,``);return}if(t!==`a`)return;let n=e.getAttribute(`href`),r=n===null?null:km(n,location.origin);r?(e.setAttribute(`href`,r),e.setAttribute(`target`,`_blank`),e.setAttribute(`rel`,`noopener noreferrer`)):(e.removeAttribute(`href`),e.removeAttribute(`target`))});var Vm={ALLOWED_TAGS:Am,ALLOWED_ATTR:Nm,FORBID_TAGS:jm,ALLOW_DATA_ATTR:!1,ALLOW_ARIA_ATTR:!1},Hm=new Map;function Um(e){let t=Hm.get(e);return t===void 0&&(t=Om.sanitize(Q.parse(e,{async:!1}),Vm),Hm.size>400&&Hm.delete(Hm.keys().next().value),Hm.set(e,t)),t}var Wm=`demo.job-runs`,Gm=e=>e.status!==`running`&&e.status!==`waiting`,Km=G(()=>ql.value?.info?.jobs??[]),qm=e=>Km.value.find(t=>t.id===e),Jm=G(()=>{let e=Y.value.docs[Wm];return Object.values(e?.items??{}).sort((e,t)=>t.id-e.id)}),Ym=e=>Jm.value.find(t=>t.id===e),Xm=e=>Jm.value.find(t=>t.toolCallId===e),Zm=N(Date.now());setInterval(()=>Zm.value=Date.now(),1e3);var Qm=e=>e<1e3?`${Math.max(0,Math.round(e))}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`,$m=N();async function eh(e,t){if(!$m.value){$m.value=e;try{return await bu(t)}finally{$m.value=void 0}}}function th(e){ku.value&&Mu(),setTimeout(()=>document.querySelector(`[data-job-run="${e}"]`)?.scrollIntoView({behavior:`smooth`,block:`center`}))}async function nh(e){let t=await eh(`start:${e.id}`,()=>J.value.demo(`jobs`,{job:e.id}));t&&(yu(`${e.title} started. It runs in the chat.`),th(t.taskId))}var rh=(e,t)=>eh(`decide:${e.id}`,()=>J.value.demo(`jobs/${e.id}/approval`,{approved:t})),ih=e=>eh(`stop:${e.id}`,()=>eu.value.abortTask(e.id));function ah(e){q.value&&tu({...q.value,agentId:e})}var oh=[`data-job-run`,`aria-label`],sh={class:`job-run-head`},ch={class:`job-run-icon`},lh={class:`job-run-titles`},uh={class:`job-run-eyebrow`},dh={class:`job-run-repeat`},fh={key:0,class:`job-run-about`},ph={class:`job-run-meta`},mh={key:0,class:`job-run-resumed`},hh={class:`job-stepper`,"aria-label":`Phases`},gh=[`aria-current`],_h={class:`job-chip`},vh={class:`job-step-dot`},yh={class:`job-step-label`},bh={key:0,class:`job-step-progress`},xh={class:`job-phases`},Sh=[`open`],Ch={class:`job-phase-n`},wh={class:`job-phase-summary`},Th={class:`job-phase-time`},Eh={key:0,class:`job-phase-about`},Dh={key:1,class:`job-steps`},Oh=[`open`],kh={key:1,class:`job-step-line`},Ah=[`onClick`],jh={key:2,class:`job-phase-empty`},Mh={key:1,class:`job-approval`,role:`group`,"aria-label":`Approval`},Nh={class:`job-approval-buttons`},Ph=[`disabled`],Fh=[`disabled`],Ih={key:2,class:`message-error`},Lh={class:`job-run-foot`},Rh=[`disabled`],zh=F({__name:`JobCard`,props:{run:{}},setup(e){let t=e,n=G(()=>qm(t.run.job)),r=G(()=>Gm(t.run)),i=G(()=>Qm((t.run.endedAt??Zm.value)-t.run.startedAt)),a={running:`Running`,waiting:`Waiting for you`,completed:`Completed`,failed:`Failed`,aborted:`Stopped`,declined:`Declined`},o={command:Ac,tool:Ic,agent:zs,state:Bs,approval:Oc,checkpoint:Qs,note:lc},s=e=>e.kind===`tool`?`${e.label}: a subagent tool call, its own durable task`:e.label,c=e=>{let t=e.step,n=[`command`,`tool`,`state`].includes(t.kind)?eo(`code`,{title:s(t)},t.label):eo(`span`,{class:`job-step-text`},t.label),r=t.status===`running`?eo(uc,{size:15,class:`spin`}):t.status===`done`?eo(Hs,{size:15}):t.status===`waiting`?eo(nc,{size:15}):eo(Lc,{size:15});return[eo(o[t.kind],{size:16,class:`job-step-kind`}),n,t.kind===`tool`&&t.detail?eo(`span`,{class:`job-step-args`,title:t.detail},t.detail):null,eo(`span`,{class:`job-step-state`},[r,t.ms!==void 0&&t.kind!==`note`?eo(`span`,Qm(t.ms)):null])]};c.props=[`step`];let l=e=>n.value?.phases.find(t=>t.id===e),u=e=>e.startedAt?Qm((e.endedAt??(e.status===`running`||e.status===`waiting`?Zm.value:e.startedAt))-e.startedAt):``,d=e=>e.status!==`pending`&&e.status!==`skipped`,f=G(()=>Object.entries(t.run.input)),p=G(()=>t.run.phases.find(e=>e.status===`waiting`));return(t,o)=>(R(),z(`article`,{class:E([`job-run`,`is-${e.run.status}`]),"data-job-run":e.run.id,"aria-label":`${e.run.title} run ${e.run.run}: ${a[e.run.status]}`},[V(`header`,sh,[V(`span`,ch,[H(P(Fc),{size:22})]),V(`div`,lh,[V(`div`,uh,[o[3]||=V(`span`,null,`DURABLE JOB`,-1),V(`span`,dh,[H(P(Tc),{size:15}),U(`Repeatable workflow, run #`+k(e.run.run),1)])]),V(`h3`,null,k(e.run.title),1)]),V(`span`,{class:E([`job-run-status`,e.run.status])},[o[4]||=V(`i`,null,null,-1),U(k(a[e.run.status]),1)],2)]),n.value?(R(),z(`p`,fh,k(n.value.summary),1)):W(``,!0),V(`div`,ph,[V(`span`,null,`task #`+k(e.run.id),1),V(`span`,null,k(e.run.startedBy===`agent`?`started by the agent`:`started by you`),1),V(`span`,null,k(i.value),1),(R(!0),z(L,null,I(f.value,([e,t])=>(R(),z(`span`,{key:e,class:`job-run-input`},k(e)+`=`+k(t),1))),128)),e.run.resumed?(R(),z(`span`,mh,`resumed `+k(e.run.resumed)+`× after restart`,1)):W(``,!0)]),V(`ol`,hh,[(R(!0),z(L,null,I(e.run.phases,(t,n)=>(R(),z(`li`,{key:t.id,class:E(`ph-${t.status}`),"aria-current":e.run.phase===t.id&&!r.value?`step`:void 0},[V(`span`,_h,[V(`span`,vh,[t.status===`done`?(R(),B(P(Hs),{key:0,size:15})):t.status===`running`?(R(),B(P(uc),{key:1,size:15,class:`spin`})):t.status===`waiting`?(R(),B(P(nc),{key:2,size:15})):[`failed`,`aborted`].includes(t.status)?(R(),B(P(Lc),{key:3,size:15})):(R(),z(L,{key:4},[U(k(n+1),1)],64))]),V(`span`,yh,k(t.label),1),t.progress?(R(),z(`span`,bh,k(t.progress.done)+`/`+k(t.progress.total),1)):W(``,!0)])],10,gh))),128))]),V(`div`,xh,[(R(!0),z(L,null,I(e.run.phases,(e,t)=>(R(),z(`details`,{key:e.id,class:E([`job-phase`,`ph-${e.status}`]),open:d(e)},[V(`summary`,null,[V(`span`,Ch,k(t+1),1),V(`strong`,null,k(e.label),1),V(`span`,wh,k(e.summary??(e.status===`pending`?l(e.id)?.summary:e.status===`skipped`?`Skipped`:``)),1),V(`span`,Th,k(u(e)),1)]),e.status===`done`?W(``,!0):(R(),z(`p`,Eh,k(l(e.id)?.summary),1)),e.steps.length?(R(),z(`ul`,Dh,[(R(!0),z(L,null,I(e.steps,e=>(R(),z(`li`,{key:e.id,class:E([`k-${e.kind}`,`st-${e.status}`])},[e.detail&&e.kind!==`tool`?(R(),z(`details`,{key:0,open:e.status===`error`},[V(`summary`,null,[H(c,{step:e},null,8,[`step`])]),V(`pre`,null,k(e.detail),1)],8,Oh)):(R(),z(`div`,kh,[H(c,{step:e},null,8,[`step`])])),e.kind===`agent`&&e.conversationId?(R(),z(`button`,{key:2,class:`text-button job-step-link`,onClick:t=>P(ah)(e.conversationId)},` Open subagent #`+k(e.conversationId),9,Ah)):W(``,!0)],2))),128))])):e.status===`pending`?(R(),z(`p`,jh,`Not started yet.`)):W(``,!0)],10,Sh))),128))]),e.run.approval===`pending`?(R(),z(`div`,Mh,[V(`div`,null,[H(P(Oc),{size:20}),o[5]||=V(`strong`,null,`Approve to continue`,-1)]),V(`p`,null,k(p.value?l(p.value.id)?.summary:`This run waits for you`)+`. It is paused on a saved checkpoint: close the browser or restart the device and the decision will still be waiting. `,1),V(`div`,Nh,[V(`button`,{class:`primary small`,disabled:!!P($m),onClick:o[0]||=t=>P(rh)(e.run,!0)},[H(P(Hs),{size:18}),o[6]||=U(`Approve & continue `,-1)],8,Ph),V(`button`,{class:`secondary`,disabled:!!P($m),onClick:o[1]||=t=>P(rh)(e.run,!1)},`Decline`,8,Fh)])])):W(``,!0),e.run.error&&e.run.status!==`aborted`?(R(),z(`p`,Ih,k(e.run.error),1)):W(``,!0),V(`footer`,Lh,[V(`span`,null,k(e.run.background?`Runs in the background: the conversation owns it, so Interrupt leaves it running.`:`Owned by this tool call: Interrupt stops it.`)+` Each phase saves a checkpoint, so a restart resumes the current phase.`,1),r.value?W(``,!0):(R(),z(`button`,{key:0,class:`secondary danger`,disabled:!!P($m),onClick:o[2]||=t=>P(ih)(e.run)},[H(P(hc),{size:16}),o[7]||=U(`Stop `,-1)],8,Rh))])],10,oh))}}),Bh={class:`message-label`},Vh={class:`user-message`},Hh={class:`message-label`},Uh={key:0,class:`streaming`},Wh={key:1},Gh=[`aria-label`],Kh=[`innerHTML`],qh={key:1,class:`thinking`},Jh=[`data-call-id`],Yh={class:`tool-status`},Xh={class:`tool-section-label`},Zh=[`aria-label`,`onClick`],Qh={key:0,class:`typing`},$h={key:1,class:`message-error`},eg=[`aria-label`],tg={key:3,class:`live-tool`},ng={key:0},rg={class:`event-line`},ig=[`aria-label`],ag={key:0,class:`raw`},og=F({__name:`TranscriptItem`,props:{item:{}},emits:[`fork`],setup(e,{emit:t}){let n=t,r=e=>e.status===`error`?`Error`:e.status===`done`?`Done`:e.status,i=e=>e.kind===`user`?`pi-user`:e.kind===`assistant`?e.streaming?`live-generation`:`pi-assistant`:e.kind===`tool-result`?`pi-tool-result`:e.kind===`tool`?`live-tool-entry`:e.entryKind.replaceAll(`.`,`-`);return(t,a)=>(R(),z(`article`,{class:E([`entry`,i(e.item)])},[e.item.kind===`user`?(R(),z(L,{key:0},[V(`div`,Bh,[a[3]||=U(` YOU `,-1),V(`span`,null,`#`+k(e.item.id),1)]),V(`div`,Vh,k(e.item.text),1)],64)):e.item.kind===`assistant`?(R(),z(L,{key:1},[V(`div`,Hh,[a[5]||=U(` AGENT `,-1),e.item.streaming?(R(),z(`span`,Uh,`Working`)):(R(),z(`span`,Wh,`#`+k(e.item.id),1)),e.item.streaming?W(``,!0):(R(),z(`button`,{key:2,class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,title:`Fork from this entry. App State stays shared.`,onClick:a[0]||=t=>n(`fork`,e.item.id)},[H(P(tc),{size:18}),a[4]||=U(`Fork `,-1)],8,Gh))]),(R(!0),z(L,null,I(e.item.blocks,(e,t)=>(R(),z(L,{key:t},[e.type===`text`?(R(),z(`div`,{key:0,class:`markdown`,innerHTML:P(Um)(e.text)},null,8,Kh)):e.type===`thinking`?(R(),z(`details`,qh,[a[6]||=V(`summary`,null,`Thinking`,-1),V(`div`,null,k(e.text),1)])):(R(),z(`details`,{key:2,class:E([`tool-call`,{failed:e.call.status===`error`}]),"data-call-id":e.call.callId},[V(`summary`,null,[e.call.status===`error`?(R(),B(P(ic),{key:0,size:18})):e.call.status===`done`?(R(),B(P(Hs),{key:1,size:18})):e.call.status===`running`?(R(),B(P(Fs),{key:2,size:18})):(R(),B(P(Ic),{key:3,size:18})),V(`strong`,null,k(e.call.name),1),V(`code`,null,k(P(Cu)(e.call.args)?.slice(0,90)),1),V(`span`,Yh,k(r(e.call)),1)]),a[10]||=V(`div`,{class:`tool-section-label`},`Input`,-1),V(`pre`,null,k(P(Cu)(e.call.args)),1),e.call.result===void 0?e.call.output?(R(),z(L,{key:1},[a[9]||=V(`div`,{class:`tool-section-label`},`Live output`,-1),V(`pre`,null,k(e.call.output),1)],64)):W(``,!0):(R(),z(L,{key:0},[V(`div`,Xh,[a[8]||=V(`span`,null,`Result`,-1),e.call.resultEntryId===void 0?W(``,!0):(R(),z(`button`,{key:0,class:`fork-button`,"aria-label":`Fork at entry ${e.call.resultEntryId}`,title:`Fork after this result`,onClick:t=>n(`fork`,e.call.resultEntryId)},[H(P(tc),{size:18}),a[7]||=U(`Fork `,-1)],8,Zh))]),V(`pre`,null,k(e.call.result),1)],64))],10,Jh)),e.type===`tool`&&e.call.name===`run_durable_job`&&P(Xm)(e.call.callId)?(R(),B(zh,{key:3,run:P(Xm)(e.call.callId)},null,8,[`run`])):W(``,!0)],64))),128)),e.item.streaming&&!e.item.blocks.length?(R(),z(`div`,Qh,[...a[11]||=[V(`i`,null,null,-1),V(`i`,null,null,-1),V(`i`,null,null,-1)]])):W(``,!0),e.item.error?(R(),z(`div`,$h,k(e.item.error),1)):W(``,!0)],64)):e.item.kind===`tool-result`?(R(),z(`details`,{key:2,class:E([`tool-result`,{failed:e.item.isError}])},[V(`summary`,null,[e.item.isError?(R(),B(P(ic),{key:1,size:18})):(R(),B(P(Hs),{key:0,size:18})),V(`strong`,null,k(e.item.name),1),V(`span`,null,k(e.item.isError?`error`:`result`),1),V(`button`,{class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,onClick:a[1]||=Cs(t=>n(`fork`,e.item.id),[`prevent`])},[H(P(tc),{size:18}),a[12]||=U(`Fork `,-1)],8,eg)]),V(`pre`,null,k(e.item.text),1)],2)):e.item.kind===`tool`?(R(),z(`div`,tg,[V(`div`,null,[H(P(Fs),{size:18}),V(`strong`,null,k(e.item.call.name),1),V(`span`,null,k(e.item.call.status),1)]),e.item.call.output?(R(),z(`pre`,ng,k(e.item.call.output),1)):W(``,!0),e.item.call.name===`run_durable_job`&&P(Xm)(e.item.call.callId)?(R(),B(zh,{key:1,run:P(Xm)(e.item.call.callId)},null,8,[`run`])):W(``,!0)])):e.item.entryKind===`demo.job`&&P(Ym)(e.item.data.taskId)?(R(),B(zh,{key:4,run:P(Ym)(e.item.data.taskId)},null,8,[`run`])):(R(),z(L,{key:5},[V(`div`,rg,[e.item.entryKind===`demo.state-change`?(R(),B(P(Bs),{key:0,size:18})):(R(),B(P(sc),{key:1,size:18})),V(`span`,null,k(e.item.text),1),V(`button`,{class:`fork-button`,"aria-label":`Fork at entry ${e.item.id}`,onClick:a[2]||=t=>n(`fork`,e.item.id)},[H(P(tc),{size:18}),a[13]||=U(`Fork `,-1)],8,ig)]),e.item.note?(R(),z(`details`,ag,[a[14]||=V(`summary`,null,`Context note`,-1),V(`pre`,null,k(e.item.note),1)])):W(``,!0)],64))],2))}}),sg=()=>globalThis.crypto?.randomUUID?.()??`${Date.now()}-${Math.random().toString(36).slice(2)}`,cg=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],lg={enabled:!0,reserveTokens:16384,backgroundTokens:32768,keepRecentTokens:2e3},ug={auto:2e5,wait:25e4};function dg(e){if(!(e>0))return{...lg};let t=Math.min(ug.wait,e-lg.reserveTokens),n=Math.min(ug.auto,t-lg.backgroundTokens);return{...lg,reserveTokens:e-t,backgroundTokens:t-n}}function fg(e,t){let n=Math.max(0,e-t.reserveTokens);return{wait:n,auto:t.backgroundTokens>0?Math.max(0,n-t.backgroundTokens):void 0}}var pg=(e,t)=>{if(e===void 0)throw Error(`No ${t} selected`);return e},mg=[{name:`compact`,args:`[instructions]`,description:`Summarize older context; stored entries stay`,run:async e=>{await pg(J.value,`agent`).compact(e||void 0),yu(`Compaction requested. /tasks shows its outcome.`)}},{name:`reset`,args:`[handoff note]`,description:`Start a fresh context; history stays stored`,run:async e=>{await pg(J.value,`agent`).reset(e||void 0),yu(`New context started.`)}},{name:`tasks`,description:`Open the Tasks panel`,run:()=>ju(`tasks`)},{name:`new`,args:`[name]`,description:`New agent in this workspace`,run:async e=>{let t=pg(q.value,`workspace`),n=await pg(eu.value,`workspace`).createAgent(e?{name:e}:{});tu({...t,agentId:n.id}),yu(`New agent ${n.name}.`)}},{name:`fork`,args:`[entryId] [name]`,description:`Fork at an entry (default: the last reply)`,run:async e=>{let[t,...n]=e.split(/\s+/).filter(Boolean),r=t&&/^\d+$/.test(t)?Number(t):void 0,i=(r===void 0?[t,...n]:n).filter(Boolean).join(` `),a=r??Y.value.entries.filter(e=>e.kind===`pi.assistant`).at(-1)?.id;if(a===void 0)throw Error(`Nothing to fork yet`);let o=pg(q.value,`agent`),s=await pg(J.value,`agent`).fork({entryId:a,name:i||void 0});tu({...o,agentId:s.id}),yu(`Forked at entry #${a}. App State stays shared.`)}},{name:`name`,args:`<name>`,description:`Rename this agent`,run:async e=>{if(!e)throw Error(`Usage: /name <name>`);await pg(J.value,`agent`).rename(e),yu(`Agent renamed to ${e}.`)}},{name:`model`,description:`Choose this agent's model`,run:()=>X.dialog={kind:`models`}},{name:`thinking`,args:`<level>`,description:`Thinking level: ${cg.join(`, `)}`,run:async e=>{if(!cg.includes(e))throw Error(`Levels: ${cg.join(`, `)}`);await pg(J.value,`agent`).configure({thinkingLevel:e}),await _u(),yu(`Thinking ${e}. Used on the next turn.`)}},{name:`help`,description:`How this works, keys and commands`,run:()=>X.dialog={kind:`help`}}];function hg(e){let t=e.trim().match(/^\/(\S+)\s*([\s\S]*)$/),n=t&&mg.find(e=>e.name===t[1]);return n?{command:n,arg:t[2].trim()}:void 0}var gg={class:`composer-region`},_g={key:0,class:`queue`},vg=[`aria-label`,`onClick`],yg={class:`composer`},bg={key:0,class:`slash-menu`,role:`listbox`,"aria-label":`Slash commands`},xg=[`aria-selected`,`onMousedown`],Sg={key:0,class:`slash-args`},Cg={class:`slash-desc`},wg={class:`composer-toolbar`},Tg={class:`composer-left`},Eg={class:`queue-mode`},Dg={class:`composer-right`},Og=[`disabled`],kg=[`disabled`],Ag=F({__name:`Composer`,setup(e){let t=N(`followUp`),n=N(!1),r=G(()=>Jl.value&&Y.value.ready&&Xl.status.value===`live`&&zl.value===`live`),i=N(0),a=N(!1),o=G(()=>{let e=X.composer.match(/^\/(\S*)$/);return e&&!a.value?mg.filter(t=>t.name.startsWith(e[1].toLowerCase())):[]});Wn(()=>X.composer,()=>{i.value=0,X.composer.startsWith(`/`)||(a.value=!1)});async function s(e,t=!1){!e.args||t&&e.args.startsWith(`[`)&&X.composer===`/${e.name}`?(X.composer=`/${e.name}`,await u()):X.composer=`/${e.name} `}function c(e){if(!o.value.length){e.key===`Enter`&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),u());return}if(e.key===`ArrowDown`||e.key===`ArrowUp`){let t=o.value.length;i.value=(i.value+(e.key===`ArrowDown`?1:t-1))%t}else if(e.key===`Tab`||e.key===`Enter`&&!e.shiftKey)s(o.value[i.value],e.key===`Enter`);else if(e.key===`Escape`)a.value=!0;else return;e.preventDefault(),e.stopPropagation()}async function l(e){let t=hg(e);return t?(n.value=!0,await bu(async()=>{await t.command.run(t.arg),X.composer=``}),n.value=!1,!0):!1}async function u(){let e=X.composer.trim(),i=J.value;if(!e||n.value||!i||!r.value||e.startsWith(`/`)&&await l(e))return;n.value=!0;let a=q.value,o=`${a.deviceId}/${a.sessionId}/${a.agentId}`,s;try{s=JSON.parse(sessionStorage.getItem(`dpi.pending-send`)??`null`)}catch{}let c=s?.key===o&&s.content===e&&s.mode===t.value?s.requestId:sg();sessionStorage.setItem(`dpi.pending-send`,JSON.stringify({key:o,content:e,mode:t.value,requestId:c})),await bu(async()=>{await i.send(e,t.value,c),sessionStorage.removeItem(`dpi.pending-send`),X.composer=``}),n.value=!1}function d(e){bu(()=>J.value.withdraw(e))}return(e,a)=>(R(),z(`div`,gg,[P(Y).inbox.length?(R(),z(`div`,_g,[(R(!0),z(L,null,I(P(Y).inbox,e=>(R(),z(`div`,{key:e.id},[H(P(qs),{size:18}),V(`span`,null,k(e.mode===`steer`?`Steer`:`Queued`)+`: `+k(e.content??`Context update`),1),V(`button`,{class:`icon-button`,"aria-label":`Withdraw submission ${e.id}`,title:`Withdraw queued input`,onClick:t=>d(e.id)},[H(P(Lc),{size:18})],8,vg)]))),128))])):W(``,!0),V(`div`,yg,[o.value.length?(R(),z(`ul`,bg,[(R(!0),z(L,null,I(o.value,(e,t)=>(R(),z(`li`,{key:e.name,role:`option`,"aria-selected":t===i.value,class:E({active:t===i.value}),onMousedown:Cs(t=>s(e),[`prevent`])},[V(`code`,null,`/`+k(e.name),1),e.args?(R(),z(`span`,Sg,k(e.args),1)):W(``,!0),V(`span`,Cg,k(e.description),1)],42,xg))),128))])):W(``,!0),Ln(V(`textarea`,{"onUpdate:modelValue":a[0]||=e=>P(X).composer=e,rows:`2`,placeholder:`Give your agent something to do, or type / for commands…`,"aria-label":`Message your agent`,onKeydown:c},null,544),[[ps,P(X).composer]]),V(`div`,wg,[V(`div`,Tg,[V(`div`,Eg,[Ln(V(`select`,{"onUpdate:modelValue":a[1]||=e=>t.value=e,"aria-label":`When busy`,title:`Follow-up waits for this run. Steer joins after a tool round.`},[...a[3]||=[V(`option`,{value:`followUp`},`Follow-up`,-1),V(`option`,{value:`steer`},`Steer`,-1),V(`option`,{value:`reject`},`Reject if busy`,-1)]],512),[[gs,t.value]]),H(P(Us),{size:24,"aria-hidden":`true`})])]),V(`div`,Dg,[V(`button`,{class:`interrupt`,disabled:!P(fu)||P(Eu),title:`Stop foreground work and owned subagents (Escape). Background jobs continue.`,onClick:a[2]||=(...e)=>P(Du)&&P(Du)(...e)},[H(P(hc),{size:24,class:`stop-sign`,fill:`currentColor`}),a[4]||=U(`Interrupt`,-1)],8,Og),V(`button`,{class:`send`,"aria-label":`Send message`,disabled:!P(X).composer.trim()||n.value||!r.value,onClick:u},[H(P(Rs),{size:20})],8,kg)])])]),a[5]||=V(`div`,{class:`composer-footnote`},[V(`span`,null,[V(`i`,{class:`live-dot`}),U(`Closing this window never interrupts your agent.`)])],-1)]))}}),jg={class:`chat-panel`},Mg={class:`chat-header`},Ng={class:`lineage-picker`},Pg={class:`lineage-toolbar`},Fg=[`title`],Ig={class:`crumb-main`},Lg={class:`device-chip`},Rg=[`title`],zg={class:`crumb-main`},Bg={class:`crumb-name`},Vg=[`aria-current`,`title`,`onClick`],Hg={class:`crumb-kind`},Ug={class:`crumb-main`},Wg={class:`crumb-name`},Gg=[`disabled`],Kg=[`aria-expanded`],qg={key:0,class:`lineage-source`},Jg={id:`conversation-picker`,class:`conversation-picker`,role:`dialog`,"aria-label":`Choose conversation`},Yg=[`aria-label`,`aria-current`,`onClick`],Xg={class:`conversation-choice-content`},Zg={class:`choice-lineage`},Qg={class:`choice-source`},$g={key:0,class:`agent-stream-status`,role:`alert`},e_=[`disabled`],t_={key:0,class:`chat-empty`},n_={key:0},r_={key:1},i_={key:0,class:`chat-empty`},a_={class:`starter-grid`},o_={key:1,class:`entry live-generation`},s_={class:`message-label`},c_={class:`streaming`},l_={key:2,class:`hint retry-note`},u_=F({__name:`AgentView`,setup(e){let t=N(),n=N(),r=N(!1),i=G(()=>Y.value.items),a=G(()=>i.value.some(e=>e.kind===`assistant`&&e.streaming)),o=G(()=>i.value.some(e=>e.kind===`tool`&&e.call.status===`running`||e.kind===`assistant`&&e.blocks.some(e=>e.type===`tool`&&e.call.status===`running`))),s=e=>e.kind===`fork`?`Forked from agent #${e.parentId} at entry #${e.forkedAt}`:e.kind===`subagent`?`Owned by agent #${e.ownerAgentId}`:`Root agent`,c=G(()=>lu.value.map(e=>({...e,lineage:Qc(lu.value,e.id)})).sort((e,t)=>{for(let n=0;n<Math.min(e.lineage.length,t.lineage.length);n++)if(e.lineage[n].id!==t.lineage[n].id)return e.lineage[n].id-t.lineage[n].id;return e.lineage.length-t.lineage.length})),l=G(()=>uu.value.at(-1)),u=e=>e.kind===`root`?`agent`:e.kind;function d(){q.value&&(Wl.tree=!0,iu(q.value.deviceId,!0))}function f(){let e=lu.value.find(e=>e.kind===`root`)??lu.value[0];e&&p(e.id)}function p(e){r.value=!1,q.value&&tu({...q.value,agentId:e})}function m(e){let t=J.value,n=q.value;t&&n&&(X.dialog={kind:`prompt`,title:`Fork conversation`,hint:`${l.value?.name??`Agent #${n.agentId}`} / entry #${e}. Leave the name blank to use Fork #ID.`,label:`Fork name`,optional:!0,placeholder:`e.g. Alternative approach`,submit:`Create fork`,run:async r=>{let i=await t.fork({entryId:e,name:r||void 0});tu({...n,agentId:i.id}),yu(`Forked at entry #${e}. App State stays shared.`)}})}function h(){let e=J.value,t=l.value;e&&t&&(X.dialog={kind:`prompt`,title:`Rename agent`,label:`Agent name`,value:t.named?t.name:``,placeholder:t.name,submit:`Save name`,run:t=>e.rename(t)})}Wn(q,()=>{r.value=!1});let g=!0;return Wn(Xl.version,()=>{let e=t.value;g=!e||e.scrollHeight-e.scrollTop-e.clientHeight<120},{flush:`pre`}),Wn(Xl.version,()=>{g&&wn(()=>t.value?.scrollTo({top:t.value.scrollHeight,behavior:`instant`}))}),Wn(()=>uu.value.length,()=>void wn(()=>n.value&&(n.value.scrollLeft=n.value.scrollWidth))),(e,g)=>(R(),z(`section`,jg,[V(`header`,Mg,[V(`div`,Ng,[V(`div`,Pg,[V(`nav`,{ref_key:`lineageNav`,ref:n,class:`crumbs conversation-lineage`,"aria-label":`Conversation lineage`},[V(`button`,{class:`crumb`,title:`${P(ql)?.name} · ${P(ql)?.url}`,onClick:d},[g[5]||=V(`span`,{class:`crumb-kind`},`device`,-1),V(`span`,Ig,[H(Zu,{device:P(ql),size:18},null,8,[`device`]),V(`span`,Lg,k(P(ql)?.id),1)])],8,Fg),H(P(Ws),{class:`crumb-sep`,size:18,"aria-hidden":`true`}),V(`button`,{class:`crumb`,title:P(Ql)?.cwd,onClick:f},[g[6]||=V(`span`,{class:`crumb-kind`},`workspace`,-1),V(`span`,zg,[H(P($s),{size:18,"aria-hidden":`true`}),V(`span`,Bg,k(P(Ql)?.name),1)])],8,Rg),(R(!0),z(L,null,I(P(uu),e=>(R(),z(L,{key:e.id},[H(P(Ws),{class:`crumb-sep`,size:18,"aria-hidden":`true`}),V(`button`,{class:E([`crumb`,{current:e.id===P(q)?.agentId}]),"aria-current":e.id===P(q)?.agentId?`page`:void 0,title:s(e),onClick:t=>p(e.id)},[V(`span`,Hg,k(u(e)),1),V(`span`,Ug,[e.kind===`fork`?(R(),B(P(tc),{key:0,size:18,"aria-hidden":`true`})):e.kind===`subagent`?(R(),B(P(Ys),{key:1,size:18,"aria-hidden":`true`})):(R(),B(P(fc),{key:2,size:18,"aria-hidden":`true`})),V(`span`,Wg,k(e.name),1)])],10,Vg)],64))),128))],512),V(`button`,{class:`icon-button`,"aria-label":`Rename agent`,title:`Rename this agent`,disabled:!l.value,onClick:h},[H(P(bc),{size:18})],8,Gg),V(`button`,{class:`icon-button conversation-menu-toggle`,"aria-label":`Browse conversations`,"aria-haspopup":`dialog`,"aria-expanded":r.value,"aria-controls":`conversation-picker`,title:`Browse roots and forks`,onClick:g[0]||=e=>r.value=!r.value},[H(P(Us),{size:18})],8,Kg)]),l.value&&l.value.kind!==`root`?(R(),z(`div`,qg,k(s(l.value)),1)):W(``,!0),r.value?(R(),z(L,{key:1},[V(`button`,{class:`conversation-menu-dismiss`,"aria-label":`Close conversation picker`,onClick:g[1]||=e=>r.value=!1}),V(`section`,Jg,[g[7]||=V(`div`,{class:`conversation-picker-heading`},`Roots & forks`,-1),(R(!0),z(L,null,I(c.value,e=>(R(),z(`button`,{key:e.id,class:E([`conversation-choice`,{selected:e.id===P(q)?.agentId}]),"aria-label":e.lineage.map(e=>e.name).join(` → `),"aria-current":e.id===P(q)?.agentId?`page`:void 0,onClick:t=>p(e.id)},[V(`div`,Xg,[V(`span`,Zg,[(R(!0),z(L,null,I(e.lineage,(t,n)=>(R(),z(L,{key:t.id},[n?(R(),B(P(Ws),{key:0,size:18,"aria-hidden":`true`})):W(``,!0),V(`span`,{class:E({"choice-ancestor":n<e.lineage.length-1})},k(t.name),3)],64))),128))]),V(`span`,Qg,k(s(e)),1)]),e.id===P(q)?.agentId?(R(),B(P(Hs),{key:0,size:18,"aria-hidden":`true`})):e.kind===`fork`?(R(),B(P(tc),{key:1,size:18,"aria-hidden":`true`})):(R(),B(P(fc),{key:2,size:18,"aria-hidden":`true`}))],10,Yg))),128))])],64)):W(``,!0)])]),P(Xl).fault.value||P(Xl).status.value===`fault`||P(Xl).status.value===`reconnecting`||P(Y).ready&&P(Xl).status.value===`connecting`?(R(),z(`div`,$g,[V(`div`,null,[V(`strong`,null,k(P(Y).ready?`Cached transcript is stale.`:`Agent stream unavailable.`),1),V(`p`,null,k(P(Xl).fault.value||`Updates are paused while the stream reconnects.`),1),g[8]||=V(`p`,null,`Sending is paused until a fresh snapshot arrives. Your draft is kept.`,-1)]),V(`button`,{disabled:P(Xl).status.value===`connecting`,onClick:g[2]||=(...e)=>P(Xl).retry&&P(Xl).retry(...e)},` Retry stream `,8,e_)])):W(``,!0),V(`div`,{ref_key:`chat`,ref:t,class:`chat-scroll`,"data-testid":`chat`},[P(Y).ready?(R(),z(L,{key:1},[i.value.length?W(``,!0):(R(),z(`div`,i_,[g[13]||=V(`div`,{class:`agent-orb`},[V(`img`,{src:`/icons/durable-pi.svg`,alt:`Durable Pi`}),V(`i`)],-1),g[14]||=V(`span`,{class:`eyebrow`},`YOUR DURABLE AGENT IS READY`,-1),g[15]||=V(`h2`,null,`A conversation with continuity.`,-1),V(`p`,null,`Messages, tools and state live on `+k(P(ql)?.id)+`, beyond this window.`,1),V(`div`,a_,[V(`button`,{onClick:g[3]||=e=>P(xu)(`Inspect this directory using your tools and give me a brief overview. Do not modify any files.`)},[H(P($s),{size:18}),g[9]||=V(`strong`,null,`Explore this directory`,-1),g[10]||=V(`span`,null,`See coding tools in action`,-1),H(P(Ls),{size:18})]),V(`button`,{onClick:g[4]||=e=>P(xu)(`Use read_state, then update_state to add a field called progress with value 1 and a boolean called ready with value false.`)},[H(P(Bs),{size:18}),g[11]||=V(`strong`,null,`Make a state change`,-1),g[12]||=V(`span`,null,`Watch the workspace update`,-1),H(P(Ls),{size:18})])])])),(R(!0),z(L,null,I(i.value,e=>(R(),B(og,{key:e.id,item:e,onFork:m},null,8,[`item`]))),128)),P(Y).running&&!a.value&&!o.value?(R(),z(`div`,o_,[V(`div`,s_,[g[16]||=U(` AGENT `,-1),V(`span`,c_,k(P(Y).retry?`Retry scheduled`:`Working`),1)]),g[17]||=V(`div`,{class:`typing`},[V(`i`),V(`i`),V(`i`)],-1)])):W(``,!0),P(Y).retry?(R(),z(`p`,l_,` Retrying: `+k(P(Y).retry.error),1)):W(``,!0),(R(!0),z(L,null,I(P(Y).notices,(e,t)=>(R(),z(`p`,{key:t,class:`message-error`},k(e),1))),128))],64)):(R(),z(`div`,t_,[H(P(Fs),{size:30}),P(Xl).status.value===`fault`?(R(),z(`h2`,n_,`This agent is unavailable.`)):(R(),z(`h2`,r_,`Connecting to the agent…`)),V(`p`,null,`The agent keeps working on `+k(P(ql)?.id)+` while this view connects.`,1)]))],512),H(Ag)]))}});function d_(e,t){return`${e}/${t.replaceAll(`~`,`~0`).replaceAll(`/`,`~1`)}`}var f_=[`data-state-path`],p_={key:0,class:`state-field-heading`},m_=[`value`,`aria-label`,`disabled`],h_=[`value`],g_=[`aria-label`,`disabled`],__=[`aria-label`,`disabled`],v_=[`aria-label`,`disabled`],y_=[`value`],b_=[`disabled`],x_=[`disabled`,`aria-label`],S_={key:2,class:`state-number`},C_=[`aria-label`,`disabled`],w_=[`aria-label`,`disabled`],T_=[`aria-label`,`disabled`],E_={key:3,class:`state-boolean`},D_=[`aria-label`,`aria-checked`,`disabled`],O_=[`aria-label`,`disabled`],k_={key:5,class:`muted`},A_=F({__name:`StateEditor`,props:{value:{type:[String,Number,Boolean,null,Array,Object]},path:{default:``},label:{default:`App State`},disabled:{type:Boolean}},emits:[`change`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>n.value===null?`null`:Array.isArray(n.value)?`array`:typeof n.value),a=G(()=>i.value===`object`||i.value===`array`),o=G(()=>a.value?Object.entries(n.value):[]),s=N(``),c=N(!1),l=N(``),u=N(`string`),d=N(!1),f=[`string`,`number`,`boolean`,`object`,`array`,`null`],p={string:()=>``,number:()=>0,boolean:()=>!1,object:()=>({}),array:()=>[],null:()=>null};Wn(()=>n.value,e=>{c.value||(s.value=String(e??``))},{immediate:!0});function m(e,t){r(`change`,{operation:e,path:n.path,value:t})}function h(){c.value=!1;let e=i.value===`number`?Number(s.value):s.value;if(i.value===`number`&&(!String(s.value).trim()||!Number.isFinite(e))){s.value=String(n.value);return}e!==n.value&&m(`update`,e)}function g(){let e=i.value===`array`?`-`:l.value.trim();e&&(r(`change`,{operation:`create`,path:d_(n.path,e),value:p[u.value]()}),l.value=``,d.value=!1)}return(t,n)=>{let _=qr(`StateEditor`,!0);return R(),z(`div`,{class:E([`state-field`,{"state-root":e.path===``}]),"data-state-path":e.path},[e.path===``?W(``,!0):(R(),z(`div`,p_,[V(`strong`,null,k(e.label),1),V(`select`,{value:i.value,"aria-label":`Type of ${e.path}`,disabled:e.disabled,onChange:n[0]||=e=>m(`update`,p[e.target.value]())},[(R(),z(L,null,I(f,e=>V(`option`,{key:e,value:e},k(e),9,h_)),64))],40,m_),V(`button`,{class:`icon-button`,"aria-label":`Delete ${e.path}`,title:`Delete field`,disabled:e.disabled,onClick:n[1]||=e=>m(`delete`)},[H(P(jc),{size:18})],8,g_)])),a.value?(R(),z(L,{key:1},[(R(!0),z(L,null,I(o.value,([t,i])=>(R(),B(_,{key:t,value:i,path:P(d_)(e.path,t),label:t,disabled:e.disabled,onChange:n[2]||=e=>r(`change`,e)},null,8,[`value`,`path`,`label`,`disabled`]))),128)),d.value&&i.value===`array`?(R(),z(`form`,{key:0,class:`state-add`,onSubmit:Cs(g,[`prevent`])},[i.value===`array`?W(``,!0):Ln((R(),z(`input`,{key:0,"onUpdate:modelValue":n[3]||=e=>l.value=e,placeholder:`Field name`,"aria-label":`New field name in ${e.path||`/`}`,required:``,disabled:e.disabled},null,8,__)),[[ps,l.value]]),Ln(V(`select`,{"onUpdate:modelValue":n[4]||=e=>u.value=e,"aria-label":`New field type in ${e.path||`/`}`,disabled:e.disabled},[(R(),z(L,null,I(f,e=>V(`option`,{key:e,value:e},k(e),9,y_)),64))],8,v_),[[gs,u.value]]),V(`button`,{class:`secondary small`,disabled:e.disabled||i.value!==`array`&&!l.value.trim()},` Add `,8,b_),V(`button`,{type:`button`,class:`text-button`,onClick:n[5]||=e=>d.value=!1},`Cancel`)],32)):i.value===`array`?(R(),z(`button`,{key:1,class:`text-button state-add-button`,disabled:e.disabled,"aria-label":`Add ${i.value===`array`?`item`:`field`} to ${e.path||`/`}`,onClick:n[6]||=e=>d.value=!0},[H(P(Sc),{size:18}),U(k(i.value===`array`?`Add item`:`Add field`),1)],8,x_)):W(``,!0)],64)):i.value===`number`?(R(),z(`div`,S_,[V(`button`,{class:`secondary`,"aria-label":`Decrement ${e.path}`,disabled:e.disabled,onClick:n[7]||=e=>m(`increment`,-1)},[H(P(pc),{size:18})],8,C_),Ln(V(`input`,{"onUpdate:modelValue":n[8]||=e=>s.value=e,type:`number`,step:`any`,"aria-label":`Value of ${e.path}`,disabled:e.disabled,onFocus:n[9]||=e=>c.value=!0,onBlur:h,onKeydown:n[10]||=Ts(e=>e.target.blur(),[`enter`])},null,40,w_),[[ps,s.value]]),V(`button`,{class:`secondary`,"aria-label":`Increment ${e.path}`,disabled:e.disabled,onClick:n[11]||=e=>m(`increment`,1)},[H(P(Sc),{size:18})],8,T_)])):i.value===`boolean`?(R(),z(`div`,E_,[V(`button`,{class:E([`switch`,{on:e.value===!0}]),role:`switch`,"aria-label":`Value of ${e.path}`,"aria-checked":e.value===!0,disabled:e.disabled,onClick:n[12]||=t=>m(`update`,!e.value)},[...n[15]||=[V(`span`,null,null,-1)]],10,D_),V(`span`,null,k(e.value),1)])):i.value===`string`?Ln((R(),z(`textarea`,{key:4,"onUpdate:modelValue":n[13]||=e=>s.value=e,rows:`2`,"aria-label":`Value of ${e.path}`,disabled:e.disabled,onFocus:n[14]||=e=>c.value=!0,onBlur:h},null,40,O_)),[[ps,s.value]]):(R(),z(`span`,k_,`null`))],10,f_)}}}),j_=[`data-status`],M_=[`title`],N_=[`title`],P_=[`href`],F_=[`title`],I_=F({__name:`TunnelStatusBar`,props:{device:{}},setup(e){let t=e,n=G(()=>t.device.status===`online`),r=G(()=>t.device.transport===`tunnel`),i=G(()=>n.value?r.value?`online · via tunnel`:`online · LAN`:r.value?`tunnel`:`LAN`),a=G(()=>t.device.tunnel?.state===`connected`);return(t,o)=>(R(),z(`span`,{class:`tunnel-status`,"data-status":e.device.status},[V(`span`,{class:`axis transport`,title:r.value?`Hub ⇄ device over the tunnel (WSS)`:`Hub → device over LAN`},[r.value?(R(),B(P(Vs),{key:0,size:13,class:E({live:a.value})},null,8,[`class`])):(R(),B(P(Pc),{key:1,size:13,class:E({live:n.value})},null,8,[`class`])),U(` `+k(i.value),1)],8,M_),V(`span`,{class:E([`axis monitor`,e.device.status])},[e.device.status===`offline`?(R(),B(P(Nc),{key:0,size:13})):(R(),z(L,{key:1},[U(k(e.device.status),1)],64))],2),r.value&&a.value&&e.device.tunnel?(R(),z(`span`,{key:0,class:`axis muted`,title:`tunnel last seen ${P(Tu)(e.device.tunnel.lastSeenAt)}`},k(e.device.tunnel.readerCount)+` reader`+k(e.device.tunnel.readerCount===1?``:`s`),9,N_)):W(``,!0),e.device.url?(R(),z(`a`,{key:1,class:`axis url`,href:e.device.url,target:`_blank`,rel:`noreferrer`},k(e.device.url),9,P_)):W(``,!0),e.device.lastSeenAt?(R(),z(`span`,{key:2,class:`axis muted`,title:`last probe ${P(Tu)(e.device.lastSeenAt)}`},k(P(Tu)(e.device.lastSeenAt)),9,F_)):W(``,!0)],8,j_))}});async function L_(e,t,n,r,i){let a=await fetch(`/api${t}`,{method:e,headers:n===void 0?{}:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n),signal:r,...i?{keepalive:i}:{}}),o=await a.json().catch(()=>void 0);if(!a.ok){let e=o?.error;throw new fl(e?.code??`internal`,e?.message??`${a.status} ${a.statusText}`,a.status)}return o}var R_={pairings:e=>L_(`GET`,`/pairings`,void 0,e),createCode:e=>L_(`POST`,`/pair/code`,{},e),resolveCode:(e,t)=>L_(`POST`,`/pair/resolve`,{code:e},t),codeState:(e,t)=>L_(`GET`,`/pair/codes/${encodeURIComponent(e)}`,void 0,t),approve:(e,t,n)=>L_(`POST`,`/pair/codes/${encodeURIComponent(e)}/approve`,t,n),cancel:(e,t,n)=>L_(`POST`,`/pair/codes/${encodeURIComponent(e)}/cancel`,{},t,n),rotate:(e,t)=>L_(`POST`,`/pairings/${encodeURIComponent(e)}/rotate`,{},t),revoke:(e,t=`user`,n)=>L_(`POST`,`/pairings/${encodeURIComponent(e)}/revoke`,{reason:t},n)},z_=0;function B_(){let e=++z_,t=!1;return{gen:e,close:()=>t=!0,closed:()=>t}}var V_=class extends Error{codeId;constructor(e){super(`pairing poll timed out for ${e}`),this.codeId=e,this.name=`PollTimeout`}},H_=e=>e===`issued`||e===`cancelled`||e===`expired`;async function U_(e,t,n={}){let r=n.intervalMs??1e3,i=Date.now()+(n.timeoutMs??33e4);for(;;){if(e.closed())return;if(n.signal?.aborted)throw new DOMException(`The operation was aborted.`,`AbortError`);if(Date.now()>i)throw new V_(t);let a=await R_.codeState(t,n.signal);if(e.closed())return;if(e.state=a,n.onState?.(a),H_(a.phase))return a;await new Promise(e=>setTimeout(e,r))}}var W_={key:0,class:`token-manager`,"aria-label":`Credential manager`},G_={class:`credential-fingerprint`},K_=[`title`],q_={key:0,class:`rotation-badge`,role:`status`},J_={class:`token-actions`},Y_=[`disabled`],X_=[`disabled`],Z_={key:1,class:`message-error`,role:`alert`},Q_=F({__name:`TokenManager`,props:{device:{}},setup(e){let t=e,n=N(!1),r=N(``),i=G(()=>t.device.pairing);async function a(){if(!n.value){n.value=!0,r.value=``;try{await R_.rotate(t.device.id),yu(`Rotation queued — it completes when the device acknowledges the new credential.`)}catch(e){r.value=Ol(e)}finally{n.value=!1}}}async function o(){n.value||(X.dialog={kind:`prompt`,title:`Revoke ${t.device.id}?`,hint:`Every tunnel credential for this device dies at commit and the live tunnel is cut within a second. The device cleans its own files the next time it talks to the hub.`,submit:`Revoke`,danger:!0,run:async()=>{await R_.revoke(t.device.id,`user`),yu(`Revoke committed on the hub. The tunnel is cut; the device cleans up on its next contact.`)}})}return(e,t)=>i.value?(R(),z(`section`,W_,[V(`header`,null,[H(P(ac),{size:15}),t[0]||=V(`h3`,null,`Credential`,-1),V(`span`,{class:E([`pairing-status`,i.value.status])},k(i.value.status),3)]),V(`dl`,null,[t[1]||=V(`dt`,null,`Key fingerprint`,-1),V(`dd`,null,[V(`code`,G_,k(i.value.keyFingerprint),1)]),t[2]||=V(`dt`,null,`Paired`,-1),V(`dd`,{title:new Date(i.value.pairedAt).toISOString()},k(P(Tu)(i.value.pairedAt)),9,K_),t[3]||=V(`dt`,null,`Generation`,-1),V(`dd`,null,k(i.value.credentialGeneration),1)]),i.value.rotationPending?(R(),z(`p`,q_,[H(P(wc),{size:13,class:`spin`}),t[4]||=U(` rotation queued — waiting for the device to ACK `,-1)])):W(``,!0),V(`div`,J_,[i.value.status===`paired`?(R(),z(`button`,{key:0,class:`small`,disabled:n.value||i.value.rotationPending,onClick:a},[H(P(wc),{size:14}),t[5]||=U(` Rotate credential `,-1)],8,Y_)):W(``,!0),i.value.status===`paired`?(R(),z(`button`,{key:1,class:`small danger`,disabled:n.value,onClick:o},[H(P(kc),{size:14}),t[6]||=U(` Revoke `,-1)],8,X_)):W(``,!0)]),r.value?(R(),z(`p`,Z_,k(r.value),1)):W(``,!0)])):W(``,!0)}}),$_={class:`tasks-panel`},ev={class:`panel-heading`},tv={class:`tag`},nv={key:0,class:`message-error`,role:`alert`},rv={class:`task-section`,"aria-label":`Durable jobs`},iv={key:0,class:`task-empty`},av=[`data-job`],ov={class:`job-def-head`},sv={key:0,class:`tag`},cv={class:`tag`},lv=[`aria-label`],uv=[`title`],dv={class:`job-def-meta`},fv=[`title`],pv=[`title`],mv={key:0,class:`job-def-last`},hv=[`onClick`],gv=[`disabled`,`onClick`],_v=[`disabled`,`onClick`],vv=[`disabled`,`onClick`],yv={class:`task-section`,"aria-label":`Agent activity`},bv={class:`panel-heading`},xv={key:0,class:`task-empty`},Sv={key:1,class:`task-tree`},Cv=[`data-task-kind`],wv={class:`tag`},Tv={key:0,class:`task-phase`},Ev=[`onClick`],Dv=[`disabled`],Ov={class:`raw`},kv=F({__name:`TasksPanel`,setup(e){let t=N(``),n=N(!1),r=N([]),i=N(),a=e=>({running:`Running`,waiting:`Waiting`,completed:`Completed`,aborted:`Stopped`,declined:`Declined`,failed:`Failed`,pending:`Queued`,completing:`Finishing`,terminal:`Finished`})[e]??e,o=G(()=>new Map(Km.value.map(e=>[e.id,Jm.value.find(t=>t.job===e.id)]))),s=G(()=>{let e=du.value,t=new Set(e.map(e=>e.id)),n=new Map;for(let r of e){let e=r.owner!==void 0&&t.has(r.owner)?r.owner:void 0;n.set(e,[...n.get(e)??[],r])}let r=[],i=(e,t)=>{for(let a of(n.get(e)??[]).sort((e,t)=>e.id-t.id))r.push({task:a,depth:t}),i(a.id,t+1)};return i(void 0,0),r}),c=e=>e.kind===`pi.tool`?{icon:Ic,name:e.label??`Tool call`,what:`tool call`}:e.kind===`pi.generation`?{icon:zs,name:`Model response`,what:`generation`}:e.kind===`pi.compaction`?{icon:sc,name:`Compaction`,what:`compaction`}:e.kind.startsWith(`demo.job.`)?{icon:Fc,name:e.label??qm(e.kind.slice(9))?.title??e.kind,what:`durable job`}:e.kind===`demo.job-approval`?{icon:Oc,name:`Approval`,what:`waits for you`}:{icon:Fs,name:e.label??e.kind,what:e.kind},l=e=>e.state.phase?e.kind.startsWith(`demo.job.`)?qm(e.kind.slice(9))?.phases.find(t=>t.id===e.state.phase)?.label??e.state.phase:e.state.phase:``;async function u(){if(!n.value&&J.value){n.value=!0,t.value=``;try{await J.value.abort(!0)}catch(e){t.value=Ol(e)}finally{n.value=!1}}}async function d(e){let n=eu.value;if(e.target.open&&n)try{let[e,t]=await Promise.all([n.tasks(`terminal`,40),n.inspect()]);r.value=e,i.value=t}catch(e){t.value=Ol(e)}}let f=G(()=>r.value.filter(e=>e.state.status===`terminal`).slice(-12).reverse());return(e,r)=>(R(),z(`div`,$_,[V(`div`,ev,[r[0]||=V(`h2`,null,`Tasks`,-1),V(`span`,tv,k(P(du).length)+` active`,1)]),t.value?(R(),z(`p`,nv,k(t.value),1)):W(``,!0),V(`section`,rv,[V(`h3`,null,[H(P(Tc),{size:18}),r[1]||=U(`Durable jobs`,-1)]),r[2]||=V(`p`,{class:`hint`},[U(` Repeatable workflows with named phases. Every run follows the same phases and saves a checkpoint after each one. Start one here, or ask your agent: it finds these with `),V(`code`,null,`list_durable_jobs`),U(`, starts them with `),V(`code`,null,`run_durable_job`),U(` and checks them with `),V(`code`,null,`check_durable_job`),U(`. Runs play out live in the chat. `)],-1),P(Km).length?W(``,!0):(R(),z(`p`,iv,` This device has no durable jobs. Deploy the latest backend to it. `)),(R(!0),z(L,null,I(P(Km),e=>(R(),z(`article`,{key:e.id,class:`job-def`,"data-job":e.id},[V(`div`,ov,[H(P(Fc),{size:18}),V(`strong`,null,k(e.title),1),e.approval?(R(),z(`span`,sv,`needs approval`)):W(``,!0),V(`span`,cv,`~`+k(e.seconds)+`s`,1)]),V(`p`,null,k(e.summary),1),V(`ol`,{class:`job-chain`,"aria-label":`${e.title} phases`},[(R(!0),z(L,null,I(e.phases,(e,t)=>(R(),z(`li`,{key:e.id,title:e.summary},[V(`span`,null,k(t+1),1),U(k(e.label),1),e.kind===`repeat`?(R(),B(P(Tc),{key:0,size:13})):W(``,!0),e.kind===`approval`?(R(),B(P(Oc),{key:1,size:13})):W(``,!0)],8,uv))),128))],8,lv),V(`div`,dv,[(R(!0),z(L,null,I(e.inputs,e=>(R(),z(`code`,{key:e.name,title:e.description},k(e.name)+`=`+k(e.default),9,fv))),128)),V(`code`,{title:`Each run saves its result to App State ${e.resultPath}`},`→ `+k(e.resultPath),9,pv)]),o.value.get(e.id)?(R(),z(`div`,mv,[V(`span`,null,[U(`Run #`+k(o.value.get(e.id).run)+`: `,1),V(`strong`,null,k(a(o.value.get(e.id).status)),1),P(Gm)(o.value.get(e.id))?W(``,!0):(R(),z(L,{key:0},[U(` in `+k(o.value.get(e.id).phases.find(t=>t.id===o.value.get(e.id).phase)?.label),1)],64))]),V(`button`,{class:`text-button`,onClick:t=>P(th)(o.value.get(e.id).id)},` Show in chat `,8,hv),o.value.get(e.id).approval===`pending`?(R(),z(L,{key:0},[V(`button`,{class:`primary small`,disabled:!!P($m),onClick:t=>P(rh)(o.value.get(e.id),!0)},` Approve `,8,gv),V(`button`,{class:`secondary`,disabled:!!P($m),onClick:t=>P(rh)(o.value.get(e.id),!1)},` Decline `,8,_v)],64)):W(``,!0)])):W(``,!0),V(`button`,{class:`secondary job-def-run`,disabled:!!P($m)||!P(J),onClick:t=>P(nh)(e)},[H(P(xc),{size:16}),U(`Run `+k(e.title),1)],8,vv)],8,av))),128))]),V(`section`,yv,[V(`div`,bv,[r[3]||=V(`h3`,null,`Agent activity`,-1),H(P(Fs),{size:18})]),r[5]||=V(`p`,{class:`hint`},` Every model response and every tool call is its own durable task with an id, an owner and a checkpoint. Follow them live here; after a restart each one resumes or reports how it ended. `,-1),s.value.length?(R(),z(`ul`,Sv,[(R(!0),z(L,null,I(s.value,({task:e,depth:t})=>(R(),z(`li`,{key:e.id,class:`task-row`,style:T({"--depth":t}),"data-task-kind":e.kind},[(R(),B(Yr(c(e).icon),{size:16})),V(`strong`,null,k(c(e).name),1),V(`span`,wv,k(a(e.state.status)),1),l(e)?(R(),z(`span`,Tv,k(l(e)),1)):W(``,!0),V(`small`,null,`#`+k(e.id)+` `+k(c(e).what)+`, agent #`+k(e.conversationId)+k(e.effectiveBackground?`, background`:``),1),(R(!0),z(L,null,I(e.conversations,e=>(R(),z(`button`,{key:e,class:`text-button`,onClick:t=>P(ah)(e)},` Open agent #`+k(e),9,Ev))),128))],12,Cv))),128))])):(R(),z(`p`,xv,`Nothing running. Send a message or run a job.`)),r[6]||=V(`p`,{class:`hint`},` Interrupt or Esc stops foreground work and what it owns. Stop all also stops background runs. `,-1),V(`button`,{class:`secondary danger`,disabled:!P(du).length||n.value,onClick:u},[H(P(hc),{size:18}),r[4]||=U(`Stop all `,-1)],8,Dv)]),V(`details`,{class:`raw task-section`,onToggle:d},[V(`summary`,null,[H(P(qs),{size:18}),r[7]||=U(`Runtime details`,-1)]),r[9]||=V(`p`,{class:`hint`},` Recent task results and recovery records, read from the device when opened. `,-1),(R(!0),z(L,null,I(f.value,e=>(R(),z(`details`,{key:e.id,class:`raw`},[V(`summary`,null,[U(k(e.kind)+` #`+k(e.id),1),V(`span`,null,k(a(e.state.outcome?.status??e.state.status)),1)]),V(`pre`,null,k(JSON.stringify(e.state.outcome,null,2)),1)]))),128)),V(`details`,Ov,[r[8]||=V(`summary`,null,`Recovery inspection`,-1),V(`pre`,null,k(JSON.stringify(i.value,null,2)),1)])],32)]))}}),Av={class:`extensions-panel`},jv={class:`panel-heading`},Mv={key:0,class:`task-empty`},Nv=[`data-extension`],Pv={class:`ext-head`},Fv=[`aria-checked`,`aria-label`,`disabled`,`onClick`],Iv=[`checked`,`disabled`,`onChange`],Lv=F({__name:`ExtensionsPanel`,setup(e){let t=Zt(),n=N(!1);async function r(){let e=J.value;if(!e||!Jl.value)return void(t.value=void 0);t.value=await e.extensions().catch(()=>void 0)??t.value}Wn([J,Jl,()=>JSON.stringify(Y.value.agent.extensions??null)],r,{immediate:!0});async function i(e){let r=J.value;if(r&&!n.value){n.value=!0;try{let n=await bu(()=>r.setExtension(e));n&&(t.value=n),_u()}finally{n.value=!1}}}return(e,r)=>(R(),z(`div`,Av,[V(`div`,jv,[r[0]||=V(`h2`,null,`Extensions`,-1),H(P(Cc),{size:18})]),r[3]||=V(`p`,{class:`hint`},` Custom harness capabilities for this agent. Turn one on and the next request uses it. The choice is stored with the agent, so it survives restarts. `,-1),t.value?W(``,!0):(R(),z(`p`,Mv,`Loading extensions…`)),(R(!0),z(L,null,I(t.value?.extensions??[],e=>(R(),z(`article`,{key:e.name,class:E([`ext-card`,{on:e.enabled}]),"data-extension":e.name},[V(`div`,Pv,[V(`div`,null,[V(`strong`,null,k(e.title),1),V(`code`,null,k(e.name),1)]),V(`button`,{class:E([`switch`,{on:e.enabled}]),role:`switch`,"aria-checked":e.enabled,"aria-label":e.title,disabled:n.value,onClick:t=>i({name:e.name,enabled:!e.enabled})},[...r[1]||=[V(`span`,null,null,-1)]],10,Fv)]),V(`p`,null,k(e.description),1),e.prompts?(R(),z(`ul`,{key:0,class:E([`ext-prompts`,{off:!e.enabled}])},[(R(!0),z(L,null,I(e.prompts,e=>(R(),z(`li`,{key:e.id},[V(`label`,null,[V(`input`,{type:`checkbox`,checked:e.enabled,disabled:n.value,onChange:t=>i({prompt:e.id,enabled:t.target.checked})},null,40,Iv),V(`code`,null,k(e.id),1)]),V(`span`,null,k(e.description),1),V(`details`,null,[r[2]||=V(`summary`,null,`View prompt`,-1),V(`pre`,null,k(e.text),1)])]))),128))],2)):W(``,!0)],10,Nv))),128))]))}}),Rv={class:`context-section`,"aria-labelledby":`context-title`},zv={class:`section-label`},Bv={key:0,class:`hint`},Vv={class:`context-numbers`},Hv={class:`context-pct`},Uv={key:0,class:`context-compacting`},Wv=[`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],Gv={class:`context-marker-label`},Kv=[`aria-valuemin`,`aria-valuemax`,`aria-valuenow`,`aria-valuetext`],qv={class:`context-marker-label`},Jv={class:`hint context-hint`},Yv={class:`modal compaction-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`compaction-title`},Xv={class:`context-toggle`},Zv=[`checked`],Qv=512,$v=4096,ey=1024,ty=F({__name:`ContextBar`,setup(e){let t=e=>e>=1e6?`${(e/1e6).toFixed(2)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e),n=G(()=>mu.value?.contextWindow??0),r=G(()=>{let e=Y.value.entries;for(let t=e.length-1;t>=0;t--){if(e[t].kind!==`pi.assistant`)continue;let n=e[t].model?.find(e=>e.role===`assistant`)?.usage;if(n)return n.totalTokens||n.input+n.output+n.cacheRead+n.cacheWrite}return 0}),i=G(()=>Y.value.compactions.length>0),a=N(),o=G(()=>a.value??Ql.value?.compaction??dg(n.value));Wn(()=>JSON.stringify(Ql.value?.compaction),e=>{a.value&&e===JSON.stringify(a.value)&&(a.value=void 0)});let s=N(),c=G(()=>X.dialog?.kind===`compaction`),l=()=>void(X.dialog=void 0);Vr(()=>c.value&&l());let u=G(()=>s.value??fg(n.value,o.value)),d=e=>`${Math.min(100,Math.max(0,100*e/(n.value||1)))}%`,f=G(()=>Math.round(100*r.value/(n.value||1))),p=e=>{let t=e/(n.value||1);return t<.35?`start`:t>.65?`end`:`center`},m=(e,t)=>Math.min(n.value-ey,Math.max((t??$v)+ey,e)),h=(e,t)=>Math.min(t-ey,Math.max($v,e));function g(e,t){let n=u.value,r=Math.round(t/Qv)*Qv;s.value=e===`wait`?{auto:n.auto,wait:m(r,n.auto)}:{auto:h(r,n.wait),wait:n.wait}}async function _(e){let t=eu.value;if(!t)return;let n=await bu(()=>t.setCompaction(e));n&&(a.value=n),s.value=void 0}function v(){let e=s.value;e&&_({reserveTokens:n.value-e.wait,...e.auto===void 0?{}:{backgroundTokens:e.wait-e.auto}})}let y=N(),b;function x(e,t){b=e,t.currentTarget.setPointerCapture(t.pointerId)}function ee(e){if(!b||!y.value)return;let t=y.value.getBoundingClientRect();g(b,(e.clientX-t.left)/t.width*n.value)}function S(){b&&(b=void 0,v())}function te(e,t){let n=(t.shiftKey?8192:1024)*(t.key===`ArrowRight`||t.key===`ArrowUp`?1:t.key===`ArrowLeft`||t.key===`ArrowDown`?-1:0);if(!n)return;t.preventDefault();let r=u.value;g(e,(e===`auto`?r.auto??$v:r.wait)+n)}return(e,a)=>(R(),z(L,null,[V(`section`,Rv,[V(`div`,zv,[a[7]||=V(`span`,{id:`context-title`},`CONTEXT`,-1),n.value?(R(),z(`button`,{key:0,class:`context-details-toggle`,onClick:a[0]||=e=>P(X).dialog={kind:`compaction`}},[H(P(ic),{size:16}),a[6]||=U(`Details `,-1)])):W(``,!0)]),n.value?(R(),z(L,{key:1},[V(`div`,Vv,[V(`strong`,null,k(t(r.value)),1),V(`span`,null,`of `+k(t(n.value))+` tokens`,1),V(`span`,Hv,k(f.value)+`%`,1),i.value?(R(),z(`span`,Uv,[...a[8]||=[V(`i`,null,null,-1),U(`Compacting`,-1)]])):W(``,!0)]),V(`div`,{ref_key:`bar`,ref:y,class:E([`context-bar`,{off:!o.value.enabled}]),onPointermove:ee,onPointerup:S,onPointercancel:S},[V(`div`,{class:E([`context-fill`,{hot:u.value.auto!==void 0&&r.value>=u.value.auto}]),style:T({width:d(r.value)})},null,6),V(`div`,{class:`context-reserve`,style:T({left:d(u.value.wait)}),title:`Reserved for the answer`},null,4),u.value.auto===void 0?W(``,!0):(R(),z(`button`,{key:0,class:E([`context-marker auto`,`label-${p(u.value.auto)}`]),role:`slider`,"aria-label":`Automatic compaction starts at`,"aria-valuemin":$v,"aria-valuemax":u.value.wait-ey,"aria-valuenow":u.value.auto,"aria-valuetext":`${t(u.value.auto)} tokens`,style:T({left:d(u.value.auto)}),onPointerdown:a[1]||=e=>x(`auto`,e),onKeydown:a[2]||=e=>te(`auto`,e),onKeyup:v,onBlur:v},[V(`span`,Gv,`Auto-compact at `+k(t(u.value.auto)),1)],46,Wv)),V(`button`,{class:E([`context-marker wait`,`label-${p(u.value.wait)}`]),role:`slider`,"aria-label":`The next request waits for a summary at`,"aria-valuemin":(u.value.auto??$v)+ey,"aria-valuemax":n.value-ey,"aria-valuenow":u.value.wait,"aria-valuetext":`${t(u.value.wait)} tokens, ${t(n.value-u.value.wait)} reserved`,style:T({left:d(u.value.wait)}),onPointerdown:a[3]||=e=>x(`wait`,e),onKeydown:a[4]||=e=>te(`wait`,e),onKeyup:v,onBlur:v},[V(`span`,qv,`Reserve at `+k(t(u.value.wait)),1)],46,Kv)],34),V(`p`,Jv,[o.value.enabled?(R(),z(L,{key:0},[a[9]||=U(`Compacts in the background at `,-1),V(`strong`,null,k(t(u.value.auto??u.value.wait)),1),a[10]||=U(` and waits at `,-1),V(`strong`,null,k(t(u.value.wait)),1),a[11]||=U(`.`,-1)],64)):(R(),z(L,{key:1},[U(`Automatic compaction is off.`)],64))])],64)):(R(),z(`div`,Bv,`Pick a model to see its context window.`))]),(R(),B(ar,{to:`body`},[c.value?(R(),z(`div`,{key:0,class:`modal-backdrop`,onClick:Cs(l,[`self`])},[V(`section`,Yv,[V(`header`,null,[a[12]||=V(`h2`,{id:`compaction-title`},`Context compaction`,-1),V(`button`,{class:`icon-button`,"aria-label":`Close context compaction`,onClick:l},[H(P(Lc),{size:18})])]),V(`p`,null,[a[13]||=U(` A summary starts in the background at `,-1),V(`strong`,null,k(t(u.value.auto??u.value.wait)),1),a[14]||=U(`. Above `,-1),V(`strong`,null,k(t(u.value.wait)),1),U(` the next request waits for it, keeping `+k(t(n.value-u.value.wait))+` free for the answer. Drag a marker on the bar to change either point. `,1)]),a[16]||=V(`p`,null,[U(`Older entries stay stored, and `),V(`code`,null,`search_history`),U(` still finds them.`)],-1),V(`label`,Xv,[V(`input`,{type:`checkbox`,checked:o.value.enabled,onChange:a[5]||=e=>_({enabled:e.target.checked})},null,40,Zv),a[15]||=U(` Automatic compaction `,-1)]),a[17]||=V(`p`,{class:`hint`},[U(` Applies to every agent in this session. `),V(`code`,null,`/compact`),U(` works either way. `)],-1),V(`footer`,null,[V(`button`,{class:`secondary`,onClick:l},`Close`)])])])):W(``,!0)]))],64))}}),ny=/^[A-Za-z_$][\w$]*$/,ry=e=>` `.repeat(e);function iy(e,t){let n=[],r=(e,t=`text`)=>n.push({text:e,kind:t});return r(`function`,`keyword`),r(` `),r(e,`function`),r(`(`,`punct`),r(`args`),r(`: `,`punct`),ay(t,0,r),r(`): `,`punct`),r(`Promise`,`type`),r(`<`,`punct`),r(`ToolResult`,`type`),r(`>;`,`punct`),n}function ay(e,t,n){if(!e||typeof e!=`object`)return n(`unknown`,`type`);if(`const`in e)return cy(e.const,n);if(e.enum)return sy(e.enum.map(e=>({const:e})),t,n);if(e.anyOf??e.oneOf)return sy(e.anyOf??e.oneOf,t,n);if(Array.isArray(e.type))return sy(e.type.map(t=>({...e,type:t})),t,n);switch(e.type){case`string`:case`boolean`:case`null`:return n(e.type,`type`);case`number`:case`integer`:return n(`number`,`type`);case`array`:{let r=!!(e.items?.anyOf??e.items?.oneOf??e.items?.enum);return r&&n(`(`,`punct`),ay(e.items,t,n),r&&n(`)`,`punct`),n(`[]`,`punct`)}case`object`:return oy(e,t,n);default:return n(`unknown`,`type`)}}function oy(e,t,n){let r=Object.entries(e.properties??{});if(!r.length)return e.additionalProperties&&typeof e.additionalProperties==`object`?(n(`Record`,`type`),n(`<`,`punct`),n(`string`,`type`),n(`, `,`punct`),ay(e.additionalProperties,t,n),n(`>`,`punct`)):n(`{}`,`punct`);let i=new Set(e.required??[]);n(`{`,`punct`),n(`
|
|
76
|
-
`);for(let[e,a]of r){let r=ly(a);r&&n(`${ry(t+1)}${r}\n`,`comment`),n(ry(t+1)),n(ny.test(e)?e:JSON.stringify(e),`property`),n(i.has(e)?`: `:`?: `,`punct`),ay(a,t+1,n),n(`;`,`punct`),n(`
|
|
77
|
-
`)}n(ry(t)),n(`}`,`punct`)}function sy(e,t,n){e.forEach((e,r)=>{r&&n(` | `,`punct`),ay(e,t,n)})}function cy(e,t){if(typeof e==`string`)return t(JSON.stringify(e),`string`);if(typeof e==`number`)return t(String(e),`number`);t(String(e),`type`)}function ly(e){let t=[e.description,e.minimum===void 0?``:`@minimum ${e.minimum}`,e.maximum===void 0?``:`@maximum ${e.maximum}`,e.default===void 0?``:`@default ${JSON.stringify(e.default)}`].filter(Boolean);return t.length?`/** ${t.join(` `)} */`:``}var uy={key:0,class:`panel-rail`,"aria-label":`Inspector (collapsed)`},dy=[`title`],fy=[`aria-label`,`title`,`onClick`],py={key:0,class:`count`},my={class:`inspector-tabs`,role:`tablist`,"aria-label":`Session details`},hy=[`id`,`aria-selected`,`onClick`],gy={key:0,class:`count`},_y=[`title`],vy=[`aria-labelledby`],yy={class:`session-heading`},by=[`title`],xy={class:`cwd-trail`,dir:`rtl`},Sy={dir:`ltr`},Cy={class:`session-status`},wy={key:0,class:`background-pill`},Ty={class:`saved`},Ey={class:`model-section`},Dy=[`src`],Oy={class:`thinking-row`},ky=[`value`],Ay={class:`stats-section`,"aria-labelledby":`stats-title`},jy={class:`metrics`},My=[`title`],Ny={class:`usage-breakdown`,"aria-label":`Agent token and cost breakdown`},Py={scope:`row`},Fy={class:`panel-heading`},Iy={class:`hint app-state-description`},Ly=[`disabled`],Ry={class:`state-json-actions`},zy={key:0,class:`hint`},By=[`disabled`],Vy=[`disabled`],Hy={key:0,class:`message-error`,role:`alert`},Uy={class:`panel-heading`},Wy={class:`tag`},Gy={class:`hook-card`},Ky=[`aria-checked`],qy={key:0,class:`tag tool-disabled`},Jy={class:`tag`},Yy=[`aria-label`],Xy=F({__name:`Inspector`,setup(e){let t=G(()=>new Map(hu.value?.tools.map(e=>[e.name,iy(e.name,e.parameters)]))),n=[{id:`session`,label:`Session`,icon:$s},{id:`state`,label:`State`,icon:Bs},{id:`tasks`,label:`Tasks`,icon:Fs},{id:`tools`,label:`Tools`,icon:Ic},{id:`extensions`,label:`Extend`,icon:Cc}],r=G(()=>[{label:`Input`,tokens:pu.value.input,cost:pu.value.inputCost},{label:`Output`,tokens:pu.value.output,cost:pu.value.outputCost},{label:`Cache read`,tokens:pu.value.cacheRead,cost:pu.value.cacheReadCost},{label:`Cache write`,tokens:pu.value.cacheWrite,cost:pu.value.cacheWriteCost}]),i=G(()=>du.value.filter(e=>e.background).length);function a(e,t){bu(async()=>{await J.value.configure(e),await _u(),t&&yu(t)})}function o(){let e=eu.value;e&&(X.dialog={kind:`prompt`,title:`Rename session`,label:`Session name`,value:Ql.value?.name??``,submit:`Save name`,run:t=>e.rename(t)})}let s=Zl.sharedState,c=N(``),l=N(``),u=N(0),d=N(!1),f=N(``),p=G(()=>c.value!==l.value),m=G(()=>p.value&&s.value?.revision!==u.value);function h(){c.value=Cu(s.value?.value??{}),l.value=c.value,u.value=s.value?.revision??0,f.value=``}Wn(s,()=>!p.value&&h(),{immediate:!0});async function g(e){if(!d.value&&J.value){d.value=!0,f.value=``;try{await J.value.demo(`state`,e)}catch(e){f.value=Ol(e)}finally{d.value=!1}}}async function _(){if(!d.value&&J.value){f.value=``,d.value=!0;try{let e=JSON.parse(c.value);if(!e||Array.isArray(e)||typeof e!=`object`)throw Error(`App State must be a JSON object.`);let t=await J.value.demo(`state`,{operation:`update`,path:``,value:e,expectedRevision:u.value});c.value=Cu(t.value),l.value=c.value,u.value=t.revision,yu(`Shared App State saved.`)}catch(e){f.value=Ol(e)}finally{d.value=!1}}}let v=G(()=>hu.value?.config.readOnly===!0),y=G(()=>hu.value?.tools.filter(e=>e.offered).length??0);return(e,l)=>(R(),z(`aside`,{class:E([`inspector`,{collapsed:!P(Au),overlay:P(X).inspectorOverlay}])},[P(Au)?(R(),z(L,{key:1},[V(`div`,my,[(R(),z(L,null,I(n,e=>V(`button`,{id:`inspector-tab-${e.id}`,key:e.id,role:`tab`,"aria-controls":`inspector-panel`,"aria-selected":P(X).tab===e.id,class:E({active:P(X).tab===e.id}),onClick:t=>P(X).tab=e.id},[(R(),B(Yr(e.icon),{size:18})),U(k(e.label),1),e.id===`tasks`&&P(du).length?(R(),z(`span`,gy,k(P(du).length),1)):W(``,!0)],10,hy)),64)),V(`button`,{class:`icon-button panel-toggle`,"aria-label":`Collapse inspector`,title:`Collapse inspector (${P(Iu).inspector})`,onClick:l[1]||=e=>P(Mu)()},[H(P(gc),{size:18})],8,_y)]),V(`div`,{id:`inspector-panel`,class:E([`inspector-body`,{"session-panel":P(X).tab===`session`}]),role:`tabpanel`,"aria-labelledby":`inspector-tab-${P(X).tab}`},[P(X).tab===`session`?(R(),z(L,{key:0},[V(`section`,yy,[V(`h1`,null,[V(`span`,null,k(P(Ql)?.name??`Loading session`),1),V(`button`,{class:`icon-button`,title:`Rename session`,"aria-label":`Rename session`,onClick:o},[H(P(bc),{size:18})])]),V(`button`,{class:`path cwd-button`,title:P(Ql)?.cwd,"aria-label":`Show full working directory`,onClick:l[2]||=e=>P(X).dialog={kind:`path`,path:P(Ql)?.cwd??``}},[H(P($s),{size:18}),V(`span`,xy,[V(`bdi`,Sy,k(P(Ql)?.cwd),1)])],8,by),V(`div`,Cy,[V(`span`,{class:E([`status-pill`,{working:P(fu)}])},[l[7]||=V(`i`,null,null,-1),U(k(P(fu)?`Working`:`Idle`),1)],2),i.value?(R(),z(`span`,wy,k(i.value)+` background`,1)):W(``,!0),V(`span`,Ty,[H(P(Ec),{size:18}),U(k(P(ql)?.id),1)]),P(ql)?(R(),B(I_,{key:1,device:P(ql)},null,8,[`device`])):W(``,!0)])]),P(ql)?(R(),B(Q_,{key:0,device:P(ql)},null,8,[`device`])):W(``,!0),V(`section`,Ey,[l[14]||=V(`div`,{class:`section-label`},[V(`span`,null,`AGENT`)],-1),V(`button`,{class:`model-button`,onClick:l[3]||=e=>P(X).dialog={kind:`models`}},[V(`img`,{src:P(wu)(P(Y).agent.model?.modelId),alt:``},null,8,Dy),V(`div`,null,[V(`strong`,null,k(P(mu)?.name??P(Y).agent.model?.modelId??`Loading…`),1),V(`small`,null,k(P(mu)?.tier??``)+` / `+k(P(Y).agent.model?.provider??``),1)]),H(P(Us),{size:18})]),V(`div`,Oy,[l[8]||=V(`span`,null,`Thinking`,-1),V(`select`,{"aria-label":`Thinking level`,value:P(Y).agent.thinkingLevel??`low`,onChange:l[4]||=e=>a({thinkingLevel:e.target.value},`Thinking ${e.target.value}. Used on the next turn.`)},[(R(!0),z(L,null,I(P(cg),e=>(R(),z(`option`,{key:e},k(e),1))),128))],40,ky)]),H(ty),V(`section`,Ay,[l[13]||=V(`div`,{class:`section-label`},[V(`span`,{id:`stats-title`},`STATS`)],-1),V(`div`,jy,[V(`div`,{title:`${P(pu).tokens.toLocaleString(`en-US`)} total tokens`},[V(`span`,null,k(P(Su)(P(pu).tokens)),1),l[9]||=V(`small`,null,`total tokens`,-1)],8,My),V(`div`,null,[V(`span`,null,`$`+k(P(pu).cost.toFixed(4)),1),l[10]||=V(`small`,null,`agent cost`,-1)]),V(`div`,null,[V(`span`,null,k(P(hu)?.tools.length??0),1),l[11]||=V(`small`,null,`tools`,-1)])]),V(`table`,Ny,[l[12]||=V(`thead`,null,[V(`tr`,null,[V(`th`,{scope:`col`},`Type`),V(`th`,{scope:`col`},`Tokens`),V(`th`,{scope:`col`},`Cost (USD)`)])],-1),V(`tbody`,null,[(R(!0),z(L,null,I(r.value,e=>(R(),z(`tr`,{key:e.label},[V(`th`,Py,k(e.label),1),V(`td`,null,k(e.tokens.toLocaleString(`en-US`)),1),V(`td`,null,`$`+k(e.cost.toFixed(4)),1)]))),128))])])])])],64)):W(``,!0),P(X).tab===`state`?(R(),z(L,{key:1},[V(`div`,Fy,[l[15]||=V(`h2`,null,`App State`,-1),H(P(Bs),{size:18})]),V(`p`,Iy,` One shared JSON object for every agent, session and fork on `+k(P(ql)?.id)+`. You and your agents can read, create, update or delete values and fields. Changes appear live and persist across closed browsers, interrupted agents and backend restarts. `,1),Ln(V(`textarea`,{"onUpdate:modelValue":l[5]||=e=>c.value=e,class:`app-state-json`,"aria-label":`App State JSON`,spellcheck:`false`,disabled:d.value||!P(s),rows:`12`},null,8,Ly),[[ps,c.value]]),V(`div`,Ry,[m.value?(R(),z(`span`,zy,`State changed elsewhere. Load the latest JSON before saving.`)):W(``,!0),p.value?(R(),z(`button`,{key:1,class:`secondary`,disabled:d.value,onClick:h},k(m.value?`Load latest`:`Reset`),9,By)):W(``,!0),V(`button`,{class:`primary small`,disabled:!p.value||d.value||m.value,onClick:_},k(d.value?`Saving…`:`Save JSON`),9,Vy)]),f.value?(R(),z(`p`,Hy,k(f.value),1)):W(``,!0),H(A_,{value:P(s)?.value??{},disabled:d.value||p.value||!P(s),onChange:g},null,8,[`value`,`disabled`])],64)):W(``,!0),P(X).tab===`tasks`?(R(),B(kv,{key:2})):W(``,!0),P(X).tab===`extensions`?(R(),B(Lv,{key:3})):W(``,!0),P(X).tab===`tools`?(R(),z(L,{key:4},[V(`div`,Uy,[l[16]||=V(`h2`,null,`Tools`,-1),V(`span`,Wy,k(y.value)+` / `+k(P(hu)?.tools.length??0),1)]),l[20]||=V(`p`,{class:`hint`},` Every tool this agent's extensions provide. Open one to see its definition. `,-1),V(`div`,Gy,[V(`div`,null,[H(P(Oc),{size:18}),l[18]||=V(`strong`,null,`Read only`,-1),V(`button`,{class:E([`switch`,{on:v.value}]),role:`switch`,"aria-checked":v.value,"aria-label":`Read only`,onClick:l[6]||=e=>a({readOnly:!v.value},v.value?`Read only off. Every tool is back.`:`Read only on. Tools that write are disabled.`)},[...l[17]||=[V(`span`,null,null,-1)]],10,Ky)]),l[19]||=V(`p`,null,` Offers this agent only tools that read. Tools that create, update or delete leave its next request, and the choice is stored with the agent. `,-1)]),(R(!0),z(L,null,I(P(hu)?.tools,e=>(R(),z(`details`,{key:e.name,class:E([`tool-row`,{disabled:!e.offered}])},[V(`summary`,null,[H(P(Ic),{size:18}),V(`strong`,null,k(e.name),1),e.offered?W(``,!0):(R(),z(`span`,qy,`disabled`)),V(`span`,Jy,k(e.replay===`safe`?`replay safe`:`interrupt on crash`),1)]),V(`p`,null,k(e.description),1),e.parameters?(R(),z(`pre`,{key:0,class:`tool-signature`,"aria-label":`${e.name} TypeScript definition`},[V(`code`,null,[(R(!0),z(L,null,I(t.value.get(e.name),(e,t)=>(R(),z(`span`,{key:t,class:E(`tk-${e.kind}`)},k(e.text),3))),128))])],8,Yy)):W(``,!0),V(`small`,null,k(e.replay===`safe`?`An interrupted execution may run again after recovery.`:`A crash records an interrupted result instead of rerunning this effect.`),1)],2))),128))],64)):W(``,!0)],10,vy)],64)):(R(),z(`div`,uy,[V(`button`,{class:`icon-button panel-toggle`,"aria-label":`Expand inspector`,title:`Expand inspector (${P(Iu).inspector})`,onClick:l[0]||=e=>P(ju)()},[H(P(_c),{size:18})],8,dy),(R(),z(L,null,I(n,e=>V(`button`,{key:e.id,class:E([`rail-tab`,{active:P(X).tab===e.id}]),"aria-label":`Open ${e.label}`,title:e.label,onClick:t=>P(ju)(e.id)},[(R(),B(Yr(e.icon),{size:20})),e.id===`tasks`&&P(du).length?(R(),z(`span`,py,k(P(du).length),1)):W(``,!0)],10,fy)),64))]))],2))}}),Zy={class:`chat-empty`},Qy={class:`eyebrow`},$y={key:3,class:`hint offline-error`},eb={key:4,class:`offline-command`},tb={key:5,class:`hint`},nb={key:6,class:`hint`},rb={class:`offline-actions`},ib=[`disabled`],ab={key:7,class:`message-error`,role:`alert`},ob=F({__name:`OfflinePanel`,props:{device:{}},setup(e){let t=e,n=N(!1),r=N(``),i=G(()=>{let e=t.device,n=e.source===`config`;switch(e.status){case`checking`:return{title:`Checking ${e.id}…`,text:`Probing the device. This view fills in as soon as it answers.`};case`unauthorized`:return e.transport===`tunnel`?{title:`${e.id} tunnel credentials are not valid`,text:`Pair the device again — the hub will mint a fresh credential.`}:{title:e.hasToken?`${e.id} rejected its token`:`No token for ${e.id}`,text:e.hasToken?`The device's DPI_TOKEN changed (a rotate or a rebuilt device). Copy the current token into this hub's registry, then check again.`:`This hub has no token for the device yet. Register it, then check again.`,command:n&&e.kind!==`url`?`just net register ${e.id}`:`just net register ${e.id} --token <token>`};case`mismatch`:return{title:`${e.id} answers as a different device`,text:`The URL now reaches a backend with another identity (a rebuilt VM or a new data directory). If that is expected, register it again: that trusts the identity it answers with now.`,command:e.kind===`url`?`just net register ${e.id} --token <token>`:`just net register ${e.id}`};case`incompatible`:return{title:`${e.id} speaks another API version`,text:`Update the device's dpi-backend.`,command:n?`just net deploy ${e.id}`:void 0};default:return{title:`${e.id} is offline`,text:`Last seen ${Tu(e.lastSeenAt)}. Its agents keep their state on the device and resume when its backend starts again. The tree shows the last known sessions.`,command:n?e.kind===`local`?`just backend run`:e.kind===`url`?void 0:`just net restart ${e.id}`:void 0,alt:n&&e.kind!==`local`&&e.kind!==`url`?`just net up ${e.id}`:void 0}}});async function a(){n.value=!0,r.value=``;try{let e=await Dl.check(t.device.id);e.status===`online`&&yu(`${e.id} is online.`)}catch(e){r.value=Ol(e)}finally{n.value=!1}}async function o(e){try{await navigator.clipboard.writeText(e),yu(`Copied.`)}catch{yu(`Clipboard needs localhost or HTTPS. Select the text to copy.`)}}return(t,s)=>(R(),z(`section`,{class:E([`chat-panel offline-panel`,e.device.status]),"aria-live":`polite`},[V(`div`,Zy,[e.device.status===`checking`?(R(),B(P(dc),{key:0,class:`spin`,size:30})):e.device.status===`mismatch`||e.device.status===`unauthorized`?(R(),B(P(Dc),{key:1,size:30})):(R(),B(P(Nc),{key:2,size:30})),V(`span`,Qy,k(e.device.kind.toUpperCase())+` · `+k(e.device.url??(e.device.transport===`tunnel`?`tunnel`:`no endpoint`)),1),V(`h2`,null,k(i.value.title),1),V(`p`,null,k(i.value.text),1),e.device.error?(R(),z(`p`,$y,k(e.device.error),1)):W(``,!0),i.value.command?(R(),z(`div`,eb,[V(`code`,null,k(i.value.command),1),V(`button`,{class:`icon-button`,"aria-label":`Copy command`,onClick:s[0]||=e=>o(i.value.command)},[H(P(Js),{size:18})])])):W(``,!0),i.value.command?(R(),z(`p`,tb,`Run it in this repo's terminal, then press Check now.`)):W(``,!0),i.value.alt?(R(),z(`p`,nb,[s[2]||=U(` Never deployed or rebuilt? `,-1),V(`code`,null,k(i.value.alt),1),s[3]||=U(` provisions it from scratch. `,-1)])):W(``,!0),V(`div`,rb,[V(`button`,{class:`secondary`,disabled:n.value,onClick:s[1]||=e=>a()},[H(P(wc),{size:18}),U(k(n.value?`Checking…`:`Check now`),1)],8,ib)]),r.value?(R(),z(`p`,ab,k(r.value),1)):W(``,!0)])],2))}}),sb={class:`dir-browser`},cb={class:`dir-path`},lb=[`disabled`],ub=[`aria-busy`],db=[`title`],fb=[`aria-selected`,`title`,`onClick`],pb={key:1,class:`hint`},mb={key:0,class:`message-error`,role:`alert`},hb=F({__name:`DirBrowser`,props:ri({deviceId:{}},{modelValue:{required:!0},modelModifiers:{}}),emits:[`update:modelValue`],setup(e){let t=e,n=Ci(e,`modelValue`),r=N(),i=N(!1),a=N(``),o=0;async function s(e){let s=++o,c=t.deviceId;i.value=!0,a.value=``;try{let t=await Tl(c).dirs(e);return s===o?(r.value=t,t.path&&(n.value=t.path),t):void 0}catch(e){s===o&&(a.value=Ol(e));return}finally{s===o&&(i.value=!1)}}return Wn(()=>t.deviceId,async()=>{r.value=void 0;let e=await s(``),t=e?.dirs[0];t&&!e.path&&await s(t.path)},{immediate:!0}),(e,t)=>(R(),z(`div`,sb,[V(`div`,cb,[Ln(V(`input`,{"onUpdate:modelValue":t[0]||=e=>n.value=e,"aria-label":`Working directory`,required:``,placeholder:`/path/to/project`,spellcheck:`false`,autocomplete:`off`,onKeydown:t[1]||=Ts(Cs(e=>s(n.value),[`prevent`]),[`enter`])},null,544),[[ps,n.value]]),V(`button`,{type:`button`,class:`secondary small`,disabled:i.value||!n.value,onClick:t[2]||=e=>s(n.value)},` Go `,8,lb)]),V(`div`,{class:`dir-list`,role:`listbox`,"aria-label":`Directories`,"aria-busy":i.value},[V(`button`,{type:`button`,class:`dir-item`,title:`Start directories`,onClick:t[3]||=e=>s(``)},[H(P(rc),{size:16}),t[5]||=V(`span`,null,`Start dirs`,-1)]),r.value?.parent?(R(),z(`button`,{key:0,type:`button`,class:`dir-item`,title:r.value.parent,onClick:t[4]||=e=>s(r.value.parent)},[H(P(Xs),{size:16}),t[6]||=V(`span`,null,`..`,-1)],8,db)):W(``,!0),(R(!0),z(L,null,I(r.value?.dirs,e=>(R(),z(`button`,{key:e.path,type:`button`,class:`dir-item`,role:`option`,"aria-selected":e.path===n.value,title:e.path,onClick:t=>s(e.path)},[e.path===n.value?(R(),B(P($s),{key:0,size:16})):(R(),B(P(ec),{key:1,size:16})),V(`span`,null,k(e.name),1)],8,fb))),128)),r.value&&!r.value.dirs.length?(R(),z(`p`,pb,`No subdirectories.`)):W(``,!0)],8,ub),a.value?(R(),z(`p`,mb,k(a.value),1)):W(``,!0)]))}}),gb={key:0,class:`message-error`},_b=[`value`],vb={class:`field`},yb=[`value`],bb={key:2,class:`message-error`,role:`alert`},xb=[`disabled`],Sb=F({__name:`NewSessionDialog`,props:{deviceId:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>Bl.devices.value.filter(e=>e.status===`online`)),a=N(i.value.find(e=>e.id===n.deviceId)?.id??i.value[0]?.id??``),o=G(()=>i.value.find(e=>e.id===a.value)),s=G(()=>o.value?.info?.models??[]),c=e=>`${e.provider}/${e.id}`,l=N({name:``,cwd:``,model:``}),u=N(!1),d=N(``);Wn(o,e=>{let t=e?.info?.models.find(t=>t.id===e.info?.defaultModel)??e?.info?.models[0];l.value.model=t?c(t):``,l.value.cwd=``},{immediate:!0});async function f(){if(!u.value&&o.value){u.value=!0,d.value=``;try{let e=s.value.find(e=>c(e)===l.value.model);if(!e)throw Error(`Choose a model`);let t=await Tl(o.value.id).createSession({name:l.value.name.trim()||`New session`,cwd:l.value.cwd.trim(),model:{provider:e.provider,modelId:e.id}}),n=t.agents.find(e=>e.kind===`root`)??t.agents[0];tu({deviceId:o.value.id,sessionId:t.id,agentId:n?.id??1}),yu(`Session created on ${o.value.id}.`),r(`close`)}catch(e){d.value=Ol(e)}finally{u.value=!1}}}return(e,t)=>(R(),z(`div`,{class:`modal-backdrop`,onClick:t[6]||=Cs(e=>r(`close`),[`self`])},[V(`form`,{class:`modal session-modal`,onSubmit:Cs(f,[`prevent`])},[V(`header`,null,[t[7]||=V(`div`,null,[V(`span`,{class:`eyebrow`},`A PERSISTENT WORKSPACE`),V(`h2`,null,`New session`)],-1),V(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close new session`,onClick:t[0]||=e=>r(`close`)},[H(P(Lc),{size:18})])]),i.value.length?(R(),z(L,{key:1},[V(`label`,null,[t[8]||=U(`Device`,-1),Ln(V(`select`,{"onUpdate:modelValue":t[1]||=e=>a.value=e,"aria-label":`Device`},[(R(!0),z(L,null,I(i.value,e=>(R(),z(`option`,{key:e.id,value:e.id},k(e.id)+` · `+k(e.info?.hostname??e.url),9,_b))),128))],512),[[gs,a.value]])]),V(`label`,null,[t[9]||=U(`Session name`,-1),Ln(V(`input`,{"onUpdate:modelValue":t[2]||=e=>l.value.name=e,autofocus:``,placeholder:`My durable agent`,maxlength:`100`},null,512),[[ps,l.value.name]])]),V(`div`,vb,[V(`span`,null,`Working directory on `+k(a.value),1),H(hb,{modelValue:l.value.cwd,"onUpdate:modelValue":t[3]||=e=>l.value.cwd=e,"device-id":a.value},null,8,[`modelValue`,`device-id`])]),V(`label`,null,[t[10]||=U(`Model`,-1),Ln(V(`select`,{"onUpdate:modelValue":t[4]||=e=>l.value.model=e,"aria-label":`New session model`},[(R(!0),z(L,null,I(s.value,e=>(R(),z(`option`,{key:c(e),value:c(e)},k(e.tier)+` / `+k(e.name),9,yb))),128))],512),[[gs,l.value.model]])])],64)):(R(),z(`p`,gb,` No device is online. Start one with just backend run or just net up <id>, then try again. `)),d.value?(R(),z(`p`,bb,k(d.value),1)):W(``,!0),V(`footer`,null,[V(`button`,{type:`button`,class:`secondary`,onClick:t[5]||=e=>r(`close`)},`Cancel`),V(`button`,{class:`primary`,disabled:u.value||!l.value.model||!l.value.cwd||!o.value},[H(P(Sc),{size:18}),U(k(u.value?`Creating…`:`Create session`),1)],8,xb)])],32)]))}}),Cb=new Uint8Array(512),wb=new Uint8Array(256);(()=>{let e=1;for(let t=0;t<255;t++)Cb[t]=e,wb[e]=t,e<<=1,e&256&&(e^=285);for(let e=255;e<512;e++)Cb[e]=Cb[e-255]})();var Tb=(e,t)=>e===0||t===0?0:Cb[wb[e]+wb[t]];function Eb(e){let t=[1];for(let n=0;n<e;n++){let e=Array(t.length+1).fill(0);for(let r=0;r<t.length;r++)e[r]^=t[r],e[r+1]^=Tb(t[r],Cb[n]);t=e}return t}function Db(e,t){let n=Eb(t),r=Array(t).fill(0);for(let i of e){let e=i^r[0];r.shift(),r.push(0);for(let i=0;i<t;i++)r[i]^=Tb(n[i+1],e)}return r}var Ob=[21,25,29,33,37],kb=[19,34,55,80,108],Ab=[7,10,15,20,26],jb=[[],[6,18],[6,22],[6,26],[6,30]];function Mb(e){for(let t=1;t<=5;t++)if(e+2<=kb[t-1])return t;throw Error(`qr: payload too long (${e} bytes; v5L max ${kb[4]-2})`)}function Nb(e,t){let n=[...new TextEncoder().encode(e)],r=[],i=(e,t)=>{for(let n=t-1;n>=0;n--)r.push(e>>n&1)};i(4,4),i(n.length,8);for(let e of n)i(e,8);let a=kb[t-1],o=a*8;for(i(0,Math.min(4,o-r.length));r.length%8!=0;)r.push(0);let s=[236,17],c=0;for(;r.length<o;)i(s[c++%2],8);let l=[];for(let e=0;e<a;e++){let t=0;for(let n=0;n<8;n++)t=t<<1|r[e*8+n];l.push(t)}return l}function Pb(e){return Array.from({length:e},()=>Array(e).fill(!1))}function Fb(e,t){let n=Ob[t-1],r=(t,r)=>{for(let i=-1;i<=7;i++)for(let a=-1;a<=7;a++){let o=t+i,s=r+a;if(o<0||o>=n||s<0||s>=n)continue;let c=i>=0&&i<=6&&a>=0&&a<=6&&(i===0||i===6||a===0||a===6),l=i>=2&&i<=4&&a>=2&&a<=4;e[o][s]=c||l}};r(0,0),r(0,n-7),r(n-7,0);for(let t=8;t<n-8;t++)e[6][t]=t%2==0,e[t][6]=t%2==0;let i=jb[t-1];for(let t of i)for(let r of i)if(!(t<=8&&r<=8||t<=8&&r>=n-9||t>=n-9&&r<=8))for(let n=-2;n<=2;n++)for(let i=-2;i<=2;i++)e[t+n][r+i]=Math.max(Math.abs(n),Math.abs(i))!==1;e[n-8][8]=!0}function Ib(e){let t=8|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>9&1?1335:0);let r=(t<<10|n)^21522,i=[];for(let e=14;e>=0;e--)i.push((r>>e&1)==1);return i}function Lb(e,t){let n=Ob[0]*0+e.length,r=Ib(t);for(let t=0;t<=5;t++)e[8][t]=r[t];e[8][7]=r[6],e[8][8]=r[7],e[7][8]=r[8];for(let t=9;t<15;t++)e[14-t][8]=r[t];for(let t=0;t<7;t++)e[n-1-t][8]=r[t];e[8][n-8]=r[7];for(let t=8;t<15;t++)e[8][n-15+t]=r[t];e[n-8][8]=!0}function Rb(e,t,n,r){let i=e.length;Ob[n-1]*Ob[n-1];let a=e=>((t[e>>3]??0)>>7-(e&7)&1)==1,o=0,s=!0;for(let t=i-1;t>0;t-=2){t===6&&t--;for(let c=0;c<i;c++){let l=s?i-1-c:c;for(let i of[t,t-1]){if(Bb(l,i,n))continue;if(o>=(kb[n-1]+Ab[n-1])*8){o++;continue}let t=a(o++);zb(l,i,r)&&(t=!t),e[l][i]=t}}s=!s}}function zb(e,t,n){switch(n){case 0:return(e+t)%2==0;case 1:return e%2==0;case 2:return t%3==0;case 3:return(e+t)%3==0;case 4:return(Math.floor(e/2)+Math.floor(t/3))%2==0;case 5:return e*t%2+e*t%3==0;case 6:return(e*t%2+e*t%3)%2==0;default:return((e+t)%2+e*t%3)%2==0}}function Bb(e,t,n){let r=Ob[n-1];if(e<=8&&t<=8||e<=8&&t>=r-8||e>=r-8&&t<=8||e===6||t===6)return!0;let i=jb[n-1];for(let n of i)for(let a of i)if(!(n<=8&&a<=8||n<=8&&a>=r-9||n>=r-9&&a<=8)&&Math.abs(e-n)<=2&&Math.abs(t-a)<=2)return!0;return!1}function Vb(e){let t=e.length,n=0;for(let r=0;r<2;r++)for(let i=0;i<t;i++){let a=1;for(let o=1;o<t;o++)(r===0?e[i][o]:e[o][i])===(r===0?e[i][o-1]:e[o-1][i])?(a++,o===t-1&&a>=5&&(n+=3+(a-5))):(a>=5&&(n+=3+(a-5)),a=1)}for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=e[r][i];e[r][i+1]===t&&e[r+1][i]===t&&e[r+1][i+1]===t&&(n+=3)}let r=[!0,!1,!0,!0,!0,!1,!0,!1,!1,!1,!1],i=(e,t)=>{for(let i=0;i+11<=t;i++){let t=!0;for(let n=0;n<11;n++)if(e(i+n)!==r[n]){t=!1;break}t&&(n+=40)}};for(let n=0;n<t;n++)i(t=>e[n][t],t);for(let n=0;n<t;n++)i(t=>e[t][n],t);let a=0;for(let t of e)for(let e of t)e&&a++;let o=a*100/(t*t);return n+=Math.floor(Math.abs(o-50)/5)*10,n}function Hb(e,t){let n=Mb(new TextEncoder().encode(e).length),r=Ob[n-1],i=Nb(e,n),a=Db(i,Ab[n-1]),o=[...i,...a],s=Pb(r);return Fb(s,n),Rb(s,o,n,t),Lb(s,t),s}function Ub(e,t){if(t!==void 0)return Hb(e,t);let n;for(let t=0;t<8;t++){let r=Hb(e,t),i=Vb(r);(!n||i<n.score)&&(n={m:r,score:i})}return n.m}function Wb(e,t=160){let n=Ub(e),r=n.length,i=t/(r+8),a=``;for(let e=0;e<r;e++)for(let t=0;t<r;t++)n[e][t]&&(a+=`<rect x="${((t+4)*i).toFixed(2)}" y="${((e+4)*i).toFixed(2)}" width="${i.toFixed(3)}" height="${i.toFixed(3)}"/>`);return`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${t} ${t}" shape-rendering="crispEdges"><rect width="${t}" height="${t}" fill="#fff"/><g fill="#000">${a}</g></svg>`}function Gb(e){if(!/^\/pair\/?$/.test(e.pathname))return;let t=e.searchParams;if(!t.has(`code`)&&!t.has(`origin`)&&!t.has(`v`))return;let n=t.get(`code`);if(e.username||e.password||e.hash||t.getAll(`code`).length!==1||!n||!/^[A-Z2-7]{8}$/.test(n)||t.getAll(`v`).length!==1||t.get(`v`)!==`1`)return{error:`Invalid pairing link. Use a complete version 1 link from the hub wizard.`};if(t.has(`origin`))try{let n=new URL(t.get(`origin`));if(t.getAll(`origin`).length!==1||n.origin!==e.origin||n.pathname!==`/`||n.username||n.password||n.search||n.hash)throw Error(`origin mismatch`)}catch{return{error:`This pairing link does not belong to this hub. Open the original hub link instead.`}}return{code:n,origin:e.origin}}var Kb=e=>/^\/pair\/?$/.test(e.pathname)?`/`:void 0,qb=e=>/^\/pair\/?$/.test(e.pathname)&&Gb(e)===void 0?`/`:void 0,Jb=4e3;async function Yb(e){if(!e.needsCancel)return{closed:!0,confirmed:!0};let t,n=await Promise.race([e.cancel().catch(()=>`failed`),new Promise(n=>t=setTimeout(()=>n(`failed`),e.timeoutMs))]);return clearTimeout(t),{closed:n!==`issued`,confirmed:n===`cancelled`}}var Xb={class:`modal pair-wizard`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`pair-title`},Zb={key:0,class:`hint`},Qb={class:`pair-steps`,"aria-label":`Pairing progress`},$b={class:`pair-grid`},ex={class:`pair-code-box`},tx={class:`pair-code`,"aria-label":`Pairing code`},nx=[`innerHTML`],rx={class:`pair-side`},ix={key:0,class:`hint`},ax={class:`pair-fingerprint`},ox={class:`fp`},sx={class:`pair-confirm`},cx={key:0,class:`pair-confirm warn`},lx=[`disabled`],ux=[`disabled`],dx={class:`hint`},fx=[`disabled`],px={key:5,class:`error`,role:`alert`},mx={key:2},hx={class:`error`,role:`alert`},gx=F({__name:`PairDeviceWizard`,props:{handoff:{}},emits:[`close`],setup(e,{expose:t,emit:n}){let r=n,i=e,a=N(`boot`),o=N(),s=N(),c=N(),l=N(``),u=N(!1),d=N(!1),f=N(!1),p=N(!1),m=N(!1),h=N(),g=G(()=>{let e=s.value?.code??``;return e.length===8?`${e.slice(0,4)}-${e.slice(4)}`:e}),_=G(()=>s.value?s.value.pairUrl:``),v=G(()=>_.value?Wb(_.value,148):``),y=G(()=>c.value?.enrollment?.keyFingerprint??``),b=G(()=>c.value?.deviceId??``);Wn(b,e=>{h.value?.(),e&&(h.value=Wn(()=>Bl.devices.value.find(t=>t.id===e)?.status,e=>{e===`online`&&(yu(`Device paired and online.`),h.value?.(),h.value=void 0)},{immediate:!0}))});async function x(e){a.value=`boot`,l.value=``,f.value=!1,p.value=!1,c.value=void 0,s.value=void 0,o.value?.close();let t=B_();o.value=t;try{let n=e?await R_.resolveCode(e):await R_.createCode();if(t.closed()){await R_.cancel(n.codeId).catch(()=>{yu(`The late pairing code could not be cancelled. Check device credentials before retrying.`)});return}if(s.value=n,a.value=`code`,e){let e=Kb(new URL(window.location.href));e&&window.history.replaceState(window.history.state,``,e)}U_(t,n.codeId,{intervalMs:1e3,onState:e=>{c.value=e,e.phase===`awaiting_proof`?a.value=`proof`:e.phase===`awaiting_approval`||e.phase===`approved`?a.value=`approve`:e.phase===`issued`||e.phase===`connected`?a.value=`issued`:e.phase===`cancelled`?a.value=`cancelled`:e.phase===`expired`&&(a.value=`expired`)}}).catch(e=>{t.closed()||(l.value=e instanceof Error?e.message:String(e),a.value=`expired`)})}catch(e){l.value=e instanceof Error?e.message:String(e),a.value=`expired`}}async function ee(){let e=c.value,t=o.value;if(e?.enrollment&&t&&!u.value){u.value=!0,l.value=``;try{let t=await R_.approve(s.value.codeId,{enrollmentId:e.enrollment.enrollmentId,deviceUid:e.enrollment.deviceUid,keyFingerprint:e.enrollment.keyFingerprint,...p.value?{replaceKey:!0}:{}});c.value=t,(t.phase===`issued`||t.phase===`connected`)&&(a.value=`issued`)}catch(e){l.value=e instanceof Error?e.message:String(e)}finally{u.value=!1}}}async function S(e){if(!s.value)return`cancelled`;try{let t=await R_.cancel(s.value.codeId,void 0,e);return c.value=t,o.value&&(o.value.state=t),a.value=t.phase===`expired`?`expired`:`cancelled`,o.value?.close(),`cancelled`}catch(e){if(e instanceof fl&&e.status===409&&String(e.code)===`already_issued`){let e=await R_.codeState(s.value.codeId).catch(()=>void 0);return e&&(c.value=e,o.value&&(o.value.state=e)),a.value=`issued`,l.value=`Credential already issued. Closing does not revoke it; choose Revoke explicitly if needed.`,`issued`}return l.value=e instanceof Error?e.message:String(e),`failed`}}let te=()=>S(!1),C=()=>[`issued`,`connected`,`cancelled`,`expired`].includes(c.value?.phase??``);async function ne(){let e=b.value;if(e){u.value=!0;try{await R_.revoke(e,`user`),yu(`Issued credential revoked.`),r(`close`)}catch(e){l.value=e instanceof Error?e.message:String(e)}finally{u.value=!1}}}async function re(){if(s.value)try{await navigator.clipboard.writeText(s.value.code),m.value=!0,setTimeout(()=>m.value=!1,1500)}catch{l.value=`Clipboard unavailable; copy the code manually.`}}async function w(){if(!d.value){d.value=!0,u.value=!0;try{let e=await Yb({needsCancel:!!s.value&&!C(),cancel:te,timeoutMs:Jb});if(!e.closed)return;o.value?.close(),h.value?.(),e.confirmed||yu(`Pairing cancellation was not confirmed. The code expires on its own; check device credentials before retrying.`),r(`close`)}finally{d.value=!1,u.value=!1}}}return t({close:w}),Lr(()=>{if(i.handoff&&`error`in i.handoff){l.value=i.handoff.error,a.value=`expired`;return}x(i.handoff?.code)}),Br(()=>{let e=o.value;e&&!e.closed()&&s.value&&!C()&&S(!0).then(e=>{e!==`cancelled`&&yu(`Pairing cancellation was not confirmed. Check device credentials before retrying.`)}),e?.close(),h.value?.()}),(e,t)=>(R(),z(`div`,{class:`modal-backdrop`,onClick:Cs(w,[`self`])},[V(`div`,Xb,[V(`header`,null,[t[5]||=V(`h2`,{id:`pair-title`},`Pair a device`,-1),V(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close dialog`,onClick:w},[H(P(Lc),{size:18})])]),a.value===`boot`?(R(),z(`p`,Zb,`Minting a pairing code…`)):s.value?(R(),z(L,{key:1},[V(`ol`,Qb,[t[6]||=V(`li`,{class:E({on:!0})},`Code`,-1),V(`li`,{class:E({on:[`proof`,`approve`,`issued`].includes(a.value)})},`Proof`,2),V(`li`,{class:E({on:[`approve`,`issued`].includes(a.value)})},`Fingerprint`,2),V(`li`,{class:E({on:a.value===`issued`})},`Online`,2)]),V(`div`,$b,[V(`div`,ex,[V(`div`,tx,k(g.value),1),V(`button`,{type:`button`,class:`small`,onClick:re},[H(P(Js),{size:14}),U(` `+k(m.value?`Copied`:`Copy code`),1)]),t[7]||=V(`p`,{class:`hint`},` Run the device pairing command and scan, or enter this code on the device. Expires in 5 minutes. `,-1),V(`div`,{class:`pair-qr`,"aria-label":`Pairing QR code`,innerHTML:v.value},null,8,nx)]),V(`div`,rx,[a.value===`code`||a.value===`proof`?(R(),z(`p`,ix,[H(P(wc),{size:14,class:`spin`}),t[8]||=U(` Waiting for the device to submit its signing proof… `,-1)])):a.value===`approve`?(R(),z(L,{key:1},[V(`div`,ax,[t[9]||=V(`h3`,null,`Device key fingerprint`,-1),V(`code`,ox,k(y.value),1),t[10]||=V(`p`,{class:`hint`},` Compare ALL 64 hex characters with the fingerprint shown on the device screen. `,-1)]),V(`label`,sx,[Ln(V(`input`,{"onUpdate:modelValue":t[0]||=e=>f.value=e,type:`checkbox`},null,512),[[ms,f.value]]),t[11]||=U(` The fingerprint matches the device display exactly `,-1)]),c.value?.enrollment?.keyChanged?(R(),z(`label`,cx,[Ln(V(`input`,{"onUpdate:modelValue":t[1]||=e=>p.value=e,type:`checkbox`},null,512),[[ms,p.value]]),H(P(Dc),{size:14}),t[12]||=U(` Device is already paired with a DIFFERENT key — replace the stored key (replaceKey) `,-1)])):W(``,!0),V(`button`,{type:`button`,class:`primary`,disabled:!f.value||u.value||c.value?.enrollment?.keyChanged===!0&&!p.value,onClick:ee},` Approve device `,8,lx),V(`button`,{type:`button`,class:`small`,disabled:u.value,onClick:te},` Cancel pairing `,8,ux)],64)):a.value===`issued`?(R(),z(L,{key:2},[V(`p`,dx,[H(P(Gs),{size:14}),t[13]||=U(` Credential issued. The device is connecting through the tunnel — you will get a toast once the monitor probe reports it online. `,-1)]),V(`button`,{type:`button`,class:`small`,onClick:w},`Close`),V(`button`,{type:`button`,class:`small danger`,disabled:!b.value||u.value,title:`Mistaken approval? Revoke the credential now.`,onClick:ne},` Revoke this credential `,8,fx)],64)):a.value===`cancelled`?(R(),z(L,{key:3},[t[14]||=V(`p`,{class:`hint`},`Pairing was cancelled (or the signature failed too many times).`,-1),V(`button`,{type:`button`,class:`small`,onClick:t[2]||=e=>x()},`Start over`)],64)):a.value===`expired`?(R(),z(L,{key:4},[t[15]||=V(`p`,{class:`hint`},`The pairing code expired.`,-1),V(`button`,{type:`button`,class:`small`,onClick:t[3]||=e=>x()},`New code`)],64)):W(``,!0),l.value?(R(),z(`p`,px,k(l.value),1)):W(``,!0)])])],64)):(R(),z(`div`,mx,[V(`p`,hx,k(l.value||`This pairing link is unavailable.`),1),V(`button`,{type:`button`,class:`small`,onClick:t[4]||=e=>x()},`New code`)]))])]))}}),_x={class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`device-credentials-title`},vx={class:`hint`},yx={key:1,class:`hint`},bx=F({__name:`DeviceCredentialsDialog`,props:{deviceId:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=G(()=>Bl.devices.value.find(e=>e.id===n.deviceId));return(e,t)=>(R(),z(`div`,{class:`modal-backdrop`,onClick:t[2]||=Cs(e=>r(`close`),[`self`])},[V(`section`,_x,[V(`header`,null,[t[3]||=V(`h2`,{id:`device-credentials-title`},`Device credentials`,-1),V(`button`,{class:`icon-button`,"aria-label":`Close device credentials`,onClick:t[0]||=e=>r(`close`)},[H(P(Lc),{size:18})])]),i.value?(R(),z(L,{key:0},[V(`p`,null,[U(k(i.value.name)+` `,1),V(`code`,null,k(i.value.id),1)]),V(`p`,vx,k(i.value.status)+` · tunnel `+k(i.value.tunnel?.state??`disconnected`)+` · `+k(i.value.tunnel?.readerCount??0)+` readers `,1),H(Q_,{device:i.value},null,8,[`device`])],64)):(R(),z(`p`,yx,`This device is no longer in the registry.`)),V(`footer`,null,[V(`button`,{class:`secondary`,onClick:t[1]||=e=>r(`close`)},`Close`)])])]))}}),xx={id:`prompt-title`},Sx=[`disabled`],Cx={key:0,class:`hint`},wx={key:1},Tx={key:0,class:`muted`},Ex=[`placeholder`,`disabled`],Dx=[`required`,`placeholder`,`aria-label`,`disabled`],Ox={key:2,class:`message-error`,role:`alert`},kx=[`disabled`],Ax=[`disabled`],jx=F({__name:`PromptDialog`,props:{dialog:{}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,i=N(n.dialog.value??``),a=N(!1),o=N(``),s=N(),c=!!n.dialog.label;async function l(){if(!a.value&&(!c||n.dialog.optional||i.value.trim())){a.value=!0,o.value=``;try{await n.dialog.run(i.value.trim()),r(`close`)}catch(e){o.value=Ol(e)}finally{a.value=!1}}}return Lr(()=>void wn(()=>(s.value?.focus(),s.value?.select()))),(t,n)=>(R(),z(`div`,{class:`modal-backdrop`,onClick:n[4]||=Cs(e=>!a.value&&r(`close`),[`self`])},[V(`form`,{class:`modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`prompt-title`,onSubmit:Cs(l,[`prevent`])},[V(`header`,null,[V(`h2`,xx,k(e.dialog.title),1),V(`button`,{type:`button`,class:`icon-button`,"aria-label":`Close dialog`,disabled:a.value,onClick:n[0]||=e=>r(`close`)},[H(P(Lc),{size:18})],8,Sx)]),e.dialog.hint?(R(),z(`p`,Cx,k(e.dialog.hint),1)):W(``,!0),c?(R(),z(`label`,wx,[U(k(e.dialog.label)+` `,1),e.dialog.optional?(R(),z(`span`,Tx,`(optional)`)):W(``,!0),e.dialog.multiline?Ln((R(),z(`textarea`,{key:1,ref_key:`input`,ref:s,"onUpdate:modelValue":n[1]||=e=>i.value=e,rows:`4`,placeholder:e.dialog.placeholder,disabled:a.value},null,8,Ex)),[[ps,i.value]]):Ln((R(),z(`input`,{key:2,ref_key:`input`,ref:s,"onUpdate:modelValue":n[2]||=e=>i.value=e,maxlength:`100`,required:!e.dialog.optional,placeholder:e.dialog.placeholder,"aria-label":e.dialog.label,disabled:a.value},null,8,Dx)),[[ps,i.value]])])):W(``,!0),o.value?(R(),z(`p`,Ox,k(o.value),1)):W(``,!0),V(`footer`,null,[V(`button`,{type:`button`,class:`secondary`,disabled:a.value,onClick:n[3]||=e=>r(`close`)},` Cancel `,8,kx),V(`button`,{class:E([`primary`,{danger:e.dialog.danger}]),disabled:a.value||c&&!e.dialog.optional&&!i.value.trim()},k(a.value?`Working…`:e.dialog.submit),11,Ax)])],32)]))}}),Mx={class:`modal model-modal`},Nx={class:`eyebrow`},Px={class:`model-list`},Fx=[`onClick`],Ix=[`src`],Lx={class:`hint`},Rx=F({__name:`ModelPicker`,emits:[`close`],setup(e,{emit:t}){let n=t,r=N(``),i=G(()=>cu.value.filter(e=>`${e.name} ${e.id} ${e.tier}`.toLowerCase().includes(r.value.toLowerCase()))),a=e=>e.id===Y.value.agent.model?.modelId&&e.provider===Y.value.agent.model?.provider;async function o(e){await bu(()=>J.value.configure({model:{provider:e.provider,modelId:e.id}}))&&(await _u(),yu(`Model saved. Used on the next turn.`),n(`close`))}return(e,t)=>(R(),z(`div`,{class:`modal-backdrop`,onClick:t[2]||=Cs(e=>n(`close`),[`self`])},[V(`section`,Mx,[V(`header`,null,[V(`div`,null,[V(`span`,Nx,`PER AGENT · `+k(P(ql)?.id),1),t[3]||=V(`h2`,null,`Choose a model`,-1)]),V(`button`,{class:`icon-button`,"aria-label":`Close model picker`,onClick:t[0]||=e=>n(`close`)},[H(P(Lc),{size:18})])]),Ln(V(`input`,{"onUpdate:modelValue":t[1]||=e=>r.value=e,placeholder:`Search models or tiers…`,"aria-label":`Search models`},null,512),[[ps,r.value]]),V(`div`,Px,[(R(!0),z(L,null,I(i.value,e=>(R(),z(`button`,{key:`${e.provider}/${e.id}`,class:E({selected:a(e)}),onClick:t=>o(e)},[V(`img`,{src:P(wu)(e.id),alt:``},null,8,Ix),V(`div`,null,[V(`strong`,null,k(e.name),1),V(`small`,null,k(e.tier)+` / `+k(e.provider)+` / `+k(P(Su)(e.contextWindow))+` context`,1)]),a(e)?(R(),B(P(Hs),{key:0,size:18})):W(``,!0)],10,Fx))),128))]),V(`p`,Lx,`Models available on `+k(P(ql)?.id)+`. Provider keys stay on the device.`,1)])]))}}),zx={class:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`help-title`},Bx={class:`dialog-head`},Vx={class:`dialog-body`},Hx={class:`n`},Ux={class:`body`},Wx={class:`help-callout`},Gx={class:`dialog-foot`},Kx={class:`right`},qx=F({__name:`HelpDialog`,setup(e){let t=[{title:`Pick a device, start a session`,body:`Every device in the tree runs dpi-backend. A session gets its own SQLite database on that device, in the directory you choose.`},{title:`Send work, then close the browser`,body:`The device owns the run. Reopening restores committed messages, state and live progress.`},{title:`Change state and fork`,body:`Edit App State by hand or through the agent. Every session and fork on a device shares it.`},{title:`Interrupt deliberately`,body:`Interrupt stops foreground work and owned subagents. Background jobs continue. Stop all includes them.`},{title:`Explore the boundaries`,body:`Queue a follow-up, steer after tools, wait for approval, compact context, reset or inspect raw state.`},{title:`Restart a device`,body:`Its tree dims and shows the restart command. Checkpointed jobs recover on boot. Replay-safe tools may rerun. Other interrupted tools return an error.`}];return(e,n)=>(R(),z(`div`,{class:`scrim`,onClick:n[2]||=Cs(e=>P(X).dialog=void 0,[`self`])},[V(`section`,zx,[V(`div`,Bx,[n[3]||=V(`div`,null,[V(`span`,{class:`dialog-eyebrow`},`LEARN BY DOING`),V(`h3`,{id:`help-title`},`What makes this durable?`)],-1),V(`button`,{class:`icon-button`,"aria-label":`Close help`,onClick:n[0]||=e=>P(X).dialog=void 0},[H(P(Lc),{size:18})])]),V(`div`,Vx,[(R(),z(L,null,I(t,(e,t)=>V(`div`,{key:e.title,class:`help-step`},[V(`span`,Hx,k(String(t+1).padStart(2,`0`)),1),V(`div`,null,[V(`b`,null,k(e.title),1),V(`div`,Ux,k(e.body),1)])])),64)),V(`div`,Wx,[H(P(ic),{size:18}),n[4]||=V(`span`,null,`Durable does not mean exactly-once external effects. Checkpoints protect progress. Tools still need their own idempotency.`,-1)])]),V(`div`,Gx,[V(`div`,Kx,[V(`button`,{class:`secondary`,type:`button`,onClick:n[1]||=e=>P(X).dialog=void 0},`Close`)])])])]))}}),Jx={key:0,class:`toast`,role:`status`},Yx=F({__name:`Toast`,setup(e){return(e,t)=>(R(),B(go,{name:`toast`},{default:In(()=>[P(X).toast?(R(),z(`div`,Jx,[H(P(Hs),{size:18}),U(k(P(X).toast),1)])):W(``,!0)]),_:1}))}}),Xx={class:`shell`,"data-testid":`app-shell`},Zx={key:0,class:`error-banner`,role:`alert`},Qx={key:4,class:`welcome`,"data-testid":`welcome-empty`},$x=[`disabled`],eS={class:`welcome-features`},tS={class:`modal path-modal`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`path-title`},nS={class:`full-directory`},rS=F({__name:`App`,setup(e){let t=()=>Bl.devices.value.filter(e=>e.status===`online`).length,n=N();function r(){X.dialog={kind:`new-session`,deviceId:q.value?.deviceId}}function i(e){let t=X.dialog?void 0:Lu(e);if(t)return e.preventDefault(),t===`tree`?Nu():Pu();if(e.key===`Escape`){if(X.dialog){X.dialog.kind===`pair`?n.value?.close():X.dialog=void 0;return}!e.repeat&&!e.isComposing&&fu.value&&(e.preventDefault(),Du()),X.drawer=!1,X.inspectorOverlay=!1}}function a(e){let t=e.clientX,n=Ul.value,r=e=>Ul.value=Math.max(220,Math.min(560,n+e.clientX-t)),i=()=>{window.removeEventListener(`pointermove`,r),window.removeEventListener(`pointerup`,i)};window.addEventListener(`pointermove`,r),window.addEventListener(`pointerup`,i)}return Lr(()=>{document.addEventListener(`keydown`,i),ou()}),Br(()=>{Rl.stop(),document.removeEventListener(`keydown`,i)}),(e,i)=>(R(),z(`div`,Xx,[H(Gu,{onNewSession:r}),P(X).error?(R(),z(`div`,Zx,[H(P(ic),{size:18}),V(`span`,null,k(P(X).error),1),V(`button`,{class:`icon-button`,"aria-label":`Dismiss error`,onClick:i[0]||=e=>P(X).error=``},`×`)])):W(``,!0),V(`main`,{class:`net-workspace`,style:T({"--tree-w":`${P(Ul)}px`})},[H(Td),P(Wl).tree?(R(),z(`div`,{key:0,class:`tree-resizer`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize network tree`,onPointerdown:Cs(a,[`prevent`])},null,32)):W(``,!0),P(X).drawer?(R(),z(`div`,{key:1,class:`tree-backdrop`,onClick:i[1]||=e=>P(X).drawer=!1})):W(``,!0),P(q)&&P(ql)&&P(Jl)?(R(),z(L,{key:2},[H(Xy),P(X).inspectorOverlay?(R(),z(`div`,{key:0,class:`inspector-backdrop`,onClick:i[2]||=e=>P(Mu)()})):W(``,!0),(R(),B(u_,{key:`${P(q).deviceId}/${P(q).sessionId}`}))],64)):P(q)&&P(ql)?(R(),B(ob,{key:3,device:P(ql)},null,8,[`device`])):(R(),z(`section`,Qx,[i[14]||=V(`img`,{class:`welcome-symbol`,src:`/icons/durable-pi.svg`,alt:`Durable Pi`},null,-1),i[15]||=V(`span`,{class:`eyebrow`},`THE DURABLE AGENT NETWORK`,-1),i[16]||=V(`h1`,null,[U(`Close the tab.`),V(`br`),U(`The work continues.`)],-1),i[17]||=V(`p`,null,`Agents run on your devices. This page is only a window into them.`,-1),V(`button`,{class:`primary`,disabled:!t(),onClick:r},[H(P(Sc),{size:18}),U(k(P(Bl).devices.value.length?`Create a session`:`Add a device to dpi-network.yaml`),1)],8,$x),V(`div`,eS,[V(`span`,null,[H(P(Zs),{size:18}),i[11]||=U(`SQLite on each device`,-1)]),V(`span`,null,[H(P(tc),{size:18}),i[12]||=U(`Branch any agent`,-1)]),V(`span`,null,[H(P(Fs),{size:18}),i[13]||=U(`Watch from anywhere`,-1)])])]))],4),H(Ju),P(X).dialog?.kind===`pair`?(R(),B(gx,{key:1,ref_key:`pairWizard`,ref:n,handoff:P(X).dialog.handoff,onClose:i[3]||=e=>P(X).dialog=void 0},null,8,[`handoff`])):W(``,!0),P(X).dialog?.kind===`credentials`?(R(),B(bx,{key:2,"device-id":P(X).dialog.deviceId,onClose:i[4]||=e=>P(X).dialog=void 0},null,8,[`device-id`])):W(``,!0),P(X).dialog?.kind===`new-session`?(R(),B(Sb,{key:3,"device-id":P(X).dialog.deviceId,onClose:i[5]||=e=>P(X).dialog=void 0},null,8,[`device-id`])):P(X).dialog?.kind===`prompt`?(R(),B(jx,{key:4,dialog:P(X).dialog,onClose:i[6]||=e=>P(X).dialog=void 0},null,8,[`dialog`])):P(X).dialog?.kind===`models`?(R(),B(Rx,{key:5,onClose:i[7]||=e=>P(X).dialog=void 0})):P(X).dialog?.kind===`path`?(R(),z(`div`,{key:6,class:`modal-backdrop`,onClick:i[10]||=Cs(e=>P(X).dialog=void 0,[`self`])},[V(`section`,tS,[V(`header`,null,[i[18]||=V(`h2`,{id:`path-title`},`Working directory`,-1),V(`button`,{class:`icon-button`,"aria-label":`Close working directory`,onClick:i[8]||=e=>P(X).dialog=void 0},[H(P(Lc),{size:18})])]),V(`code`,nS,k(P(X).dialog.path),1),V(`footer`,null,[V(`button`,{class:`secondary`,onClick:i[9]||=e=>P(X).dialog=void 0},`Close`)])])])):P(X).dialog?.kind===`help`?(R(),B(qx,{key:7})):W(``,!0),H(Yx)]))}}),iS=new URL(window.location.href);if(/^\/pair\/?$/.test(iS.pathname)){let e=Gb(iS);e?(iS.search=``,iS.hash=``,window.history.replaceState(window.history.state,``,iS),X.dialog={kind:`pair`,handoff:e}):window.history.replaceState(window.history.state,``,qb(iS))}ks(rS).mount(`#app`);
|