ask-coding-harness 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,23 +1,23 @@
1
- var qo=Object.defineProperty;var qa=t=>{throw TypeError(t)};var Ko=(t,e,r)=>e in t?qo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var et=(t,e,r)=>Ko(t,typeof e!="symbol"?e+"":e,r),pn=(t,e,r)=>e.has(t)||qa("Cannot "+r);var u=(t,e,r)=>(pn(t,e,"read from private field"),r?r.call(t):e.get(t)),F=(t,e,r)=>e.has(t)?qa("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),L=(t,e,r,n)=>(pn(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),_e=(t,e,r)=>(pn(t,e,"access private method"),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();const kn=!1;var gi=Array.isArray,Wo=Array.prototype.indexOf,Cr=Array.prototype.includes,Js=Array.from,bi=Object.defineProperty,Xr=Object.getOwnPropertyDescriptor,Vo=Object.getOwnPropertyDescriptors,Yo=Object.prototype,Jo=Array.prototype,_i=Object.getPrototypeOf,Ka=Object.isExtensible;function Go(t){for(var e=0;e<t.length;e++)t[e]()}function yi(){var t,e,r=new Promise((n,s)=>{t=n,e=s});return{promise:r,resolve:t,reject:e}}const Ee=2,ss=4,Gs=8,ki=1<<24,Ct=16,at=32,hr=64,Dn=128,Je=512,ye=1024,Ae=2048,At=4096,Ue=8192,$t=16384,Zs=32768,Ar=65536,Wa=1<<17,Hn=1<<18,qr=1<<19,Zo=1<<20,xt=1<<25,ar=32768,wn=1<<21,Un=1<<22,jt=1<<23,Ms=Symbol("$state"),Xo=Symbol("legacy props"),Qo=Symbol(""),_r=new class extends Error{constructor(){super(...arguments);et(this,"name","StaleReactionError");et(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},Xs=3,Kt=8;function el(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function tl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function rl(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function sl(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function nl(t){throw new Error("https://svelte.dev/e/effect_orphan")}function al(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function il(){throw new Error("https://svelte.dev/e/hydration_failed")}function ol(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ll(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function cl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function dl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const ul=1,fl=2,wi=4,pl=8,hl=16,vl=1,ml=2,xi="[",Qs="[!",Fn="]",ir={},xe=Symbol(),gl="http://www.w3.org/1999/xhtml";function xs(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function bl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let D=!1;function De(t){D=t}let W;function ke(t){if(t===null)throw xs(),ir;return W=t}function Pr(){return ke(qe(W))}function x(t){if(D){if(qe(W)!==null)throw xs(),ir;W=t}}function qn(t=1){if(D){for(var e=t,r=W;e--;)r=qe(r);W=r}}function Bs(t=!0){for(var e=0,r=W;;){if(r.nodeType===Kt){var n=r.data;if(n===Fn){if(e===0)return r;e-=1}else(n===xi||n===Qs)&&(e+=1)}var s=qe(r);t&&r.remove(),r=s}}function $i(t){if(!t||t.nodeType!==Kt)throw xs(),ir;return t.data}function Ei(t){return t===this.v}function _l(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Si(t){return!_l(t,this.v)}let yl=!1,Fe=null;function Or(t){Fe=t}function vt(t,e=!1,r){Fe={p:Fe,i:!1,c:null,e:null,s:t,x:null,l:null}}function mt(t){var e=Fe,r=e.e;if(r!==null){e.e=null;for(var n of r)Xi(n)}return t!==void 0&&(e.x=t),e.i=!0,Fe=e.p,t??{}}function Ci(){return!0}let Vt=[];function Ai(){var t=Vt;Vt=[],Go(t)}function ft(t){if(Vt.length===0&&!Qr){var e=Vt;queueMicrotask(()=>{e===Vt&&Ai()})}Vt.push(t)}function kl(){for(;Vt.length>0;)Ai()}function Pi(t){var e=Q;if(e===null)return J.f|=jt,t;if((e.f&Zs)===0){if((e.f&Dn)===0)throw t;e.b.error(t)}else Nr(t,e)}function Nr(t,e){for(;e!==null;){if((e.f&Dn)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const wl=-7169;function ge(t,e){t.f=t.f&wl|e}function Kn(t){(t.f&Je)!==0||t.deps===null?ge(t,ye):ge(t,At)}function Oi(t){if(t!==null)for(const e of t)(e.f&Ee)===0||(e.f&ar)===0||(e.f^=ar,Oi(e.deps))}function Ni(t,e,r){(t.f&Ae)!==0?e.add(t):(t.f&At)!==0&&r.add(t),Oi(t.deps),ge(t,ye)}const zs=new Set;let K=null,xn=null,$e=null,Be=[],en=null,$n=!1,Qr=!1;var yr,kr,Gt,wr,bs,_s,Zt,xr,ht,En,Sn,zi;const pa=class pa{constructor(){F(this,ht);et(this,"committed",!1);et(this,"current",new Map);et(this,"previous",new Map);F(this,yr,new Set);F(this,kr,new Set);F(this,Gt,0);F(this,wr,0);F(this,bs,null);F(this,_s,new Set);F(this,Zt,new Set);et(this,"skipped_effects",new Set);et(this,"is_fork",!1);F(this,xr,!1)}is_deferred(){return this.is_fork||u(this,wr)>0}process(e){var s;Be=[],this.apply();var r=[],n=[];for(const a of e)_e(this,ht,En).call(this,a,r,n);if(this.is_deferred()){_e(this,ht,Sn).call(this,n),_e(this,ht,Sn).call(this,r);for(const a of this.skipped_effects)Ri(a)}else{for(const a of u(this,yr))a();u(this,yr).clear(),u(this,Gt)===0&&_e(this,ht,zi).call(this),xn=this,K=null,Va(n),Va(r),xn=null,(s=u(this,bs))==null||s.resolve()}$e=null}capture(e,r){r!==xe&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&jt)===0&&(this.current.set(e,e.v),$e==null||$e.set(e,e.v))}activate(){K=this,this.apply()}deactivate(){K===this&&(K=null,$e=null)}flush(){if(this.activate(),Be.length>0){if(Ti(),K!==null&&K!==this)return}else u(this,Gt)===0&&this.process([]);this.deactivate()}discard(){for(const e of u(this,kr))e(this);u(this,kr).clear()}increment(e){L(this,Gt,u(this,Gt)+1),e&&L(this,wr,u(this,wr)+1)}decrement(e){L(this,Gt,u(this,Gt)-1),e&&L(this,wr,u(this,wr)-1),!u(this,xr)&&(L(this,xr,!0),ft(()=>{L(this,xr,!1),this.is_deferred()?Be.length>0&&this.flush():this.revive()}))}revive(){for(const e of u(this,_s))u(this,Zt).delete(e),ge(e,Ae),Et(e);for(const e of u(this,Zt))ge(e,At),Et(e);this.flush()}oncommit(e){u(this,yr).add(e)}ondiscard(e){u(this,kr).add(e)}settled(){return(u(this,bs)??L(this,bs,yi())).promise}static ensure(){if(K===null){const e=K=new pa;zs.add(K),Qr||ft(()=>{K===e&&e.flush()})}return K}apply(){}};yr=new WeakMap,kr=new WeakMap,Gt=new WeakMap,wr=new WeakMap,bs=new WeakMap,_s=new WeakMap,Zt=new WeakMap,xr=new WeakMap,ht=new WeakSet,En=function(e,r,n){e.f^=ye;for(var s=e.first,a=null;s!==null;){var i=s.f,l=(i&(at|hr))!==0,o=l&&(i&ye)!==0,c=o||(i&Ue)!==0||this.skipped_effects.has(s);if(!c&&s.fn!==null){l?s.f^=ye:a!==null&&(i&(ss|Gs|ki))!==0?a.b.defer_effect(s):(i&ss)!==0?r.push(s):$s(s)&&((i&Ct)!==0&&u(this,Zt).add(s),as(s));var d=s.first;if(d!==null){s=d;continue}}var h=s.parent;for(s=s.next;s===null&&h!==null;)h===a&&(a=null),s=h.next,h=h.parent}},Sn=function(e){for(var r=0;r<e.length;r+=1)Ni(e[r],u(this,_s),u(this,Zt))},zi=function(){var s;if(zs.size>1){this.previous.clear();var e=$e,r=!0;for(const a of zs){if(a===this){r=!1;continue}const i=[];for(const[o,c]of this.current){if(a.current.has(o))if(r&&c!==a.current.get(o))a.current.set(o,c);else continue;i.push(o)}if(i.length===0)continue;const l=[...a.current.keys()].filter(o=>!this.current.has(o));if(l.length>0){var n=Be;Be=[];const o=new Set,c=new Map;for(const d of i)Mi(d,l,o,c);if(Be.length>0){K=a,a.apply();for(const d of Be)_e(s=a,ht,En).call(s,d,[],[]);a.deactivate()}Be=n}}K=null,$e=e}this.committed=!0,zs.delete(this)};let Rt=pa;function re(t){var e=Qr;Qr=!0;try{for(var r;;){if(kl(),Be.length===0&&(K==null||K.flush(),Be.length===0))return en=null,r;Ti()}}finally{Qr=e}}function Ti(){$n=!0;var t=null;try{for(var e=0;Be.length>0;){var r=Rt.ensure();if(e++>1e3){var n,s;xl()}r.process(Be),It.clear()}}finally{$n=!1,en=null}}function xl(){try{al()}catch(t){Nr(t,en)}}let tt=null;function Va(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&($t|Ue))===0&&$s(n)&&(tt=new Set,as(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?ro(n):n.fn=null),(tt==null?void 0:tt.size)>0)){It.clear();for(const s of tt){if((s.f&($t|Ue))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)tt.has(i)&&(tt.delete(i),a.push(i)),i=i.parent;for(let l=a.length-1;l>=0;l--){const o=a[l];(o.f&($t|Ue))===0&&as(o)}}tt.clear()}}tt=null}}function Mi(t,e,r,n){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&Ee)!==0?Mi(s,e,r,n):(a&(Un|Ct))!==0&&(a&Ae)===0&&ji(s,e,n)&&(ge(s,Ae),Et(s))}}function ji(t,e,r){const n=r.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const s of t.deps){if(Cr.call(e,s))return!0;if((s.f&Ee)!==0&&ji(s,e,r))return r.set(s,!0),!0}return r.set(t,!1),!1}function Et(t){for(var e=en=t;e.parent!==null;){e=e.parent;var r=e.f;if($n&&e===Q&&(r&Ct)!==0&&(r&Hn)===0)return;if((r&(hr|at))!==0){if((r&ye)===0)return;e.f^=ye}}Be.push(e)}function Ri(t){if(!((t.f&at)!==0&&(t.f&ye)!==0)){ge(t,ye);for(var e=t.first;e!==null;)Ri(e),e=e.next}}function $l(t){let e=0,r=or(0),n;return()=>{Yn()&&(f(r),sn(()=>(e===0&&(n=an(()=>t(()=>es(r)))),e+=1,()=>{ft(()=>{e-=1,e===0&&(n==null||n(),n=void 0,es(r))})})))}}var El=Ar|qr|Dn;function Sl(t,e,r){new Cl(t,e,r)}var Ie,ys,ot,Xt,lt,We,Oe,ct,_t,Mt,Qt,yt,$r,er,Er,Sr,kt,Vs,ve,Ii,Li,Cn,js,Rs,An;class Cl{constructor(e,r,n){F(this,ve);et(this,"parent");et(this,"is_pending",!1);F(this,Ie);F(this,ys,D?W:null);F(this,ot);F(this,Xt);F(this,lt);F(this,We,null);F(this,Oe,null);F(this,ct,null);F(this,_t,null);F(this,Mt,null);F(this,Qt,0);F(this,yt,0);F(this,$r,!1);F(this,er,!1);F(this,Er,new Set);F(this,Sr,new Set);F(this,kt,null);F(this,Vs,$l(()=>(L(this,kt,or(u(this,Qt))),()=>{L(this,kt,null)})));L(this,Ie,e),L(this,ot,r),L(this,Xt,n),this.parent=Q.b,this.is_pending=!!u(this,ot).pending,L(this,lt,nn(()=>{if(Q.b=this,D){const a=u(this,ys);Pr(),a.nodeType===Kt&&a.data===Qs?_e(this,ve,Li).call(this):(_e(this,ve,Ii).call(this),u(this,yt)===0&&(this.is_pending=!1))}else{var s=_e(this,ve,Cn).call(this);try{L(this,We,Ye(()=>n(s)))}catch(a){this.error(a)}u(this,yt)>0?_e(this,ve,Rs).call(this):this.is_pending=!1}return()=>{var a;(a=u(this,Mt))==null||a.remove()}},El)),D&&L(this,Ie,W)}defer_effect(e){Ni(e,u(this,Er),u(this,Sr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!u(this,ot).pending}update_pending_count(e){_e(this,ve,An).call(this,e),L(this,Qt,u(this,Qt)+e),!(!u(this,kt)||u(this,$r))&&(L(this,$r,!0),ft(()=>{L(this,$r,!1),u(this,kt)&&zr(u(this,kt),u(this,Qt))}))}get_effect_pending(){return u(this,Vs).call(this),f(u(this,kt))}error(e){var r=u(this,ot).onerror;let n=u(this,ot).failed;if(u(this,er)||!r&&!n)throw e;u(this,We)&&(ze(u(this,We)),L(this,We,null)),u(this,Oe)&&(ze(u(this,Oe)),L(this,Oe,null)),u(this,ct)&&(ze(u(this,ct)),L(this,ct,null)),D&&(ke(u(this,ys)),qn(),ke(Bs()));var s=!1,a=!1;const i=()=>{if(s){bl();return}s=!0,a&&dl(),Rt.ensure(),L(this,Qt,0),u(this,ct)!==null&&rr(u(this,ct),()=>{L(this,ct,null)}),this.is_pending=this.has_pending_snippet(),L(this,We,_e(this,ve,js).call(this,()=>(L(this,er,!1),Ye(()=>u(this,Xt).call(this,u(this,Ie)))))),u(this,yt)>0?_e(this,ve,Rs).call(this):this.is_pending=!1};ft(()=>{try{a=!0,r==null||r(e,i),a=!1}catch(l){Nr(l,u(this,lt)&&u(this,lt).parent)}n&&L(this,ct,_e(this,ve,js).call(this,()=>{Rt.ensure(),L(this,er,!0);try{return Ye(()=>{n(u(this,Ie),()=>e,()=>i)})}catch(l){return Nr(l,u(this,lt).parent),null}finally{L(this,er,!1)}}))})}}Ie=new WeakMap,ys=new WeakMap,ot=new WeakMap,Xt=new WeakMap,lt=new WeakMap,We=new WeakMap,Oe=new WeakMap,ct=new WeakMap,_t=new WeakMap,Mt=new WeakMap,Qt=new WeakMap,yt=new WeakMap,$r=new WeakMap,er=new WeakMap,Er=new WeakMap,Sr=new WeakMap,kt=new WeakMap,Vs=new WeakMap,ve=new WeakSet,Ii=function(){try{L(this,We,Ye(()=>u(this,Xt).call(this,u(this,Ie))))}catch(e){this.error(e)}},Li=function(){const e=u(this,ot).pending;e&&(L(this,Oe,Ye(()=>e(u(this,Ie)))),ft(()=>{var r=_e(this,ve,Cn).call(this);L(this,We,_e(this,ve,js).call(this,()=>(Rt.ensure(),Ye(()=>u(this,Xt).call(this,r))))),u(this,yt)>0?_e(this,ve,Rs).call(this):(rr(u(this,Oe),()=>{L(this,Oe,null)}),this.is_pending=!1)}))},Cn=function(){var e=u(this,Ie);return this.is_pending&&(L(this,Mt,Ce()),u(this,Ie).before(u(this,Mt)),e=u(this,Mt)),e},js=function(e){var r=Q,n=J,s=Fe;Ze(u(this,lt)),Te(u(this,lt)),Or(u(this,lt).ctx);try{return e()}catch(a){return Pi(a),null}finally{Ze(r),Te(n),Or(s)}},Rs=function(){const e=u(this,ot).pending;u(this,We)!==null&&(L(this,_t,document.createDocumentFragment()),u(this,_t).append(u(this,Mt)),ao(u(this,We),u(this,_t))),u(this,Oe)===null&&L(this,Oe,Ye(()=>e(u(this,Ie))))},An=function(e){var r;if(!this.has_pending_snippet()){this.parent&&_e(r=this.parent,ve,An).call(r,e);return}if(L(this,yt,u(this,yt)+e),u(this,yt)===0){this.is_pending=!1;for(const n of u(this,Er))ge(n,Ae),Et(n);for(const n of u(this,Sr))ge(n,At),Et(n);u(this,Er).clear(),u(this,Sr).clear(),u(this,Oe)&&rr(u(this,Oe),()=>{L(this,Oe,null)}),u(this,_t)&&(u(this,Ie).before(u(this,_t)),L(this,_t,null))}};function Bi(t,e,r,n){const s=tn;var a=t.filter(p=>!p.settled);if(r.length===0&&a.length===0){n(e.map(s));return}var i=K,l=Q,o=Al(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(p=>p.promise)):null;function d(p){o();try{n(p)}catch(m){(l.f&$t)===0&&Nr(m,l)}i==null||i.deactivate(),Pn()}if(r.length===0){c.then(()=>d(e.map(s)));return}function h(){o(),Promise.all(r.map(p=>Pl(p))).then(p=>d([...e.map(s),...p])).catch(p=>Nr(p,l))}c?c.then(h):h()}function Al(){var t=Q,e=J,r=Fe,n=K;return function(a=!0){Ze(t),Te(e),Or(r),a&&(n==null||n.activate())}}function Pn(){Ze(null),Te(null),Or(null)}function tn(t){var e=Ee|Ae,r=J!==null&&(J.f&Ee)!==0?J:null;return Q!==null&&(Q.f|=qr),{ctx:Fe,deps:null,effects:null,equals:Ei,f:e,fn:t,reactions:null,rv:0,v:xe,wv:0,parent:r??Q,ac:null}}function Pl(t,e,r){let n=Q;n===null&&tl();var s=n.b,a=void 0,i=or(xe),l=!J,o=new Map;return Bl(()=>{var m;var c=yi();a=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{d===K&&d.committed&&d.deactivate(),Pn()})}catch(_){c.reject(_),Pn()}var d=K;if(l){var h=s.is_rendered();s.update_pending_count(1),d.increment(h),(m=o.get(d))==null||m.reject(_r),o.delete(d),o.set(d,c)}const p=(_,P=void 0)=>{if(d.activate(),P)P!==_r&&(i.f|=jt,zr(i,P));else{(i.f&jt)!==0&&(i.f^=jt),zr(i,_);for(const[v,w]of o){if(o.delete(v),v===d)break;w.reject(_r)}}l&&(s.update_pending_count(-1),d.decrement(h))};c.promise.then(p,_=>p(null,_||"unknown"))}),Jn(()=>{for(const c of o.values())c.reject(_r)}),new Promise(c=>{function d(h){function p(){h===a?c(i):d(a)}h.then(p,p)}d(a)})}function st(t){const e=tn(t);return io(e),e}function Ol(t){const e=tn(t);return e.equals=Si,e}function Di(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ze(e[r])}}function Nl(t){for(var e=t.parent;e!==null;){if((e.f&Ee)===0)return(e.f&$t)===0?e:null;e=e.parent}return null}function Wn(t){var e,r=Q;Ze(Nl(t));try{t.f&=~ar,Di(t),e=uo(t)}finally{Ze(r)}return e}function Hi(t){var e=Wn(t);if(!t.equals(e)&&(t.wv=lo(),(!(K!=null&&K.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){ge(t,ye);return}Bt||($e!==null?(Yn()||K!=null&&K.is_fork)&&$e.set(t,e):Kn(t))}let On=new Set;const It=new Map;let Ui=!1;function or(t,e){var r={f:0,v:t,reactions:null,equals:Ei,rv:0,wv:0};return r}function se(t,e){const r=or(t);return io(r),r}function Fi(t,e=!1,r=!0){const n=or(t);return e||(n.equals=Si),n}function y(t,e,r=!1){J!==null&&(!nt||(J.f&Wa)!==0)&&Ci()&&(J.f&(Ee|Ct|Un|Wa))!==0&&(Ge===null||!Cr.call(Ge,t))&&cl();let n=r?ut(e):e;return zr(t,n)}function zr(t,e){if(!t.equals(e)){var r=t.v;Bt?It.set(t,e):It.set(t,r),t.v=e;var n=Rt.ensure();if(n.capture(t,r),(t.f&Ee)!==0){const s=t;(t.f&Ae)!==0&&Wn(s),Kn(s)}t.wv=lo(),qi(t,Ae),Q!==null&&(Q.f&ye)!==0&&(Q.f&(at|hr))===0&&(Ke===null?Ul([t]):Ke.push(t)),!n.is_fork&&On.size>0&&!Ui&&zl()}return e}function zl(){Ui=!1;for(const t of On)(t.f&ye)!==0&&ge(t,At),$s(t)&&as(t);On.clear()}function es(t){y(t,t.v+1)}function qi(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var a=r[s],i=a.f,l=(i&Ae)===0;if(l&&ge(a,e),(i&Ee)!==0){var o=a;$e==null||$e.delete(o),(i&ar)===0&&(i&Je&&(a.f|=ar),qi(o,At))}else l&&((i&Ct)!==0&&tt!==null&&tt.add(a),Et(a))}}function ut(t){if(typeof t!="object"||t===null||Ms in t)return t;const e=_i(t);if(e!==Yo&&e!==Jo)return t;var r=new Map,n=gi(t),s=se(0),a=sr,i=l=>{if(sr===a)return l();var o=J,c=sr;Te(null),Za(a);var d=l();return Te(o),Za(c),d};return n&&r.set("length",se(t.length)),new Proxy(t,{defineProperty(l,o,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&ol();var d=r.get(o);return d===void 0?d=i(()=>{var h=se(c.value);return r.set(o,h),h}):y(d,c.value,!0),!0},deleteProperty(l,o){var c=r.get(o);if(c===void 0){if(o in l){const d=i(()=>se(xe));r.set(o,d),es(s)}}else y(c,xe),es(s);return!0},get(l,o,c){var m;if(o===Ms)return t;var d=r.get(o),h=o in l;if(d===void 0&&(!h||(m=Xr(l,o))!=null&&m.writable)&&(d=i(()=>{var _=ut(h?l[o]:xe),P=se(_);return P}),r.set(o,d)),d!==void 0){var p=f(d);return p===xe?void 0:p}return Reflect.get(l,o,c)},getOwnPropertyDescriptor(l,o){var c=Reflect.getOwnPropertyDescriptor(l,o);if(c&&"value"in c){var d=r.get(o);d&&(c.value=f(d))}else if(c===void 0){var h=r.get(o),p=h==null?void 0:h.v;if(h!==void 0&&p!==xe)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return c},has(l,o){var p;if(o===Ms)return!0;var c=r.get(o),d=c!==void 0&&c.v!==xe||Reflect.has(l,o);if(c!==void 0||Q!==null&&(!d||(p=Xr(l,o))!=null&&p.writable)){c===void 0&&(c=i(()=>{var m=d?ut(l[o]):xe,_=se(m);return _}),r.set(o,c));var h=f(c);if(h===xe)return!1}return d},set(l,o,c,d){var j;var h=r.get(o),p=o in l;if(n&&o==="length")for(var m=c;m<h.v;m+=1){var _=r.get(m+"");_!==void 0?y(_,xe):m in l&&(_=i(()=>se(xe)),r.set(m+"",_))}if(h===void 0)(!p||(j=Xr(l,o))!=null&&j.writable)&&(h=i(()=>se(void 0)),y(h,ut(c)),r.set(o,h));else{p=h.v!==xe;var P=i(()=>ut(c));y(h,P)}var v=Reflect.getOwnPropertyDescriptor(l,o);if(v!=null&&v.set&&v.set.call(d,c),!p){if(n&&typeof o=="string"){var w=r.get("length"),S=Number(o);Number.isInteger(S)&&S>=w.v&&y(w,S+1)}es(s)}return!0},ownKeys(l){f(s);var o=Reflect.ownKeys(l).filter(h=>{var p=r.get(h);return p===void 0||p.v!==xe});for(var[c,d]of r)d.v!==xe&&!(c in l)&&o.push(c);return o},setPrototypeOf(){ll()}})}var Ya,Ki,Wi,Vi,Yi;function Nn(){if(Ya===void 0){Ya=window,Ki=document,Wi=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Vi=Xr(e,"firstChild").get,Yi=Xr(e,"nextSibling").get,Ka(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ka(r)&&(r.__t=void 0)}}function Ce(t=""){return document.createTextNode(t)}function He(t){return Vi.call(t)}function qe(t){return Yi.call(t)}function E(t,e){if(!D)return He(t);var r=He(W);if(r===null)r=W.appendChild(Ce());else if(e&&r.nodeType!==Xs){var n=Ce();return r==null||r.before(n),ke(n),n}return ke(r),r}function ns(t,e=!1){if(!D){var r=He(t);return r instanceof Comment&&r.data===""?qe(r):r}if(e&&(W==null?void 0:W.nodeType)!==Xs){var n=Ce();return W==null||W.before(n),ke(n),n}return W}function O(t,e=1,r=!1){let n=D?W:t;for(var s;e--;)s=n,n=qe(n);if(!D)return n;if(r&&(n==null?void 0:n.nodeType)!==Xs){var a=Ce();return n===null?s==null||s.after(a):n.before(a),ke(a),a}return ke(n),n}function Vn(t){t.textContent=""}function Ji(){return!1}function Tl(t){D&&He(t)!==null&&Vn(t)}let Ja=!1;function Gi(){Ja||(Ja=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function rn(t){var e=J,r=Q;Te(null),Ze(null);try{return t()}finally{Te(e),Ze(r)}}function Ml(t,e,r,n=r){t.addEventListener(e,()=>rn(r));const s=t.__on_r;s?t.__on_r=()=>{s(),n(!0)}:t.__on_r=()=>n(!0),Gi()}function jl(t){Q===null&&(J===null&&nl(),sl()),Bt&&rl()}function Rl(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function gt(t,e,r){var n=Q;n!==null&&(n.f&Ue)!==0&&(t|=Ue);var s={ctx:Fe,deps:null,nodes:null,f:t|Ae|Je,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{as(s),s.f|=Zs}catch(l){throw ze(s),l}else e!==null&&Et(s);var a=s;if(r&&a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&qr)===0&&(a=a.first,(t&Ct)!==0&&(t&Ar)!==0&&a!==null&&(a.f|=Ar)),a!==null&&(a.parent=n,n!==null&&Rl(a,n),J!==null&&(J.f&Ee)!==0&&(t&hr)===0)){var i=J;(i.effects??(i.effects=[])).push(a)}return s}function Yn(){return J!==null&&!nt}function Jn(t){const e=gt(Gs,null,!1);return ge(e,ye),e.teardown=t,e}function Zi(t){jl();var e=Q.f,r=!J&&(e&at)!==0&&(e&Zs)===0;if(r){var n=Fe;(n.e??(n.e=[])).push(t)}else return Xi(t)}function Xi(t){return gt(ss|Zo,t,!1)}function Il(t){Rt.ensure();const e=gt(hr|qr,t,!0);return(r={})=>new Promise(n=>{r.outro?rr(e,()=>{ze(e),n(void 0)}):(ze(e),n(void 0))})}function Ll(t){return gt(ss,t,!1)}function Bl(t){return gt(Un|qr,t,!0)}function sn(t,e=0){return gt(Gs|e,t,!0)}function q(t,e=[],r=[],n=[]){Bi(n,e,r,s=>{gt(Gs,()=>t(...s.map(f)),!0)})}function Dl(t,e=[],r=[],n=[]){var s=K,a=r.length>0||n.length>0;a&&s.increment(!0),Bi(n,e,r,i=>{gt(ss,()=>t(...i.map(f)),!1),a&&s.decrement(!0)})}function nn(t,e=0){var r=gt(Ct|e,t,!0);return r}function Ye(t){return gt(at|qr,t,!0)}function Qi(t){var e=t.teardown;if(e!==null){const r=Bt,n=J;Ga(!0),Te(null);try{e.call(null)}finally{Ga(r),Te(n)}}}function eo(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&rn(()=>{s.abort(_r)});var n=r.next;(r.f&hr)!==0?r.parent=null:ze(r,e),r=n}}function Hl(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&at)===0&&ze(e),e=r}}function ze(t,e=!0){var r=!1;(e||(t.f&Hn)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(to(t.nodes.start,t.nodes.end),r=!0),eo(t,e&&!r),Ds(t,0),ge(t,$t);var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)a.stop();Qi(t);var s=t.parent;s!==null&&s.first!==null&&ro(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function to(t,e){for(;t!==null;){var r=t===e?null:qe(t);t.remove(),t=r}}function ro(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function rr(t,e,r=!0){var n=[];so(t,n,!0);var s=()=>{r&&ze(t),e&&e()},a=n.length;if(a>0){var i=()=>--a||s();for(var l of n)l.out(i)}else s()}function so(t,e,r){if((t.f&Ue)===0){t.f^=Ue;var n=t.nodes&&t.nodes.t;if(n!==null)for(const l of n)(l.is_global||r)&&e.push(l);for(var s=t.first;s!==null;){var a=s.next,i=(s.f&Ar)!==0||(s.f&at)!==0&&(t.f&Ct)!==0;so(s,e,i?r:!1),s=a}}}function Gn(t){no(t,!0)}function no(t,e){if((t.f&Ue)!==0){t.f^=Ue,(t.f&ye)===0&&(ge(t,Ae),Et(t));for(var r=t.first;r!==null;){var n=r.next,s=(r.f&Ar)!==0||(r.f&at)!==0;no(r,s?e:!1),r=n}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function ao(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var s=r===n?null:qe(r);e.append(r),r=s}}let Is=!1,Bt=!1;function Ga(t){Bt=t}let J=null,nt=!1;function Te(t){J=t}let Q=null;function Ze(t){Q=t}let Ge=null;function io(t){J!==null&&(Ge===null?Ge=[t]:Ge.push(t))}let Ne=null,Re=0,Ke=null;function Ul(t){Ke=t}let oo=1,Yt=0,sr=Yt;function Za(t){sr=t}function lo(){return++oo}function $s(t){var e=t.f;if((e&Ae)!==0)return!0;if(e&Ee&&(t.f&=~ar),(e&At)!==0){for(var r=t.deps,n=r.length,s=0;s<n;s++){var a=r[s];if($s(a)&&Hi(a),a.wv>t.wv)return!0}(e&Je)!==0&&$e===null&&ge(t,ye)}return!1}function co(t,e,r=!0){var n=t.reactions;if(n!==null&&!(Ge!==null&&Cr.call(Ge,t)))for(var s=0;s<n.length;s++){var a=n[s];(a.f&Ee)!==0?co(a,e,!1):e===a&&(r?ge(a,Ae):(a.f&ye)!==0&&ge(a,At),Et(a))}}function uo(t){var P;var e=Ne,r=Re,n=Ke,s=J,a=Ge,i=Fe,l=nt,o=sr,c=t.f;Ne=null,Re=0,Ke=null,J=(c&(at|hr))===0?t:null,Ge=null,Or(t.ctx),nt=!1,sr=++Yt,t.ac!==null&&(rn(()=>{t.ac.abort(_r)}),t.ac=null);try{t.f|=wn;var d=t.fn,h=d(),p=t.deps,m=K==null?void 0:K.is_fork;if(Ne!==null){var _;if(m||Ds(t,Re),p!==null&&Re>0)for(p.length=Re+Ne.length,_=0;_<Ne.length;_++)p[Re+_]=Ne[_];else t.deps=p=Ne;if(Yn()&&(t.f&Je)!==0)for(_=Re;_<p.length;_++)((P=p[_]).reactions??(P.reactions=[])).push(t)}else!m&&p!==null&&Re<p.length&&(Ds(t,Re),p.length=Re);if(Ci()&&Ke!==null&&!nt&&p!==null&&(t.f&(Ee|At|Ae))===0)for(_=0;_<Ke.length;_++)co(Ke[_],t);if(s!==null&&s!==t){if(Yt++,s.deps!==null)for(let v=0;v<r;v+=1)s.deps[v].rv=Yt;if(e!==null)for(const v of e)v.rv=Yt;Ke!==null&&(n===null?n=Ke:n.push(...Ke))}return(t.f&jt)!==0&&(t.f^=jt),h}catch(v){return Pi(v)}finally{t.f^=wn,Ne=e,Re=r,Ke=n,J=s,Ge=a,Or(i),nt=l,sr=o}}function Fl(t,e){let r=e.reactions;if(r!==null){var n=Wo.call(r,t);if(n!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[n]=r[s],r.pop())}}if(r===null&&(e.f&Ee)!==0&&(Ne===null||!Cr.call(Ne,e))){var a=e;(a.f&Je)!==0&&(a.f^=Je,a.f&=~ar),Kn(a),Di(a),Ds(a,0)}}function Ds(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Fl(t,r[n])}function as(t){var e=t.f;if((e&$t)===0){ge(t,ye);var r=Q,n=Is;Q=t,Is=!0;try{(e&(Ct|ki))!==0?Hl(t):eo(t),Qi(t);var s=uo(t);t.teardown=typeof s=="function"?s:null,t.wv=oo;var a;kn&&yl&&(t.f&Ae)!==0&&t.deps}finally{Is=n,Q=r}}}async function ql(){await Promise.resolve(),re()}function f(t){var e=t.f,r=(e&Ee)!==0;if(J!==null&&!nt){var n=Q!==null&&(Q.f&$t)!==0;if(!n&&(Ge===null||!Cr.call(Ge,t))){var s=J.deps;if((J.f&wn)!==0)t.rv<Yt&&(t.rv=Yt,Ne===null&&s!==null&&s[Re]===t?Re++:Ne===null?Ne=[t]:Ne.push(t));else{(J.deps??(J.deps=[])).push(t);var a=t.reactions;a===null?t.reactions=[J]:Cr.call(a,J)||a.push(J)}}}if(Bt&&It.has(t))return It.get(t);if(r){var i=t;if(Bt){var l=i.v;return((i.f&ye)===0&&i.reactions!==null||po(i))&&(l=Wn(i)),It.set(i,l),l}var o=(i.f&Je)===0&&!nt&&J!==null&&(Is||(J.f&Je)!==0),c=i.deps===null;$s(i)&&(o&&(i.f|=Je),Hi(i)),o&&!c&&fo(i)}if($e!=null&&$e.has(t))return $e.get(t);if((t.f&jt)!==0)throw t.v;return t.v}function fo(t){if(t.deps!==null){t.f|=Je;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&Ee)!==0&&(e.f&Je)===0&&fo(e)}}function po(t){if(t.v===xe)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(It.has(e)||(e.f&Ee)!==0&&po(e))return!0;return!1}function an(t){var e=nt;try{return nt=!0,t()}finally{nt=e}}const Kl=["touchstart","touchmove"];function Wl(t){return Kl.includes(t)}const ho=new Set,zn=new Set;function Vl(t,e,r,n={}){function s(a){if(n.capture||Gr.call(e,a),!a.cancelBubble)return rn(()=>r==null?void 0:r.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ft(()=>{e.addEventListener(t,s,n)}):e.addEventListener(t,s,n),s}function Se(t,e,r,n,s){var a={capture:n,passive:s},i=Vl(t,e,r,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Jn(()=>{e.removeEventListener(t,i,a)})}function Kr(t){for(var e=0;e<t.length;e++)ho.add(t[e]);for(var r of zn)r(t)}let Xa=null;function Gr(t){var v;var e=this,r=e.ownerDocument,n=t.type,s=((v=t.composedPath)==null?void 0:v.call(t))||[],a=s[0]||t.target;Xa=t;var i=0,l=Xa===t&&t.__root;if(l){var o=s.indexOf(l);if(o!==-1&&(e===document||e===window)){t.__root=e;return}var c=s.indexOf(e);if(c===-1)return;o<=c&&(i=o)}if(a=s[i]||t.target,a!==e){bi(t,"currentTarget",{configurable:!0,get(){return a||r}});var d=J,h=Q;Te(null),Ze(null);try{for(var p,m=[];a!==null;){var _=a.assignedSlot||a.parentNode||a.host||null;try{var P=a["__"+n];P!=null&&(!a.disabled||t.target===a)&&P.call(a,t)}catch(w){p?m.push(w):p=w}if(t.cancelBubble||_===e||_===null)break;a=_}if(p){for(let w of m)queueMicrotask(()=>{throw w});throw p}}finally{t.__root=e,delete t.currentTarget,Te(d),Ze(h)}}}function vo(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function pt(t,e){var r=Q;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function B(t,e){var r=(e&vl)!==0,n=(e&ml)!==0,s,a=!t.startsWith("<!>");return()=>{if(D)return pt(W,null),W;s===void 0&&(s=vo(a?t:"<!>"+t),r||(s=He(s)));var i=n||Wi?document.importNode(s,!0):s.cloneNode(!0);if(r){var l=He(i),o=i.lastChild;pt(l,o)}else pt(i,i);return i}}function hn(t=""){if(!D){var e=Ce(t+"");return pt(e,e),e}var r=W;return r.nodeType!==Xs&&(r.before(r=Ce()),ke(r)),pt(r,r),r}function Hs(){if(D)return pt(W,null),W;var t=document.createDocumentFragment(),e=document.createComment(""),r=Ce();return t.append(e,r),pt(e,r),t}function T(t,e){if(D){var r=Q;((r.f&Zs)===0||r.nodes.end===null)&&(r.nodes.end=W),Pr();return}t!==null&&t.before(e)}function he(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function Zn(t,e){return mo(t,e)}function Yl(t,e){Nn(),e.intro=e.intro??!1;const r=e.target,n=D,s=W;try{for(var a=He(r);a&&(a.nodeType!==Kt||a.data!==xi);)a=qe(a);if(!a)throw ir;De(!0),ke(a);const i=mo(t,{...e,anchor:a});return De(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
- `).some(l=>l.startsWith("https://svelte.dev/e/")))throw i;return i!==ir&&console.warn("Failed to hydrate: ",i),e.recover===!1&&il(),Nn(),Vn(r),De(!1),Zn(t,e)}finally{De(n),ke(s)}}const mr=new Map;function mo(t,{target:e,anchor:r,props:n={},events:s,context:a,intro:i=!0}){Nn();var l=new Set,o=h=>{for(var p=0;p<h.length;p++){var m=h[p];if(!l.has(m)){l.add(m);var _=Wl(m);e.addEventListener(m,Gr,{passive:_});var P=mr.get(m);P===void 0?(document.addEventListener(m,Gr,{passive:_}),mr.set(m,1)):mr.set(m,P+1)}}};o(Js(ho)),zn.add(o);var c=void 0,d=Il(()=>{var h=r??e.appendChild(Ce());return Sl(h,{pending:()=>{}},p=>{if(a){vt({});var m=Fe;m.c=a}if(s&&(n.$$events=s),D&&pt(p,null),c=t(p,n)||{},D&&(Q.nodes.end=W,W===null||W.nodeType!==Kt||W.data!==Fn))throw xs(),ir;a&&mt()}),()=>{var _;for(var p of l){e.removeEventListener(p,Gr);var m=mr.get(p);--m===0?(document.removeEventListener(p,Gr),mr.delete(p)):mr.set(p,m)}zn.delete(o),h!==r&&((_=h.parentNode)==null||_.removeChild(h))}});return Tn.set(c,d),c}let Tn=new WeakMap;function Jl(t,e){const r=Tn.get(t);return r?(Tn.delete(t),r(e)):Promise.resolve()}var rt,dt,Le,tr,ks,ws,Ys;class Gl{constructor(e,r=!0){et(this,"anchor");F(this,rt,new Map);F(this,dt,new Map);F(this,Le,new Map);F(this,tr,new Set);F(this,ks,!0);F(this,ws,()=>{var e=K;if(u(this,rt).has(e)){var r=u(this,rt).get(e),n=u(this,dt).get(r);if(n)Gn(n),u(this,tr).delete(r);else{var s=u(this,Le).get(r);s&&(u(this,dt).set(r,s.effect),u(this,Le).delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.effect)}for(const[a,i]of u(this,rt)){if(u(this,rt).delete(a),a===e)break;const l=u(this,Le).get(i);l&&(ze(l.effect),u(this,Le).delete(i))}for(const[a,i]of u(this,dt)){if(a===r||u(this,tr).has(a))continue;const l=()=>{if(Array.from(u(this,rt).values()).includes(a)){var c=document.createDocumentFragment();ao(i,c),c.append(Ce()),u(this,Le).set(a,{effect:i,fragment:c})}else ze(i);u(this,tr).delete(a),u(this,dt).delete(a)};u(this,ks)||!n?(u(this,tr).add(a),rr(i,l,!1)):l()}}});F(this,Ys,e=>{u(this,rt).delete(e);const r=Array.from(u(this,rt).values());for(const[n,s]of u(this,Le))r.includes(n)||(ze(s.effect),u(this,Le).delete(n))});this.anchor=e,L(this,ks,r)}ensure(e,r){var n=K,s=Ji();if(r&&!u(this,dt).has(e)&&!u(this,Le).has(e))if(s){var a=document.createDocumentFragment(),i=Ce();a.append(i),u(this,Le).set(e,{effect:Ye(()=>r(i)),fragment:a})}else u(this,dt).set(e,Ye(()=>r(this.anchor)));if(u(this,rt).set(n,e),s){for(const[l,o]of u(this,dt))l===e?n.skipped_effects.delete(o):n.skipped_effects.add(o);for(const[l,o]of u(this,Le))l===e?n.skipped_effects.delete(o.effect):n.skipped_effects.add(o.effect);n.oncommit(u(this,ws)),n.ondiscard(u(this,Ys))}else D&&(this.anchor=W),u(this,ws).call(this)}}rt=new WeakMap,dt=new WeakMap,Le=new WeakMap,tr=new WeakMap,ks=new WeakMap,ws=new WeakMap,Ys=new WeakMap;function te(t,e,r=!1){D&&Pr();var n=new Gl(t),s=r?Ar:0;function a(i,l){if(D){const c=$i(t)===Qs;if(i===c){var o=Bs();ke(o),n.anchor=o,De(!1),n.ensure(i,l),De(!0);return}}n.ensure(i,l)}nn(()=>{var i=!1;e((l,o=!0)=>{i=!0,a(o,l)}),i||a(!1,null)},s)}function Zl(t,e){return e}function Xl(t,e,r){for(var n=[],s=e.length,a,i=e.length,l=0;l<s;l++){let h=e[l];rr(h,()=>{if(a){if(a.pending.delete(h),a.done.add(h),a.pending.size===0){var p=t.outrogroups;Mn(Js(a.done)),p.delete(a),p.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=n.length===0&&r!==null;if(o){var c=r,d=c.parentNode;Vn(d),d.append(c),t.items.clear()}Mn(e,!o)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Mn(t,e=!0){for(var r=0;r<t.length;r++)ze(t[r],e)}var Qa;function is(t,e,r,n,s,a=null){var i=t,l=new Map,o=(e&wi)!==0;if(o){var c=t;i=D?ke(He(c)):c.appendChild(Ce())}D&&Pr();var d=null,h=Ol(()=>{var w=r();return gi(w)?w:w==null?[]:Js(w)}),p,m=!0;function _(){v.fallback=d,Ql(v,p,i,e,n),d!==null&&(p.length===0?(d.f&xt)===0?Gn(d):(d.f^=xt,Zr(d,null,i)):rr(d,()=>{d=null}))}var P=nn(()=>{p=f(h);var w=p.length;let S=!1;if(D){var j=$i(i)===Qs;j!==(w===0)&&(i=Bs(),ke(i),De(!1),S=!0)}for(var H=new Set,$=K,R=Ji(),G=0;G<w;G+=1){D&&W.nodeType===Kt&&W.data===Fn&&(i=W,S=!0,De(!1));var k=p[G],M=n(k,G),N=m?null:l.get(M);N?(N.v&&zr(N.v,k),N.i&&zr(N.i,G),R&&$.skipped_effects.delete(N.e)):(N=ec(l,m?i:Qa??(Qa=Ce()),k,M,G,s,e,r),m||(N.e.f|=xt),l.set(M,N)),H.add(M)}if(w===0&&a&&!d&&(m?d=Ye(()=>a(i)):(d=Ye(()=>a(Qa??(Qa=Ce()))),d.f|=xt)),D&&w>0&&ke(Bs()),!m)if(R){for(const[Z,de]of l)H.has(Z)||$.skipped_effects.add(de.e);$.oncommit(_),$.ondiscard(()=>{})}else _();S&&De(!0),f(h)}),v={effect:P,items:l,outrogroups:null,fallback:d};m=!1,D&&(i=W)}function Vr(t){for(;t!==null&&(t.f&at)===0;)t=t.next;return t}function Ql(t,e,r,n,s){var N,Z,de,A,z,ne,C,U,we;var a=(n&pl)!==0,i=e.length,l=t.items,o=Vr(t.effect.first),c,d=null,h,p=[],m=[],_,P,v,w;if(a)for(w=0;w<i;w+=1)_=e[w],P=s(_,w),v=l.get(P).e,(v.f&xt)===0&&((Z=(N=v.nodes)==null?void 0:N.a)==null||Z.measure(),(h??(h=new Set)).add(v));for(w=0;w<i;w+=1){if(_=e[w],P=s(_,w),v=l.get(P).e,t.outrogroups!==null)for(const be of t.outrogroups)be.pending.delete(v),be.done.delete(v);if((v.f&xt)!==0)if(v.f^=xt,v===o)Zr(v,null,r);else{var S=d?d.next:o;v===t.effect.last&&(t.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),zt(t,d,v),zt(t,v,S),Zr(v,S,r),d=v,p=[],m=[],o=Vr(d.next);continue}if((v.f&Ue)!==0&&(Gn(v),a&&((A=(de=v.nodes)==null?void 0:de.a)==null||A.unfix(),(h??(h=new Set)).delete(v))),v!==o){if(c!==void 0&&c.has(v)){if(p.length<m.length){var j=m[0],H;d=j.prev;var $=p[0],R=p[p.length-1];for(H=0;H<p.length;H+=1)Zr(p[H],j,r);for(H=0;H<m.length;H+=1)c.delete(m[H]);zt(t,$.prev,R.next),zt(t,d,$),zt(t,R,j),o=j,d=R,w-=1,p=[],m=[]}else c.delete(v),Zr(v,o,r),zt(t,v.prev,v.next),zt(t,v,d===null?t.effect.first:d.next),zt(t,d,v),d=v;continue}for(p=[],m=[];o!==null&&o!==v;)(c??(c=new Set)).add(o),m.push(o),o=Vr(o.next);if(o===null)continue}(v.f&xt)===0&&p.push(v),d=v,o=Vr(v.next)}if(t.outrogroups!==null){for(const be of t.outrogroups)be.pending.size===0&&(Mn(Js(be.done)),(z=t.outrogroups)==null||z.delete(be));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||c!==void 0){var G=[];if(c!==void 0)for(v of c)(v.f&Ue)===0&&G.push(v);for(;o!==null;)(o.f&Ue)===0&&o!==t.fallback&&G.push(o),o=Vr(o.next);var k=G.length;if(k>0){var M=(n&wi)!==0&&i===0?r:null;if(a){for(w=0;w<k;w+=1)(C=(ne=G[w].nodes)==null?void 0:ne.a)==null||C.measure();for(w=0;w<k;w+=1)(we=(U=G[w].nodes)==null?void 0:U.a)==null||we.fix()}Xl(t,G,M)}}a&&ft(()=>{var be,Xe;if(h!==void 0)for(v of h)(Xe=(be=v.nodes)==null?void 0:be.a)==null||Xe.apply()})}function ec(t,e,r,n,s,a,i,l){var o=(i&ul)!==0?(i&hl)===0?Fi(r,!1,!1):or(r):null,c=(i&fl)!==0?or(s):null;return{v:o,i:c,e:Ye(()=>(a(e,o??r,c??s,l),()=>{t.delete(n)}))}}function Zr(t,e,r){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end,a=e&&(e.f&xt)===0?e.nodes.start:r;n!==null;){var i=qe(n);if(a.before(n),n===s)return;n=i}}function zt(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function go(t,e,r=!1,n=!1,s=!1){var a=t,i="";q(()=>{var l=Q;if(i===(i=e()??"")){D&&Pr();return}if(l.nodes!==null&&(to(l.nodes.start,l.nodes.end),l.nodes=null),i!==""){if(D){W.data;for(var o=Pr(),c=o;o!==null&&(o.nodeType!==Kt||o.data!=="");)c=o,o=qe(o);if(o===null)throw xs(),ir;pt(W,c),a=ke(o);return}var d=i+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var h=vo(d);if((r||n)&&(h=He(h)),pt(He(h),h.lastChild),r||n)for(;He(h);)a.before(He(h));else a.before(h)}})}function tc(t,e){let r=null,n=D;var s;if(D){r=W;for(var a=He(document.head);a!==null&&(a.nodeType!==Kt||a.data!==t);)a=qe(a);if(a===null)De(!1);else{var i=qe(a);a.remove(),ke(i)}}D||(s=document.head.appendChild(Ce()));try{nn(()=>e(s),Hn)}finally{n&&(De(!0),ke(r))}}function rc(t,e,r){var n=t==null?"":""+t;return e&&(n=n?n+" "+e:e),n===""?null:n}function gr(t,e,r,n,s,a){var i=t.__className;if(D||i!==r||i===void 0){var l=rc(r,n);(!D||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):t.className=l),t.__className=r}return a}const sc=Symbol("is custom element"),nc=Symbol("is html");function bo(t){if(D){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;Us(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var s=t.checked;Us(t,"checked",null),t.checked=s}}};t.__on_r=r,ft(r),Gi()}}function Us(t,e,r,n){var s=ac(t);D&&(s[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||s[e]!==(s[e]=r)&&(e==="loading"&&(t[Qo]=r),r==null?t.removeAttribute(e):typeof r!="string"&&_o(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function ce(t,e,r){var n=J,s=Q;let a=D;D&&De(!1),Te(null),Ze(null);try{e!=="style"&&(jn.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.tagName.toLowerCase())?_o(t).includes(e):r&&typeof r=="object")?t[e]=r:Us(t,e,r==null?r:String(r))}finally{Te(n),Ze(s),a&&De(!0)}}function ac(t){return t.__attributes??(t.__attributes={[sc]:t.nodeName.includes("-"),[nc]:t.namespaceURI===gl})}var jn=new Map;function _o(t){var e=t.getAttribute("is")||t.nodeName,r=jn.get(e);if(r)return r;jn.set(e,r=[]);for(var n,s=t,a=Element.prototype;a!==s;){n=Vo(s);for(var i in n)n[i].set&&r.push(i);s=_i(s)}return r}function Xn(t,e,r=e){var n=new WeakSet;Ml(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=vn(t)?mn(a):a,r(a),K!==null&&n.add(K),await ql(),a!==(a=e())){var i=t.selectionStart,l=t.selectionEnd,o=t.value.length;if(t.value=a??"",l!==null){var c=t.value.length;i===l&&l===o&&c>o?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=i,t.selectionEnd=Math.min(l,c))}}}),(D&&t.defaultValue!==t.value||an(e)==null&&t.value)&&(r(vn(t)?mn(t.value):t.value),K!==null&&n.add(K)),sn(()=>{var s=e();if(t===document.activeElement){var a=xn??K;if(n.has(a))return}vn(t)&&s===mn(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}function vn(t){var e=t.type;return e==="number"||e==="range"}function mn(t){return t===""?null:+t}function ei(t,e){return t===e||(t==null?void 0:t[Ms])===e}function yo(t={},e,r,n){return Ll(()=>{var s,a;return sn(()=>{s=a,a=[],an(()=>{t!==r(...a)&&(e(t,...a),s&&ei(r(...s),t)&&e(null,...s))})}),()=>{ft(()=>{a&&ei(r(...a),t)&&e(null,...a)})}}),t}function ic(t,e,r,n,s){var a=()=>{n(r[t])};r.addEventListener(e,a),s?sn(()=>{r[t]=s()}):a(),(r===document.body||r===window||r===document)&&Jn(()=>{r.removeEventListener(e,a)})}function Pt(t,e,r){var n;t.$$events||(t.$$events={}),(n=t.$$events)[e]||(n[e]=[]),t.$$events[e].push(r)}function Ot(t){for(var e in t)e in this&&(this[e]=t[e])}function ie(t,e,r,n){var s=n,a=!0,i=()=>(a&&(a=!1,s=n),s),l;l=t[e],l===void 0&&n!==void 0&&(l=i());var o;o=()=>{var p=t[e];return p===void 0?i():(a=!0,p)};var c=!1,d=tn(()=>(c=!1,o())),h=Q;return(function(p,m){if(arguments.length>0){const _=m?f(d):p;return y(d,_),c=!0,s!==void 0&&(s=_),p}return Bt&&c||(h.f&$t)!==0?d.v:f(d)})}function Nt(t){return new oc(t)}var wt,Ve;class oc{constructor(e){F(this,wt);F(this,Ve);var a;var r=new Map,n=(i,l)=>{var o=Fi(l,!1,!1);return r.set(i,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(i,l){return f(r.get(l)??n(l,Reflect.get(i,l)))},has(i,l){return l===Xo?!0:(f(r.get(l)??n(l,Reflect.get(i,l))),Reflect.has(i,l))},set(i,l,o){return y(r.get(l)??n(l,o),o),Reflect.set(i,l,o)}});L(this,Ve,(e.hydrate?Yl:Zn)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&re(),L(this,wt,s.$$events);for(const i of Object.keys(u(this,Ve)))i==="$set"||i==="$destroy"||i==="$on"||bi(this,i,{get(){return u(this,Ve)[i]},set(l){u(this,Ve)[i]=l},enumerable:!0});u(this,Ve).$set=i=>{Object.assign(s,i)},u(this,Ve).$destroy=()=>{Jl(u(this,Ve))}}$set(e){u(this,Ve).$set(e)}$on(e,r){u(this,wt)[e]=u(this,wt)[e]||[];const n=(...s)=>r.call(this,...s);return u(this,wt)[e].push(n),()=>{u(this,wt)[e]=u(this,wt)[e].filter(s=>s!==n)}}$destroy(){u(this,Ve).$destroy()}}wt=new WeakMap,Ve=new WeakMap;function lc(t){Fe===null&&el(),Zi(()=>{const e=an(t);if(typeof e=="function")return e})}const cc="5";var vi;typeof window<"u"&&((vi=window.__svelte??(window.__svelte={})).v??(vi.v=new Set)).add(cc);function ko(t){const e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=[],n=/```(\w*)\n?([\s\S]*?)```/g;let s,a=0;for(;(s=n.exec(e))!==null;)r.push(e.slice(a,s.index)),r.push(`<pre class="code-block"><code class="lang-${s[1]||"text"}">${s[2].replace(/\n$/,"")}</code></pre>`),a=s.index+s[0].length;return r.push(e.slice(a)),r.join("").split(/\n{2,}/).map(i=>i.startsWith("<pre")?i:`<p>${i.replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\n/g,"<br/>")}</p>`).join("")}/**
1
+ var Vo=Object.defineProperty;var Va=t=>{throw TypeError(t)};var Yo=(t,e,r)=>e in t?Vo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var tt=(t,e,r)=>Yo(t,typeof e!="symbol"?e+"":e,r),mn=(t,e,r)=>e.has(t)||Va("Cannot "+r);var p=(t,e,r)=>(mn(t,e,"read from private field"),r?r.call(t):e.get(t)),q=(t,e,r)=>e.has(t)?Va("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),L=(t,e,r,n)=>(mn(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),ge=(t,e,r)=>(mn(t,e,"access private method"),r);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=r(s);fetch(s.href,a)}})();const $n=!1;var yi=Array.isArray,Jo=Array.prototype.indexOf,Ar=Array.prototype.includes,Xs=Array.from,ki=Object.defineProperty,es=Object.getOwnPropertyDescriptor,Go=Object.getOwnPropertyDescriptors,Zo=Object.prototype,Xo=Array.prototype,wi=Object.getPrototypeOf,Ya=Object.isExtensible;function Qo(t){for(var e=0;e<t.length;e++)t[e]()}function xi(){var t,e,r=new Promise((n,s)=>{t=n,e=s});return{promise:r,resolve:t,reject:e}}const xe=2,as=4,Qs=8,$i=1<<24,St=16,it=32,mr=64,Fn=128,Ze=512,be=1024,Pe=2048,Ct=4096,Ue=8192,xt=16384,en=32768,Pr=65536,Ja=1<<17,qn=1<<18,Kr=1<<19,el=1<<20,wt=1<<25,or=32768,En=1<<21,Kn=1<<22,jt=1<<23,Is=Symbol("$state"),tl=Symbol("legacy props"),rl=Symbol(""),yr=new class extends Error{constructor(){super(...arguments);tt(this,"name","StaleReactionError");tt(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}},tn=3,Kt=8;function sl(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function nl(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function al(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function il(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function ol(t){throw new Error("https://svelte.dev/e/effect_orphan")}function ll(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function cl(){throw new Error("https://svelte.dev/e/hydration_failed")}function dl(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function ul(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function fl(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function pl(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const hl=1,vl=2,Ei=4,ml=8,gl=16,bl=1,_l=2,Si="[",rn="[!",Wn="]",lr={},ke=Symbol(),yl="http://www.w3.org/1999/xhtml";function Es(t){console.warn("https://svelte.dev/e/hydration_mismatch")}function kl(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}let H=!1;function Be(t){H=t}let W;function _e(t){if(t===null)throw Es(),lr;return W=t}function Or(){return _e(qe(W))}function x(t){if(H){if(qe(W)!==null)throw Es(),lr;W=t}}function Vn(t=1){if(H){for(var e=t,r=W;e--;)r=qe(r);W=r}}function Us(t=!0){for(var e=0,r=W;;){if(r.nodeType===Kt){var n=r.data;if(n===Wn){if(e===0)return r;e-=1}else(n===Si||n===rn)&&(e+=1)}var s=qe(r);t&&r.remove(),r=s}}function Ci(t){if(!t||t.nodeType!==Kt)throw Es(),lr;return t.data}function Ai(t){return t===this.v}function wl(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Pi(t){return!wl(t,this.v)}let xl=!1,Fe=null;function Nr(t){Fe=t}function vt(t,e=!1,r){Fe={p:Fe,i:!1,c:null,e:null,s:t,x:null,l:null}}function mt(t){var e=Fe,r=e.e;if(r!==null){e.e=null;for(var n of r)to(n)}return t!==void 0&&(e.x=t),e.i=!0,Fe=e.p,t??{}}function Oi(){return!0}let Jt=[];function Ni(){var t=Jt;Jt=[],Qo(t)}function ft(t){if(Jt.length===0&&!ts){var e=Jt;queueMicrotask(()=>{e===Jt&&Ni()})}Jt.push(t)}function $l(){for(;Jt.length>0;)Ni()}function zi(t){var e=re;if(e===null)return Y.f|=jt,t;if((e.f&en)===0){if((e.f&Fn)===0)throw t;e.b.error(t)}else zr(t,e)}function zr(t,e){for(;e!==null;){if((e.f&Fn)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t}const El=-7169;function me(t,e){t.f=t.f&El|e}function Yn(t){(t.f&Ze)!==0||t.deps===null?me(t,be):me(t,Ct)}function Ti(t){if(t!==null)for(const e of t)(e.f&xe)===0||(e.f&or)===0||(e.f^=or,Ti(e.deps))}function Mi(t,e,r){(t.f&Pe)!==0?e.add(t):(t.f&Ct)!==0&&r.add(t),Ti(t.deps),me(t,be)}const js=new Set;let K=null,Sn=null,we=null,De=[],sn=null,Cn=!1,ts=!1;var kr,wr,Xt,xr,ys,ks,Qt,$r,ht,An,Pn,ji;const ma=class ma{constructor(){q(this,ht);tt(this,"committed",!1);tt(this,"current",new Map);tt(this,"previous",new Map);q(this,kr,new Set);q(this,wr,new Set);q(this,Xt,0);q(this,xr,0);q(this,ys,null);q(this,ks,new Set);q(this,Qt,new Set);tt(this,"skipped_effects",new Set);tt(this,"is_fork",!1);q(this,$r,!1)}is_deferred(){return this.is_fork||p(this,xr)>0}process(e){var s;De=[],this.apply();var r=[],n=[];for(const a of e)ge(this,ht,An).call(this,a,r,n);if(this.is_deferred()){ge(this,ht,Pn).call(this,n),ge(this,ht,Pn).call(this,r);for(const a of this.skipped_effects)Di(a)}else{for(const a of p(this,kr))a();p(this,kr).clear(),p(this,Xt)===0&&ge(this,ht,ji).call(this),Sn=this,K=null,Ga(n),Ga(r),Sn=null,(s=p(this,ys))==null||s.resolve()}we=null}capture(e,r){r!==ke&&!this.previous.has(e)&&this.previous.set(e,r),(e.f&jt)===0&&(this.current.set(e,e.v),we==null||we.set(e,e.v))}activate(){K=this,this.apply()}deactivate(){K===this&&(K=null,we=null)}flush(){if(this.activate(),De.length>0){if(Ri(),K!==null&&K!==this)return}else p(this,Xt)===0&&this.process([]);this.deactivate()}discard(){for(const e of p(this,wr))e(this);p(this,wr).clear()}increment(e){L(this,Xt,p(this,Xt)+1),e&&L(this,xr,p(this,xr)+1)}decrement(e){L(this,Xt,p(this,Xt)-1),e&&L(this,xr,p(this,xr)-1),!p(this,$r)&&(L(this,$r,!0),ft(()=>{L(this,$r,!1),this.is_deferred()?De.length>0&&this.flush():this.revive()}))}revive(){for(const e of p(this,ks))p(this,Qt).delete(e),me(e,Pe),$t(e);for(const e of p(this,Qt))me(e,Ct),$t(e);this.flush()}oncommit(e){p(this,kr).add(e)}ondiscard(e){p(this,wr).add(e)}settled(){return(p(this,ys)??L(this,ys,xi())).promise}static ensure(){if(K===null){const e=K=new ma;js.add(K),ts||ft(()=>{K===e&&e.flush()})}return K}apply(){}};kr=new WeakMap,wr=new WeakMap,Xt=new WeakMap,xr=new WeakMap,ys=new WeakMap,ks=new WeakMap,Qt=new WeakMap,$r=new WeakMap,ht=new WeakSet,An=function(e,r,n){e.f^=be;for(var s=e.first,a=null;s!==null;){var i=s.f,l=(i&(it|mr))!==0,o=l&&(i&be)!==0,c=o||(i&Ue)!==0||this.skipped_effects.has(s);if(!c&&s.fn!==null){l?s.f^=be:a!==null&&(i&(as|Qs|$i))!==0?a.b.defer_effect(s):(i&as)!==0?r.push(s):Ss(s)&&((i&St)!==0&&p(this,Qt).add(s),os(s));var d=s.first;if(d!==null){s=d;continue}}var f=s.parent;for(s=s.next;s===null&&f!==null;)f===a&&(a=null),s=f.next,f=f.parent}},Pn=function(e){for(var r=0;r<e.length;r+=1)Mi(e[r],p(this,ks),p(this,Qt))},ji=function(){var s;if(js.size>1){this.previous.clear();var e=we,r=!0;for(const a of js){if(a===this){r=!1;continue}const i=[];for(const[o,c]of this.current){if(a.current.has(o))if(r&&c!==a.current.get(o))a.current.set(o,c);else continue;i.push(o)}if(i.length===0)continue;const l=[...a.current.keys()].filter(o=>!this.current.has(o));if(l.length>0){var n=De;De=[];const o=new Set,c=new Map;for(const d of i)Ii(d,l,o,c);if(De.length>0){K=a,a.apply();for(const d of De)ge(s=a,ht,An).call(s,d,[],[]);a.deactivate()}De=n}}K=null,we=e}this.committed=!0,js.delete(this)};let Rt=ma;function G(t){var e=ts;ts=!0;try{for(var r;;){if($l(),De.length===0&&(K==null||K.flush(),De.length===0))return sn=null,r;Ri()}}finally{ts=e}}function Ri(){Cn=!0;var t=null;try{for(var e=0;De.length>0;){var r=Rt.ensure();if(e++>1e3){var n,s;Sl()}r.process(De),It.clear()}}finally{Cn=!1,sn=null}}function Sl(){try{ll()}catch(t){zr(t,sn)}}let rt=null;function Ga(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var n=t[r++];if((n.f&(xt|Ue))===0&&Ss(n)&&(rt=new Set,os(n),n.deps===null&&n.first===null&&n.nodes===null&&(n.teardown===null&&n.ac===null?ao(n):n.fn=null),(rt==null?void 0:rt.size)>0)){It.clear();for(const s of rt){if((s.f&(xt|Ue))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)rt.has(i)&&(rt.delete(i),a.push(i)),i=i.parent;for(let l=a.length-1;l>=0;l--){const o=a[l];(o.f&(xt|Ue))===0&&os(o)}}rt.clear()}}rt=null}}function Ii(t,e,r,n){if(!r.has(t)&&(r.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&xe)!==0?Ii(s,e,r,n):(a&(Kn|St))!==0&&(a&Pe)===0&&Li(s,e,n)&&(me(s,Pe),$t(s))}}function Li(t,e,r){const n=r.get(t);if(n!==void 0)return n;if(t.deps!==null)for(const s of t.deps){if(Ar.call(e,s))return!0;if((s.f&xe)!==0&&Li(s,e,r))return r.set(s,!0),!0}return r.set(t,!1),!1}function $t(t){for(var e=sn=t;e.parent!==null;){e=e.parent;var r=e.f;if(Cn&&e===re&&(r&St)!==0&&(r&qn)===0)return;if((r&(mr|it))!==0){if((r&be)===0)return;e.f^=be}}De.push(e)}function Di(t){if(!((t.f&it)!==0&&(t.f&be)!==0)){me(t,be);for(var e=t.first;e!==null;)Di(e),e=e.next}}function Cl(t){let e=0,r=cr(0),n;return()=>{Zn()&&(u(r),on(()=>(e===0&&(n=cn(()=>t(()=>rs(r)))),e+=1,()=>{ft(()=>{e-=1,e===0&&(n==null||n(),n=void 0,rs(r))})})))}}var Al=Pr|Kr|Fn;function Pl(t,e,r){new Ol(t,e,r)}var Ie,ws,lt,er,ct,Ve,Ne,dt,bt,Mt,tr,_t,Er,rr,Sr,Cr,yt,Gs,he,Bi,Hi,On,Ls,Ds,Nn;class Ol{constructor(e,r,n){q(this,he);tt(this,"parent");tt(this,"is_pending",!1);q(this,Ie);q(this,ws,H?W:null);q(this,lt);q(this,er);q(this,ct);q(this,Ve,null);q(this,Ne,null);q(this,dt,null);q(this,bt,null);q(this,Mt,null);q(this,tr,0);q(this,_t,0);q(this,Er,!1);q(this,rr,!1);q(this,Sr,new Set);q(this,Cr,new Set);q(this,yt,null);q(this,Gs,Cl(()=>(L(this,yt,cr(p(this,tr))),()=>{L(this,yt,null)})));L(this,Ie,e),L(this,lt,r),L(this,er,n),this.parent=re.b,this.is_pending=!!p(this,lt).pending,L(this,ct,ln(()=>{if(re.b=this,H){const a=p(this,ws);Or(),a.nodeType===Kt&&a.data===rn?ge(this,he,Hi).call(this):(ge(this,he,Bi).call(this),p(this,_t)===0&&(this.is_pending=!1))}else{var s=ge(this,he,On).call(this);try{L(this,Ve,Je(()=>n(s)))}catch(a){this.error(a)}p(this,_t)>0?ge(this,he,Ds).call(this):this.is_pending=!1}return()=>{var a;(a=p(this,Mt))==null||a.remove()}},Al)),H&&L(this,Ie,W)}defer_effect(e){Mi(e,p(this,Sr),p(this,Cr))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!p(this,lt).pending}update_pending_count(e){ge(this,he,Nn).call(this,e),L(this,tr,p(this,tr)+e),!(!p(this,yt)||p(this,Er))&&(L(this,Er,!0),ft(()=>{L(this,Er,!1),p(this,yt)&&Tr(p(this,yt),p(this,tr))}))}get_effect_pending(){return p(this,Gs).call(this),u(p(this,yt))}error(e){var r=p(this,lt).onerror;let n=p(this,lt).failed;if(p(this,rr)||!r&&!n)throw e;p(this,Ve)&&(Te(p(this,Ve)),L(this,Ve,null)),p(this,Ne)&&(Te(p(this,Ne)),L(this,Ne,null)),p(this,dt)&&(Te(p(this,dt)),L(this,dt,null)),H&&(_e(p(this,ws)),Vn(),_e(Us()));var s=!1,a=!1;const i=()=>{if(s){kl();return}s=!0,a&&pl(),Rt.ensure(),L(this,tr,0),p(this,dt)!==null&&nr(p(this,dt),()=>{L(this,dt,null)}),this.is_pending=this.has_pending_snippet(),L(this,Ve,ge(this,he,Ls).call(this,()=>(L(this,rr,!1),Je(()=>p(this,er).call(this,p(this,Ie)))))),p(this,_t)>0?ge(this,he,Ds).call(this):this.is_pending=!1};ft(()=>{try{a=!0,r==null||r(e,i),a=!1}catch(l){zr(l,p(this,ct)&&p(this,ct).parent)}n&&L(this,dt,ge(this,he,Ls).call(this,()=>{Rt.ensure(),L(this,rr,!0);try{return Je(()=>{n(p(this,Ie),()=>e,()=>i)})}catch(l){return zr(l,p(this,ct).parent),null}finally{L(this,rr,!1)}}))})}}Ie=new WeakMap,ws=new WeakMap,lt=new WeakMap,er=new WeakMap,ct=new WeakMap,Ve=new WeakMap,Ne=new WeakMap,dt=new WeakMap,bt=new WeakMap,Mt=new WeakMap,tr=new WeakMap,_t=new WeakMap,Er=new WeakMap,rr=new WeakMap,Sr=new WeakMap,Cr=new WeakMap,yt=new WeakMap,Gs=new WeakMap,he=new WeakSet,Bi=function(){try{L(this,Ve,Je(()=>p(this,er).call(this,p(this,Ie))))}catch(e){this.error(e)}},Hi=function(){const e=p(this,lt).pending;e&&(L(this,Ne,Je(()=>e(p(this,Ie)))),ft(()=>{var r=ge(this,he,On).call(this);L(this,Ve,ge(this,he,Ls).call(this,()=>(Rt.ensure(),Je(()=>p(this,er).call(this,r))))),p(this,_t)>0?ge(this,he,Ds).call(this):(nr(p(this,Ne),()=>{L(this,Ne,null)}),this.is_pending=!1)}))},On=function(){var e=p(this,Ie);return this.is_pending&&(L(this,Mt,Ae()),p(this,Ie).before(p(this,Mt)),e=p(this,Mt)),e},Ls=function(e){var r=re,n=Y,s=Fe;Qe(p(this,ct)),Me(p(this,ct)),Nr(p(this,ct).ctx);try{return e()}catch(a){return zi(a),null}finally{Qe(r),Me(n),Nr(s)}},Ds=function(){const e=p(this,lt).pending;p(this,Ve)!==null&&(L(this,bt,document.createDocumentFragment()),p(this,bt).append(p(this,Mt)),lo(p(this,Ve),p(this,bt))),p(this,Ne)===null&&L(this,Ne,Je(()=>e(p(this,Ie))))},Nn=function(e){var r;if(!this.has_pending_snippet()){this.parent&&ge(r=this.parent,he,Nn).call(r,e);return}if(L(this,_t,p(this,_t)+e),p(this,_t)===0){this.is_pending=!1;for(const n of p(this,Sr))me(n,Pe),$t(n);for(const n of p(this,Cr))me(n,Ct),$t(n);p(this,Sr).clear(),p(this,Cr).clear(),p(this,Ne)&&nr(p(this,Ne),()=>{L(this,Ne,null)}),p(this,bt)&&(p(this,Ie).before(p(this,bt)),L(this,bt,null))}};function Ui(t,e,r,n){const s=nn;var a=t.filter(h=>!h.settled);if(r.length===0&&a.length===0){n(e.map(s));return}var i=K,l=re,o=Nl(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(h=>h.promise)):null;function d(h){o();try{n(h)}catch(m){(l.f&xt)===0&&zr(m,l)}i==null||i.deactivate(),zn()}if(r.length===0){c.then(()=>d(e.map(s)));return}function f(){o(),Promise.all(r.map(h=>zl(h))).then(h=>d([...e.map(s),...h])).catch(h=>zr(h,l))}c?c.then(f):f()}function Nl(){var t=re,e=Y,r=Fe,n=K;return function(a=!0){Qe(t),Me(e),Nr(r),a&&(n==null||n.activate())}}function zn(){Qe(null),Me(null),Nr(null)}function nn(t){var e=xe|Pe,r=Y!==null&&(Y.f&xe)!==0?Y:null;return re!==null&&(re.f|=Kr),{ctx:Fe,deps:null,effects:null,equals:Ai,f:e,fn:t,reactions:null,rv:0,v:ke,wv:0,parent:r??re,ac:null}}function zl(t,e,r){let n=re;n===null&&nl();var s=n.b,a=void 0,i=cr(ke),l=!Y,o=new Map;return Ul(()=>{var m;var c=xi();a=c.promise;try{Promise.resolve(t()).then(c.resolve,c.reject).then(()=>{d===K&&d.committed&&d.deactivate(),zn()})}catch(b){c.reject(b),zn()}var d=K;if(l){var f=s.is_rendered();s.update_pending_count(1),d.increment(f),(m=o.get(d))==null||m.reject(yr),o.delete(d),o.set(d,c)}const h=(b,z=void 0)=>{if(d.activate(),z)z!==yr&&(i.f|=jt,Tr(i,z));else{(i.f&jt)!==0&&(i.f^=jt),Tr(i,b);for(const[v,w]of o){if(o.delete(v),v===d)break;w.reject(yr)}}l&&(s.update_pending_count(-1),d.decrement(f))};c.promise.then(h,b=>h(null,b||"unknown"))}),Xn(()=>{for(const c of o.values())c.reject(yr)}),new Promise(c=>{function d(f){function h(){f===a?c(i):d(a)}f.then(h,h)}d(a)})}function Ge(t){const e=nn(t);return co(e),e}function Tl(t){const e=nn(t);return e.equals=Pi,e}function Fi(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)Te(e[r])}}function Ml(t){for(var e=t.parent;e!==null;){if((e.f&xe)===0)return(e.f&xt)===0?e:null;e=e.parent}return null}function Jn(t){var e,r=re;Qe(Ml(t));try{t.f&=~or,Fi(t),e=ho(t)}finally{Qe(r)}return e}function qi(t){var e=Jn(t);if(!t.equals(e)&&(t.wv=fo(),(!(K!=null&&K.is_fork)||t.deps===null)&&(t.v=e,t.deps===null))){me(t,be);return}Dt||(we!==null?(Zn()||K!=null&&K.is_fork)&&we.set(t,e):Yn(t))}let Tn=new Set;const It=new Map;let Ki=!1;function cr(t,e){var r={f:0,v:t,reactions:null,equals:Ai,rv:0,wv:0};return r}function ee(t,e){const r=cr(t);return co(r),r}function Wi(t,e=!1,r=!0){const n=cr(t);return e||(n.equals=Pi),n}function k(t,e,r=!1){Y!==null&&(!at||(Y.f&Ja)!==0)&&Oi()&&(Y.f&(xe|St|Kn|Ja))!==0&&(Xe===null||!Ar.call(Xe,t))&&fl();let n=r?nt(e):e;return Tr(t,n)}function Tr(t,e){if(!t.equals(e)){var r=t.v;Dt?It.set(t,e):It.set(t,r),t.v=e;var n=Rt.ensure();if(n.capture(t,r),(t.f&xe)!==0){const s=t;(t.f&Pe)!==0&&Jn(s),Yn(s)}t.wv=fo(),Vi(t,Pe),re!==null&&(re.f&be)!==0&&(re.f&(it|mr))===0&&(We===null?Kl([t]):We.push(t)),!n.is_fork&&Tn.size>0&&!Ki&&jl()}return e}function jl(){Ki=!1;for(const t of Tn)(t.f&be)!==0&&me(t,Ct),Ss(t)&&os(t);Tn.clear()}function rs(t){k(t,t.v+1)}function Vi(t,e){var r=t.reactions;if(r!==null)for(var n=r.length,s=0;s<n;s++){var a=r[s],i=a.f,l=(i&Pe)===0;if(l&&me(a,e),(i&xe)!==0){var o=a;we==null||we.delete(o),(i&or)===0&&(i&Ze&&(a.f|=or),Vi(o,Ct))}else l&&((i&St)!==0&&rt!==null&&rt.add(a),$t(a))}}function nt(t){if(typeof t!="object"||t===null||Is in t)return t;const e=wi(t);if(e!==Zo&&e!==Xo)return t;var r=new Map,n=yi(t),s=ee(0),a=ar,i=l=>{if(ar===a)return l();var o=Y,c=ar;Me(null),ei(a);var d=l();return Me(o),ei(c),d};return n&&r.set("length",ee(t.length)),new Proxy(t,{defineProperty(l,o,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&dl();var d=r.get(o);return d===void 0?d=i(()=>{var f=ee(c.value);return r.set(o,f),f}):k(d,c.value,!0),!0},deleteProperty(l,o){var c=r.get(o);if(c===void 0){if(o in l){const d=i(()=>ee(ke));r.set(o,d),rs(s)}}else k(c,ke),rs(s);return!0},get(l,o,c){var m;if(o===Is)return t;var d=r.get(o),f=o in l;if(d===void 0&&(!f||(m=es(l,o))!=null&&m.writable)&&(d=i(()=>{var b=nt(f?l[o]:ke),z=ee(b);return z}),r.set(o,d)),d!==void 0){var h=u(d);return h===ke?void 0:h}return Reflect.get(l,o,c)},getOwnPropertyDescriptor(l,o){var c=Reflect.getOwnPropertyDescriptor(l,o);if(c&&"value"in c){var d=r.get(o);d&&(c.value=u(d))}else if(c===void 0){var f=r.get(o),h=f==null?void 0:f.v;if(f!==void 0&&h!==ke)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return c},has(l,o){var h;if(o===Is)return!0;var c=r.get(o),d=c!==void 0&&c.v!==ke||Reflect.has(l,o);if(c!==void 0||re!==null&&(!d||(h=es(l,o))!=null&&h.writable)){c===void 0&&(c=i(()=>{var m=d?nt(l[o]):ke,b=ee(m);return b}),r.set(o,c));var f=u(c);if(f===ke)return!1}return d},set(l,o,c,d){var T;var f=r.get(o),h=o in l;if(n&&o==="length")for(var m=c;m<f.v;m+=1){var b=r.get(m+"");b!==void 0?k(b,ke):m in l&&(b=i(()=>ee(ke)),r.set(m+"",b))}if(f===void 0)(!h||(T=es(l,o))!=null&&T.writable)&&(f=i(()=>ee(void 0)),k(f,nt(c)),r.set(o,f));else{h=f.v!==ke;var z=i(()=>nt(c));k(f,z)}var v=Reflect.getOwnPropertyDescriptor(l,o);if(v!=null&&v.set&&v.set.call(d,c),!h){if(n&&typeof o=="string"){var w=r.get("length"),C=Number(o);Number.isInteger(C)&&C>=w.v&&k(w,C+1)}rs(s)}return!0},ownKeys(l){u(s);var o=Reflect.ownKeys(l).filter(f=>{var h=r.get(f);return h===void 0||h.v!==ke});for(var[c,d]of r)d.v!==ke&&!(c in l)&&o.push(c);return o},setPrototypeOf(){ul()}})}var Za,Yi,Ji,Gi,Zi;function Mn(){if(Za===void 0){Za=window,Yi=document,Ji=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;Gi=es(e,"firstChild").get,Zi=es(e,"nextSibling").get,Ya(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Ya(r)&&(r.__t=void 0)}}function Ae(t=""){return document.createTextNode(t)}function He(t){return Gi.call(t)}function qe(t){return Zi.call(t)}function E(t,e){if(!H)return He(t);var r=He(W);if(r===null)r=W.appendChild(Ae());else if(e&&r.nodeType!==tn){var n=Ae();return r==null||r.before(n),_e(n),n}return _e(r),r}function is(t,e=!1){if(!H){var r=He(t);return r instanceof Comment&&r.data===""?qe(r):r}if(e&&(W==null?void 0:W.nodeType)!==tn){var n=Ae();return W==null||W.before(n),_e(n),n}return W}function O(t,e=1,r=!1){let n=H?W:t;for(var s;e--;)s=n,n=qe(n);if(!H)return n;if(r&&(n==null?void 0:n.nodeType)!==tn){var a=Ae();return n===null?s==null||s.after(a):n.before(a),_e(a),a}return _e(n),n}function Gn(t){t.textContent=""}function Xi(){return!1}function Rl(t){H&&He(t)!==null&&Gn(t)}let Xa=!1;function Qi(){Xa||(Xa=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const r of t.target.elements)(e=r.__on_r)==null||e.call(r)})},{capture:!0}))}function an(t){var e=Y,r=re;Me(null),Qe(null);try{return t()}finally{Me(e),Qe(r)}}function Il(t,e,r,n=r){t.addEventListener(e,()=>an(r));const s=t.__on_r;s?t.__on_r=()=>{s(),n(!0)}:t.__on_r=()=>n(!0),Qi()}function Ll(t){re===null&&(Y===null&&ol(),il()),Dt&&al()}function Dl(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function gt(t,e,r){var n=re;n!==null&&(n.f&Ue)!==0&&(t|=Ue);var s={ctx:Fe,deps:null,nodes:null,f:t|Pe|Ze,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};if(r)try{os(s),s.f|=en}catch(l){throw Te(s),l}else e!==null&&$t(s);var a=s;if(r&&a.deps===null&&a.teardown===null&&a.nodes===null&&a.first===a.last&&(a.f&Kr)===0&&(a=a.first,(t&St)!==0&&(t&Pr)!==0&&a!==null&&(a.f|=Pr)),a!==null&&(a.parent=n,n!==null&&Dl(a,n),Y!==null&&(Y.f&xe)!==0&&(t&mr)===0)){var i=Y;(i.effects??(i.effects=[])).push(a)}return s}function Zn(){return Y!==null&&!at}function Xn(t){const e=gt(Qs,null,!1);return me(e,be),e.teardown=t,e}function eo(t){Ll();var e=re.f,r=!Y&&(e&it)!==0&&(e&en)===0;if(r){var n=Fe;(n.e??(n.e=[])).push(t)}else return to(t)}function to(t){return gt(as|el,t,!1)}function Bl(t){Rt.ensure();const e=gt(mr|Kr,t,!0);return(r={})=>new Promise(n=>{r.outro?nr(e,()=>{Te(e),n(void 0)}):(Te(e),n(void 0))})}function Hl(t){return gt(as,t,!1)}function Ul(t){return gt(Kn|Kr,t,!0)}function on(t,e=0){return gt(Qs|e,t,!0)}function U(t,e=[],r=[],n=[]){Ui(n,e,r,s=>{gt(Qs,()=>t(...s.map(u)),!0)})}function Fl(t,e=[],r=[],n=[]){var s=K,a=r.length>0||n.length>0;a&&s.increment(!0),Ui(n,e,r,i=>{gt(as,()=>t(...i.map(u)),!1),a&&s.decrement(!0)})}function ln(t,e=0){var r=gt(St|e,t,!0);return r}function Je(t){return gt(it|Kr,t,!0)}function ro(t){var e=t.teardown;if(e!==null){const r=Dt,n=Y;Qa(!0),Me(null);try{e.call(null)}finally{Qa(r),Me(n)}}}function so(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){const s=r.ac;s!==null&&an(()=>{s.abort(yr)});var n=r.next;(r.f&mr)!==0?r.parent=null:Te(r,e),r=n}}function ql(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&it)===0&&Te(e),e=r}}function Te(t,e=!0){var r=!1;(e||(t.f&qn)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(no(t.nodes.start,t.nodes.end),r=!0),so(t,e&&!r),Fs(t,0),me(t,xt);var n=t.nodes&&t.nodes.t;if(n!==null)for(const a of n)a.stop();ro(t);var s=t.parent;s!==null&&s.first!==null&&ao(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=null}function no(t,e){for(;t!==null;){var r=t===e?null:qe(t);t.remove(),t=r}}function ao(t){var e=t.parent,r=t.prev,n=t.next;r!==null&&(r.next=n),n!==null&&(n.prev=r),e!==null&&(e.first===t&&(e.first=n),e.last===t&&(e.last=r))}function nr(t,e,r=!0){var n=[];io(t,n,!0);var s=()=>{r&&Te(t),e&&e()},a=n.length;if(a>0){var i=()=>--a||s();for(var l of n)l.out(i)}else s()}function io(t,e,r){if((t.f&Ue)===0){t.f^=Ue;var n=t.nodes&&t.nodes.t;if(n!==null)for(const l of n)(l.is_global||r)&&e.push(l);for(var s=t.first;s!==null;){var a=s.next,i=(s.f&Pr)!==0||(s.f&it)!==0&&(t.f&St)!==0;io(s,e,i?r:!1),s=a}}}function Qn(t){oo(t,!0)}function oo(t,e){if((t.f&Ue)!==0){t.f^=Ue,(t.f&be)===0&&(me(t,Pe),$t(t));for(var r=t.first;r!==null;){var n=r.next,s=(r.f&Pr)!==0||(r.f&it)!==0;oo(r,s?e:!1),r=n}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function lo(t,e){if(t.nodes)for(var r=t.nodes.start,n=t.nodes.end;r!==null;){var s=r===n?null:qe(r);e.append(r),r=s}}let Bs=!1,Dt=!1;function Qa(t){Dt=t}let Y=null,at=!1;function Me(t){Y=t}let re=null;function Qe(t){re=t}let Xe=null;function co(t){Y!==null&&(Xe===null?Xe=[t]:Xe.push(t))}let ze=null,Re=0,We=null;function Kl(t){We=t}let uo=1,Gt=0,ar=Gt;function ei(t){ar=t}function fo(){return++uo}function Ss(t){var e=t.f;if((e&Pe)!==0)return!0;if(e&xe&&(t.f&=~or),(e&Ct)!==0){for(var r=t.deps,n=r.length,s=0;s<n;s++){var a=r[s];if(Ss(a)&&qi(a),a.wv>t.wv)return!0}(e&Ze)!==0&&we===null&&me(t,be)}return!1}function po(t,e,r=!0){var n=t.reactions;if(n!==null&&!(Xe!==null&&Ar.call(Xe,t)))for(var s=0;s<n.length;s++){var a=n[s];(a.f&xe)!==0?po(a,e,!1):e===a&&(r?me(a,Pe):(a.f&be)!==0&&me(a,Ct),$t(a))}}function ho(t){var z;var e=ze,r=Re,n=We,s=Y,a=Xe,i=Fe,l=at,o=ar,c=t.f;ze=null,Re=0,We=null,Y=(c&(it|mr))===0?t:null,Xe=null,Nr(t.ctx),at=!1,ar=++Gt,t.ac!==null&&(an(()=>{t.ac.abort(yr)}),t.ac=null);try{t.f|=En;var d=t.fn,f=d(),h=t.deps,m=K==null?void 0:K.is_fork;if(ze!==null){var b;if(m||Fs(t,Re),h!==null&&Re>0)for(h.length=Re+ze.length,b=0;b<ze.length;b++)h[Re+b]=ze[b];else t.deps=h=ze;if(Zn()&&(t.f&Ze)!==0)for(b=Re;b<h.length;b++)((z=h[b]).reactions??(z.reactions=[])).push(t)}else!m&&h!==null&&Re<h.length&&(Fs(t,Re),h.length=Re);if(Oi()&&We!==null&&!at&&h!==null&&(t.f&(xe|Ct|Pe))===0)for(b=0;b<We.length;b++)po(We[b],t);if(s!==null&&s!==t){if(Gt++,s.deps!==null)for(let v=0;v<r;v+=1)s.deps[v].rv=Gt;if(e!==null)for(const v of e)v.rv=Gt;We!==null&&(n===null?n=We:n.push(...We))}return(t.f&jt)!==0&&(t.f^=jt),f}catch(v){return zi(v)}finally{t.f^=En,ze=e,Re=r,We=n,Y=s,Xe=a,Nr(i),at=l,ar=o}}function Wl(t,e){let r=e.reactions;if(r!==null){var n=Jo.call(r,t);if(n!==-1){var s=r.length-1;s===0?r=e.reactions=null:(r[n]=r[s],r.pop())}}if(r===null&&(e.f&xe)!==0&&(ze===null||!Ar.call(ze,e))){var a=e;(a.f&Ze)!==0&&(a.f^=Ze,a.f&=~or),Yn(a),Fi(a),Fs(a,0)}}function Fs(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)Wl(t,r[n])}function os(t){var e=t.f;if((e&xt)===0){me(t,be);var r=re,n=Bs;re=t,Bs=!0;try{(e&(St|$i))!==0?ql(t):so(t),ro(t);var s=ho(t);t.teardown=typeof s=="function"?s:null,t.wv=uo;var a;$n&&xl&&(t.f&Pe)!==0&&t.deps}finally{Bs=n,re=r}}}async function Vl(){await Promise.resolve(),G()}function u(t){var e=t.f,r=(e&xe)!==0;if(Y!==null&&!at){var n=re!==null&&(re.f&xt)!==0;if(!n&&(Xe===null||!Ar.call(Xe,t))){var s=Y.deps;if((Y.f&En)!==0)t.rv<Gt&&(t.rv=Gt,ze===null&&s!==null&&s[Re]===t?Re++:ze===null?ze=[t]:ze.push(t));else{(Y.deps??(Y.deps=[])).push(t);var a=t.reactions;a===null?t.reactions=[Y]:Ar.call(a,Y)||a.push(Y)}}}if(Dt&&It.has(t))return It.get(t);if(r){var i=t;if(Dt){var l=i.v;return((i.f&be)===0&&i.reactions!==null||mo(i))&&(l=Jn(i)),It.set(i,l),l}var o=(i.f&Ze)===0&&!at&&Y!==null&&(Bs||(Y.f&Ze)!==0),c=i.deps===null;Ss(i)&&(o&&(i.f|=Ze),qi(i)),o&&!c&&vo(i)}if(we!=null&&we.has(t))return we.get(t);if((t.f&jt)!==0)throw t.v;return t.v}function vo(t){if(t.deps!==null){t.f|=Ze;for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&xe)!==0&&(e.f&Ze)===0&&vo(e)}}function mo(t){if(t.v===ke)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(It.has(e)||(e.f&xe)!==0&&mo(e))return!0;return!1}function cn(t){var e=at;try{return at=!0,t()}finally{at=e}}const Yl=["touchstart","touchmove"];function Jl(t){return Yl.includes(t)}const go=new Set,jn=new Set;function Gl(t,e,r,n={}){function s(a){if(n.capture||Xr.call(e,a),!a.cancelBubble)return an(()=>r==null?void 0:r.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?ft(()=>{e.addEventListener(t,s,n)}):e.addEventListener(t,s,n),s}function Ee(t,e,r,n,s){var a={capture:n,passive:s},i=Gl(t,e,r,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Xn(()=>{e.removeEventListener(t,i,a)})}function Wr(t){for(var e=0;e<t.length;e++)go.add(t[e]);for(var r of jn)r(t)}let ti=null;function Xr(t){var v;var e=this,r=e.ownerDocument,n=t.type,s=((v=t.composedPath)==null?void 0:v.call(t))||[],a=s[0]||t.target;ti=t;var i=0,l=ti===t&&t.__root;if(l){var o=s.indexOf(l);if(o!==-1&&(e===document||e===window)){t.__root=e;return}var c=s.indexOf(e);if(c===-1)return;o<=c&&(i=o)}if(a=s[i]||t.target,a!==e){ki(t,"currentTarget",{configurable:!0,get(){return a||r}});var d=Y,f=re;Me(null),Qe(null);try{for(var h,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var z=a["__"+n];z!=null&&(!a.disabled||t.target===a)&&z.call(a,t)}catch(w){h?m.push(w):h=w}if(t.cancelBubble||b===e||b===null)break;a=b}if(h){for(let w of m)queueMicrotask(()=>{throw w});throw h}}finally{t.__root=e,delete t.currentTarget,Me(d),Qe(f)}}}function bo(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function pt(t,e){var r=re;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function B(t,e){var r=(e&bl)!==0,n=(e&_l)!==0,s,a=!t.startsWith("<!>");return()=>{if(H)return pt(W,null),W;s===void 0&&(s=bo(a?t:"<!>"+t),r||(s=He(s)));var i=n||Ji?document.importNode(s,!0):s.cloneNode(!0);if(r){var l=He(i),o=i.lastChild;pt(l,o)}else pt(i,i);return i}}function gn(t=""){if(!H){var e=Ae(t+"");return pt(e,e),e}var r=W;return r.nodeType!==tn&&(r.before(r=Ae()),_e(r)),pt(r,r),r}function qs(){if(H)return pt(W,null),W;var t=document.createDocumentFragment(),e=document.createComment(""),r=Ae();return t.append(e,r),pt(e,r),t}function M(t,e){if(H){var r=re;((r.f&en)===0||r.nodes.end===null)&&(r.nodes.end=W),Or();return}t!==null&&t.before(e)}function fe(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=r,t.nodeValue=r+"")}function ea(t,e){return _o(t,e)}function Zl(t,e){Mn(),e.intro=e.intro??!1;const r=e.target,n=H,s=W;try{for(var a=He(r);a&&(a.nodeType!==Kt||a.data!==Si);)a=qe(a);if(!a)throw lr;Be(!0),_e(a);const i=_o(t,{...e,anchor:a});return Be(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
+ `).some(l=>l.startsWith("https://svelte.dev/e/")))throw i;return i!==lr&&console.warn("Failed to hydrate: ",i),e.recover===!1&&cl(),Mn(),Gn(r),Be(!1),ea(t,e)}finally{Be(n),_e(s)}}const br=new Map;function _o(t,{target:e,anchor:r,props:n={},events:s,context:a,intro:i=!0}){Mn();var l=new Set,o=f=>{for(var h=0;h<f.length;h++){var m=f[h];if(!l.has(m)){l.add(m);var b=Jl(m);e.addEventListener(m,Xr,{passive:b});var z=br.get(m);z===void 0?(document.addEventListener(m,Xr,{passive:b}),br.set(m,1)):br.set(m,z+1)}}};o(Xs(go)),jn.add(o);var c=void 0,d=Bl(()=>{var f=r??e.appendChild(Ae());return Pl(f,{pending:()=>{}},h=>{if(a){vt({});var m=Fe;m.c=a}if(s&&(n.$$events=s),H&&pt(h,null),c=t(h,n)||{},H&&(re.nodes.end=W,W===null||W.nodeType!==Kt||W.data!==Wn))throw Es(),lr;a&&mt()}),()=>{var b;for(var h of l){e.removeEventListener(h,Xr);var m=br.get(h);--m===0?(document.removeEventListener(h,Xr),br.delete(h)):br.set(h,m)}jn.delete(o),f!==r&&((b=f.parentNode)==null||b.removeChild(f))}});return Rn.set(c,d),c}let Rn=new WeakMap;function Xl(t,e){const r=Rn.get(t);return r?(Rn.delete(t),r(e)):Promise.resolve()}var st,ut,Le,sr,xs,$s,Zs;class Ql{constructor(e,r=!0){tt(this,"anchor");q(this,st,new Map);q(this,ut,new Map);q(this,Le,new Map);q(this,sr,new Set);q(this,xs,!0);q(this,$s,()=>{var e=K;if(p(this,st).has(e)){var r=p(this,st).get(e),n=p(this,ut).get(r);if(n)Qn(n),p(this,sr).delete(r);else{var s=p(this,Le).get(r);s&&(p(this,ut).set(r,s.effect),p(this,Le).delete(r),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),n=s.effect)}for(const[a,i]of p(this,st)){if(p(this,st).delete(a),a===e)break;const l=p(this,Le).get(i);l&&(Te(l.effect),p(this,Le).delete(i))}for(const[a,i]of p(this,ut)){if(a===r||p(this,sr).has(a))continue;const l=()=>{if(Array.from(p(this,st).values()).includes(a)){var c=document.createDocumentFragment();lo(i,c),c.append(Ae()),p(this,Le).set(a,{effect:i,fragment:c})}else Te(i);p(this,sr).delete(a),p(this,ut).delete(a)};p(this,xs)||!n?(p(this,sr).add(a),nr(i,l,!1)):l()}}});q(this,Zs,e=>{p(this,st).delete(e);const r=Array.from(p(this,st).values());for(const[n,s]of p(this,Le))r.includes(n)||(Te(s.effect),p(this,Le).delete(n))});this.anchor=e,L(this,xs,r)}ensure(e,r){var n=K,s=Xi();if(r&&!p(this,ut).has(e)&&!p(this,Le).has(e))if(s){var a=document.createDocumentFragment(),i=Ae();a.append(i),p(this,Le).set(e,{effect:Je(()=>r(i)),fragment:a})}else p(this,ut).set(e,Je(()=>r(this.anchor)));if(p(this,st).set(n,e),s){for(const[l,o]of p(this,ut))l===e?n.skipped_effects.delete(o):n.skipped_effects.add(o);for(const[l,o]of p(this,Le))l===e?n.skipped_effects.delete(o.effect):n.skipped_effects.add(o.effect);n.oncommit(p(this,$s)),n.ondiscard(p(this,Zs))}else H&&(this.anchor=W),p(this,$s).call(this)}}st=new WeakMap,ut=new WeakMap,Le=new WeakMap,sr=new WeakMap,xs=new WeakMap,$s=new WeakMap,Zs=new WeakMap;function se(t,e,r=!1){H&&Or();var n=new Ql(t),s=r?Pr:0;function a(i,l){if(H){const c=Ci(t)===rn;if(i===c){var o=Us();_e(o),n.anchor=o,Be(!1),n.ensure(i,l),Be(!0);return}}n.ensure(i,l)}ln(()=>{var i=!1;e((l,o=!0)=>{i=!0,a(o,l)}),i||a(!1,null)},s)}function ec(t,e){return e}function tc(t,e,r){for(var n=[],s=e.length,a,i=e.length,l=0;l<s;l++){let f=e[l];nr(f,()=>{if(a){if(a.pending.delete(f),a.done.add(f),a.pending.size===0){var h=t.outrogroups;In(Xs(a.done)),h.delete(a),h.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=n.length===0&&r!==null;if(o){var c=r,d=c.parentNode;Gn(d),d.append(c),t.items.clear()}In(e,!o)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function In(t,e=!0){for(var r=0;r<t.length;r++)Te(t[r],e)}var ri;function ls(t,e,r,n,s,a=null){var i=t,l=new Map,o=(e&Ei)!==0;if(o){var c=t;i=H?_e(He(c)):c.appendChild(Ae())}H&&Or();var d=null,f=Tl(()=>{var w=r();return yi(w)?w:w==null?[]:Xs(w)}),h,m=!0;function b(){v.fallback=d,rc(v,h,i,e,n),d!==null&&(h.length===0?(d.f&wt)===0?Qn(d):(d.f^=wt,Qr(d,null,i)):nr(d,()=>{d=null}))}var z=ln(()=>{h=u(f);var w=h.length;let C=!1;if(H){var T=Ci(i)===rn;T!==(w===0)&&(i=Us(),_e(i),Be(!1),C=!0)}for(var I=new Set,Z=K,Q=Xi(),ne=0;ne<w;ne+=1){H&&W.nodeType===Kt&&W.data===Wn&&(i=W,C=!0,Be(!1));var $=h[ne],R=n($,ne),_=m?null:l.get(R);_?(_.v&&Tr(_.v,$),_.i&&Tr(_.i,ne),Q&&Z.skipped_effects.delete(_.e)):(_=sc(l,m?i:ri??(ri=Ae()),$,R,ne,s,e,r),m||(_.e.f|=wt),l.set(R,_)),I.add(R)}if(w===0&&a&&!d&&(m?d=Je(()=>a(i)):(d=Je(()=>a(ri??(ri=Ae()))),d.f|=wt)),H&&w>0&&_e(Us()),!m)if(Q){for(const[j,ae]of l)I.has(j)||Z.skipped_effects.add(ae.e);Z.oncommit(b),Z.ondiscard(()=>{})}else b();C&&Be(!0),u(f)}),v={effect:z,items:l,outrogroups:null,fallback:d};m=!1,H&&(i=W)}function Jr(t){for(;t!==null&&(t.f&it)===0;)t=t.next;return t}function rc(t,e,r,n,s){var _,j,ae,S,N,V,A,D,$e;var a=(n&ml)!==0,i=e.length,l=t.items,o=Jr(t.effect.first),c,d=null,f,h=[],m=[],b,z,v,w;if(a)for(w=0;w<i;w+=1)b=e[w],z=s(b,w),v=l.get(z).e,(v.f&wt)===0&&((j=(_=v.nodes)==null?void 0:_.a)==null||j.measure(),(f??(f=new Set)).add(v));for(w=0;w<i;w+=1){if(b=e[w],z=s(b,w),v=l.get(z).e,t.outrogroups!==null)for(const ye of t.outrogroups)ye.pending.delete(v),ye.done.delete(v);if((v.f&wt)!==0)if(v.f^=wt,v===o)Qr(v,null,r);else{var C=d?d.next:o;v===t.effect.last&&(t.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),zt(t,d,v),zt(t,v,C),Qr(v,C,r),d=v,h=[],m=[],o=Jr(d.next);continue}if((v.f&Ue)!==0&&(Qn(v),a&&((S=(ae=v.nodes)==null?void 0:ae.a)==null||S.unfix(),(f??(f=new Set)).delete(v))),v!==o){if(c!==void 0&&c.has(v)){if(h.length<m.length){var T=m[0],I;d=T.prev;var Z=h[0],Q=h[h.length-1];for(I=0;I<h.length;I+=1)Qr(h[I],T,r);for(I=0;I<m.length;I+=1)c.delete(m[I]);zt(t,Z.prev,Q.next),zt(t,d,Z),zt(t,Q,T),o=T,d=Q,w-=1,h=[],m=[]}else c.delete(v),Qr(v,o,r),zt(t,v.prev,v.next),zt(t,v,d===null?t.effect.first:d.next),zt(t,d,v),d=v;continue}for(h=[],m=[];o!==null&&o!==v;)(c??(c=new Set)).add(o),m.push(o),o=Jr(o.next);if(o===null)continue}(v.f&wt)===0&&h.push(v),d=v,o=Jr(v.next)}if(t.outrogroups!==null){for(const ye of t.outrogroups)ye.pending.size===0&&(In(Xs(ye.done)),(N=t.outrogroups)==null||N.delete(ye));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||c!==void 0){var ne=[];if(c!==void 0)for(v of c)(v.f&Ue)===0&&ne.push(v);for(;o!==null;)(o.f&Ue)===0&&o!==t.fallback&&ne.push(o),o=Jr(o.next);var $=ne.length;if($>0){var R=(n&Ei)!==0&&i===0?r:null;if(a){for(w=0;w<$;w+=1)(A=(V=ne[w].nodes)==null?void 0:V.a)==null||A.measure();for(w=0;w<$;w+=1)($e=(D=ne[w].nodes)==null?void 0:D.a)==null||$e.fix()}tc(t,ne,R)}}a&&ft(()=>{var ye,et;if(f!==void 0)for(v of f)(et=(ye=v.nodes)==null?void 0:ye.a)==null||et.apply()})}function sc(t,e,r,n,s,a,i,l){var o=(i&hl)!==0?(i&gl)===0?Wi(r,!1,!1):cr(r):null,c=(i&vl)!==0?cr(s):null;return{v:o,i:c,e:Je(()=>(a(e,o??r,c??s,l),()=>{t.delete(n)}))}}function Qr(t,e,r){if(t.nodes)for(var n=t.nodes.start,s=t.nodes.end,a=e&&(e.f&wt)===0?e.nodes.start:r;n!==null;){var i=qe(n);if(a.before(n),n===s)return;n=i}}function zt(t,e,r){e===null?t.effect.first=r:e.next=r,r===null?t.effect.last=e:r.prev=e}function yo(t,e,r=!1,n=!1,s=!1){var a=t,i="";U(()=>{var l=re;if(i===(i=e()??"")){H&&Or();return}if(l.nodes!==null&&(no(l.nodes.start,l.nodes.end),l.nodes=null),i!==""){if(H){W.data;for(var o=Or(),c=o;o!==null&&(o.nodeType!==Kt||o.data!=="");)c=o,o=qe(o);if(o===null)throw Es(),lr;pt(W,c),a=_e(o);return}var d=i+"";r?d=`<svg>${d}</svg>`:n&&(d=`<math>${d}</math>`);var f=bo(d);if((r||n)&&(f=He(f)),pt(He(f),f.lastChild),r||n)for(;He(f);)a.before(He(f));else a.before(f)}})}function nc(t,e){let r=null,n=H;var s;if(H){r=W;for(var a=He(document.head);a!==null&&(a.nodeType!==Kt||a.data!==t);)a=qe(a);if(a===null)Be(!1);else{var i=qe(a);a.remove(),_e(i)}}H||(s=document.head.appendChild(Ae()));try{ln(()=>e(s),qn)}finally{n&&(Be(!0),_e(r))}}function ac(t,e,r){var n=t==null?"":""+t;return e&&(n=n?n+" "+e:e),n===""?null:n}function Yt(t,e,r,n,s,a){var i=t.__className;if(H||i!==r||i===void 0){var l=ac(r,n);(!H||l!==t.getAttribute("class"))&&(l==null?t.removeAttribute("class"):t.className=l),t.__className=r}return a}const ic=Symbol("is custom element"),oc=Symbol("is html");function ko(t){if(H){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;Ks(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var s=t.checked;Ks(t,"checked",null),t.checked=s}}};t.__on_r=r,ft(r),Qi()}}function Ks(t,e,r,n){var s=lc(t);H&&(s[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||s[e]!==(s[e]=r)&&(e==="loading"&&(t[rl]=r),r==null?t.removeAttribute(e):typeof r!="string"&&wo(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function ce(t,e,r){var n=Y,s=re;let a=H;H&&Be(!1),Me(null),Qe(null);try{e!=="style"&&(Ln.has(t.getAttribute("is")||t.nodeName)||!customElements||customElements.get(t.getAttribute("is")||t.tagName.toLowerCase())?wo(t).includes(e):r&&typeof r=="object")?t[e]=r:Ks(t,e,r==null?r:String(r))}finally{Me(n),Qe(s),a&&Be(!0)}}function lc(t){return t.__attributes??(t.__attributes={[ic]:t.nodeName.includes("-"),[oc]:t.namespaceURI===yl})}var Ln=new Map;function wo(t){var e=t.getAttribute("is")||t.nodeName,r=Ln.get(e);if(r)return r;Ln.set(e,r=[]);for(var n,s=t,a=Element.prototype;a!==s;){n=Go(s);for(var i in n)n[i].set&&r.push(i);s=wi(s)}return r}function ta(t,e,r=e){var n=new WeakSet;Il(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=bn(t)?_n(a):a,r(a),K!==null&&n.add(K),await Vl(),a!==(a=e())){var i=t.selectionStart,l=t.selectionEnd,o=t.value.length;if(t.value=a??"",l!==null){var c=t.value.length;i===l&&l===o&&c>o?(t.selectionStart=c,t.selectionEnd=c):(t.selectionStart=i,t.selectionEnd=Math.min(l,c))}}}),(H&&t.defaultValue!==t.value||cn(e)==null&&t.value)&&(r(bn(t)?_n(t.value):t.value),K!==null&&n.add(K)),on(()=>{var s=e();if(t===document.activeElement){var a=Sn??K;if(n.has(a))return}bn(t)&&s===_n(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}function bn(t){var e=t.type;return e==="number"||e==="range"}function _n(t){return t===""?null:+t}function si(t,e){return t===e||(t==null?void 0:t[Is])===e}function xo(t={},e,r,n){return Hl(()=>{var s,a;return on(()=>{s=a,a=[],cn(()=>{t!==r(...a)&&(e(t,...a),s&&si(r(...s),t)&&e(null,...s))})}),()=>{ft(()=>{a&&si(r(...a),t)&&e(null,...a)})}}),t}function cc(t,e,r,n,s){var a=()=>{n(r[t])};r.addEventListener(e,a),s?on(()=>{r[t]=s()}):a(),(r===document.body||r===window||r===document)&&Xn(()=>{r.removeEventListener(e,a)})}function At(t,e,r){var n;t.$$events||(t.$$events={}),(n=t.$$events)[e]||(n[e]=[]),t.$$events[e].push(r)}function Pt(t){for(var e in t)e in this&&(this[e]=t[e])}function te(t,e,r,n){var s=n,a=!0,i=()=>(a&&(a=!1,s=n),s),l;l=t[e],l===void 0&&n!==void 0&&(l=i());var o;o=()=>{var h=t[e];return h===void 0?i():(a=!0,h)};var c=!1,d=nn(()=>(c=!1,o())),f=re;return(function(h,m){if(arguments.length>0){const b=m?u(d):h;return k(d,b),c=!0,s!==void 0&&(s=b),h}return Dt&&c||(f.f&xt)!==0?d.v:u(d)})}function Ot(t){return new dc(t)}var kt,Ye;class dc{constructor(e){q(this,kt);q(this,Ye);var a;var r=new Map,n=(i,l)=>{var o=Wi(l,!1,!1);return r.set(i,o),o};const s=new Proxy({...e.props||{},$$events:{}},{get(i,l){return u(r.get(l)??n(l,Reflect.get(i,l)))},has(i,l){return l===tl?!0:(u(r.get(l)??n(l,Reflect.get(i,l))),Reflect.has(i,l))},set(i,l,o){return k(r.get(l)??n(l,o),o),Reflect.set(i,l,o)}});L(this,Ye,(e.hydrate?Zl:ea)(e.component,{target:e.target,anchor:e.anchor,props:s,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((a=e==null?void 0:e.props)!=null&&a.$$host)||e.sync===!1)&&G(),L(this,kt,s.$$events);for(const i of Object.keys(p(this,Ye)))i==="$set"||i==="$destroy"||i==="$on"||ki(this,i,{get(){return p(this,Ye)[i]},set(l){p(this,Ye)[i]=l},enumerable:!0});p(this,Ye).$set=i=>{Object.assign(s,i)},p(this,Ye).$destroy=()=>{Xl(p(this,Ye))}}$set(e){p(this,Ye).$set(e)}$on(e,r){p(this,kt)[e]=p(this,kt)[e]||[];const n=(...s)=>r.call(this,...s);return p(this,kt)[e].push(n),()=>{p(this,kt)[e]=p(this,kt)[e].filter(s=>s!==n)}}$destroy(){p(this,Ye).$destroy()}}kt=new WeakMap,Ye=new WeakMap;function uc(t){Fe===null&&sl(),eo(()=>{const e=cn(t);if(typeof e=="function")return e})}const fc="5";var bi;typeof window<"u"&&((bi=window.__svelte??(window.__svelte={})).v??(bi.v=new Set)).add(fc);function $o(t){const e=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),r=[],n=/```(\w*)\n?([\s\S]*?)```/g;let s,a=0;for(;(s=n.exec(e))!==null;)r.push(e.slice(a,s.index)),r.push(`<pre class="code-block"><code class="lang-${s[1]||"text"}">${s[2].replace(/\n$/,"")}</code></pre>`),a=s.index+s[0].length;return r.push(e.slice(a)),r.join("").split(/\n{2,}/).map(i=>i.startsWith("<pre")?i:`<p>${i.replace(/`([^`]+)`/g,"<code>$1</code>").replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>").replace(/\*([^*]+)\*/g,"<em>$1</em>").replace(/\n/g,"<br/>")}</p>`).join("")}/**
3
3
  * @license
4
4
  * Copyright 2019 Google LLC
5
5
  * SPDX-License-Identifier: BSD-3-Clause
6
- */const Ls=globalThis,Qn=Ls.ShadowRoot&&(Ls.ShadyCSS===void 0||Ls.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,ea=Symbol(),ti=new WeakMap;let wo=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==ea)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(Qn&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=ti.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ti.set(r,e))}return e}toString(){return this.cssText}};const xo=t=>new wo(typeof t=="string"?t:t+"",void 0,ea),oe=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,s,a)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[a+1],t[0]);return new wo(r,t,ea)},dc=(t,e)=>{if(Qn)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),s=Ls.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=r.cssText,t.appendChild(n)}},ri=Qn?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return xo(r)})(t):t;/**
6
+ */const Hs=globalThis,ra=Hs.ShadowRoot&&(Hs.ShadyCSS===void 0||Hs.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,sa=Symbol(),ni=new WeakMap;let Eo=class{constructor(e,r,n){if(this._$cssResult$=!0,n!==sa)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=r}get styleSheet(){let e=this.o;const r=this.t;if(ra&&e===void 0){const n=r!==void 0&&r.length===1;n&&(e=ni.get(r)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&ni.set(r,e))}return e}toString(){return this.cssText}};const So=t=>new Eo(typeof t=="string"?t:t+"",void 0,sa),oe=(t,...e)=>{const r=t.length===1?t[0]:e.reduce((n,s,a)=>n+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[a+1],t[0]);return new Eo(r,t,sa)},pc=(t,e)=>{if(ra)t.adoptedStyleSheets=e.map(r=>r instanceof CSSStyleSheet?r:r.styleSheet);else for(const r of e){const n=document.createElement("style"),s=Hs.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=r.cssText,t.appendChild(n)}},ai=ra?t=>t:t=>t instanceof CSSStyleSheet?(e=>{let r="";for(const n of e.cssRules)r+=n.cssText;return So(r)})(t):t;/**
7
7
  * @license
8
8
  * Copyright 2017 Google LLC
9
9
  * SPDX-License-Identifier: BSD-3-Clause
10
- */const{is:uc,defineProperty:fc,getOwnPropertyDescriptor:pc,getOwnPropertyNames:hc,getOwnPropertySymbols:vc,getPrototypeOf:mc}=Object,Lt=globalThis,si=Lt.trustedTypes,gc=si?si.emptyScript:"",gn=Lt.reactiveElementPolyfillSupport,ts=(t,e)=>t,Fs={toAttribute(t,e){switch(e){case Boolean:t=t?gc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},ta=(t,e)=>!uc(t,e),ni={attribute:!0,type:String,converter:Fs,reflect:!1,useDefault:!1,hasChanged:ta};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Lt.litPropertyMetadata??(Lt.litPropertyMetadata=new WeakMap);let br=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=ni){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(e,n,r);s!==void 0&&fc(this.prototype,e,s)}}static getPropertyDescriptor(e,r,n){const{get:s,set:a}=pc(this.prototype,e)??{get(){return this[r]},set(i){this[r]=i}};return{get:s,set(i){const l=s==null?void 0:s.call(this);a==null||a.call(this,i),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ni}static _$Ei(){if(this.hasOwnProperty(ts("elementProperties")))return;const e=mc(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ts("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ts("properties"))){const r=this.properties,n=[...hc(r),...vc(r)];for(const s of n)this.createProperty(s,r[s])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,s]of r)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const s=this._$Eu(r,n);s!==void 0&&this._$Eh.set(s,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const s of n)r.unshift(ri(s))}else e!==void 0&&r.push(ri(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return dc(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){var a;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const i=(((a=n.converter)==null?void 0:a.toAttribute)!==void 0?n.converter:Fs).toAttribute(r,n.type);this._$Em=e,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(e,r){var a,i;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const l=n.getPropertyOptions(s),o=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)==null?void 0:a.fromAttribute)!==void 0?l.converter:Fs;this._$Em=s;const c=o.fromAttribute(r,l.type);this[s]=c??((i=this._$Ej)==null?void 0:i.get(s))??c,this._$Em=null}}requestUpdate(e,r,n,s=!1,a){var i;if(e!==void 0){const l=this.constructor;if(s===!1&&(a=this[e]),n??(n=l.getPropertyOptions(e)),!((n.hasChanged??ta)(a,r)||n.useDefault&&n.reflect&&a===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(l._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:s,wrapped:a},i){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,i??r??this[e]),a!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,i]of this._$Ep)this[a]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,i]of s){const{wrapped:l}=i,o=this[a];l!==!0||this._$AL.has(a)||o===void 0||this.C(a,void 0,i,o)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(r)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var s;return(s=n.hostUpdated)==null?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};br.elementStyles=[],br.shadowRootOptions={mode:"open"},br[ts("elementProperties")]=new Map,br[ts("finalized")]=new Map,gn==null||gn({ReactiveElement:br}),(Lt.reactiveElementVersions??(Lt.reactiveElementVersions=[])).push("2.1.2");/**
10
+ */const{is:hc,defineProperty:vc,getOwnPropertyDescriptor:mc,getOwnPropertyNames:gc,getOwnPropertySymbols:bc,getPrototypeOf:_c}=Object,Lt=globalThis,ii=Lt.trustedTypes,yc=ii?ii.emptyScript:"",yn=Lt.reactiveElementPolyfillSupport,ss=(t,e)=>t,Ws={toAttribute(t,e){switch(e){case Boolean:t=t?yc:null;break;case Object:case Array:t=t==null?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=t!==null;break;case Number:r=t===null?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch{r=null}}return r}},na=(t,e)=>!hc(t,e),oi={attribute:!0,type:String,converter:Ws,reflect:!1,useDefault:!1,hasChanged:na};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Lt.litPropertyMetadata??(Lt.litPropertyMetadata=new WeakMap);let _r=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,r=oi){if(r.state&&(r.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((r=Object.create(r)).wrapped=!0),this.elementProperties.set(e,r),!r.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(e,n,r);s!==void 0&&vc(this.prototype,e,s)}}static getPropertyDescriptor(e,r,n){const{get:s,set:a}=mc(this.prototype,e)??{get(){return this[r]},set(i){this[r]=i}};return{get:s,set(i){const l=s==null?void 0:s.call(this);a==null||a.call(this,i),this.requestUpdate(e,l,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??oi}static _$Ei(){if(this.hasOwnProperty(ss("elementProperties")))return;const e=_c(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(ss("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(ss("properties"))){const r=this.properties,n=[...gc(r),...bc(r)];for(const s of n)this.createProperty(s,r[s])}const e=this[Symbol.metadata];if(e!==null){const r=litPropertyMetadata.get(e);if(r!==void 0)for(const[n,s]of r)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[r,n]of this.elementProperties){const s=this._$Eu(r,n);s!==void 0&&this._$Eh.set(s,r)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const r=[];if(Array.isArray(e)){const n=new Set(e.flat(1/0).reverse());for(const s of n)r.unshift(ai(s))}else e!==void 0&&r.push(ai(e));return r}static _$Eu(e,r){const n=r.attribute;return n===!1?void 0:typeof n=="string"?n:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(r=>this.enableUpdating=r),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(r=>r(this))}addController(e){var r;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var r;(r=this._$EO)==null||r.delete(e)}_$E_(){const e=new Map,r=this.constructor.elementProperties;for(const n of r.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return pc(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostConnected)==null?void 0:n.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(r=>{var n;return(n=r.hostDisconnected)==null?void 0:n.call(r)})}attributeChangedCallback(e,r,n){this._$AK(e,n)}_$ET(e,r){var a;const n=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,n);if(s!==void 0&&n.reflect===!0){const i=(((a=n.converter)==null?void 0:a.toAttribute)!==void 0?n.converter:Ws).toAttribute(r,n.type);this._$Em=e,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(e,r){var a,i;const n=this.constructor,s=n._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const l=n.getPropertyOptions(s),o=typeof l.converter=="function"?{fromAttribute:l.converter}:((a=l.converter)==null?void 0:a.fromAttribute)!==void 0?l.converter:Ws;this._$Em=s;const c=o.fromAttribute(r,l.type);this[s]=c??((i=this._$Ej)==null?void 0:i.get(s))??c,this._$Em=null}}requestUpdate(e,r,n,s=!1,a){var i;if(e!==void 0){const l=this.constructor;if(s===!1&&(a=this[e]),n??(n=l.getPropertyOptions(e)),!((n.hasChanged??na)(a,r)||n.useDefault&&n.reflect&&a===((i=this._$Ej)==null?void 0:i.get(e))&&!this.hasAttribute(l._$Eu(e,n))))return;this.C(e,r,n)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,r,{useDefault:n,reflect:s,wrapped:a},i){n&&!(this._$Ej??(this._$Ej=new Map)).has(e)&&(this._$Ej.set(e,i??r??this[e]),a!==!0||i!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(r=void 0),this._$AL.set(e,r)),s===!0&&this._$Em!==e&&(this._$Eq??(this._$Eq=new Set)).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(r){Promise.reject(r)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var n;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[a,i]of this._$Ep)this[a]=i;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[a,i]of s){const{wrapped:l}=i,o=this[a];l!==!0||this._$AL.has(a)||o===void 0||this.C(a,void 0,i,o)}}let e=!1;const r=this._$AL;try{e=this.shouldUpdate(r),e?(this.willUpdate(r),(n=this._$EO)==null||n.forEach(s=>{var a;return(a=s.hostUpdate)==null?void 0:a.call(s)}),this.update(r)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(r)}willUpdate(e){}_$AE(e){var r;(r=this._$EO)==null||r.forEach(n=>{var s;return(s=n.hostUpdated)==null?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(r=>this._$ET(r,this[r]))),this._$EM()}updated(e){}firstUpdated(e){}};_r.elementStyles=[],_r.shadowRootOptions={mode:"open"},_r[ss("elementProperties")]=new Map,_r[ss("finalized")]=new Map,yn==null||yn({ReactiveElement:_r}),(Lt.reactiveElementVersions??(Lt.reactiveElementVersions=[])).push("2.1.2");/**
11
11
  * @license
12
12
  * Copyright 2017 Google LLC
13
13
  * SPDX-License-Identifier: BSD-3-Clause
14
- */const rs=globalThis,ai=t=>t,qs=rs.trustedTypes,ii=qs?qs.createPolicy("lit-html",{createHTML:t=>t}):void 0,$o="$lit$",Tt=`lit$${Math.random().toFixed(9).slice(2)}$`,Eo="?"+Tt,bc=`<${Eo}>`,lr=document,os=()=>lr.createComment(""),ls=t=>t===null||typeof t!="object"&&typeof t!="function",ra=Array.isArray,_c=t=>ra(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",bn=`[
15
- \f\r]`,Yr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,oi=/-->/g,li=/>/g,Wt=RegExp(`>|${bn}(?:([^\\s"'>=/]+)(${bn}*=${bn}*(?:[^
16
- \f\r"'\`<>=]|("|')|))|$)`,"g"),ci=/'/g,di=/"/g,So=/^(?:script|style|textarea|title)$/i,yc=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),g=yc(1),cr=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),ui=new WeakMap,Jt=lr.createTreeWalker(lr,129);function Co(t,e){if(!ra(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ii!==void 0?ii.createHTML(e):e}const kc=(t,e)=>{const r=t.length-1,n=[];let s,a=e===2?"<svg>":e===3?"<math>":"",i=Yr;for(let l=0;l<r;l++){const o=t[l];let c,d,h=-1,p=0;for(;p<o.length&&(i.lastIndex=p,d=i.exec(o),d!==null);)p=i.lastIndex,i===Yr?d[1]==="!--"?i=oi:d[1]!==void 0?i=li:d[2]!==void 0?(So.test(d[2])&&(s=RegExp("</"+d[2],"g")),i=Wt):d[3]!==void 0&&(i=Wt):i===Wt?d[0]===">"?(i=s??Yr,h=-1):d[1]===void 0?h=-2:(h=i.lastIndex-d[2].length,c=d[1],i=d[3]===void 0?Wt:d[3]==='"'?di:ci):i===di||i===ci?i=Wt:i===oi||i===li?i=Yr:(i=Wt,s=void 0);const m=i===Wt&&t[l+1].startsWith("/>")?" ":"";a+=i===Yr?o+bc:h>=0?(n.push(c),o.slice(0,h)+$o+o.slice(h)+Tt+m):o+Tt+(h===-2?l:m)}return[Co(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class cs{constructor({strings:e,_$litType$:r},n){let s;this.parts=[];let a=0,i=0;const l=e.length-1,o=this.parts,[c,d]=kc(e,r);if(this.el=cs.createElement(c,n),Jt.currentNode=this.el.content,r===2||r===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=Jt.nextNode())!==null&&o.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith($o)){const p=d[i++],m=s.getAttribute(h).split(Tt),_=/([.?@])?(.*)/.exec(p);o.push({type:1,index:a,name:_[2],strings:m,ctor:_[1]==="."?xc:_[1]==="?"?$c:_[1]==="@"?Ec:on}),s.removeAttribute(h)}else h.startsWith(Tt)&&(o.push({type:6,index:a}),s.removeAttribute(h));if(So.test(s.tagName)){const h=s.textContent.split(Tt),p=h.length-1;if(p>0){s.textContent=qs?qs.emptyScript:"";for(let m=0;m<p;m++)s.append(h[m],os()),Jt.nextNode(),o.push({type:2,index:++a});s.append(h[p],os())}}}else if(s.nodeType===8)if(s.data===Eo)o.push({type:2,index:a});else{let h=-1;for(;(h=s.data.indexOf(Tt,h+1))!==-1;)o.push({type:7,index:a}),h+=Tt.length-1}a++}}static createElement(e,r){const n=lr.createElement("template");return n.innerHTML=e,n}}function Tr(t,e,r=t,n){var i,l;if(e===cr)return e;let s=n!==void 0?(i=r._$Co)==null?void 0:i[n]:r._$Cl;const a=ls(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==a&&((l=s==null?void 0:s._$AO)==null||l.call(s,!1),a===void 0?s=void 0:(s=new a(t),s._$AT(t,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=s:r._$Cl=s),s!==void 0&&(e=Tr(t,s._$AS(t,e.values),s,n)),e}class wc{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:n}=this._$AD,s=((e==null?void 0:e.creationScope)??lr).importNode(r,!0);Jt.currentNode=s;let a=Jt.nextNode(),i=0,l=0,o=n[0];for(;o!==void 0;){if(i===o.index){let c;o.type===2?c=new Es(a,a.nextSibling,this,e):o.type===1?c=new o.ctor(a,o.name,o.strings,this,e):o.type===6&&(c=new Sc(a,this,e)),this._$AV.push(c),o=n[++l]}i!==(o==null?void 0:o.index)&&(a=Jt.nextNode(),i++)}return Jt.currentNode=lr,s}p(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Es{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,n,s){this.type=2,this._$AH=ue,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Tr(this,e,r),ls(e)?e===ue||e==null||e===""?(this._$AH!==ue&&this._$AR(),this._$AH=ue):e!==this._$AH&&e!==cr&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):_c(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ue&&ls(this._$AH)?this._$AA.nextSibling.data=e:this.T(lr.createTextNode(e)),this._$AH=e}$(e){var a;const{values:r,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=cs.createElement(Co(n.h,n.h[0]),this.options)),n);if(((a=this._$AH)==null?void 0:a._$AD)===s)this._$AH.p(r);else{const i=new wc(s,this),l=i.u(this.options);i.p(r),this.T(l),this._$AH=i}}_$AC(e){let r=ui.get(e.strings);return r===void 0&&ui.set(e.strings,r=new cs(e)),r}k(e){ra(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,s=0;for(const a of e)s===r.length?r.push(n=new Es(this.O(os()),this.O(os()),this,this.options)):n=r[s],n._$AI(a),s++;s<r.length&&(this._$AR(n&&n._$AB.nextSibling,s),r.length=s)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);e!==this._$AB;){const s=ai(e).nextSibling;ai(e).remove(),e=s}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class on{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,s,a){this.type=1,this._$AH=ue,this._$AN=void 0,this.element=e,this.name=r,this._$AM=s,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ue}_$AI(e,r=this,n,s){const a=this.strings;let i=!1;if(a===void 0)e=Tr(this,e,r,0),i=!ls(e)||e!==this._$AH&&e!==cr,i&&(this._$AH=e);else{const l=e;let o,c;for(e=a[0],o=0;o<a.length-1;o++)c=Tr(this,l[n+o],r,o),c===cr&&(c=this._$AH[o]),i||(i=!ls(c)||c!==this._$AH[o]),c===ue?e=ue:e!==ue&&(e+=(c??"")+a[o+1]),this._$AH[o]=c}i&&!s&&this.j(e)}j(e){e===ue?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class xc extends on{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ue?void 0:e}}class $c extends on{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ue)}}class Ec extends on{constructor(e,r,n,s,a){super(e,r,n,s,a),this.type=5}_$AI(e,r=this){if((e=Tr(this,e,r,0)??ue)===cr)return;const n=this._$AH,s=e===ue&&n!==ue||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==ue&&(n===ue||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class Sc{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Tr(this,e)}}const _n=rs.litHtmlPolyfillSupport;_n==null||_n(cs,Es),(rs.litHtmlVersions??(rs.litHtmlVersions=[])).push("3.3.3");const Cc=(t,e,r)=>{const n=(r==null?void 0:r.renderBefore)??e;let s=n._$litPart$;if(s===void 0){const a=(r==null?void 0:r.renderBefore)??null;n._$litPart$=s=new Es(e.insertBefore(os(),a),a,void 0,r??{})}return s._$AI(t),s};/**
14
+ */const ns=globalThis,li=t=>t,Vs=ns.trustedTypes,ci=Vs?Vs.createPolicy("lit-html",{createHTML:t=>t}):void 0,Co="$lit$",Tt=`lit$${Math.random().toFixed(9).slice(2)}$`,Ao="?"+Tt,kc=`<${Ao}>`,dr=document,cs=()=>dr.createComment(""),ds=t=>t===null||typeof t!="object"&&typeof t!="function",aa=Array.isArray,wc=t=>aa(t)||typeof(t==null?void 0:t[Symbol.iterator])=="function",kn=`[
15
+ \f\r]`,Gr=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,di=/-->/g,ui=/>/g,Vt=RegExp(`>|${kn}(?:([^\\s"'>=/]+)(${kn}*=${kn}*(?:[^
16
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),fi=/'/g,pi=/"/g,Po=/^(?:script|style|textarea|title)$/i,xc=t=>(e,...r)=>({_$litType$:t,strings:e,values:r}),g=xc(1),ur=Symbol.for("lit-noChange"),ue=Symbol.for("lit-nothing"),hi=new WeakMap,Zt=dr.createTreeWalker(dr,129);function Oo(t,e){if(!aa(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return ci!==void 0?ci.createHTML(e):e}const $c=(t,e)=>{const r=t.length-1,n=[];let s,a=e===2?"<svg>":e===3?"<math>":"",i=Gr;for(let l=0;l<r;l++){const o=t[l];let c,d,f=-1,h=0;for(;h<o.length&&(i.lastIndex=h,d=i.exec(o),d!==null);)h=i.lastIndex,i===Gr?d[1]==="!--"?i=di:d[1]!==void 0?i=ui:d[2]!==void 0?(Po.test(d[2])&&(s=RegExp("</"+d[2],"g")),i=Vt):d[3]!==void 0&&(i=Vt):i===Vt?d[0]===">"?(i=s??Gr,f=-1):d[1]===void 0?f=-2:(f=i.lastIndex-d[2].length,c=d[1],i=d[3]===void 0?Vt:d[3]==='"'?pi:fi):i===pi||i===fi?i=Vt:i===di||i===ui?i=Gr:(i=Vt,s=void 0);const m=i===Vt&&t[l+1].startsWith("/>")?" ":"";a+=i===Gr?o+kc:f>=0?(n.push(c),o.slice(0,f)+Co+o.slice(f)+Tt+m):o+Tt+(f===-2?l:m)}return[Oo(t,a+(t[r]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),n]};class us{constructor({strings:e,_$litType$:r},n){let s;this.parts=[];let a=0,i=0;const l=e.length-1,o=this.parts,[c,d]=$c(e,r);if(this.el=us.createElement(c,n),Zt.currentNode=this.el.content,r===2||r===3){const f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(s=Zt.nextNode())!==null&&o.length<l;){if(s.nodeType===1){if(s.hasAttributes())for(const f of s.getAttributeNames())if(f.endsWith(Co)){const h=d[i++],m=s.getAttribute(f).split(Tt),b=/([.?@])?(.*)/.exec(h);o.push({type:1,index:a,name:b[2],strings:m,ctor:b[1]==="."?Sc:b[1]==="?"?Cc:b[1]==="@"?Ac:dn}),s.removeAttribute(f)}else f.startsWith(Tt)&&(o.push({type:6,index:a}),s.removeAttribute(f));if(Po.test(s.tagName)){const f=s.textContent.split(Tt),h=f.length-1;if(h>0){s.textContent=Vs?Vs.emptyScript:"";for(let m=0;m<h;m++)s.append(f[m],cs()),Zt.nextNode(),o.push({type:2,index:++a});s.append(f[h],cs())}}}else if(s.nodeType===8)if(s.data===Ao)o.push({type:2,index:a});else{let f=-1;for(;(f=s.data.indexOf(Tt,f+1))!==-1;)o.push({type:7,index:a}),f+=Tt.length-1}a++}}static createElement(e,r){const n=dr.createElement("template");return n.innerHTML=e,n}}function Mr(t,e,r=t,n){var i,l;if(e===ur)return e;let s=n!==void 0?(i=r._$Co)==null?void 0:i[n]:r._$Cl;const a=ds(e)?void 0:e._$litDirective$;return(s==null?void 0:s.constructor)!==a&&((l=s==null?void 0:s._$AO)==null||l.call(s,!1),a===void 0?s=void 0:(s=new a(t),s._$AT(t,r,n)),n!==void 0?(r._$Co??(r._$Co=[]))[n]=s:r._$Cl=s),s!==void 0&&(e=Mr(t,s._$AS(t,e.values),s,n)),e}class Ec{constructor(e,r){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=r}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:r},parts:n}=this._$AD,s=((e==null?void 0:e.creationScope)??dr).importNode(r,!0);Zt.currentNode=s;let a=Zt.nextNode(),i=0,l=0,o=n[0];for(;o!==void 0;){if(i===o.index){let c;o.type===2?c=new Cs(a,a.nextSibling,this,e):o.type===1?c=new o.ctor(a,o.name,o.strings,this,e):o.type===6&&(c=new Pc(a,this,e)),this._$AV.push(c),o=n[++l]}i!==(o==null?void 0:o.index)&&(a=Zt.nextNode(),i++)}return Zt.currentNode=dr,s}p(e){let r=0;for(const n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(e,n,r),r+=n.strings.length-2):n._$AI(e[r])),r++}}class Cs{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this._$Cv}constructor(e,r,n,s){this.type=2,this._$AH=ue,this._$AN=void 0,this._$AA=e,this._$AB=r,this._$AM=n,this.options=s,this._$Cv=(s==null?void 0:s.isConnected)??!0}get parentNode(){let e=this._$AA.parentNode;const r=this._$AM;return r!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=r.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,r=this){e=Mr(this,e,r),ds(e)?e===ue||e==null||e===""?(this._$AH!==ue&&this._$AR(),this._$AH=ue):e!==this._$AH&&e!==ur&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):wc(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==ue&&ds(this._$AH)?this._$AA.nextSibling.data=e:this.T(dr.createTextNode(e)),this._$AH=e}$(e){var a;const{values:r,_$litType$:n}=e,s=typeof n=="number"?this._$AC(e):(n.el===void 0&&(n.el=us.createElement(Oo(n.h,n.h[0]),this.options)),n);if(((a=this._$AH)==null?void 0:a._$AD)===s)this._$AH.p(r);else{const i=new Ec(s,this),l=i.u(this.options);i.p(r),this.T(l),this._$AH=i}}_$AC(e){let r=hi.get(e.strings);return r===void 0&&hi.set(e.strings,r=new us(e)),r}k(e){aa(this._$AH)||(this._$AH=[],this._$AR());const r=this._$AH;let n,s=0;for(const a of e)s===r.length?r.push(n=new Cs(this.O(cs()),this.O(cs()),this,this.options)):n=r[s],n._$AI(a),s++;s<r.length&&(this._$AR(n&&n._$AB.nextSibling,s),r.length=s)}_$AR(e=this._$AA.nextSibling,r){var n;for((n=this._$AP)==null?void 0:n.call(this,!1,!0,r);e!==this._$AB;){const s=li(e).nextSibling;li(e).remove(),e=s}}setConnected(e){var r;this._$AM===void 0&&(this._$Cv=e,(r=this._$AP)==null||r.call(this,e))}}class dn{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,r,n,s,a){this.type=1,this._$AH=ue,this._$AN=void 0,this.element=e,this.name=r,this._$AM=s,this.options=a,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=ue}_$AI(e,r=this,n,s){const a=this.strings;let i=!1;if(a===void 0)e=Mr(this,e,r,0),i=!ds(e)||e!==this._$AH&&e!==ur,i&&(this._$AH=e);else{const l=e;let o,c;for(e=a[0],o=0;o<a.length-1;o++)c=Mr(this,l[n+o],r,o),c===ur&&(c=this._$AH[o]),i||(i=!ds(c)||c!==this._$AH[o]),c===ue?e=ue:e!==ue&&(e+=(c??"")+a[o+1]),this._$AH[o]=c}i&&!s&&this.j(e)}j(e){e===ue?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Sc extends dn{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===ue?void 0:e}}class Cc extends dn{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==ue)}}class Ac extends dn{constructor(e,r,n,s,a){super(e,r,n,s,a),this.type=5}_$AI(e,r=this){if((e=Mr(this,e,r,0)??ue)===ur)return;const n=this._$AH,s=e===ue&&n!==ue||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,a=e!==ue&&(n===ue||s);s&&this.element.removeEventListener(this.name,this,n),a&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var r;typeof this._$AH=="function"?this._$AH.call(((r=this.options)==null?void 0:r.host)??this.element,e):this._$AH.handleEvent(e)}}class Pc{constructor(e,r,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=r,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Mr(this,e)}}const wn=ns.litHtmlPolyfillSupport;wn==null||wn(us,Cs),(ns.litHtmlVersions??(ns.litHtmlVersions=[])).push("3.3.3");const Oc=(t,e,r)=>{const n=(r==null?void 0:r.renderBefore)??e;let s=n._$litPart$;if(s===void 0){const a=(r==null?void 0:r.renderBefore)??null;n._$litPart$=s=new Cs(e.insertBefore(cs(),a),a,void 0,r??{})}return s._$AI(t),s};/**
17
17
  * @license
18
18
  * Copyright 2017 Google LLC
19
19
  * SPDX-License-Identifier: BSD-3-Clause
20
- */const nr=globalThis;let X=class extends br{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Cc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return cr}};var mi;X._$litElement$=!0,X.finalized=!0,(mi=nr.litElementHydrateSupport)==null||mi.call(nr,{LitElement:X});const yn=nr.litElementPolyfillSupport;yn==null||yn({LitElement:X});(nr.litElementVersions??(nr.litElementVersions=[])).push("4.2.2");const Ac={surface:{light:"#ffffff",dark:"#171717"},"surface-muted":{light:"#f5f5f5",dark:"#1a1a1a"},"surface-hover":{light:"#f5f5f5",dark:"#1a1a1a"},"surface-active":{light:"#e5e5e5",dark:"#262626"},text:{light:"#171717",dark:"#e5e5e5"},"text-muted":{light:"#a3a3a3",dark:"#737373"},"text-faint":{light:"#737373",dark:"#525252"},"text-inverse":{light:"#fafafa",dark:"#171717"},border:{light:"#e5e5e5",dark:"#262626"},"border-strong":{light:"#d4d4d4",dark:"#404040"},focus:{light:"#a3a3a3",dark:"#525252"},accent:{light:"#c2410c",dark:"#ea580c"},"accent-text":{light:"#fafafa",dark:"#fafafa"},danger:{light:"#dc2626",dark:"#f87171"},"danger-text":{light:"#991b1b",dark:"#fca5a5"},"danger-bg":{light:"#fef2f2",dark:"#450a0a"},"danger-border":{light:"#fecaca",dark:"#7f1d1d"},success:{light:"#16a34a",dark:"#4ade80"},"success-text":{light:"#166534",dark:"#86efac"},"success-bg":{light:"#f0fdf4",dark:"#052e16"},"success-border":{light:"#bbf7d0",dark:"#166534"}},Pc=`
20
+ */const ir=globalThis;let X=class extends _r{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var r;const e=super.createRenderRoot();return(r=this.renderOptions).renderBefore??(r.renderBefore=e.firstChild),e}update(e){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Oc(r,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return ur}};var _i;X._$litElement$=!0,X.finalized=!0,(_i=ir.litElementHydrateSupport)==null||_i.call(ir,{LitElement:X});const xn=ir.litElementPolyfillSupport;xn==null||xn({LitElement:X});(ir.litElementVersions??(ir.litElementVersions=[])).push("4.2.2");const Nc={surface:{light:"#ffffff",dark:"#171717"},"surface-muted":{light:"#f5f5f5",dark:"#1a1a1a"},"surface-hover":{light:"#f5f5f5",dark:"#1a1a1a"},"surface-active":{light:"#e5e5e5",dark:"#262626"},text:{light:"#171717",dark:"#e5e5e5"},"text-muted":{light:"#a3a3a3",dark:"#737373"},"text-faint":{light:"#737373",dark:"#525252"},"text-inverse":{light:"#fafafa",dark:"#171717"},border:{light:"#e5e5e5",dark:"#262626"},"border-strong":{light:"#d4d4d4",dark:"#404040"},focus:{light:"#a3a3a3",dark:"#525252"},accent:{light:"#c2410c",dark:"#ea580c"},"accent-text":{light:"#fafafa",dark:"#fafafa"},danger:{light:"#dc2626",dark:"#f87171"},"danger-text":{light:"#991b1b",dark:"#fca5a5"},"danger-bg":{light:"#fef2f2",dark:"#450a0a"},"danger-border":{light:"#fecaca",dark:"#7f1d1d"},success:{light:"#16a34a",dark:"#4ade80"},"success-text":{light:"#166534",dark:"#86efac"},"success-bg":{light:"#f0fdf4",dark:"#052e16"},"success-border":{light:"#bbf7d0",dark:"#166534"}},zc=`
21
21
  --ask-radius: var(--ask-radius-app, 0.5rem);
22
22
  --ask-radius-small: var(--ask-radius-app-small, 0.375rem);
23
23
  --ask-radius-pill: var(--ask-radius-app-pill, 9999px);
@@ -25,11 +25,11 @@ var qo=Object.defineProperty;var qa=t=>{throw TypeError(t)};var Ko=(t,e,r)=>e in
25
25
  --ask-font-size: var(--ask-font-size-app, 0.8125rem);
26
26
  --ask-font-size-small: var(--ask-font-size-app-small, 0.6875rem);
27
27
  --ask-spacing: var(--ask-spacing-app, 0.5rem);
28
- `;function Ts(t){return Object.entries(Ac).map(([e,r])=>` --ask-${e}: var(--ask-${e}-${t}, ${r[t]});`).join(`
29
- `)}const le=xo(`
28
+ `;function Rs(t){return Object.entries(Nc).map(([e,r])=>` --ask-${e}: var(--ask-${e}-${t}, ${r[t]});`).join(`
29
+ `)}const le=So(`
30
30
  :host {
31
- ${Ts("light")}
32
- ${Pc}
31
+ ${Rs("light")}
32
+ ${zc}
33
33
  }
34
34
 
35
35
  /* Explicit dark theme (on the component or any ancestor) */
@@ -37,45 +37,45 @@ ${Pc}
37
37
  :host-context([theme="dark"]),
38
38
  /* Legacy .dark class path */
39
39
  :host-context(.dark) {
40
- ${Ts("dark")}
40
+ ${Rs("dark")}
41
41
  }
42
42
 
43
43
  /* Explicit light theme pins light */
44
44
  :host([theme="light"]),
45
45
  :host-context([theme="light"]) {
46
- ${Ts("light")}
46
+ ${Rs("light")}
47
47
  }
48
48
 
49
49
  /* OS preference, unless the app pinned a theme */
50
50
  @media (prefers-color-scheme: dark) {
51
51
  :host(:not([theme="light"])) {
52
- ${Ts("dark")}
52
+ ${Rs("dark")}
53
53
  }
54
54
  }
55
55
  `);/**
56
56
  * @license
57
57
  * Copyright 2017 Google LLC
58
58
  * SPDX-License-Identifier: BSD-3-Clause
59
- */const Oc={attribute:!0,type:String,converter:Fs,reflect:!1,hasChanged:ta},Nc=(t=Oc,e,r)=>{const{kind:n,metadata:s}=r;let a=globalThis.litPropertyMetadata.get(s);if(a===void 0&&globalThis.litPropertyMetadata.set(s,a=new Map),n==="setter"&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),n==="accessor"){const{name:i}=r;return{set(l){const o=e.get.call(this);e.set.call(this,l),this.requestUpdate(i,o,t,!0,l)},init(l){return l!==void 0&&this.C(i,void 0,t,l),l}}}if(n==="setter"){const{name:i}=r;return function(l){const o=this[i];e.call(this,l),this.requestUpdate(i,o,t,!0,l)}}throw Error("Unsupported decorator location: "+n)};function b(t){return(e,r)=>typeof r=="object"?Nc(t,e,r):((n,s,a)=>{const i=s.hasOwnProperty(a);return s.constructor.createProperty(a,n),i?Object.getOwnPropertyDescriptor(s,a):void 0})(t,e,r)}/**
59
+ */const Tc={attribute:!0,type:String,converter:Ws,reflect:!1,hasChanged:na},Mc=(t=Tc,e,r)=>{const{kind:n,metadata:s}=r;let a=globalThis.litPropertyMetadata.get(s);if(a===void 0&&globalThis.litPropertyMetadata.set(s,a=new Map),n==="setter"&&((t=Object.create(t)).wrapped=!0),a.set(r.name,t),n==="accessor"){const{name:i}=r;return{set(l){const o=e.get.call(this);e.set.call(this,l),this.requestUpdate(i,o,t,!0,l)},init(l){return l!==void 0&&this.C(i,void 0,t,l),l}}}if(n==="setter"){const{name:i}=r;return function(l){const o=this[i];e.call(this,l),this.requestUpdate(i,o,t,!0,l)}}throw Error("Unsupported decorator location: "+n)};function y(t){return(e,r)=>typeof r=="object"?Mc(t,e,r):((n,s,a)=>{const i=s.hasOwnProperty(a);return s.constructor.createProperty(a,n),i?Object.getOwnPropertyDescriptor(s,a):void 0})(t,e,r)}/**
60
60
  * @license
61
61
  * Copyright 2017 Google LLC
62
62
  * SPDX-License-Identifier: BSD-3-Clause
63
- */function Ss(t){return b({...t,state:!0,attribute:!1})}/**
63
+ */function As(t){return y({...t,state:!0,attribute:!1})}/**
64
64
  * @license
65
65
  * Copyright 2017 Google LLC
66
66
  * SPDX-License-Identifier: BSD-3-Clause
67
- */const fi=(t,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(t,e,r),r);/**
67
+ */const vi=(t,e,r)=>(r.configurable=!0,r.enumerable=!0,Reflect.decorate&&typeof e!="object"&&Object.defineProperty(t,e,r),r);/**
68
68
  * @license
69
69
  * Copyright 2017 Google LLC
70
70
  * SPDX-License-Identifier: BSD-3-Clause
71
- */function ln(t,e){return(r,n,s)=>{const a=i=>{var l;return((l=i.renderRoot)==null?void 0:l.querySelector(t))??null};if(e){const{get:i,set:l}=typeof n=="object"?r:s??(()=>{const o=Symbol();return{get(){return this[o]},set(c){this[o]=c}}})();return fi(r,n,{get(){let o=i.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&l.call(this,o)),o}})}return fi(r,n,{get(){return a(this)}})}}var zc=Object.defineProperty,Ao=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&zc(e,r,s),s};const ha=class ha extends X{constructor(){super(...arguments),this.role="user",this.content=""}render(){const e=this.role==="assistant";return g`
71
+ */function un(t,e){return(r,n,s)=>{const a=i=>{var l;return((l=i.renderRoot)==null?void 0:l.querySelector(t))??null};if(e){const{get:i,set:l}=typeof n=="object"?r:s??(()=>{const o=Symbol();return{get(){return this[o]},set(c){this[o]=c}}})();return vi(r,n,{get(){let o=i.call(this);return o===void 0&&(o=a(this),(o!==null||this.hasUpdated)&&l.call(this,o)),o}})}return vi(r,n,{get(){return a(this)}})}}var jc=Object.defineProperty,No=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&jc(e,r,s),s};const ga=class ga extends X{constructor(){super(...arguments),this.role="user",this.content=""}render(){const e=this.role==="assistant";return g`
72
72
  <div class="message-row ${e?"":"message-row--right"}">
73
73
  <div
74
74
  class="message-bubble ${e?"message-bubble--assistant":"message-bubble--user"}"
75
75
  style="${e?"color: var(--ask-text, #171717)":"background: var(--ask-surface-muted, #f5f5f5); color: var(--ask-text, #171717)"}"
76
76
  >${this.content}</div>
77
77
  </div>
78
- `}};ha.styles=oe`${le}
78
+ `}};ga.styles=oe`${le}
79
79
 
80
80
  :host {
81
81
  display: block;
@@ -113,7 +113,7 @@ ${Ts("dark")}
113
113
  /* Theming via CSS custom properties */
114
114
 
115
115
 
116
- `;let ds=ha;Ao([b({type:String})],ds.prototype,"role");Ao([b({type:String})],ds.prototype,"content");customElements.define("ask-message",ds);var Tc=Object.defineProperty,cn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Tc(e,r,s),s};const va=class va extends X{constructor(){super(...arguments),this.content="",this.label="Thought",this.open=!1,this.streaming=!1}_handleToggle(){this.streaming||(this.open=!this.open,this.dispatchEvent(new CustomEvent("ask-toggle",{detail:{open:this.open},bubbles:!0,composed:!0})))}_handleKeydown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleToggle())}render(){const e=this.content&&this.content.length>0,r=this.streaming||this.open;return!e&&!this.streaming?g``:g`
116
+ `;let fs=ga;No([y({type:String})],fs.prototype,"role");No([y({type:String})],fs.prototype,"content");customElements.define("ask-message",fs);var Rc=Object.defineProperty,fn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Rc(e,r,s),s};const ba=class ba extends X{constructor(){super(...arguments),this.content="",this.label="Thought",this.open=!1,this.streaming=!1}_handleToggle(){this.streaming||(this.open=!this.open,this.dispatchEvent(new CustomEvent("ask-toggle",{detail:{open:this.open},bubbles:!0,composed:!0})))}_handleKeydown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleToggle())}render(){const e=this.content&&this.content.length>0,r=this.streaming||this.open;return!e&&!this.streaming?g``:g`
117
117
  <div
118
118
  class="thinking-header"
119
119
  @click=${this._handleToggle}
@@ -133,7 +133,7 @@ ${Ts("dark")}
133
133
  <div class="thinking-body ${r?"thinking-body--expanded":""}">
134
134
  <div class="thinking-body-inner">${this.content}</div>
135
135
  </div>
136
- `}};va.styles=oe`${le}
136
+ `}};ba.styles=oe`${le}
137
137
 
138
138
  :host {
139
139
  display: block;
@@ -213,14 +213,14 @@ ${Ts("dark")}
213
213
 
214
214
 
215
215
 
216
- `;let dr=va;cn([b({type:String})],dr.prototype,"content");cn([b({type:String})],dr.prototype,"label");cn([b({type:Boolean,reflect:!0})],dr.prototype,"open");cn([b({type:Boolean,reflect:!0})],dr.prototype,"streaming");customElements.define("ask-thinking",dr);var Mc=Object.defineProperty,sa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Mc(e,r,s),s};const ma=class ma extends X{constructor(){super(...arguments),this.name="Tool",this.status="running",this.duration=0}render(){const e=this.status==="failed",r=this.status==="done";let n,s,a;r?(n="✓",s="",a="done"):e?(n="✕",s="",a="failed"):(n="⚙",s="tool-icon--running",a="running");const i=this.duration>0?`${this.duration}ms`:"";return g`
216
+ `;let fr=ba;fn([y({type:String})],fr.prototype,"content");fn([y({type:String})],fr.prototype,"label");fn([y({type:Boolean,reflect:!0})],fr.prototype,"open");fn([y({type:Boolean,reflect:!0})],fr.prototype,"streaming");customElements.define("ask-thinking",fr);var Ic=Object.defineProperty,ia=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Ic(e,r,s),s};const _a=class _a extends X{constructor(){super(...arguments),this.name="Tool",this.status="running",this.duration=0}render(){const e=this.status==="failed",r=this.status==="done";let n,s,a;r?(n="✓",s="",a="done"):e?(n="✕",s="",a="failed"):(n="⚙",s="tool-icon--running",a="running");const i=this.duration>0?`${this.duration}ms`:"";return g`
217
217
  <div class="tool-card ${e?"tool-card--failed":""}">
218
218
  <span class="tool-icon ${s}">${n}</span>
219
219
  <span class="tool-name">${this.name}</span>
220
220
  <span class="tool-status">${a}</span>
221
221
  ${i?g`<span class="tool-duration">${i}</span>`:""}
222
222
  </div>
223
- `}};ma.styles=oe`${le}
223
+ `}};_a.styles=oe`${le}
224
224
 
225
225
  :host {
226
226
  display: block;
@@ -282,7 +282,7 @@ ${Ts("dark")}
282
282
 
283
283
 
284
284
 
285
- `;let Mr=ma;sa([b({type:String})],Mr.prototype,"name");sa([b({type:String})],Mr.prototype,"status");sa([b({type:Number})],Mr.prototype,"duration");customElements.define("ask-tool-call",Mr);var jc=Object.defineProperty,Cs=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&jc(e,r,s),s};const ga=class ga extends X{constructor(){super(...arguments),this.actionId=0,this.toolName="Tool",this.args="",this.message="",this.status="pending"}render(){const e=this.status==="pending",r=this.status==="pending"?g`<span class="status-chip status-chip--pending">Awaiting approval</span>`:this.status==="approved"?g`<span class="status-chip status-chip--approved">Approved</span>`:g`<span class="status-chip status-chip--rejected">Rejected</span>`;return g`
285
+ `;let jr=_a;ia([y({type:String})],jr.prototype,"name");ia([y({type:String})],jr.prototype,"status");ia([y({type:Number})],jr.prototype,"duration");customElements.define("ask-tool-call",jr);var Lc=Object.defineProperty,Ps=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Lc(e,r,s),s};const ya=class ya extends X{constructor(){super(...arguments),this.actionId=0,this.toolName="Tool",this.args="",this.message="",this.status="pending"}render(){const e=this.status==="pending",r=this.status==="pending"?g`<span class="status-chip status-chip--pending">Awaiting approval</span>`:this.status==="approved"?g`<span class="status-chip status-chip--approved">Approved</span>`:g`<span class="status-chip status-chip--rejected">Rejected</span>`;return g`
286
286
  <div class="approval ${e?"approval--pending":""}">
287
287
  <div class="head">
288
288
  <span class="icon">✋</span>
@@ -297,7 +297,7 @@ ${Ts("dark")}
297
297
  <button class="btn-reject" @click=${this._reject}>Reject</button>
298
298
  </div>
299
299
  `:""}
300
- </div>`}_approve(){this.dispatchEvent(new CustomEvent("approval-approved",{detail:{id:this.actionId},bubbles:!0,composed:!0}))}_reject(){this.dispatchEvent(new CustomEvent("approval-rejected",{detail:{id:this.actionId},bubbles:!0,composed:!0}))}};ga.styles=oe`${le}
300
+ </div>`}_approve(){this.dispatchEvent(new CustomEvent("approval-approved",{detail:{id:this.actionId},bubbles:!0,composed:!0}))}_reject(){this.dispatchEvent(new CustomEvent("approval-rejected",{detail:{id:this.actionId},bubbles:!0,composed:!0}))}};ya.styles=oe`${le}
301
301
 
302
302
  :host {
303
303
  display: block;
@@ -392,7 +392,7 @@ ${Ts("dark")}
392
392
  color: var(--ask-danger-text, #991b1b);
393
393
  border-color: var(--ask-danger-border, #fecaca);
394
394
  }
395
- `;let Dt=ga;Cs([b({type:Number,attribute:"action-id"})],Dt.prototype,"actionId");Cs([b({type:String,attribute:"tool-name"})],Dt.prototype,"toolName");Cs([b({type:String})],Dt.prototype,"args");Cs([b({type:String})],Dt.prototype,"message");Cs([b({type:String})],Dt.prototype,"status");customElements.define("ask-tool-approval",Dt);var Rc=Object.defineProperty,na=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Rc(e,r,s),s};const ba=class ba extends X{constructor(){super(...arguments),this.open=!1,this.header=""}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this._onKeydown),super.disconnectedCallback()}render(){return g`
395
+ `;let Bt=ya;Ps([y({type:Number,attribute:"action-id"})],Bt.prototype,"actionId");Ps([y({type:String,attribute:"tool-name"})],Bt.prototype,"toolName");Ps([y({type:String})],Bt.prototype,"args");Ps([y({type:String})],Bt.prototype,"message");Ps([y({type:String})],Bt.prototype,"status");customElements.define("ask-tool-approval",Bt);var Dc=Object.defineProperty,oa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Dc(e,r,s),s};const ka=class ka extends X{constructor(){super(...arguments),this.open=!1,this.header=""}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._onKeydown)}disconnectedCallback(){this.removeEventListener("keydown",this._onKeydown),super.disconnectedCallback()}render(){return g`
396
396
  <div class="overlay" @click=${this._onBackdrop}>
397
397
  <div class="panel" role="dialog" aria-modal="true" aria-label=${this.header}>
398
398
  <div class="head">
@@ -403,7 +403,7 @@ ${Ts("dark")}
403
403
  <div class="footer"><slot name="footer"></slot></div>
404
404
  </div>
405
405
  </div>
406
- `}_onKeydown(e){e.key==="Escape"&&this.open&&this._close()}_onBackdrop(e){e.target===e.currentTarget&&this._close()}_close(){this.open=!1,this.dispatchEvent(new CustomEvent("dialog-close",{bubbles:!0,composed:!0}))}};ba.styles=oe`${le}
406
+ `}_onKeydown(e){e.key==="Escape"&&this.open&&this._close()}_onBackdrop(e){e.target===e.currentTarget&&this._close()}_close(){this.open=!1,this.dispatchEvent(new CustomEvent("dialog-close",{bubbles:!0,composed:!0}))}};ka.styles=oe`${le}
407
407
 
408
408
  :host {
409
409
  display: none;
@@ -477,7 +477,7 @@ ${Ts("dark")}
477
477
  gap: 0.5rem;
478
478
  padding: 0 1.25rem 1.25rem;
479
479
  }
480
- `;let jr=ba;na([b({type:Boolean,reflect:!0})],jr.prototype,"open");na([b({type:String})],jr.prototype,"header");na([ln(".panel")],jr.prototype,"_panel");customElements.define("ask-dialog",jr);var Ic=Object.defineProperty,dn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Ic(e,r,s),s};const _a=class _a extends X{constructor(){super(...arguments),this.items=[],this.triggerLabel="",this.open=!1,this._onOutside=e=>{if(!this.open)return;e.composedPath().includes(this)||(this.open=!1,this.dispatchEvent(new CustomEvent("menu-close",{bubbles:!0,composed:!0})))}}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onOutside)}disconnectedCallback(){document.removeEventListener("pointerdown",this._onOutside),super.disconnectedCallback()}render(){return g`
480
+ `;let Rr=ka;oa([y({type:Boolean,reflect:!0})],Rr.prototype,"open");oa([y({type:String})],Rr.prototype,"header");oa([un(".panel")],Rr.prototype,"_panel");customElements.define("ask-dialog",Rr);var Bc=Object.defineProperty,pn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Bc(e,r,s),s};const wa=class wa extends X{constructor(){super(...arguments),this.items=[],this.triggerLabel="",this.open=!1,this._onOutside=e=>{if(!this.open)return;e.composedPath().includes(this)||(this.open=!1,this.dispatchEvent(new CustomEvent("menu-close",{bubbles:!0,composed:!0})))}}connectedCallback(){super.connectedCallback(),document.addEventListener("pointerdown",this._onOutside)}disconnectedCallback(){document.removeEventListener("pointerdown",this._onOutside),super.disconnectedCallback()}render(){return g`
481
481
  <button class="trigger" @click=${this._toggle} aria-expanded=${this.open?"true":"false"}>
482
482
  <slot name="trigger">${this.triggerLabel}</slot>
483
483
  <svg class="caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
@@ -505,7 +505,7 @@ ${Ts("dark")}
505
505
  <slot name="menu-footer"></slot>
506
506
  </div>
507
507
  `:""}
508
- `}_toggle(){this.open=!this.open,this.dispatchEvent(new CustomEvent(this.open?"menu-open":"menu-close",{bubbles:!0,composed:!0}))}_select(e){this.open=!1,this.dispatchEvent(new CustomEvent("menu-select",{detail:{id:e.id},bubbles:!0,composed:!0}))}};_a.styles=oe`${le}
508
+ `}_toggle(){this.open=!this.open,this.dispatchEvent(new CustomEvent(this.open?"menu-open":"menu-close",{bubbles:!0,composed:!0}))}_select(e){this.open=!1,this.dispatchEvent(new CustomEvent("menu-select",{detail:{id:e.id},bubbles:!0,composed:!0}))}};wa.styles=oe`${le}
509
509
 
510
510
  :host {
511
511
  display: inline-block;
@@ -624,7 +624,7 @@ ${Ts("dark")}
624
624
  margin-top: 0.25rem;
625
625
  padding-top: 0.25rem;
626
626
  }
627
- `;let ur=_a;dn([b({type:Array})],ur.prototype,"items");dn([b({type:String})],ur.prototype,"triggerLabel");dn([b({type:Boolean})],ur.prototype,"open");dn([ln(".menu")],ur.prototype,"_menu");customElements.define("ask-menu",ur);var Lc=Object.defineProperty,Po=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Lc(e,r,s),s};const ya=class ya extends X{constructor(){super(...arguments),this.value="",this.placeholder="Search…"}render(){return g`
627
+ `;let pr=wa;pn([y({type:Array})],pr.prototype,"items");pn([y({type:String})],pr.prototype,"triggerLabel");pn([y({type:Boolean})],pr.prototype,"open");pn([un(".menu")],pr.prototype,"_menu");customElements.define("ask-menu",pr);var Hc=Object.defineProperty,zo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Hc(e,r,s),s};const xa=class xa extends X{constructor(){super(...arguments),this.value="",this.placeholder="Search…"}render(){return g`
628
628
  <div class="wrap">
629
629
  <span class="icon">
630
630
  <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
@@ -643,7 +643,7 @@ ${Ts("dark")}
643
643
  aria-label="Clear search"
644
644
  >✕</button>
645
645
  </div>
646
- `}_onInput(e){const r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_clear(){this.value="",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:""},bubbles:!0,composed:!0}))}};ya.styles=oe`${le}
646
+ `}_onInput(e){const r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent("search-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_clear(){this.value="",this.dispatchEvent(new CustomEvent("search-input",{detail:{value:""},bubbles:!0,composed:!0}))}};xa.styles=oe`${le}
647
647
 
648
648
  :host {
649
649
  display: block;
@@ -703,7 +703,7 @@ ${Ts("dark")}
703
703
  .clear:hover {
704
704
  background: var(--ask-surface-active, #e5e5e5);
705
705
  }
706
- `;let us=ya;Po([b({type:String})],us.prototype,"value");Po([b({type:String})],us.prototype,"placeholder");customElements.define("ask-search-input",us);var Bc=Object.defineProperty,As=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Bc(e,r,s),s};const ka=class ka extends X{constructor(){super(...arguments),this.id="",this.title="",this.meta="",this.active=!1,this.archived=!1}render(){return g`
706
+ `;let ps=xa;zo([y({type:String})],ps.prototype,"value");zo([y({type:String})],ps.prototype,"placeholder");customElements.define("ask-search-input",ps);var Uc=Object.defineProperty,Os=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Uc(e,r,s),s};const $a=class $a extends X{constructor(){super(...arguments),this.id="",this.title="",this.meta="",this.active=!1,this.archived=!1}render(){return g`
707
707
  <div class="item ${this.active?"item--active":""}" @click=${this._select}>
708
708
  <span class="title">${this.title}</span>
709
709
  ${this.meta?g`<span class="meta">${this.meta}</span>`:""}
@@ -715,7 +715,7 @@ ${Ts("dark")}
715
715
  <button class="mini mini--danger" title="Delete" @click=${this._emit("conversation-delete")}>✕</button>
716
716
  </div>
717
717
  </div>
718
- `}_select(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("conversation-select",{detail:{id:this.id},bubbles:!0,composed:!0}))}_emit(e){return r=>{r.stopPropagation(),this.dispatchEvent(new CustomEvent(e,{detail:{id:this.id},bubbles:!0,composed:!0}))}}};ka.styles=oe`${le}
718
+ `}_select(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent("conversation-select",{detail:{id:this.id},bubbles:!0,composed:!0}))}_emit(e){return r=>{r.stopPropagation(),this.dispatchEvent(new CustomEvent(e,{detail:{id:this.id},bubbles:!0,composed:!0}))}}};$a.styles=oe`${le}
719
719
 
720
720
  :host {
721
721
  display: block;
@@ -784,7 +784,7 @@ ${Ts("dark")}
784
784
  .mini--danger:hover {
785
785
  color: var(--ask-danger, #dc2626);
786
786
  }
787
- `;let Ht=ka;As([b({type:String})],Ht.prototype,"id");As([b({type:String})],Ht.prototype,"title");As([b({type:String})],Ht.prototype,"meta");As([b({type:Boolean})],Ht.prototype,"active");As([b({type:Boolean})],Ht.prototype,"archived");customElements.define("ask-conversation-item",Ht);var Dc=Object.defineProperty,aa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Dc(e,r,s),s};const wa=class wa extends X{constructor(){super(...arguments),this.label="",this.count=0,this.expanded=!0}render(){return g`
787
+ `;let Ht=$a;Os([y({type:String})],Ht.prototype,"id");Os([y({type:String})],Ht.prototype,"title");Os([y({type:String})],Ht.prototype,"meta");Os([y({type:Boolean})],Ht.prototype,"active");Os([y({type:Boolean})],Ht.prototype,"archived");customElements.define("ask-conversation-item",Ht);var Fc=Object.defineProperty,la=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Fc(e,r,s),s};const Ea=class Ea extends X{constructor(){super(...arguments),this.label="",this.count=0,this.expanded=!0}render(){return g`
788
788
  <button class="header" @click=${this._toggle} aria-expanded=${this.expanded?"true":"false"}>
789
789
  <svg class="chevron ${this.expanded?"chevron--open":""}" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round">
790
790
  <polyline points="9 6 15 12 9 18" />
@@ -793,7 +793,7 @@ ${Ts("dark")}
793
793
  ${this.count>0?g`<span class="count">${this.count}</span>`:""}
794
794
  </button>
795
795
  ${this.expanded?g`<slot></slot>`:""}
796
- `}_toggle(){this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent("group-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0}))}};wa.styles=oe`${le}
796
+ `}_toggle(){this.expanded=!this.expanded,this.dispatchEvent(new CustomEvent("group-toggle",{detail:{expanded:this.expanded},bubbles:!0,composed:!0}))}};Ea.styles=oe`${le}
797
797
 
798
798
  :host {
799
799
  display: block;
@@ -841,7 +841,7 @@ ${Ts("dark")}
841
841
  color: var(--ask-text-muted, #a3a3a3);
842
842
  flex-shrink: 0;
843
843
  }
844
- `;let Rr=wa;aa([b({type:String})],Rr.prototype,"label");aa([b({type:Number})],Rr.prototype,"count");aa([b({type:Boolean})],Rr.prototype,"expanded");customElements.define("ask-conversation-group",Rr);var Hc=Object.defineProperty,Uc=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Hc(e,r,s),s};const xa=class xa extends X{constructor(){super(...arguments),this.todos=[]}render(){if(this.todos.length===0)return g``;const e=this.todos.map(r=>typeof r=="string"?{id:r,title:r,status:"pending"}:r);return g`
844
+ `;let Ir=Ea;la([y({type:String})],Ir.prototype,"label");la([y({type:Number})],Ir.prototype,"count");la([y({type:Boolean})],Ir.prototype,"expanded");customElements.define("ask-conversation-group",Ir);var qc=Object.defineProperty,Kc=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&qc(e,r,s),s};const Sa=class Sa extends X{constructor(){super(...arguments),this.todos=[]}render(){if(this.todos.length===0)return g``;const e=this.todos.map(r=>typeof r=="string"?{id:r,title:r,status:"pending"}:r);return g`
845
845
  <ul class="todos">
846
846
  ${e.map(r=>g`
847
847
  <li class="todo todo--${r.status}">
@@ -850,7 +850,7 @@ ${Ts("dark")}
850
850
  <span class="status">${r.status.replace("_"," ")}</span>
851
851
  </li>
852
852
  `)}
853
- </ul>`}};xa.styles=oe`${le}
853
+ </ul>`}};Sa.styles=oe`${le}
854
854
 
855
855
  :host {
856
856
  display: block;
@@ -906,7 +906,7 @@ ${Ts("dark")}
906
906
  0%, 100% { opacity: 1; }
907
907
  50% { opacity: 0.35; }
908
908
  }
909
- `;let Ks=xa;Uc([b({type:Array})],Ks.prototype,"todos");customElements.define("ask-todo-list",Ks);var Fc=Object.defineProperty,Oo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Fc(e,r,s),s};const $a=class $a extends X{constructor(){super(...arguments),this.plan="",this.status="proposed"}render(){const e=this.status==="proposed",r=this.status==="proposed"?g`<span class="status-chip status-chip--proposed">Proposed</span>`:this.status==="approved"?g`<span class="status-chip status-chip--approved">Approved</span>`:g`<span class="status-chip status-chip--rejected">Rejected</span>`;return g`
909
+ `;let Ys=Sa;Kc([y({type:Array})],Ys.prototype,"todos");customElements.define("ask-todo-list",Ys);var Wc=Object.defineProperty,To=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Wc(e,r,s),s};const Ca=class Ca extends X{constructor(){super(...arguments),this.plan="",this.status="proposed"}render(){const e=this.status==="proposed",r=this.status==="proposed"?g`<span class="status-chip status-chip--proposed">Proposed</span>`:this.status==="approved"?g`<span class="status-chip status-chip--approved">Approved</span>`:g`<span class="status-chip status-chip--rejected">Rejected</span>`;return g`
910
910
  <div class="plan">
911
911
  <div class="head">
912
912
  <span>📋 Plan</span>
@@ -919,7 +919,7 @@ ${Ts("dark")}
919
919
  <button class="btn-reject" @click=${this._reject}>Reject plan</button>
920
920
  </div>
921
921
  `:""}
922
- </div>`}_approve(){this.dispatchEvent(new CustomEvent("plan-approved",{detail:{plan:this.plan},bubbles:!0,composed:!0}))}_reject(){this.dispatchEvent(new CustomEvent("plan-rejected",{detail:{plan:this.plan},bubbles:!0,composed:!0}))}};$a.styles=oe`${le}
922
+ </div>`}_approve(){this.dispatchEvent(new CustomEvent("plan-approved",{detail:{plan:this.plan},bubbles:!0,composed:!0}))}_reject(){this.dispatchEvent(new CustomEvent("plan-rejected",{detail:{plan:this.plan},bubbles:!0,composed:!0}))}};Ca.styles=oe`${le}
923
923
 
924
924
  :host {
925
925
  display: block;
@@ -992,7 +992,7 @@ ${Ts("dark")}
992
992
  color: var(--ask-danger-text, #991b1b);
993
993
  border-color: var(--ask-danger-border, #fecaca);
994
994
  }
995
- `;let fs=$a;Oo([b({type:String})],fs.prototype,"plan");Oo([b({type:String})],fs.prototype,"status");customElements.define("ask-plan",fs);var qc=Object.defineProperty,No=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&qc(e,r,s),s};const Ea=class Ea extends X{constructor(){super(...arguments),this.diff="",this.filename=""}render(){const e=Kc(this.diff);if(e.lines.length===0&&!this.filename)return g`<pre class="diff"><div class="diff--empty">No changes</div></pre>`;const r=this.filename?g`<div class="file-header"><span>${this.filename}</span><span class="hunk-count">+${e.adds} −${e.dels}</span></div>`:e.fileNames.length>0?g`<div class="file-header"><span>${e.fileNames.join(" → ")}</span><span class="hunk-count">+${e.adds} −${e.dels}</span></div>`:"";return g`
995
+ `;let hs=Ca;To([y({type:String})],hs.prototype,"plan");To([y({type:String})],hs.prototype,"status");customElements.define("ask-plan",hs);var Vc=Object.defineProperty,Mo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Vc(e,r,s),s};const Aa=class Aa extends X{constructor(){super(...arguments),this.diff="",this.filename=""}render(){const e=Yc(this.diff);if(e.lines.length===0&&!this.filename)return g`<pre class="diff"><div class="diff--empty">No changes</div></pre>`;const r=this.filename?g`<div class="file-header"><span>${this.filename}</span><span class="hunk-count">+${e.adds} −${e.dels}</span></div>`:e.fileNames.length>0?g`<div class="file-header"><span>${e.fileNames.join(" → ")}</span><span class="hunk-count">+${e.adds} −${e.dels}</span></div>`:"";return g`
996
996
  <div class="diff">
997
997
  ${r}
998
998
  ${e.hunks.map(n=>g`
@@ -1006,7 +1006,7 @@ ${Ts("dark")}
1006
1006
  </div>`})}
1007
1007
  </div>
1008
1008
  `)}
1009
- </div>`}};Ea.styles=oe`${le}
1009
+ </div>`}};Aa.styles=oe`${le}
1010
1010
 
1011
1011
  :host {
1012
1012
  display: block;
@@ -1098,8 +1098,8 @@ ${Ts("dark")}
1098
1098
  font-family: var(--ask-font, ui-sans-serif, system-ui, sans-serif);
1099
1099
  font-size: 0.8125rem;
1100
1100
  }
1101
- `;let ps=Ea;No([b({type:String})],ps.prototype,"diff");No([b({type:String})],ps.prototype,"filename");function Kc(t){const e=[],r=[];let n=0,s=0,a=null,i=0,l=0;for(const c of t.split(`
1102
- `)){const d=c.replace(/\r$/,"");if(d.startsWith("+++ ")||d.startsWith("--- ")){r.push(d.slice(4).replace(/^[ab]\//,""));continue}if(d.startsWith("@@")){a={header:d,lines:[]},e.push(a);const h=d.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);i=h?parseInt(h[1],10):0,l=h?parseInt(h[2],10):0;continue}a&&(d.startsWith("+")?(a.lines.push({type:"add",text:d.slice(1),oldNo:null,newNo:l}),l+=1,n+=1):d.startsWith("-")?(a.lines.push({type:"del",text:d.slice(1),oldNo:i,newNo:null}),i+=1,s+=1):(a.lines.push({type:"ctx",text:d.slice(1),oldNo:i,newNo:l}),i+=1,l+=1))}const o=e.flatMap(c=>c.lines);return{hunks:e,lines:o,fileNames:r,adds:n,dels:s}}customElements.define("ask-diff",ps);var Wc=Object.defineProperty,ia=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Wc(e,r,s),s};const Sa=class Sa extends X{constructor(){super(...arguments),this.output="",this.maxLines=8,this.expanded=!1}render(){const e=this.output.replace(/\x1b\[[0-9;]*m/g,"");if(!e)return g`<div class="terminal"><div class="output output--empty">No output</div></div>`;const r=e.split(`
1101
+ `;let vs=Aa;Mo([y({type:String})],vs.prototype,"diff");Mo([y({type:String})],vs.prototype,"filename");function Yc(t){const e=[],r=[];let n=0,s=0,a=null,i=0,l=0;for(const c of t.split(`
1102
+ `)){const d=c.replace(/\r$/,"");if(d.startsWith("+++ ")||d.startsWith("--- ")){r.push(d.slice(4).replace(/^[ab]\//,""));continue}if(d.startsWith("@@")){a={header:d,lines:[]},e.push(a);const f=d.match(/@@ -(\d+)(?:,\d+)? \+(\d+)(?:,\d+)? @@/);i=f?parseInt(f[1],10):0,l=f?parseInt(f[2],10):0;continue}a&&(d.startsWith("+")?(a.lines.push({type:"add",text:d.slice(1),oldNo:null,newNo:l}),l+=1,n+=1):d.startsWith("-")?(a.lines.push({type:"del",text:d.slice(1),oldNo:i,newNo:null}),i+=1,s+=1):(a.lines.push({type:"ctx",text:d.slice(1),oldNo:i,newNo:l}),i+=1,l+=1))}const o=e.flatMap(c=>c.lines);return{hunks:e,lines:o,fileNames:r,adds:n,dels:s}}customElements.define("ask-diff",vs);var Jc=Object.defineProperty,ca=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Jc(e,r,s),s};const Pa=class Pa extends X{constructor(){super(...arguments),this.output="",this.maxLines=8,this.expanded=!1}render(){const e=this.output.replace(/\x1b\[[0-9;]*m/g,"");if(!e)return g`<div class="terminal"><div class="output output--empty">No output</div></div>`;const r=e.split(`
1103
1103
  `),n=!this.expanded&&r.length>this.maxLines,s=n?r.slice(0,this.maxLines):r,a=`calc(${this.maxLines} * 1.1rem)`;return g`
1104
1104
  <div class="terminal">
1105
1105
  <div class="bar">
@@ -1110,7 +1110,7 @@ ${Ts("dark")}
1110
1110
  </div>
1111
1111
  <pre class="output" style=${n?`max-height: ${a}`:""}>${s.join(`
1112
1112
  `)}</pre>
1113
- </div>`}_toggle(){this.expanded=!this.expanded}async _copy(){var e;try{await navigator.clipboard.writeText(this.output)}catch{const r=(e=this.shadowRoot)==null?void 0:e.querySelector(".output"),n=document.createRange();if(r){n.selectNodeContents(r);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(n)}}}};Sa.styles=oe`${le}
1113
+ </div>`}_toggle(){this.expanded=!this.expanded}async _copy(){var e;try{await navigator.clipboard.writeText(this.output)}catch{const r=(e=this.shadowRoot)==null?void 0:e.querySelector(".output"),n=document.createRange();if(r){n.selectNodeContents(r);const s=window.getSelection();s==null||s.removeAllRanges(),s==null||s.addRange(n)}}}};Pa.styles=oe`${le}
1114
1114
 
1115
1115
  :host {
1116
1116
  display: block;
@@ -1173,11 +1173,11 @@ ${Ts("dark")}
1173
1173
  font-family: var(--ask-font, ui-sans-serif, system-ui, sans-serif);
1174
1174
  font-size: 0.75rem;
1175
1175
  }
1176
- `;let Ir=Sa;ia([b({type:String})],Ir.prototype,"output");ia([b({type:Number,attribute:"max-lines"})],Ir.prototype,"maxLines");ia([b({type:Boolean})],Ir.prototype,"expanded");customElements.define("ask-terminal-output",Ir);var Vc=Object.defineProperty,zo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Vc(e,r,s),s};const Ca=class Ca extends X{constructor(){super(...arguments),this.content="",this.active=!1}render(){return this.active?g`
1176
+ `;let Lr=Pa;ca([y({type:String})],Lr.prototype,"output");ca([y({type:Number,attribute:"max-lines"})],Lr.prototype,"maxLines");ca([y({type:Boolean})],Lr.prototype,"expanded");customElements.define("ask-terminal-output",Lr);var Gc=Object.defineProperty,jo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Gc(e,r,s),s};const Oa=class Oa extends X{constructor(){super(...arguments),this.content="",this.active=!1}render(){return this.active?g`
1177
1177
  <div class="streaming-content">
1178
1178
  ${this.content}<span class="streaming-cursor" aria-hidden="true"></span>
1179
1179
  </div>
1180
- `:g``}};Ca.styles=oe`${le}
1180
+ `:g``}};Oa.styles=oe`${le}
1181
1181
 
1182
1182
  :host {
1183
1183
  display: block;
@@ -1207,7 +1207,7 @@ ${Ts("dark")}
1207
1207
  @keyframes ask-blink {
1208
1208
  50% { opacity: 0; }
1209
1209
  }
1210
- `;let hs=Ca;zo([b({type:String})],hs.prototype,"content");zo([b({type:Boolean,reflect:!0})],hs.prototype,"active");customElements.define("ask-streaming",hs);var Yc=Object.defineProperty,oa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Yc(e,r,s),s};const Aa=class Aa extends X{constructor(){super(...arguments),this.code="",this.language="",this._copied=!1}async _handleCopy(){try{await navigator.clipboard.writeText(this.code),this._copied=!0,setTimeout(()=>{this._copied=!1},2e3)}catch{}}render(){return this.code?g`
1210
+ `;let ms=Oa;jo([y({type:String})],ms.prototype,"content");jo([y({type:Boolean,reflect:!0})],ms.prototype,"active");customElements.define("ask-streaming",ms);var Zc=Object.defineProperty,da=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Zc(e,r,s),s};const Na=class Na extends X{constructor(){super(...arguments),this.code="",this.language="",this._copied=!1}async _handleCopy(){try{await navigator.clipboard.writeText(this.code),this._copied=!0,setTimeout(()=>{this._copied=!1},2e3)}catch{}}render(){return this.code?g`
1211
1211
  <div class="code-wrapper">
1212
1212
  <div class="code-header">
1213
1213
  <span class="code-language">${this.language||"code"}</span>
@@ -1217,7 +1217,7 @@ ${Ts("dark")}
1217
1217
  </div>
1218
1218
  <pre class="code-body"><code>${this.code}</code></pre>
1219
1219
  </div>
1220
- `:g``}};Aa.styles=oe`${le}
1220
+ `:g``}};Na.styles=oe`${le}
1221
1221
 
1222
1222
  :host {
1223
1223
  display: block;
@@ -1281,7 +1281,7 @@ ${Ts("dark")}
1281
1281
 
1282
1282
 
1283
1283
 
1284
- `;let Lr=Aa;oa([b({type:String})],Lr.prototype,"code");oa([b({type:String})],Lr.prototype,"language");oa([Ss()],Lr.prototype,"_copied");customElements.define("ask-code-block",Lr);var Jc=Object.defineProperty,Ps=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Jc(e,r,s),s};const Pa=class Pa extends X{constructor(){super(...arguments),this.value="",this.placeholder="Type a message...",this.disabled=!1,this.streaming=!1}_handleInput(e){const r=e.target;this.value=r.value,this._autoResize(),this.dispatchEvent(new CustomEvent("ask-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_autoResize(){const e=this._textarea;e.style.height="auto",e.style.height=Math.min(e.scrollHeight,192)+"px"}_handleKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this._submit())}_submit(){const e=this.value.trim();!e||this.disabled||this.streaming||this.dispatchEvent(new CustomEvent("ask-submit",{detail:{value:e},bubbles:!0,composed:!0}))}_handleStop(){this.dispatchEvent(new CustomEvent("ask-stop",{bubbles:!0,composed:!0}))}_handleKeydownGlobal(e){e.key==="Escape"&&this.streaming&&this._handleStop()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydownGlobal.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydownGlobal.bind(this))}render(){const e=this.querySelector(":scope > [slot='context']")!==null,r=this.querySelector(":scope > [slot='toolbar']")!==null;return g`
1284
+ `;let Dr=Na;da([y({type:String})],Dr.prototype,"code");da([y({type:String})],Dr.prototype,"language");da([As()],Dr.prototype,"_copied");customElements.define("ask-code-block",Dr);var Xc=Object.defineProperty,Ns=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Xc(e,r,s),s};const za=class za extends X{constructor(){super(...arguments),this.value="",this.placeholder="Type a message...",this.disabled=!1,this.streaming=!1}_handleInput(e){const r=e.target;this.value=r.value,this._autoResize(),this.dispatchEvent(new CustomEvent("ask-input",{detail:{value:this.value},bubbles:!0,composed:!0}))}_autoResize(){const e=this._textarea;e.style.height="auto",e.style.height=Math.min(e.scrollHeight,192)+"px"}_handleKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this._submit())}_submit(){const e=this.value.trim();!e||this.disabled||this.streaming||this.dispatchEvent(new CustomEvent("ask-submit",{detail:{value:e},bubbles:!0,composed:!0}))}_handleStop(){this.dispatchEvent(new CustomEvent("ask-stop",{bubbles:!0,composed:!0}))}_handleKeydownGlobal(e){e.key==="Escape"&&this.streaming&&this._handleStop()}connectedCallback(){super.connectedCallback(),document.addEventListener("keydown",this._handleKeydownGlobal.bind(this))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this._handleKeydownGlobal.bind(this))}render(){const e=this.querySelector(":scope > [slot='context']")!==null,r=this.querySelector(":scope > [slot='toolbar']")!==null;return g`
1285
1285
  ${e?g`<div class="input-context" part="context"><slot name="context"></slot></div>`:""}
1286
1286
  <div class="input-card">
1287
1287
  <div class="input-main">
@@ -1326,7 +1326,7 @@ ${Ts("dark")}
1326
1326
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M12 5l7 7-7 7"/>
1327
1327
  </svg>
1328
1328
  </button>
1329
- `}};Pa.styles=oe`${le}
1329
+ `}};za.styles=oe`${le}
1330
1330
 
1331
1331
  :host {
1332
1332
  display: block;
@@ -1445,7 +1445,7 @@ ${Ts("dark")}
1445
1445
 
1446
1446
 
1447
1447
 
1448
- `;let Ut=Pa;Ps([b({type:String})],Ut.prototype,"value");Ps([b({type:String})],Ut.prototype,"placeholder");Ps([b({type:Boolean,reflect:!0})],Ut.prototype,"disabled");Ps([b({type:Boolean,reflect:!0})],Ut.prototype,"streaming");Ps([ln(".input-textarea",!0)],Ut.prototype,"_textarea");customElements.define("ask-chat-input",Ut);var Gc=Object.defineProperty,un=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Gc(e,r,s),s};const Oa=class Oa extends X{constructor(){super(...arguments),this.src="",this.name="",this.role="assistant",this.size=28}render(){const e=`${this.size}px`;if(this.src)return g`
1448
+ `;let Ut=za;Ns([y({type:String})],Ut.prototype,"value");Ns([y({type:String})],Ut.prototype,"placeholder");Ns([y({type:Boolean,reflect:!0})],Ut.prototype,"disabled");Ns([y({type:Boolean,reflect:!0})],Ut.prototype,"streaming");Ns([un(".input-textarea",!0)],Ut.prototype,"_textarea");customElements.define("ask-chat-input",Ut);var Qc=Object.defineProperty,hn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Qc(e,r,s),s};const Ta=class Ta extends X{constructor(){super(...arguments),this.src="",this.name="",this.role="assistant",this.size=28}render(){const e=`${this.size}px`;if(this.src)return g`
1449
1449
  <div class="avatar" style="width: ${e}; height: ${e};">
1450
1450
  <img class="avatar-img" src=${this.src} alt=${this.name||"avatar"} />
1451
1451
  </div>
@@ -1453,7 +1453,7 @@ ${Ts("dark")}
1453
1453
  <div class="avatar" style="width: ${e}; height: ${e};">
1454
1454
  <span class="avatar-fallback">${r}</span>
1455
1455
  </div>
1456
- `}};Oa.styles=oe`${le}
1456
+ `}};Ta.styles=oe`${le}
1457
1457
 
1458
1458
  :host {
1459
1459
  display: inline-flex;
@@ -1489,7 +1489,7 @@ ${Ts("dark")}
1489
1489
 
1490
1490
 
1491
1491
 
1492
- `;let fr=Oa;un([b({type:String})],fr.prototype,"src");un([b({type:String})],fr.prototype,"name");un([b({type:String})],fr.prototype,"role");un([b({type:Number})],fr.prototype,"size");customElements.define("ask-avatar",fr);var Zc=Object.defineProperty,Os=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Zc(e,r,s),s};const Na=class Na extends X{constructor(){super(...arguments),this.name="",this.size=0,this.type="",this.src="",this.removable=!1}_formatSize(e){return e<1024?`${e}B`:e<1048576?`${(e/1024).toFixed(1)}KB`:`${(e/1048576).toFixed(1)}MB`}_handleRemove(){this.dispatchEvent(new CustomEvent("ask-remove",{detail:{name:this.name},bubbles:!0,composed:!0}))}render(){const e=this.type.startsWith("image/"),n=this.type.includes("pdf")?"📕":"📄";return g`
1492
+ `;let hr=Ta;hn([y({type:String})],hr.prototype,"src");hn([y({type:String})],hr.prototype,"name");hn([y({type:String})],hr.prototype,"role");hn([y({type:Number})],hr.prototype,"size");customElements.define("ask-avatar",hr);var ed=Object.defineProperty,zs=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&ed(e,r,s),s};const Ma=class Ma extends X{constructor(){super(...arguments),this.name="",this.size=0,this.type="",this.src="",this.removable=!1}_formatSize(e){return e<1024?`${e}B`:e<1048576?`${(e/1024).toFixed(1)}KB`:`${(e/1048576).toFixed(1)}MB`}_handleRemove(){this.dispatchEvent(new CustomEvent("ask-remove",{detail:{name:this.name},bubbles:!0,composed:!0}))}render(){const e=this.type.startsWith("image/"),n=this.type.includes("pdf")?"📕":"📄";return g`
1493
1493
  <div class="attachment-card">
1494
1494
  <div class="attachment-preview">
1495
1495
  ${e?g`<img class="attachment-preview-img" src=${this.src||""} alt=${this.name} />`:g`<span>${n}</span>`}
@@ -1504,7 +1504,7 @@ ${Ts("dark")}
1504
1504
  </button>
1505
1505
  `:""}
1506
1506
  </div>
1507
- `}};Na.styles=oe`${le}
1507
+ `}};Ma.styles=oe`${le}
1508
1508
 
1509
1509
  :host {
1510
1510
  display: block;
@@ -1588,7 +1588,7 @@ ${Ts("dark")}
1588
1588
 
1589
1589
 
1590
1590
 
1591
- `;let Ft=Na;Os([b({type:String})],Ft.prototype,"name");Os([b({type:Number})],Ft.prototype,"size");Os([b({type:String})],Ft.prototype,"type");Os([b({type:String})],Ft.prototype,"src");Os([b({type:Boolean})],Ft.prototype,"removable");customElements.define("ask-attachment",Ft);var Xc=Object.defineProperty,la=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Xc(e,r,s),s};const za=class za extends X{constructor(){super(...arguments),this.message="",this.title="Something went wrong",this.retryable=!1}_handleRetry(){this.dispatchEvent(new CustomEvent("ask-retry",{bubbles:!0,composed:!0}))}render(){return this.message?g`
1591
+ `;let Ft=Ma;zs([y({type:String})],Ft.prototype,"name");zs([y({type:Number})],Ft.prototype,"size");zs([y({type:String})],Ft.prototype,"type");zs([y({type:String})],Ft.prototype,"src");zs([y({type:Boolean})],Ft.prototype,"removable");customElements.define("ask-attachment",Ft);var td=Object.defineProperty,ua=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&td(e,r,s),s};const ja=class ja extends X{constructor(){super(...arguments),this.message="",this.title="Something went wrong",this.retryable=!1}_handleRetry(){this.dispatchEvent(new CustomEvent("ask-retry",{bubbles:!0,composed:!0}))}render(){return this.message?g`
1592
1592
  <div class="error-card">
1593
1593
  <span class="error-icon">⚠️</span>
1594
1594
  <div class="error-content">
@@ -1597,7 +1597,7 @@ ${Ts("dark")}
1597
1597
  ${this.retryable?g`<button class="error-retry" @click=${this._handleRetry}>Retry</button>`:""}
1598
1598
  </div>
1599
1599
  </div>
1600
- `:g``}};za.styles=oe`${le}
1600
+ `:g``}};ja.styles=oe`${le}
1601
1601
 
1602
1602
  :host {
1603
1603
  display: block;
@@ -1654,14 +1654,14 @@ ${Ts("dark")}
1654
1654
 
1655
1655
 
1656
1656
 
1657
- `;let Br=za;la([b({type:String})],Br.prototype,"message");la([b({type:String})],Br.prototype,"title");la([b({type:Boolean})],Br.prototype,"retryable");customElements.define("ask-error",Br);var Qc=Object.defineProperty,To=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&Qc(e,r,s),s};const Ta=class Ta extends X{constructor(){super(...arguments),this.suggestions="",this.label="Suggestions"}_parsedSuggestions(){try{const e=JSON.parse(this.suggestions);if(Array.isArray(e))return e}catch{}return this.suggestions?this.suggestions.split(",").map(e=>e.trim()).filter(Boolean):[]}_handleSelect(e){this.dispatchEvent(new CustomEvent("ask-select",{detail:{suggestion:e},bubbles:!0,composed:!0}))}render(){const e=this._parsedSuggestions();return e.length===0?g``:g`
1657
+ `;let Br=ja;ua([y({type:String})],Br.prototype,"message");ua([y({type:String})],Br.prototype,"title");ua([y({type:Boolean})],Br.prototype,"retryable");customElements.define("ask-error",Br);var rd=Object.defineProperty,Ro=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&rd(e,r,s),s};const Ra=class Ra extends X{constructor(){super(...arguments),this.suggestions="",this.label="Suggestions"}_parsedSuggestions(){try{const e=JSON.parse(this.suggestions);if(Array.isArray(e))return e}catch{}return this.suggestions?this.suggestions.split(",").map(e=>e.trim()).filter(Boolean):[]}_handleSelect(e){this.dispatchEvent(new CustomEvent("ask-select",{detail:{suggestion:e},bubbles:!0,composed:!0}))}render(){const e=this._parsedSuggestions();return e.length===0?g``:g`
1658
1658
  <div class="suggestions-label">${this.label}</div>
1659
1659
  <div class="suggestions-list">
1660
1660
  ${e.map(r=>g`
1661
1661
  <button class="suggestion-chip" @click=${()=>this._handleSelect(r)}>${r}</button>
1662
1662
  `)}
1663
1663
  </div>
1664
- `}};Ta.styles=oe`${le}
1664
+ `}};Ra.styles=oe`${le}
1665
1665
 
1666
1666
  :host {
1667
1667
  display: block;
@@ -1698,7 +1698,7 @@ ${Ts("dark")}
1698
1698
 
1699
1699
 
1700
1700
 
1701
- `;let vs=Ta;To([b({type:String})],vs.prototype,"suggestions");To([b({type:String})],vs.prototype,"label");customElements.define("ask-suggestions",vs);var ed=Object.defineProperty,ca=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&ed(e,r,s),s};const Ma=class Ma extends X{constructor(){super(...arguments),this.options="",this.value="",this.label=""}_parsedOptions(){try{const e=JSON.parse(this.options);if(Array.isArray(e))return e}catch{}return[]}_handleChange(e){const r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent("ask-change",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e=this._parsedOptions();return g`
1701
+ `;let gs=Ra;Ro([y({type:String})],gs.prototype,"suggestions");Ro([y({type:String})],gs.prototype,"label");customElements.define("ask-suggestions",gs);var sd=Object.defineProperty,fa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&sd(e,r,s),s};const Ia=class Ia extends X{constructor(){super(...arguments),this.options="",this.value="",this.label=""}_parsedOptions(){try{const e=JSON.parse(this.options);if(Array.isArray(e))return e}catch{}return[]}_handleChange(e){const r=e.target;this.value=r.value,this.dispatchEvent(new CustomEvent("ask-change",{detail:{value:this.value},bubbles:!0,composed:!0}))}render(){const e=this._parsedOptions();return g`
1702
1702
  <div class="selector-wrapper">
1703
1703
  ${this.label?g`<span class="selector-label">${this.label}</span>`:""}
1704
1704
  <select class="selector-select" @change=${this._handleChange} .value=${this.value}>
@@ -1707,7 +1707,7 @@ ${Ts("dark")}
1707
1707
  `)}
1708
1708
  </select>
1709
1709
  </div>
1710
- `}};Ma.styles=oe`${le}
1710
+ `}};Ia.styles=oe`${le}
1711
1711
 
1712
1712
  :host {
1713
1713
  display: block;
@@ -1746,19 +1746,19 @@ ${Ts("dark")}
1746
1746
 
1747
1747
 
1748
1748
 
1749
- `;let Dr=Ma;ca([b({type:String})],Dr.prototype,"options");ca([b({type:String})],Dr.prototype,"value");ca([b({type:String})],Dr.prototype,"label");customElements.define("ask-model-selector",Dr);/**
1749
+ `;let Hr=Ia;fa([y({type:String})],Hr.prototype,"options");fa([y({type:String})],Hr.prototype,"value");fa([y({type:String})],Hr.prototype,"label");customElements.define("ask-model-selector",Hr);/**
1750
1750
  * @license
1751
1751
  * Copyright 2017 Google LLC
1752
1752
  * SPDX-License-Identifier: BSD-3-Clause
1753
- */const td={CHILD:2},rd=t=>(...e)=>({_$litDirective$:t,values:e});class sd{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
1753
+ */const nd={CHILD:2},ad=t=>(...e)=>({_$litDirective$:t,values:e});class id{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,r,n){this._$Ct=e,this._$AM=r,this._$Ci=n}_$AS(e,r){return this.update(e,r)}update(e,r){return this.render(...r)}}/**
1754
1754
  * @license
1755
1755
  * Copyright 2017 Google LLC
1756
1756
  * SPDX-License-Identifier: BSD-3-Clause
1757
- */class Rn extends sd{constructor(e){if(super(e),this.it=ue,e.type!==td.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ue||e==null)return this._t=void 0,this.it=e;if(e===cr)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}}Rn.directiveName="unsafeHTML",Rn.resultType=1;const In=rd(Rn);var nd=Object.defineProperty,Mo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&nd(e,r,s),s};function ad(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function id(t){let e=ad(t);return e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*([^*]+)\*/g,"<em>$1</em>"),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/\n/g,"<br>"),e}const ja=class ja extends X{constructor(){super(...arguments),this.content="",this.html=""}render(){if(this.html)return g`
1758
- <div class="markdown-content">${In(this.html)}</div>
1759
- `;if(!this.content)return g``;const e=id(this.content);return g`
1760
- <div class="markdown-content">${In(e)}</div>
1761
- `}};ja.styles=oe`${le}
1757
+ */class Dn extends id{constructor(e){if(super(e),this.it=ue,e.type!==nd.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===ue||e==null)return this._t=void 0,this.it=e;if(e===ur)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const r=[e];return r.raw=r,this._t={_$litType$:this.constructor.resultType,strings:r,values:[]}}}Dn.directiveName="unsafeHTML",Dn.resultType=1;const Bn=ad(Dn);var od=Object.defineProperty,Io=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&od(e,r,s),s};function ld(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function cd(t){let e=ld(t);return e=e.replace(/`([^`]+)`/g,"<code>$1</code>"),e=e.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),e=e.replace(/\*([^*]+)\*/g,"<em>$1</em>"),e=e.replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>'),e=e.replace(/\n/g,"<br>"),e}const La=class La extends X{constructor(){super(...arguments),this.content="",this.html=""}render(){if(this.html)return g`
1758
+ <div class="markdown-content">${Bn(this.html)}</div>
1759
+ `;if(!this.content)return g``;const e=cd(this.content);return g`
1760
+ <div class="markdown-content">${Bn(e)}</div>
1761
+ `}};La.styles=oe`${le}
1762
1762
 
1763
1763
  :host {
1764
1764
  display: block;
@@ -1804,7 +1804,7 @@ ${Ts("dark")}
1804
1804
 
1805
1805
 
1806
1806
 
1807
- `;let ms=ja;Mo([b({type:String})],ms.prototype,"content");Mo([b({type:String})],ms.prototype,"html");customElements.define("ask-markdown",ms);var od=Object.defineProperty,Ns=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&od(e,r,s),s};const Ra=class Ra extends X{constructor(){super(...arguments),this.accept="",this.multiple=!0,this.disabled=!1,this.files=""}_handleKeydown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleClick())}_handleClick(){this.disabled||this._input.click()}_handleFileChange(e){const r=e.target,n=r.files;if(!n||n.length===0)return;const s=[];for(let l=0;l<n.length;l++){const o=n[l],c={name:o.name,size:o.size,type:o.type};o.type.startsWith("image/")&&(c.src=URL.createObjectURL(o)),s.push(c)}const i=[...this._parsedFiles(),...s];this.files=JSON.stringify(i),r.value="",this.dispatchEvent(new CustomEvent("ask-files-select",{detail:{files:s},bubbles:!0,composed:!0}))}_handleRemove(e){const r=e.detail.name,n=this._parsedFiles().filter(s=>s.name!==r);this.files=JSON.stringify(n),this.dispatchEvent(new CustomEvent("ask-file-remove",{detail:{name:r},bubbles:!0,composed:!0}))}_parsedFiles(){try{const e=JSON.parse(this.files);if(Array.isArray(e))return e}catch{}return[]}render(){const e=this._parsedFiles();return g`
1807
+ `;let bs=La;Io([y({type:String})],bs.prototype,"content");Io([y({type:String})],bs.prototype,"html");customElements.define("ask-markdown",bs);var dd=Object.defineProperty,Ts=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&dd(e,r,s),s};const Da=class Da extends X{constructor(){super(...arguments),this.accept="",this.multiple=!0,this.disabled=!1,this.files=""}_handleKeydown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleClick())}_handleClick(){this.disabled||this._input.click()}_handleFileChange(e){const r=e.target,n=r.files;if(!n||n.length===0)return;const s=[];for(let l=0;l<n.length;l++){const o=n[l],c={name:o.name,size:o.size,type:o.type};o.type.startsWith("image/")&&(c.src=URL.createObjectURL(o)),s.push(c)}const i=[...this._parsedFiles(),...s];this.files=JSON.stringify(i),r.value="",this.dispatchEvent(new CustomEvent("ask-files-select",{detail:{files:s},bubbles:!0,composed:!0}))}_handleRemove(e){const r=e.detail.name,n=this._parsedFiles().filter(s=>s.name!==r);this.files=JSON.stringify(n),this.dispatchEvent(new CustomEvent("ask-file-remove",{detail:{name:r},bubbles:!0,composed:!0}))}_parsedFiles(){try{const e=JSON.parse(this.files);if(Array.isArray(e))return e}catch{}return[]}render(){const e=this._parsedFiles();return g`
1808
1808
  <div class="dropzone ${this.disabled?"dropzone--disabled":""}" role="button" tabindex="0" aria-disabled=${this.disabled} @click=${this._handleClick} @keydown=${this._handleKeydown}>
1809
1809
  <div class="dropzone-icon">📎</div>
1810
1810
  <div>Click to attach files</div>
@@ -1831,7 +1831,7 @@ ${Ts("dark")}
1831
1831
  `)}
1832
1832
  </div>
1833
1833
  `:""}
1834
- `}};Ra.styles=oe`${le}
1834
+ `}};Da.styles=oe`${le}
1835
1835
 
1836
1836
  :host {
1837
1837
  display: block;
@@ -1882,7 +1882,7 @@ ${Ts("dark")}
1882
1882
 
1883
1883
 
1884
1884
 
1885
- `;let qt=Ra;Ns([b({type:String})],qt.prototype,"accept");Ns([b({type:Boolean})],qt.prototype,"multiple");Ns([b({type:Boolean})],qt.prototype,"disabled");Ns([b({type:String})],qt.prototype,"files");Ns([ln(".dropzone-input",!0)],qt.prototype,"_input");customElements.define("ask-file-upload",qt);var ld=Object.defineProperty,da=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&ld(e,r,s),s};function pi(t){const e=Date.now()-new Date(t).getTime(),r=Math.floor(e/1e3);if(r<60)return"just now";const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}const Ia=class Ia extends X{constructor(){super(...arguments),this.items="",this.activeId="",this._search=""}_parsedItems(){try{const e=JSON.parse(this.items);if(Array.isArray(e))return e}catch{}return[]}_handleSearch(e){this._search=e.target.value}_handleItemKeydown(e,r){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleSelect(r))}_handleSelect(e){this.dispatchEvent(new CustomEvent("ask-select",{detail:{id:e},bubbles:!0,composed:!0}))}render(){const e=this._parsedItems(),r=this._search.toLowerCase(),n=e.filter(i=>r?i.title.toLowerCase().includes(r)||`${i.messageCount||0} messages`.includes(r):!0),s=n.some(i=>i.status!=="closed"),a=n.some(i=>i.status==="closed");return e.length===0?g`
1885
+ `;let qt=Da;Ts([y({type:String})],qt.prototype,"accept");Ts([y({type:Boolean})],qt.prototype,"multiple");Ts([y({type:Boolean})],qt.prototype,"disabled");Ts([y({type:String})],qt.prototype,"files");Ts([un(".dropzone-input",!0)],qt.prototype,"_input");customElements.define("ask-file-upload",qt);var ud=Object.defineProperty,pa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&ud(e,r,s),s};function mi(t){const e=Date.now()-new Date(t).getTime(),r=Math.floor(e/1e3);if(r<60)return"just now";const n=Math.floor(r/60);if(n<60)return`${n}m ago`;const s=Math.floor(n/60);if(s<24)return`${s}h ago`;const a=Math.floor(s/24);return a<30?`${a}d ago`:new Date(t).toLocaleDateString()}const Ba=class Ba extends X{constructor(){super(...arguments),this.items="",this.activeId="",this._search=""}_parsedItems(){try{const e=JSON.parse(this.items);if(Array.isArray(e))return e}catch{}return[]}_handleSearch(e){this._search=e.target.value}_handleItemKeydown(e,r){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this._handleSelect(r))}_handleSelect(e){this.dispatchEvent(new CustomEvent("ask-select",{detail:{id:e},bubbles:!0,composed:!0}))}render(){const e=this._parsedItems(),r=this._search.toLowerCase(),n=e.filter(i=>r?i.title.toLowerCase().includes(r)||`${i.messageCount||0} messages`.includes(r):!0),s=n.some(i=>i.status!=="closed"),a=n.some(i=>i.status==="closed");return e.length===0?g`
1886
1886
  <div class="empty-state">
1887
1887
  <p>No conversations yet</p>
1888
1888
  </div>
@@ -1909,7 +1909,7 @@ ${Ts("dark")}
1909
1909
  <div class="item-title">${i.title||"Untitled"}</div>
1910
1910
  <div class="item-meta">
1911
1911
  <span>${i.messageCount||0} messages</span>
1912
- ${i.timestamp?g`<span>·</span><span>${pi(i.timestamp)}</span>`:""}
1912
+ ${i.timestamp?g`<span>·</span><span>${mi(i.timestamp)}</span>`:""}
1913
1913
  </div>
1914
1914
  </div>
1915
1915
  </div>
@@ -1930,13 +1930,13 @@ ${Ts("dark")}
1930
1930
  <div class="item-title">${i.title||"Untitled"}</div>
1931
1931
  <div class="item-meta">
1932
1932
  <span>${i.messageCount||0} messages</span>
1933
- ${i.timestamp?g`<span>·</span><span>${pi(i.timestamp)}</span>`:""}
1933
+ ${i.timestamp?g`<span>·</span><span>${mi(i.timestamp)}</span>`:""}
1934
1934
  </div>
1935
1935
  </div>
1936
1936
  </div>
1937
1937
  `)}
1938
1938
  `:""}
1939
- `}};Ia.styles=oe`${le}
1939
+ `}};Ba.styles=oe`${le}
1940
1940
 
1941
1941
  :host {
1942
1942
  display: block;
@@ -2019,7 +2019,7 @@ ${Ts("dark")}
2019
2019
 
2020
2020
 
2021
2021
 
2022
- `;let Hr=Ia;da([b({type:String})],Hr.prototype,"items");da([b({type:String})],Hr.prototype,"activeId");da([Ss()],Hr.prototype,"_search");customElements.define("ask-conversation-list",Hr);var cd=Object.defineProperty,Wr=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&cd(e,r,s),s};const La=class La extends X{constructor(){super(...arguments),this.groups="",this.activeId="",this.newChatLabel="New chat",this.storageKey="ask-sidebar",this._collapsed={},this._expanded={}}connectedCallback(){super.connectedCallback(),this._loadState()}_loadState(){try{const e=sessionStorage.getItem(this.storageKey);if(!e)return;const r=JSON.parse(e);this._collapsed=r.collapsed||{},this._expanded=r.expanded||{}}catch{}}_saveState(){try{sessionStorage.setItem(this.storageKey,JSON.stringify({collapsed:this._collapsed,expanded:this._expanded}))}catch{}}_parsedGroups(){try{const e=JSON.parse(this.groups);if(Array.isArray(e))return e}catch{}return[]}_emit(e,r){this.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0}))}_group(e){return this._parsedGroups().find(r=>r.id===e)}_findNode(e){for(const r of this._parsedGroups()){const n=this._searchNode(r.nodes,e);if(n)return n}}_searchNode(e,r){for(const n of e){if(n.id===r)return n;const s=this._searchNode(n.children??[],r);if(s)return s}}_toggleGroup(e){this._collapsed={...this._collapsed,[e]:!this._isCollapsed(e)},this._saveState()}_toggleNode(e){const r=this._findNode(e),n=r?!this._isExpanded(r):!(this._expanded[e]??!1);this._expanded={...this._expanded,[e]:n},this._saveState()}_isCollapsed(e){var r;return this._collapsed[e]??((r=this._group(e))==null?void 0:r.collapsed)??!1}_isExpanded(e){return this._expanded[e.id]??this._containsActive(e)}_containsActive(e){return e.id===this.activeId?!0:(e.children??[]).some(r=>r.id===this.activeId)}_node(e,r){if((e.children??[]).length>0){const s=this._isExpanded(e);return g`
2022
+ `;let Ur=Ba;pa([y({type:String})],Ur.prototype,"items");pa([y({type:String})],Ur.prototype,"activeId");pa([As()],Ur.prototype,"_search");customElements.define("ask-conversation-list",Ur);var fd=Object.defineProperty,Vr=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&fd(e,r,s),s};const Ha=class Ha extends X{constructor(){super(...arguments),this.groups="",this.activeId="",this.newChatLabel="New chat",this.storageKey="ask-sidebar",this._collapsed={},this._expanded={}}connectedCallback(){super.connectedCallback(),this._loadState()}_loadState(){try{const e=sessionStorage.getItem(this.storageKey);if(!e)return;const r=JSON.parse(e);this._collapsed=r.collapsed||{},this._expanded=r.expanded||{}}catch{}}_saveState(){try{sessionStorage.setItem(this.storageKey,JSON.stringify({collapsed:this._collapsed,expanded:this._expanded}))}catch{}}_parsedGroups(){try{const e=JSON.parse(this.groups);if(Array.isArray(e))return e}catch{}return[]}_emit(e,r){this.dispatchEvent(new CustomEvent(e,{detail:r,bubbles:!0,composed:!0}))}_group(e){return this._parsedGroups().find(r=>r.id===e)}_findNode(e){for(const r of this._parsedGroups()){const n=this._searchNode(r.nodes,e);if(n)return n}}_searchNode(e,r){for(const n of e){if(n.id===r)return n;const s=this._searchNode(n.children??[],r);if(s)return s}}_toggleGroup(e){this._collapsed={...this._collapsed,[e]:!this._isCollapsed(e)},this._saveState()}_toggleNode(e){const r=this._findNode(e),n=r?!this._isExpanded(r):!(this._expanded[e]??!1);this._expanded={...this._expanded,[e]:n},this._saveState()}_isCollapsed(e){var r;return this._collapsed[e]??((r=this._group(e))==null?void 0:r.collapsed)??!1}_isExpanded(e){return this._expanded[e.id]??this._containsActive(e)}_containsActive(e){return e.id===this.activeId?!0:(e.children??[]).some(r=>r.id===this.activeId)}_node(e,r){if((e.children??[]).length>0){const s=this._isExpanded(e);return g`
2023
2023
  <div>
2024
2024
  <button
2025
2025
  class="node node--indent-${r} ${this._containsActive(e)?"node--active":""}"
@@ -2059,7 +2059,7 @@ ${Ts("dark")}
2059
2059
  ${this._isCollapsed(r.id)?"":g`<div class="group-nodes">${r.nodes.map(n=>this._node(n,0))}</div>`}
2060
2060
  </div>
2061
2061
  `)}
2062
- `}};La.styles=oe`${le}
2062
+ `}};Ha.styles=oe`${le}
2063
2063
 
2064
2064
  :host {
2065
2065
  display: block;
@@ -2193,7 +2193,7 @@ ${Ts("dark")}
2193
2193
 
2194
2194
 
2195
2195
 
2196
- `;let St=La;Wr([b({type:String})],St.prototype,"groups");Wr([b({type:String,attribute:"active-id"})],St.prototype,"activeId");Wr([b({type:String,attribute:"new-chat-label"})],St.prototype,"newChatLabel");Wr([b({type:String,attribute:"storage-key"})],St.prototype,"storageKey");Wr([Ss()],St.prototype,"_collapsed");Wr([Ss()],St.prototype,"_expanded");customElements.define("ask-sidebar",St);var dd=Object.defineProperty,ua=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&dd(e,r,s),s};const Ba=class Ba extends X{constructor(){super(...arguments),this.recording=!1,this.disabled=!1,this._elapsed=0,this._timerId=null}_handleClick(){this.disabled||(this.recording?this._stopRecording():this._startRecording())}_startRecording(){this.recording=!0,this._elapsed=0,this._timerId=setInterval(()=>{this._elapsed++},1e3),this.dispatchEvent(new CustomEvent("ask-record-start",{bubbles:!0,composed:!0}))}_stopRecording(){this.recording=!1,this._timerId&&(clearInterval(this._timerId),this._timerId=null),this.dispatchEvent(new CustomEvent("ask-record-stop",{detail:{elapsed:this._elapsed},bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this._timerId&&clearInterval(this._timerId)}_formatTime(e){const r=Math.floor(e/60),n=e%60;return`${r}:${n.toString().padStart(2,"0")}`}render(){return g`
2196
+ `;let Et=Ha;Vr([y({type:String})],Et.prototype,"groups");Vr([y({type:String,attribute:"active-id"})],Et.prototype,"activeId");Vr([y({type:String,attribute:"new-chat-label"})],Et.prototype,"newChatLabel");Vr([y({type:String,attribute:"storage-key"})],Et.prototype,"storageKey");Vr([As()],Et.prototype,"_collapsed");Vr([As()],Et.prototype,"_expanded");customElements.define("ask-sidebar",Et);var pd=Object.defineProperty,ha=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&pd(e,r,s),s};const Ua=class Ua extends X{constructor(){super(...arguments),this.recording=!1,this.disabled=!1,this._elapsed=0,this._timerId=null}_handleClick(){this.disabled||(this.recording?this._stopRecording():this._startRecording())}_startRecording(){this.recording=!0,this._elapsed=0,this._timerId=setInterval(()=>{this._elapsed++},1e3),this.dispatchEvent(new CustomEvent("ask-record-start",{bubbles:!0,composed:!0}))}_stopRecording(){this.recording=!1,this._timerId&&(clearInterval(this._timerId),this._timerId=null),this.dispatchEvent(new CustomEvent("ask-record-stop",{detail:{elapsed:this._elapsed},bubbles:!0,composed:!0}))}disconnectedCallback(){super.disconnectedCallback(),this._timerId&&clearInterval(this._timerId)}_formatTime(e){const r=Math.floor(e/60),n=e%60;return`${r}:${n.toString().padStart(2,"0")}`}render(){return g`
2197
2197
  <button
2198
2198
  class="voice-btn ${this.recording?"voice-btn--recording":""}"
2199
2199
  @click=${this._handleClick}
@@ -2203,7 +2203,7 @@ ${Ts("dark")}
2203
2203
  ${this.recording?"⏹":"🎤"}
2204
2204
  </button>
2205
2205
  ${this.recording?g`<span class="voice-timer">${this._formatTime(this._elapsed)}</span>`:""}
2206
- `}};Ba.styles=oe`${le}
2206
+ `}};Ua.styles=oe`${le}
2207
2207
 
2208
2208
  :host {
2209
2209
  display: inline-flex;
@@ -2254,7 +2254,7 @@ ${Ts("dark")}
2254
2254
 
2255
2255
 
2256
2256
 
2257
- `;let Ur=Ba;ua([b({type:Boolean,reflect:!0})],Ur.prototype,"recording");ua([b({type:Boolean})],Ur.prototype,"disabled");ua([Ss()],Ur.prototype,"_elapsed");customElements.define("ask-voice-input",Ur);var ud=Object.defineProperty,jo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&ud(e,r,s),s};const Da=class Da extends X{constructor(){super(...arguments),this.visible=!1,this.badge=0}_handleClick(){this.dispatchEvent(new CustomEvent("ask-scroll",{bubbles:!0,composed:!0}))}render(){return g`
2257
+ `;let Fr=Ua;ha([y({type:Boolean,reflect:!0})],Fr.prototype,"recording");ha([y({type:Boolean})],Fr.prototype,"disabled");ha([As()],Fr.prototype,"_elapsed");customElements.define("ask-voice-input",Fr);var hd=Object.defineProperty,Lo=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&hd(e,r,s),s};const Fa=class Fa extends X{constructor(){super(...arguments),this.visible=!1,this.badge=0}_handleClick(){this.dispatchEvent(new CustomEvent("ask-scroll",{bubbles:!0,composed:!0}))}render(){return g`
2258
2258
  <button
2259
2259
  class="scroll-btn ${this.visible?"scroll-btn--visible":""}"
2260
2260
  @click=${this._handleClick}
@@ -2266,7 +2266,7 @@ ${Ts("dark")}
2266
2266
  </svg>
2267
2267
  ${this.badge>0?g`<span class="scroll-badge">${this.badge>99?"99+":this.badge}</span>`:""}
2268
2268
  </button>
2269
- `}};Da.styles=oe`${le}
2269
+ `}};Fa.styles=oe`${le}
2270
2270
 
2271
2271
  :host {
2272
2272
  display: block;
@@ -2330,7 +2330,7 @@ ${Ts("dark")}
2330
2330
 
2331
2331
 
2332
2332
 
2333
- `;let gs=Da;jo([b({type:Boolean,reflect:!0})],gs.prototype,"visible");jo([b({type:Number})],gs.prototype,"badge");customElements.define("ask-scroll-bottom",gs);var fd=Object.defineProperty,fn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&fd(e,r,s),s};const Ha=class Ha extends X{constructor(){super(...arguments),this.verificationUri="",this.userCode="",this.pending=!1,this.expiresLabel=""}_authorize(){this.dispatchEvent(new CustomEvent("ask-authorize",{bubbles:!0,composed:!0}))}render(){return g`
2333
+ `;let _s=Fa;Lo([y({type:Boolean,reflect:!0})],_s.prototype,"visible");Lo([y({type:Number})],_s.prototype,"badge");customElements.define("ask-scroll-bottom",_s);var vd=Object.defineProperty,vn=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&vd(e,r,s),s};const qa=class qa extends X{constructor(){super(...arguments),this.verificationUri="",this.userCode="",this.pending=!1,this.expiresLabel=""}_authorize(){this.dispatchEvent(new CustomEvent("ask-authorize",{bubbles:!0,composed:!0}))}render(){return g`
2334
2334
  ${this.pending?g`<div class="notice">
2335
2335
  Not authorized yet — open the link, enter the code, then try again.
2336
2336
  </div>`:""}
@@ -2358,7 +2358,7 @@ ${Ts("dark")}
2358
2358
  </ol>
2359
2359
 
2360
2360
  ${this.expiresLabel?g`<p class="meta">The code expires ${this.expiresLabel}. Your tokens are encrypted at rest.</p>`:""}
2361
- `}};Ha.styles=oe`
2361
+ `}};qa.styles=oe`
2362
2362
  ${le}
2363
2363
 
2364
2364
  :host {
@@ -2421,7 +2421,7 @@ ${Ts("dark")}
2421
2421
  font-size: 0.75rem;
2422
2422
  color: var(--ask-text-muted, #a3a3a3);
2423
2423
  }
2424
- `;let pr=Ha;fn([b({type:String,attribute:"verification-uri"})],pr.prototype,"verificationUri");fn([b({type:String,attribute:"user-code"})],pr.prototype,"userCode");fn([b({type:Boolean,reflect:!0})],pr.prototype,"pending");fn([b({type:String,attribute:"expires-label"})],pr.prototype,"expiresLabel");customElements.define("ask-device-auth",pr);var pd=Object.defineProperty,fa=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&pd(e,r,s),s};const hi={explore:`
2424
+ `;let vr=qa;vn([y({type:String,attribute:"verification-uri"})],vr.prototype,"verificationUri");vn([y({type:String,attribute:"user-code"})],vr.prototype,"userCode");vn([y({type:Boolean,reflect:!0})],vr.prototype,"pending");vn([y({type:String,attribute:"expires-label"})],vr.prototype,"expiresLabel");customElements.define("ask-device-auth",vr);var md=Object.defineProperty,va=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&md(e,r,s),s};const gi={explore:`
2425
2425
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2426
2426
  <path d="M3 11l19-9-9 19-2-8-8-2z"/>
2427
2427
  </svg>`,build:`
@@ -2435,13 +2435,13 @@ ${Ts("dark")}
2435
2435
  <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
2436
2436
  <rect x="8" y="8" width="8" height="8" rx="1.5"/>
2437
2437
  <path d="M12 2v3M12 19v3M2 12h3M19 12h3M5 5l2 2M17 17l2 2M19 5l-2 2M7 17l-2 2"/>
2438
- </svg>`},Ua=class Ua extends X{constructor(){super(...arguments),this.variant="explore",this.label="",this.description=""}_accent(){const e={explore:"var(--ask-prompt-explore, #4f9cf9)",build:"var(--ask-prompt-build, #a78bfa)",review:"var(--ask-prompt-review, #34d399)",fix:"var(--ask-prompt-fix, #fb923c)",custom:"var(--ask-prompt-custom, var(--ask-accent, #c2410c))"};return e[this.variant]??e.custom}_icon(){return this.variant==="custom"?ue:g`<span class="icon" part="icon">${In(hi[this.variant]??hi.explore)}</span>`}_click(){this.dispatchEvent(new CustomEvent("ask-prompt",{detail:{label:this.label,variant:this.variant},bubbles:!0,composed:!0}))}render(){return g`
2438
+ </svg>`},Ka=class Ka extends X{constructor(){super(...arguments),this.variant="explore",this.label="",this.description=""}_accent(){const e={explore:"var(--ask-prompt-explore, #4f9cf9)",build:"var(--ask-prompt-build, #a78bfa)",review:"var(--ask-prompt-review, #34d399)",fix:"var(--ask-prompt-fix, #fb923c)",custom:"var(--ask-prompt-custom, var(--ask-accent, #c2410c))"};return e[this.variant]??e.custom}_icon(){return this.variant==="custom"?ue:g`<span class="icon" part="icon">${Bn(gi[this.variant]??gi.explore)}</span>`}_click(){this.dispatchEvent(new CustomEvent("ask-prompt",{detail:{label:this.label,variant:this.variant},bubbles:!0,composed:!0}))}render(){return g`
2439
2439
  <button class="card" style="--ask-prompt-accent: ${this._accent()}" @click=${this._click}>
2440
2440
  ${this.variant==="custom"?g`<span class="icon" part="icon"><slot></slot></span>`:this._icon()}
2441
2441
  <span class="label">${this.label}</span>
2442
2442
  ${this.description?g`<span class="description">${this.description}</span>`:ue}
2443
2443
  </button>
2444
- `}};Ua.styles=oe`${le}
2444
+ `}};Ka.styles=oe`${le}
2445
2445
 
2446
2446
  :host {
2447
2447
  display: block;
@@ -2499,7 +2499,7 @@ ${Ts("dark")}
2499
2499
  color: var(--ask-text-muted, #a3a3a3);
2500
2500
  line-height: 1.4;
2501
2501
  }
2502
- `;let Fr=Ua;fa([b({type:String})],Fr.prototype,"variant");fa([b({type:String})],Fr.prototype,"label");fa([b({type:String})],Fr.prototype,"description");customElements.define("ask-prompt-card",Fr);var hd=Object.defineProperty,vd=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&hd(e,r,s),s};const Fa=class Fa extends X{constructor(){super(...arguments),this.heading=""}render(){return g`
2502
+ `;let qr=Ka;va([y({type:String})],qr.prototype,"variant");va([y({type:String})],qr.prototype,"label");va([y({type:String})],qr.prototype,"description");customElements.define("ask-prompt-card",qr);var gd=Object.defineProperty,bd=(t,e,r,n)=>{for(var s=void 0,a=t.length-1,i;a>=0;a--)(i=t[a])&&(s=i(e,r,s)||s);return s&&gd(e,r,s),s};const Wa=class Wa extends X{constructor(){super(...arguments),this.heading=""}render(){return g`
2503
2503
  <div class="empty">
2504
2504
  <span class="icon" part="icon">
2505
2505
  <slot name="icon">
@@ -2512,7 +2512,7 @@ ${Ts("dark")}
2512
2512
  ${this.heading?g`<h2 class="heading">${this.heading}</h2>`:""}
2513
2513
  <div class="body" part="body"><slot></slot></div>
2514
2514
  </div>
2515
- `}};Fa.styles=oe`${le}
2515
+ `}};Wa.styles=oe`${le}
2516
2516
 
2517
2517
  :host {
2518
2518
  display: block;
@@ -2554,10 +2554,10 @@ ${Ts("dark")}
2554
2554
  width: 100%;
2555
2555
  max-width: 52rem;
2556
2556
  }
2557
- `;let Ws=Fa;vd([b({type:String})],Ws.prototype,"heading");customElements.define("ask-empty-state",Ws);const Pe="";async function Me(t){if(!t.ok){const e=await t.json().catch(()=>({}));throw new Error(e.error||`HTTP ${t.status}`)}return t.json()}async function md(){return Me(await fetch(`${Pe}/api/config`))}async function gd(){return Me(await fetch(`${Pe}/api/workspaces`))}async function bd(t){return Me(await fetch(`${Pe}/api/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})}))}async function Ln(){return Me(await fetch(`${Pe}/api/conversations`))}async function _d(t){return Me(await fetch(`${Pe}/api/conversations/${t}`))}async function yd(t,e){await Me(await fetch(`${Pe}/api/conversations/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})}))}async function kd(t){await Me(await fetch(`${Pe}/api/conversations/${t}`,{method:"DELETE"}))}async function wd(t){await Me(await fetch(`${Pe}/api/conversations/${t}/archive`,{method:"POST"}))}async function xd(t,e){await Me(await fetch(`${Pe}/api/conversations/${t}/approvals/${e}/approve`,{method:"POST"}))}async function $d(t,e){await Me(await fetch(`${Pe}/api/conversations/${t}/approvals/${e}/reject`,{method:"POST"}))}async function Ed(t){await Me(await fetch(`${Pe}/api/conversations/${t}/approvals/approve-all`,{method:"POST"}))}async function Sd(t){await Me(await fetch(`${Pe}/api/conversations/${t}/plan/approve`,{method:"POST"}))}async function Cd(t){await Me(await fetch(`${Pe}/api/conversations/${t}/plan/reject`,{method:"POST"}))}async function Ad(t){await Me(await fetch(`${Pe}/api/conversations/${t}/abort`,{method:"POST"}))}function Pd(t,e,r,n,s,a,i){const l=new AbortController;return(async()=>{var o,c;try{const d=await fetch(`${Pe}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,conversation_id:e||void 0,model:r||void 0,workspace:n||void 0}),signal:l.signal});if(!d.ok||!d.body)throw new Error(`HTTP ${d.status}`);const h=d.body.getReader(),p=new TextDecoder;let m="";for(;;){const{done:_,value:P}=await h.read();if(_)break;m+=p.decode(P,{stream:!0});let v;for(;(v=m.indexOf(`
2557
+ `;let Js=Wa;bd([y({type:String})],Js.prototype,"heading");customElements.define("ask-empty-state",Js);const Se="";async function Oe(t){if(!t.ok){const e=await t.json().catch(()=>({}));throw new Error(e.error||`HTTP ${t.status}`)}return t.json()}async function _d(){return Oe(await fetch(`${Se}/api/config`))}async function yd(){return Oe(await fetch(`${Se}/api/workspaces`))}async function kd(t){const e=encodeURIComponent(t);return Oe(await fetch(`${Se}/api/workspaces/${e}/agents`))}async function wd(t){return Oe(await fetch(`${Se}/api/workspaces`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t})}))}async function Hn(){return Oe(await fetch(`${Se}/api/conversations`))}async function xd(t){return Oe(await fetch(`${Se}/api/conversations/${t}`))}async function $d(t,e){await Oe(await fetch(`${Se}/api/conversations/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})}))}async function Ed(t){await Oe(await fetch(`${Se}/api/conversations/${t}`,{method:"DELETE"}))}async function Sd(t){await Oe(await fetch(`${Se}/api/conversations/${t}/archive`,{method:"POST"}))}async function Cd(t,e){await Oe(await fetch(`${Se}/api/conversations/${t}/approvals/${e}/approve`,{method:"POST"}))}async function Ad(t,e){await Oe(await fetch(`${Se}/api/conversations/${t}/approvals/${e}/reject`,{method:"POST"}))}async function Pd(t){await Oe(await fetch(`${Se}/api/conversations/${t}/approvals/approve-all`,{method:"POST"}))}async function Od(t){await Oe(await fetch(`${Se}/api/conversations/${t}/plan/approve`,{method:"POST"}))}async function Nd(t){await Oe(await fetch(`${Se}/api/conversations/${t}/plan/reject`,{method:"POST"}))}async function zd(t){await Oe(await fetch(`${Se}/api/conversations/${t}/abort`,{method:"POST"}))}function Td(t,e,r,n,s,a,i,l){const o=new AbortController;return(async()=>{var c,d;try{const f=await fetch(`${Se}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:t,conversation_id:e||void 0,model:r||void 0,workspace:n||void 0,agent:s||void 0}),signal:o.signal});if(!f.ok||!f.body)throw new Error(`HTTP ${f.status}`);const h=f.body.getReader(),m=new TextDecoder;let b="";for(;;){const{done:z,value:v}=await h.read();if(z)break;b+=m.decode(v,{stream:!0});let w;for(;(w=b.indexOf(`
2558
2558
 
2559
- `))!==-1;){const w=m.slice(0,v);m=m.slice(v+2);const S=(o=w.match(/^event: (.+)$/m))==null?void 0:o[1],j=(c=w.match(/^data: (.+)$/m))==null?void 0:c[1];if(!S||j===void 0)continue;if(S==="conversation.created"){a(j);continue}let H={};try{H=JSON.parse(j)}catch{}s({type:S,data:H})}}}catch(d){d.name!=="AbortError"&&s({type:"error",data:{error:d.message}})}finally{i()}})(),l}function Od(t,e,r){switch(e){case"message.delta":t.text+=r.delta??"";break;case"message.thinking":t.thinking+=r.delta??"";break;case"tool.start":{const n=String(r.id??`${r.name}-${t.tools.size}`);t.tools=new Map(t.tools).set(n,{id:n,name:r.name,args:r.args,status:"running"});break}case"tool.delta":{const n=String(r.id),s=t.tools.get(n);s&&(t.tools=new Map(t.tools).set(n,{...s,partial:(s.partial??"")+(r.partial??"")}));break}case"tool.end":{const n=String(r.id),s=t.tools.get(n)??{id:n,name:r.name,status:"done"};t.tools=new Map(t.tools).set(n,{...s,output:r.output,isError:r.isError,durationMs:r.durationMs,status:r.isError?"failed":"done"});break}case"approval.required":t.approvals.push({id:r.id,toolName:r.toolName,args:r.args,message:r.message,autoApprovable:r.autoApprovable,status:"pending"});break;case"approval.updated":{const n=t.approvals.find(s=>s.id===r.id);n&&(n.status=r.status);break}case"plan.proposed":t.plan=r.plan,t.planStatus="proposed";break;case"plan.approved":t.plan=r.plan??t.plan,t.planStatus="approved";break;case"plan.rejected":t.plan=r.plan??t.plan,t.planStatus="rejected";break;case"todos.updated":t.todos=r.todos??[];break;case"turn.completed":t.status="completed",r.response&&!t.text&&(t.text=r.response);break;case"turn.failed":t.status="failed";break;case"turn.aborted":t.status="aborted";break}}function Jr(){return{text:"",thinking:"",tools:new Map,approvals:[],todos:[],plan:null,planStatus:null,status:"streaming"}}var Nd=B('<div class="block svelte-1l486hy"><ask-todo-list></ask-todo-list></div>',2),zd=B('<div class="block svelte-1l486hy"><ask-plan></ask-plan></div>',2),Td=B('<span class="tool-status running svelte-1l486hy">running…</span>'),Md=B('<span class="tool-status failed svelte-1l486hy">failed</span>'),jd=B('<span class="tool-status done svelte-1l486hy"> </span>'),Rd=B('<pre class="tool-args svelte-1l486hy"> </pre>'),Id=B("<ask-diff></ask-diff>",2),Ld=B("<ask-terminal-output></ask-terminal-output>",2),Bd=B('<div class="tool svelte-1l486hy"><div class="tool-head svelte-1l486hy"><span class="tool-icon svelte-1l486hy"> </span> <span class="tool-name svelte-1l486hy"> </span> <!></div> <!> <!></div>'),Dd=B('<div class="block tools svelte-1l486hy"></div>'),Hd=B('<button class="approve-all svelte-1l486hy"> </button>'),Ud=B("<ask-tool-approval></ask-tool-approval>",2),Fd=B('<div class="block approvals svelte-1l486hy"><!> <!></div>'),qd=B('<div class="tool-stream svelte-1l486hy"><!> <!> <!> <!></div>');function Ro(t,e){if(new.target)return Nt({component:Ro,...t});vt(e,!0);let r=ie(e,"turn"),n=ie(e,"conversationId");const s=st(()=>Array.from(r().tools.values())),a=st(()=>r().approvals.filter(k=>k.status==="pending"));function i(k){switch(k){case"bash":return"⌘";case"read":return"👁";case"write":return"✎";case"edit":return"✎";case"grep":return"🔎";case"glob":return"🗂";case"apply_patch":return"▤";case"todo_write":return"☑";default:return"⚙"}}function l(k){return k.startsWith("diff --git")||k.includes("--- a/")&&k.includes("+++ b/")||k.includes(`
2560
- @@ -`)}function o(k){return k.args===void 0||k.args===null?"":typeof k.args=="string"?k.args:JSON.stringify(k.args,null,2)}async function c(k){if(!n())return;await xd(n(),k);const M=r().approvals.find(N=>N.id===k);M&&(M.status="approved")}async function d(k){if(!n())return;await $d(n(),k);const M=r().approvals.find(N=>N.id===k);M&&(M.status="rejected")}async function h(){if(n()){await Ed(n());for(const k of r().approvals)k.status==="pending"&&(k.status="approved")}}async function p(){n()&&(await Sd(n()),r().planStatus="approved")}async function m(){n()&&(await Cd(n()),r().planStatus="rejected")}var _={get turn(){return r()},set turn(k){r(k),re()},get conversationId(){return n()},set conversationId(k){n(k),re()},$set:Ot,$on:(k,M)=>Pt(e,k,M)},P=qd(),v=E(P);{var w=k=>{var M=Nd(),N=E(M);q(()=>ce(N,"todos",r().todos)),gr(N,1,"svelte-1l486hy"),x(M),T(k,M)};te(v,k=>{r().todos.length>0&&k(w)})}var S=O(v,2);{var j=k=>{var M=zd(),N=E(M);q(()=>ce(N,"plan",r().plan)),q(()=>ce(N,"status",r().planStatus)),gr(N,1,"svelte-1l486hy"),x(M),Se("plan-approved",N,p),Se("plan-rejected",N,m),T(k,M)};te(S,k=>{r().plan!==null&&r().planStatus&&k(j)})}var H=O(S,2);{var $=k=>{var M=Dd();is(M,21,()=>f(s),N=>N.id,(N,Z)=>{var de=Bd(),A=E(de),z=E(A),ne=E(z,!0);x(z);var C=O(z,2),U=E(C,!0);x(C);var we=O(C,2);{var be=V=>{var me=Td();T(V,me)},Xe=V=>{var me=Hs(),bt=ns(me);{var I=ee=>{var pe=Md();T(ee,pe)},Y=ee=>{var pe=jd(),it=E(pe);x(pe),q(vr=>he(it,`done${vr??""}`),[()=>f(Z).durationMs?` · ${(f(Z).durationMs/1e3).toFixed(1)}s`:""]),T(ee,pe)};te(bt,ee=>{f(Z).isError?ee(I):ee(Y,!1)},!0)}T(V,me)};te(we,V=>{f(Z).status==="running"?V(be):V(Xe,!1)})}x(A);var Qe=O(A,2);{var je=V=>{var me=Rd(),bt=E(me,!0);x(me),q(I=>he(bt,I),[()=>o(f(Z))]),T(V,me)};te(Qe,V=>{o(f(Z))&&V(je)})}var fe=O(Qe,2);{var ae=V=>{var me=Hs(),bt=ns(me);{var I=ee=>{var pe=Id();q(()=>ce(pe,"diff",f(Z).output)),gr(pe,1,"svelte-1l486hy"),T(ee,pe)},Y=ee=>{var pe=Ld();q(()=>ce(pe,"output",f(Z).output)),ce(pe,"max-lines",6),gr(pe,1,"svelte-1l486hy"),T(ee,pe)};te(bt,ee=>{l(f(Z).output)?ee(I):ee(Y,!1)})}T(V,me)};te(fe,V=>{f(Z).status!=="running"&&f(Z).output&&V(ae)})}x(de),q(V=>{he(ne,V),he(U,f(Z).name)},[()=>i(f(Z).name)]),T(N,de)}),x(M),T(k,M)};te(H,k=>{f(s).length>0&&k($)})}var R=O(H,2);{var G=k=>{var M=Fd(),N=E(M);{var Z=A=>{var z=Hd();z.__click=h;var ne=E(z);x(z),q(()=>he(ne,`Approve all (${f(a).length??""})`)),T(A,z)};te(N,A=>{f(a).length>1&&A(Z)})}var de=O(N,2);is(de,17,()=>r().approvals,A=>A.id,(A,z)=>{var ne=Ud();q(()=>ce(ne,"action-id",f(z).id)),q(()=>ce(ne,"tool-name",f(z).toolName)),q(()=>ce(ne,"args",typeof f(z).args=="string"?f(z).args:JSON.stringify(f(z).args??{},null,2))),q(()=>ce(ne,"message",f(z).message??"")),q(()=>ce(ne,"status",f(z).status)),gr(ne,1,"svelte-1l486hy"),Se("approval-approved",ne,()=>c(f(z).id)),Se("approval-rejected",ne,()=>d(f(z).id)),T(A,ne)}),x(M),T(k,M)};te(R,k=>{r().approvals.length>0&&k(G)})}return x(P),T(t,P),mt(_)}Kr(["click"]);var Kd=B('<details class="thinking svelte-kpbn6d"><summary class="svelte-kpbn6d"><span class="thinking-label svelte-kpbn6d"> </span> <span class="thinking-toggle svelte-kpbn6d"> </span></summary> <div class="thinking-body svelte-kpbn6d"> </div></details>'),Wd=B('<div class="markdown svelte-kpbn6d"><!></div>'),Vd=B('<div class="typing svelte-kpbn6d"><span class="svelte-kpbn6d"></span><span class="svelte-kpbn6d"></span><span class="svelte-kpbn6d"></span></div>'),Yd=B('<div class="assistant svelte-kpbn6d"><!> <!> <!> <!></div>');function Bn(t,e){if(new.target)return Nt({component:Bn,...t});vt(e,!0);let r=ie(e,"content"),n=ie(e,"turn"),s=ie(e,"streaming",7,!1),a=ie(e,"conversationId",7,null),i=se(!1);const l=st(()=>n()!==void 0&&(n().tools.size>0||n().approvals.length>0||n().plan!==null||n().todos.length>0));var o={get content(){return r()},set content(S){r(S),re()},get turn(){return n()},set turn(S){n(S),re()},get streaming(){return s()},set streaming(S=!1){s(S),re()},get conversationId(){return a()},set conversationId(S=null){a(S),re()},$set:Ot,$on:(S,j)=>Pt(e,S,j)},c=Yd(),d=E(c);{var h=S=>{var j=Kd(),H=E(j),$=E(H),R=E($);x($);var G=O($,2),k=E(G,!0);x(G),x(H);var M=O(H,2),N=E(M,!0);x(M),x(j),q(()=>{he(R,`Thinking${s()?"…":""}`),he(k,f(i)?"Hide":"Show"),he(N,n().thinking)}),ic("open","toggle",j,Z=>y(i,Z),()=>f(i)),T(S,j)};te(d,S=>{n()!==void 0&&n().thinking&&S(h)})}var p=O(d,2);{var m=S=>{var j=Wd(),H=E(j);go(H,()=>ko(r())),x(j),T(S,j)};te(p,S=>{r()&&S(m)})}var _=O(p,2);{var P=S=>{Ro(S,{get turn(){return n()},get conversationId(){return a()}})};te(_,S=>{n()!==void 0&&f(l)&&S(P)})}var v=O(_,2);{var w=S=>{var j=Vd();T(S,j)};te(v,S=>{s()&&!r()&&!f(l)&&S(w)})}return x(c),T(t,c),mt(o)}var Jd=B('<div class="user svelte-10oznxe"><div class="bubble svelte-10oznxe"><!></div></div>');function Io(t,e){if(new.target)return Nt({component:Io,...t});vt(e,!0);let r=ie(e,"content");var n={get content(){return r()},set content(l){r(l),re()},$set:Ot,$on:(l,o)=>Pt(e,l,o)},s=Jd(),a=E(s),i=E(a);return go(i,()=>ko(r())),x(a),x(s),T(t,s),mt(n)}var Gd=B(`<div class="empty svelte-xdaci2"><div class="empty-logo svelte-xdaci2">🔧</div> <h1 class="svelte-xdaci2"> </h1> <p class="svelte-xdaci2">Point the agent at your project and let it fire away. It can read,
2559
+ `))!==-1;){const C=b.slice(0,w);b=b.slice(w+2);const T=(c=C.match(/^event: (.+)$/m))==null?void 0:c[1],I=(d=C.match(/^data: (.+)$/m))==null?void 0:d[1];if(!T||I===void 0)continue;if(T==="conversation.created"){i(I);continue}let Z={};try{Z=JSON.parse(I)}catch{}a({type:T,data:Z})}}}catch(f){f.name!=="AbortError"&&a({type:"error",data:{error:f.message}})}finally{l()}})(),o}function Md(t,e,r){switch(e){case"message.delta":t.text+=r.delta??"";break;case"message.thinking":t.thinking+=r.delta??"";break;case"tool.start":{const n=String(r.id??`${r.name}-${t.tools.size}`);t.tools=new Map(t.tools).set(n,{id:n,name:r.name,args:r.args,status:"running"});break}case"tool.delta":{const n=String(r.id),s=t.tools.get(n);s&&(t.tools=new Map(t.tools).set(n,{...s,partial:(s.partial??"")+(r.partial??"")}));break}case"tool.end":{const n=String(r.id),s=t.tools.get(n)??{id:n,name:r.name,status:"done"};t.tools=new Map(t.tools).set(n,{...s,output:r.output,isError:r.isError,durationMs:r.durationMs,status:r.isError?"failed":"done"});break}case"approval.required":t.approvals.push({id:r.id,toolName:r.toolName,args:r.args,message:r.message,autoApprovable:r.autoApprovable,status:"pending"});break;case"approval.updated":{const n=t.approvals.find(s=>s.id===r.id);n&&(n.status=r.status);break}case"plan.proposed":t.plan=r.plan,t.planStatus="proposed";break;case"plan.approved":t.plan=r.plan??t.plan,t.planStatus="approved";break;case"plan.rejected":t.plan=r.plan??t.plan,t.planStatus="rejected";break;case"todos.updated":t.todos=r.todos??[];break;case"turn.completed":t.status="completed",r.response&&!t.text&&(t.text=r.response);break;case"turn.failed":t.status="failed";break;case"turn.aborted":t.status="aborted";break}}function Zr(){return{text:"",thinking:"",tools:new Map,approvals:[],todos:[],plan:null,planStatus:null,status:"streaming"}}var jd=B('<div class="block svelte-1l486hy"><ask-todo-list></ask-todo-list></div>',2),Rd=B('<div class="block svelte-1l486hy"><ask-plan></ask-plan></div>',2),Id=B('<span class="tool-status running svelte-1l486hy">running…</span>'),Ld=B('<span class="tool-status failed svelte-1l486hy">failed</span>'),Dd=B('<span class="tool-status done svelte-1l486hy"> </span>'),Bd=B('<pre class="tool-args svelte-1l486hy"> </pre>'),Hd=B("<ask-diff></ask-diff>",2),Ud=B("<ask-terminal-output></ask-terminal-output>",2),Fd=B('<div class="tool svelte-1l486hy"><div class="tool-head svelte-1l486hy"><span class="tool-icon svelte-1l486hy"> </span> <span class="tool-name svelte-1l486hy"> </span> <!></div> <!> <!></div>'),qd=B('<div class="block tools svelte-1l486hy"></div>'),Kd=B('<button class="approve-all svelte-1l486hy"> </button>'),Wd=B("<ask-tool-approval></ask-tool-approval>",2),Vd=B('<div class="block approvals svelte-1l486hy"><!> <!></div>'),Yd=B('<div class="tool-stream svelte-1l486hy"><!> <!> <!> <!></div>');function Do(t,e){if(new.target)return Ot({component:Do,...t});vt(e,!0);let r=te(e,"turn"),n=te(e,"conversationId");const s=Ge(()=>Array.from(r().tools.values())),a=Ge(()=>r().approvals.filter($=>$.status==="pending"));function i($){switch($){case"bash":return"⌘";case"read":return"👁";case"write":return"✎";case"edit":return"✎";case"grep":return"🔎";case"glob":return"🗂";case"apply_patch":return"▤";case"todo_write":return"☑";default:return"⚙"}}function l($){return $.startsWith("diff --git")||$.includes("--- a/")&&$.includes("+++ b/")||$.includes(`
2560
+ @@ -`)}function o($){return $.args===void 0||$.args===null?"":typeof $.args=="string"?$.args:JSON.stringify($.args,null,2)}async function c($){if(!n())return;await Cd(n(),$);const R=r().approvals.find(_=>_.id===$);R&&(R.status="approved")}async function d($){if(!n())return;await Ad(n(),$);const R=r().approvals.find(_=>_.id===$);R&&(R.status="rejected")}async function f(){if(n()){await Pd(n());for(const $ of r().approvals)$.status==="pending"&&($.status="approved")}}async function h(){n()&&(await Od(n()),r().planStatus="approved")}async function m(){n()&&(await Nd(n()),r().planStatus="rejected")}var b={get turn(){return r()},set turn($){r($),G()},get conversationId(){return n()},set conversationId($){n($),G()},$set:Pt,$on:($,R)=>At(e,$,R)},z=Yd(),v=E(z);{var w=$=>{var R=jd(),_=E(R);U(()=>ce(_,"todos",r().todos)),Yt(_,1,"svelte-1l486hy"),x(R),M($,R)};se(v,$=>{r().todos.length>0&&$(w)})}var C=O(v,2);{var T=$=>{var R=Rd(),_=E(R);U(()=>ce(_,"plan",r().plan)),U(()=>ce(_,"status",r().planStatus)),Yt(_,1,"svelte-1l486hy"),x(R),Ee("plan-approved",_,h),Ee("plan-rejected",_,m),M($,R)};se(C,$=>{r().plan!==null&&r().planStatus&&$(T)})}var I=O(C,2);{var Z=$=>{var R=qd();ls(R,21,()=>u(s),_=>_.id,(_,j)=>{var ae=Fd(),S=E(ae),N=E(S),V=E(N,!0);x(N);var A=O(N,2),D=E(A,!0);x(A);var $e=O(A,2);{var ye=F=>{var ve=Id();M(F,ve)},et=F=>{var ve=qs(),ot=is(ve);{var Wt=Ce=>{var P=Ld();M(Ce,P)},Yr=Ce=>{var P=Dd(),J=E(P);x(P),U(de=>fe(J,`done${de??""}`),[()=>u(j).durationMs?` · ${(u(j).durationMs/1e3).toFixed(1)}s`:""]),M(Ce,P)};se(ot,Ce=>{u(j).isError?Ce(Wt):Ce(Yr,!1)},!0)}M(F,ve)};se($e,F=>{u(j).status==="running"?F(ye):F(et,!1)})}x(S);var Ke=O(S,2);{var je=F=>{var ve=Bd(),ot=E(ve,!0);x(ve),U(Wt=>fe(ot,Wt),[()=>o(u(j))]),M(F,ve)};se(Ke,F=>{o(u(j))&&F(je)})}var pe=O(Ke,2);{var ie=F=>{var ve=qs(),ot=is(ve);{var Wt=Ce=>{var P=Hd();U(()=>ce(P,"diff",u(j).output)),Yt(P,1,"svelte-1l486hy"),M(Ce,P)},Yr=Ce=>{var P=Ud();U(()=>ce(P,"output",u(j).output)),ce(P,"max-lines",6),Yt(P,1,"svelte-1l486hy"),M(Ce,P)};se(ot,Ce=>{l(u(j).output)?Ce(Wt):Ce(Yr,!1)})}M(F,ve)};se(pe,F=>{u(j).status!=="running"&&u(j).output&&F(ie)})}x(ae),U(F=>{fe(V,F),fe(D,u(j).name)},[()=>i(u(j).name)]),M(_,ae)}),x(R),M($,R)};se(I,$=>{u(s).length>0&&$(Z)})}var Q=O(I,2);{var ne=$=>{var R=Vd(),_=E(R);{var j=S=>{var N=Kd();N.__click=f;var V=E(N);x(N),U(()=>fe(V,`Approve all (${u(a).length??""})`)),M(S,N)};se(_,S=>{u(a).length>1&&S(j)})}var ae=O(_,2);ls(ae,17,()=>r().approvals,S=>S.id,(S,N)=>{var V=Wd();U(()=>ce(V,"action-id",u(N).id)),U(()=>ce(V,"tool-name",u(N).toolName)),U(()=>ce(V,"args",typeof u(N).args=="string"?u(N).args:JSON.stringify(u(N).args??{},null,2))),U(()=>ce(V,"message",u(N).message??"")),U(()=>ce(V,"status",u(N).status)),Yt(V,1,"svelte-1l486hy"),Ee("approval-approved",V,()=>c(u(N).id)),Ee("approval-rejected",V,()=>d(u(N).id)),M(S,V)}),x(R),M($,R)};se(Q,$=>{r().approvals.length>0&&$(ne)})}return x(z),M(t,z),mt(b)}Wr(["click"]);var Jd=B('<details class="thinking svelte-kpbn6d"><summary class="svelte-kpbn6d"><span class="thinking-label svelte-kpbn6d"> </span> <span class="thinking-toggle svelte-kpbn6d"> </span></summary> <div class="thinking-body svelte-kpbn6d"> </div></details>'),Gd=B('<div class="markdown svelte-kpbn6d"><!></div>'),Zd=B('<div class="typing svelte-kpbn6d"><span class="svelte-kpbn6d"></span><span class="svelte-kpbn6d"></span><span class="svelte-kpbn6d"></span></div>'),Xd=B('<div class="assistant svelte-kpbn6d"><!> <!> <!> <!></div>');function Un(t,e){if(new.target)return Ot({component:Un,...t});vt(e,!0);let r=te(e,"content"),n=te(e,"turn"),s=te(e,"streaming",7,!1),a=te(e,"conversationId",7,null),i=ee(!1);const l=Ge(()=>n()!==void 0&&(n().tools.size>0||n().approvals.length>0||n().plan!==null||n().todos.length>0));var o={get content(){return r()},set content(C){r(C),G()},get turn(){return n()},set turn(C){n(C),G()},get streaming(){return s()},set streaming(C=!1){s(C),G()},get conversationId(){return a()},set conversationId(C=null){a(C),G()},$set:Pt,$on:(C,T)=>At(e,C,T)},c=Xd(),d=E(c);{var f=C=>{var T=Jd(),I=E(T),Z=E(I),Q=E(Z);x(Z);var ne=O(Z,2),$=E(ne,!0);x(ne),x(I);var R=O(I,2),_=E(R,!0);x(R),x(T),U(()=>{fe(Q,`Thinking${s()?"…":""}`),fe($,u(i)?"Hide":"Show"),fe(_,n().thinking)}),cc("open","toggle",T,j=>k(i,j),()=>u(i)),M(C,T)};se(d,C=>{n()!==void 0&&n().thinking&&C(f)})}var h=O(d,2);{var m=C=>{var T=Gd(),I=E(T);yo(I,()=>$o(r())),x(T),M(C,T)};se(h,C=>{r()&&C(m)})}var b=O(h,2);{var z=C=>{Do(C,{get turn(){return n()},get conversationId(){return a()}})};se(b,C=>{n()!==void 0&&u(l)&&C(z)})}var v=O(b,2);{var w=C=>{var T=Zd();M(C,T)};se(v,C=>{s()&&!r()&&!u(l)&&C(w)})}return x(c),M(t,c),mt(o)}var Qd=B('<div class="user svelte-10oznxe"><div class="bubble svelte-10oznxe"><!></div></div>');function Bo(t,e){if(new.target)return Ot({component:Bo,...t});vt(e,!0);let r=te(e,"content");var n={get content(){return r()},set content(l){r(l),G()},$set:Pt,$on:(l,o)=>At(e,l,o)},s=Qd(),a=E(s),i=E(a);return yo(i,()=>$o(r())),x(a),x(s),M(t,s),mt(n)}var eu=B(`<div class="empty svelte-xdaci2"><div class="empty-logo svelte-xdaci2">🔧</div> <h1 class="svelte-xdaci2"> </h1> <p class="svelte-xdaci2">Point the agent at your project and let it fire away. It can read,
2561
2561
  write, and run commands — watch every tool call live and approve
2562
- what needs approving.</p></div>`),Zd=B('<div class="chat svelte-xdaci2"><!> <!> <!></div>');function Lo(t,e){if(new.target)return Nt({component:Lo,...t});vt(e,!0);let r=ie(e,"messages"),n=ie(e,"turn"),s=ie(e,"streaming"),a=ie(e,"conversationId"),i,l=se(!0);Zi(()=>{f(l)&&i&&(i.scrollTop=i.scrollHeight)});function o(){if(!i)return;const v=i.scrollHeight-i.scrollTop-i.clientHeight<80;y(l,v)}var c={get messages(){return r()},set messages(v){r(v),re()},get turn(){return n()},set turn(v){n(v),re()},get streaming(){return s()},set streaming(v){s(v),re()},get conversationId(){return a()},set conversationId(v){a(v),re()},$set:Ot,$on:(v,w)=>Pt(e,v,w)},d=Zd(),h=E(d);{var p=v=>{var w=Gd(),S=O(E(w),2),j=E(S,!0);x(S),qn(2),x(w),q(()=>he(j,a()?"Continue the conversation":"ask-coding-harness")),T(v,w)};te(h,v=>{r().length===0&&!s()&&v(p)})}var m=O(h,2);is(m,17,r,Zl,(v,w)=>{var S=Hs(),j=ns(S);{var H=R=>{Io(R,{get content(){return f(w).content}})},$=R=>{Bn(R,{get content(){return f(w).content}})};te(j,R=>{f(w).role==="user"?R(H):R($,!1)})}T(v,S)});var _=O(m,2);{var P=v=>{Bn(v,{get content(){return n().text},get turn(){return n()},get streaming(){return s()},get conversationId(){return a()}})};te(_,v=>{(s()||n().text.trim()||n().tools.size>0||n().approvals.length>0||n().plan||n().todos.length>0)&&v(P)})}return x(d),yo(d,v=>i=v,()=>i),Se("scroll",d,o),T(t,d),mt(c)}var Xd=B('<div class="ws-name svelte-181dlmc"> </div>'),Qd=B('<div class="empty svelte-181dlmc"> </div>'),eu=B('<div class="rename-row svelte-181dlmc"><input class="svelte-181dlmc"/></div>'),tu=B("<ask-conversation-item></ask-conversation-item>",2),ru=B('<div class="sidebar svelte-181dlmc"><div class="head svelte-181dlmc"><!> <button class="new svelte-181dlmc"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> New conversation</button> <button class="close svelte-181dlmc" aria-label="Close sidebar"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="search svelte-181dlmc"><ask-search-input></ask-search-input></div> <div class="list svelte-181dlmc"><!> <ask-conversation-group></ask-conversation-group></div></div>',2);function Bo(t,e){if(new.target)return Nt({component:Bo,...t});vt(e,!0);let r=ie(e,"conversations"),n=ie(e,"currentId"),s=ie(e,"workspaceName"),a=ie(e,"streaming"),i=ie(e,"onSelect"),l=ie(e,"onNew"),o=ie(e,"onChanged"),c=ie(e,"onClose"),d=se(""),h=se(null),p=se("");const m=st(()=>f(d).trim()?r().filter(C=>C.title.toLowerCase().includes(f(d).trim().toLowerCase())):r());async function _(){o()(await Ln())}async function P(C){const U=f(p).trim();U&&(await yd(C,U),await _()),y(h,null)}async function v(C){await wd(C),await _()}async function w(C){confirm("Delete this conversation?")&&(await kd(C),await _())}function S(C){i()(C.detail.id)}var j={get conversations(){return r()},set conversations(C){r(C),re()},get currentId(){return n()},set currentId(C){n(C),re()},get workspaceName(){return s()},set workspaceName(C){s(C),re()},get streaming(){return a()},set streaming(C){a(C),re()},get onSelect(){return i()},set onSelect(C){i(C),re()},get onNew(){return l()},set onNew(C){l(C),re()},get onChanged(){return o()},set onChanged(C){o(C),re()},get onClose(){return c()},set onClose(C){c(C),re()},$set:Ot,$on:(C,U)=>Pt(e,C,U)},H=ru(),$=E(H),R=E($);{var G=C=>{var U=Xd(),we=E(U,!0);x(U),q(()=>he(we,s())),T(C,U)};te(R,C=>{s()&&C(G)})}var k=O(R,2);k.__click=function(...C){var U;(U=l())==null||U.apply(this,C)};var M=O(k,2);M.__click=function(...C){var U;(U=c())==null||U.apply(this,C)},x($);var N=O($,2),Z=E(N);ce(Z,"placeholder","Filter conversations…"),x(N);var de=O(N,2),A=E(de);{var z=C=>{var U=Qd(),we=E(U,!0);x(U),q(()=>he(we,r().length===0?"No conversations yet.":"No matches.")),T(C,U)};te(A,C=>{f(m).length===0&&C(z)})}var ne=O(A,2);return q(()=>ce(ne,"label",s()??"Conversations")),q(()=>ce(ne,"count",f(m).length)),is(ne,21,()=>f(m),C=>C.id,(C,U)=>{var we=Hs(),be=ns(we);{var Xe=je=>{var fe=eu();fe.__click=V=>V.stopPropagation();var ae=E(fe);bo(ae),ae.__keydown=V=>{V.key==="Enter"&&P(f(U).id),V.key==="Escape"&&y(h,null)},x(fe),Xn(ae,()=>f(p),V=>y(p,V)),T(je,fe)},Qe=je=>{var fe=tu();q(()=>ce(fe,"id",f(U).id)),q(()=>ce(fe,"title",f(U).title)),q(()=>ce(fe,"meta",`${f(U).message_count} msgs`)),q(()=>ce(fe,"active",f(U).id===n())),q(()=>ce(fe,"archived",f(U).archived)),Se("conversation-select",fe,S),Se("conversation-rename",fe,ae=>{y(h,ae.detail.id,!0),y(p,f(U).title,!0)}),Se("conversation-archive",fe,()=>v(f(U).id)),Se("conversation-delete",fe,()=>w(f(U).id)),T(je,fe)};te(be,je=>{f(h)===f(U).id?je(Xe):je(Qe,!1)})}T(C,we)}),x(ne),x(de),x(H),q(()=>k.disabled=a()),Se("search-input",Z,C=>y(d,C.detail.value,!0)),T(t,H),mt(j)}Kr(["click","keydown"]);var su=B('<button class="send stop svelte-1n8df3y" aria-label="Stop"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><rect x="5" y="5" width="14" height="14" rx="2"></rect></svg></button>'),nu=B('<button class="send svelte-1n8df3y" aria-label="Send"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg></button>'),au=B('<div class="hint svelte-1n8df3y"><span class="model-chip svelte-1n8df3y"> </span> <span class="shortcut svelte-1n8df3y">Shift+Enter for a new line</span></div>'),iu=B('<div class="composer svelte-1n8df3y"><div class="box svelte-1n8df3y"><textarea rows="1" class="svelte-1n8df3y"></textarea> <!></div> <!></div>');function Do(t,e){if(new.target)return Nt({component:Do,...t});vt(e,!0);let r=ie(e,"streaming"),n=ie(e,"model"),s=ie(e,"disabled"),a=ie(e,"onSend"),i=ie(e,"onStop"),l=se(""),o;function c(){const $=f(l).trim();!$||r()||s()||(a()($),y(l,""),o&&(o.style.height="auto"))}function d($){$.key==="Enter"&&!$.shiftKey&&($.preventDefault(),c())}function h(){o&&(o.style.height="auto",o.style.height=Math.min(o.scrollHeight,180)+"px")}var p={get streaming(){return r()},set streaming($){r($),re()},get model(){return n()},set model($){n($),re()},get disabled(){return s()},set disabled($){s($),re()},get onSend(){return a()},set onSend($){a($),re()},get onStop(){return i()},set onStop($){i($),re()},$set:Ot,$on:($,R)=>Pt(e,$,R)},m=iu(),_=E(m),P=E(_);Tl(P),P.__keydown=d,P.__input=h,yo(P,$=>o=$,()=>o);var v=O(P,2);{var w=$=>{var R=su();R.__click=function(...G){var k;(k=i())==null||k.apply(this,G)},T($,R)},S=$=>{var R=nu();R.__click=c,q(G=>R.disabled=G,[()=>s()||!f(l).trim()]),T($,R)};te(v,$=>{r()?$(w):$(S,!1)})}x(_);var j=O(_,2);{var H=$=>{var R=au(),G=E(R),k=E(G,!0);x(G),qn(2),x(R),q(()=>he(k,n())),T($,R)};te(j,$=>{n()&&$(H)})}return x(m),q(()=>Us(P,"placeholder",s()?"Connecting to the harness server…":"Ask the agent to do something…")),Xn(P,()=>f(l),$=>y(l,$)),T(t,m),mt(p)}Kr(["keydown","input","click"]);var ou=B("<button> </button>"),lu=B('<p class="hint svelte-1u3w06f">Saved locally. New messages use this model.</p>'),cu=B('<section class="svelte-1u3w06f"><h3 class="svelte-1u3w06f">Workspace</h3> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Name</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Root</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Git branch</span> <span class="value svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Agent</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Features</span> <span class="value svelte-1u3w06f"><!> <!> <!></span></div></section> <section class="svelte-1u3w06f"><h3 class="svelte-1u3w06f">Model</h3> <div class="models svelte-1u3w06f"></div> <!></section>',1),du=B('<p class="hint svelte-1u3w06f">No server config available.</p>'),uu=B("<ask-dialog><!></ask-dialog>",2);function Ho(t,e){var p;if(new.target)return Nt({component:Ho,...t});vt(e,!0);let r=ie(e,"config"),n=ie(e,"onClose"),s=se(ut(localStorage.getItem("ach_model")||((p=r())==null?void 0:p.defaultModel)||""));const a=st(()=>{var m;return f(s)!==(localStorage.getItem("ach_model")||((m=r())==null?void 0:m.defaultModel)||"")});function i(m){y(s,m,!0),localStorage.setItem("ach_model",m)}var l={get config(){return r()},set config(m){r(m),re()},get onClose(){return n()},set onClose(m){n(m),re()},$set:Ot,$on:(m,_)=>Pt(e,m,_)},o=uu();ce(o,"open",!0),ce(o,"header","Settings");var c=E(o);{var d=m=>{var _=cu(),P=ns(_),v=O(E(P),2),w=O(E(v),2),S=E(w,!0);x(w),x(v);var j=O(v,2),H=O(E(j),2),$=E(H,!0);x(H),x(j);var R=O(j,2),G=O(E(R),2),k=E(G,!0);x(G),x(R);var M=O(R,2),N=O(E(M),2),Z=E(N,!0);x(N),x(M);var de=O(M,2),A=O(E(de),2),z=E(A);{var ne=ae=>{var V=hn("approvals ·");T(ae,V)};te(z,ae=>{r().features.approvals&&ae(ne)})}var C=O(z,2);{var U=ae=>{var V=hn("plan mode ·");T(ae,V)};te(C,ae=>{r().features.planMode&&ae(U)})}var we=O(C,2);{var be=ae=>{var V=hn("todos");T(ae,V)};te(we,ae=>{r().features.todos&&ae(be)})}x(A),x(de),x(P);var Xe=O(P,2),Qe=O(E(Xe),2);is(Qe,20,()=>r().models,ae=>ae,(ae,V)=>{var me=ou();me.__click=()=>i(V);var bt=E(me,!0);x(me),q(()=>{gr(me,1,`model ${V===f(s)?"active":""}`,"svelte-1u3w06f"),he(bt,V)}),T(ae,me)}),x(Qe);var je=O(Qe,2);{var fe=ae=>{var V=lu();T(ae,V)};te(je,ae=>{f(a)&&ae(fe)})}x(Xe),q(()=>{he(S,r().workspace.name),he($,r().workspace.root),he(k,r().workspace.gitBranch??"—"),he(Z,r().currentAdapter)}),T(m,_)},h=m=>{var _=du();T(m,_)};te(c,m=>{r()?m(d):m(h,!1)})}return x(o),Se("dialog-close",o,function(...m){var _;(_=n())==null||_.apply(this,m)}),T(t,o),mt(l)}Kr(["click"]);var fu=B('<div class="error svelte-1xx308a"> </div>'),pu=B(`<div class="switcher svelte-1xx308a"><ask-menu><span slot="trigger" class="trigger-name svelte-1xx308a"> </span> <div slot="menu-footer" class="menu-footer svelte-1xx308a"><button class="open-ws svelte-1xx308a">+ Open workspace…</button></div></ask-menu> <ask-dialog><p class="hint svelte-1xx308a">Path to a project directory on this machine. The agent gets full access to it —
2563
- same trust model as running a coding agent in your terminal.</p> <input class="path-input svelte-1xx308a" placeholder="/path/to/project"/> <!> <div slot="footer"><button class="btn cancel svelte-1xx308a">Cancel</button> <button class="btn go svelte-1xx308a"> </button></div></ask-dialog></div>`,2);function Uo(t,e){if(new.target)return Nt({component:Uo,...t});vt(e,!0);let r=ie(e,"workspaces"),n=ie(e,"current"),s=ie(e,"onSelect"),a=ie(e,"onOpened"),i=se(!1),l=se(!1),o=se(""),c=se(!1),d=se(null);const h=st(()=>r().map(A=>{var z;return{id:A.root,label:A.name,description:A.root,icon:"📁",active:A.root===((z=n())==null?void 0:z.root)}}));function p(A){const z=r().find(ne=>ne.root===A.detail.id);z&&s()(z)}async function m(){const A=f(o).trim();if(!(!A||f(c))){y(c,!0),y(d,null);try{const z=await bd(A);y(l,!1),y(o,""),a()(z)}catch(z){y(d,z.message||"Could not open that workspace",!0)}finally{y(c,!1)}}}var _={get workspaces(){return r()},set workspaces(A){r(A),re()},get current(){return n()},set current(A){n(A),re()},get onSelect(){return s()},set onSelect(A){s(A),re()},get onOpened(){return a()},set onOpened(A){a(A),re()},$set:Ot,$on:(A,z)=>Pt(e,A,z)},P=pu(),v=E(P);q(()=>ce(v,"items",f(h))),q(()=>{var A;return ce(v,"trigger-label",((A=n())==null?void 0:A.name)??"No workspace")});var w=E(v),S=E(w,!0);x(w);var j=O(w,2),H=E(j);H.__click=()=>{y(l,!0),y(i,!1)},x(j),x(v);var $=O(v,2);q(()=>ce($,"open",f(l))),ce($,"header","Open workspace");var R=O(E($),2);bo(R),R.__keydown=A=>{A.key==="Enter"&&m(),A.key==="Escape"&&y(l,!1)};var G=O(R,2);{var k=A=>{var z=fu(),ne=E(z,!0);x(z),q(()=>he(ne,f(d))),T(A,z)};te(G,A=>{f(d)&&A(k)})}var M=O(G,2),N=E(M);N.__click=()=>y(l,!1);var Z=O(N,2);Z.__click=m;var de=E(Z,!0);return x(Z),x(M),x($),x(P),q(A=>{var z;he(S,((z=n())==null?void 0:z.name)??"No workspace"),Z.disabled=A,he(de,f(c)?"Opening…":"Open")},[()=>f(c)||!f(o).trim()]),Se("menu-select",v,p),Se("menu-open",v,()=>y(i,!0)),Se("menu-close",v,()=>y(i,!1)),Se("dialog-close",$,()=>y(l,!1)),Xn(R,()=>f(o),A=>y(o,A)),T(t,P),mt(_)}Kr(["click","keydown"]);var hu=B('<button class="icon-btn stop svelte-1n46o8q" aria-label="Stop"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><rect x="5" y="5" width="14" height="14" rx="2"></rect></svg></button>'),vu=B('<div class="sidebar-wrap svelte-1n46o8q"><!></div>'),mu=B('<div class="banner-error svelte-1n46o8q"> </div>'),gu=B('<div class="app svelte-1n46o8q"><header class="topbar svelte-1n46o8q"><button class="icon-btn hamburger svelte-1n46o8q" aria-label="Toggle sidebar"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button> <div class="workspace svelte-1n46o8q"><!></div> <div class="topbar-actions svelte-1n46o8q"><!> <button class="icon-btn svelte-1n46o8q" aria-label="Settings"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></header> <div class="body svelte-1n46o8q"><!> <main class="main svelte-1n46o8q"><!> <!> <!></main></div> <!></div>');function Fo(t,e){if(new.target)return Nt({component:Fo,...t});vt(e,!0);let r=se(null),n=se(ut([])),s=se(ut([])),a=se(null),i=se(null),l=se(ut([])),o=se(ut(Jr())),c=se(!1),d=se(!1),h=se(!1),p=se(null),m=null;const _=st(()=>window.innerWidth<768);lc(async()=>{var I;try{y(r,await md(),!0),y(n,await Ln(),!0),y(s,await gd(),!0),y(a,f(s).find(Y=>{var ee;return Y.root===((ee=f(r))==null?void 0:ee.workspace.root)})??f(s)[0]??((I=f(r))==null?void 0:I.workspace)??null,!0)}catch(Y){y(p,`Cannot reach the harness server: ${Y.message}`)}});async function P(I){if(!f(c))try{const Y=await _d(I);if(y(i,Y.id,!0),y(l,(Y.messages??[]).map(ee=>({role:ee.role,content:ee.content})),!0),y(o,Jr(),!0),y(h,!1),y(d,!1),y(p,null),Y.directory){const ee=f(s).find(pe=>pe.root===Y.directory);ee&&y(a,ee,!0)}}catch(Y){y(p,Y.message,!0)}}function v(I){f(c)||(y(a,I,!0),y(i,null),y(l,[],!0),y(o,Jr(),!0),y(p,null))}function w(I){y(s,[...f(s).filter(Y=>Y.root!==I.root),I],!0),v(I)}function S(){f(c)||(y(i,null),y(l,[],!0),y(o,Jr(),!0),y(p,null),y(d,!1))}function j(I){var ee,pe;if(f(c)||!I.trim())return;f(o).text.trim()&&(f(l).length===0||f(l)[f(l).length-1].role!=="assistant")&&y(l,[...f(l),{role:"assistant",content:f(o).text.trim()}],!0);const Y={role:"user",content:I.trim()};y(l,[...f(l),Y],!0),y(o,Jr(),!0),y(c,!0),y(p,null),m=Pd(Y.content,f(i),(ee=f(r))==null?void 0:ee.defaultModel,(pe=f(a))==null?void 0:pe.root,it=>{if(it.type==="error"){y(p,it.data.error,!0),f(o).status="failed";return}Od(f(o),it.type,it.data)},it=>{y(i,it,!0),$()},()=>{y(c,!1),$()})}function H(){m&&m.abort(),f(i)&&Ad(f(i)).catch(()=>{})}async function $(){try{y(n,await Ln(),!0)}catch{}}function R(I){y(n,I,!0)}function G(I){P(I)}var k={$set:Ot,$on:(I,Y)=>Pt(e,I,Y)},M=gu();tc("1n46o8q",I=>{Dl(()=>{var Y;Ki.title=((Y=f(r))==null?void 0:Y.workspace.name)??"ask-coding-harness"??""})});var N=E(M),Z=E(N);Z.__click=()=>y(d,!f(d));var de=O(Z,2),A=E(de);Uo(A,{get workspaces(){return f(s)},get current(){return f(a)},onSelect:v,onOpened:w}),x(de);var z=O(de,2),ne=E(z);{var C=I=>{var Y=hu();Y.__click=H,T(I,Y)};te(ne,I=>{f(c)&&I(C)})}var U=O(ne,2);U.__click=()=>y(h,!f(h)),x(z),x(N);var we=O(N,2),be=E(we);{var Xe=I=>{var Y=vu(),ee=E(Y);{let pe=st(()=>f(n).filter(vr=>!f(a)||vr.directory===f(a).root)),it=st(()=>{var vr;return(vr=f(a))==null?void 0:vr.name});Bo(ee,{get conversations(){return f(pe)},get currentId(){return f(i)},get workspaceName(){return f(it)},onSelect:G,onNew:S,onChanged:R,onClose:()=>y(d,!1),get streaming(){return f(c)}})}x(Y),T(I,Y)};te(be,I=>{(f(d)||!f(_))&&I(Xe)})}var Qe=O(be,2),je=E(Qe);{var fe=I=>{var Y=mu(),ee=E(Y,!0);x(Y),q(()=>he(ee,f(p))),T(I,Y)};te(je,I=>{f(p)&&!f(c)&&I(fe)})}var ae=O(je,2);Lo(ae,{get messages(){return f(l)},get turn(){return f(o)},get streaming(){return f(c)},get conversationId(){return f(i)}});var V=O(ae,2);{let I=st(()=>{var ee;return(ee=f(r))==null?void 0:ee.defaultModel}),Y=st(()=>!f(r));Do(V,{get streaming(){return f(c)},get model(){return f(I)},onSend:j,onStop:H,get disabled(){return f(Y)}})}x(Qe),x(we);var me=O(we,2);{var bt=I=>{Ho(I,{get config(){return f(r)},onClose:()=>y(h,!1)})};te(me,I=>{f(h)&&I(bt)})}return x(M),T(t,M),mt(k)}Kr(["click"]);Zn(Fo,{target:document.getElementById("app")});
2562
+ what needs approving.</p></div>`),tu=B('<div class="chat svelte-xdaci2"><!> <!> <!></div>');function Ho(t,e){if(new.target)return Ot({component:Ho,...t});vt(e,!0);let r=te(e,"messages"),n=te(e,"turn"),s=te(e,"streaming"),a=te(e,"conversationId"),i,l=ee(!0);eo(()=>{u(l)&&i&&(i.scrollTop=i.scrollHeight)});function o(){if(!i)return;const v=i.scrollHeight-i.scrollTop-i.clientHeight<80;k(l,v)}var c={get messages(){return r()},set messages(v){r(v),G()},get turn(){return n()},set turn(v){n(v),G()},get streaming(){return s()},set streaming(v){s(v),G()},get conversationId(){return a()},set conversationId(v){a(v),G()},$set:Pt,$on:(v,w)=>At(e,v,w)},d=tu(),f=E(d);{var h=v=>{var w=eu(),C=O(E(w),2),T=E(C,!0);x(C),Vn(2),x(w),U(()=>fe(T,a()?"Continue the conversation":"ask-coding-harness")),M(v,w)};se(f,v=>{r().length===0&&!s()&&v(h)})}var m=O(f,2);ls(m,17,r,ec,(v,w)=>{var C=qs(),T=is(C);{var I=Q=>{Bo(Q,{get content(){return u(w).content}})},Z=Q=>{Un(Q,{get content(){return u(w).content}})};se(T,Q=>{u(w).role==="user"?Q(I):Q(Z,!1)})}M(v,C)});var b=O(m,2);{var z=v=>{Un(v,{get content(){return n().text},get turn(){return n()},get streaming(){return s()},get conversationId(){return a()}})};se(b,v=>{(s()||n().text.trim()||n().tools.size>0||n().approvals.length>0||n().plan||n().todos.length>0)&&v(z)})}return x(d),xo(d,v=>i=v,()=>i),Ee("scroll",d,o),M(t,d),mt(c)}var ru=B('<div class="ws-name svelte-181dlmc"> </div>'),su=B('<div class="empty svelte-181dlmc"> </div>'),nu=B('<div class="rename-row svelte-181dlmc"><input class="svelte-181dlmc"/></div>'),au=B("<ask-conversation-item></ask-conversation-item>",2),iu=B('<div class="sidebar svelte-181dlmc"><div class="head svelte-181dlmc"><!> <button class="new svelte-181dlmc"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg> New conversation</button> <button class="close svelte-181dlmc" aria-label="Close sidebar"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg></button></div> <div class="search svelte-181dlmc"><ask-search-input></ask-search-input></div> <div class="list svelte-181dlmc"><!> <ask-conversation-group></ask-conversation-group></div></div>',2);function Uo(t,e){if(new.target)return Ot({component:Uo,...t});vt(e,!0);let r=te(e,"conversations"),n=te(e,"currentId"),s=te(e,"workspaceName"),a=te(e,"streaming"),i=te(e,"onSelect"),l=te(e,"onNew"),o=te(e,"onChanged"),c=te(e,"onClose"),d=ee(""),f=ee(null),h=ee("");const m=Ge(()=>u(d).trim()?r().filter(A=>A.title.toLowerCase().includes(u(d).trim().toLowerCase())):r());async function b(){o()(await Hn())}async function z(A){const D=u(h).trim();D&&(await $d(A,D),await b()),k(f,null)}async function v(A){await Sd(A),await b()}async function w(A){confirm("Delete this conversation?")&&(await Ed(A),await b())}function C(A){i()(A.detail.id)}var T={get conversations(){return r()},set conversations(A){r(A),G()},get currentId(){return n()},set currentId(A){n(A),G()},get workspaceName(){return s()},set workspaceName(A){s(A),G()},get streaming(){return a()},set streaming(A){a(A),G()},get onSelect(){return i()},set onSelect(A){i(A),G()},get onNew(){return l()},set onNew(A){l(A),G()},get onChanged(){return o()},set onChanged(A){o(A),G()},get onClose(){return c()},set onClose(A){c(A),G()},$set:Pt,$on:(A,D)=>At(e,A,D)},I=iu(),Z=E(I),Q=E(Z);{var ne=A=>{var D=ru(),$e=E(D,!0);x(D),U(()=>fe($e,s())),M(A,D)};se(Q,A=>{s()&&A(ne)})}var $=O(Q,2);$.__click=function(...A){var D;(D=l())==null||D.apply(this,A)};var R=O($,2);R.__click=function(...A){var D;(D=c())==null||D.apply(this,A)},x(Z);var _=O(Z,2),j=E(_);ce(j,"placeholder","Filter conversations…"),x(_);var ae=O(_,2),S=E(ae);{var N=A=>{var D=su(),$e=E(D,!0);x(D),U(()=>fe($e,r().length===0?"No conversations yet.":"No matches.")),M(A,D)};se(S,A=>{u(m).length===0&&A(N)})}var V=O(S,2);return U(()=>ce(V,"label",s()??"Conversations")),U(()=>ce(V,"count",u(m).length)),ls(V,21,()=>u(m),A=>A.id,(A,D)=>{var $e=qs(),ye=is($e);{var et=je=>{var pe=nu();pe.__click=F=>F.stopPropagation();var ie=E(pe);ko(ie),ie.__keydown=F=>{F.key==="Enter"&&z(u(D).id),F.key==="Escape"&&k(f,null)},x(pe),ta(ie,()=>u(h),F=>k(h,F)),M(je,pe)},Ke=je=>{var pe=au();U(()=>ce(pe,"id",u(D).id)),U(()=>ce(pe,"title",u(D).title)),U(()=>ce(pe,"meta",`${u(D).message_count} msgs`)),U(()=>ce(pe,"active",u(D).id===n())),U(()=>ce(pe,"archived",u(D).archived)),Ee("conversation-select",pe,C),Ee("conversation-rename",pe,ie=>{k(f,ie.detail.id,!0),k(h,u(D).title,!0)}),Ee("conversation-archive",pe,()=>v(u(D).id)),Ee("conversation-delete",pe,()=>w(u(D).id)),M(je,pe)};se(ye,je=>{u(f)===u(D).id?je(et):je(Ke,!1)})}M(A,$e)}),x(V),x(ae),x(I),U(()=>$.disabled=a()),Ee("search-input",j,A=>k(d,A.detail.value,!0)),M(t,I),mt(T)}Wr(["click","keydown"]);var ou=B('<button class="send stop svelte-1n8df3y" aria-label="Stop"><svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor"><rect x="5" y="5" width="14" height="14" rx="2"></rect></svg></button>'),lu=B('<button class="send svelte-1n8df3y" aria-label="Send"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg></button>'),cu=B('<div class="hint svelte-1n8df3y"><span class="model-chip svelte-1n8df3y"> </span> <span class="agent-chip svelte-1n8df3y"><ask-menu><span slot="trigger"> </span></ask-menu></span> <span class="shortcut svelte-1n8df3y">Shift+Enter for a new line</span></div>',2),du=B('<div class="composer svelte-1n8df3y"><div class="box svelte-1n8df3y"><textarea rows="1" class="svelte-1n8df3y"></textarea> <!></div> <!></div>');function Fo(t,e){if(new.target)return Ot({component:Fo,...t});vt(e,!0);let r=te(e,"streaming"),n=te(e,"model"),s=te(e,"disabled"),a=te(e,"agents"),i=te(e,"currentAgent"),l=te(e,"onSend"),o=te(e,"onStop"),c=te(e,"onAgentChange");const d=Ge(()=>[{id:"",label:"Default agent",description:"workspace defaults",icon:"🤖",active:!i()},...a().map(_=>({id:_.name,label:_.name,description:"agents/"+_.name,icon:"🧩",active:_.name===i()}))]);function f(_){c()(_.detail.id||null)}let h=ee(""),m;function b(){const _=u(h).trim();!_||r()||s()||(l()(_),k(h,""),m&&(m.style.height="auto"))}function z(_){_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),b())}function v(){m&&(m.style.height="auto",m.style.height=Math.min(m.scrollHeight,180)+"px")}var w={get streaming(){return r()},set streaming(_){r(_),G()},get model(){return n()},set model(_){n(_),G()},get disabled(){return s()},set disabled(_){s(_),G()},get agents(){return a()},set agents(_){a(_),G()},get currentAgent(){return i()},set currentAgent(_){i(_),G()},get onSend(){return l()},set onSend(_){l(_),G()},get onStop(){return o()},set onStop(_){o(_),G()},get onAgentChange(){return c()},set onAgentChange(_){c(_),G()},$set:Pt,$on:(_,j)=>At(e,_,j)},C=du(),T=E(C),I=E(T);Rl(I),I.__keydown=z,I.__input=v,xo(I,_=>m=_,()=>m);var Z=O(I,2);{var Q=_=>{var j=ou();j.__click=function(...ae){var S;(S=o())==null||S.apply(this,ae)},M(_,j)},ne=_=>{var j=lu();j.__click=b,U(ae=>j.disabled=ae,[()=>s()||!u(h).trim()]),M(_,j)};se(Z,_=>{r()?_(Q):_(ne,!1)})}x(T);var $=O(T,2);{var R=_=>{var j=cu(),ae=E(j),S=E(ae,!0);x(ae);var N=O(ae,2),V=E(N);U(()=>ce(V,"items",u(d))),Yt(V,1,"agent-menu");var A=E(V),D=E(A,!0);x(A),x(V),x(N),Vn(2),x(j),U(()=>{fe(S,n()),fe(D,i()?`agent: ${i()}`:"default agent")}),Ee("menu-select",V,f),M(_,j)};se($,_=>{n()&&_(R)})}return x(C),U(()=>Ks(I,"placeholder",s()?"Connecting to the harness server…":"Ask the agent to do something…")),ta(I,()=>u(h),_=>k(h,_)),M(t,C),mt(w)}Wr(["keydown","input","click"]);var uu=B("<button> </button>"),fu=B('<p class="hint svelte-1u3w06f">Saved locally. New messages use this model.</p>'),pu=B('<section class="svelte-1u3w06f"><h3 class="svelte-1u3w06f">Workspace</h3> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Name</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Root</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Git branch</span> <span class="value svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Agent</span> <span class="value mono svelte-1u3w06f"> </span></div> <div class="row svelte-1u3w06f"><span class="label svelte-1u3w06f">Features</span> <span class="value svelte-1u3w06f"><!> <!> <!></span></div></section> <section class="svelte-1u3w06f"><h3 class="svelte-1u3w06f">Model</h3> <div class="models svelte-1u3w06f"></div> <!></section>',1),hu=B('<p class="hint svelte-1u3w06f">No server config available.</p>'),vu=B("<ask-dialog><!></ask-dialog>",2);function qo(t,e){var h;if(new.target)return Ot({component:qo,...t});vt(e,!0);let r=te(e,"config"),n=te(e,"onClose"),s=ee(nt(localStorage.getItem("ach_model")||((h=r())==null?void 0:h.defaultModel)||""));const a=Ge(()=>{var m;return u(s)!==(localStorage.getItem("ach_model")||((m=r())==null?void 0:m.defaultModel)||"")});function i(m){k(s,m,!0),localStorage.setItem("ach_model",m)}var l={get config(){return r()},set config(m){r(m),G()},get onClose(){return n()},set onClose(m){n(m),G()},$set:Pt,$on:(m,b)=>At(e,m,b)},o=vu();ce(o,"open",!0),ce(o,"header","Settings");var c=E(o);{var d=m=>{var b=pu(),z=is(b),v=O(E(z),2),w=O(E(v),2),C=E(w,!0);x(w),x(v);var T=O(v,2),I=O(E(T),2),Z=E(I,!0);x(I),x(T);var Q=O(T,2),ne=O(E(Q),2),$=E(ne,!0);x(ne),x(Q);var R=O(Q,2),_=O(E(R),2),j=E(_,!0);x(_),x(R);var ae=O(R,2),S=O(E(ae),2),N=E(S);{var V=ie=>{var F=gn("approvals ·");M(ie,F)};se(N,ie=>{r().features.approvals&&ie(V)})}var A=O(N,2);{var D=ie=>{var F=gn("plan mode ·");M(ie,F)};se(A,ie=>{r().features.planMode&&ie(D)})}var $e=O(A,2);{var ye=ie=>{var F=gn("todos");M(ie,F)};se($e,ie=>{r().features.todos&&ie(ye)})}x(S),x(ae),x(z);var et=O(z,2),Ke=O(E(et),2);ls(Ke,20,()=>r().models,ie=>ie,(ie,F)=>{var ve=uu();ve.__click=()=>i(F);var ot=E(ve,!0);x(ve),U(()=>{Yt(ve,1,`model ${F===u(s)?"active":""}`,"svelte-1u3w06f"),fe(ot,F)}),M(ie,ve)}),x(Ke);var je=O(Ke,2);{var pe=ie=>{var F=fu();M(ie,F)};se(je,ie=>{u(a)&&ie(pe)})}x(et),U(()=>{fe(C,r().workspace.name),fe(Z,r().workspace.root),fe($,r().workspace.gitBranch??"—"),fe(j,r().currentAdapter)}),M(m,b)},f=m=>{var b=hu();M(m,b)};se(c,m=>{r()?m(d):m(f,!1)})}return x(o),Ee("dialog-close",o,function(...m){var b;(b=n())==null||b.apply(this,m)}),M(t,o),mt(l)}Wr(["click"]);var mu=B('<div class="error svelte-1xx308a"> </div>'),gu=B(`<div class="switcher svelte-1xx308a"><ask-menu><span slot="trigger" class="trigger-name svelte-1xx308a"> </span> <div slot="menu-footer" class="menu-footer svelte-1xx308a"><button class="open-ws svelte-1xx308a">+ Open workspace…</button></div></ask-menu> <ask-dialog><p class="hint svelte-1xx308a">Path to a project directory on this machine. The agent gets full access to it —
2563
+ same trust model as running a coding agent in your terminal.</p> <input class="path-input svelte-1xx308a" placeholder="/path/to/project"/> <!> <div slot="footer"><button class="btn cancel svelte-1xx308a">Cancel</button> <button class="btn go svelte-1xx308a"> </button></div></ask-dialog></div>`,2);function Ko(t,e){if(new.target)return Ot({component:Ko,...t});vt(e,!0);let r=te(e,"workspaces"),n=te(e,"current"),s=te(e,"onSelect"),a=te(e,"onOpened"),i=ee(!1),l=ee(!1),o=ee(""),c=ee(!1),d=ee(null);const f=Ge(()=>r().map(S=>{var N;return{id:S.root,label:S.name,description:S.root,icon:"📁",active:S.root===((N=n())==null?void 0:N.root)}}));function h(S){const N=r().find(V=>V.root===S.detail.id);N&&s()(N)}async function m(){const S=u(o).trim();if(!(!S||u(c))){k(c,!0),k(d,null);try{const N=await wd(S);k(l,!1),k(o,""),a()(N)}catch(N){k(d,N.message||"Could not open that workspace",!0)}finally{k(c,!1)}}}var b={get workspaces(){return r()},set workspaces(S){r(S),G()},get current(){return n()},set current(S){n(S),G()},get onSelect(){return s()},set onSelect(S){s(S),G()},get onOpened(){return a()},set onOpened(S){a(S),G()},$set:Pt,$on:(S,N)=>At(e,S,N)},z=gu(),v=E(z);U(()=>ce(v,"items",u(f))),U(()=>{var S;return ce(v,"trigger-label",((S=n())==null?void 0:S.name)??"No workspace")});var w=E(v),C=E(w,!0);x(w);var T=O(w,2),I=E(T);I.__click=()=>{k(l,!0),k(i,!1)},x(T),x(v);var Z=O(v,2);U(()=>ce(Z,"open",u(l))),ce(Z,"header","Open workspace");var Q=O(E(Z),2);ko(Q),Q.__keydown=S=>{S.key==="Enter"&&m(),S.key==="Escape"&&k(l,!1)};var ne=O(Q,2);{var $=S=>{var N=mu(),V=E(N,!0);x(N),U(()=>fe(V,u(d))),M(S,N)};se(ne,S=>{u(d)&&S($)})}var R=O(ne,2),_=E(R);_.__click=()=>k(l,!1);var j=O(_,2);j.__click=m;var ae=E(j,!0);return x(j),x(R),x(Z),x(z),U(S=>{var N;fe(C,((N=n())==null?void 0:N.name)??"No workspace"),j.disabled=S,fe(ae,u(c)?"Opening…":"Open")},[()=>u(c)||!u(o).trim()]),Ee("menu-select",v,h),Ee("menu-open",v,()=>k(i,!0)),Ee("menu-close",v,()=>k(i,!1)),Ee("dialog-close",Z,()=>k(l,!1)),ta(Q,()=>u(o),S=>k(o,S)),M(t,z),mt(b)}Wr(["click","keydown"]);var bu=B('<button class="icon-btn stop svelte-1n46o8q" aria-label="Stop"><svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor"><rect x="5" y="5" width="14" height="14" rx="2"></rect></svg></button>'),_u=B('<div class="sidebar-wrap svelte-1n46o8q"><!></div>'),yu=B('<div class="banner-error svelte-1n46o8q"> </div>'),ku=B('<div class="app svelte-1n46o8q"><header class="topbar svelte-1n46o8q"><button class="icon-btn hamburger svelte-1n46o8q" aria-label="Toggle sidebar"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg></button> <div class="workspace svelte-1n46o8q"><!></div> <div class="topbar-actions svelte-1n46o8q"><!> <button class="icon-btn svelte-1n46o8q" aria-label="Settings"><svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33h.01a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51h.01a1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82v.01a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg></button></div></header> <div class="body svelte-1n46o8q"><!> <main class="main svelte-1n46o8q"><!> <!> <!></main></div> <!></div>');function Wo(t,e){if(new.target)return Ot({component:Wo,...t});vt(e,!0);let r=ee(null),n=ee(nt([])),s=ee(nt([])),a=ee(null),i=ee(nt([])),l=ee(null),o=ee(null),c=ee(nt([])),d=ee(nt(Zr())),f=ee(!1),h=ee(!1),m=ee(!1),b=ee(null),z=null;const v=Ge(()=>window.innerWidth<768);uc(async()=>{var P;try{k(r,await _d(),!0),k(n,await Hn(),!0),k(s,await yd(),!0),k(a,u(s).find(J=>{var de;return J.root===((de=u(r))==null?void 0:de.workspace.root)})??u(s)[0]??((P=u(r))==null?void 0:P.workspace)??null,!0),u(a)&&await C(u(a))}catch(J){k(b,`Cannot reach the harness server: ${J.message}`)}});async function w(P){if(!u(f))try{const J=await xd(P);if(k(o,J.id,!0),k(c,(J.messages??[]).map(de=>({role:de.role,content:de.content})),!0),k(d,Zr(),!0),k(m,!1),k(h,!1),k(b,null),k(l,J.agent??null,!0),J.directory){const de=u(s).find(gr=>gr.root===J.directory);de&&k(a,de,!0)}}catch(J){k(b,J.message,!0)}}async function C(P){try{k(i,await kd(P.root),!0)}catch{k(i,[],!0)}}function T(P){u(f)||(k(a,P,!0),k(o,null),k(c,[],!0),k(d,Zr(),!0),k(b,null),k(l,null),C(P))}function I(P){k(s,[...u(s).filter(J=>J.root!==P.root),P],!0),T(P)}function Z(){u(f)||(k(o,null),k(c,[],!0),k(d,Zr(),!0),k(b,null),k(h,!1))}function Q(P){var de,gr;if(u(f)||!P.trim())return;u(d).text.trim()&&(u(c).length===0||u(c)[u(c).length-1].role!=="assistant")&&k(c,[...u(c),{role:"assistant",content:u(d).text.trim()}],!0);const J={role:"user",content:P.trim()};k(c,[...u(c),J],!0),k(d,Zr(),!0),k(f,!0),k(b,null),z=Td(J.content,u(o),(de=u(r))==null?void 0:de.defaultModel,(gr=u(a))==null?void 0:gr.root,u(l)??void 0,Nt=>{if(Nt.type==="error"){k(b,Nt.data.error,!0),u(d).status="failed";return}Md(u(d),Nt.type,Nt.data)},Nt=>{k(o,Nt,!0),$()},()=>{k(f,!1),$()})}function ne(){z&&z.abort(),u(o)&&zd(u(o)).catch(()=>{})}async function $(){try{k(n,await Hn(),!0)}catch{}}function R(P){k(n,P,!0)}function _(P){w(P)}var j={$set:Pt,$on:(P,J)=>At(e,P,J)},ae=ku();nc("1n46o8q",P=>{Fl(()=>{var J;Yi.title=((J=u(r))==null?void 0:J.workspace.name)??"ask-coding-harness"??""})});var S=E(ae),N=E(S);N.__click=()=>k(h,!u(h));var V=O(N,2),A=E(V);Ko(A,{get workspaces(){return u(s)},get current(){return u(a)},onSelect:T,onOpened:I}),x(V);var D=O(V,2),$e=E(D);{var ye=P=>{var J=bu();J.__click=ne,M(P,J)};se($e,P=>{u(f)&&P(ye)})}var et=O($e,2);et.__click=()=>k(m,!u(m)),x(D),x(S);var Ke=O(S,2),je=E(Ke);{var pe=P=>{var J=_u(),de=E(J);{let gr=Ge(()=>u(n).filter(Ms=>!u(a)||Ms.directory===u(a).root)),Nt=Ge(()=>{var Ms;return(Ms=u(a))==null?void 0:Ms.name});Uo(de,{get conversations(){return u(gr)},get currentId(){return u(o)},get workspaceName(){return u(Nt)},onSelect:_,onNew:Z,onChanged:R,onClose:()=>k(h,!1),get streaming(){return u(f)}})}x(J),M(P,J)};se(je,P=>{(u(h)||!u(v))&&P(pe)})}var ie=O(je,2),F=E(ie);{var ve=P=>{var J=yu(),de=E(J,!0);x(J),U(()=>fe(de,u(b))),M(P,J)};se(F,P=>{u(b)&&!u(f)&&P(ve)})}var ot=O(F,2);Ho(ot,{get messages(){return u(c)},get turn(){return u(d)},get streaming(){return u(f)},get conversationId(){return u(o)}});var Wt=O(ot,2);{let P=Ge(()=>{var de;return(de=u(r))==null?void 0:de.defaultModel}),J=Ge(()=>!u(r));Fo(Wt,{get streaming(){return u(f)},get model(){return u(P)},get agents(){return u(i)},get currentAgent(){return u(l)},onSend:Q,onStop:ne,onAgentChange:de=>k(l,de,!0),get disabled(){return u(J)}})}x(ie),x(Ke);var Yr=O(Ke,2);{var Ce=P=>{qo(P,{get config(){return u(r)},onClose:()=>k(m,!1)})};se(Yr,P=>{u(m)&&P(Ce)})}return x(ae),M(t,ae),mt(j)}Wr(["click"]);ea(Wo,{target:document.getElementById("app")});