lowlander 0.6.0 → 0.6.1

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.
@@ -4925,3 +4925,47 @@ Client pid=2117127 disconnected
4925
4925
  Client pid=2117127 disconnected
4926
4926
  Client pid=2117127 disconnected
4927
4927
  No connections for 10 seconds, shutting down commit worker
4928
+ Commit worker started
4929
+ Client pid=2527091 initialized
4930
+ Client pid=2527091 initialized
4931
+ Client pid=2527091 initialized
4932
+ Client pid=2527091 initialized
4933
+ Client pid=2527091 initialized
4934
+ Client pid=2527091 initialized
4935
+ Client pid=2527091 initialized
4936
+ Client pid=2527091 initialized
4937
+ Client pid=2527091 initialized
4938
+ Client pid=2527091 initialized
4939
+ Client pid=2527091 initialized
4940
+ Client pid=2527091 initialized
4941
+ Client pid=2527091 initialized
4942
+ Client pid=2527091 initialized
4943
+ Client pid=2527091 initialized
4944
+ Client pid=2527091 initialized
4945
+ Processed 1 succeeded and 0 raced commits for 1 clients in 5 ms (including 5 ms for commit)
4946
+ Processed 1 succeeded and 0 raced commits for 1 clients in 25 ms (including 25 ms for commit)
4947
+ Processed 1 succeeded and 0 raced commits for 1 clients in 3 ms (including 3 ms for commit)
4948
+ Processed 1 succeeded and 0 raced commits for 1 clients in 6 ms (including 6 ms for commit)
4949
+ Processed 1 succeeded and 0 raced commits for 1 clients in 58 ms (including 57 ms for commit)
4950
+ Processed 1 succeeded and 0 raced commits for 1 clients in 6 ms (including 6 ms for commit)
4951
+ Processed 1 succeeded and 0 raced commits for 1 clients in 8 ms (including 7 ms for commit)
4952
+ Processed 1 succeeded and 0 raced commits for 1 clients in 7 ms (including 7 ms for commit)
4953
+ Processed 1 succeeded and 0 raced commits for 1 clients in 46 ms (including 46 ms for commit)
4954
+ Processed 1 succeeded and 0 raced commits for 1 clients in 11 ms (including 11 ms for commit)
4955
+ Client pid=2527091 disconnected
4956
+ Client pid=2527091 disconnected
4957
+ Client pid=2527091 disconnected
4958
+ Client pid=2527091 disconnected
4959
+ Client pid=2527091 disconnected
4960
+ Client pid=2527091 disconnected
4961
+ Client pid=2527091 disconnected
4962
+ Client pid=2527091 disconnected
4963
+ Client pid=2527091 disconnected
4964
+ Client pid=2527091 disconnected
4965
+ Client pid=2527091 disconnected
4966
+ Client pid=2527091 disconnected
4967
+ Client pid=2527091 disconnected
4968
+ Client pid=2527091 disconnected
4969
+ Client pid=2527091 disconnected
4970
+ Client pid=2527091 disconnected
4971
+ No connections for 10 seconds, shutting down commit worker
@@ -1,8 +1,8 @@
1
- var Ae=class{keyProp;tail;symbols;constructor(t){this.keyProp=t,this.tail={},this.symbols=[Symbol(0)]}add(t){if(this.symbols[0]in t)return!1;let r=1+(Math.clz32(Math.random()*4294967295)>>2);for(let l=this.symbols.length;l<r;l++)this.symbols.push(Symbol(l));let n=this.keyProp,o=t[n],i,a=this.tail;for(let l=this.symbols.length-1;l>=0;l--){let c=this.symbols[l];for(;(i=a[c])&&i[n]>o;)a=i;l<r&&(t[c]=a[c],a[c]=t)}return!0}has(t){return this.symbols[0]in t}fetchLast(){let t=this.tail[this.symbols[0]];if(t)return this.remove(t),t}isEmpty(){return this.tail[this.symbols[0]]===void 0}get(t){let r=this.keyProp,n,o=this.tail;for(let i=this.symbols.length-1;i>=0;i--){let a=this.symbols[i];for(;(n=o[a])&&n[r]>t;)o=n}return o[this.symbols[0]]?.[r]===t?o[this.symbols[0]]:void 0}*[Symbol.iterator](){let t=this.symbols[0],r=this.tail[t];for(;r;)yield r,r=r[t]}prev(t){return t[this.symbols[0]]}remove(t){if(!(this.symbols[0]in t))return!1;let r=this.keyProp,n=t[r],o,i=this.tail;for(let a=this.symbols.length-1;a>=0;a--){let l=this.symbols[a];for(;(o=i[l])&&o[r]>=n&&o!==t;)i=o;o===t&&(i[l]=o[l],delete o[l])}return o===t}clear(){let t=this.symbols[0],r=this.tail;for(;r;){let n=r[t];for(let o of this.symbols){if(!(o in r))break;delete r[o]}r=n}this.tail={}}},D,Z=0,T,S;function X(e,t,r,n){(e.sideEffects||=[]).push(t,r,n)}function Sr(e,t){for(let r=t.length-3;r>=0;r-=3){let n=t[r+1],o=t[r+2];switch(t[r]){case 0:o?e.classList.add(n):e.classList.remove(n);break;case 1:e.style[n]=o??"";break;case 2:e[n]=o;break;case 3:o==null?e.removeAttribute(n):e.setAttribute(n,o);break;case 4:e.removeEventListener(n,o);break}}}function st(e){if(!D)D=new Ae("prio"),queueMicrotask(Nt);else if(!(Z&1)&&(Z++,Z>98))throw new Error("Too many recursive updates from observes");D.add(e)}function Nt(){let e=Date.now();for(;D;){let t=D.fetchLast();if(!t)break;Z&1&&Z++,t.queueRun()}D=void 0,Z=0,e=Date.now()-e,e>9&&console.debug(`Aberdeen queue took ${e}ms`)}function Et(e){let t="";for(let r of e){if(typeof r=="string"){t+=`${r}`;continue}if(typeof r!="number")throw new Error("onEach() sort key must be a string, number or an array of such");let n="",o=Math.abs(Math.round(r)),i=r<0;for(;o>0;)n=String.fromCharCode(i?65534-o%65533:2+o%65533)+n,o=Math.floor(o/65533);t+=String.fromCharCode(128+(i?-n.length:n.length))+n}return t}function Er(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCodePoint(65535-e.charCodeAt(r));return t}var Lt=0,ke=class{prio=--Lt;remove(){let t=this.getLastNode();t&&Ee(t,this.getPrecedingNode());let r=S;S=this.el,this.delete(),S=r}},Ve=class{queueRun;prio=--Lt;constructor(t){this.queueRun=t,st(this)}},ee=class extends ke{cleaners;sideEffects;changes;constructor(t=[]){super(),this.cleaners=t}lastChild;redraw(){}getLastNode(){return pe(this.lastChild)}delete(){let t=this.cleaners;for(let n=t.length-1;n>=0;n--){let o=t[n];typeof o=="function"?o():o.delete(this)}this.cleaners.length=0;let r=this.sideEffects;r&&(this.el===S&&Sr(this.el,r),this.sideEffects=void 0),D?.remove(this),this.lastChild=void 0}onChange(t,r,n,o){this.changes||(this.changes=new Map,st(this));let i=this.changes.get(t);i||(i=new Map,this.changes.set(t,i)),i.has(r)?i.get(r)===n&&i.delete(r):i.set(r,o)}fetchHasChanges(){if(!this.changes)return!1;for(let t of this.changes.values())if(t.size>0)return delete this.changes,!0;return delete this.changes,!1}queueRun(){this.fetchHasChanges()&&(this.remove(),T=this,this.redraw(),T=void 0)}getInsertAfterNode(){return this.getLastNode()||this.getPrecedingNode()}getChildPrevSibling(){return this.lastChild}},ge=class extends ee{el;svg;prevSibling;constructor(t,r,n=!1){super(n?h.cleaners:[]),this.el=t,this.svg=r,t===h.el?(this.prevSibling=h.getChildPrevSibling(),h.lastChild=this):this.prevSibling=t.lastChild||void 0,n||h.cleaners.push(this)}getPrecedingNode(){return pe(this.prevSibling)}getChildPrevSibling(){return this.lastChild||this.prevSibling}},Ce=class extends ge{renderer;constructor(t,r,n){super(t,r),this.renderer=n,this.redraw()}redraw(){let t=h;h=this;try{this.renderer()}catch(r){ft(r,!0)}h=t}},Se=class extends ee{el=document.body;svg=!1;getPrecedingNode(){}},Ye=class extends ee{el;renderer;svg;constructor(t,r){super(),this.el=t,this.renderer=r,this.svg=t.namespaceURI==="http://www.w3.org/2000/svg";let n=T;T=this,this.redraw(),T=n,h.cleaners.push(this)}redraw(){Ce.prototype.redraw.call(this)}getPrecedingNode(){}delete(){Ee(this.getLastNode(),this.getPrecedingNode());let t=S;S=this.el,super.delete(),S=t}remove(){this.delete()}};function Ee(e,t){for(;e&&e!==t;){let r=e.previousSibling,n=rt.get(e);n&&e instanceof Element?n!==!0&&(typeof n=="function"?n(e):jr(e,n),rt.set(e,!0)):e.remove(),e=r}}function pe(e){return!e||e instanceof Node?e:e.getLastNode()||e.getPrecedingNode()}var Qe=class extends ge{renderer;result=$({value:void 0});constructor(t){super(h.el,h.svg),this.renderer=t,this.redraw()}redraw(){let t=h;h=this;try{this.result.value=this.renderer()}catch(r){ft(r,!0)}h=t}},Je=class extends ge{key;target;svg=!1;constructor(t,r,n){super(t,t.namespaceURI==="http://www.w3.org/2000/svg"),this.key=r,this.target=n,this.redraw()}redraw(){let t=h;h=this,M(this.el,this.key,this.target.value),h=t}},Xe=class extends ke{renderer;makeSortKey;parentElement=h.el;prevSibling;target;byIndex=new Map;sortedSet=new Ae("sortKey");changedIndexes=new Map;constructor(t,r,n){super(),this.renderer=r,this.makeSortKey=n;let o=this.target=t[p]||t;if(w(o,P,this),this.prevSibling=h.getChildPrevSibling(),h.lastChild=this,h.cleaners.push(this),o instanceof Array)for(let i=0;i<o.length;i++)new ue(this,i,!1);else for(let i of o instanceof Map?o.keys():o instanceof Set?o.values():Object.keys(o))new ue(this,i,!1)}getPrecedingNode(){return pe(this.prevSibling)}onChange(t,r,n,o){(!(t instanceof Array)||typeof r=="number")&&(this.changedIndexes.has(r)?this.changedIndexes.get(r)===n&&this.changedIndexes.delete(r):(this.changedIndexes.set(r,o),st(this)))}queueRun(){let t=this.changedIndexes;this.changedIndexes=new Map;for(let r of t.keys()){let n=this.byIndex.get(r);n&&n.remove(),(this.target instanceof Set||this.target instanceof Map?this.target.has(r):r in this.target)?new ue(this,r,!0):this.byIndex.delete(r)}T=void 0}delete(){for(let t of this.byIndex.values())t.delete();D?.remove(this),this.byIndex.clear(),setTimeout(()=>{this.sortedSet.clear()},1)}getLastNode(){for(let t of this.sortedSet){let r=t.getActualLastNode();if(r)return r}}},ue=class extends ee{parent;itemIndex;sortKey;el;svg;constructor(t,r,n){super(),this.parent=t,this.itemIndex=r,this.el=t.parentElement,this.svg=h.svg,this.parent.byIndex.set(this.itemIndex,this),this.lastChild=this,n&&(T=this),this.redraw()}getPrecedingNode(){this.parent.sortedSet.add(this);let t=this.parent.sortedSet.prev(this);return t?pe(t.lastChild):this.parent.getPrecedingNode()}getLastNode(){return this.getPrecedingNode()}getActualLastNode(){let t=this.lastChild;for(;t&&t!==this;){if(t instanceof Node)return t;let r=t.getLastNode();if(r)return r;t=t.getPrecedingNode()}}queueRun(){if(h!==re&&Ot(4),!this.fetchHasChanges())return;if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&Ee(r,this.getPrecedingNode())}let t=S;S=this.el,this.delete(),S=t,this.lastChild=this,T=this,this.redraw(),T=void 0}redraw(){let t,r=this.parent.target,n=this.itemIndex;r instanceof Set?t=n=$(n):r instanceof Map?(t=$(r.get(n)),n=$(n)):t=$(r[n]);let o=h;h=this;let i;try{this.parent.makeSortKey?i=this.parent.makeSortKey(t,n):i=n,i instanceof Array?i=Et(i):typeof i!="string"&&i!=null&&(i=Et([i])),this.sortKey!==i&&(this.parent.sortedSet.remove(this),this.sortKey=i),i!=null&&this.parent.renderer(t,n)}catch(a){ft(a,i!=null)}h=o}getInsertAfterNode(){return this.sortKey==null&&Ot(1),pe(this.lastChild)}remove(){if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&Ee(r,this.getPrecedingNode()),this.parent.sortedSet.remove(this),this.sortKey=void 0}let t=S;S=this.el,this.delete(),S=t}};function F(e,t){if(e!==h.el){e.appendChild(t);return}let r=h.el,n=h.getInsertAfterNode();r.insertBefore(t,n?n.nextSibling:r.firstChild),h.lastChild=t}var re=new Se,h=re;function ot(e){let t=h;h=new Se;try{return e()}finally{h=t}}var P=Symbol("any"),p=Symbol("target"),N=Symbol("mapSize"),Ze=new WeakMap,be=0;function w(e,t,r=h){if(r===re||be)return;let n=Ze.get(e);if(n||Ze.set(e,n=new Map),t!==P&&n.get(P)?.has(r))return;let o=n.get(t);o||n.set(t,o=new Set),!o.has(r)&&(o.add(r),r===h?h.cleaners.push(o):h.cleaners.push(()=>{o.delete(r)}))}function ne(e,t,r){if(!e||typeof e!="object")throw new Error("A.onEach requires an object");e=e[p]||e,new Xe(e,t,r)}function et(e){for(let t of Object.keys(e))return!1;return!0}var y=Symbol("empty");function $e(e){let t=e[p]||e,r=h;if(t instanceof Array)return w(t,"length",(o,i,a)=>{!i!=!a&&r.onChange(t,y,!i,!a)}),!t.length;if(t instanceof Map||t instanceof Set)return w(t,N,(o,i,a)=>{!i!=!a&&r.onChange(t,y,!i,!a)}),!t.size;let n=et(t);return w(t,P,(o,i,a)=>{if(i===y!=(a===y)){let l=et(t);l!==n&&(r.onChange(t,y,l,n),n=l)}}),n}function Rr(e){if(e instanceof Array)return Ie(e,"length");if(e instanceof Map||e instanceof Set)return Ie(e,"size");let t=e[p]||e,r=0;for(let o of Object.keys(t))t[o]!==void 0&&r++;let n=Oe(r);return w(t,P,(o,i,a)=>{a===i||(a===y?n.value=++r:i===y&&(n.value=--r))}),n}function Ir(e,t,r,n){if(r===n&&r!==void 0)return;let o=Ze.get(e);if(o!==void 0)for(let i of[t,P]){let a=o.get(i);if(a)for(let l of a)typeof l=="function"?l(t,r,n):l.onChange(e,t,r,n)}}var x=Ir,Mr={get(e,t){return t===p?e:(w(e,t),$(e[t]))},set(e,t,r){typeof r=="object"&&r&&(r=r[p]||r);let n=e.hasOwnProperty(t)?e[t]:y;return r!==n&&(e[t]=r,x(e,t,r,n)),!0},deleteProperty(e,t){let r=e.hasOwnProperty(t)?e[t]:y;return delete e[t],x(e,t,y,r),!0},has(e,t){return w(e,t),e.hasOwnProperty(t)},ownKeys(e){return w(e,P),Reflect.ownKeys(e)}};function Tr(e,t,r){typeof r=="object"&&r&&(r=r[p]||r);let n=e[t];if(n===void 0&&!e.hasOwnProperty(t)&&(n=y),r!==n){let o=e.length;if(t==="length"){e.length=r;for(let i=r;i<o;i++)x(e,i,y,e[i])}else{if(typeof t=="string"){let i=0|t;String(i)===t&&i>=0&&(t=i)}e[t]=r,x(e,t,r,n)}e.length!==o&&x(e,"length",e.length,o)}return!0}var Or={get(e,t){if(t===p)return e;if(typeof t=="string"){let r=0|t;String(r)===t&&r>=0&&(t=r)}return w(e,t),$(e[t])},set:Tr,deleteProperty(e,t){if(typeof t=="string"){let n=0|t;String(n)===t&&n>=0&&(t=n)}let r=e[t];return r===void 0&&!e.hasOwnProperty(t)&&(r=y),delete e[t],x(e,t,y,r),!0}};function de(e){return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?t:{done:!1,value:$(t.value)}}}}function tt(e){return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?t:{done:!1,value:[$(t.value[0]),$(t.value[1])]}}}}function K(e){return typeof e=="object"&&e&&e[p]||e}var Rt={get(e){let t=this[p];return e=K(e),w(t,e),$(t.get(e))},set(e,t){let r=this[p];e=K(e),t=K(t);let n=r.get(e);if(n===void 0&&!r.has(e)&&(n=y),t!==n){let o=r.size;r.set(e,t),x(r,e,t,n),x(r,N,r.size,o)}return this},delete(e){let t=this[p];e=K(e);let r=t.get(e);r===void 0&&!t.has(e)&&(r=y);let n=t.delete(e);return n&&(x(t,e,y,r),x(t,N,t.size,t.size+1)),n},clear(){let e=this[p],t=e.size;for(let r of e.keys())x(e,r,void 0,e.get(r));e.clear(),x(e,N,0,t)},has(e){let t=this[p];return e=K(e),w(t,e),t.has(e)},keys(){let e=this[p];return w(e,P),de(e.keys())},values(){let e=this[p];return w(e,P),de(e.values())},entries(){let e=this[p];return w(e,P),tt(e.entries())},[Symbol.iterator](){let e=this[p];return w(e,P),tt(e[Symbol.iterator]())}},It={add(e){let t=this[p];if(e=K(e),!t.has(e)){let r=t.size;t.add(e),x(t,e,e,y),x(t,N,t.size,r)}return this},delete(e){let t=this[p];if(e=K(e),!t.has(e))return!1;let r=t.size;return t.delete(e),x(t,e,y,e),x(t,N,t.size,r),!0},clear(){let e=this[p],t=e.size;if(t){for(let r of e.values())x(e,r,y,r);e.clear(),x(e,N,0,t)}},has(e){let t=this[p];return e=K(e),w(t,e),t.has(e)},keys(){let e=this[p];return w(e,P),de(e.keys())},values(){let e=this[p];return w(e,P),de(e.values())},entries(){let e=this[p];return w(e,P),tt(e.entries())},[Symbol.iterator](){let e=this[p];return w(e,P),de(e[Symbol.iterator]())}},Nr={get(e,t){return t===p?e:Rt.hasOwnProperty(t)?Rt[t]:t==="size"?(w(e,N),e.size):e[t]}},Lr={get(e,t){return t===p?e:It.hasOwnProperty(t)?It[t]:t==="size"?(w(e,N),e.size):e[t]}},Mt=new WeakMap;function $(e){if(typeof e!="object"||e===null||e[p]!==void 0||e[I])return e;let t=Mt.get(e);if(t)return t;let r;return e instanceof Array?r=Or:e instanceof Map?r=Nr:e instanceof Set?r=Lr:r=Mr,t=new Proxy(e,r),Mt.set(e,t),t}function Oe(e){if(e instanceof Promise){let t=$({busy:!0});return e.then(r=>{t.value=r,t.busy=!1}).catch(r=>{t.error=r,t.busy=!1}),t}return $(typeof e=="object"&&e!==null?e:{value:e})}function at(e){return e&&(e[p]||e)}var rt=new WeakMap;function jr(e,t){let r=t.split(".").filter(n=>n);e.classList.add(...r),setTimeout(()=>e.remove(),2e3)}function qr(e,t,r){return arguments.length>2?jt(e,t,r,0):lt(e,t,0)}function jt(e,t,r,n){let o=Ft(e,t);return r===o?!1:typeof o=="object"&&o!==null&&typeof r=="object"&&r!==null&&o.constructor===r.constructor?lt(o,r,n):(r=nt(r),e instanceof Map?e.set(t,r):e[t]=nt(r),!0)}function zr(e,t,r){return arguments.length>2?jt(e,t,r,Re):lt(e,t,Re)}function lt(e,t,r){let n=e[p];return n&&(e=n,r|=B),n=t[p],n&&(t=n,h!==re&&!be&&(r|=H)),Pe(e,t,r)}function Pe(e,t,r){r&H&&w(t,P);let n=!1;if(t instanceof Array&&e instanceof Array){let o=e.length,i=t.length;for(let a=0;a<i;a++){let l=e[a];l===void 0&&!e.hasOwnProperty(a)&&(l=y);let c=t[a];if(c===void 0&&!t.hasOwnProperty(a))delete e[a],r&B&&x(e,a,y,l),n=!0;else if(l!==c){if(typeof c=="object"&&c!==null){if(typeof l=="object"&&l!==null&&c.constructor===l.constructor&&!(I in c)){n=Pe(l,c,r)||n;continue}c=me(c,r&H)}e[a]=c,r&B&&x(e,a,c,l),n=!0}}if(i!==o){if(r&B){for(let a=i;a<o;a++){let l=e[a];delete e[a],x(e,a,y,l)}e.length=i,x(e,"length",i,o)}else e.length=i;n=!0}}else if(t instanceof Map&&e instanceof Map){for(let o of t.keys()){let i=t.get(o),a=e.get(o);if(a===void 0&&!e.has(o)&&(a=y),a!==i){if(typeof i=="object"&&i!==null){if(typeof a=="object"&&a!==null&&i.constructor===a.constructor&&!(I in i)){n=Pe(a,i,r)||n;continue}i=me(i,r&H)}e.set(o,i),r&B&&x(e,o,i,a),n=!0}}if(!(r&Re)){for(let o of e.keys())if(!t.has(o)){let i=e.get(o);e.delete(o),r&B&&x(e,o,y,i),n=!0}}}else if(t.constructor===e.constructor){for(let o of Object.keys(t)){let i=t[o],a=e.hasOwnProperty(o)?e[o]:y;if(a!==i){if(typeof i=="object"&&i!==null){if(typeof a=="object"&&a!==null&&i.constructor===a.constructor&&!(I in i)){n=Pe(a,i,r)||n;continue}i=me(i,r&H)}e[o]=i,r&B&&x(e,o,i,a),n=!0}}if(!(r&Re)){for(let o of Object.keys(e))if(!t.hasOwnProperty(o)){let i=e[o];delete e[o],r&B&&i!==void 0&&x(e,o,y,i),n=!0}}}else throw new Error(`Incompatible or non-object types: ${t?.constructor?.name||typeof t} vs ${e?.constructor?.name||typeof e}`);return n}var Re=1,H=32,B=64,I=Symbol("OPAQUE"),_r=I;Promise.prototype[I]=!0;Date.prototype[I]=!0;Node.prototype[I]=!0;if(typeof Temporal<"u")for(let e of"Duration Instant PlainDate PlainDateTime PlainMonthDay PlainTime PlainYearMonth ZonedDateTime".split(" ")){let t=Temporal[e];t&&(t.prototype[I]=!0)}var he=$({});function Ur(e=1,t="rem"){for(let r=0;r<=12;r++)he[r]=2**(r-3)*e+t}var Br=/(\burl\([^)]*\))|("[^"]*")|(^| )\$([\w-]+)/g,qt=/^\d/;function zt(e){return e.indexOf("$")<0?e:e.replace(Br,(t,r,n,o,i)=>{if(r||n)return t;let a=qt.test(i)?`m${i}`:i;return`${o}var(--${a})`})}var we;function Kr(){if(!we){if(typeof window>"u"||!window.matchMedia)return!1;let e=window.matchMedia("(prefers-color-scheme: dark)");we=Oe({value:e.matches}),e.addEventListener("change",()=>we.value=e.matches)}return we.value}function me(e,t){if(I in e)return e;if(t&H&&w(e,P),e instanceof Array)return e.map(n=>Fe(n,t));if(e instanceof Map){let n=new Map;for(let[o,i]of e)n.set(o,Fe(i,t));return n}let r=Object.create(Object.getPrototypeOf(e));for(let n of Object.keys(e))r[n]=Fe(e[n],t);return r}function Fe(e,t){return typeof e=="object"&&e!==null?me(e,t):e}function nt(e){if(typeof e!="object"||e===null)return e;let t=0,r=e[p];return r&&(e=r,h!==re&&!be&&(t=H)),me(e,t)}var Dr={get(e,t){if(t===p)return Ie(at(e.proxy),e.index);if(t==="value")return e.proxy[e.index]},set(e,t,r){return t==="value"?(e.proxy[e.index]=r,!0):!1}};function Ie(e,t){return new Proxy({proxy:e,index:t},Dr)}function Gr(e,t){let r,n,o=e.getAttribute("type"),i=at(t).value;o==="checkbox"?(i===void 0&&(t.value=e.checked),r=()=>{e.checked=t.value},n=()=>{t.value=e.checked}):o==="radio"?(i===void 0&&e.checked&&(t.value=e.value),r=()=>{e.checked=t.value===e.value},n=()=>{e.checked&&(t.value=e.value)}):(n=()=>{t.value=o==="number"||o==="range"?e.value===""?null:+e.value:e.value},i===void 0&&n(),r=()=>{e.value=t.value,e.tagName==="SELECT"&&e.value!=t.value&&new Ve(()=>e.value=t.value)}),Gt(r),e.addEventListener("input",n),L(()=>{e.removeEventListener("input",n)})}var He=/\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|\[(.+?)\]\((.+?)\)/g,Me={create:(e,t)=>{if(h===T)if(typeof t=="function")t(e);else{let r=t.split(".").filter(n=>n);e.classList.add(...r),(async()=>(e.offsetHeight,e.classList.remove(...r)))()}},destroy:(e,t)=>{rt.set(e,t)},html:(e,t)=>{if(e===h.el&&!e.firstChild)e.innerHTML=`${t}`;else{let r=document.createElement(h.el.tagName);for(r.innerHTML=`${t}`;r.firstChild;)F(e,r.firstChild)}},text:(e,t)=>{F(e,document.createTextNode(t))},rich:(e,t)=>{let r=0,n,o=String(t);for(He.lastIndex=0;(n=He.exec(o))!==null;){n.index>r&&F(e,document.createTextNode(o.slice(r,n.index)));let i;if(n[1]!==void 0)i=document.createElement("strong"),i.textContent=n[1];else if(n[2]!==void 0)i=document.createElement("em"),i.textContent=n[2];else if(n[3]!==void 0)i=document.createElement("code"),i.textContent=n[3];else{let a=document.createElement("a");a.textContent=n[4],a.href=n[5],i=a}F(e,i),r=He.lastIndex}r<o.length&&F(e,document.createTextNode(o.slice(r)))}};function Wr(){Me.create=Me.destroy=()=>{}}function k(...e){let t=h.el,r=h.svg,n=e.length;for(let o=0;o<n;o++){let i=e[o];if(!(i==null||i===!1))if(typeof i=="string"){let a=i.length,l=0;for(let c=0;c<a;c=l+1){l=J(i," .=:#",c);let m=i[l];if(m===":"){let d="$"+i.substring(c,l);if(l+1>=a){M(t,d,e[++o]);break}if(i[l+1]===" "){let f=J(i,";",l+2),u=i.substring(l+2,f).trim();M(t,d,u),l=f}else{let f=J(i," ",l+1),u=i.substring(l+1,f);M(t,d,u),l=f}}else if(m==="="){let d=i.substring(c,l);if(l+1>=a){M(t,d,e[++o]);break}let f=i[l+1];if(f==='"'||f==="'"||f==="`"){let u=J(i,f,l+2),g=i.substring(l+2,u);M(t,d,g),l=u}else{let u=J(i," ",l+1),g=i.substring(l+1,u);M(t,d,g),l=u}}else{if(l>c){let d=i.substring(c,l);r||=d==="svg";let f=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d);F(t,f),t=f}if(m==="#"){let d=l+1<a?i.substring(l+1):e[++o];M(t,"text",d);break}if(m==="."){let d=J(i," #=.",l+1);if(i[d]==="="&&d+1>=a)M(t,i.substring(l,d),e[++o]),l=d;else{let u=i.substring(l+1,d)||e[++o];t.classList.contains(u)||(t===h.el&&X(h,0,u,!1),t.classList.add(u)),l=d-1}}}}}else if(typeof i=="object")if(i.constructor!==Object)if(i instanceof Node)F(t,i),i instanceof Element&&(t=i,r=i.namespaceURI==="http://www.w3.org/2000/svg");else throw new Error(`Unexpected argument: ${i}`);else for(let a of Object.keys(i))M(t,a,i[a]);else if(typeof i=="function")new Ce(t,r,i);else throw new Error(`Unexpected argument: ${i}`)}return t}function J(e,t,r){if(t.length===1){let o=e.indexOf(t,r);return o>=0?o:e.length}let n=e.length;for(let o=r;o<n;o++)if(t.indexOf(e[o])>=0)return o;return n}var _t=0;function Fr(e){let t=`.AbdStl${++_t}`,r=typeof e=="string"?it(e,t):Te(e,t);if(r){let n=Ut++;te[n]=r,L(()=>delete te[n])}return t}var te=Oe({}),Ut=0;function Tt(e,t){let r=[];for(let n of e.split(","))for(let o of t.split(","))r.push(o.includes("&")?o.trim().replace(/&/g,n):`${n} ${o.trim()}`.trim());return r.join(",")}function Te(e,t){let r="";for(let[n,o]of Object.entries(e))o&&typeof o=="object"?n.startsWith("@")?r+=`${n}{
2
- ${Te(o,t)}}
3
- `:r+=Te(o,Tt(t,n)):typeof o=="string"&&(n.startsWith("@")?r+=`${n}{
4
- ${it(o,t)}}
5
- `:r+=it(o,Tt(t,n)));return r}var Hr=/-([a-z])/g;function Vr(e){return e.replace(Hr,(t,r)=>r.toUpperCase())}var Yr=/^[a-zA-Z-]+$/;function it(e,t){let r="";for(let n=0,o=e.length;n<o;){for(;e[n]===" ";)n++;if(n>=o)break;let i=e.indexOf(":",n);if(i===-1)throw new Error(`Trailing data in style string: "${e.substring(n)}"`);let a=e.substring(n,i);if(!Yr.test(a))throw new Error(`Invalid CSS key: "${a}" in style string: "${e}"`);n=i+1;let l;if(e[n]===" "){n++;let d=e.indexOf(";",n);l=e.substring(n,d===-1?o:d).trim(),n=d===-1?o:d+1}else{let d=e.indexOf(" ",n);l=e.substring(n,d===-1?o:d),n=d===-1?o:d}let c=zt(l),m=Bt[a]||a;r+=typeof m=="string"?`${m}:${c};`:m.map(d=>`${d}:${c};`).join("")}return r?`${t}{${r}}
6
- `:""}function Qr(e){let t=Te(e,"");if(t){let r=Ut++;te[r]=t,L(()=>delete te[r])}}var Bt={m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mh:["margin-left","margin-right"],mv:["margin-top","margin-bottom"],p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",ph:["padding-left","padding-right"],pv:["padding-top","padding-bottom"],w:"width",h:"height",bg:"background",fg:"color",r:"border-radius"};function M(e,t,r){if(typeof r=="object"&&r!==null&&r[p])t==="bind"?Gr(e,r):new Je(e,t,r);else if(t[0]==="."){let n=t.substring(1).split("."),o=e.classList,i=!!r;if(e===h.el)for(let a of n){let l=o.contains(a);l!==i&&X(h,0,a,l)}i?o.add(...n):o.remove(...n)}else if(t[0]==="$"){t=t.substring(1);let n=r==null||r===!1?"":typeof r=="string"?zt(r):String(r),o=Bt[t]||t,i=e.style,a=e===h.el,l=typeof o=="string"?[o]:o;for(let c of l){let m=Vr(c);a&&X(h,1,m,i[m]),i[m]=n}}else r==null||(t in Me?Me[t](e,r):typeof r=="function"?(e.addEventListener(t,r),e===h.el&&X(h,4,t,r)):r===!0||r===!1||t==="value"||t==="selectedIndex"?(e===h.el&&X(h,2,t,e[t]),e[t]=r):(e===h.el&&X(h,3,t,e.getAttribute(t)),e.setAttribute(t,r)))}function Kt(e){return console.error("Error while in Aberdeen render:",e),!0}var Dt=Kt;function Jr(e){Dt=e||Kt}function L(e){h.cleaners.push(e)}function Gt(e){return new Qe(e).result}function Wt(e,t){new Ye(e,t)}function Xr(){re.remove(),_t=0}function Ft(e,t){be++;try{return arguments.length===1?e():e instanceof Map?e.get(t):e[t]}finally{be--}}function Zr(e,t){let r;return e instanceof Array?r=$([]):e instanceof Map?r=$(new Map):r=$({}),ne(e,(n,o)=>{let i=t(n,o);i!==void 0&&(r instanceof Map?(r.set(o,i),L(()=>{r.delete(o)})):(r[o]=i,L(()=>{delete r[o]})))}),r}function en(e,t){let r=$({});return ne(e,(n,o)=>{let i=t(n,o);if(i){for(let a of Object.keys(i))r[a]=i[a];L(()=>{for(let a of Object.keys(i))delete r[a]})}}),r}function tn(e,t){let r={},n=$(r);return ne(e,(o,i)=>{let a=t(o,i);if(a!=null){let l=a instanceof Array?a:[a];if(l.length){for(let c of l)r[c]?n[c][i]=o:n[c]={[i]:o};L(()=>{for(let c of l)delete n[c][i],et(r[c])&&delete n[c]})}}}),n}function rn(e){let t=ve;ve||=new Set;try{Ht(e,ve)}finally{ve=t}return e}var ve;function Ht(e,t){if(e&&typeof e=="object"){let r=e.constructor.name||"unknown object";if(t.has(e)){k(`#<${r}: circular reference>`);return}t.add(e),L(()=>t.delete(e));let n=e[ct];n!==void 0?typeof n=="function"?n.call(e):k(`#${n}`):k(`#<${r}>`,"ul",()=>{ne(e,(o,i)=>{k("li",()=>{e instanceof Array||k(`#${JSON.stringify(i)}: `),Ht(o,t)})})})}else k(e===void 0?"#undefined":"#"+JSON.stringify(e))}var ct=Symbol("CUSTOM_DUMP");Date.prototype[ct]=function(){k("#<Date> "+this.toISOString())};function Ot(e){throw new Error(`Aberdeen internal error ${e}`)}function ft(e,t){try{Dt(e)===!1&&(t=!1)}catch(r){console.error(r)}try{t&&k("div.aberdeen-error#Error")}catch{}}typeof document<"u"&&ot(()=>{k(()=>{$e(te)&&$e(he)||Wt(document.head,()=>{k("style.abd",()=>{ne(te,e=>{k("#",e)}),k(()=>{if($e(he))return;let e=":root{";for(let[t,r]of Object.entries(he)){let n=qt.test(String(t))?`m${t}`:t;e+=`--${n}:${r};`}e+=`}
7
- `,k("#",e)})})})})});var s=Object.assign(k,{clean:L,clone:nt,copy:qr,count:Rr,cssVars:he,CUSTOM_DUMP:ct,darkMode:Kr,derive:Gt,disableCreateDestroy:Wr,dump:rn,insertCss:Fr,insertGlobalCss:Qr,invertString:Er,isEmpty:$e,map:Zr,merge:zr,mount:Wt,multiMap:en,OPAQUE:I,NO_COPY:_r,onEach:ne,partition:tn,peek:Ft,proxy:Oe,ref:Ie,runQueue:Nt,setErrorHandler:Jr,setSpacingCssVars:Ur,unmountAll:Xr,unproxy:at});var ut="staffa:darkMode",Vt=s.proxy({value:nn()});function nn(){try{let e=localStorage.getItem(ut);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function dt(e){Vt.value=e;try{e===void 0?localStorage.removeItem(ut):localStorage.setItem(ut,e?"dark":"light")}catch{}}function Ne(e=!1){let t=Vt.value;return t===void 0&&!e?s.darkMode():t}s(()=>{Ne()?s.insertGlobalCss({":root":"--s-primary:#8b7bff --s-secondary:#ef7fd0 --s-danger:#ff6b6b --s-success:#46d39a --s-warning:#fbbf24 --s-neutral:#3c4352 --s-page:#0e1015 --s-panel:#181b22 --s-raised:#222632 --s-ink:#e8eaf0 --s-on-accent:#0c0a14 --s-focus:rgba(139,123,255,0.45) --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 34px rgba(0,0,0,0.5);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#6db3ff"}):s.insertGlobalCss({":root":"--s-primary:#6c5ce7 --s-secondary:#d6459e --s-danger:#e23b3b --s-success:#1f9d6b --s-warning:#d97706 --s-neutral:#c7ccda --s-page:#f3f4f8 --s-panel:#ffffff --s-raised:#eceef4 --s-ink:#1b1e27 --s-on-accent:#0c0a14 --s-focus:rgba(108,92,231,0.35) --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 30px rgba(20,24,40,0.13);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#2563eb"})});s.setSpacingCssVars();s.insertGlobalCss({":root":"--s-gradient: linear-gradient(135deg, $s-primary, $s-secondary); --s-glow: 0 8px 24px color-mix(in srgb, $s-primary 32%, transparent); --s-page-bg: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, $s-secondary, transparent 86%), transparent 56%), radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, $s-primary, transparent 87%), transparent 56%), $s-page;",":root, .s-s.base":"--s-a:$s-ink --s-b:$s-page",".s-s.base":"background: $s-page-bg;",".s-s.panel":"--s-a:$s-ink --s-b:$s-panel",".s-s.raised":"--s-a:$s-ink --s-b:$s-raised",".s-s.neutral":"--s-a:$s-ink --s-b:$s-neutral",".s-s.primary":"--s-a:$s-on-accent --s-b:$s-primary",".s-s.secondary":"--s-a:$s-on-accent --s-b:$s-secondary",".s-s.danger":"--s-a:$s-on-accent --s-b:$s-danger",".s-s.success":"--s-a:$s-on-accent --s-b:$s-success",".s-s.warning":"--s-a:$s-on-accent --s-b:$s-warning",".s-s.gradient":"--s-a:$s-on-accent --s-b:$s-primary",":root, .s-s":"--s-fg:$s-a --s-bg:$s-b --s-fg-muted: color-mix(in oklab, $s-fg, $s-bg 42%); --s-fg-faint: color-mix(in oklab, $s-fg, $s-bg 64%); --s-border: color-mix(in oklab, $s-fg, $s-bg 82%); --s-border-strong: color-mix(in oklab, $s-fg, $s-bg 68%); scrollbar-width:thin scrollbar-color: $s-border-strong transparent; background:$s-bg color:$s-fg",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover":"background:$s-fg-faint background-clip:padding-box",".s-s.tonal":"--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent);",".s-s.outlined":"--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg);",".s-s.filled":"--s-fg:$s-a --s-bg:$s-b background:$s-bg;",".s-s.gradient:not(.tonal):not(.outlined)":"background: $s-gradient;",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-accent:$s-primary",".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient":"--s-accent:$s-fg --s-link:$s-fg"});s.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased",a:"color: $s-link; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select":"font:inherit color:inherit","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-fg, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-fg, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-border;","::placeholder":"color: $s-fg-faint; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-fg-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"}});s.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let e=document.documentElement;e.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("s-preload")))}var sn="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";s.insertGlobalCss({[`${sn}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-fg-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-border; padding-left: $3; fg: $s-fg-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-border; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-border-strong;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-fg-muted font-size:0.9em margin-top:$1 text-align:center"});var on=0;function j(e="s"){return`${e}-${++on}`}function b(e,...t){e!=null&&(typeof e=="function"?e(...t):s("rich=",e))}s.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-fg user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-fg-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color:$s-border-strong","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&:disabled":"opacity:0.6 cursor:not-allowed","&[aria-invalid=true]":"border-color:$s-danger"}});function G(e,t){let r=e.id??j("field"),n=()=>!!e.error;s("div.s-field",e.attrs,()=>{s(()=>{e.label!=null&&s(`label for=${r}`,()=>{b(e.label),e.required&&s("span.s-req aria-hidden=true #*")})}),t(r,n),s(()=>{e.help!=null&&!e.error&&s("div.s-help",()=>b(e.help))}),s(()=>{e.error&&s("div.s-error role=alert #",e.error)})})}function ie(e,t,r,n){s(`id=${t}`),e.name&&s(`name=${e.name}`),s(()=>{e.disabled&&s("disabled=true")}),s(()=>{e.required&&s("aria-required=true")}),s(()=>s("aria-invalid=",r()?"true":"false")),n&&s("bind=",n)}s.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color:$s-border-strong","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em bg:$s-raised border: 1px solid $s-border; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-fg background:$s-border",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0 bg:$s-panel border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-fg-muted"}});function an(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function Yt(e){let t=j("ac-menu"),r=s.proxy({query:"",open:!1,active:0}),n=()=>(typeof e.options=="function"?e.options():e.options).map(an),o=()=>{let f=e.bind?.value;return f==null||f===""?[]:Array.isArray(f)?f:[f]},i=f=>n().find(u=>u.value===f)?.label??f;if(!e.multi){let f=e.bind?s.peek(e.bind,"value"):void 0;typeof f=="string"&&f&&(r.query=s.peek(()=>i(f)))}let a=()=>{let f=new Set(o()),u=n();e.multi&&(u=u.filter(v=>!f.has(v.value)));let g=r.query.trim().toLowerCase();return g&&(u=u.filter(v=>v.label.toLowerCase().includes(g))),u},l=(f,u)=>{if(e.multi){let g=Array.isArray(e.bind?.value)?[...e.bind.value]:[];g.includes(f)||g.push(f),e.bind&&(e.bind.value=g),r.query=""}else e.bind&&(e.bind.value=f),r.query=i(f),r.open=!1;r.active=0,u?.focus()},c=f=>{if(!e.bind)return;let u=e.bind.value??[];e.bind.value=u.filter(g=>g!==f)};G(e,(f,u)=>{s("div.s-ac",e.inputAttrs,()=>{s(()=>s("aria-invalid=",u()?"true":"false"));let g;s("div.s-control",()=>{s("click=",()=>g?.focus()),s(()=>{if(e.multi)for(let v of o())s("span.s-chip",()=>{s("span #",s.peek(()=>i(v))),s("button type=button aria-label=",`Remove ${v}`,()=>{s("#\xD7"),s("click=",A=>{A.stopPropagation(),c(v),g?.focus()})})})}),g=s("input type=text role=combobox autocomplete=off",()=>{s(`id=${f} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&s("placeholder=",e.placeholder),e.disabled&&s("disabled=true"),e.required&&s("aria-required=true"),s("bind=",s.ref(r,"query")),s(()=>s("aria-expanded=",r.open?"true":"false")),s(()=>{let A=a()[r.active];s("aria-activedescendant=",r.open&&A?`${t}-opt-${r.active}`:"")}),s("input=",()=>{r.open=!0,r.active=0}),s("focus=",()=>{r.open=!0}),s("blur=",()=>{setTimeout(()=>d(),150)}),s("keydown=",v=>m(v,g))})}),s(()=>{if(!r.open)return;let v=a(),A=r.query.trim(),St=e.allowCustom!==!1&&A!==""&&!v.some(Q=>Q.label.toLowerCase()===A.toLowerCase());s("ul.s-menu role=listbox",`id=${t}`,()=>{v.forEach((Q,We)=>{s("li.s-option role=option",`id=${t}-opt-${We}`,()=>{s(()=>s("aria-selected=",r.active===We?"true":"false")),s("#",Q.label),s("mousedown=",Cr=>Cr.preventDefault()),s("click=",()=>l(Q.value,g)),s("mousemove=",()=>{r.active=We})})}),St&&s("li.s-option.s-add role=option",()=>{s("#",`Add "${A}"`),s("mousedown=",Q=>Q.preventDefault()),s("click=",()=>l(A,g))}),v.length===0&&!St&&s("li.s-empty #No matches")})}),s(()=>{if(e.name)if(e.multi)for(let v of o())s("input type=hidden",()=>{s("name=",e.name),s("value=",v)});else s("input type=hidden",()=>{s("name=",e.name),s("value=",o()[0]??"")})})})});function m(f,u){let g=a(),v=g.length-1;if(f.key==="ArrowDown")f.preventDefault(),r.open=!0,r.active=Math.min(v,r.active+1);else if(f.key==="ArrowUp")f.preventDefault(),r.active=Math.max(0,r.active-1);else if(f.key==="Enter"){f.preventDefault();let A=g[r.active];A?l(A.value,u):e.allowCustom!==!1&&r.query.trim()?l(r.query.trim(),u):r.open&&(r.open=!1)}else if(f.key==="Escape")r.open=!1,e.multi||(r.query=i(o()[0]??""));else if(f.key==="Backspace"&&e.multi&&r.query===""){let A=o();A.length&&c(A[A.length-1])}}function d(){r.open=!1,e.multi?r.query="":e.allowCustom!==!1&&r.query.trim()?l(r.query.trim()):r.query=i(o()[0]??"")}}s.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column border: 1px solid $s-border; r: $s-radius-lg; overflow:hidden box-shadow: $s-shadow;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600","> footer":"display:flex align-items:center gap:$2 padding: $2 $3; border-top: 1px solid $s-border;","> div":"p:$3 gap:$3"}});function Qt(e={}){let t=typeof e=="function"?{content:e}:e;s("section.s-box.s-s.panel",t.attrs,()=>{s(()=>{t.header!=null&&s("header.s-s.raised",t.headerAttrs,()=>b(t.header))}),s("div",t.contentAttrs,()=>{t.content&&t.content()}),s(()=>{t.footer!=null&&s("footer.s-s.raised",t.footerAttrs,()=>b(t.footer))})})}s.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none border: 1px solid $s-border; r: $s-radius; padding: 0.5em 1em; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus;","&:disabled, &[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none filter:saturate(0.6)","&:hover":"filter: brightness(1.08); transform: translateY(-1px)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-b 26%, transparent);","&.gradient:not(.tonal):not(.outlined)":"border:0 box-shadow: $s-glow;","&.gradient:not(.tonal):not(.outlined):hover":"filter: brightness(1.06); box-shadow: 0 10px 28px color-mix(in srgb, $s-primary 42%, transparent); transform: translateY(-1px);","&:active:not(:disabled):not([aria-disabled=true])":"transform: translateY(1px)","&.small, .small > &":"padding: 0.32em 0.7em; font-size:0.85em","&.large, .large > &":"padding: 0.66em 1.3em; font-size:1.1em"}});var ln=/\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;function R(e={}){let t=typeof e=="string"?{text:e}:typeof e=="function"?{content:e}:e,r=t.href!=null?"a":"button",n=t.attrs&&ln.test(t.attrs)?"":".gradient";s(`${r}.s-btn.s-s${n}`,t.attrs,()=>{t.href!=null?(s(`href=${t.href} role=button`),t.disabled&&s("aria-disabled=true")):(s("type=",t.type??"button"),t.disabled&&s("disabled=true")),t.ariaLabel&&s("aria-label=",t.ariaLabel),t.click&&s("click=",t.click),b(t.icon),t.content?t.content():t.text!=null&&s("#",t.text)})}s.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function W(e={}){let r=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;s(`div.s-bgroup${r} role=group`,e.attrs,()=>{if(e.buttons)for(let n of e.buttons)R(n);e.content&&e.content()})}function Jt(e){s(()=>{let t=e.bind.value;W({attrs:e.attrs,buttons:Object.entries(e.options).map(([r,n])=>({text:typeof n=="string"?n:void 0,content:typeof n=="function"?n:void 0,attrs:t===r?".primary":".neutral .outlined",click:()=>{e.bind.value=e.allowDeselect&&t===r?null:r}}))})}),e.name&&s(()=>s(`input type=hidden name=${e.name} value=`,e.bind.value??""))}s.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.6",input:"width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0"}});function Xt(e={}){let t=e.id??j("check");s("div.s-check",e.attrs,()=>{s(`label for=${t}`,()=>{s("input type=checkbox",e.inputAttrs,()=>{s(`id=${t}`),e.name&&s(`name=${e.name}`),e.checked&&!e.bind&&s("checked=true"),e.change&&s("change=",e.change),s(()=>{e.disabled&&s("disabled=true")}),s(()=>{e.required&&s("aria-required=true")}),e.bind&&s("bind=",e.bind)}),s(()=>{e.label!=null&&b(e.label),e.required&&s("span.s-req aria-hidden=true #*")})}),s(()=>{e.help!=null&&!e.error&&s("div.s-help",()=>b(e.help))}),s(()=>{e.error&&s("div.s-error role=alert #",e.error)})})}s.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center gap:$2 flex-wrap:wrap margin-top:$1"}});function Zt(e={}){let t=typeof e=="function"?{content:e}:e;s("form.s-form",t.attrs,()=>{s(()=>{s(".grid=",t.layout==="grid")}),s("submit=",r=>{if(r.preventDefault(),t.submit){let n=new FormData(r.target),o={};for(let i of new Set(n.keys())){let a=n.getAll(i);o[i]=a.length===1?a[0]:a}t.submit(o,r)}}),t.content&&t.content(),s(()=>{t.actions&&s("footer",t.actionsAttrs,()=>t.actions?.())})})}var gt=()=>{};var pt=typeof ABERDEEN_FAKE_WINDOW<"u"?ABERDEEN_FAKE_WINDOW:window,z=pt.location,V=pt.history;function er(){return tr({path:z.pathname,hash:z.hash,search:Object.fromEntries(new URLSearchParams(z.search)),state:V.state?.state||{}},"load",(V.state?.stack?.length||0)+1)}function ht(e,t,r){if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t||e.constructor!==t.constructor)return!1;if(t instanceof Array){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(!ht(e[n],t[n],r))return!1}else{for(let n of Object.keys(t))if(!ht(e[n],t[n],r))return!1;if(!r){for(let n of Object.keys(e))if(!t.hasOwnProperty(n))return!1}}return!0}function cn(e){let t=new URLSearchParams(e.search).toString();return(t?`${e.path}?${t}`:e.path)+e.hash}function tr(e,t,r){let n=e.path||(e.p||[]).join("/")||"/";return n=(""+n).replace(/\/+$/,""),n.startsWith("/")||(n=`/${n}`),{path:n,hash:e.hash&&e.hash!=="#"?e.hash.startsWith("#")?e.hash:"#"+e.hash:"",p:n.length>1?n.slice(1).replace(/\/+$/,"").split("/"):[],nav:t,search:typeof e.search=="object"&&e.search?s.clone(e.search):{},state:typeof e.state=="object"&&e.state?s.clone(e.state):{},depth:r}}function fn(e,t=!1){if(typeof e=="string"){let r=new URL(e,z.href);if(r.host!==z.host){if(t)return;throw new Error(`Unexpected external URL: ${r.host} != ${z.host}`)}e={path:r.pathname,search:Object.fromEntries(r.searchParams),hash:r.hash}}else e instanceof Array&&(e={p:e});if(e.p&&(e.p=e.p.map(String)),e.search)for(let r of Object.keys(e.search))e.search[r]=String(e.search[r]);return e}function rr(e){let t=fn(e,!0);if(!t)return!1;if(t.path!=null||t.p!=null){let r=t.path||(t.p||[]).join("/")||"/";if(r=(""+r).replace(/\/+$/,""),r.startsWith("/")||(r=`/${r}`),!mt[r])return!1}if(t.search){for(let[r,n]of Object.entries(t.search))if(!mt[`${r}=${n}`])return!1}return!0}var se,un=0;var q=s.proxy({}),mt=s.proxy({});function dn(){se=V.state?.stack||[];let e=er();gt("initial",e),s.copy(s.unproxy(q),e)}dn();pt.addEventListener("popstate",function(e){un=0;let t=er(),r=V.state?.stack||[];if(r.length!==se.length){let n=Math.min(se.length,r.length)-1;(n<0||r[n]===se[n])&&(t.nav=r.length<se.length?"back":"forward")}se=r,gt("popstate",t),s.copy(q,t),s.runQueue()});ot(()=>{s(()=>{q.path="/"+Array.from(q.p).join("/")}),s(()=>{let e=V.state?.stack||[],t=tr(q,s.unproxy(q).nav,e.length+1);s.copy(q,t);let r={state:t.state,stack:e},n=cn(t);(n!==z.pathname+z.search+z.hash||!ht(V.state,r,!1))&&(gt("replaceState",t,r,n),V.replaceState(r,"",n))}),s(()=>{let e={};e[q.path]=!0;for(let[t,r]of Object.entries(q.search))e[`${t}=${r}`]=!0;s.copy(mt,e)})});s.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 border: 1px solid $s-border; r:$s-radius-lg box-shadow:$s-shadow overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item, .s-menu-item-link":"display:flex align-items:center gap:$2 w:100% padding: 0.5em 0.65em; r:$s-radius cursor:pointer text-align:left font-size:0.9em border:0 background:transparent fg:$s-fg text-decoration:none transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;",".s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page]), .s-menu-item-link:hover:not([aria-current=page])":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-menu-item[aria-current=page], .s-menu-item-link[aria-current=page]":"color:$s-on-accent font-weight:600 background: $s-gradient; box-shadow: 0 3px 10px color-mix(in srgb, $s-primary 38%, transparent);",".s-menu-item[aria-current=page] .s-menu-icon, .s-menu-item-link[aria-current=page] .s-menu-icon":"color:$s-on-accent",".s-menu-item[aria-current=page]:hover, .s-menu-item-link[aria-current=page]:hover":"filter:brightness(1.06)",".s-menu-item:focus-visible, .s-menu-item-link:focus-visible":"outline:none background: color-mix(in srgb, $s-fg 10%, transparent); box-shadow: 0 0 0 2px inset $s-focus;",".s-menu-item[aria-disabled=true], .s-menu-item-link[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"fg:$s-fg-muted flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);"});function Le(e,t){s("keydown=",r=>{if(r.key!=="ArrowDown"&&r.key!=="ArrowUp"&&r.key!=="Home"&&r.key!=="End")return;r.preventDefault();let o=[...r.currentTarget.querySelectorAll(".s-menu-item, .s-menu-item-link")].filter(c=>c.getAttribute("aria-disabled")!=="true");if(!o.length)return;let i=o.indexOf(document.activeElement),a=r.key==="ArrowUp"?-1:1,l=r.key==="Home"?0:r.key==="End"?o.length-1:i<0?a>0?0:o.length-1:(i+a+o.length)%o.length;o[l].focus()});for(let r of e){if(typeof r=="function"){r();continue}if("separator"in r){s("hr.s-menu-sep");continue}s(r.href?"a.s-menu-item-link":"button.s-menu-item type=button",r.attrs,()=>{r.href&&(s("href=",r.href),r.target&&s("target=",r.target),s(()=>{rr(r.href)&&s("aria-current=page")})),r.disabled&&s("aria-disabled=true"),s("click=",n=>{if(r.disabled){n.preventDefault();return}t?.(),r.click?.(n)}),r.icon&&s("span.s-menu-icon",()=>b(r.icon)),b(r.label)})}}var ae=s.proxy({opts:null});function oe(){let e=ae.opts?.anchor;ae.opts=null,e?.focus()}function hn(e,t){let r=e.offsetWidth,n=e.offsetHeight,o=window.innerWidth,i=window.innerHeight,a=4,l=t.left;l+r>o-8&&(l=Math.max(8,t.right-r));let c=t.bottom+a;c+n>i-8&&t.top-n-a>=8&&(c=t.top-n-a),e.style.left=Math.max(8,l)+"px",e.style.top=Math.max(8,c)+"px"}s.mount(document.body,()=>{let e=ae.opts;if(!e)return;let t=s("div.s-menu-list.s-s.panel create=hidden destroy=hidden",e.dropdownAttrs,()=>{Le(e.items,oe)}),r=o=>{let i=o.target;!t.contains(i)&&!e.anchor.contains(i)&&oe()},n=o=>{(o.key==="Escape"||o.key==="Tab")&&(o.preventDefault(),oe())};document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),s.clean(()=>{document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0)}),requestAnimationFrame(()=>{document.body.contains(t)&&(hn(t,e.anchor.getBoundingClientRect()),t.querySelector(".s-menu-item:not([aria-disabled=true]), .s-menu-item-link:not([aria-disabled=true])")?.focus())})});function bt(e){return ae.opts=e,oe}function je(e){let t=null;s.clean(()=>{ae.opts?.anchor===t&&oe()}),R({icon:()=>s("span aria-hidden=true #\u2630"),ariaLabel:"Open menu",attrs:".neutral .outlined",...e.button,click:r=>{if(t=r.currentTarget,ae.opts?.anchor===t){oe();return}bt({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}s.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border-bottom: 1px solid $s-border; position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-border; fg:$s-fg-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-fg-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center",".s-body-inner":"flex:1 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);","> main, .s-body main":"flex:1 overflow-y:auto display:flex flex-direction:column","> main > .s-content, .s-body main > .s-content":"width:100% flex:1 p:$3","> main.s-scroll-y, .s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1 background:transparent"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex","@container (max-width: 640px)":{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0"}});function ir(e={}){let t=e.nav,r=e.navPosition??"left",n=t!=null&&t.items.length>0,o=n?r==="button"?".s-nav-btn-only":`.s-nav-${r}`:"";s(`div.s-main.s-s.base${o}`,e.attrs,()=>{s(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||n)&&s("header.s-s.raised",e.topbarAttrs,()=>{s("div.s-bar",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),s(()=>{n&&s("div.s-nav-trigger",()=>{je({...t,button:{icon:()=>s("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .outlined .small",...t.button}})})}),s(()=>{e.icon!=null&&s("div.s-header-icon",()=>b(e.icon))}),s("div.s-titles",()=>{s(()=>{e.title!=null&&s("div.s-title",()=>b(e.title))}),s(()=>{e.subtitle!=null&&s("div.s-subtitle",()=>b(e.subtitle))})}),s(()=>{e.menu&&s("div.s-menu",()=>e.menu?.())})})})}),n&&r!=="button"?s("div.s-body",()=>{s("div.s-body-inner",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),s(`nav.s-nav-panel.s-s.raised.s-nav-${r}`,e.navAttrs,()=>{Le(t.items)}),s("div.s-nav-sep aria-hidden=true"),nr(e,!1)})}):nr(e,!0),s(()=>{e.footer!=null&&s("footer",()=>{s("div.s-bar",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),b(e.footer)})})})})}function nr(e,t){let r=s("main",()=>{s("div.s-content",e.contentAttrs,()=>{t&&s(()=>{e.maxWidth!=null&&s("margin-inline:auto max-width:",e.maxWidth)}),e.content&&e.content()})});mn(r)}function mn(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),r=new ResizeObserver(t);r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),t(),s.clean(()=>r.disconnect())}function qe(e={}){G(e,(t,r)=>{s("input.s-input",e.inputAttrs,()=>{s("type=",e.type??"text"),e.placeholder!=null&&s("placeholder=",e.placeholder),e.autocomplete!=null&&s("autocomplete=",e.autocomplete),e.value!=null&&!e.bind&&s("value=",e.value),e.input&&s("input=",e.input),e.change&&s("change=",e.change),ie(e,t,r,e.bind)})})}s.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) border: 1px solid $s-border; r: $s-radius-lg; box-shadow: $s-shadow; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center gap:$2 padding: $2 $3; border-top: 1px solid $s-border; flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var Y=s.proxy({}),yt=0,gn=s.derive(()=>{let e=Object.keys(Y);if(e.length)return e[e.length-1]});s.mount(document.body,()=>{s.onEach(Y,({resolve:e,opts:t},r)=>{let n=()=>{delete Y[r]};s.clean(()=>{t.onClose?.(),e()});let o=s.derive(()=>gn.value!=r);s("div.s-backdrop create=hidden destroy=hidden .hidden=",o,"click=",()=>{t.allowCancel!==!1&&n()}),s("div.s-dialog.s-s.panel create=hidden destroy=hidden",t.attrs,()=>{s(()=>{t.header!=null&&s("header.s-s.raised",t.headerAttrs,()=>b(t.header))}),s("div",t.contentAttrs,()=>{b(t.content,n)}),s(()=>{t.footer!=null&&s("footer.s-s.raised",t.footerAttrs,()=>b(t.footer))})})})});function ye(e){yt||document.addEventListener("keydown",r=>{if(r.key==="Escape"&&e.allowCancel!==!1){let n=s.unproxy(Y);for(let o=yt;o>0;o--)if(n[o]){n[o].opts.allowCancel!==!1&&delete Y[o];break}}});let t=++yt;return e.cancelWithScope!==!1&&s.clean(()=>{delete Y[t]}),new Promise(r=>{Y[t]={resolve:r,opts:e}})}function sr(e,t={}){return ye({header:"Alert",allowCancel:!0,content:r=>{s("p",()=>{s("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"OK",click:r})}})},...t})}function or(e,t={}){return new Promise(r=>{let n=!1;ye({header:"Confirm",allowCancel:!0,content:o=>{s("p",()=>{s("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"Cancel",attrs:".neutral .outlined",click:o}),R({text:"OK",click:()=>{n=!0,o()}})}})},...t,onClose:()=>{r(n),t.onClose?.()}})})}function ar(e,t="",r={}){return new Promise(n=>{let o=null;ye({header:"Input",allowCancel:!0,content:i=>{s("p",()=>{s("#",e)});let a=s.proxy({value:t});s("form display:contents",()=>{s("submit=",l=>{l.preventDefault(),o=a.value,i()}),qe({bind:s.ref(a,"value")}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"Cancel",attrs:".neutral .outlined",type:"button",click:i}),R({text:"OK",type:"submit"})}})})},...r,onClose:()=>{n(o),r.onClose?.()}})})}s.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-fg-muted font-size:0.85em"}});function lr(e){G(e,(t,r)=>{s("div.s-select_wrap",e.inputAttrs,()=>{s("select.s-input",()=>{ie(e,t,r),s("change=",n=>{e.bind&&(e.bind.value=n.target.value)}),s(()=>{let n=typeof e.options=="function"?e.options():e.options,o=e.bind?.value??"";e.placeholder!=null&&s("option",()=>{s("value= disabled=true hidden=true"),o||s("selected=true"),s("#",e.placeholder)});for(let i of n){let a=typeof i=="string"?{value:i,label:i}:{value:i.value,label:i.label??i.value};s("option",()=>{s("value=",a.value),a.value===o&&s("selected=true"),s("#",a.label)})}})})})})}s.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tablist":"display:flex gap:$1 align-items:stretch overflow-x:auto scrollbar-width:none border-bottom: 1px solid $s-border;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-fg-muted; font-weight:600 padding: 0.6em 0.9em; border-bottom: 3px solid transparent; margin-bottom:-1px transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-fg;",".s-tab:disabled":"opacity:0.5 cursor:not-allowed",".s-tab:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function cr(e){let t=j("tabs"),r=(i,a)=>i.id??String(a),n=e.bind??s.proxy(r(e.tabs[0]??{label:""},0)),o=(i,a)=>{i.disabled||(n.value=r(i,a))};s("div.s-tabs",e.attrs,()=>{s("div.s-tablist role=tablist",()=>{e.tabs.forEach((i,a)=>{let l=r(i,a);s("button.s-tab type=button role=tab",()=>{s(`id=${t}-tab-${l} aria-controls=${t}-panel-${l}`),s(()=>{let c=n.value===l;s("aria-selected=",c?"true":"false"),s("tabindex=",c?"0":"-1")}),i.disabled&&s("disabled=true"),s("click=",()=>o(i,a)),s("keydown=",c=>pn(c,e.tabs,a,o)),b(i.icon),b(i.label)})})}),s("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{s(()=>{let i=n.value,a=e.tabs.findIndex((c,m)=>r(c,m)===i),l=e.tabs[a]??e.tabs[0];l&&(s(`id=${t}-panel-${r(l,a)} aria-labelledby=${t}-tab-${r(l,a)}`),l.content?.())})})})}function pn(e,t,r,n){let o=r;if(e.key==="ArrowRight"||e.key==="ArrowDown")o=(r+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")o=(r-1+t.length)%t.length;else if(e.key==="Home")o=0;else if(e.key==="End")o=t.length-1;else return;e.preventDefault();let i=o>=r?1:-1;for(let a=0;a<t.length;a++){let l=t[o];if(l&&!l.disabled){n(l,o),e.currentTarget?.parentElement?.children[o]?.focus();return}o=(o+i+t.length)%t.length}}s.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function ur(e={}){let t=e.autoGrow!==!1;G(e,(r,n)=>{let o=s("textarea.s-input",e.inputAttrs,()=>{t?(s(".s-autoGrow"),s("input=",i=>{fr(i.currentTarget),e.input&&e.input(i)})):(s("rows=",e.rows??4),s("resize:",e.resize??"vertical"),e.input&&s("input=",e.input)),e.placeholder!=null&&s("placeholder=",e.placeholder),e.value!=null&&!e.bind&&s("value=",e.value),e.change&&s("change=",e.change),ie(e,r,n,e.bind)});t&&requestAnimationFrame(()=>fr(o))})}function fr(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}var ze=400,dr=`margin ${ze}ms ease-out, transform ${ze}ms ease-out`;function hr(e){if(e.parentElement){let t=getComputedStyle(e.parentElement);if(t.display==="flex"&&(t.flexDirection||"").startsWith("row"))return{marginLeft:`-${e.offsetWidth/2}px`,marginRight:`-${e.offsetWidth/2}px`,transform:"scaleX(0)"}}return{marginBottom:`-${e.offsetHeight/2}px`,marginTop:`-${e.offsetHeight/2}px`,transform:"scaleY(0)"}}async function mr(e){let t=hr(e);Object.assign(e.style,t),e.offsetHeight,e.style.transition=dr;for(let r in t)e.style[r]="";setTimeout(()=>{e.style.transition=""},ze)}async function gr(e){let t=hr(e);e.style.transition=dr,Object.assign(e.style,t),setTimeout(()=>{e.remove()},ze)}s.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow pointer-events:auto",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-msg":"font-size:0.9em fg:$s-fg-muted line-height:1.4",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-fg",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg"}});var bn=0,wt=s.proxy({});s.mount(document.body,()=>{s("div.s-toasts aria-live=polite aria-atomic=false",()=>{s.onEach(wt,e=>{let{opts:t}=e,r=t.type==="danger"||t.type==="warning"?"alert":"status",n=t.type??"neutral";s(`div.s-toast.s-s.${n} role=${r}`,"create=",mr,"destroy=",gr,t.attrs,()=>{s("div.s-toast-body",()=>{s(()=>{t.title!=null&&s("div.s-toast-title",()=>b(t.title))}),s("div.s-toast-msg",()=>b(t.message))}),s(()=>{t.dismissible!==!1&&s("button.s-toast-close type=button aria-label=Dismiss",()=>{s("#\xD7"),s("click=",()=>xt(e.id))})})})})})});function xt(e){delete wt[e]}function pr(e){let t=++bn;wt[t]={id:t,opts:e};let r=e.duration??4e3,n;return r>0&&(n=setTimeout(()=>xt(t),r)),()=>{n!=null&&clearTimeout(n),xt(t)}}s.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content bg:$s-raised fg:$s-fg border: 1px solid $s-border-strong; r:$s-radius box-shadow:$s-shadow padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var le=s.proxy(void 0),O=null;typeof window<"u"&&window.addEventListener("scroll",()=>{le.value=void 0},{capture:!0,passive:!0});function yn(e,t,r,n){let i=window.innerWidth,a=window.innerHeight,l=0,c=0;return n==="bottom"?(l=e.left+(e.width-t)/2,c=e.bottom+7,c+r>a-8&&(c=e.top-r-7)):n==="left"?(l=e.left-t-7,c=e.top+(e.height-r)/2,l<8&&(l=e.right+7)):n==="right"?(l=e.right+7,c=e.top+(e.height-r)/2,l+t>i-8&&(l=e.left-t-7)):(l=e.left+(e.width-t)/2,c=e.top-r-7,c<8&&(c=e.bottom+7)),{x:Math.max(8,Math.min(l,i-t-8)),y:Math.max(8,Math.min(c,a-r-8))}}function vt(){O&&clearTimeout(O),O=setTimeout(()=>{le.value=void 0,O=null},100)}s.mount(document.body,()=>{let e=le.value;if(!e)return;let{opts:t,anchor:r}=e,n=t.placement??"top",o=s("div.s-tt-tip role=tooltip visibility:hidden",t.attrs,()=>{s("mouseenter=",()=>{O&&(clearTimeout(O),O=null)}),s("mouseleave=",vt),b(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(o))return;let{x:i,y:a}=yn(r.getBoundingClientRect(),o.offsetWidth,o.offsetHeight,n);o.style.left=i+"px",o.style.top=a+"px",o.style.visibility=""})});function br(e){let t=r=>{O&&(clearTimeout(O),O=null),le.value={opts:e,anchor:r.currentTarget}};s("mouseenter=",t),s("mouseleave=",vt),s("focusin=",t),s("focusout=",vt),s.clean(()=>{le.value?.opts===e&&(le.value=void 0)})}var xn={main:ir,box:Qt,dialog:ye,alert:sr,confirm:or,prompt:ar,form:Zt,menuButton:je,showFloatingMenu:bt,textline:qe,textarea:ur,checkbox:Xt,tabs:cr,button:R,buttonChooser:Jt,buttonGroup:W,autocomplete:Yt,select:lr,toast:pr,addTooltip:br,setDarkMode:dt,getDarkMode:Ne},E=xn;var wn=new TextEncoder,$t=new TextDecoder("utf-8",{fatal:!0}),ce=Symbol("EOD"),Be="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$",wr=new Uint8Array(128).fill(255);for(let e=0;e<Be.length;++e)wr[Be.charCodeAt(e)]=e;var Pt=typeof process<"u"&&process?.stdout?.isTTY,_e=Pt?["\x1B[32m","\x1B[33m","\x1B[34m","\x1B[35m"]:[""],vn=Pt?"\x1B[0m":"",yr=Pt?"\x1B[31m":"",xr={array:5,object:6,map:7,set:8,end:9},Ue=0,$n=typeof process<"u"?!!process.env?.DATAPACK_EXTENDED_LOGGING:!1,_=class e{buffer;dataView;readPos=0;writePos=0;static EOD=ce;get _buffer(){return this.buffer}constructor(t=1900){t instanceof Uint8Array?(this.buffer=t,this.writePos=t.length):this.buffer=new Uint8Array(t)}writeMultiByteNumber(t,r,n=!1,o=!1){let i=0,a=t;for(;a>0;)i++,a=Math.floor(a/256);let l=o?~i&31:i;this.buffer[this.writePos++]=r<<5|l;let c=1;for(let m=0;m<i;m++)c*=256;for(let m=0;m<i;m++){c=Math.floor(c/256);let d=Math.floor(t/c)%256;n&&(d^=255),this.buffer[this.writePos++]=d}}readMultiByteNumber(t,r=!1){this.readPos+t>this.writePos&&this.notEnoughData("number");let n=0,o=1;for(let i=t-1;i>=0;i--){let a=this.buffer[this.readPos+i];r&&(a^=255),n+=a*o,o*=256}return this.readPos+=t,n}notEnoughData(t){throw new Error(`Not enough data to read a ${t} at position ${this.readPos} in
8
- ${this.toString(!0)}`)}write(t){if(this.ensureCapacity(33),typeof t=="number")Number.isInteger(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER?t>=0?t<32?this.buffer[this.writePos++]=32|t:t<64?this.buffer[this.writePos++]=64|t-32:this.writeMultiByteNumber(t-64,3):this.writeMultiByteNumber(-t,0,!0,!0):(this.buffer[this.writePos++]=128,this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.dataView.setFloat64(this.writePos,t),this.writePos+=8);else if(t===void 0)this.buffer[this.writePos++]=129;else if(t===null)this.buffer[this.writePos++]=130;else if(t===!0)this.buffer[this.writePos++]=131;else if(t===!1)this.buffer[this.writePos++]=132;else if(typeof t=="string"){let r=wn.encode(t);r.length<32?this.buffer[this.writePos++]=160|r.length:this.writeMultiByteNumber(r.length,6),this.ensureCapacity(r.length),this.buffer.set(r,this.writePos),this.writePos+=r.length}else if(t instanceof Uint8Array)this.writeMultiByteNumber(t.length,7),this.ensureCapacity(t.length),this.buffer.set(t,this.writePos),this.writePos+=t.length;else if(Array.isArray(t)||typeof t.length=="number"&&typeof t[Symbol.iterator]=="function"){this.buffer[this.writePos++]=133;for(let r of t)this.write(r);this.buffer[this.writePos++]=137}else if(t instanceof Map){this.buffer[this.writePos++]=135;for(let[r,n]of t)this.write(r),this.write(n);this.buffer[this.writePos++]=137}else if(t instanceof Set){this.buffer[this.writePos++]=136;for(let r of t)this.write(r);this.buffer[this.writePos++]=137}else if(t instanceof Date)this.buffer[this.writePos++]=140,this.write(Math.floor(t.getTime()/1e3));else if(typeof t=="object")t instanceof xe?this.writeCustom(t.name,t.data):typeof t.toDataPack=="function"?t.toDataPack(this):this.writeAsObject(t);else throw new Error(`Unsupported data type: ${typeof t}`);return this}read(t){if(this.readPos>this.writePos)throw new Error("Not enough data");let r=this.buffer[this.readPos++],n=r>>5&7,o=r&31;switch(n){case 0:{let i=~o&31;return-this.readMultiByteNumber(i,!0)}case 1:return o;case 2:return o+32;case 3:return this.readMultiByteNumber(o)+64;case 4:switch(o){case 0:{this.readPos+8>this.writePos&&this.notEnoughData("float64"),this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength);let i=this.dataView.getFloat64(this.readPos);return this.readPos+=8,i}case 1:return;case 2:return null;case 3:return!0;case 4:return!1;case 5:{let i=[];for(;;){let a=this.read(t);if(a===ce)break;i.push(a)}return i}case 6:{let i={};for(;;){let a=this.read(t);if(a===ce)break;let l=this.read(t);i[a]=l}return i}case 7:{let i=new Map;for(;;){let a=this.read(t);if(a===ce)break;let l=this.read(t);i.set(a,l)}return i}case 8:{let i=new Set;for(;;){let a=this.read(t);if(a===ce)break;i.add(a)}return i}case 9:return ce;case 10:return--this.readPos,this.readIdentifier();case 11:{let i=this.readPos,a=i;for(;a>=this.writePos&&this.notEnoughData("null-terminated string"),this.buffer[a]!==0;)a++;return this.readPos=a+1,$t.decode(this.buffer.subarray(i,a))}case 12:{let i=this.readPositiveInt();return new Date(i*1e3)}case 13:{let i=this.readString(),a=this.read();return t&&i in t?t[i](a):new xe(i,a)}default:throw new Error(`Unknown type 4 subtype: ${o}`)}case 5:{let i=o;this.readPos+i>this.writePos&&this.notEnoughData("short string");let a=this.buffer.subarray(this.readPos,this.readPos+i);return this.readPos+=i,$t.decode(a)}case 6:{let i=this.readMultiByteNumber(o);this.readPos+i>this.writePos&&this.notEnoughData("string");let a=this.buffer.subarray(this.readPos,this.readPos+i);return this.readPos+=i,$t.decode(a)}case 7:{let i=this.readMultiByteNumber(o);this.readPos+i>this.writePos&&this.notEnoughData("blob");let a=this.buffer.slice(this.readPos,this.readPos+i);return this.readPos+=i,new Uint8Array(a)}default:throw new Error(`Unknown type: ${n}`)}}ensureCapacity(t){let r=this.writePos+t;if(r<=this.buffer.length)return;let n=Math.max(r,Math.floor(this.buffer.length*1.5)),o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.writePos)),this.buffer=o,delete this.dataView}readNumber(){let t=this.read();if(typeof t!="number")throw new Error("Expected number but got "+typeof t);return t}readDate(){let t=this.read();if(!(t instanceof Date))throw new Error("Expected Date but got "+typeof t);return t}readPositiveInt(t){let r=this.read();if(typeof r!="number"||!Number.isInteger(r)||r<0||t!==void 0&&r>=t)throw new Error(`Expected positive integer < ${t} but got ${r}`);return r}readBoolean(){let t=this.read();if(typeof t!="boolean")throw new Error("Expected boolean but got "+typeof t);return t}readUint8Array(){let t=this.read();if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array but got "+typeof t);return t}readString(){let t=this.read();if(typeof t!="string")throw new Error("Expected string but got "+typeof t);return t}writeIdentifier(t){let r=0;if(typeof t=="number")r=t;else{if(t.length!==8)throw new Error(`Identifier must be exactly 8 characters, got ${t.length}`);let n;for(let o=0;o<8;o++){let i=t.charCodeAt(o);if(i>127||(n=wr[i])===255)throw new Error(`Invalid base64 character: ${t[o]}`);r=r*64+n}}this.ensureCapacity(7),this.buffer[this.writePos++]=138;for(let n=5;n>=0;n--)this.buffer[this.writePos+n]=r%256,r=Math.floor(r/256);return this.writePos+=6,this}readIdentifier(){let t=this.readIdentifierNumber(),r="";for(let n=0;n<8;n++)r=Be[t%64]+r,t=Math.floor(t/64);return r}readIdentifierNumber(){if(this.readPos+7>this.writePos&&this.notEnoughData("identifier"),this.buffer[this.readPos++]!==138)throw new Error("Invalid identifier header");let r=0;for(let n=0;n<6;n++)r=r*256+this.buffer[this.readPos++];return r}writeOrderedString(t){let r=new TextEncoder().encode(t);if(r.includes(0))throw new Error("String contains null character");return this.ensureCapacity(r.length+2),this.buffer[this.writePos++]=139,this.buffer.set(r,this.writePos),this.writePos+=r.length,this.buffer[this.writePos++]=0,this}toUint8Array(t=!0,r=0,n=this.writePos){return t?this.buffer.slice(r,n):this.buffer.subarray(r,n)}toBuffer(){return this.buffer.buffer.slice(0,this.writePos)}clone(t,r=0,n=this.writePos){if(t)return new e(this.buffer.slice(r,n));{let o=new e(this.buffer);return o.readPos=r,o.writePos=n,o}}writeCustom(t,r){this.buffer[this.writePos++]=141,this.write(t),this.write(r)}writeAsObject(t){this.buffer[this.writePos++]=134;for(let r of Object.keys(t))this.write(r),this.write(t[r]);return this.buffer[this.writePos++]=137,this}writeCollection(t,r){return this.writeCollectionBoundary(t),r(t==="array"||t==="set"?n=>{this.write(n)}:t==="object"?(n,o)=>{this.writeObjectKey(n),this.write(o)}:(n,o)=>{this.write(n),this.write(o)}),this.writeCollectionBoundary("end")}writeCollectionBoundary(t){let r=xr[t];if(!r)throw new Error(`Invalid collection type: ${t}`);return this.buffer[this.writePos++]=128|r,this}writeObjectKey(t){if(typeof t=="string"){let r=parseInt(t,10);r.toString()==t&&(t=r)}else typeof t!="number"&&(t=""+t);this.write(t)}readCollectionBoundary(t){this.readPos>=this.writePos&&this.notEnoughData("collection boundary");let r=this.buffer[this.readPos++],n=128|xr[t];if(r!==n)throw new Error(`Expected ${t} boundary but got byte ${r}`)}increment(){for(let t=this.writePos-1;t>=0;t--)if(this.buffer[t]===255)this.buffer[t]=0;else return this.buffer[t]++,this}toString(t=void 0,r=0,n=this.writePos){t===void 0&&(t=$n);let o=this.readPos;this.readPos=r;let i=0,a="",l="",c=Ue,m=c>0?_e[(c-1)%_e.length]:vn;try{for(;this.readPos<n;){let d=_e[Ue++%_e.length];if(a+=d+fe(this.read())+" ",t)for(l+=d;i<this.readPos;)l+=this.buffer[i].toString(16).padStart(2,"0")+" ",i++}}catch{if(!t)return this.readPos=o,Ue=c,this.toString(!0,r,n);for(a+=yr+"ERROR ",l+=yr;i<this.writePos;)l+=this.buffer[i].toString(16).padStart(2,"0")+" ",i++}return this.readPos=o,c||(Ue=0),t?"DataPack{"+l+m+"\u2192 "+a.trimEnd()+m+"}":"DataPack{"+a.trimEnd()+m+"}"}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}readAvailable(){return this.readPos<this.writePos}static generateIdentifier(){let t=Math.floor(+new Date*256+Math.random()*16384),r="";for(let n=0;n<8;n++)r=Be[t&63]+r,t=Math.floor(t/64);return r}static createBuffer(...t){let r=new e;for(let n of t)r.write(n);return r.toBuffer()}static createUint8Array(...t){let r=new e;for(let n of t)r.write(n);return r.toUint8Array(!1)}};function fe(e){if(e===void 0)return"undefined";if(typeof e=="object"&&e!==null){if(e instanceof Uint8Array)return new _(e).toString();if(e instanceof Array)return"["+e.map(t=>fe(t)).join(", ")+"]";if(e instanceof Map)return"Map{"+Array.from(e.entries()).map(([t,r])=>`${fe(t)}=>${fe(r)}`).join(", ")+"}";if(e instanceof Set)return"Set{"+Array.from(e.values()).map(t=>fe(t)).join(", ")+"}";if(typeof e=="object"&&e!==null)return"{"+Object.entries(e).map(([t,r])=>`${t}:${fe(r)}`).join(", ")+"}"}return JSON.stringify(e)}var xe=class{name;data;constructor(t,r){this.name=t,this.data=r}};_.prototype.CustomData=xe;var U={error:"e",response:"r",response_proxy:"p",response_model:"m",response_proxy_model:"q",model_data:"d"},At={call:1,cancel:2};var C=0;var Ke=Symbol(),De=class{constructor(t){this.url=t;this.api=new Proxy({connection:this,requestId:void 0},vr),this.connect()}url;ws;activeRequests=new Map;requestCounter=0;reconnectAttempts=0;_proxyCounter=0;$state=s.proxy({online:!1,error:void 0});streamCache=new Map;get[s.OPAQUE](){return!0}api;isOnline(){return this.$state.online}getError(){return this.$state.error}connect(){let t;try{t=this.ws=typeof this.url=="string"?new WebSocket(this.url):this.url()}catch(r){console.error("WebSocket connection error:",r),this.$state.error=r?.message||"WebSocket connection error";return}t.binaryType="arraybuffer",C>=1&&console.log(`[lowlander] Connecting to WebSocket at ${typeof this.url=="string"?this.url:"[custom WebSocket]"}`),t.onopen=()=>{if(t===this.ws){C>=1&&console.log("[lowlander] WebSocket connected"),this.$state.online=!0,this.$state.error=void 0,this.reconnectAttempts=0;for(let r of this.activeRequests.values())r.$result.busy=!0,this.ws.send(r.requestBuffer)}},t.onclose=()=>{t===this.ws&&(C>=1&&console.log("[lowlander] WebSocket disconnected"),this.reconnect())},t.onerror=r=>{t===this.ws&&(console.error("WebSocket error:",r),this.$state.error=r?.message||"WebSocket connection error",this.reconnect())},t.onmessage=r=>{if(t!==this.ws)return;let n=new _(new Uint8Array(r.data)),o=n.readPositiveInt(),i=this.activeRequests.get(o);if(!i)return;let a=s.unproxy(i.$result),l=n.read();if(typeof l=="number"){let c=i.callbacks?.[l],m=[];for(;n.readAvailable();)m.push(n.read());c(...m);return}if(l===U.model_data){i.database||=new Map,i.commitIds||=new Map;let c=n.readNumber(),m=n.readNumber(),d=n.read({model:function(g){let v=i.database.get(g);return v||console.error("Unknown linked model hash "+g),v}});C>=3&&console.log("[lowlander] incoming model_data",o,c,m,d),setTimeout(()=>this.pruneCommitIds(i,m),15e3);let f=i.commitIds.get(c);if(!d){if(f&&m<Math.max(...f.values()))return;i.database.delete(c),i.commitIds.set(c,new Map([[Ke,m]]));return}let u=i.database.get(c);if(u){f||(f=new Map,i.commitIds.set(c,f));for(let g of Object.keys(d))m<(f.get(g)??f.get(Ke)??-1)||(d[g]&&typeof d[g]=="object"?s.copy(u,g,d[g]):u[g]=d[g],f.set(g,m))}else{if(f&&m<(f.get(Ke)??-1))return;let g=s.proxy(d);s.unproxy(g)[s.OPAQUE]=!1,i.database.set(c,g),i.commitIds.set(c,new Map([[Ke,m]]))}return}if(l===U.error){let c=n.readString();i.$result.error=new Error(c),C>=2&&console.log(`[lowlander] incoming error requestId=${o} message=${c}`)}else if(l===U.response||l===U.response_proxy)i.$result.value=n.read(),i.virtualSocketIds=n.read(),i.hasServerProxy=l===U.response_proxy,C>=2&&console.log(`[lowlander] incoming response requestId=${o} value=${a.value} virtualSocketIds=${i.virtualSocketIds} hasServerProxy=${i.hasServerProxy}`);else if(l===U.response_model||l===U.response_proxy_model){i.virtualSocketIds=n.read();let c=n.readNumber(),m=n.read(),d=i.database?.get(c);i.hasServerProxy=l===U.response_proxy_model,C>=2&&console.log(`[lowlander] incoming ${i.hasServerProxy?"response_proxy_model":"response_model"} requestId=${o} dbKey=${c} cacheMs=${m} obj=${d}`),d?i.$result.value=s.proxy(d):i.$result.error=new Error("Unknown database key "+c),m!==void 0&&i.cacheKey&&!this.streamCache.has(i.cacheKey)&&this.streamCache.set(i.cacheKey,{request:i,cacheKey:i.cacheKey,cacheMs:m,refCount:1})}else throw new Error("Unknown message type "+l);!i.hasServerProxy&&!i.virtualSocketIds?.length&&this.activeRequests.delete(o),i.hasServerProxy||delete i.$result.serverProxy,i.$result.busy=!1,i.resolve&&(a.error!=null?(console.error(a.error),i.reject(a.error)):i.resolve(a.value),delete i.resolve,delete i.reject)}}reconnect(){if(this.ws=void 0,this.$state.online=!1,typeof this.url!="string")return;let t=Math.min(500*Math.pow(2,this.reconnectAttempts),2e4);this.reconnectAttempts++,C>=1&&console.log(`[lowlander] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),setTimeout(this.connect.bind(this),t)}pruneCommitIds(t,r){if(t.commitIds)for(let[n,o]of t.commitIds){for(let[i,a]of o)a<=r&&o.delete(i);o.size||t.commitIds.delete(n)}}_createMethodStub(t,r){return(...n)=>{let i=n.some(u=>typeof u=="function")?void 0:(r??"")+":"+t+":"+JSON.stringify(n);if(i){let u=this.streamCache.get(i);if(u)return u.lingerTimeout&&(clearTimeout(u.lingerTimeout),u.lingerTimeout=void 0),u.refCount++,C>=2&&console.log(`[lowlander] reusing cached stream cacheKey=${i} refCount=${u.refCount}`),s.clean(()=>{u.refCount--,C>=2&&console.log(`[lowlander] clean cached consumer cacheKey=${i} refCount=${u.refCount}`),u.refCount<=0&&this.startLinger(u)}),u.request.$result}let a={busy:!0},l=s.proxy(a),c=++this.requestCounter,m=new _;m.write(c).write(At.call).write(r).write(t);let d;m.writeCollection("array",()=>{for(let u of n)typeof u=="function"?(d||=[],m.writeCustom("cb",d.length),d.push(u)):m.write(u)});let f={$result:l,requestBuffer:m.toUint8Array(!0),requestId:c,connection:this,callbacks:d,cacheKey:i};return a.serverProxy=new Proxy(f,vr),a.promise=new Promise((u,g)=>{f.resolve=u,f.reject=g}),this.activeRequests.set(c,f),C>=2&&console.log(`[lowlander] outgoing call requestId=${c} method=${t} params=`,n),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(f.requestBuffer),s.clean(()=>{let u=i?this.streamCache.get(i):void 0;if(u&&u.request===f){u.refCount--,C>=2&&console.log(`[lowlander] clean stream owner cacheKey=${i} refCount=${u.refCount}`),u.refCount<=0&&this.startLinger(u);return}this.cancelRequest(f)}),l}}cancelRequest(t){if(this.activeRequests.delete(t.requestId),t.virtualSocketIds?.length||t.hasServerProxy){C>=2&&console.log(`[lowlander] outgoing cancel requestId=${t.requestId} virtualSocketIds=${t.virtualSocketIds} hasServerProxy=${t.hasServerProxy}`);let r=_.createUint8Array(++this.requestCounter,At.cancel,t.requestId,t.virtualSocketIds);this.ws?.send(r)}}startLinger(t){t.lingerTimeout&&clearTimeout(t.lingerTimeout),C>=2&&console.log(`[lowlander] start linger cacheKey=${t.cacheKey} cacheMs=${t.cacheMs}`),t.lingerTimeout=setTimeout(()=>{t.refCount>0||(C>=2&&console.log(`[lowlander] linger expired cacheKey=${t.cacheKey}`),this.streamCache.delete(t.cacheKey),this.cancelRequest(t.request))},t.cacheMs)}},vr={get(e,t){if(typeof t=="symbol")return t===s.OPAQUE?!0:t===s.CUSTOM_DUMP?`<ServerProxy for #${e.requestId}>`:void 0;if(e.serverProxyCache?.has(t))return e.serverProxyCache.get(t);if(t==="then"||t==="catch"||t==="finally")return;if(t==="constructor")return{name:"ServerProxy-"+e.requestId};let r=e.connection._createMethodStub(t,e.requestId);return e.serverProxyCache||(e.serverProxyCache=new Map),e.serverProxyCache.set(t,r),r},has(e,t){return typeof t=="string"||t===s.NO_COPY}};var Pn=`ws://${location.hostname}:8080/`,$r=new De(Pn),Ge=$r.api,An=Ge.add(1234,6753),Pr=Ge.authenticate("Frank"),Ar=Pr.serverProxy,kn=Ar.getBio(),Cn=Ge.streamModel(),kt=s.proxy(!1),Ct=s.proxy(""),kr=s.proxy([]),Sn=0;Ge.streamSomething(e=>kr[Sn++%20]=e);s.mount(document.body,()=>{E.main({title:"Lowlander Hello World",maxWidth:"48rem",content:()=>{E.box({header:"Connection",content:()=>{s("p","m:0",()=>{s("#Online: "),s(()=>s($r.isOnline()?"text=yes":"text=no"))})}}),E.box({header:"Add(1234, 6753)",content:()=>s.dump(An)}),E.box({header:"Auth token",content:()=>s.dump(Pr)}),E.box({header:"Bio",content:()=>s.dump(kn)}),E.box({header:"Live model",content:()=>s.dump(Cn)}),E.box({header:"Toggle friend",content:()=>{E.form({submit:async()=>{kt.value=!0;let e=await Ar.toggleFriend(Ct.value).promise;kt.value=!1,e||E.alert("No such person: "+Ct.value)},content:()=>E.textline({label:"Person name",bind:Ct}),actions:()=>{s(()=>{kt.value?s("span","fg:$s-fg-muted","#Busy\u2026"):E.button({text:"Toggle friend",type:"submit"})})}})}}),E.box({header:"Streamed data",content:()=>s.dump(kr)})}})});
1
+ var ye=class{keyProp;tail;symbols;constructor(e){this.keyProp=e,this.tail={},this.symbols=[Symbol(0)]}add(e){if(this.symbols[0]in e)return!1;let r=1+(Math.clz32(Math.random()*4294967295)>>2);for(let l=this.symbols.length;l<r;l++)this.symbols.push(Symbol(l));let n=this.keyProp,i=e[n],s,a=this.tail;for(let l=this.symbols.length-1;l>=0;l--){let c=this.symbols[l];for(;(s=a[c])&&s[n]>i;)a=s;l<r&&(e[c]=a[c],a[c]=e)}return!0}has(e){return this.symbols[0]in e}fetchLast(){let e=this.tail[this.symbols[0]];if(e)return this.remove(e),e}isEmpty(){return this.tail[this.symbols[0]]===void 0}get(e){let r=this.keyProp,n,i=this.tail;for(let s=this.symbols.length-1;s>=0;s--){let a=this.symbols[s];for(;(n=i[a])&&n[r]>e;)i=n}return i[this.symbols[0]]?.[r]===e?i[this.symbols[0]]:void 0}*[Symbol.iterator](){let e=this.symbols[0],r=this.tail[e];for(;r;)yield r,r=r[e]}prev(e){return e[this.symbols[0]]}remove(e){if(!(this.symbols[0]in e))return!1;let r=this.keyProp,n=e[r],i,s=this.tail;for(let a=this.symbols.length-1;a>=0;a--){let l=this.symbols[a];for(;(i=s[l])&&i[r]>=n&&i!==e;)s=i;i===e&&(s[l]=i[l],delete i[l])}return i===e}clear(){let e=this.symbols[0],r=this.tail;for(;r;){let n=r[e];for(let i of this.symbols){if(!(i in r))break;delete r[i]}r=n}this.tail={}}},_,V=0,E,A;function H(t,e,r,n){(t.sideEffects||=[]).push(e,r,n)}function or(t,e){for(let r=e.length-3;r>=0;r-=3){let n=e[r+1],i=e[r+2];switch(e[r]){case 0:i?t.classList.add(n):t.classList.remove(n);break;case 1:t.style[n]=i??"";break;case 2:t[n]=i;break;case 3:i==null?t.removeAttribute(n):t.setAttribute(n,i);break;case 4:t.removeEventListener(n,i);break}}}function Xe(t){if(!_)_=new ye("prio"),queueMicrotask(St);else if(!(V&1)&&(V++,V>98))throw new Error("Too many recursive updates from observes");_.add(t)}function St(){let t=Date.now();for(;_;){let e=_.fetchLast();if(!e)break;V&1&&V++,e.queueRun()}_=void 0,V=0,t=Date.now()-t,t>9&&console.debug(`Aberdeen queue took ${t}ms`)}function vt(t){let e="";for(let r of t){if(typeof r=="string"){e+=`${r}`;continue}if(typeof r!="number")throw new Error("onEach() sort key must be a string, number or an array of such");let n="",i=Math.abs(Math.round(r)),s=r<0;for(;i>0;)n=String.fromCharCode(s?65534-i%65533:2+i%65533)+n,i=Math.floor(i/65533);e+=String.fromCharCode(128+(s?-n.length:n.length))+n}return e}function ar(t){let e="";for(let r=0;r<t.length;r++)e+=String.fromCodePoint(65535-t.charCodeAt(r));return e}var Et=0,xe=class{prio=--Et;remove(){let e=this.getLastNode();e&&$e(e,this.getPrecedingNode());let r=A;A=this.el,this.delete(),A=r}},Be=class{queueRun;prio=--Et;constructor(e){this.queueRun=e,Xe(this)}},Y=class extends xe{cleaners;sideEffects;changes;constructor(e=[]){super(),this.cleaners=e}lastChild;redraw(){}getLastNode(){return ce(this.lastChild)}delete(){let e=this.cleaners;for(let n=e.length-1;n>=0;n--){let i=e[n];typeof i=="function"?i():i.delete(this)}this.cleaners.length=0;let r=this.sideEffects;r&&(this.el===A&&or(this.el,r),this.sideEffects=void 0),_?.remove(this),this.lastChild=void 0}onChange(e,r,n,i){this.changes||(this.changes=new Map,Xe(this));let s=this.changes.get(e);s||(s=new Map,this.changes.set(e,s)),s.has(r)?s.get(r)===n&&s.delete(r):s.set(r,i)}fetchHasChanges(){if(!this.changes)return!1;for(let e of this.changes.values())if(e.size>0)return delete this.changes,!0;return delete this.changes,!1}queueRun(){this.fetchHasChanges()&&(this.remove(),E=this,this.redraw(),E=void 0)}getInsertAfterNode(){return this.getLastNode()||this.getPrecedingNode()}getChildPrevSibling(){return this.lastChild}},le=class extends Y{el;svg;prevSibling;constructor(e,r,n=!1){super(n?f.cleaners:[]),this.el=e,this.svg=r,e===f.el?(this.prevSibling=f.getChildPrevSibling(),f.lastChild=this):this.prevSibling=e.lastChild||void 0,n||f.cleaners.push(this)}getPrecedingNode(){return ce(this.prevSibling)}getChildPrevSibling(){return this.lastChild||this.prevSibling}},we=class extends le{renderer;constructor(e,r,n){super(e,r),this.renderer=n,this.redraw()}redraw(){let e=f;f=this;try{this.renderer()}catch(r){nt(r,!0)}f=e}},ve=class extends Y{el=document.body;svg=!1;getPrecedingNode(){}},Ke=class extends Y{el;renderer;svg;constructor(e,r){super(),this.el=e,this.renderer=r,this.svg=e.namespaceURI==="http://www.w3.org/2000/svg";let n=E;E=this,this.redraw(),E=n,f.cleaners.push(this)}redraw(){we.prototype.redraw.call(this)}getPrecedingNode(){}delete(){$e(this.getLastNode(),this.getPrecedingNode());let e=A;A=this.el,super.delete(),A=e}remove(){this.delete()}};function $e(t,e){for(;t&&t!==e;){let r=t.previousSibling,n=Ye.get(t);n&&t instanceof Element?n!==!0&&(typeof n=="function"?n(t):gr(t,n),Ye.set(t,!0)):t.remove(),t=r}}function ce(t){return!t||t instanceof Node?t:t.getLastNode()||t.getPrecedingNode()}var De=class extends le{renderer;result=v({value:void 0});constructor(e){super(f.el,f.svg),this.renderer=e,this.redraw()}redraw(){let e=f;f=this;try{this.result.value=this.renderer()}catch(r){nt(r,!0)}f=e}},Ge=class extends le{key;target;svg=!1;constructor(e,r,n){super(e,e.namespaceURI==="http://www.w3.org/2000/svg"),this.key=r,this.target=n,this.redraw()}redraw(){let e=f;f=this,S(this.el,this.key,this.target.value),f=e}},We=class extends xe{renderer;makeSortKey;parentElement=f.el;prevSibling;target;byIndex=new Map;sortedSet=new ye("sortKey");changedIndexes=new Map;constructor(e,r,n){super(),this.renderer=r,this.makeSortKey=n;let i=this.target=e[g]||e;if(x(i,$,this),this.prevSibling=f.getChildPrevSibling(),f.lastChild=this,f.cleaners.push(this),i instanceof Array)for(let s=0;s<i.length;s++)new se(this,s,!1);else for(let s of i instanceof Map?i.keys():i instanceof Set?i.values():Object.keys(i))new se(this,s,!1)}getPrecedingNode(){return ce(this.prevSibling)}onChange(e,r,n,i){(!(e instanceof Array)||typeof r=="number")&&(this.changedIndexes.has(r)?this.changedIndexes.get(r)===n&&this.changedIndexes.delete(r):(this.changedIndexes.set(r,i),Xe(this)))}queueRun(){let e=this.changedIndexes;this.changedIndexes=new Map;for(let r of e.keys()){let n=this.byIndex.get(r);n&&n.remove(),(this.target instanceof Set||this.target instanceof Map?this.target.has(r):r in this.target)?new se(this,r,!0):this.byIndex.delete(r)}E=void 0}delete(){for(let e of this.byIndex.values())e.delete();_?.remove(this),this.byIndex.clear(),setTimeout(()=>{this.sortedSet.clear()},1)}getLastNode(){for(let e of this.sortedSet){let r=e.getActualLastNode();if(r)return r}}},se=class extends Y{parent;itemIndex;sortKey;el;svg;constructor(e,r,n){super(),this.parent=e,this.itemIndex=r,this.el=e.parentElement,this.svg=f.svg,this.parent.byIndex.set(this.itemIndex,this),this.lastChild=this,n&&(E=this),this.redraw()}getPrecedingNode(){this.parent.sortedSet.add(this);let e=this.parent.sortedSet.prev(this);return e?ce(e.lastChild):this.parent.getPrecedingNode()}getLastNode(){return this.getPrecedingNode()}getActualLastNode(){let e=this.lastChild;for(;e&&e!==this;){if(e instanceof Node)return e;let r=e.getLastNode();if(r)return r;e=e.getPrecedingNode()}}queueRun(){if(f!==J&&Ct(4),!this.fetchHasChanges())return;if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&$e(r,this.getPrecedingNode())}let e=A;A=this.el,this.delete(),A=e,this.lastChild=this,E=this,this.redraw(),E=void 0}redraw(){let e,r=this.parent.target,n=this.itemIndex;r instanceof Set?e=n=v(n):r instanceof Map?(e=v(r.get(n)),n=v(n)):e=v(r[n]);let i=f;f=this;let s;try{this.parent.makeSortKey?s=this.parent.makeSortKey(e,n):s=n,s instanceof Array?s=vt(s):typeof s!="string"&&s!=null&&(s=vt([s])),this.sortKey!==s&&(this.parent.sortedSet.remove(this),this.sortKey=s),s!=null&&this.parent.renderer(e,n)}catch(a){nt(a,s!=null)}f=i}getInsertAfterNode(){return this.sortKey==null&&Ct(1),ce(this.lastChild)}remove(){if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&$e(r,this.getPrecedingNode()),this.parent.sortedSet.remove(this),this.sortKey=void 0}let e=A;A=this.el,this.delete(),A=e}};function B(t,e){if(t!==f.el){t.appendChild(e);return}let r=f.el,n=f.getInsertAfterNode();r.insertBefore(e,n?n.nextSibling:r.firstChild),f.lastChild=e}var J=new ve,f=J;function Ze(t){let e=f;f=new ve;try{return t()}finally{f=e}}var $=Symbol("any"),g=Symbol("target"),R=Symbol("mapSize"),Fe=new WeakMap,fe=0;function x(t,e,r=f){if(r===J||fe)return;let n=Fe.get(t);if(n||Fe.set(t,n=new Map),e!==$&&n.get($)?.has(r))return;let i=n.get(e);i||n.set(e,i=new Set),!i.has(r)&&(i.add(r),r===f?f.cleaners.push(i):f.cleaners.push(()=>{i.delete(r)}))}function X(t,e,r){if(!t||typeof t!="object")throw new Error("A.onEach requires an object");t=t[g]||t,new We(t,e,r)}function He(t){for(let e of Object.keys(t))return!1;return!0}var b=Symbol("empty");function pe(t){let e=t[g]||t,r=f;if(e instanceof Array)return x(e,"length",(i,s,a)=>{!s!=!a&&r.onChange(e,b,!s,!a)}),!e.length;if(e instanceof Map||e instanceof Set)return x(e,R,(i,s,a)=>{!s!=!a&&r.onChange(e,b,!s,!a)}),!e.size;let n=He(e);return x(e,$,(i,s,a)=>{if(s===b!=(a===b)){let l=He(e);l!==n&&(r.onChange(e,b,l,n),n=l)}}),n}function lr(t){if(t instanceof Array)return ke(t,"length");if(t instanceof Map||t instanceof Set)return ke(t,"size");let e=t[g]||t,r=0;for(let i of Object.keys(e))e[i]!==void 0&&r++;let n=Se(r);return x(e,$,(i,s,a)=>{a===s||(a===b?n.value=++r:s===b&&(n.value=--r))}),n}function cr(t,e,r,n){if(r===n&&r!==void 0)return;let i=Fe.get(t);if(i!==void 0)for(let s of[e,$]){let a=i.get(s);if(a)for(let l of a)typeof l=="function"?l(e,r,n):l.onChange(t,e,r,n)}}var y=cr,fr={get(t,e){return e===g?t:(x(t,e),v(t[e]))},set(t,e,r){typeof r=="object"&&r&&(r=r[g]||r);let n=t.hasOwnProperty(e)?t[e]:b;return r!==n&&(t[e]=r,y(t,e,r,n)),!0},deleteProperty(t,e){let r=t.hasOwnProperty(e)?t[e]:b;return delete t[e],y(t,e,b,r),!0},has(t,e){return x(t,e),t.hasOwnProperty(e)},ownKeys(t){return x(t,$),Reflect.ownKeys(t)}};function ur(t,e,r){typeof r=="object"&&r&&(r=r[g]||r);let n=t[e];if(n===void 0&&!t.hasOwnProperty(e)&&(n=b),r!==n){let i=t.length;if(e==="length"){t.length=r;for(let s=r;s<i;s++)y(t,s,b,t[s])}else{if(typeof e=="string"){let s=0|e;String(s)===e&&s>=0&&(e=s)}t[e]=r,y(t,e,r,n)}t.length!==i&&y(t,"length",t.length,i)}return!0}var dr={get(t,e){if(e===g)return t;if(typeof e=="string"){let r=0|e;String(r)===e&&r>=0&&(e=r)}return x(t,e),v(t[e])},set:ur,deleteProperty(t,e){if(typeof e=="string"){let n=0|e;String(n)===e&&n>=0&&(e=n)}let r=t[e];return r===void 0&&!t.hasOwnProperty(e)&&(r=b),delete t[e],y(t,e,b,r),!0}};function ie(t){return{[Symbol.iterator](){return this},next(){let e=t.next();return e.done?e:{done:!1,value:v(e.value)}}}}function Ve(t){return{[Symbol.iterator](){return this},next(){let e=t.next();return e.done?e:{done:!1,value:[v(e.value[0]),v(e.value[1])]}}}}function z(t){return typeof t=="object"&&t&&t[g]||t}var $t={get(t){let e=this[g];return t=z(t),x(e,t),v(e.get(t))},set(t,e){let r=this[g];t=z(t),e=z(e);let n=r.get(t);if(n===void 0&&!r.has(t)&&(n=b),e!==n){let i=r.size;r.set(t,e),y(r,t,e,n),y(r,R,r.size,i)}return this},delete(t){let e=this[g];t=z(t);let r=e.get(t);r===void 0&&!e.has(t)&&(r=b);let n=e.delete(t);return n&&(y(e,t,b,r),y(e,R,e.size,e.size+1)),n},clear(){let t=this[g],e=t.size;for(let r of t.keys())y(t,r,void 0,t.get(r));t.clear(),y(t,R,0,e)},has(t){let e=this[g];return t=z(t),x(e,t),e.has(t)},keys(){let t=this[g];return x(t,$),ie(t.keys())},values(){let t=this[g];return x(t,$),ie(t.values())},entries(){let t=this[g];return x(t,$),Ve(t.entries())},[Symbol.iterator](){let t=this[g];return x(t,$),Ve(t[Symbol.iterator]())}},Pt={add(t){let e=this[g];if(t=z(t),!e.has(t)){let r=e.size;e.add(t),y(e,t,t,b),y(e,R,e.size,r)}return this},delete(t){let e=this[g];if(t=z(t),!e.has(t))return!1;let r=e.size;return e.delete(t),y(e,t,b,t),y(e,R,e.size,r),!0},clear(){let t=this[g],e=t.size;if(e){for(let r of t.values())y(t,r,b,r);t.clear(),y(t,R,0,e)}},has(t){let e=this[g];return t=z(t),x(e,t),e.has(t)},keys(){let t=this[g];return x(t,$),ie(t.keys())},values(){let t=this[g];return x(t,$),ie(t.values())},entries(){let t=this[g];return x(t,$),Ve(t.entries())},[Symbol.iterator](){let t=this[g];return x(t,$),ie(t[Symbol.iterator]())}},hr={get(t,e){return e===g?t:$t.hasOwnProperty(e)?$t[e]:e==="size"?(x(t,R),t.size):t[e]}},mr={get(t,e){return e===g?t:Pt.hasOwnProperty(e)?Pt[e]:e==="size"?(x(t,R),t.size):t[e]}},kt=new WeakMap;function v(t){if(typeof t!="object"||t===null||t[g]!==void 0||t[C])return t;let e=kt.get(t);if(e)return e;let r;return t instanceof Array?r=dr:t instanceof Map?r=hr:t instanceof Set?r=mr:r=fr,e=new Proxy(t,r),kt.set(t,e),e}function Se(t){if(t instanceof Promise){let e=v({busy:!0});return t.then(r=>{e.value=r,e.busy=!1}).catch(r=>{e.error=r,e.busy=!1}),e}return v(typeof t=="object"&&t!==null?t:{value:t})}function et(t){return t&&(t[g]||t)}var Ye=new WeakMap;function gr(t,e){let r=e.split(".").filter(n=>n);t.classList.add(...r),setTimeout(()=>t.remove(),2e3)}function pr(t,e,r){return arguments.length>2?Rt(t,e,r,0):tt(t,e,0)}function Rt(t,e,r,n){let i=_t(t,e);return r===i?!1:typeof i=="object"&&i!==null&&typeof r=="object"&&r!==null&&i.constructor===r.constructor?tt(i,r,n):(r=Qe(r),t instanceof Map?t.set(e,r):t[e]=Qe(r),!0)}function br(t,e,r){return arguments.length>2?Rt(t,e,r,Pe):tt(t,e,Pe)}function tt(t,e,r){let n=t[g];return n&&(t=n,r|=q),n=e[g],n&&(e=n,f!==J&&!fe&&(r|=K)),be(t,e,r)}function be(t,e,r){r&K&&x(e,$);let n=!1;if(e instanceof Array&&t instanceof Array){let i=t.length,s=e.length;for(let a=0;a<s;a++){let l=t[a];l===void 0&&!t.hasOwnProperty(a)&&(l=b);let c=e[a];if(c===void 0&&!e.hasOwnProperty(a))delete t[a],r&q&&y(t,a,b,l),n=!0;else if(l!==c){if(typeof c=="object"&&c!==null){if(typeof l=="object"&&l!==null&&c.constructor===l.constructor&&!(C in c)){n=be(l,c,r)||n;continue}c=ae(c,r&K)}t[a]=c,r&q&&y(t,a,c,l),n=!0}}if(s!==i){if(r&q){for(let a=s;a<i;a++){let l=t[a];delete t[a],y(t,a,b,l)}t.length=s,y(t,"length",s,i)}else t.length=s;n=!0}}else if(e instanceof Map&&t instanceof Map){for(let i of e.keys()){let s=e.get(i),a=t.get(i);if(a===void 0&&!t.has(i)&&(a=b),a!==s){if(typeof s=="object"&&s!==null){if(typeof a=="object"&&a!==null&&s.constructor===a.constructor&&!(C in s)){n=be(a,s,r)||n;continue}s=ae(s,r&K)}t.set(i,s),r&q&&y(t,i,s,a),n=!0}}if(!(r&Pe)){for(let i of t.keys())if(!e.has(i)){let s=t.get(i);t.delete(i),r&q&&y(t,i,b,s),n=!0}}}else if(e.constructor===t.constructor){for(let i of Object.keys(e)){let s=e[i],a=t.hasOwnProperty(i)?t[i]:b;if(a!==s){if(typeof s=="object"&&s!==null){if(typeof a=="object"&&a!==null&&s.constructor===a.constructor&&!(C in s)){n=be(a,s,r)||n;continue}s=ae(s,r&K)}t[i]=s,r&q&&y(t,i,s,a),n=!0}}if(!(r&Pe)){for(let i of Object.keys(t))if(!e.hasOwnProperty(i)){let s=t[i];delete t[i],r&q&&s!==void 0&&y(t,i,b,s),n=!0}}}else throw new Error(`Incompatible or non-object types: ${e?.constructor?.name||typeof e} vs ${t?.constructor?.name||typeof t}`);return n}var Pe=1,K=32,q=64,C=Symbol("OPAQUE"),yr=C;Promise.prototype[C]=!0;Date.prototype[C]=!0;Node.prototype[C]=!0;if(typeof Temporal<"u")for(let t of"Duration Instant PlainDate PlainDateTime PlainMonthDay PlainTime PlainYearMonth ZonedDateTime".split(" ")){let e=Temporal[t];e&&(e.prototype[C]=!0)}var oe=v({});function xr(t=1,e="rem"){for(let r=0;r<=12;r++)oe[r]=2**(r-3)*t+e}var wr=/(\burl\([^)]*\))|("[^"]*")|(^| )\$([\w-]+)/g,Mt=/^\d/;function It(t){return t.indexOf("$")<0?t:t.replace(wr,(e,r,n,i,s)=>{if(r||n)return e;let a=Mt.test(s)?`m${s}`:s;return`${i}var(--${a})`})}var me;function vr(){if(!me){if(typeof window>"u"||!window.matchMedia)return!1;let t=window.matchMedia("(prefers-color-scheme: dark)");me=Se({value:t.matches}),t.addEventListener("change",()=>me.value=t.matches)}return me.value}function ae(t,e){if(C in t)return t;if(e&K&&x(t,$),t instanceof Array)return t.map(n=>_e(n,e));if(t instanceof Map){let n=new Map;for(let[i,s]of t)n.set(i,_e(s,e));return n}let r=Object.create(Object.getPrototypeOf(t));for(let n of Object.keys(t))r[n]=_e(t[n],e);return r}function _e(t,e){return typeof t=="object"&&t!==null?ae(t,e):t}function Qe(t){if(typeof t!="object"||t===null)return t;let e=0,r=t[g];return r&&(t=r,f!==J&&!fe&&(e=K)),ae(t,e)}var $r={get(t,e){if(e===g)return ke(et(t.proxy),t.index);if(e==="value")return t.proxy[t.index]},set(t,e,r){return e==="value"?(t.proxy[t.index]=r,!0):!1}};function ke(t,e){return new Proxy({proxy:t,index:e},$r)}function Pr(t,e){let r,n,i=t.getAttribute("type"),s=et(e).value;i==="checkbox"?(s===void 0&&(e.value=t.checked),r=()=>{t.checked=e.value},n=()=>{e.value=t.checked}):i==="radio"?(s===void 0&&t.checked&&(e.value=t.value),r=()=>{t.checked=e.value===t.value},n=()=>{t.checked&&(e.value=t.value)}):(n=()=>{e.value=i==="number"||i==="range"?t.value===""?null:+t.value:t.value},s===void 0&&n(),r=()=>{t.value=e.value,t.tagName==="SELECT"&&t.value!=e.value&&new Be(()=>t.value=e.value)}),qt(r),t.addEventListener("input",n),M(()=>{t.removeEventListener("input",n)})}var Ue=/\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|\[(.+?)\]\((.+?)\)/g,Ae={create:(t,e)=>{if(f===E)if(typeof e=="function")e(t);else{let r=e.split(".").filter(n=>n);t.classList.add(...r),(async()=>(t.offsetHeight,t.classList.remove(...r)))()}},destroy:(t,e)=>{Ye.set(t,e)},html:(t,e)=>{if(t===f.el&&!t.firstChild)t.innerHTML=`${e}`;else{let r=document.createElement(f.el.tagName);for(r.innerHTML=`${e}`;r.firstChild;)B(t,r.firstChild)}},text:(t,e)=>{B(t,document.createTextNode(e))},rich:(t,e)=>{let r=0,n,i=String(e);for(Ue.lastIndex=0;(n=Ue.exec(i))!==null;){n.index>r&&B(t,document.createTextNode(i.slice(r,n.index)));let s;if(n[1]!==void 0)s=document.createElement("strong"),s.textContent=n[1];else if(n[2]!==void 0)s=document.createElement("em"),s.textContent=n[2];else if(n[3]!==void 0)s=document.createElement("code"),s.textContent=n[3];else{let a=document.createElement("a");a.textContent=n[4],a.href=n[5],s=a}B(t,s),r=Ue.lastIndex}r<i.length&&B(t,document.createTextNode(i.slice(r)))}};function kr(){Ae.create=Ae.destroy=()=>{}}function P(...t){let e=f.el,r=f.svg,n=t.length;for(let i=0;i<n;i++){let s=t[i];if(!(s==null||s===!1))if(typeof s=="string"){let a=s.length,l=0;for(let c=0;c<a;c=l+1){l=F(s," .=:#",c);let d=s[l];if(d===":"){let u="$"+s.substring(c,l);if(l+1>=a){S(e,u,t[++i]);break}if(s[l+1]===" "){let p=F(s,";",l+2),h=s.substring(l+2,p).trim();S(e,u,h),l=p}else{let p=F(s," ",l+1),h=s.substring(l+1,p);S(e,u,h),l=p}}else if(d==="="){let u=s.substring(c,l);if(l+1>=a){S(e,u,t[++i]);break}let p=s[l+1];if(p==='"'||p==="'"||p==="`"){let h=F(s,p,l+2),w=s.substring(l+2,h);S(e,u,w),l=h}else{let h=F(s," ",l+1),w=s.substring(l+1,h);S(e,u,w),l=h}}else{if(l>c){let u=s.substring(c,l);r||=u==="svg";let p=r?document.createElementNS("http://www.w3.org/2000/svg",u):document.createElement(u);B(e,p),e=p}if(d==="#"){let u=l+1<a?s.substring(l+1):t[++i];S(e,"text",u);break}if(d==="."){let u=F(s," #=.",l+1);if(s[u]==="="&&u+1>=a)S(e,s.substring(l,u),t[++i]),l=u;else{let h=s.substring(l+1,u)||t[++i];e.classList.contains(h)||(e===f.el&&H(f,0,h,!1),e.classList.add(h)),l=u-1}}}}}else if(typeof s=="object")if(s.constructor!==Object)if(s instanceof Node)B(e,s),s instanceof Element&&(e=s,r=s.namespaceURI==="http://www.w3.org/2000/svg");else throw new Error(`Unexpected argument: ${s}`);else for(let a of Object.keys(s))S(e,a,s[a]);else if(typeof s=="function")new we(e,r,s);else throw new Error(`Unexpected argument: ${s}`)}return e}function F(t,e,r){if(e.length===1){let i=t.indexOf(e,r);return i>=0?i:t.length}let n=t.length;for(let i=r;i<n;i++)if(e.indexOf(t[i])>=0)return i;return n}var Tt=0;function Ar(t){let e=`.AbdStl${++Tt}`,r=typeof t=="string"?Je(t,e):Ce(t,e);if(r){let n=Ot++;Q[n]=r,M(()=>delete Q[n])}return e}var Q=Se({}),Ot=0;function At(t,e){let r=[];for(let n of t.split(","))for(let i of e.split(","))r.push(i.includes("&")?i.trim().replace(/&/g,n):`${n} ${i.trim()}`.trim());return r.join(",")}function Ce(t,e){let r="";for(let[n,i]of Object.entries(t))i&&typeof i=="object"?n.startsWith("@")?r+=`${n}{
2
+ ${Ce(i,e)}}
3
+ `:r+=Ce(i,At(e,n)):typeof i=="string"&&(n.startsWith("@")?r+=`${n}{
4
+ ${Je(i,e)}}
5
+ `:r+=Je(i,At(e,n)));return r}var Cr=/-([a-z])/g;function Sr(t){return t.replace(Cr,(e,r)=>r.toUpperCase())}var Er=/^[a-zA-Z-]+$/;function Je(t,e){let r="";for(let n=0,i=t.length;n<i;){for(;t[n]===" ";)n++;if(n>=i)break;let s=t.indexOf(":",n);if(s===-1)throw new Error(`Trailing data in style string: "${t.substring(n)}"`);let a=t.substring(n,s);if(!Er.test(a))throw new Error(`Invalid CSS key: "${a}" in style string: "${t}"`);n=s+1;let l;if(t[n]===" "){n++;let u=t.indexOf(";",n);l=t.substring(n,u===-1?i:u).trim(),n=u===-1?i:u+1}else{let u=t.indexOf(" ",n);l=t.substring(n,u===-1?i:u),n=u===-1?i:u}let c=It(l),d=Nt[a]||a;r+=typeof d=="string"?`${d}:${c};`:d.map(u=>`${u}:${c};`).join("")}return r?`${e}{${r}}
6
+ `:""}function Rr(t){let e=Ce(t,"");if(e){let r=Ot++;Q[r]=e,M(()=>delete Q[r])}}var Nt={m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mh:["margin-left","margin-right"],mv:["margin-top","margin-bottom"],p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",ph:["padding-left","padding-right"],pv:["padding-top","padding-bottom"],w:"width",h:"height",bg:"background",fg:"color",r:"border-radius"};function S(t,e,r){if(typeof r=="object"&&r!==null&&r[g])e==="bind"?Pr(t,r):new Ge(t,e,r);else if(e[0]==="."){let n=e.substring(1).split("."),i=t.classList,s=!!r;if(t===f.el)for(let a of n){let l=i.contains(a);l!==s&&H(f,0,a,l)}s?i.add(...n):i.remove(...n)}else if(e[0]==="$"){e=e.substring(1);let n=r==null||r===!1?"":typeof r=="string"?It(r):String(r),i=Nt[e]||e,s=t.style,a=t===f.el,l=typeof i=="string"?[i]:i;for(let c of l){let d=Sr(c);a&&H(f,1,d,s[d]),s[d]=n}}else r==null||(e in Ae?Ae[e](t,r):typeof r=="function"?(t.addEventListener(e,r),t===f.el&&H(f,4,e,r)):r===!0||r===!1||e==="value"||e==="selectedIndex"?(t===f.el&&H(f,2,e,t[e]),t[e]=r):(t===f.el&&H(f,3,e,t.getAttribute(e)),t.setAttribute(e,r)))}function jt(t){return console.error("Error while in Aberdeen render:",t),!0}var Lt=jt;function Mr(t){Lt=t||jt}function M(t){f.cleaners.push(t)}function qt(t){return new De(t).result}function zt(t,e){new Ke(t,e)}function Ir(){J.remove(),Tt=0}function _t(t,e){fe++;try{return arguments.length===1?t():t instanceof Map?t.get(e):t[e]}finally{fe--}}function Tr(t,e){let r;return t instanceof Array?r=v([]):t instanceof Map?r=v(new Map):r=v({}),X(t,(n,i)=>{let s=e(n,i);s!==void 0&&(r instanceof Map?(r.set(i,s),M(()=>{r.delete(i)})):(r[i]=s,M(()=>{delete r[i]})))}),r}function Or(t,e){let r=v({});return X(t,(n,i)=>{let s=e(n,i);if(s){for(let a of Object.keys(s))r[a]=s[a];M(()=>{for(let a of Object.keys(s))delete r[a]})}}),r}function Nr(t,e){let r={},n=v(r);return X(t,(i,s)=>{let a=e(i,s);if(a!=null){let l=a instanceof Array?a:[a];if(l.length){for(let c of l)r[c]?n[c][s]=i:n[c]={[s]:i};M(()=>{for(let c of l)delete n[c][s],He(r[c])&&delete n[c]})}}}),n}function jr(t){let e=ge;ge||=new Set;try{Ut(t,ge)}finally{ge=e}return t}var ge;function Ut(t,e){if(t&&typeof t=="object"){let r=t.constructor.name||"unknown object";if(e.has(t)){P(`#<${r}: circular reference>`);return}e.add(t),M(()=>e.delete(t));let n=t[rt];n!==void 0?typeof n=="function"?n.call(t):P(`#${n}`):P(`#<${r}>`,"ul",()=>{X(t,(i,s)=>{P("li",()=>{t instanceof Array||P(`#${JSON.stringify(s)}: `),Ut(i,e)})})})}else P(t===void 0?"#undefined":"#"+JSON.stringify(t))}var rt=Symbol("CUSTOM_DUMP");Date.prototype[rt]=function(){P("#<Date> "+this.toISOString())};function Ct(t){throw new Error(`Aberdeen internal error ${t}`)}function nt(t,e){try{Lt(t)===!1&&(e=!1)}catch(r){console.error(r)}try{e&&P("div.aberdeen-error#Error")}catch{}}typeof document<"u"&&Ze(()=>{P(()=>{pe(Q)&&pe(oe)||zt(document.head,()=>{P("style.abd",()=>{X(Q,t=>{P("#",t)}),P(()=>{if(pe(oe))return;let t=":root{";for(let[e,r]of Object.entries(oe)){let n=Mt.test(String(e))?`m${e}`:e;t+=`--${n}:${r};`}t+=`}
7
+ `,P("#",t)})})})})});var o=Object.assign(P,{clean:M,clone:Qe,copy:pr,count:lr,cssVars:oe,CUSTOM_DUMP:rt,darkMode:vr,derive:qt,disableCreateDestroy:kr,dump:jr,insertCss:Ar,insertGlobalCss:Rr,invertString:ar,isEmpty:pe,map:Tr,merge:br,mount:zt,multiMap:Or,OPAQUE:C,NO_COPY:yr,onEach:X,partition:Nr,peek:_t,proxy:Se,ref:ke,runQueue:St,setErrorHandler:Mr,setSpacingCssVars:xr,unmountAll:Ir,unproxy:et});var Lr="staffa:darkMode",qr=o.proxy({value:zr()});function zr(){try{let t=localStorage.getItem(Lr);if(t==="dark")return!0;if(t==="light")return!1}catch{}}function Bt(t=!1){let e=qr.value;return e===void 0&&!t?o.darkMode():e}o(()=>{Bt()?o.insertGlobalCss({":root":"--s-primary:#8b7bff --s-secondary:#ef7fd0 --s-danger:#ff6b6b --s-success:#46d39a --s-warning:#fbbf24 --s-neutral: color-mix(in oklab, #3d4047, $s-tint 14%); --s-page: color-mix(in oklab, #0e0f12, $s-tint 5%); --s-panel: color-mix(in oklab, #17181c, $s-tint 6%); --s-raised: color-mix(in oklab, #212327, $s-tint 8%); --s-ink: color-mix(in oklab, #e9eaec, $s-tint 8%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 45%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 34px rgba(0,0,0,0.5);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#6db3ff"}):o.insertGlobalCss({":root":"--s-primary:#6c5ce7 --s-secondary:#d6459e --s-danger:#e23b3b --s-success:#1f9d6b --s-warning:#d97706 --s-neutral: color-mix(in oklab, #c9cbd0, $s-tint 14%); --s-page: color-mix(in oklab, #f3f4f6, $s-tint 5%); --s-panel: color-mix(in oklab, #ffffff, $s-tint 2%); --s-raised: color-mix(in oklab, #edeef0, $s-tint 7%); --s-ink: color-mix(in oklab, #1d1f24, $s-tint 7%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 35%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 30px rgba(20,24,40,0.13);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#2563eb"})});o.setSpacingCssVars();o.insertGlobalCss({":root":"--s-tint: color-mix(in oklab, $s-primary, $s-secondary); --s-gradient: linear-gradient(135deg, $s-primary, $s-secondary); --s-gradient-surface: linear-gradient(170deg, color-mix(in oklab, $s-primary 85%, $s-secondary), color-mix(in oklab, $s-primary 30%, $s-secondary)); --s-glow: 0 5px 16px color-mix(in srgb, $s-primary 26%, transparent); --s-page-bg: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, $s-secondary, transparent 86%), transparent 56%), radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, $s-primary, transparent 87%), transparent 56%), $s-page;",":root, .s-s.base":"--s-a:$s-ink --s-b:$s-page",".s-s.base":"background: $s-page-bg;",".s-s.panel":"--s-a:$s-ink --s-b:$s-panel",".s-s.raised":"--s-a:$s-ink --s-b:$s-raised",".s-s.neutral":"--s-a:$s-ink --s-b:$s-neutral",".s-s.primary":"--s-a:$s-on-accent --s-b:$s-primary",".s-s.secondary":"--s-a:$s-on-accent --s-b:$s-secondary",".s-s.danger":"--s-a:$s-on-accent --s-b:$s-danger",".s-s.success":"--s-a:$s-on-accent --s-b:$s-success",".s-s.warning":"--s-a:$s-on-accent --s-b:$s-warning",".s-s.gradient":"--s-a:$s-on-accent --s-b:$s-primary",":root, .s-s":"--s-fg:$s-a --s-bg:$s-b --s-fg-muted: color-mix(in oklab, $s-fg, $s-bg 42%); --s-fg-faint: color-mix(in oklab, $s-fg, $s-bg 64%); --s-border: color-mix(in oklab, $s-fg, $s-bg 82%); --s-border-strong: color-mix(in oklab, $s-fg, $s-bg 68%); scrollbar-width:thin scrollbar-color: $s-border-strong transparent; background:$s-bg color:$s-fg r:$s-radius",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover":"background:$s-fg-faint background-clip:padding-box",".s-s.tonal":"--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent); border: 1px solid $s-border;",".s-s.outlined":"--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg); border: 1px solid $s-border;",".s-s.filled":"--s-fg:$s-a --s-bg:$s-b background:$s-bg;",".s-s.gradient:not(.tonal):not(.outlined)":"background: $s-gradient-surface;",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-accent:$s-primary",".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient":"--s-accent:$s-fg --s-link:$s-fg",".s-s.primary .s-s.tonal, .s-s.secondary .s-s.tonal, .s-s.gradient .s-s.tonal, .s-s.danger .s-s.tonal, .s-s.success .s-s.tonal, .s-s.warning .s-s.tonal, .s-s.primary .s-s.outlined, .s-s.secondary .s-s.outlined, .s-s.gradient .s-s.outlined, .s-s.danger .s-s.outlined, .s-s.success .s-s.outlined, .s-s.warning .s-s.outlined":"--s-bg: $s-panel; background: $s-panel;"});o.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased",a:"color: $s-link; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select":"font:inherit color:inherit","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-fg, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-fg, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-border;","::placeholder":"color: $s-fg-faint; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-fg-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"}});o.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let t=document.documentElement;t.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>t.classList.remove("s-preload")))}o.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var _r="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";o.insertGlobalCss({[`${_r}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-fg-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-border; padding-left: $3; fg: $s-fg-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-border; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-border-strong;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-fg-muted font-size:0.9em margin-top:$1 text-align:center"});var Ur=0;function ue(t="s"){return`${t}-${++Ur}`}function m(t,...e){t!=null&&(typeof t=="function"?t(...e):o("rich=",t))}function U(t){queueMicrotask(()=>o(t))}o.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-fg user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-fg-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color:$s-border-strong","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function de(t,e){let r=t.id??ue("field"),n=()=>!!t.error;o("div.s-field",t.attrs,()=>{o(()=>{t.label!=null&&o(`label for=${r}`,()=>{m(t.label),t.required&&o("span.s-req aria-hidden=true #*")})}),e(r,n),o(()=>{t.help!=null&&!t.error&&o("div.s-help",()=>m(t.help))}),o(()=>{t.error&&o("div.s-error role=alert #",t.error)})})}function Ee(t,e,r,n){o(`id=${e}`),t.name&&o(`name=${t.name}`),o(()=>{t.disabled&&o("disabled=true")}),o(()=>{t.required&&o("aria-required=true")}),o(()=>o("aria-invalid=",r()?"true":"false")),n&&o("bind=",n)}o.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color:$s-border-strong","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em bg:$s-raised border: 1px solid $s-border; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-fg background:$s-border",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0 bg:$s-panel border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-fg-muted"}});o.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column border: 1px solid $s-border; r: $s-radius-lg; overflow:hidden box-shadow: $s-shadow;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border;","> div":"p:$3 gap:$3"}});function I(t={}){let e=typeof t=="string"||typeof t=="function"?{content:t}:t;o("section.s-box.s-s.panel",e.attrs,()=>{o(()=>{e.header!=null&&o("header.s-s.raised",e.headerAttrs,()=>m(e.header))}),o("div",e.contentAttrs,()=>{m(e.content)}),o(()=>{e.footer!=null&&o("footer.s-s.raised",e.footerAttrs,()=>m(e.footer))})})}o.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none border:0 padding: 0.5em 1em; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus;","&:hover":"filter: brightness(1.08)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-b 26%, transparent);","&.gradient:not(.tonal):not(.outlined)":"box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), $s-glow;","&.gradient:not(.tonal):not(.outlined):hover":"filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), 0 7px 18px color-mix(in srgb, $s-primary 34%, transparent);","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: 0.32em 0.7em; font-size:0.85em","&.large, .large > &":"padding: 0.66em 1.3em; font-size:1.1em"}});var Br=/\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;function T(t={}){let e=typeof t=="string"||typeof t=="function"?{content:t}:t,r=e.href!=null?"a":"button",n=e.attrs&&Br.test(e.attrs)?"":".gradient";o(`${r}.s-btn.s-s${n}`,e.attrs,()=>{e.href!=null?(o(`href=${e.href} role=button`),e.disabled&&o("aria-disabled=true")):(o("type=",e.type??"button"),e.disabled&&o("disabled=true")),e.ariaLabel&&o("aria-label=",e.ariaLabel),e.click&&o("click=",e.click),m(e.icon),m(e.content)})}o.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function Re(t={}){let r=`.s-${t.layout??"attached"}${t.vertical?".s-vertical":""}`;o(`div.s-bgroup${r} role=group`,t.attrs,()=>{if(t.buttons)for(let n of t.buttons)T(n);m(t.content)})}o.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0"}});o.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function st(t={}){let e=typeof t=="string"||typeof t=="function"?{content:t}:t;o("form.s-form",e.attrs,()=>{o(()=>{o(".grid=",e.layout==="grid")}),o("submit=",r=>{if(r.preventDefault(),e.submit){let n=new FormData(r.target),i={};for(let s of new Set(n.keys())){let a=n.getAll(s);i[s]=a.length===1?a[0]:a}e.submit(i,r)}}),m(e.content),o(()=>{e.actions&&o("footer",e.actionsAttrs,()=>m(e.actions))})})}var at=()=>{};var lt=typeof ABERDEEN_FAKE_WINDOW<"u"?ABERDEEN_FAKE_WINDOW:window,N=lt.location,D=lt.history;function Kt(){return Dt({path:N.pathname,hash:N.hash,search:Object.fromEntries(new URLSearchParams(N.search)),state:D.state?.state||{}},"load",(D.state?.stack?.length||0)+1)}function it(t,e,r){if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e||t.constructor!==e.constructor)return!1;if(e instanceof Array){if(t.length!==e.length)return!1;for(let n=0;n<e.length;n++)if(!it(t[n],e[n],r))return!1}else{for(let n of Object.keys(e))if(!it(t[n],e[n],r))return!1;if(!r){for(let n of Object.keys(t))if(!e.hasOwnProperty(n))return!1}}return!0}function Kr(t){let e=new URLSearchParams(t.search).toString();return(e?`${t.path}?${e}`:t.path)+t.hash}function Dt(t,e,r){let n=t.path||(t.p||[]).join("/")||"/";return n=(""+n).replace(/\/+$/,""),n.startsWith("/")||(n=`/${n}`),{path:n,hash:t.hash&&t.hash!=="#"?t.hash.startsWith("#")?t.hash:"#"+t.hash:"",p:n.length>1?n.slice(1).replace(/\/+$/,"").split("/"):[],nav:e,search:typeof t.search=="object"&&t.search?o.clone(t.search):{},state:typeof t.state=="object"&&t.state?o.clone(t.state):{},depth:r}}function Dr(t,e=!1){if(typeof t=="string"){let r=new URL(t,N.href);if(r.host!==N.host){if(e)return;throw new Error(`Unexpected external URL: ${r.host} != ${N.host}`)}t={path:r.pathname,search:Object.fromEntries(r.searchParams),hash:r.hash}}else t instanceof Array&&(t={p:t});if(t.p&&(t.p=t.p.map(String)),t.search)for(let r of Object.keys(t.search))t.search[r]=String(t.search[r]);return t}function Gt(t){let e=Dr(t,!0);if(!e)return!1;if(e.path!=null||e.p!=null){let r=e.path||(e.p||[]).join("/")||"/";if(r=(""+r).replace(/\/+$/,""),r.startsWith("/")||(r=`/${r}`),!ot[r])return!1}if(e.search){for(let[r,n]of Object.entries(e.search))if(!ot[`${r}=${n}`])return!1}return!0}var Z,Gr=0;var O=o.proxy({}),ot=o.proxy({});function Wr(){Z=D.state?.stack||[];let t=Kt();at("initial",t),o.copy(o.unproxy(O),t)}Wr();lt.addEventListener("popstate",function(t){Gr=0;let e=Kt(),r=D.state?.stack||[];if(r.length!==Z.length){let n=Math.min(Z.length,r.length)-1;(n<0||r[n]===Z[n])&&(e.nav=r.length<Z.length?"back":"forward")}Z=r,at("popstate",e),o.copy(O,e),o.runQueue()});Ze(()=>{o(()=>{O.path="/"+Array.from(O.p).join("/")}),o(()=>{let t=D.state?.stack||[],e=Dt(O,o.unproxy(O).nav,t.length+1);o.copy(O,e);let r={state:e.state,stack:t},n=Kr(e);(n!==N.pathname+N.search+N.hash||!it(D.state,r,!1))&&(at("replaceState",e,r,n),D.replaceState(r,"",n))}),o(()=>{let t={};t[O.path]=!0;for(let[e,r]of Object.entries(O.search))t[`${e}=${r}`]=!0;o.copy(ot,t)})});o.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 border: 1px solid $s-border; r:$s-radius-lg box-shadow:$s-shadow overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item, .s-menu-item-link":"display:flex align-items:center gap:$2 w:100% padding: 0.5em 0.65em; r:$s-radius cursor:pointer text-align:left font-size:0.9em border:0 background:transparent fg:$s-fg text-decoration:none transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;",".s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page]), .s-menu-item-link:hover:not([aria-current=page])":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-menu-item[aria-current=page], .s-menu-item-link[aria-current=page]":"color:$s-on-accent font-weight:600 background: $s-gradient; box-shadow: 0 3px 10px color-mix(in srgb, $s-primary 38%, transparent);",".s-menu-item[aria-current=page] .s-menu-icon, .s-menu-item-link[aria-current=page] .s-menu-icon":"color:$s-on-accent",".s-menu-item[aria-current=page]:hover, .s-menu-item-link[aria-current=page]:hover":"filter:brightness(1.06)",".s-menu-item:focus-visible, .s-menu-item-link:focus-visible":"outline:none background: color-mix(in srgb, $s-fg 10%, transparent); box-shadow: 0 0 0 2px inset $s-focus;",".s-menu-item[aria-disabled=true], .s-menu-item-link[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"fg:$s-fg-muted flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);"});function ct(t,e){o("keydown=",r=>{if(r.key!=="ArrowDown"&&r.key!=="ArrowUp"&&r.key!=="Home"&&r.key!=="End")return;r.preventDefault();let i=[...r.currentTarget.querySelectorAll(".s-menu-item, .s-menu-item-link")].filter(c=>c.getAttribute("aria-disabled")!=="true");if(!i.length)return;let s=i.indexOf(document.activeElement),a=r.key==="ArrowUp"?-1:1,l=r.key==="Home"?0:r.key==="End"?i.length-1:s<0?a>0?0:i.length-1:(s+a+i.length)%i.length;i[l].focus()});for(let r of t){if(typeof r=="string"||typeof r=="function"){m(r);continue}if("separator"in r){o("hr.s-menu-sep");continue}o(r.href?"a.s-menu-item-link":"button.s-menu-item type=button",r.attrs,()=>{r.href&&(o("href=",r.href),r.target&&o("target=",r.target),o(()=>{Gt(r.href)&&o("aria-current=page")})),r.disabled&&o("aria-disabled=true"),o("click=",n=>{if(r.disabled){n.preventDefault();return}e?.(),r.click?.(n)}),r.icon&&o("span.s-menu-icon",()=>m(r.icon)),m(r.label)})}}var te=o.proxy({opts:null});function ee(){let t=te.opts?.anchor;te.opts=null,t?.focus()}function Fr(t,e){let r=t.offsetWidth,n=t.offsetHeight,i=window.innerWidth,s=window.innerHeight,a=4,l=e.left;l+r>i-8&&(l=Math.max(8,e.right-r));let c=e.bottom+a;c+n>s-8&&e.top-n-a>=8&&(c=e.top-n-a),t.style.left=Math.max(8,l)+"px",t.style.top=Math.max(8,c)+"px"}U(()=>{let t=te.opts;if(!t)return;let e=o("div.s-menu-list.s-s.panel create=hidden destroy=hidden",t.dropdownAttrs,()=>{ct(t.items,ee)}),r=i=>{let s=i.target;!e.contains(s)&&!t.anchor.contains(s)&&ee()},n=i=>{(i.key==="Escape"||i.key==="Tab")&&(i.preventDefault(),ee())};document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),o.clean(()=>{document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0)}),requestAnimationFrame(()=>{document.body.contains(e)&&(Fr(e,t.anchor.getBoundingClientRect()),e.querySelector(".s-menu-item:not([aria-disabled=true]), .s-menu-item-link:not([aria-disabled=true])")?.focus())})});function Wt(t){return te.opts=t,ee}function ft(t){let e=null;o.clean(()=>{te.opts?.anchor===e&&ee()}),T({icon:()=>o("span aria-hidden=true #\u2630"),...t.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral .outlined",...t.button,click:r=>{if(e=r.currentTarget,te.opts?.anchor===e){ee();return}Wt({items:t.items,anchor:e,dropdownAttrs:t.dropdownAttrs})}})}o.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border-bottom: 1px solid $s-border; position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-border; fg:$s-fg-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-fg-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center",".s-body-inner":"flex:1 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);",".s-body main":"flex:1 min-height:0 overflow-y:auto display:flex flex-direction:column",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1 background:transparent"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex","@container (max-width: 640px)":{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0",".s-main .s-body main.s-scroll-y":"margin-right:0"}});function ut(t={}){let e=t.nav,r=t.navPosition??"left",n=e!=null&&e.items.length>0,i=n?r==="button"?".s-nav-btn-only":`.s-nav-${r}`:"";o(`div.s-main.s-s.base${i}`,t.attrs,()=>{o(()=>{(t.title!=null||t.subtitle!=null||t.icon!=null||t.menu!=null||n)&&o("header.s-s.raised",t.topbarAttrs,()=>{o("div.s-bar",()=>{o(()=>{t.maxWidth!=null&&o("max-width:",t.maxWidth)}),o(()=>{n&&o("div.s-nav-trigger",()=>{ft({...e,button:{icon:()=>o("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .outlined .small",...e.button}})})}),o(()=>{t.icon!=null&&o("div.s-header-icon",()=>m(t.icon))}),o("div.s-titles",()=>{o(()=>{t.title!=null&&o("div.s-title",()=>m(t.title))}),o(()=>{t.subtitle!=null&&o("div.s-subtitle",()=>m(t.subtitle))})}),o(()=>{t.menu&&o("div.s-menu",()=>m(t.menu))})})})}),o("div.s-body",()=>{o("div.s-body-inner",()=>{o(()=>{t.maxWidth!=null&&o("max-width:",t.maxWidth)}),n&&r!=="button"&&(o(`nav.s-nav-panel.s-s.raised.s-nav-${r}`,t.navAttrs,()=>{ct(e.items)}),o("div.s-nav-sep aria-hidden=true")),Hr(t)})}),o(()=>{t.footer!=null&&o("footer",()=>{o("div.s-bar",()=>{o(()=>{t.maxWidth!=null&&o("max-width:",t.maxWidth)}),m(t.footer)})})})})}function Hr(t){let e=o("main",()=>{o("div.s-content",t.contentAttrs,()=>{m(t.content)})});Vr(e)}function Vr(t){if(typeof ResizeObserver>"u")return;let e=()=>t.classList.toggle("s-scroll-y",t.offsetWidth>t.clientWidth),r=new ResizeObserver(e);r.observe(t),t.firstElementChild&&r.observe(t.firstElementChild),e(),o.clean(()=>r.disconnect())}function Me(t={}){de(t,(e,r)=>{o("input.s-input",t.inputAttrs,()=>{o("type=",t.type??"text"),t.placeholder!=null&&o("placeholder=",t.placeholder),t.autocomplete!=null&&o("autocomplete=",t.autocomplete),t.value!=null&&!t.bind&&o("value=",t.value),t.input&&o("input=",t.input),t.change&&o("change=",t.change),Ee(t,e,r,t.bind)})})}o.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) border: 1px solid $s-border; r: $s-radius-lg; box-shadow: $s-shadow; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border; flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var G=o.proxy({}),dt=0,Yr=o.derive(()=>{let t=Object.keys(G);if(t.length)return t[t.length-1]});U(()=>{o.onEach(G,({resolve:t,opts:e},r)=>{let n=()=>{delete G[r]};o.clean(()=>{e.onClose?.(),t()});let i=o.derive(()=>Yr.value!=r);o("div.s-backdrop create=hidden destroy=hidden .hidden=",i,"click=",()=>{e.allowCancel!==!1&&n()}),o("div.s-dialog.s-s.panel create=hidden destroy=hidden",e.attrs,()=>{o(()=>{e.header!=null&&o("header.s-s.raised",e.headerAttrs,()=>m(e.header))}),o("div",e.contentAttrs,()=>{m(e.content,n)}),o(()=>{e.footer!=null&&o("footer.s-s.raised",e.footerAttrs,()=>m(e.footer))})})})});function Ft(t){dt||document.addEventListener("keydown",r=>{if(r.key==="Escape"&&t.allowCancel!==!1){let n=o.unproxy(G);for(let i=dt;i>0;i--)if(n[i]){n[i].opts.allowCancel!==!1&&delete G[i];break}}});let e=++dt;return t.cancelWithScope!==!1&&o.clean(()=>{delete G[e]}),new Promise(r=>{G[e]={resolve:r,opts:t}})}function ht(t,e={}){return Ft({header:"Alert",allowCancel:!0,content:r=>{o("p",()=>{o("#",t)}),Re({layout:"spaced",attrs:"align-self:flex-end",content:()=>{T({content:"OK",click:r})}})},...e})}o.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-fg-muted font-size:0.85em"}});o.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tablist":"display:flex gap:$1 align-items:stretch overflow-x:auto scrollbar-width:none border-bottom: 1px solid $s-border;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-fg-muted; font-weight:600 padding: 0.6em 0.9em; border-bottom: 3px solid transparent; margin-bottom:-1px transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-fg;",".s-tab:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});o.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});var Ie=400,Ht=`margin ${Ie}ms ease-out, transform ${Ie}ms ease-out`;function Vt(t){if(t.parentElement){let e=getComputedStyle(t.parentElement);if(e.display==="flex"&&(e.flexDirection||"").startsWith("row"))return{marginLeft:`-${t.offsetWidth/2}px`,marginRight:`-${t.offsetWidth/2}px`,transform:"scaleX(0)"}}return{marginBottom:`-${t.offsetHeight/2}px`,marginTop:`-${t.offsetHeight/2}px`,transform:"scaleY(0)"}}async function Yt(t){let e=Vt(t);Object.assign(t.style,e),t.offsetHeight,t.style.transition=Ht;for(let r in e)t.style[r]="";setTimeout(()=>{t.style.transition=""},Ie)}async function Qt(t){let e=Vt(t);t.style.transition=Ht,Object.assign(t.style,e),setTimeout(()=>{t.remove()},Ie)}o.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-msg":"font-size:0.9em fg:$s-fg-muted line-height:1.4",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-fg",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var Te=o.proxy({});U(()=>{o.peek(()=>o.isEmpty(Te))&&o.isEmpty(Te)||o("div.s-toasts aria-live=polite aria-atomic=false",()=>{o.onEach(Te,t=>{let{opts:e,id:r}=t,n=e.type==="danger"||e.type==="warning"?"alert":"status",i=e.type??"neutral",s=e.duration??6e3,a,l=null,c=()=>{clearTimeout(a),l&&(l.style.transition="none",l.style.width="100%",l.offsetWidth,l.style.transition=`width ${s}ms linear`,l.style.width="0%"),a=setTimeout(()=>Jt(r),s)},d=()=>{clearTimeout(a),a=void 0,l&&(l.style.transition="none",l.style.width="100%")};o.clean(()=>clearTimeout(a)),o(`div.s-toast.s-s.${i} role=${n}`,"create=",Yt,"destroy=",Qt,e.attrs,()=>{s>0&&(o("mouseenter=",d),o("mouseleave=",c)),o("div.s-toast-body",()=>{o(()=>{e.title!=null&&o("div.s-toast-title",()=>m(e.title))}),o("div.s-toast-msg",()=>m(e.message))}),o(()=>{e.dismissible!==!1&&o("button.s-toast-close type=button aria-label=Dismiss",()=>{o("#\xD7"),o("click=",()=>Jt(r))})}),s>0&&(l=o("div.s-toast-progress"))}),s>0&&requestAnimationFrame(c)})})});function Jt(t){delete Te[t]}o.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content bg:$s-raised fg:$s-fg border: 1px solid $s-border-strong; r:$s-radius box-shadow:$s-shadow padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var mt=o.proxy(void 0),W=null;typeof window<"u"&&window.addEventListener("scroll",()=>{mt.value=void 0},{capture:!0,passive:!0});function Qr(t,e,r,n){let s=window.innerWidth,a=window.innerHeight,l=0,c=0;return n==="bottom"?(l=t.left+(t.width-e)/2,c=t.bottom+7,c+r>a-8&&(c=t.top-r-7)):n==="left"?(l=t.left-e-7,c=t.top+(t.height-r)/2,l<8&&(l=t.right+7)):n==="right"?(l=t.right+7,c=t.top+(t.height-r)/2,l+e>s-8&&(l=t.left-e-7)):(l=t.left+(t.width-e)/2,c=t.top-r-7,c<8&&(c=t.bottom+7)),{x:Math.max(8,Math.min(l,s-e-8)),y:Math.max(8,Math.min(c,a-r-8))}}function Jr(){W&&clearTimeout(W),W=setTimeout(()=>{mt.value=void 0,W=null},100)}U(()=>{let t=mt.value;if(!t)return;let{opts:e,anchor:r}=t,n=e.placement??"top",i=o("div.s-tt-tip role=tooltip visibility:hidden",e.attrs,()=>{o("mouseenter=",()=>{W&&(clearTimeout(W),W=null)}),o("mouseleave=",Jr),m(e.tip)});requestAnimationFrame(()=>{if(!document.body.contains(i))return;let{x:s,y:a}=Qr(r.getBoundingClientRect(),i.offsetWidth,i.offsetHeight,n);i.style.left=s+"px",i.style.top=a+"px",i.style.visibility=""})});var Zr=new TextEncoder,gt=new TextDecoder("utf-8",{fatal:!0}),re=Symbol("EOD"),je="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$",er=new Uint8Array(128).fill(255);for(let t=0;t<je.length;++t)er[je.charCodeAt(t)]=t;var pt=typeof process<"u"&&process?.stdout?.isTTY,Oe=pt?["\x1B[32m","\x1B[33m","\x1B[34m","\x1B[35m"]:[""],en=pt?"\x1B[0m":"",Xt=pt?"\x1B[31m":"",Zt={array:5,object:6,map:7,set:8,end:9},Ne=0,tn=typeof process<"u"?!!process.env?.DATAPACK_EXTENDED_LOGGING:!1,j=class t{buffer;dataView;readPos=0;writePos=0;static EOD=re;get _buffer(){return this.buffer}constructor(e=1900){e instanceof Uint8Array?(this.buffer=e,this.writePos=e.length):this.buffer=new Uint8Array(e)}writeMultiByteNumber(e,r,n=!1,i=!1){let s=0,a=e;for(;a>0;)s++,a=Math.floor(a/256);let l=i?~s&31:s;this.buffer[this.writePos++]=r<<5|l;let c=1;for(let d=0;d<s;d++)c*=256;for(let d=0;d<s;d++){c=Math.floor(c/256);let u=Math.floor(e/c)%256;n&&(u^=255),this.buffer[this.writePos++]=u}}readMultiByteNumber(e,r=!1){this.readPos+e>this.writePos&&this.notEnoughData("number");let n=0,i=1;for(let s=e-1;s>=0;s--){let a=this.buffer[this.readPos+s];r&&(a^=255),n+=a*i,i*=256}return this.readPos+=e,n}notEnoughData(e){throw new Error(`Not enough data to read a ${e} at position ${this.readPos} in
8
+ ${this.toString(!0)}`)}write(e){if(this.ensureCapacity(33),typeof e=="number")Number.isInteger(e)&&e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER?e>=0?e<32?this.buffer[this.writePos++]=32|e:e<64?this.buffer[this.writePos++]=64|e-32:this.writeMultiByteNumber(e-64,3):this.writeMultiByteNumber(-e,0,!0,!0):(this.buffer[this.writePos++]=128,this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.dataView.setFloat64(this.writePos,e),this.writePos+=8);else if(e===void 0)this.buffer[this.writePos++]=129;else if(e===null)this.buffer[this.writePos++]=130;else if(e===!0)this.buffer[this.writePos++]=131;else if(e===!1)this.buffer[this.writePos++]=132;else if(typeof e=="string"){let r=Zr.encode(e);r.length<32?this.buffer[this.writePos++]=160|r.length:this.writeMultiByteNumber(r.length,6),this.ensureCapacity(r.length),this.buffer.set(r,this.writePos),this.writePos+=r.length}else if(e instanceof Uint8Array)this.writeMultiByteNumber(e.length,7),this.ensureCapacity(e.length),this.buffer.set(e,this.writePos),this.writePos+=e.length;else if(Array.isArray(e)||typeof e.length=="number"&&typeof e[Symbol.iterator]=="function"){this.buffer[this.writePos++]=133;for(let r of e)this.write(r);this.buffer[this.writePos++]=137}else if(e instanceof Map){this.buffer[this.writePos++]=135;for(let[r,n]of e)this.write(r),this.write(n);this.buffer[this.writePos++]=137}else if(e instanceof Set){this.buffer[this.writePos++]=136;for(let r of e)this.write(r);this.buffer[this.writePos++]=137}else if(e instanceof Date)this.buffer[this.writePos++]=140,this.write(Math.floor(e.getTime()/1e3));else if(typeof e=="object")e instanceof he?this.writeCustom(e.name,e.data):typeof e.toDataPack=="function"?e.toDataPack(this):this.writeAsObject(e);else throw new Error(`Unsupported data type: ${typeof e}`);return this}read(e){if(this.readPos>this.writePos)throw new Error("Not enough data");let r=this.buffer[this.readPos++],n=r>>5&7,i=r&31;switch(n){case 0:{let s=~i&31;return-this.readMultiByteNumber(s,!0)}case 1:return i;case 2:return i+32;case 3:return this.readMultiByteNumber(i)+64;case 4:switch(i){case 0:{this.readPos+8>this.writePos&&this.notEnoughData("float64"),this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength);let s=this.dataView.getFloat64(this.readPos);return this.readPos+=8,s}case 1:return;case 2:return null;case 3:return!0;case 4:return!1;case 5:{let s=[];for(;;){let a=this.read(e);if(a===re)break;s.push(a)}return s}case 6:{let s={};for(;;){let a=this.read(e);if(a===re)break;let l=this.read(e);s[a]=l}return s}case 7:{let s=new Map;for(;;){let a=this.read(e);if(a===re)break;let l=this.read(e);s.set(a,l)}return s}case 8:{let s=new Set;for(;;){let a=this.read(e);if(a===re)break;s.add(a)}return s}case 9:return re;case 10:return--this.readPos,this.readIdentifier();case 11:{let s=this.readPos,a=s;for(;a>=this.writePos&&this.notEnoughData("null-terminated string"),this.buffer[a]!==0;)a++;return this.readPos=a+1,gt.decode(this.buffer.subarray(s,a))}case 12:{let s=this.readPositiveInt();return new Date(s*1e3)}case 13:{let s=this.readString(),a=this.read();return e&&s in e?e[s](a):new he(s,a)}default:throw new Error(`Unknown type 4 subtype: ${i}`)}case 5:{let s=i;this.readPos+s>this.writePos&&this.notEnoughData("short string");let a=this.buffer.subarray(this.readPos,this.readPos+s);return this.readPos+=s,gt.decode(a)}case 6:{let s=this.readMultiByteNumber(i);this.readPos+s>this.writePos&&this.notEnoughData("string");let a=this.buffer.subarray(this.readPos,this.readPos+s);return this.readPos+=s,gt.decode(a)}case 7:{let s=this.readMultiByteNumber(i);this.readPos+s>this.writePos&&this.notEnoughData("blob");let a=this.buffer.slice(this.readPos,this.readPos+s);return this.readPos+=s,new Uint8Array(a)}default:throw new Error(`Unknown type: ${n}`)}}ensureCapacity(e){let r=this.writePos+e;if(r<=this.buffer.length)return;let n=Math.max(r,Math.floor(this.buffer.length*1.5)),i=new Uint8Array(n);i.set(this.buffer.subarray(0,this.writePos)),this.buffer=i,delete this.dataView}readNumber(){let e=this.read();if(typeof e!="number")throw new Error("Expected number but got "+typeof e);return e}readDate(){let e=this.read();if(!(e instanceof Date))throw new Error("Expected Date but got "+typeof e);return e}readPositiveInt(e){let r=this.read();if(typeof r!="number"||!Number.isInteger(r)||r<0||e!==void 0&&r>=e)throw new Error(`Expected positive integer < ${e} but got ${r}`);return r}readBoolean(){let e=this.read();if(typeof e!="boolean")throw new Error("Expected boolean but got "+typeof e);return e}readUint8Array(){let e=this.read();if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array but got "+typeof e);return e}readString(){let e=this.read();if(typeof e!="string")throw new Error("Expected string but got "+typeof e);return e}writeIdentifier(e){let r=0;if(typeof e=="number")r=e;else{if(e.length!==8)throw new Error(`Identifier must be exactly 8 characters, got ${e.length}`);let n;for(let i=0;i<8;i++){let s=e.charCodeAt(i);if(s>127||(n=er[s])===255)throw new Error(`Invalid base64 character: ${e[i]}`);r=r*64+n}}this.ensureCapacity(7),this.buffer[this.writePos++]=138;for(let n=5;n>=0;n--)this.buffer[this.writePos+n]=r%256,r=Math.floor(r/256);return this.writePos+=6,this}readIdentifier(){let e=this.readIdentifierNumber(),r="";for(let n=0;n<8;n++)r=je[e%64]+r,e=Math.floor(e/64);return r}readIdentifierNumber(){if(this.readPos+7>this.writePos&&this.notEnoughData("identifier"),this.buffer[this.readPos++]!==138)throw new Error("Invalid identifier header");let r=0;for(let n=0;n<6;n++)r=r*256+this.buffer[this.readPos++];return r}writeOrderedString(e){let r=new TextEncoder().encode(e);if(r.includes(0))throw new Error("String contains null character");return this.ensureCapacity(r.length+2),this.buffer[this.writePos++]=139,this.buffer.set(r,this.writePos),this.writePos+=r.length,this.buffer[this.writePos++]=0,this}toUint8Array(e=!0,r=0,n=this.writePos){return e?this.buffer.slice(r,n):this.buffer.subarray(r,n)}toBuffer(){return this.buffer.buffer.slice(0,this.writePos)}clone(e,r=0,n=this.writePos){if(e)return new t(this.buffer.slice(r,n));{let i=new t(this.buffer);return i.readPos=r,i.writePos=n,i}}writeCustom(e,r){this.buffer[this.writePos++]=141,this.write(e),this.write(r)}writeAsObject(e){this.buffer[this.writePos++]=134;for(let r of Object.keys(e))this.write(r),this.write(e[r]);return this.buffer[this.writePos++]=137,this}writeCollection(e,r){return this.writeCollectionBoundary(e),r(e==="array"||e==="set"?n=>{this.write(n)}:e==="object"?(n,i)=>{this.writeObjectKey(n),this.write(i)}:(n,i)=>{this.write(n),this.write(i)}),this.writeCollectionBoundary("end")}writeCollectionBoundary(e){let r=Zt[e];if(!r)throw new Error(`Invalid collection type: ${e}`);return this.buffer[this.writePos++]=128|r,this}writeObjectKey(e){if(typeof e=="string"){let r=parseInt(e,10);r.toString()==e&&(e=r)}else typeof e!="number"&&(e=""+e);this.write(e)}readCollectionBoundary(e){this.readPos>=this.writePos&&this.notEnoughData("collection boundary");let r=this.buffer[this.readPos++],n=128|Zt[e];if(r!==n)throw new Error(`Expected ${e} boundary but got byte ${r}`)}increment(){for(let e=this.writePos-1;e>=0;e--)if(this.buffer[e]===255)this.buffer[e]=0;else return this.buffer[e]++,this}toString(e=void 0,r=0,n=this.writePos){e===void 0&&(e=tn);let i=this.readPos;this.readPos=r;let s=0,a="",l="",c=Ne,d=c>0?Oe[(c-1)%Oe.length]:en;try{for(;this.readPos<n;){let u=Oe[Ne++%Oe.length];if(a+=u+ne(this.read())+" ",e)for(l+=u;s<this.readPos;)l+=this.buffer[s].toString(16).padStart(2,"0")+" ",s++}}catch{if(!e)return this.readPos=i,Ne=c,this.toString(!0,r,n);for(a+=Xt+"ERROR ",l+=Xt;s<this.writePos;)l+=this.buffer[s].toString(16).padStart(2,"0")+" ",s++}return this.readPos=i,c||(Ne=0),e?"DataPack{"+l+d+"\u2192 "+a.trimEnd()+d+"}":"DataPack{"+a.trimEnd()+d+"}"}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}readAvailable(){return this.readPos<this.writePos}static generateIdentifier(){let e=Math.floor(+new Date*256+Math.random()*16384),r="";for(let n=0;n<8;n++)r=je[e&63]+r,e=Math.floor(e/64);return r}static createBuffer(...e){let r=new t;for(let n of e)r.write(n);return r.toBuffer()}static createUint8Array(...e){let r=new t;for(let n of e)r.write(n);return r.toUint8Array(!1)}};function ne(t){if(t===void 0)return"undefined";if(typeof t=="object"&&t!==null){if(t instanceof Uint8Array)return new j(t).toString();if(t instanceof Array)return"["+t.map(e=>ne(e)).join(", ")+"]";if(t instanceof Map)return"Map{"+Array.from(t.entries()).map(([e,r])=>`${ne(e)}=>${ne(r)}`).join(", ")+"}";if(t instanceof Set)return"Set{"+Array.from(t.values()).map(e=>ne(e)).join(", ")+"}";if(typeof t=="object"&&t!==null)return"{"+Object.entries(t).map(([e,r])=>`${e}:${ne(r)}`).join(", ")+"}"}return JSON.stringify(t)}var he=class{name;data;constructor(e,r){this.name=e,this.data=r}};j.prototype.CustomData=he;var L={error:"e",response:"r",response_proxy:"p",response_model:"m",response_proxy_model:"q",model_data:"d"},bt={call:1,cancel:2};var k=0;var Le=Symbol(),qe=class{constructor(e){this.url=e;this.api=new Proxy({connection:this,requestId:void 0},tr),this.connect()}url;ws;activeRequests=new Map;requestCounter=0;reconnectAttempts=0;_proxyCounter=0;$state=o.proxy({online:!1,error:void 0});streamCache=new Map;get[o.OPAQUE](){return!0}api;isOnline(){return this.$state.online}getError(){return this.$state.error}connect(){let e;try{e=this.ws=typeof this.url=="string"?new WebSocket(this.url):this.url()}catch(r){console.error("WebSocket connection error:",r),this.$state.error=r?.message||"WebSocket connection error";return}e.binaryType="arraybuffer",k>=1&&console.log(`[lowlander] Connecting to WebSocket at ${typeof this.url=="string"?this.url:"[custom WebSocket]"}`),e.onopen=()=>{if(e===this.ws){k>=1&&console.log("[lowlander] WebSocket connected"),this.$state.online=!0,this.$state.error=void 0,this.reconnectAttempts=0;for(let r of this.activeRequests.values())r.$result.busy=!0,this.ws.send(r.requestBuffer)}},e.onclose=()=>{e===this.ws&&(k>=1&&console.log("[lowlander] WebSocket disconnected"),this.reconnect())},e.onerror=r=>{e===this.ws&&(console.error("WebSocket error:",r),this.$state.error=r?.message||"WebSocket connection error",this.reconnect())},e.onmessage=r=>{if(e!==this.ws)return;let n=new j(new Uint8Array(r.data)),i=n.readPositiveInt(),s=this.activeRequests.get(i);if(!s)return;let a=o.unproxy(s.$result),l=n.read();if(typeof l=="number"){let c=s.callbacks?.[l],d=[];for(;n.readAvailable();)d.push(n.read());c(...d);return}if(l===L.model_data){s.database||=new Map,s.commitIds||=new Map;let c=n.readNumber(),d=n.readNumber(),u=n.read({model:function(w){let wt=s.database.get(w);return wt||console.error("Unknown linked model hash "+w),wt}});k>=3&&console.log("[lowlander] incoming model_data",i,c,d,u),setTimeout(()=>this.pruneCommitIds(s,d),15e3);let p=s.commitIds.get(c);if(!u){if(p&&d<Math.max(...p.values()))return;s.database.delete(c),s.commitIds.set(c,new Map([[Le,d]]));return}let h=s.database.get(c);if(h){p||(p=new Map,s.commitIds.set(c,p));for(let w of Object.keys(u))d<(p.get(w)??p.get(Le)??-1)||(u[w]&&typeof u[w]=="object"?o.copy(h,w,u[w]):h[w]=u[w],p.set(w,d))}else{if(p&&d<(p.get(Le)??-1))return;let w=o.proxy(u);o.unproxy(w)[o.OPAQUE]=!1,s.database.set(c,w),s.commitIds.set(c,new Map([[Le,d]]))}return}if(l===L.error){let c=n.readString();s.$result.error=new Error(c),k>=2&&console.log(`[lowlander] incoming error requestId=${i} message=${c}`)}else if(l===L.response||l===L.response_proxy)s.$result.value=n.read(),s.virtualSocketIds=n.read(),s.hasServerProxy=l===L.response_proxy,k>=2&&console.log(`[lowlander] incoming response requestId=${i} value=${a.value} virtualSocketIds=${s.virtualSocketIds} hasServerProxy=${s.hasServerProxy}`);else if(l===L.response_model||l===L.response_proxy_model){s.virtualSocketIds=n.read();let c=n.readNumber(),d=n.read(),u=s.database?.get(c);s.hasServerProxy=l===L.response_proxy_model,k>=2&&console.log(`[lowlander] incoming ${s.hasServerProxy?"response_proxy_model":"response_model"} requestId=${i} dbKey=${c} cacheMs=${d} obj=${u}`),u?s.$result.value=o.proxy(u):s.$result.error=new Error("Unknown database key "+c),d!==void 0&&s.cacheKey&&!this.streamCache.has(s.cacheKey)&&this.streamCache.set(s.cacheKey,{request:s,cacheKey:s.cacheKey,cacheMs:d,refCount:1})}else throw new Error("Unknown message type "+l);!s.hasServerProxy&&!s.virtualSocketIds?.length&&this.activeRequests.delete(i),s.hasServerProxy||delete s.$result.serverProxy,s.$result.busy=!1,s.resolve&&(a.error!=null?(console.error(a.error),s.reject(a.error)):s.resolve(a.value),delete s.resolve,delete s.reject)}}reconnect(){if(this.ws=void 0,this.$state.online=!1,typeof this.url!="string")return;let e=Math.min(500*Math.pow(2,this.reconnectAttempts),2e4);this.reconnectAttempts++,k>=1&&console.log(`[lowlander] Reconnecting in ${e}ms (attempt ${this.reconnectAttempts})`),setTimeout(this.connect.bind(this),e)}pruneCommitIds(e,r){if(e.commitIds)for(let[n,i]of e.commitIds){for(let[s,a]of i)a<=r&&i.delete(s);i.size||e.commitIds.delete(n)}}_createMethodStub(e,r){return(...n)=>{let s=n.some(h=>typeof h=="function")?void 0:(r??"")+":"+e+":"+JSON.stringify(n);if(s){let h=this.streamCache.get(s);if(h)return h.lingerTimeout&&(clearTimeout(h.lingerTimeout),h.lingerTimeout=void 0),h.refCount++,k>=2&&console.log(`[lowlander] reusing cached stream cacheKey=${s} refCount=${h.refCount}`),o.clean(()=>{h.refCount--,k>=2&&console.log(`[lowlander] clean cached consumer cacheKey=${s} refCount=${h.refCount}`),h.refCount<=0&&this.startLinger(h)}),h.request.$result}let a={busy:!0},l=o.proxy(a),c=++this.requestCounter,d=new j;d.write(c).write(bt.call).write(r).write(e);let u;d.writeCollection("array",()=>{for(let h of n)typeof h=="function"?(u||=[],d.writeCustom("cb",u.length),u.push(h)):d.write(h)});let p={$result:l,requestBuffer:d.toUint8Array(!0),requestId:c,connection:this,callbacks:u,cacheKey:s};return a.serverProxy=new Proxy(p,tr),a.promise=new Promise((h,w)=>{p.resolve=h,p.reject=w}),this.activeRequests.set(c,p),k>=2&&console.log(`[lowlander] outgoing call requestId=${c} method=${e} params=`,n),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(p.requestBuffer),o.clean(()=>{let h=s?this.streamCache.get(s):void 0;if(h&&h.request===p){h.refCount--,k>=2&&console.log(`[lowlander] clean stream owner cacheKey=${s} refCount=${h.refCount}`),h.refCount<=0&&this.startLinger(h);return}this.cancelRequest(p)}),l}}cancelRequest(e){if(this.activeRequests.delete(e.requestId),e.virtualSocketIds?.length||e.hasServerProxy){k>=2&&console.log(`[lowlander] outgoing cancel requestId=${e.requestId} virtualSocketIds=${e.virtualSocketIds} hasServerProxy=${e.hasServerProxy}`);let r=j.createUint8Array(++this.requestCounter,bt.cancel,e.requestId,e.virtualSocketIds);this.ws?.send(r)}}startLinger(e){e.lingerTimeout&&clearTimeout(e.lingerTimeout),k>=2&&console.log(`[lowlander] start linger cacheKey=${e.cacheKey} cacheMs=${e.cacheMs}`),e.lingerTimeout=setTimeout(()=>{e.refCount>0||(k>=2&&console.log(`[lowlander] linger expired cacheKey=${e.cacheKey}`),this.streamCache.delete(e.cacheKey),this.cancelRequest(e.request))},e.cacheMs)}},tr={get(t,e){if(typeof e=="symbol")return e===o.OPAQUE?!0:e===o.CUSTOM_DUMP?`<ServerProxy for #${t.requestId}>`:void 0;if(t.serverProxyCache?.has(e))return t.serverProxyCache.get(e);if(e==="then"||e==="catch"||e==="finally")return;if(e==="constructor")return{name:"ServerProxy-"+t.requestId};let r=t.connection._createMethodStub(e,t.requestId);return t.serverProxyCache||(t.serverProxyCache=new Map),t.serverProxyCache.set(e,r),r},has(t,e){return typeof e=="string"||e===o.NO_COPY}};var rn=`ws://${location.hostname}:8080/`,rr=new qe(rn),ze=rr.api,nn=ze.add(1234,6753),nr=ze.authenticate("Frank"),sr=nr.serverProxy,sn=sr.getBio(),on=ze.streamModel(),yt=o.proxy(!1),xt=o.proxy(""),ir=o.proxy([]),an=0;ze.streamSomething(t=>ir[an++%20]=t);o.mount(document.body,()=>{ut({title:"Lowlander Hello World",maxWidth:"48rem",content:()=>{I({header:"Connection",content:()=>{o("p","m:0",()=>{o("#Online: "),o(()=>o(rr.isOnline()?"text=yes":"text=no"))})}}),I({header:"Add(1234, 6753)",content:()=>o.dump(nn)}),I({header:"Auth token",content:()=>o.dump(nr)}),I({header:"Bio",content:()=>o.dump(sn)}),I({header:"Live model",content:()=>o.dump(on)}),I({header:"Toggle friend",content:()=>{st({submit:async()=>{yt.value=!0;let t=await sr.toggleFriend(xt.value).promise;yt.value=!1,t||ht("No such person: "+xt.value)},content:()=>Me({label:"Person name",bind:xt}),actions:()=>{o(()=>{yt.value?o("span","fg:$s-fg-muted","#Busy\u2026"):T({content:"Toggle friend",type:"submit"})})}})}}),I({header:"Streamed data",content:()=>o.dump(ir)})}})});
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../examples/helloworld/client/js/base.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,UAAU,CAAC;AACzB,OAAO,CAAC,MAAM,QAAQ,CAAC;AAEvB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,aAAa,GAAG,QAAQ,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAExD,MAAM,UAAU,GAAG,IAAI,UAAU,CAAa,aAAa,CAAC,CAAC;AAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;AAE3B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChC,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;AACjC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAEhC,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChC,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,EAAc,CAAC,CAAC;AACrC,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,GAAG,CAAC,eAAe,CAAC,CAAC,IAAY,EAAE,EAAE,CAAE,IAAY,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAE9E,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE;IACxB,CAAC,CAAC,IAAI,CAAC;QACH,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,GAAG,EAAE;YACV,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE;oBACxC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;wBACf,CAAC,CAAC,WAAW,CAAC,CAAC;wBACf,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC/D,CAAC,CAAC,CAAC;gBACP,CAAC,EAAC,CAAC,CAAC;YAEJ,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEjE,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAE7D,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAErD,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAE9D,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE;oBAC3C,CAAC,CAAC,IAAI,CAAC;wBACH,MAAM,EAAE,KAAK,IAAI,EAAE;4BACf,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;4BACtB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;4BACnE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;4BACvB,IAAI,CAAC,KAAK;gCAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;wBAC/D,CAAC;wBACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;wBACrE,OAAO,EAAE,GAAG,EAAE;4BACV,CAAC,CAAC,GAAG,EAAE;gCACH,IAAI,QAAQ,CAAC,KAAK;oCAAE,CAAC,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;;oCACrD,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;4BAC7D,CAAC,CAAC,CAAC;wBACP,CAAC;qBACJ,CAAC,CAAC;gBACP,CAAC,EAAC,CAAC,CAAC;YAEJ,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../examples/helloworld/client/js/base.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,UAAU,CAAC;AACzB,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE9C,MAAM,aAAa,GAAG,QAAQ,QAAQ,CAAC,QAAQ,QAAQ,CAAC;AAExD,MAAM,UAAU,GAAG,IAAI,UAAU,CAAa,aAAa,CAAC,CAAC;AAC7D,MAAM,GAAG,GAAG,UAAU,CAAC,GAAG,CAAC;AAE3B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AAChC,MAAM,IAAI,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AACvC,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC;AACjC,MAAM,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;AAC7B,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;AAEhC,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AAChC,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC/B,MAAM,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,EAAc,CAAC,CAAC;AACrC,IAAI,SAAS,GAAG,CAAC,CAAC;AAClB,GAAG,CAAC,eAAe,CAAC,CAAC,IAAY,EAAE,EAAE,CAAE,IAAY,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC;AAE9E,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE;IACxB,CAAC,CAAC,IAAI,CAAC;QACH,KAAK,EAAE,uBAAuB;QAC9B,QAAQ,EAAE,OAAO;QACjB,OAAO,EAAE,GAAG,EAAE;YACV,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE;oBACxC,CAAC,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;wBACf,CAAC,CAAC,WAAW,CAAC,CAAC;wBACf,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;oBAC/D,CAAC,CAAC,CAAC;gBACP,CAAC,EAAC,CAAC,CAAC;YAEJ,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAEjE,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAE7D,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAErD,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAE9D,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE;oBAC3C,CAAC,CAAC,IAAI,CAAC;wBACH,MAAM,EAAE,KAAK,IAAI,EAAE;4BACf,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;4BACtB,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC;4BACnE,QAAQ,CAAC,KAAK,GAAG,KAAK,CAAC;4BACvB,IAAI,CAAC,KAAK;gCAAE,CAAC,CAAC,KAAK,CAAC,kBAAkB,GAAG,UAAU,CAAC,KAAK,CAAC,CAAC;wBAC/D,CAAC;wBACD,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;wBACrE,OAAO,EAAE,GAAG,EAAE;4BACV,CAAC,CAAC,GAAG,EAAE;gCACH,IAAI,QAAQ,CAAC,KAAK;oCAAE,CAAC,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,CAAC,CAAC;;oCACrD,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;4BAChE,CAAC,CAAC,CAAC;wBACP,CAAC;qBACJ,CAAC,CAAC;gBACP,CAAC,EAAC,CAAC,CAAC;YAEJ,CAAC,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpE,CAAC;KACJ,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}