mates 0.1.0-beta.7 → 0.1.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.esm.js +102 -33
- package/dist/index.esm.js.map +1 -1
- package/package.json +3 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,16 +1,88 @@
|
|
|
1
|
-
"use strict";var t=require("lit-html"),e=require("lit-html/directives/unsafe-html.js"),n=require("lit-html/directives/async-append.js"),s=require("lit-html/directives/async-replace.js"),i=require("lit-html/directives/cache.js"),r=require("lit-html/directives/class-map.js"),o=require("lit-html/directives/guard.js"),a=require("lit-html/directives/if-defined.js"),l=require("lit-html/directives/join.js"),c=require("lit-html/directives/keyed.js"),h=require("lit-html/directives/live.js"),u=require("lit-html/directives/range.js"),d=require("lit-html/directives/repeat.js"),f=require("lit-html/directives/style-map.js"),p=require("lit-html/directives/until.js"),m=require("lit-html/directives/when.js"),g=require("lit-html/directives/ref.js"),_=require("lit-html/async-directive.js"),y=require("lit-html/directive.js");const v=()=>{},w={registerComponent:v,unregisterComponent:v,notifyRender:v,getComponentName:()=>"Anonymous",logComponentMount:v,logComponentRender:v,logComponentUnmount:v,logAtomSet:v,logAtomUpdate:v,logEventTrigger:v,logCleanupEventTrigger:v,logFetchRequest:v,logFetchResponse:v,logFetchError:v,recordRender:v};function b(t,e){w.registerComponent(t,e)}function S(t){return w.getComponentName(t)}function x(t,e){w.logEventTrigger(t,e)}function E(t,e,n){w.recordRender(t,e,n)}let C=!1,M=new Set,k=!1;function A(){return C}function O(){return k}function R(t){M.add(t)}function P(){k=!0}function T(){k=!1}function z(){const t={prevEnabled:C,prevStores:M};return C=!0,M=new Set,t}function I(t){const e=M;return C=t.prevEnabled,M=t.prevStores,e}const D=z,L=I,j={setupInProgress:!1,templateInProgress:!1,viewOuterInProgress:!1,isHookRunning:!1};function N(t){if(!j.isHookRunning){if(j.templateInProgress)throw new Error(`${t} cannot be created during template function execution. Only scopes (useScope) are allowed in templates.`);if(O())throw new Error(`${t} cannot be created inside a memo() or effect(). They should only read state, not create new reactive primitives.`)}}function $(t){if(!j.viewOuterInProgress){if(j.templateInProgress)throw new Error(`${t} cannot be called during template function execution. Move it to the component's outer function.`);if(O())throw new Error(`${t} cannot be called inside a memo() or effect(). Move it to the component's outer function.`);throw new Error(`${t} must be called inside a component's outer function. It cannot be used at module level or inside inner functions (e.g. event handlers, timers, or callbacks).`)}}function U(t,e){(function(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")})()&&(e?console.error(`[${e}]`,t):console.error(t))}function F(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)}function V(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n}var W,Y,H;"function"==typeof SuppressedError&&SuppressedError;class q{constructor(){W.set(this,new Set),Y.set(this,1)}subscribe(t){return F(this,W,"f").add(t),()=>F(this,W,"f").delete(t)}notify(){var t;V(this,Y,(t=F(this,Y,"f"),++t),"f"),[...F(this,W,"f")].forEach(t=>{try{t?.()}catch(t){console.error(t)}})}getVersion(){return F(this,Y,"f")}get subscriberCount(){return F(this,W,"f").size}clear(){F(this,W,"f").clear()}}W=new WeakMap,Y=new WeakMap;class B{constructor(){H.set(this,new Set)}subscribe(t){return N("subscribe"),F(this,H,"f").has(t)?()=>{}:(F(this,H,"f").add(t),()=>F(this,H,"f").delete(t))}trigger(t){F(this,H,"f").forEach(e=>{try{e(t)}catch(t){console.error("Error in event handler:",t)}})}get handlerCount(){return F(this,H,"f").size}clear(){F(this,H,"f").clear()}}H=new WeakMap;const G=[];function X(t,e){G.push(t);let n=null;try{n=e()}finally{G.pop()}return n}function Z(t){const e=G[G.length-1];if(!e){if(!1!==t)throw new Error("getCurrentHost(): No active host context");return null}return e}let J=!1;function Q(){return J}function K(t){t.DOMReadyEvent?.cleanupAndClearSubs(),t.PaintEvent?.cleanupAndClearSubs(),t.cleanups.forEach(t=>t.forEach(t=>{try{t()}catch(t){console.error("Error during cleanup:",t)}})),t.cleanups.clear(),t.onEachUpdateCallbacks.clear(),t.scopes=new Map,t._templateFn=null,t._xviewRender=()=>{},t._hasMounted=!1,t._errorState=null,t._errorHandlers=[]}const tt=new class{constructor(){this.pending=new Set,this.isScheduled=!1}scheduleDisconnect(t){this.pending.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}cancelDisconnect(t){this.pending.delete(t)}flush(){const t=Array.from(this.pending);this.pending.clear(),this.isScheduled=!1;for(const e of t)e.isConnected||(K(e),e._view=null,e._props={},e.oldView=void 0)}reset(){this.pending.clear(),this.isScheduled=!1}},et=new class{constructor(){this.pendingEffects=new Set,this.isScheduled=!1,this._isFlushing=!1}get isFlushing(){return this._isFlushing}reset(){this.pendingEffects.clear(),this.isScheduled=!1,this._isFlushing=!1}schedule(t){this.pendingEffects.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this._isFlushing=!0;let t=0;for(;this.pendingEffects.size>0;){if(t++>=500){this.pendingEffects.clear(),console.error("EffectScheduler: Maximum iteration limit (500) reached. This likely means an effect is infinitely updating its own dependency. Remaining effects have been dropped.");break}const e=Array.from(this.pendingEffects);this.pendingEffects.clear();for(const t of e)try{t()}catch(t){U(t,"Effect")}}this._isFlushing=!1,this.isScheduled=!1,nt.flush()}},nt=new class{constructor(){this.pendingComponents=new Set,this.nextPendingComponents=new Set,this._currentWave=new Set,this.isScheduled=!1,this._isFlushing=!1,this._flushVersion=0,this._onIdleCallbacks=[]}get flushVersion(){return this._flushVersion}onceIdle(t){this._onIdleCallbacks.push(t),this._isFlushing||this.isScheduled||queueMicrotask(()=>this._drainIdleCallbacks())}_drainIdleCallbacks(){if(this._isFlushing||this.isScheduled)return;if(this.pendingComponents.size>0||this.nextPendingComponents.size>0)return;const t=this._onIdleCallbacks.splice(0);for(const e of t)try{e()}catch(t){console.error(t)}}reset(){this.pendingComponents.clear(),this.nextPendingComponents.clear(),this._currentWave.clear(),this._onIdleCallbacks.length=0,this.isScheduled=!1,this._isFlushing=!1}schedule(t){if(this._isFlushing){if(this._currentWave.has(t)&&t._renderVersion!==this._flushVersion)return;this.nextPendingComponents.add(t)}else this.pendingComponents.add(t);this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{et.isScheduled||et.isFlushing||this.flush()}))}flush(){for(this.nextPendingComponents.size>0&&(this.nextPendingComponents.forEach(t=>this.pendingComponents.add(t)),this.nextPendingComponents.clear()),this._isFlushing=!0,this._flushVersion++;this.pendingComponents.size>0;){const t=Array.from(this.pendingComponents);this.pendingComponents.clear(),t.sort((t,e)=>t._depth-e._depth),this._currentWave=new Set(t);for(const e of t)if(e.isConnected)try{e._render()}catch(t){U(t,"Component render")}this._currentWave.clear()}this._isFlushing=!1,this.isScheduled=!1,this.nextPendingComponents.size>0?(this.isScheduled=!0,queueMicrotask(()=>{et.isScheduled||et.isFlushing||this.flush()})):this._drainIdleCallbacks()}},st=()=>{if(j.templateInProgress&&!j.setupInProgress)throw Error("Providers such as atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")},it=()=>{},rt=t=>{st(),t.__isOnMount__=!0;const e=Z();e.addToCleanUps(t,it);if("AsyncFunction"===t.constructor.name&&Q())return e._asyncMountQueue=e._asyncMountQueue??[],void e._asyncMountQueue.push(t);let n=!1;e.DOMReadyEvent.__subscribe(()=>{if(n)return;n=!0;const s=t();if(s&&"object"==typeof s&&"function"==typeof s.then)return;const i=s;i&&e.addToCleanUps(t,i)})},ot=(t,e=!0)=>{if(e&&N("Setter"),j.setupInProgress&&e)throw new Error("Setter cannot be created inside setup function. Define setters as class properties before setup runs.");let n=t;const s=Z();e&&st();const i=new Set;try{const t=(...t)=>{const e=n(...t);return[...i].forEach(t=>{try{et.schedule(()=>t?.())}catch(t){console.error(t)}}),s?.isConnected&&nt.schedule(s),e};return t.__subscribe=t=>(N("subscribe"),i.add(t),()=>i.delete(t)),t.__isSetter___=!0,t.set=t=>{n=t},Object.defineProperty(t,"__version__",{get:()=>0}),t}catch(t){throw new Error("You can only use setter or _ inside a scope or useState or view component's outer function")}},at=ot;function lt(t,e=!0,n){if(O())return;const s=Z(e);if(s&&t&&!s.cleanups.has(t)){const e=n||t.__subscribe||t.subscribe,i=e?.(()=>{nt.schedule(s)});s.addToCleanUps(t,i)}}const ct=(t,e)=>{const n=Z(!1);n&&n.addToCleanUps(t,e)},ht=t=>{N("cleanupEvent");const e=t||Math.random().toString(36).substring(2,15),n=new Map,s=()=>{n.forEach(t=>{if(t)try{t()}catch(t){U(t,"cleanupEvent cleanup")}})},i={trigger:t=>{!function(t,e){w.logCleanupEventTrigger(t,e)}(e,t),n.forEach((e,s)=>{if(e)try{e()}catch(t){U(t,"cleanupEvent cleanup")}try{const e=s(t);n.set(s,e)}catch(t){U(t,"cleanupEvent handler"),n.set(s,void 0)}})},__subscribe:t=>(n.set(t,void 0),()=>{const e=n.get(t);if(e)try{e()}catch(t){U(t,"cleanupEvent unsubscribe")}n.delete(t)}),cleanup:s,cleanupAndClearSubs:()=>{s(),n.clear()},get hasSubscribers(){return n.size>0},name:e,__isCleanupEvent___:!0,__isEvent___:!0};return i};function ut(t){return!!t&&("AsyncFunction"===t.constructor?.name||t instanceof Promise||"object"==typeof t&&null!==t&&"then"in t||"function"==typeof t.then)}function dt(t){return"function"==typeof t?t():t}function ft(t){return t.default||t}function pt(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")}class mt extends HTMLElement{addScope(t,e){this.scopes.set(t,e)}onEachUpdate(t){this.onEachUpdateCallbacks.add(t)}constructor(){super(),this.name="Anonymous",this.scopes=new Map,this._useStates=[],this.lastVersion=-1,this._depth=0,this._parentComponent=null,this._renderVersion=0,this._errorHandlers=[],this._errorState=null,this.onEachUpdateCallbacks=new Set,this.DOMReadyEvent=null,this.PaintEvent=null,this._isViewLoading=!1,this._onRequestParentScope=t=>{const e=t,n=e.detail?.ScopeClass;if(n&&this.scopes.has(n)){const t=this.scopes.get(n);t&&(e.stopPropagation(),e.detail.resolve(t))}},this._props={},this._propsFn=()=>this._props,this._view=null,this._templateFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{};const t=j.templateInProgress;j.templateInProgress=!1,X(this,()=>{this.DOMReadyEvent=ht("DOMReady"),this.PaintEvent=ht("Paint")}),j.templateInProgress=t}set props(t){this._props=t,nt.schedule(this)}get props(){return this._props}_applyViewChange(t,e){this.oldView!==t&&(this.oldView=t,e(t),(this._hasMounted||this._errorState)&&K(this))}set view(t){if(null!==t){if(ut(t))return this._isViewLoading=!0,void dt(t).then(t=>{this._isViewLoading=!1,this.view=ft(t)},t=>{this._isViewLoading=!1,this._handleRenderError(t)});"function"==typeof t&&(this.name=t.name||"Anonymous"),this._applyViewChange(t,()=>{this._view=t}),nt.schedule(this)}}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}connectedCallback(){this.addEventListener("request-parent-scope",this._onRequestParentScope);let t=0,e=null,n=this.parentElement;for(;n;){if(n instanceof mt){e=n,t=n._depth+1;break}n=n.parentElement}this._depth=t,this._parentComponent=e,tt.cancelDisconnect(this),this._hasMounted&&(pt()&&!this._view?.skipDevToolsRender&&b(this,this._view),nt.schedule(this))}disconnectedCallback(){var t,e,n;this.removeEventListener("request-parent-scope",this._onRequestParentScope),pt()&&(this._view?.__devtools__||this._view?.skipDevToolsRender||(n=S(this),w.logComponentUnmount(n)),this._view?.skipDevToolsRender||(t=this,e=this._view,w.unregisterComponent(t,e))),tt.scheduleDisconnect(this)}addToCleanUps(t,e){const n=this.cleanups.get(t);n?n.push(e):this.cleanups.set(t,[e])}_render(){var t,e,n;if(!(this._errorState||this._isViewLoading||this._renderScheduled)&&this._view)if(this._renderVersion=nt.flushVersion,this._hasMounted){if(this._xviewRender){this.callOnEachUpdate();let s=0;if(pt()){const i=this._view?.__devtools__,r=this._view?.skipDevToolsRender,o=performance.now();this._xviewRender(),s=performance.now()-o,i||r||(E(S(this),this.componentId,s),e=S(this),n=s,w.logComponentRender(e,n)),r||(t=this,w.notifyRender(t))}else this._xviewRender()}}else this._mountComponent()}_mountComponent(){const e=this._view;t.render(t.html``,this),j.viewOuterInProgress=!0;try{this._templateFn=X(this,()=>e(this._propsFn))}catch(t){return j.viewOuterInProgress=!1,void this._handleRenderError(t)}if(j.viewOuterInProgress=!1,"function"==typeof this._templateFn){if(this._xviewRender=()=>{j.templateInProgress=!0;try{if(!this._templateFn)return;X(this,()=>{const e=this._templateFn(this._propsFn);t.render(e,this)}),this.DOMReadyEvent?.trigger(),this.PaintEvent?.hasSubscribers&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&this.PaintEvent?.trigger()})})}catch(t){this._handleRenderError(t)}finally{j.templateInProgress=!1}},this.callOnEachUpdate(),pt()){const t=e?.__devtools__,n=e?.skipDevToolsRender,s=performance.now();this._xviewRender();const i=performance.now()-s;t||n||E(e?.name||"Anonymous",this.componentId,i)}else this._xviewRender();this._view===e&&(this._hasMounted=!0,pt()&&(e?.skipDevToolsRender||b(this,e),e?.__devtools__||e?.skipDevToolsRender||(n=e?.name||"Anonymous",w.logComponentMount(n))))}else this._handleRenderError(new Error("inner function must be a template function that returns html result"));var n}_handleRenderError(e){this._errorState=e;for(const t of this._errorHandlers)try{t(e)}catch(t){}if(U(e,`Component "${this.name}"`),this._view?.__isErrorView__)return;const n=this.name,s=e instanceof Error?e.message:String(e),i=e instanceof Error&&e.stack?e.stack.split("\n").slice(1).map(t=>t.trim()).filter(Boolean).join("\n"):null,r=()=>()=>t.html`
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2017 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
5
|
+
*/
|
|
6
|
+
const t=globalThis,e=t.trustedTypes,n=e?e.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",i=`lit$${Math.random().toFixed(9).slice(2)}$`,r="?"+i,o=`<${r}>`,a=document,l=()=>a.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,h=Array.isArray,u=t=>h(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,p=/-->/g,m=/>/g,_=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),g=/'/g,y=/"/g,v=/^(?:script|style|textarea|title)$/i,w=t=>(e,...n)=>({_$litType$:t,strings:e,values:n}),b=w(1),S=w(2),E=Symbol.for("lit-noChange"),A=Symbol.for("lit-nothing"),C=new WeakMap,M=a.createTreeWalker(a,129);function k(t,e){if(!h(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==n?n.createHTML(e):e}const x=(t,e)=>{const n=t.length-1,r=[];let a,l=2===e?"<svg>":3===e?"<math>":"",c=f;for(let e=0;e<n;e++){const n=t[e];let h,u,d=-1,w=0;for(;w<n.length&&(c.lastIndex=w,u=c.exec(n),null!==u);)w=c.lastIndex,c===f?"!--"===u[1]?c=p:void 0!==u[1]?c=m:void 0!==u[2]?(v.test(u[2])&&(a=RegExp("</"+u[2],"g")),c=_):void 0!==u[3]&&(c=_):c===_?">"===u[0]?(c=a??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,h=u[1],c=void 0===u[3]?_:'"'===u[3]?y:g):c===y||c===g?c=_:c===p||c===m?c=f:(c=_,a=void 0);const b=c===_&&t[e+1].startsWith("/>")?" ":"";l+=c===f?n+o:d>=0?(r.push(h),n.slice(0,d)+s+n.slice(d)+i+b):n+i+(-2===d?e:b)}return[k(t,l+(t[n]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),r]};class ${constructor({strings:t,_$litType$:n},o){let a;this.parts=[];let c=0,h=0;const u=t.length-1,d=this.parts,[f,p]=x(t,n);if(this.el=$.createElement(f,o),M.currentNode=this.el.content,2===n||3===n){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(a=M.nextNode())&&d.length<u;){if(1===a.nodeType){if(a.hasAttributes())for(const t of a.getAttributeNames())if(t.endsWith(s)){const e=p[h++],n=a.getAttribute(t).split(i),s=/([.?@])?(.*)/.exec(e);d.push({type:1,index:c,name:s[2],strings:n,ctor:"."===s[1]?I:"?"===s[1]?P:"@"===s[1]?D:z}),a.removeAttribute(t)}else t.startsWith(i)&&(d.push({type:6,index:c}),a.removeAttribute(t));if(v.test(a.tagName)){const t=a.textContent.split(i),n=t.length-1;if(n>0){a.textContent=e?e.emptyScript:"";for(let e=0;e<n;e++)a.append(t[e],l()),M.nextNode(),d.push({type:2,index:++c});a.append(t[n],l())}}}else if(8===a.nodeType)if(a.data===r)d.push({type:2,index:c});else{let t=-1;for(;-1!==(t=a.data.indexOf(i,t+1));)d.push({type:7,index:c}),t+=i.length-1}c++}}static createElement(t,e){const n=a.createElement("template");return n.innerHTML=t,n}}function T(t,e,n=t,s){if(e===E)return e;let i=void 0!==s?n.o?.[s]:n.l;const r=c(e)?void 0:e._$litDirective$;return i?.constructor!==r&&(i?._$AO?.(!1),void 0===r?i=void 0:(i=new r(t),i._$AT(t,n,s)),void 0!==s?(n.o??=[])[s]=i:n.l=i),void 0!==i&&(e=T(t,i._$AS(t,e.values),i,s)),e}class R{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:n}=this._$AD,s=(t?.creationScope??a).importNode(e,!0);M.currentNode=s;let i=M.nextNode(),r=0,o=0,l=n[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new O(i,i.nextSibling,this,t):1===l.type?e=new l.ctor(i,l.name,l.strings,this,t):6===l.type&&(e=new L(i,this,t)),this._$AV.push(e),l=n[++o]}r!==l?.index&&(i=M.nextNode(),r++)}return M.currentNode=a,s}p(t){let e=0;for(const n of this._$AV)void 0!==n&&(void 0!==n.strings?(n._$AI(t,n,e),e+=n.strings.length-2):n._$AI(t[e])),e++}}let O=class t{get _$AU(){return this._$AM?._$AU??this.v}constructor(t,e,n,s){this.type=2,this._$AH=A,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=n,this.options=s,this.v=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=T(this,t,e),c(t)?t===A||null==t||""===t?(this._$AH!==A&&this._$AR(),this._$AH=A):t!==this._$AH&&t!==E&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==A&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(a.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:n}=t,s="number"==typeof n?this._$AC(t):(void 0===n.el&&(n.el=$.createElement(k(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new R(s,this),n=t.u(this.options);t.p(e),this.T(n),this._$AH=t}}_$AC(t){let e=C.get(t.strings);return void 0===e&&C.set(t.strings,e=new $(t)),e}k(e){h(this._$AH)||(this._$AH=[],this._$AR());const n=this._$AH;let s,i=0;for(const r of e)i===n.length?n.push(s=new t(this.O(l()),this.O(l()),this,this.options)):s=n[i],s._$AI(r),i++;i<n.length&&(this._$AR(s&&s._$AB.nextSibling,i),n.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this.v=t,this._$AP?.(t))}};class z{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,n,s,i){this.type=1,this._$AH=A,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=i,n.length>2||""!==n[0]||""!==n[1]?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=A}_$AI(t,e=this,n,s){const i=this.strings;let r=!1;if(void 0===i)t=T(this,t,e,0),r=!c(t)||t!==this._$AH&&t!==E,r&&(this._$AH=t);else{const s=t;let o,a;for(t=i[0],o=0;o<i.length-1;o++)a=T(this,s[n+o],e,o),a===E&&(a=this._$AH[o]),r||=!c(a)||a!==this._$AH[o],a===A?t=A:t!==A&&(t+=(a??"")+i[o+1]),this._$AH[o]=a}r&&!s&&this.j(t)}j(t){t===A?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class I extends z{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===A?void 0:t}}class P extends z{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==A)}}class D extends z{constructor(t,e,n,s,i){super(t,e,n,s,i),this.type=5}_$AI(t,e=this){if((t=T(this,t,e,0)??A)===E)return;const n=this._$AH,s=t===A&&n!==A||t.capture!==n.capture||t.once!==n.once||t.passive!==n.passive,i=t!==A&&(n===A||s);s&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,e,n){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(t){T(this,t)}}const N={M:s,P:i,A:r,C:1,L:x,R:R,D:u,V:T,I:O,H:z,N:P,U:D,B:I,F:L},j=t.litHtmlPolyfillSupport;j?.($,O),(t.litHtmlVersions??=[]).push("3.2.0");const U=(t,e,n)=>{const s=n?.renderBefore??e;let i=s._$litPart$;if(void 0===i){const t=n?.renderBefore??null;s._$litPart$=i=new O(e.insertBefore(l(),t),t,void 0,n??{})}return i._$AI(t),i
|
|
7
|
+
/**
|
|
8
|
+
* @license
|
|
9
|
+
* Copyright 2017 Google LLC
|
|
10
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
+
*/},F=1,V=2,W=3,H=4,Y=6,B=t=>(...e)=>({_$litDirective$:t,values:e});class q{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,n){this.t=t,this._$AM=e,this.i=n}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
12
|
+
/**
|
|
13
|
+
* @license
|
|
14
|
+
* Copyright 2017 Google LLC
|
|
15
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
|
+
*/class X extends q{constructor(t){if(super(t),this.it=A,t.type!==V)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===A||null==t)return this._t=void 0,this.it=t;if(t===E)return t;if("string"!=typeof t)throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}X.directiveName="unsafeHTML",X.resultType=1;const Z=B(X),{I:G}=N,K=(t,e)=>void 0===e?void 0!==t?._$litType$:t?._$litType$===e,J=t=>void 0===t.strings,Q=()=>document.createComment(""),tt=(t,e,n)=>{const s=t._$AA.parentNode,i=void 0===e?t._$AB:e._$AA;if(void 0===n){const e=s.insertBefore(Q(),i),r=s.insertBefore(Q(),i);n=new G(e,r,t,t.options)}else{const e=n._$AB.nextSibling,r=n._$AM,o=r!==t;if(o){let e;n._$AQ?.(t),n._$AM=t,void 0!==n._$AP&&(e=t._$AU)!==r._$AU&&n._$AP(e)}if(e!==i||o){let t=n._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,i),t=e}}}return n},et=(t,e,n=t)=>(t._$AI(e,n),t),nt={},st=(t,e=nt)=>t._$AH=e,it=t=>t._$AH,rt=t=>{t._$AP?.(!1,!0);let e=t._$AA;const n=t._$AB.nextSibling;for(;e!==n;){const t=e.nextSibling;e.remove(),e=t}},ot=t=>{t._$AR()},at=(t,e)=>{const n=t._$AN;if(void 0===n)return!1;for(const t of n)t._$AO?.(e,!1),at(t,e);return!0},lt=t=>{let e,n;do{if(void 0===(e=t._$AM))break;n=e._$AN,n.delete(t),t=e}while(0===n?.size)},ct=t=>{for(let e;e=t._$AM;t=e){let n=e._$AN;if(void 0===n)e._$AN=n=new Set;else if(n.has(t))break;n.add(t),dt(e)}};
|
|
17
|
+
/**
|
|
18
|
+
* @license
|
|
19
|
+
* Copyright 2020 Google LLC
|
|
20
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
21
|
+
*/function ht(t){void 0!==this._$AN?(lt(this),this._$AM=t,ct(this)):this._$AM=t}function ut(t,e=!1,n=0){const s=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(e)if(Array.isArray(s))for(let t=n;t<s.length;t++)at(s[t],!1),lt(s[t]);else null!=s&&(at(s,!1),lt(s));else at(this,t)}const dt=t=>{t.type==V&&(t._$AP??=ut,t._$AQ??=ht)};class ft extends q{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,n){super._$AT(t,e,n),ct(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(at(this,t),lt(this))}setValue(t){if(J(this.t))this.t._$AI(t,this);else{const e=[...this.t._$AH];e[this.i]=t,this.t._$AI(e,this,0)}}disconnected(){}reconnected(){}}
|
|
22
|
+
/**
|
|
23
|
+
* @license
|
|
24
|
+
* Copyright 2021 Google LLC
|
|
25
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
26
|
+
*/class pt{constructor(t){this.Y=t}disconnect(){this.Y=void 0}reconnect(t){this.Y=t}deref(){return this.Y}}class mt{constructor(){this.Z=void 0,this.q=void 0}get(){return this.Z}pause(){this.Z??=new Promise(t=>this.q=t)}resume(){this.q?.(),this.Z=this.q=void 0}}
|
|
27
|
+
/**
|
|
28
|
+
* @license
|
|
29
|
+
* Copyright 2017 Google LLC
|
|
30
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
31
|
+
*/class _t extends ft{constructor(){super(...arguments),this.K=new pt(this),this.X=new mt}render(t,e){return E}update(t,[e,n]){if(this.isConnected||this.disconnected(),e===this.J)return E;this.J=e;let s=0;const{K:i,X:r}=this;return(async(t,e)=>{for await(const n of t)if(!1===await e(n))return})(e,async t=>{for(;r.get();)await r.get();const o=i.deref();if(void 0!==o){if(o.J!==e)return!1;void 0!==n&&(t=n(t,s)),o.commitValue(t,s),s++}return!0}),E}commitValue(t,e){this.setValue(t)}disconnected(){this.K.disconnect(),this.X.pause()}reconnected(){this.K.reconnect(this),this.X.resume()}}const gt=B(_t),yt=B(class extends _t{constructor(t){if(super(t),t.type!==V)throw Error("asyncAppend can only be used in child expressions")}update(t,e){return this.tt=t,super.update(t,e)}commitValue(t,e){0===e&&ot(this.tt);const n=tt(this.tt);et(n,t)}}),vt=t=>{return e=t,null!=e?._$litType$?.h?t._$litType$.h:t.strings;var e},wt=B(class extends q{constructor(t){super(t),this.et=new WeakMap}render(t){return[t]}update(t,[e]){const n=K(this.it)?vt(this.it):null,s=K(e)?vt(e):null;if(null!==n&&(null===s||n!==s)){const e=it(t).pop();let s=this.et.get(n);if(void 0===s){const t=document.createDocumentFragment();s=U(A,t),s.setConnected(!1),this.et.set(n,s)}st(s,[e]),tt(s,void 0,e)}if(null!==s){if(null===n||n!==s){const e=this.et.get(s);if(void 0!==e){const n=it(e).pop();ot(t),tt(t,void 0,n),st(t,[n])}}this.it=e}else this.it=void 0;return this.render(e)}}),bt=B(class extends q{constructor(t){if(super(t),t.type!==F||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter(e=>t[e]).join(" ")+" "}update(t,[e]){if(void 0===this.st){this.st=new Set,void 0!==t.strings&&(this.nt=new Set(t.strings.join(" ").split(/\s/).filter(t=>""!==t)));for(const t in e)e[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(e)}const n=t.element.classList;for(const t of this.st)t in e||(n.remove(t),this.st.delete(t));for(const t in e){const s=!!e[t];s===this.st.has(t)||this.nt?.has(t)||(s?(n.add(t),this.st.add(t)):(n.remove(t),this.st.delete(t)))}return E}}),St={},Et=B(class extends q{constructor(){super(...arguments),this.ot=St}render(t,e){return e()}update(t,[e,n]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every((t,e)=>t===this.ot[e]))return E}else if(this.ot===e)return E;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,n)}}),At=t=>t??A;
|
|
32
|
+
/**
|
|
33
|
+
* @license
|
|
34
|
+
* Copyright 2017 Google LLC
|
|
35
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* @license
|
|
39
|
+
* Copyright 2021 Google LLC
|
|
40
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
+
*/
|
|
42
|
+
function*Ct(t,e){const n="function"==typeof e;if(void 0!==t){let s=-1;for(const i of t)s>-1&&(yield n?e(s):e),s++,yield i}}
|
|
43
|
+
/**
|
|
44
|
+
* @license
|
|
45
|
+
* Copyright 2021 Google LLC
|
|
46
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
47
|
+
*/const Mt=B(class extends q{constructor(){super(...arguments),this.key=A}render(t,e){return this.key=t,e}update(t,[e,n]){return e!==this.key&&(st(t),this.key=e),n}}),kt=B(class extends q{constructor(t){if(super(t),t.type!==W&&t.type!==F&&t.type!==H)throw Error("The `live` directive is not allowed on child or event bindings");if(!J(t))throw Error("`live` bindings can only contain a single expression")}render(t){return t}update(t,[e]){if(e===E||e===A)return e;const n=t.element,s=t.name;if(t.type===W){if(e===n[s])return E}else if(t.type===H){if(!!e===n.hasAttribute(s))return E}else if(t.type===F&&n.getAttribute(s)===e+"")return E;return st(t),e}});
|
|
48
|
+
/**
|
|
49
|
+
* @license
|
|
50
|
+
* Copyright 2020 Google LLC
|
|
51
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
52
|
+
*/
|
|
53
|
+
/**
|
|
54
|
+
* @license
|
|
55
|
+
* Copyright 2021 Google LLC
|
|
56
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
57
|
+
*/
|
|
58
|
+
function*xt(t,e,n=1){const s=void 0===e?0:t;e??=t;for(let t=s;n>0?t<e:e<t;t+=n)yield t}
|
|
59
|
+
/**
|
|
60
|
+
* @license
|
|
61
|
+
* Copyright 2017 Google LLC
|
|
62
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
63
|
+
*/const $t=(t,e,n)=>{const s=new Map;for(let i=e;i<=n;i++)s.set(t[i],i);return s},Tt=B(class extends q{constructor(t){if(super(t),t.type!==V)throw Error("repeat() can only be used in text expressions")}dt(t,e,n){let s;void 0===n?n=e:void 0!==e&&(s=e);const i=[],r=[];let o=0;for(const e of t)i[o]=s?s(e,o):o,r[o]=n(e,o),o++;return{values:r,keys:i}}render(t,e,n){return this.dt(t,e,n).values}update(t,[e,n,s]){const i=it(t),{values:r,keys:o}=this.dt(e,n,s);if(!Array.isArray(i))return this.ut=o,r;const a=this.ut??=[],l=[];let c,h,u=0,d=i.length-1,f=0,p=r.length-1;for(;u<=d&&f<=p;)if(null===i[u])u++;else if(null===i[d])d--;else if(a[u]===o[f])l[f]=et(i[u],r[f]),u++,f++;else if(a[d]===o[p])l[p]=et(i[d],r[p]),d--,p--;else if(a[u]===o[p])l[p]=et(i[u],r[p]),tt(t,l[p+1],i[u]),u++,p--;else if(a[d]===o[f])l[f]=et(i[d],r[f]),tt(t,i[u],i[d]),d--,f++;else if(void 0===c&&(c=$t(o,f,p),h=$t(a,u,d)),c.has(a[u]))if(c.has(a[d])){const e=h.get(o[f]),n=void 0!==e?i[e]:null;if(null===n){const e=tt(t,i[u]);et(e,r[f]),l[f]=e}else l[f]=et(n,r[f]),tt(t,i[u],n),i[e]=null;f++}else rt(i[d]),d--;else rt(i[u]),u++;for(;f<=p;){const e=tt(t,l[p+1]);et(e,r[f]),l[f++]=e}for(;u<=d;){const t=i[u++];null!==t&&rt(t)}return this.ut=o,st(t,l),E}}),Rt="important",Ot=" !"+Rt,zt=B(class extends q{constructor(t){if(super(t),t.type!==F||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,n)=>{const s=t[n];return null==s?e:e+`${n=n.includes("-")?n:n.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(t,[e]){const{style:n}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?n.removeProperty(t):n[t]=null);for(const t in e){const s=e[t];if(null!=s){this.ft.add(t);const e="string"==typeof s&&s.endsWith(Ot);t.includes("-")||e?n.setProperty(t,e?s.slice(0,-11):s,e?Rt:""):n[t]=s}}return E}}),It=t=>{return!(e=t,null===e||"object"!=typeof e&&"function"!=typeof e||"function"!=typeof t.then);var e},Pt=1073741823;
|
|
64
|
+
/**
|
|
65
|
+
* @license
|
|
66
|
+
* Copyright 2018 Google LLC
|
|
67
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
68
|
+
*/const Dt=B(class extends ft{constructor(){super(...arguments),this.wt=Pt,this.bt=[],this.K=new pt(this),this.X=new mt}render(...t){return t.find(t=>!It(t))??E}update(t,e){const n=this.bt;let s=n.length;this.bt=e;const i=this.K,r=this.X;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this.wt);t++){const o=e[t];if(!It(o))return this.wt=t,o;t<s&&o===n[t]||(this.wt=Pt,s=0,Promise.resolve(o).then(async t=>{for(;r.get();)await r.get();const e=i.deref();if(void 0!==e){const n=e.bt.indexOf(o);n>-1&&n<e.wt&&(e.wt=n,e.setValue(t))}}))}return E}disconnected(){this.K.disconnect(),this.X.pause()}reconnected(){this.K.reconnect(this),this.X.resume()}});
|
|
69
|
+
/**
|
|
70
|
+
* @license
|
|
71
|
+
* Copyright 2021 Google LLC
|
|
72
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
73
|
+
*/function Lt(t,e,n){return t?e(t):n?.(t)}const Nt=()=>{},jt={registerComponent:Nt,unregisterComponent:Nt,notifyRender:Nt,getComponentName:()=>"Anonymous",logComponentMount:Nt,logComponentRender:Nt,logComponentUnmount:Nt,logAtomSet:Nt,logAtomUpdate:Nt,logEventTrigger:Nt,logCleanupEventTrigger:Nt,logFetchRequest:Nt,logFetchResponse:Nt,logFetchError:Nt,recordRender:Nt};function Ut(t,e){jt.registerComponent(t,e)}function Ft(t){return jt.getComponentName(t)}function Vt(t,e){jt.logEventTrigger(t,e)}function Wt(t,e,n){jt.recordRender(t,e,n)}function Ht(t){t.registerComponent&&(jt.registerComponent=t.registerComponent),t.unregisterComponent&&(jt.unregisterComponent=t.unregisterComponent),t.notifyRender&&(jt.notifyRender=t.notifyRender),t.getComponentName&&(jt.getComponentName=t.getComponentName),t.logComponentMount&&(jt.logComponentMount=t.logComponentMount),t.logComponentRender&&(jt.logComponentRender=t.logComponentRender),t.logComponentUnmount&&(jt.logComponentUnmount=t.logComponentUnmount),t.logAtomSet&&(jt.logAtomSet=t.logAtomSet),t.logAtomUpdate&&(jt.logAtomUpdate=t.logAtomUpdate),t.logEventTrigger&&(jt.logEventTrigger=t.logEventTrigger),t.logCleanupEventTrigger&&(jt.logCleanupEventTrigger=t.logCleanupEventTrigger),t.logFetchRequest&&(jt.logFetchRequest=t.logFetchRequest),t.logFetchResponse&&(jt.logFetchResponse=t.logFetchResponse),t.logFetchError&&(jt.logFetchError=t.logFetchError),t.recordRender&&(jt.recordRender=t.recordRender)}function Yt(){return jt.registerComponent!==Nt}let Bt=!1,qt=new Set,Xt=!1;function Zt(){return Bt}function Gt(){return qt}function Kt(){return Xt}function Jt(t){qt.add(t)}function Qt(){Xt=!0}function te(){Xt=!1}function ee(){const t={prevEnabled:Bt,prevStores:qt};return Bt=!0,qt=new Set,t}function ne(t){const e=qt;return Bt=t.prevEnabled,qt=t.prevStores,e}const se=ee,ie=ne,re={setupInProgress:!1,templateInProgress:!1,viewOuterInProgress:!1,isHookRunning:!1};function oe(){return!re.isHookRunning&&(re.templateInProgress||Kt())}function ae(t){if(!re.isHookRunning){if(re.templateInProgress)throw new Error(`${t} cannot be created during template function execution. Only scopes (useScope) are allowed in templates.`);if(Kt())throw new Error(`${t} cannot be created inside a memo() or effect(). They should only read state, not create new reactive primitives.`)}}function le(t){if(!re.viewOuterInProgress){if(re.templateInProgress)throw new Error(`${t} cannot be called during template function execution. Move it to the component's outer function.`);if(Kt())throw new Error(`${t} cannot be called inside a memo() or effect(). Move it to the component's outer function.`);throw new Error(`${t} must be called inside a component's outer function. It cannot be used at module level or inside inner functions (e.g. event handlers, timers, or callbacks).`)}}function ce(t,e){(function(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")})()&&(e?console.error(`[${e}]`,t):console.error(t))}function he(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)}function ue(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n}var de,fe,pe;"function"==typeof SuppressedError&&SuppressedError;class me{constructor(){de.set(this,new Set),fe.set(this,1)}subscribe(t){return he(this,de,"f").add(t),()=>he(this,de,"f").delete(t)}notify(){var t;ue(this,fe,(t=he(this,fe,"f"),++t),"f"),[...he(this,de,"f")].forEach(t=>{try{t?.()}catch(t){console.error(t)}})}getVersion(){return he(this,fe,"f")}get subscriberCount(){return he(this,de,"f").size}clear(){he(this,de,"f").clear()}}de=new WeakMap,fe=new WeakMap;class _e{constructor(){pe.set(this,new Set)}subscribe(t){return ae("subscribe"),he(this,pe,"f").has(t)?()=>{}:(he(this,pe,"f").add(t),()=>he(this,pe,"f").delete(t))}trigger(t){he(this,pe,"f").forEach(e=>{try{e(t)}catch(t){console.error("Error in event handler:",t)}})}get handlerCount(){return he(this,pe,"f").size}clear(){he(this,pe,"f").clear()}}pe=new WeakMap;const ge=[];function ye(t,e){ge.push(t);let n=null;try{n=e()}finally{ge.pop()}return n}function ve(t){const e=ge[ge.length-1];if(!e){if(!1!==t)throw new Error("getCurrentHost(): No active host context");return null}return e}let we=!1;function be(t){we=t}function Se(){return we}function Ee(t){t.DOMReadyEvent?.cleanupAndClearSubs(),t.PaintEvent?.cleanupAndClearSubs(),t.cleanups.forEach(t=>t.forEach(t=>{try{t()}catch(t){console.error("Error during cleanup:",t)}})),t.cleanups.clear(),t.onEachUpdateCallbacks.clear(),t.scopes=new Map,t._templateFn=null,t._xviewRender=()=>{},t._hasMounted=!1,t._errorState=null,t._errorHandlers=[]}const Ae=new class{constructor(){this.pending=new Set,this.isScheduled=!1}scheduleDisconnect(t){this.pending.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}cancelDisconnect(t){this.pending.delete(t)}flush(){const t=Array.from(this.pending);this.pending.clear(),this.isScheduled=!1;for(const e of t)e.isConnected||(Ee(e),e._view=null,e._props={},e.oldView=void 0)}reset(){this.pending.clear(),this.isScheduled=!1}},Ce=new class{constructor(){this.pendingEffects=new Set,this.isScheduled=!1,this._isFlushing=!1}get isFlushing(){return this._isFlushing}reset(){this.pendingEffects.clear(),this.isScheduled=!1,this._isFlushing=!1}schedule(t){this.pendingEffects.add(t),this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>this.flush()))}flush(){this._isFlushing=!0;let t=0;for(;this.pendingEffects.size>0;){if(t++>=500){this.pendingEffects.clear(),console.error("EffectScheduler: Maximum iteration limit (500) reached. This likely means an effect is infinitely updating its own dependency. Remaining effects have been dropped.");break}const e=Array.from(this.pendingEffects);this.pendingEffects.clear();for(const t of e)try{t()}catch(t){ce(t,"Effect")}}this._isFlushing=!1,this.isScheduled=!1,Me.flush()}},Me=new class{constructor(){this.pendingComponents=new Set,this.nextPendingComponents=new Set,this._currentWave=new Set,this.isScheduled=!1,this._isFlushing=!1,this._flushVersion=0,this._onIdleCallbacks=[]}get flushVersion(){return this._flushVersion}onceIdle(t){this._onIdleCallbacks.push(t),this._isFlushing||this.isScheduled||queueMicrotask(()=>this._drainIdleCallbacks())}_drainIdleCallbacks(){if(this._isFlushing||this.isScheduled)return;if(this.pendingComponents.size>0||this.nextPendingComponents.size>0)return;const t=this._onIdleCallbacks.splice(0);for(const e of t)try{e()}catch(t){console.error(t)}}reset(){this.pendingComponents.clear(),this.nextPendingComponents.clear(),this._currentWave.clear(),this._onIdleCallbacks.length=0,this.isScheduled=!1,this._isFlushing=!1}schedule(t){if(this._isFlushing){if(this._currentWave.has(t)&&t._renderVersion!==this._flushVersion)return;this.nextPendingComponents.add(t)}else this.pendingComponents.add(t);this.isScheduled||(this.isScheduled=!0,queueMicrotask(()=>{Ce.isScheduled||Ce.isFlushing||this.flush()}))}flush(){for(this.nextPendingComponents.size>0&&(this.nextPendingComponents.forEach(t=>this.pendingComponents.add(t)),this.nextPendingComponents.clear()),this._isFlushing=!0,this._flushVersion++;this.pendingComponents.size>0;){const t=Array.from(this.pendingComponents);this.pendingComponents.clear(),t.sort((t,e)=>t._depth-e._depth),this._currentWave=new Set(t);for(const e of t)if(e.isConnected)try{e._render()}catch(t){ce(t,"Component render")}this._currentWave.clear()}this._isFlushing=!1,this.isScheduled=!1,this.nextPendingComponents.size>0?(this.isScheduled=!0,queueMicrotask(()=>{Ce.isScheduled||Ce.isFlushing||this.flush()})):this._drainIdleCallbacks()}},ke=()=>{if(re.templateInProgress&&!re.setupInProgress)throw Error("Providers such as atoms, units, bubbles, getters, setters and actions can't be created inside the template function, you can create them in view function. Because template function gets called everytime the view updates.")},xe=()=>{},$e=t=>{ke(),t.__isOnMount__=!0;const e=ve();e.addToCleanUps(t,xe);if("AsyncFunction"===t.constructor.name&&Se())return e._asyncMountQueue=e._asyncMountQueue??[],void e._asyncMountQueue.push(t);let n=!1;e.DOMReadyEvent.__subscribe(()=>{if(n)return;n=!0;const s=t();if(s&&"object"==typeof s&&"function"==typeof s.then)return;const i=s;i&&e.addToCleanUps(t,i)})},Te=t=>{ke(),t.__isOnPaint__=!0;const e=ve();e.addToCleanUps(t,xe),e.PaintEvent.__subscribe(()=>t())},Re=t=>{ke(),t.__isOnAllMount__=!0;const e=ve();e.addToCleanUps(t,xe),Me.onceIdle(()=>{if(!e.isConnected)return;const n=t();n&&e.addToCleanUps(t,n)})},Oe=t=>{ke(),t.__isOnCleanup__=!0;ve().addToCleanUps(t,t)},ze=(t,e=!0)=>{if(e&&ae("Setter"),re.setupInProgress&&e)throw new Error("Setter cannot be created inside setup function. Define setters as class properties before setup runs.");let n=t;const s=ve();e&&ke();const i=new Set;try{const t=(...t)=>{const e=n(...t);return[...i].forEach(t=>{try{Ce.schedule(()=>t?.())}catch(t){console.error(t)}}),s?.isConnected&&Me.schedule(s),e};return t.__subscribe=t=>(ae("subscribe"),i.add(t),()=>i.delete(t)),t.__isSetter___=!0,t.set=t=>{n=t},Object.defineProperty(t,"__version__",{get:()=>0}),t}catch(t){throw new Error("You can only use setter or _ inside a scope or useState or view component's outer function")}},Ie=ze;function Pe(t,e=!0,n){if(Kt())return;const s=ve(e);if(s&&t&&!s.cleanups.has(t)){const e=n||t.__subscribe||t.subscribe,i=e?.(()=>{Me.schedule(s)});s.addToCleanUps(t,i)}}function De(t){return Pe(t,!0),t}const Le=(t,e)=>{t.__isOn__=!0,ae("on");const n=new Set;let s;const i=()=>{if(s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}const e=t();"function"==typeof e&&(s=e)},r=()=>Ce.schedule(i);e.forEach(t=>{n.add(t.__subscribe(r))});const o=()=>{if(n.forEach(t=>t()),s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}};return je(t,o),o};function Ne(t){let e=null;const n=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{context:t,resolve(t=null){e=t}}});return ve().dispatchEvent(n),e}const je=(t,e)=>{const n=ve(!1);n&&n.addToCleanUps(t,e)},Ue=t=>{ae("xTabEvent");const e=new Set,n=n=>{e.forEach(e=>{try{e(n)}catch(e){ce(e,`xTabEvent(${t}) handler`)}})},s="undefined"!=typeof BroadcastChannel?new BroadcastChannel(t):null;s&&(s.onmessage=t=>{n(t.data)});return{trigger:e=>{if(Vt(t,e),s)try{s.postMessage(e)}catch(e){ce(e,`xTabEvent(${t}) postMessage`)}n(e)},__subscribe:t=>{e.add(t);const n=()=>{e.delete(t)};return je(t,n),n},close:()=>{s&&s.close()},name:t,__isEvent___:!0,__isXTabEvent___:!0}},Fe=t=>{ae("event");const e=t||Math.random().toString(36).substring(2,15),n=new _e;return{trigger:t=>{Vt(e,t),n.trigger(t)},__subscribe:t=>n.subscribe(t),name:e,__isEvent___:!0}},Ve=t=>{ae("cleanupEvent");const e=t||Math.random().toString(36).substring(2,15),n=new Map,s=()=>{n.forEach(t=>{if(t)try{t()}catch(t){ce(t,"cleanupEvent cleanup")}})},i={trigger:t=>{!function(t,e){jt.logCleanupEventTrigger(t,e)}(e,t),n.forEach((e,s)=>{if(e)try{e()}catch(t){ce(t,"cleanupEvent cleanup")}try{const e=s(t);n.set(s,e)}catch(t){ce(t,"cleanupEvent handler"),n.set(s,void 0)}})},__subscribe:t=>(n.set(t,void 0),()=>{const e=n.get(t);if(e)try{e()}catch(t){ce(t,"cleanupEvent unsubscribe")}n.delete(t)}),cleanup:s,cleanupAndClearSubs:()=>{s(),n.clear()},get hasSubscribers(){return n.size>0},name:e,__isCleanupEvent___:!0,__isEvent___:!0};return i};function We(t){return!!t&&("AsyncFunction"===t.constructor?.name||t instanceof Promise||"object"==typeof t&&null!==t&&"then"in t||"function"==typeof t.then)}function He(t){return"function"==typeof t?t():t}function Ye(t){return t.default||t}function Be(){if("undefined"==typeof window)return!0;const t=window.location.hostname;return"localhost"===t||"127.0.0.1"===t||"[::1]"===t||t.startsWith("192.168.")||t.startsWith("10.")||t.endsWith(".local")}class qe extends HTMLElement{addScope(t,e){this.scopes.set(t,e)}onEachUpdate(t){this.onEachUpdateCallbacks.add(t)}constructor(){super(),this.name="Anonymous",this.scopes=new Map,this._useStates=[],this.lastVersion=-1,this._depth=0,this._parentComponent=null,this._renderVersion=0,this._errorHandlers=[],this._errorState=null,this.onEachUpdateCallbacks=new Set,this.DOMReadyEvent=null,this.PaintEvent=null,this._isViewLoading=!1,this._onRequestParentScope=t=>{const e=t,n=e.detail?.ScopeClass;if(n&&this.scopes.has(n)){const t=this.scopes.get(n);t&&(e.stopPropagation(),e.detail.resolve(t))}},this._props={},this._propsFn=()=>this._props,this._view=null,this._templateFn=null,this._hasMounted=!1,this._renderScheduled=!1,this.componentId=Math.random(),this.cleanups=new Map,this._xviewRender=()=>{};const t=re.templateInProgress;re.templateInProgress=!1,ye(this,()=>{this.DOMReadyEvent=Ve("DOMReady"),this.PaintEvent=Ve("Paint")}),re.templateInProgress=t}set props(t){this._props=t,Me.schedule(this)}get props(){return this._props}_applyViewChange(t,e){this.oldView!==t&&(this.oldView=t,e(t),(this._hasMounted||this._errorState)&&Ee(this))}set view(t){if(null!==t){if(We(t))return this._isViewLoading=!0,void He(t).then(t=>{this._isViewLoading=!1,this.view=Ye(t)},t=>{this._isViewLoading=!1,this._handleRenderError(t)});"function"==typeof t&&(this.name=t.name||"Anonymous"),this._applyViewChange(t,()=>{this._view=t}),Me.schedule(this)}}get view(){return this._view}callOnEachUpdate(){this.onEachUpdateCallbacks.forEach(t=>t())}connectedCallback(){this.addEventListener("request-parent-scope",this._onRequestParentScope);let t=0,e=null,n=this.parentElement;for(;n;){if(n instanceof qe){e=n,t=n._depth+1;break}n=n.parentElement}this._depth=t,this._parentComponent=e,Ae.cancelDisconnect(this),this._hasMounted&&(Be()&&!this._view?.skipDevToolsRender&&Ut(this,this._view),Me.schedule(this))}disconnectedCallback(){var t,e,n;this.removeEventListener("request-parent-scope",this._onRequestParentScope),Be()&&(this._view?.__devtools__||this._view?.skipDevToolsRender||(n=Ft(this),jt.logComponentUnmount(n)),this._view?.skipDevToolsRender||(t=this,e=this._view,jt.unregisterComponent(t,e))),Ae.scheduleDisconnect(this)}addToCleanUps(t,e){const n=this.cleanups.get(t);n?n.push(e):this.cleanups.set(t,[e])}_render(){var t,e,n;if(!(this._errorState||this._isViewLoading||this._renderScheduled)&&this._view)if(this._renderVersion=Me.flushVersion,this._hasMounted){if(this._xviewRender){this.callOnEachUpdate();let s=0;if(Be()){const i=this._view?.__devtools__,r=this._view?.skipDevToolsRender,o=performance.now();this._xviewRender(),s=performance.now()-o,i||r||(Wt(Ft(this),this.componentId,s),e=Ft(this),n=s,jt.logComponentRender(e,n)),r||(t=this,jt.notifyRender(t))}else this._xviewRender()}}else this._mountComponent()}_mountComponent(){const t=this._view;U(b``,this),re.viewOuterInProgress=!0;try{this._templateFn=ye(this,()=>t(this._propsFn))}catch(t){return re.viewOuterInProgress=!1,void this._handleRenderError(t)}if(re.viewOuterInProgress=!1,"function"==typeof this._templateFn){if(this._xviewRender=()=>{re.templateInProgress=!0;try{if(!this._templateFn)return;ye(this,()=>{const t=this._templateFn(this._propsFn);U(t,this)}),this.DOMReadyEvent?.trigger(),this.PaintEvent?.hasSubscribers&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.isConnected&&this.PaintEvent?.trigger()})})}catch(t){this._handleRenderError(t)}finally{re.templateInProgress=!1}},this.callOnEachUpdate(),Be()){const e=t?.__devtools__,n=t?.skipDevToolsRender,s=performance.now();this._xviewRender();const i=performance.now()-s;e||n||Wt(t?.name||"Anonymous",this.componentId,i)}else this._xviewRender();this._view===t&&(this._hasMounted=!0,Be()&&(t?.skipDevToolsRender||Ut(this,t),t?.__devtools__||t?.skipDevToolsRender||(e=t?.name||"Anonymous",jt.logComponentMount(e))))}else this._handleRenderError(new Error("inner function must be a template function that returns html result"));var e}_handleRenderError(t){this._errorState=t;for(const e of this._errorHandlers)try{e(t)}catch(t){}if(ce(t,`Component "${this.name}"`),this._view?.__isErrorView__)return;const e=this.name,n=t instanceof Error?t.message:String(t),s=t instanceof Error&&t.stack?t.stack.split("\n").slice(1).map(t=>t.trim()).filter(Boolean).join("\n"):null,i=()=>()=>b`
|
|
2
74
|
<div
|
|
3
75
|
style="padding:14px 16px;margin:4px;border:2px solid #e74c3c;border-radius:6px;background:#fdf0ef;color:#c0392b;font-family:monospace;font-size:13px;line-height:1.5"
|
|
4
76
|
>
|
|
5
77
|
<strong style="display:block;margin-bottom:6px;font-size:14px">
|
|
6
|
-
⚠ ${
|
|
78
|
+
⚠ ${e} crashed
|
|
7
79
|
</strong>
|
|
8
80
|
<div
|
|
9
|
-
style="margin-bottom:${
|
|
81
|
+
style="margin-bottom:${s?"10px":"0"};word-break:break-word"
|
|
10
82
|
>
|
|
11
|
-
${
|
|
83
|
+
${n}
|
|
12
84
|
</div>
|
|
13
|
-
${
|
|
85
|
+
${s?b`<details>
|
|
14
86
|
<summary
|
|
15
87
|
style="cursor:pointer;opacity:0.75;font-size:11px;margin-bottom:4px"
|
|
16
88
|
>
|
|
@@ -19,86 +91,83 @@
|
|
|
19
91
|
<pre
|
|
20
92
|
style="margin:6px 0 0;padding:8px;background:rgba(231,76,60,0.08);border-radius:4px;font-size:11px;overflow-x:auto;white-space:pre-wrap;word-break:break-all"
|
|
21
93
|
>
|
|
22
|
-
${
|
|
94
|
+
${s}</pre
|
|
23
95
|
>
|
|
24
96
|
</details>`:null}
|
|
25
97
|
</div>
|
|
26
|
-
`;r.__isErrorView__=!0,r.skipDevToolsRender=!0,this.view=r,this.name=n}}customElements.get("x-view")||customElements.define("x-view",mt);class gt extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,n=e.detail?.context.id;n&&null!=this.id&&n===this.id&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}set context(t){this.id=t.id}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}function _t(t){let e=-1===t.indexOf("\0")?t:t.replace(/\0/g,"");const n=function(t){const e=t.indexOf("{"),n=t.indexOf("}");return-1===e&&-1===n?-1:-1===e?n:-1===n?e:Math.min(e,n)}(e);return-1!==n&&(e=e.slice(0,n)),/url\s*\(/i.test(e)&&(e=e.replace(/\burl\s*\(\s*(['"]?)\s*(?:javascript:|vbscript:|data:text\/html[,;])/gi,"url($1")),e}function yt(t){return t.length>0&&/^[a-zA-Z-]+$/.test(t)}customElements.get("x-provider")||customElements.define("x-provider",gt);let vt=0;function wt(){return`_m${(vt++).toString(36)}`}const bt=Object.create(null),St={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function xt(t){const e=bt[t];if(void 0!==e)return e;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);return bt[t]=n,n}function Et(t,e,n){if(!n)return`.${t} {\n${e}}`;if(n.startsWith("&")){return`.${t}${n.slice(1)} {\n${e}}`}return`${n} {\n .${t} {\n${e.replace(/^ {2}/gm," ")} }\n}`}function Ct(t){return t.startsWith("&")||t.startsWith("@media")?t:Object.prototype.hasOwnProperty.call(St,t)?`@media (min-width: ${St[t]})`:null}function Mt(t,e,n){const s=Object.create(null);for(const i in t){const r=t[i];let o="",a=null;for(const t in r){const e=r[t];if(null!=e){if("object"==typeof e&&!Array.isArray(e)){const n=Ct(t);if(null===n)throw new Error(`[css-in-js] Unknown nested key "${t}" in block "${i}". Use "&:pseudo", "@media (...)", or a configured breakpoint key.`);let s="";const r=e;for(const t in r){const e=r[t];null!=e&&(yt(t)?s+=` ${xt(t)}: ${_t(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`))}s.length>0&&(null===a&&(a=[]),a.push([s,n]));continue}yt(t)?o+=` ${xt(t)}: ${_t(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`)}}if(0===o.length&&null===a){s[i]="";continue}const l=n?.literal?i:`${i}${wt()}`;if(o.length>0&&e.push(Et(l,o,"")),null!==a)for(let t=0;t<a.length;t++)e.push(Et(l,a[t][0],a[t][1]));s[i]=l}return s}function kt(t){return Object.freeze(t)}var At,Ot,Rt,Pt,Tt,zt,It,Dt;function Lt(t){if(j.templateInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a template function.`);if(j.viewOuterInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a component outer function. Move it outside the component function.`);if(j.setupInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a setup function.`)}let jt=0;function Nt(t){return`${t}_kf${(jt++).toString(36)}`}function $t(t,e){let n="";for(const t in e){const s=e[t];let i="";for(const t in s){const e=s[t];if(null==e)continue;i+=` ${t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}: ${String(e)};\n`}i&&(n+=` ${t} {\n${i} }\n`)}return`@keyframes ${t} {\n${n}}`}class Ut{constructor(){At.add(this),Ot.set(this,""),Rt.set(this,0),Pt.set(this,null),Tt.set(this,[])}keyframes(t,e){const n=Nt(t);return this.appendRules($t(n,e)),n}appendRules(t){""!==t&&(F(this,Tt,"f").push(t),F(this,Rt,"f")>0&&F(this,At,"m",zt).call(this))}mount(){var t;V(this,Rt,(t=F(this,Rt,"f"),++t),"f"),1===F(this,Rt,"f")&&(F(this,At,"m",zt).call(this),F(this,Pt,"f")||F(this,At,"m",It).call(this))}unmount(){var t;F(this,Rt,"f")<=0||(V(this,Rt,(t=F(this,Rt,"f"),--t),"f"),0===F(this,Rt,"f")&&F(this,At,"m",Dt).call(this))}get refCount(){return F(this,Rt,"f")}get cssText(){return F(this,Ot,"f")}get isMounted(){return F(this,Rt,"f")>0}get sheet(){return F(this,Pt,"f")}}Ot=new WeakMap,Rt=new WeakMap,Pt=new WeakMap,Tt=new WeakMap,At=new WeakSet,zt=function(){if(0===F(this,Tt,"f").length)return;const t=F(this,Tt,"f").join("\n");V(this,Tt,[],"f"),V(this,Ot,F(this,Ot,"f")+(F(this,Ot,"f")?"\n":"")+t,"f"),F(this,At,"m",It).call(this)},It=function(){F(this,Pt,"f")||(V(this,Pt,new CSSStyleSheet,"f"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,F(this,Pt,"f")]),F(this,Pt,"f").replaceSync(F(this,Ot,"f"))},Dt=function(){F(this,Pt,"f")&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==F(this,Pt,"f")),V(this,Pt,null,"f")),F(this,Ot,"f")&&(F(this,Tt,"f").unshift(F(this,Ot,"f")),V(this,Ot,"","f"))};let Ft=null,Vt=!1;function Wt(){return Ft||(Ft=new Ut),Ft}function Yt(){Ft||(Ft=new Ut),Vt||(Vt=!0,queueMicrotask(()=>{Vt=!1,Ft.mount()}))}function Ht(t,e){Lt("globalCSS"),Yt();const n=[],s=Mt(t,n,e);return n.length>0&&Ft.appendRules(n.join("\n")),kt(s)}function qt(t){Lt("globalRawCSS"),Yt(),Ft.appendRules(t)}const Bt="__matesAnimationsInjected";function Gt(){globalThis[Bt]||(globalThis[Bt]=!0,qt('\n[class*="mates-"] {\n --mates-duration : 300ms;\n --mates-easing : ease;\n --mates-distance : 24px;\n animation-duration : var(--mates-duration);\n animation-timing-function : var(--mates-easing);\n animation-fill-mode : both;\n}\n'),qt("\n@keyframes mates-kf-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes mates-kf-fade-out { from { opacity: 1 } to { opacity: 0 } }\n\n@keyframes mates-kf-slide-in-up {\n from { opacity: 0; transform: translateY(var(--mates-distance)) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-up {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-down {\n from { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-down {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(var(--mates-distance)) }\n}\n@keyframes mates-kf-slide-in-left {\n from { opacity: 0; transform: translateX(var(--mates-distance)) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-left {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-right {\n from { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-right {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(var(--mates-distance)) }\n}\n\n@keyframes mates-kf-scale-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n@keyframes mates-kf-scale-out {\n from { opacity: 1; transform: scale(1) }\n to { opacity: 0; transform: scale(0.92) }\n}\n\n@keyframes mates-kf-spring-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n\n@keyframes mates-kf-flip-in-x {\n from { opacity: 0; transform: rotateX(90deg) }\n to { opacity: 1; transform: rotateX(0deg) }\n}\n@keyframes mates-kf-flip-in-y {\n from { opacity: 0; transform: rotateY(90deg) }\n to { opacity: 1; transform: rotateY(0deg) }\n}\n\n@keyframes mates-kf-blur-in {\n from { opacity: 0; filter: blur(10px) }\n to { opacity: 1; filter: blur(0) }\n}\n@keyframes mates-kf-blur-out {\n from { opacity: 1; filter: blur(0) }\n to { opacity: 0; filter: blur(10px) }\n}\n\n@keyframes mates-kf-shake {\n 0%, 100% { transform: translateX(0) }\n 15% { transform: translateX(calc(-1 * var(--mates-distance))) }\n 30% { transform: translateX(calc( 1 * var(--mates-distance))) }\n 45% { transform: translateX(calc(-0.6 * var(--mates-distance))) }\n 60% { transform: translateX(calc( 0.6 * var(--mates-distance))) }\n 75% { transform: translateX(calc(-0.3 * var(--mates-distance))) }\n 90% { transform: translateX(calc( 0.3 * var(--mates-distance))) }\n}\n\n@keyframes mates-kf-pulse {\n 0%, 100% { transform: scale(1) }\n 50% { transform: scale(1.08) }\n}\n\n@keyframes mates-kf-bounce {\n 0% { transform: translateY(0) }\n 20% { transform: translateY(calc(-0.40 * var(--mates-distance))) }\n 40% { transform: translateY(0) }\n 60% { transform: translateY(calc(-0.20 * var(--mates-distance))) }\n 80% { transform: translateY(0) }\n 90% { transform: translateY(calc(-0.08 * var(--mates-distance))) }\n 100% { transform: translateY(0) }\n}\n\n@keyframes mates-kf-spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n}\n"),Ht({"mates-fade-in":{animationName:"mates-kf-fade-in"},"mates-fade-out":{animationName:"mates-kf-fade-out"},"mates-slide-in-up":{animationName:"mates-kf-slide-in-up"},"mates-slide-out-up":{animationName:"mates-kf-slide-out-up"},"mates-slide-in-down":{animationName:"mates-kf-slide-in-down"},"mates-slide-out-down":{animationName:"mates-kf-slide-out-down"},"mates-slide-in-left":{animationName:"mates-kf-slide-in-left"},"mates-slide-out-left":{animationName:"mates-kf-slide-out-left"},"mates-slide-in-right":{animationName:"mates-kf-slide-in-right"},"mates-slide-out-right":{animationName:"mates-kf-slide-out-right"},"mates-scale-in":{animationName:"mates-kf-scale-in"},"mates-scale-out":{animationName:"mates-kf-scale-out"},"mates-spring-in":{animationName:"mates-kf-spring-in","--mates-easing":"cubic-bezier(0.34, 1.56, 0.64, 1)"},"mates-flip-in-x":{animationName:"mates-kf-flip-in-x"},"mates-flip-in-y":{animationName:"mates-kf-flip-in-y"},"mates-blur-in":{animationName:"mates-kf-blur-in"},"mates-blur-out":{animationName:"mates-kf-blur-out"},"mates-shake":{animationName:"mates-kf-shake","--mates-duration":"500ms","--mates-easing":"ease-in-out"},"mates-pulse":{animationName:"mates-kf-pulse","--mates-duration":"600ms","--mates-easing":"ease-in-out"},"mates-bounce":{animationName:"mates-kf-bounce","--mates-duration":"700ms"},"mates-spin":{animationName:"mates-kf-spin","--mates-easing":"linear"}},{literal:!0}))}Gt();class Xt{constructor(){this.state="idle",this.__isZeroPromise__=!0,this.toActive()}isActive(){return"active"===this.state}isResolved(){return"resolved"===this.state}isRejected(){return"rejected"===this.state}isCancelled(){return"cancelled"===this.state}get signal(){return this.controller.signal}toActive(){return"active"===this.state||(this.state="active",this.controller=new AbortController,this.promise=new Promise((t,e)=>{this.resolveFn=t,this.rejectFn=e,this.controller.signal.addEventListener("abort",()=>{"active"===this.state&&(this.state="cancelled",e(new DOMException("Cancelled","AbortError")))})})),this}resolve(t){this.isActive()&&(this.state="resolved",this.resolveFn(t))}reject(t){this.isActive()&&(this.state="rejected",this.rejectFn(t))}cancel(t){this.isActive()&&this.controller.abort(t)}then(t,e){return this.promise.then(t,e)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}get[Symbol.toStringTag](){return"ZeroPromise"}}const Zt=(t,e,n)=>{const s="timeout"===n?setTimeout(()=>t(),e):setInterval(()=>t(),e);return ct(s,"timeout"===n?()=>clearTimeout(s):()=>clearInterval(s)),s};function Jt(t=300,e="ease"){return{keyframes:[{opacity:0},{opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function Qt(t=300,e="ease"){return{keyframes:[{opacity:1},{opacity:0}],options:{duration:t,easing:e,fill:"both"}}}const Kt={up:"translateY(-100%)",down:"translateY(100%)",left:"translateX(-100%)",right:"translateX(100%)"};function te(t,e){switch(t){case"up":return`translateY(-${e})`;case"down":return`translateY(${e})`;case"left":return`translateX(-${e})`;case"right":return`translateX(${e})`}}function ee(t){if(null==t||"object"!=typeof t)return t;try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||ee(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function ne(t,e,n){const s=D();let i;P();try{i=t()}finally{T();L(s).forEach(t=>{"function"==typeof t.__subscribe&&e(t,n)})}return i}function se(t,e){if(N(t),"AsyncFunction"===e.constructor.name)throw new Error(`${t.toLowerCase()}() does not support async functions.`);if(O())throw new Error(`${t.toLowerCase()}() cannot be nested inside an effect() or memo().`)}function ie(t){const{name:e,fn:n,onRun:s,supportsCleanup:i}=t;se(e,n);const r=new Set;let o,a=!1;const l=()=>{if(i&&o){try{o()}catch(t){console.error("Error in effect cleanup:",t)}o=void 0}},c=()=>{if(a)return;l();const t=new Set(r);r.clear();const e=()=>{a||et.schedule(c)};let h;try{h=ne(n,t=>{r.add(t.__subscribe(e))},e)}finally{t.forEach(t=>t())}if(a)return r.forEach(t=>t()),void r.clear();i&&"function"==typeof h&&(o=h),s(h)},h=()=>{a||(a=!0,l(),r.forEach(t=>t()),r.clear())};return c(),ct(n,h),h}let re=0;function oe(t,e){if("function"==typeof t){let e;return ie({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):e=oe(t,{skipRestrictedContextCheck:!0})}}),e}e?.skipRestrictedContextCheck||N("Atom");let n=t;const s=++re,i=new q;function r(){return lt(r,!1),A()&&R(r),n}return r.get=function(){return r()},r.set=function(t,e=!1){var o,a;n="function"==typeof t?t(n):t,r.skipDevToolsLog||(o=String(s),a=n,w.logAtomSet(o,a)),e||i.notify()},r.update=function(t,e=!1){var o;"object"==typeof n&&null!==n&&(t(n),r.skipDevToolsLog||(o=String(s),w.logAtomUpdate(o)),e||i.notify())},r.__subscribe=function(t){return i.subscribe(t)},r.toJSON=function(){return JSON.stringify(n)},Object.defineProperty(r,"name",{value:"atom",writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(r,"val",{get:()=>r(),set:t=>r.set(t),enumerable:!1,configurable:!0}),Object.defineProperty(r,"__version__",{get:()=>i.getVersion(),enumerable:!1}),Object.defineProperty(r,"__isAtom___",{value:!0,writable:!1,enumerable:!1}),Object.defineProperty(r,"__id__",{value:s,writable:!1,enumerable:!1}),r}function ae(t,e){e?.skipRestrictedContextCheck||N("iAtom");const n=oe(ce(t),{skipRestrictedContextCheck:!0}),s=n.set;n.set=function(t,e=!1){const i="function"==typeof t?t(n.get()):t;s(ce(i),e)};const i=n;return delete i.update,i.name="iAtom",i}function le(t,e={}){e.skipRestrictedContextCheck||N("superAtom"),st();const n=e.freeze??!1,s=n?ce(he(t)):t;let i=!1,r="default";const o=oe(n?ce(t):t,{skipRestrictedContextCheck:!0}),a=o.set;o.set=function(t,e=!1){if(i)return;const s="function"==typeof t?t(o.get()):t;a(n?ce(s):s,e)};const l=o.update;o.update=function(t,e=!1){if(!i){if(n)throw new Error("update() is not supported when freeze is enabled — use set() with a new value.");l(t,e)}};const c=o;return c.lock=function(t="default"){i=!0,r=t},c.unlock=function(t="default"){if(r!==t)throw new Error("Incorrect passcode. Cannot unlock atom.");i=!1},c.reset=function(){i||o.set(n?ce(he(s)):s)},c.freeze=function(){ee(o.get())},c.name="superAtom",c}function ce(t){return"object"==typeof t&&null!==t?ee(t):t}function he(t){try{return structuredClone(t)}catch{return t}}function ue(t){const e=new Map,n=[],s=t=>JSON.stringify(t),i=t=>{e.delete(t);const s=n.indexOf(t);s>-1&&n.splice(s,1)};return{getCacheKey:s,removeCacheEntry:i,createCacheMethod:(r,o,a,l)=>async(...c)=>{const h=s(c),u=e.get(h);if(u){const e=Date.now();if(!(void 0!==t?.cacheDuration&&e-u.timestamp>t.cacheDuration)){const t=n.indexOf(h);return t>-1&&n.splice(t,1),n.push(h),r.set(u.result),o.set(null),a.set("success"),u.result}i(h)}const d=await l(this,c);e.set(h,{result:d,timestamp:Date.now()});const f=n.indexOf(h);if(f>-1&&n.splice(f,1),n.push(h),t?.cacheLimit&&n.length>t.cacheLimit){const t=n.shift();t&&e.delete(t)}return d},createClearCacheMethod:()=>(...t)=>{if(0===t.length)e.clear(),n.length=0;else{const e=s(t);i(e)}}}}function de(t){let e=null,n=null;const s=()=>{e&&(clearInterval(e),e=null,n=null)};return{createStartPollingMethod:i=>(...r)=>{t?.pollInterval?(s(),n=r,i(...r),e=setInterval(()=>{n&&i(...n)},t.pollInterval)):U(new Error("pollInterval not specified in asyncAction options"))},createStopPollingMethod:()=>s,stopPolling:s}}function fe(t,e){e?.allowInRestrictedContext||N("Async Action");const n={...{cacheLimit:10,pollInterval:5e3},...e};let s=t;const i=new Set;let r=null,o=null,a=null,l=null;const c=ue(n),h=de(n),u=oe(null),d=oe(null),f=oe(!1),p=oe("init"),m=t=>{i.forEach(e=>{if(void 0===e.filter||void 0===t||e.filter===t)try{e.fn()}catch(t){U(t)}})},g=()=>{o?.isActive()&&(o.cancel(),o=null),r&&(r.abort(),r=null),f.set(!1),p.set("init")},_=async(t,e)=>{g(),f.set(!0),p.set("loading"),r=new AbortController;const n=r;try{let i;if(a){i=a((...e)=>s.call(t,...e),...e)}else i=s.call(t,...e);i?.__isZeroPromise__&&(o=i);let c=await i;if(n.signal.aborted||r!==n)throw new Error("Operation was cancelled");return l&&(c=l(c)),u.set(c),d.set(null),p.set("success"),m(!0),c}catch(t){if(n.signal.aborted||r!==n)throw t;const e=t instanceof Error?t:new Error(String(t));throw u.set(null),d.set(e),p.set("error"),m(!1),e}finally{r===n&&(r=null),f.set(!1),o&&!o.isActive()&&(o=null)}},y=async(...t)=>{const e=this;if(Q()){const n=Z(!1);if(n?._ssrPromiseQueue){const s=_(e,t).catch(()=>{});return n._ssrPromiseQueue.push(s),s}}return _(e,t)},v=c.createCacheMethod(u,d,p,_),w=c.createClearCacheMethod(),b=h.createStartPollingMethod(y),S=h.createStopPollingMethod(),x=Object.assign(y,{data:u,error:d,isLoading:f,status:p,val:()=>s,set:t=>{s=t},params:{page:1},cancel:g,subscribe:(t,e)=>{N("subscribe");const n={fn:t,filter:e};i.add(n);const s=()=>i.delete(n);return ct(t,s),s},cache:v,clearCache:w,startPolling:b,stopPolling:S,interceptBefore:t=>{a=t},interceptAfter:t=>{l=t},__isAsyncAction___:!0,__isAction___:!1});return Object.defineProperty(x,"abortController",{get:()=>r,enumerable:!0,configurable:!0}),ct(x,()=>{i.clear(),h.stopPolling(),g()}),x}class pe{constructor(){this.timeoutId=null,this.pendingArgs=null,this.pendingContext=null}clearPending(){this.pendingArgs=null,this.pendingContext=null}setPending(t,e){this.pendingArgs=t,this.pendingContext=e}clearTimer(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}setTimer(t,e){this.timeoutId=((t,e)=>Zt(t,e,"timeout"))(t,e)}executePending(t){return this.pendingArgs&&(this.lastResult=t.apply(this.pendingContext,this.pendingArgs),this.clearPending()),this.lastResult}}function me(t,e){return()=>{t.clearTimer(),t.clearPending(),e?.()}}function ge(t,e){return()=>{if(t.pendingArgs&&t.timeoutId){t.clearTimer();return t.executePending(e)}return t.lastResult}}function _e(t,e){const n=new pe,s=function(...s){return n.setPending(s,this),n.clearTimer(),n.setTimer(()=>{n.lastResult=n.executePending(t),n.timeoutId=null},e),n.lastResult};return s.cancel=me(n),s.flush=ge(n,t),s}function ye(t,e){const n=new pe;let s=0;const i=function(...i){const r=Date.now(),o=r-s;return o>=e?(s=r,n.lastResult=t.apply(this,i),n.clearPending(),n.clearTimer()):(n.setPending(i,this),n.timeoutId||n.setTimer(()=>{s=Date.now(),n.lastResult=n.executePending(t),n.timeoutId=null},e-o)),n.lastResult};return i.cancel=me(n,()=>{s=0}),i.flush=ge(n,t),i}function ve(t,e){return"function"!=typeof t.animate?Promise.resolve():("function"==typeof t.getAnimations&&t.getAnimations().forEach(t=>t.cancel()),new Promise(n=>{const s=t.animate(e.keyframes,{duration:300,easing:"ease",fill:"both",...e.options});s.onfinish=()=>n(),s.oncancel=()=>n()}))}async function we(t){const{el:e,exit:n,enter:s,swap:i,getEl:r,isStale:o}=t;if(!e)return void i();if(await ve(e,n),o?.())return;if(i(),await("function"!=typeof requestAnimationFrame?Promise.resolve():new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t())))),o?.())return;const a=r?.()??e;a&&await ve(a,s)}function be(t){return t.__isEffect__=!0,ie({name:"Effect",fn:t,onRun:()=>{},supportsCleanup:!0})}function Se(){const t=new B;let e;const n={get value(){return e},__subscribe:e=>t.subscribe(e),__isMatesRef__:!0,__set:n=>{e!==n&&(e=n,t.trigger(n))}};return n}function xe(t){if(t&&t.__isMatesRef__){const e=t;return g.ref(t=>{e.__set(t)})}return g.ref(t)}const Ee=(e,n={})=>t.html`<x-view .view=${e} .props=${n}></x-view>`,Ce=Ee,Me=oe(!1),ke=le("undefined"!=typeof window?window.location.pathname:"/");be(()=>{Me()?ke.lock():ke.unlock()}),"undefined"!=typeof window&&(window.addEventListener("popstate",()=>{const t=window.location.pathname;t!==ke.get()&&ke.set(t)}),window.addEventListener("hashchange",()=>{const t=window.location.pathname;t!==ke.get()&&ke.set(t)}),window.addEventListener("navigate",()=>{const t=window.location.pathname;t!==ke.get()&&ke.set(t)}));const Ae=t=>{const e=ke.get();if(e===t)return!0;const n=t.split("/").filter(Boolean),s=e.split("/").filter(Boolean);if(n.length!==s.length)return!1;for(let t=0;t<n.length;t++){const e=n[t],i=s[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0},Oe=e=>{const n=Se(),s=()=>e().options,i=e().options.notFound?{path:"*",component:e().options.notFound}:null,r=()=>{const{routes:t}=e();return t.find(t=>Ae(t.path))??i},o=r(),a=oe(o),l=oe(o);return be(()=>{const t=l();if(t===a.get())return;const e=n.value;if(!e)return void a.set(t);const i=s(),r=a.get();we({el:e,exit:r?.exit??i.exit??Qt(200),enter:t?.enter??i.enter??Jt(250),swap:()=>a.set(t),getEl:()=>n.value,isStale:()=>l.get()!==t})}),be(()=>{ke(),function(t){l.get()!==t&&l.set(t)}(r())}),rt(()=>{const t=n.value;if(!t)return;const e=a.get(),i=s();ve(t,e?.enter??i.enter??Jt(250))}),()=>{const e=a();return t.html`
|
|
98
|
+
`;i.__isErrorView__=!0,i.skipDevToolsRender=!0,this.view=i,this.name=e}}customElements.get("x-view")||customElements.define("x-view",qe);class Xe extends HTMLElement{constructor(){super(...arguments),this._onRequestContext=t=>{const e=t,n=e.detail?.context.id;n&&null!=this.id&&n===this.id&&(e.stopPropagation(),e.detail.resolve(this._value))}}connectedCallback(){this.addEventListener("request-context",this._onRequestContext)}set context(t){this.id=t.id}disconnectedCallback(){this.removeEventListener("request-context",this._onRequestContext)}set value(t){this._value=t}get value(){return this._value}}function Ze(t){let e=-1===t.indexOf("\0")?t:t.replace(/\0/g,"");const n=function(t){const e=t.indexOf("{"),n=t.indexOf("}");return-1===e&&-1===n?-1:-1===e?n:-1===n?e:Math.min(e,n)}(e);return-1!==n&&(e=e.slice(0,n)),/url\s*\(/i.test(e)&&(e=e.replace(/\burl\s*\(\s*(['"]?)\s*(?:javascript:|vbscript:|data:text\/html[,;])/gi,"url($1")),e}function Ge(t){return t.length>0&&/^[a-zA-Z-]+$/.test(t)}customElements.get("x-provider")||customElements.define("x-provider",Xe);let Ke=0;function Je(){return`_m${(Ke++).toString(36)}`}const Qe=Object.create(null),tn={sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"};function en(t){t.breakpoints&&Object.assign(tn,t.breakpoints)}function nn(t){const e=Qe[t];if(void 0!==e)return e;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);return Qe[t]=n,n}function sn(t,e,n){if(!n)return`.${t} {\n${e}}`;if(n.startsWith("&")){return`.${t}${n.slice(1)} {\n${e}}`}return`${n} {\n .${t} {\n${e.replace(/^ {2}/gm," ")} }\n}`}function rn(t){return t.startsWith("&")||t.startsWith("@media")?t:Object.prototype.hasOwnProperty.call(tn,t)?`@media (min-width: ${tn[t]})`:null}function on(t,e,n){const s=Object.create(null);for(const i in t){const r=t[i];let o="",a=null;for(const t in r){const e=r[t];if(null!=e){if("object"==typeof e&&!Array.isArray(e)){const n=rn(t);if(null===n)throw new Error(`[css-in-js] Unknown nested key "${t}" in block "${i}". Use "&:pseudo", "@media (...)", or a configured breakpoint key.`);let s="";const r=e;for(const t in r){const e=r[t];null!=e&&(Ge(t)?s+=` ${nn(t)}: ${Ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`))}s.length>0&&(null===a&&(a=[]),a.push([s,n]));continue}Ge(t)?o+=` ${nn(t)}: ${Ze(String(e))};\n`:console.warn(`[css-in-js] invalid property name skipped: "${t}"`)}}if(0===o.length&&null===a){s[i]="";continue}const l=n?.literal?i:`${i}${Je()}`;if(o.length>0&&e.push(sn(l,o,"")),null!==a)for(let t=0;t<a.length;t++)e.push(sn(l,a[t][0],a[t][1]));s[i]=l}return s}function an(t){return Object.freeze(t)}var ln,cn,hn,un,dn,fn,pn,mn;function _n(t){if(re.templateInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a template function.`);if(re.viewOuterInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a component outer function. Move it outside the component function.`);if(re.setupInProgress)throw new Error(`[css-in-js] ${t}() must be called at module level, not inside a setup function.`)}let gn=0;function yn(t){return`${t}_kf${(gn++).toString(36)}`}function vn(t,e){let n="";for(const t in e){const s=e[t];let i="";for(const t in s){const e=s[t];if(null==e)continue;const n=t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`);i+=` ${n}: ${String(e)};\n`}i&&(n+=` ${t} {\n${i} }\n`)}return`@keyframes ${t} {\n${n}}`}class wn{constructor(){ln.add(this),cn.set(this,""),hn.set(this,0),un.set(this,null),dn.set(this,[])}keyframes(t,e){const n=yn(t);return this.appendRules(vn(n,e)),n}appendRules(t){""!==t&&(he(this,dn,"f").push(t),he(this,hn,"f")>0&&he(this,ln,"m",fn).call(this))}mount(){var t;ue(this,hn,(t=he(this,hn,"f"),++t),"f"),1===he(this,hn,"f")&&(he(this,ln,"m",fn).call(this),he(this,un,"f")||he(this,ln,"m",pn).call(this))}unmount(){var t;he(this,hn,"f")<=0||(ue(this,hn,(t=he(this,hn,"f"),--t),"f"),0===he(this,hn,"f")&&he(this,ln,"m",mn).call(this))}get refCount(){return he(this,hn,"f")}get cssText(){return he(this,cn,"f")}get isMounted(){return he(this,hn,"f")>0}get sheet(){return he(this,un,"f")}}function bn(){_n("stylesheet");const t=new wn;return{css:function(e){_n("css");const n=[],s=on(e,n);return n.length>0&&t.appendRules(n.join("\n")),an(s)},mount:function(){if(function(t){if(re.templateInProgress)throw new Error(`[css-in-js] ${t}() must not be called inside a template function. Call it in the component outer function or at module level.`)}("mount"),null===ve(!1))return t.mount(),()=>t.unmount();$e(()=>(t.mount(),()=>t.unmount()))},keyframes:function(e,n){return _n("keyframes"),t.keyframes(e,n)}}}cn=new WeakMap,hn=new WeakMap,un=new WeakMap,dn=new WeakMap,ln=new WeakSet,fn=function(){if(0===he(this,dn,"f").length)return;const t=he(this,dn,"f").join("\n");ue(this,dn,[],"f"),ue(this,cn,he(this,cn,"f")+(he(this,cn,"f")?"\n":"")+t,"f"),he(this,ln,"m",pn).call(this)},pn=function(){he(this,un,"f")||(ue(this,un,new CSSStyleSheet,"f"),document.adoptedStyleSheets=[...document.adoptedStyleSheets,he(this,un,"f")]),he(this,un,"f").replaceSync(he(this,cn,"f"))},mn=function(){he(this,un,"f")&&(document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==he(this,un,"f")),ue(this,un,null,"f")),he(this,cn,"f")&&(he(this,dn,"f").unshift(he(this,cn,"f")),ue(this,cn,"","f"))};let Sn=null,En=!1;function An(){return Sn||(Sn=new wn),Sn}function Cn(){Sn||(Sn=new wn),En||(En=!0,queueMicrotask(()=>{En=!1,Sn.mount()}))}function Mn(t,e){_n("keyframes"),Cn();const n=yn(t);return Sn.appendRules(vn(n,e)),n}function kn(t,e){_n("globalCSS"),Cn();const n=[],s=on(t,n,e);return n.length>0&&Sn.appendRules(n.join("\n")),an(s)}function xn(t){_n("globalRawCSS"),Cn(),Sn.appendRules(t)}const $n="__matesAnimationsInjected";function Tn(){globalThis[$n]||(globalThis[$n]=!0,xn('\n[class*="mates-"] {\n --mates-duration : 300ms;\n --mates-easing : ease;\n --mates-distance : 24px;\n animation-duration : var(--mates-duration);\n animation-timing-function : var(--mates-easing);\n animation-fill-mode : both;\n}\n'),xn("\n@keyframes mates-kf-fade-in { from { opacity: 0 } to { opacity: 1 } }\n@keyframes mates-kf-fade-out { from { opacity: 1 } to { opacity: 0 } }\n\n@keyframes mates-kf-slide-in-up {\n from { opacity: 0; transform: translateY(var(--mates-distance)) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-up {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-down {\n from { opacity: 0; transform: translateY(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateY(0) }\n}\n@keyframes mates-kf-slide-out-down {\n from { opacity: 1; transform: translateY(0) }\n to { opacity: 0; transform: translateY(var(--mates-distance)) }\n}\n@keyframes mates-kf-slide-in-left {\n from { opacity: 0; transform: translateX(var(--mates-distance)) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-left {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n}\n@keyframes mates-kf-slide-in-right {\n from { opacity: 0; transform: translateX(calc(-1 * var(--mates-distance))) }\n to { opacity: 1; transform: translateX(0) }\n}\n@keyframes mates-kf-slide-out-right {\n from { opacity: 1; transform: translateX(0) }\n to { opacity: 0; transform: translateX(var(--mates-distance)) }\n}\n\n@keyframes mates-kf-scale-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n@keyframes mates-kf-scale-out {\n from { opacity: 1; transform: scale(1) }\n to { opacity: 0; transform: scale(0.92) }\n}\n\n@keyframes mates-kf-spring-in {\n from { opacity: 0; transform: scale(0.92) }\n to { opacity: 1; transform: scale(1) }\n}\n\n@keyframes mates-kf-flip-in-x {\n from { opacity: 0; transform: rotateX(90deg) }\n to { opacity: 1; transform: rotateX(0deg) }\n}\n@keyframes mates-kf-flip-in-y {\n from { opacity: 0; transform: rotateY(90deg) }\n to { opacity: 1; transform: rotateY(0deg) }\n}\n\n@keyframes mates-kf-blur-in {\n from { opacity: 0; filter: blur(10px) }\n to { opacity: 1; filter: blur(0) }\n}\n@keyframes mates-kf-blur-out {\n from { opacity: 1; filter: blur(0) }\n to { opacity: 0; filter: blur(10px) }\n}\n\n@keyframes mates-kf-shake {\n 0%, 100% { transform: translateX(0) }\n 15% { transform: translateX(calc(-1 * var(--mates-distance))) }\n 30% { transform: translateX(calc( 1 * var(--mates-distance))) }\n 45% { transform: translateX(calc(-0.6 * var(--mates-distance))) }\n 60% { transform: translateX(calc( 0.6 * var(--mates-distance))) }\n 75% { transform: translateX(calc(-0.3 * var(--mates-distance))) }\n 90% { transform: translateX(calc( 0.3 * var(--mates-distance))) }\n}\n\n@keyframes mates-kf-pulse {\n 0%, 100% { transform: scale(1) }\n 50% { transform: scale(1.08) }\n}\n\n@keyframes mates-kf-bounce {\n 0% { transform: translateY(0) }\n 20% { transform: translateY(calc(-0.40 * var(--mates-distance))) }\n 40% { transform: translateY(0) }\n 60% { transform: translateY(calc(-0.20 * var(--mates-distance))) }\n 80% { transform: translateY(0) }\n 90% { transform: translateY(calc(-0.08 * var(--mates-distance))) }\n 100% { transform: translateY(0) }\n}\n\n@keyframes mates-kf-spin {\n from { transform: rotate(0deg) }\n to { transform: rotate(360deg) }\n}\n"),kn({"mates-fade-in":{animationName:"mates-kf-fade-in"},"mates-fade-out":{animationName:"mates-kf-fade-out"},"mates-slide-in-up":{animationName:"mates-kf-slide-in-up"},"mates-slide-out-up":{animationName:"mates-kf-slide-out-up"},"mates-slide-in-down":{animationName:"mates-kf-slide-in-down"},"mates-slide-out-down":{animationName:"mates-kf-slide-out-down"},"mates-slide-in-left":{animationName:"mates-kf-slide-in-left"},"mates-slide-out-left":{animationName:"mates-kf-slide-out-left"},"mates-slide-in-right":{animationName:"mates-kf-slide-in-right"},"mates-slide-out-right":{animationName:"mates-kf-slide-out-right"},"mates-scale-in":{animationName:"mates-kf-scale-in"},"mates-scale-out":{animationName:"mates-kf-scale-out"},"mates-spring-in":{animationName:"mates-kf-spring-in","--mates-easing":"cubic-bezier(0.34, 1.56, 0.64, 1)"},"mates-flip-in-x":{animationName:"mates-kf-flip-in-x"},"mates-flip-in-y":{animationName:"mates-kf-flip-in-y"},"mates-blur-in":{animationName:"mates-kf-blur-in"},"mates-blur-out":{animationName:"mates-kf-blur-out"},"mates-shake":{animationName:"mates-kf-shake","--mates-duration":"500ms","--mates-easing":"ease-in-out"},"mates-pulse":{animationName:"mates-kf-pulse","--mates-duration":"600ms","--mates-easing":"ease-in-out"},"mates-bounce":{animationName:"mates-kf-bounce","--mates-duration":"700ms"},"mates-spin":{animationName:"mates-kf-spin","--mates-easing":"linear"}},{literal:!0}))}const Rn={fadeIn:"mates-fade-in",fadeOut:"mates-fade-out",slideInUp:"mates-slide-in-up",slideOutUp:"mates-slide-out-up",slideInDown:"mates-slide-in-down",slideOutDown:"mates-slide-out-down",slideInLeft:"mates-slide-in-left",slideOutLeft:"mates-slide-out-left",slideInRight:"mates-slide-in-right",slideOutRight:"mates-slide-out-right",scaleIn:"mates-scale-in",scaleOut:"mates-scale-out",springIn:"mates-spring-in",flipInX:"mates-flip-in-x",flipInY:"mates-flip-in-y",blurIn:"mates-blur-in",blurOut:"mates-blur-out",shake:"mates-shake",pulse:"mates-pulse",bounce:"mates-bounce",spin:"mates-spin"};Tn();class On{constructor(){this.state="idle",this.__isZeroPromise__=!0,this.toActive()}isActive(){return"active"===this.state}isResolved(){return"resolved"===this.state}isRejected(){return"rejected"===this.state}isCancelled(){return"cancelled"===this.state}get signal(){return this.controller.signal}toActive(){return"active"===this.state||(this.state="active",this.controller=new AbortController,this.promise=new Promise((t,e)=>{this.resolveFn=t,this.rejectFn=e,this.controller.signal.addEventListener("abort",()=>{"active"===this.state&&(this.state="cancelled",e(new DOMException("Cancelled","AbortError")))})})),this}resolve(t){this.isActive()&&(this.state="resolved",this.resolveFn(t))}reject(t){this.isActive()&&(this.state="rejected",this.rejectFn(t))}cancel(t){this.isActive()&&this.controller.abort(t)}then(t,e){return this.promise.then(t,e)}catch(t){return this.promise.catch(t)}finally(t){return this.promise.finally(t)}get[Symbol.toStringTag](){return"ZeroPromise"}}const zn=(t,e,n)=>{const s="timeout"===n?setTimeout(()=>t(),e):setInterval(()=>t(),e);return je(s,"timeout"===n?()=>clearTimeout(s):()=>clearInterval(s)),s};function In(t){ae("Action");let e=t;const n=new Set;let s=null,i=null;const r=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})},o=Object.assign(function(...t){return((t,n)=>{try{let o;return o=s?s((...n)=>e.call(t,...n),...n):e.call(t,...n),i&&(o=i(o)),r(o),o}catch(t){const e=t instanceof Error?t:new Error(String(t));throw r(void 0),e}})(this,t)},{val:()=>e,set:t=>{e=t},__isAction___:!0,__subscribe:t=>(ae("subscribe"),n.add(t),()=>n.delete(t)),interceptBefore:t=>{s=t},interceptAfter:t=>{i=t}});return o}function Pn(t=300,e="ease"){return{keyframes:[{opacity:0},{opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function Dn(t=300,e="ease"){return{keyframes:[{opacity:1},{opacity:0}],options:{duration:t,easing:e,fill:"both"}}}const Ln={up:"translateY(-100%)",down:"translateY(100%)",left:"translateX(-100%)",right:"translateX(100%)"};function Nn(t="up",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:e?Un(t,e):Ln[t],opacity:0},{transform:"translate(0, 0)",opacity:1}],options:{duration:n,easing:s,fill:"both"}}}function jn(t="down",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"translate(0, 0)",opacity:1},{transform:e?Un(t,e):Ln[t],opacity:0}],options:{duration:n,easing:s,fill:"both"}}}function Un(t,e){switch(t){case"up":return`translateY(-${e})`;case"down":return`translateY(${e})`;case"left":return`translateX(-${e})`;case"right":return`translateX(${e})`}}function Fn(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:`scale(${t})`,opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Vn(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"scale(1)",opacity:1},{transform:`scale(${t})`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Wn(t=1,e=600,n="linear"){return{keyframes:[{transform:"rotate(0deg)"},{transform:`rotate(${360*t}deg)`}],options:{duration:e,easing:n,fill:"both"}}}function Hn(t=600){return{keyframes:[{transform:"translateY(0)",offset:0},{transform:"translateY(-30%)",offset:.3},{transform:"translateY(0)",offset:.5},{transform:"translateY(-15%)",offset:.7},{transform:"translateY(0)",offset:.85},{transform:"translateY(-5%)",offset:.95},{transform:"translateY(0)",offset:1}],options:{duration:t,easing:"ease",fill:"both"}}}function Yn(t=500,e="cubic-bezier(0.34, 1.56, 0.64, 1)"){return{keyframes:[{transform:"scale(0)",opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:t,easing:e,fill:"both"}}}function Bn(t=10,e=400){return{keyframes:[{transform:"translateX(0)"},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:"translateX(0)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}}function qn(t=1.05,e=400){return{keyframes:[{transform:"scale(1)"},{transform:`scale(${t})`},{transform:"scale(1)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}}function Xn(t="y",e=500,n="ease-out"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(90deg)`,opacity:0},{transform:`${s}(0deg)`,opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Zn(t="y",e=500,n="ease-in"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(0deg)`,opacity:1},{transform:`${s}(90deg)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Gn(t=10,e=400,n="ease-out"){return{keyframes:[{filter:`blur(${t}px)`,opacity:0},{filter:"blur(0px)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}}function Kn(t=10,e=400,n="ease-in"){return{keyframes:[{filter:"blur(0px)",opacity:1},{filter:`blur(${t}px)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}}function Jn(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"0",overflow:"hidden"},{width:"auto",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}}function Qn(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"auto",overflow:"hidden"},{width:"0",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}}function ts(t,e,n=50){return{keyframes:t.keyframes,options:{...t.options,delay:(t.options.delay??0)+e*n}}}function es(t){if(null==t||"object"!=typeof t)return t;try{return Object.keys(t).forEach(e=>{"object"!=typeof t[e]||null===t[e]||Object.isFrozen(t[e])||es(t[e])}),Object.freeze(t)}catch(t){console.error(t)}}function ns(t,e,n){const s=se();let i;Qt();try{i=t()}finally{te();ie(s).forEach(t=>{"function"==typeof t.__subscribe&&e(t,n)})}return i}function ss(t,e){if(ae(t),"AsyncFunction"===e.constructor.name)throw new Error(`${t.toLowerCase()}() does not support async functions.`);if(Kt())throw new Error(`${t.toLowerCase()}() cannot be nested inside an effect() or memo().`)}function is(t){const{name:e,fn:n,onRun:s,supportsCleanup:i}=t;ss(e,n);const r=new Set;let o,a=!1;const l=()=>{if(i&&o){try{o()}catch(t){console.error("Error in effect cleanup:",t)}o=void 0}},c=()=>{if(a)return;l();const t=new Set(r);r.clear();const e=()=>{a||Ce.schedule(c)};let h;try{h=ns(n,t=>{r.add(t.__subscribe(e))},e)}finally{t.forEach(t=>t())}if(a)return r.forEach(t=>t()),void r.clear();i&&"function"==typeof h&&(o=h),s(h)},h=()=>{a||(a=!0,l(),r.forEach(t=>t()),r.clear())};return c(),je(n,h),h}let rs=0;function os(t,e){if("function"==typeof t){let e;return is({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):e=os(t,{skipRestrictedContextCheck:!0})}}),e}e?.skipRestrictedContextCheck||ae("Atom");let n=t;const s=++rs,i=new me;function r(){return Pe(r,!1),Zt()&&Jt(r),n}return r.get=function(){return r()},r.set=function(t,e=!1){var o,a;n="function"==typeof t?t(n):t,r.skipDevToolsLog||(o=String(s),a=n,jt.logAtomSet(o,a)),e||i.notify()},r.update=function(t,e=!1){var o;"object"==typeof n&&null!==n&&(t(n),r.skipDevToolsLog||(o=String(s),jt.logAtomUpdate(o)),e||i.notify())},r.__subscribe=function(t){return i.subscribe(t)},r.toJSON=function(){return JSON.stringify(n)},Object.defineProperty(r,"name",{value:"atom",writable:!0,configurable:!0,enumerable:!1}),Object.defineProperty(r,"val",{get:()=>r(),set:t=>r.set(t),enumerable:!1,configurable:!0}),Object.defineProperty(r,"__version__",{get:()=>i.getVersion(),enumerable:!1}),Object.defineProperty(r,"__isAtom___",{value:!0,writable:!1,enumerable:!1}),Object.defineProperty(r,"__id__",{value:s,writable:!1,enumerable:!1}),r}function as(t,e){e?.skipRestrictedContextCheck||ae("iAtom");const n=os(cs(t),{skipRestrictedContextCheck:!0}),s=n.set;n.set=function(t,e=!1){const i="function"==typeof t?t(n.get()):t;s(cs(i),e)};const i=n;return delete i.update,i.name="iAtom",i}function ls(t,e={}){e.skipRestrictedContextCheck||ae("superAtom"),ke();const n=e.freeze??!1,s=n?cs(hs(t)):t;let i=!1,r="default";const o=os(n?cs(t):t,{skipRestrictedContextCheck:!0}),a=o.set;o.set=function(t,e=!1){if(i)return;const s="function"==typeof t?t(o.get()):t;a(n?cs(s):s,e)};const l=o.update;o.update=function(t,e=!1){if(!i){if(n)throw new Error("update() is not supported when freeze is enabled — use set() with a new value.");l(t,e)}};const c=o;return c.lock=function(t="default"){i=!0,r=t},c.unlock=function(t="default"){if(r!==t)throw new Error("Incorrect passcode. Cannot unlock atom.");i=!1},c.reset=function(){i||o.set(n?cs(hs(s)):s)},c.freeze=function(){es(o.get())},c.name="superAtom",c}function cs(t){return"object"==typeof t&&null!==t?es(t):t}function hs(t){try{return structuredClone(t)}catch{return t}}function us(t){const e=new Map,n=[],s=t=>JSON.stringify(t),i=t=>{e.delete(t);const s=n.indexOf(t);s>-1&&n.splice(s,1)};return{getCacheKey:s,removeCacheEntry:i,createCacheMethod:(r,o,a,l)=>async(...c)=>{const h=s(c),u=e.get(h);if(u){const e=Date.now();if(!(void 0!==t?.cacheDuration&&e-u.timestamp>t.cacheDuration)){const t=n.indexOf(h);return t>-1&&n.splice(t,1),n.push(h),r.set(u.result),o.set(null),a.set("success"),u.result}i(h)}const d=await l(this,c);e.set(h,{result:d,timestamp:Date.now()});const f=n.indexOf(h);if(f>-1&&n.splice(f,1),n.push(h),t?.cacheLimit&&n.length>t.cacheLimit){const t=n.shift();t&&e.delete(t)}return d},createClearCacheMethod:()=>(...t)=>{if(0===t.length)e.clear(),n.length=0;else{const e=s(t);i(e)}}}}function ds(t){let e=null,n=null;const s=()=>{e&&(clearInterval(e),e=null,n=null)};return{createStartPollingMethod:i=>(...r)=>{t?.pollInterval?(s(),n=r,i(...r),e=setInterval(()=>{n&&i(...n)},t.pollInterval)):ce(new Error("pollInterval not specified in asyncAction options"))},createStopPollingMethod:()=>s,stopPolling:s}}function fs(t,e){e?.allowInRestrictedContext||ae("Async Action");const n={...{cacheLimit:10,pollInterval:5e3},...e};let s=t;const i=new Set;let r=null,o=null,a=null,l=null;const c=us(n),h=ds(n),u=os(null),d=os(null),f=os(!1),p=os("init"),m=t=>{i.forEach(e=>{if(void 0===e.filter||void 0===t||e.filter===t)try{e.fn()}catch(t){ce(t)}})},_=()=>{o?.isActive()&&(o.cancel(),o=null),r&&(r.abort(),r=null),f.set(!1),p.set("init")},g=async(t,e)=>{_(),f.set(!0),p.set("loading"),r=new AbortController;const n=r;try{let i;if(a){i=a((...e)=>s.call(t,...e),...e)}else i=s.call(t,...e);i?.__isZeroPromise__&&(o=i);let c=await i;if(n.signal.aborted||r!==n)throw new Error("Operation was cancelled");return l&&(c=l(c)),u.set(c),d.set(null),p.set("success"),m(!0),c}catch(t){if(n.signal.aborted||r!==n)throw t;const e=t instanceof Error?t:new Error(String(t));throw u.set(null),d.set(e),p.set("error"),m(!1),e}finally{r===n&&(r=null),f.set(!1),o&&!o.isActive()&&(o=null)}},y=async(...t)=>{const e=this;if(Se()){const n=ve(!1);if(n?._ssrPromiseQueue){const s=g(e,t).catch(()=>{});return n._ssrPromiseQueue.push(s),s}}return g(e,t)},v=c.createCacheMethod(u,d,p,g),w=c.createClearCacheMethod(),b=h.createStartPollingMethod(y),S=h.createStopPollingMethod(),E=Object.assign(y,{data:u,error:d,isLoading:f,status:p,val:()=>s,set:t=>{s=t},params:{page:1},cancel:_,subscribe:(t,e)=>{ae("subscribe");const n={fn:t,filter:e};i.add(n);const s=()=>i.delete(n);return je(t,s),s},cache:v,clearCache:w,startPolling:b,stopPolling:S,interceptBefore:t=>{a=t},interceptAfter:t=>{l=t},__isAsyncAction___:!0,__isAction___:!1});return Object.defineProperty(E,"abortController",{get:()=>r,enumerable:!0,configurable:!0}),je(E,()=>{i.clear(),h.stopPolling(),_()}),E}class ps{constructor(){this.timeoutId=null,this.pendingArgs=null,this.pendingContext=null}clearPending(){this.pendingArgs=null,this.pendingContext=null}setPending(t,e){this.pendingArgs=t,this.pendingContext=e}clearTimer(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}setTimer(t,e){this.timeoutId=((t,e)=>zn(t,e,"timeout"))(t,e)}executePending(t){return this.pendingArgs&&(this.lastResult=t.apply(this.pendingContext,this.pendingArgs),this.clearPending()),this.lastResult}}function ms(t,e){return()=>{t.clearTimer(),t.clearPending(),e?.()}}function _s(t,e){return()=>{if(t.pendingArgs&&t.timeoutId){t.clearTimer();return t.executePending(e)}return t.lastResult}}function gs(t,e){const n=new ps,s=function(...s){return n.setPending(s,this),n.clearTimer(),n.setTimer(()=>{n.lastResult=n.executePending(t),n.timeoutId=null},e),n.lastResult};return s.cancel=ms(n),s.flush=_s(n,t),s}function ys(t,e){const n=!!e?.allowInRestrictedContext,s=fs(t,e),i=os(1,{skipRestrictedContextCheck:n}),r=os(-1,{skipRestrictedContextCheck:n});return Object.assign(s,{page:i,totalPages:r,next:(...t)=>{if(!(-1!==r.val&&i.val>=r.val))return i.update(t=>t+1),s(...t)}})}function vs(t){ae("taskAction");const e=[];let n=0,s=1,i=!1;const r={skipRestrictedContextCheck:!0},o=os([],r),a=os("idle",r),l=os(0,r);function c(){if(o.set([...e]),0===e.length)return void l.set(0);let t=0;for(const n of e)"running"===n.status?t+=.5:"pending"!==n.status&&(t+=1);l.set(Math.round(t/e.length*100))}function h(){if(i){const t=e.some(t=>"running"===t.status);return void(t||a.set("idle"))}if("running"!==a.get())return;const n=e.filter(t=>"running"===t.status).length,r=e.filter(t=>"pending"===t.status);if(0===r.length&&0===n)return void a.set("idle");const o=-1===s?r.length:Math.max(0,s-n);0!==o&&r.slice(0,o).forEach(e=>function(e){const n=new AbortController;e.status="running",e.abortController=n;const s=t(e.input,n.signal);if(s?.__isZeroPromise__){const t=s;e.abortController={signal:t.signal,abort:()=>{t.cancel()}}}c(),Promise.resolve(s).then(t=>{"cancelled"===e.status||(e.status="success",e.result.data=t),e.abortController=null,c(),h()}).catch(t=>{if("cancelled"===e.status||!0===e.abortController?.signal?.aborted)e.status="cancelled",e.abortController=null;else{const n=t instanceof Error?t:new Error(String(t));e.status="failed",e.result.error=n,e.abortController=null,ce(n,"taskAction")}c(),h()})}(e))}function u(t){return{id:++n,input:t,status:"pending",result:{data:null,error:null},abortController:null}}function d(t){const n=Array.isArray(t)?t:[t];for(const t of n)e.push(u(t));c(),"running"!==a.get()||i||h()}function f(t=1){"running"!==a.get()&&(s=t,i=!1,a.set("running"),h())}function p(){i=!0,function(){for(const t of e)"running"===t.status&&(t.status="cancelled",t.abortController?.abort(),t.abortController=null)}(),a.set("idle"),c()}function m(t){p(),e.length=0,n=0,c(),d(t)}const _={add:d,start:f,pause:function(){i||(i=!0)},stop:p,delete:function(t){const n=Array.isArray(t)?t:[t],s=new Set(n.map(t=>t.id));for(let t=e.length-1;t>=0;t--){const n=e[t];s.has(n.id)&&("running"===n.status&&(n.status="cancelled",n.abortController?.abort(),n.abortController=null),e.splice(t,1))}c(),"running"!==a.get()||i||h()},clearAndAdd:m,addAndStart:function(t,e=1){d(t),f(e)},clearAndStart:function(t,e=1){m(t),f(e)},isRunning:function(){return"running"===a.val},progress:l,tasks:o,pendingTasks:function(){return o.val.filter(t=>"pending"===t.status)},runningTasks:function(){return o.val.filter(t=>"running"===t.status)},successTasks:function(){return o.val.filter(t=>"success"===t.status)},failedTasks:function(){return o.val.filter(t=>"failed"===t.status)},cancelledTasks:function(){return o.val.filter(t=>"cancelled"===t.status)},__isTaskAction__:!0};return je(_,p),_}function ws(t,e){const n=new ps;let s=0;const i=function(...i){const r=Date.now(),o=r-s;return o>=e?(s=r,n.lastResult=t.apply(this,i),n.clearPending(),n.clearTimer()):(n.setPending(i,this),n.timeoutId||n.setTimer(()=>{s=Date.now(),n.lastResult=n.executePending(t),n.timeoutId=null},e-o)),n.lastResult};return i.cancel=ms(n,()=>{s=0}),i.flush=_s(n,t),i}function bs(t,e){return"function"!=typeof t.animate?Promise.resolve():("function"==typeof t.getAnimations&&t.getAnimations().forEach(t=>t.cancel()),new Promise(n=>{const s=t.animate(e.keyframes,{duration:300,easing:"ease",fill:"both",...e.options});s.onfinish=()=>n(),s.oncancel=()=>n()}))}async function Ss(t){const{el:e,exit:n,enter:s,swap:i,getEl:r,isStale:o}=t;if(!e)return void i();if(await bs(e,n),o?.())return;if(i(),await("function"!=typeof requestAnimationFrame?Promise.resolve():new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(()=>t())))),o?.())return;const a=r?.()??e;a&&await bs(a,s)}function Es(t){return t.__isEffect__=!0,is({name:"Effect",fn:t,onRun:()=>{},supportsCleanup:!0})}const As=new WeakMap,Cs=B(class extends ft{render(t){return A}update(t,[e]){const n=e!==this.Y;return n&&void 0!==this.Y&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),A}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.Y){const e=this.ht??globalThis;let n=As.get(e);void 0===n&&(n=new WeakMap,As.set(e,n)),void 0!==n.get(this.Y)&&this.Y.call(this.ht,void 0),n.set(this.Y,t),void 0!==t&&this.Y.call(this.ht,t)}else this.Y.value=t}get lt(){return"function"==typeof this.Y?As.get(this.ht??globalThis)?.get(this.Y):this.Y?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});function Ms(){const t=new _e;let e;const n={get value(){return e},__subscribe:e=>t.subscribe(e),__isMatesRef__:!0,__set:n=>{e!==n&&(e=n,t.trigger(n))}};return n}function ks(t){if(t&&t.__isMatesRef__){const e=t;return Cs(t=>{e.__set(t)})}return Cs(t)}const xs=(t,e={})=>b`<x-view .view=${t} .props=${e}></x-view>`,$s=xs,Ts=(t,e,n={})=>U(xs(t,n),e),Rs=os(!1),Os=()=>Rs.set(!0),zs=()=>Rs.set(!1),Is=ls("undefined"!=typeof window?window.location.pathname:"/");Es(()=>{Rs()?Is.lock():Is.unlock()}),"undefined"!=typeof window&&(window.addEventListener("popstate",()=>{const t=window.location.pathname;t!==Is.get()&&Is.set(t)}),window.addEventListener("hashchange",()=>{const t=window.location.pathname;t!==Is.get()&&Is.set(t)}),window.addEventListener("navigate",()=>{const t=window.location.pathname;t!==Is.get()&&Is.set(t)}));const Ps=t=>{const e=Is.get();if(e===t)return!0;const n=t.split("/").filter(Boolean),s=e.split("/").filter(Boolean);if(n.length!==s.length)return!1;for(let t=0;t<n.length;t++){const e=n[t],i=s[t];if(e.startsWith(":")){if(!i)return!1}else if(e!==i)return!1}return!0},Ds=t=>{const e=Ms(),n=()=>t().options,s=t().options.notFound?{path:"*",component:t().options.notFound}:null,i=()=>{const{routes:e}=t();return e.find(t=>Ps(t.path))??s},r=i(),o=os(r),a=os(r);return Es(()=>{const t=a();if(t===o.get())return;const s=e.value;if(!s)return void o.set(t);const i=n(),r=o.get();Ss({el:s,exit:r?.exit??i.exit??Dn(200),enter:t?.enter??i.enter??Pn(250),swap:()=>o.set(t),getEl:()=>e.value,isStale:()=>a.get()!==t})}),Es(()=>{Is(),function(t){a.get()!==t&&a.set(t)}(i())}),$e(()=>{const t=e.value;if(!t)return;const s=o.get(),i=n();bs(t,s?.enter??i.enter??Pn(250))}),()=>{const t=o();return b`
|
|
27
99
|
<div style="position:relative;overflow:hidden">
|
|
28
|
-
<div ${
|
|
29
|
-
${
|
|
100
|
+
<div ${ks(e)}>
|
|
101
|
+
${t?xs(t.component,t.props??{}):A}
|
|
30
102
|
</div>
|
|
31
103
|
</div>
|
|
32
|
-
`}};function Re(...t){const[e,n]=t;return e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,e)=>{if(!n||!(e in n))throw new Error(`Missing parameter: "${e}"`);return String(n[e])})}const Pe=()=>{if("undefined"==typeof window)return{};const t=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,e=new URLSearchParams(t),n={};for(const[t,s]of e)try{n[t]=JSON.parse(s)}catch{n[t]=s}return n},Te=oe(Pe());let ze=!1;be(()=>{const t=Te();ze||Me()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+window.location.search+(n?`#${n}`:"");window.history.replaceState(null,"",s)})(t)});const Ie=()=>{Me()||(ze=!0,Te.set(Pe()),ze=!1)};"undefined"!=typeof window&&window.addEventListener("hashchange",Ie);const De=()=>{if("undefined"==typeof window)return{};const t=new URLSearchParams(window.location.search),e={};for(const[n,s]of t)try{e[n]=JSON.parse(s)}catch{e[n]=s}return e},Le=oe(De());let je=!1;be(()=>{const t=Le();je||Me()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)})(t)});const Ne=()=>{Me()||(je=!0,Le.set(De()),je=!1)};"undefined"!=typeof window&&window.addEventListener("popstate",Ne);const $e={get path(){return ke.get()},get hash(){return Te()},get qsObj(){return Le()}};let Ue=null,Fe=null;function Ve(){return Ue}function We(){return Fe}const Ye={100:"CONTINUE",101:"SWITCHING_PROTOCOLS",102:"PROCESSING",103:"EARLY_HINTS",200:"OK",201:"CREATED",202:"ACCEPTED",203:"NON_AUTHORITATIVE_INFORMATION",204:"NO_CONTENT",205:"RESET_CONTENT",206:"PARTIAL_CONTENT",207:"MULTI_STATUS",208:"ALREADY_REPORTED",226:"IM_USED",300:"MULTIPLE_CHOICES",301:"MOVED_PERMANENTLY",302:"FOUND",303:"SEE_OTHER",304:"NOT_MODIFIED",305:"USE_PROXY",307:"TEMPORARY_REDIRECT",308:"PERMANENT_REDIRECT",400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENTICATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY",426:"UPGRADE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS",500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"};function He(t){return"string"==typeof t?{url:t}:t}function qe(t){const{url:e="",host:n="",path:s,params:i={}}=t,r=e||s||"",o=/^https?:\/\//i.test(r)?r:`${n}${r}`,{pathParams:a,qsParams:l}=function(t,e){const n=new Set;for(const[,e]of t.matchAll(/:([a-zA-Z_][a-zA-Z0-9_]*)/g))n.add(e);const s={},i={};for(const[t,r]of Object.entries(e))n.has(t)?s[t]=r:i[t]=r;return{pathParams:s,qsParams:i}}(o,i),c=Object.keys(a).length>0?Re(o,a):o;if(0===Object.keys(l).length)return c;let h,u;if(/^https?:\/\//i.test(c)){const t=new URL(c);h=t.origin+t.pathname,u=t.search}else{const t=c.indexOf("?");h=-1===t?c:c.slice(0,t),u=-1===t?"":c.slice(t)}const d=new URLSearchParams(u);for(const[t,e]of Object.entries(l))null!=e&&(Array.isArray(e)?e.forEach(e=>d.append(t,String(e))):d.set(t,String(e)));const f=d.toString();return f?`${h}?${f}`:h}function Be(t,e){return t.add(e),()=>t.delete(e)}const Ge=new Set,Xe=new Set,Ze=new Set;class Je{constructor(t={}){this.instanceBeforeFns=[],this.instanceAfterFns=[],this.instanceErrorFns=[],this.baseRequest=t}interceptBefore(t){return this.instanceBeforeFns.push(t),()=>{const e=this.instanceBeforeFns.indexOf(t);-1!==e&&this.instanceBeforeFns.splice(e,1)}}interceptAfter(t){return this.instanceAfterFns.push(t),()=>{const e=this.instanceAfterFns.indexOf(t);-1!==e&&this.instanceAfterFns.splice(e,1)}}interceptError(t){return this.instanceErrorFns.push(t),()=>{const e=this.instanceErrorFns.indexOf(t);-1!==e&&this.instanceErrorFns.splice(e,1)}}clearInterceptors(){this.instanceBeforeFns.length=0,this.instanceAfterFns.length=0,this.instanceErrorFns.length=0}fetch(t){const e=new Xt,n={...this.baseRequest,...t,headers:{...this.baseRequest.headers,...t.headers},params:{...this.baseRequest.params,...t.params}},{body:s,url:i,host:r,params:o,path:a,...l}=n,c=qe(n),h=function(t){return null==t?{}:"string"==typeof t||t instanceof FormData||t instanceof Blob||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof URLSearchParams||t instanceof ReadableStream?{body:t}:{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}}(s),u=(n.method??"GET").toUpperCase(),d=Ve(),f=We();if(Q()&&d){let t;try{t=c.startsWith("http")?new URL(c).pathname:c.split("?")[0]}catch{t=c.split("?")[0]}if(t.startsWith("/api")){const n=d(u,t);if(n){const t={"content-type":"application/json",...l.headers,...h.headers};if(f){const e=f.headers.get("cookie"),n=f.headers.get("authorization");e&&(t.cookie=e),n&&(t.authorization=n)}const s=new Request(c.startsWith("http")?c:`http://localhost${c}`,{method:u,headers:t,body:h.body??null});return n.handler(s,n.ctx).then(async t=>{if(!t.ok){const n=Ye[t.status]||"UNKNOWN_ERROR";return void e.reject(new Error(`${n}: ${t.statusText}`))}const n=t.headers.get("content-type");n?.includes("application/json")?e.resolve(await t.json()):e.resolve(t)}).catch(t=>e.reject(t)),e}}}let p=c,m={...l,method:u,...h,headers:{...l.headers,...h.headers}};0===Object.keys(m.headers).length&&delete m.headers;for(const t of this.instanceBeforeFns){const e=t(p,m);p=e.url,m=e.options}for(const t of Ge){const e=t(p,m);p=e.url,m=e.options}return fetch(p,{...m,signal:e.signal}).then(async t=>{let n=t;for(const t of this.instanceAfterFns)n=t(n);for(const t of Xe)n=t(n);if(!n.ok){const t=Ye[n.status]||"UNKNOWN_ERROR",s=new Error(`${t}: ${n.statusText}`);for(const t of this.instanceErrorFns)try{t(s)}catch(t){}for(const t of Ze)try{t(s)}catch(t){}return void e.reject(s)}const s=n.headers.get("content-type");if(s?.includes("application/json")){const t=await n.json();e.resolve(t)}else e.resolve(n)}).catch(t=>{for(const e of this.instanceErrorFns)try{e(t)}catch(t){}for(const e of Ze)try{e(t)}catch(t){}e.reject(t)}),e}Fetch(t){return this.fetch(t)}Get(t){return this.fetch({...t,method:"GET"})}Post(t){return this.fetch({...t,method:"POST"})}Put(t){return this.fetch({...t,method:"PUT"})}Patch(t){return this.fetch({...t,method:"PATCH"})}Delete(t){return this.fetch({...t,method:"DELETE"})}fetchAction(t){const{baseRequest:e,options:n}=function(t){if(!t)return{baseRequest:{},options:{}};const{cacheDuration:e,cacheLimit:n,pollInterval:s,allowInRestrictedContext:i,...r}=t;return{baseRequest:r,options:{...void 0!==e&&{cacheDuration:e},...void 0!==n&&{cacheLimit:n},...void 0!==s&&{pollInterval:s},...void 0!==i&&{allowInRestrictedContext:i}}}}(t);return fe(t=>this.fetch({...e,params:{...e.params,...t}}),n)}getAction(t){return this.fetchAction({...t,method:"GET"})}postAction(t){return this.fetchAction({...t,method:"POST"})}putAction(t){return this.fetchAction({...t,method:"PUT"})}patchAction(t){return this.fetchAction({...t,method:"PATCH"})}deleteAction(t){return this.fetchAction({...t,method:"DELETE"})}}const Qe=new Je,Ke="mates-theme";function tn(t){return t.startsWith("--")?t:`--${t}`}function en(t,e){let n="";for(const t in e){n+=` ${tn(t)}: ${e[t]};\n`}return n?`${t} {\n${n}}`:""}function nn(t){if(null==t)return{action:"remove"};if("boolean"==typeof t)return t?{action:"set",value:""}:{action:"remove"};if("string"==typeof t)return{action:"set",value:t};if("number"==typeof t)return{action:"set",value:String(t)};if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?"boolean"==typeof n?n?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(n)}:{action:"remove"}}if(3===t.length){const[e,n,s]=t,i=e?n:s;return"boolean"==typeof i?i?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(i)}}}return{action:"remove"}}function sn(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function rn(t){if(null==t||!1===t)return null;if("string"==typeof t)return t;if("number"==typeof t)return String(t);if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?String(n):null}if(3===t.length){const[e,n,s]=t;return String(e?n:s)}}return null}const on=new WeakMap,an=new WeakMap,ln=new WeakMap,cn=new WeakMap;class hn{constructor(t){this.el=t}attr(t){const e=this.el;on.has(e)||on.set(e,new Map);const n=on.get(e),s=new Map;for(const[i,r]of Object.entries(t)){const t=nn(r);"set"===t.action?(n.get(i)!==t.value&&e.setAttribute(i,t.value),s.set(i,t.value)):n.has(i)&&e.removeAttribute(i)}for(const t of n.keys())s.has(t)||e.removeAttribute(t);return on.set(e,s),this}updateAttr(t){const e=this.el;on.has(e)||on.set(e,new Map);const n=on.get(e),s=Object.fromEntries(n);t(s);const i=new Map;for(const[t,r]of Object.entries(s))n.get(t)!==r&&e.setAttribute(t,r),i.set(t,r);for(const t of n.keys())i.has(t)||e.removeAttribute(t);return on.set(e,i),this}style(t){const e=this.el;an.has(e)||an.set(e,new Map);const n=an.get(e),s=new Map;for(const[i,r]of Object.entries(t)){const t=rn(r),o=sn(i);null!==t?(n.get(o)!==t&&e.style.setProperty(o,t),s.set(o,t)):n.has(o)&&e.style.removeProperty(o)}for(const t of n.keys())s.has(t)||e.style.removeProperty(t);return an.set(e,s),this}classes(t){const e=this.el;ln.has(e)||ln.set(e,new Set);const n=ln.get(e),s=function(t){const e=new Set,n=t=>{for(const n of t.split(/\s+/))n&&e.add(n)};if("string"==typeof t)return n(t),e;if(Array.isArray(t)){for(const e of t)if(e||0===e)if("string"!=typeof e){if(Array.isArray(e))if(2===e.length){const[t,s]=e;t&&s&&n(s)}else if(3===e.length){const[t,s,i]=e;n(t?s:i)}}else n(e);return e}if("object"==typeof t&&null!==t)for(const[e,s]of Object.entries(t))s&&n(e);return e}(t);for(const t of s)n.has(t)||e.classList.add(t);for(const t of n)s.has(t)||e.classList.remove(t);return ln.set(e,s),this}addClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.add(n);return this}removeClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.remove(n);return this}toggleClass(t,e){const n=this.el;for(const s of t.split(/\s+/))s&&n.classList.toggle(s,e);return this}html(e){if(null==e)throw new Error("$(el).html() — the factory function must return a lit-html TemplateResult (e.g. () => html`<span>${value}</span>`).");return t.render(e,this.el),this}text(t){return this.el.textContent=String(t),this}focus(t){return this.el.focus(t),this}blur(){return this.el.blur(),this}scroll(t){const e=this.el;return"string"==typeof t?e.scrollTo({top:0,behavior:t}):t?e.scrollTo(t):e.scrollTo({top:0}),this}scrollIntoView(t){return this.el.scrollIntoView(t),this}measure(t){const e=this.el.getBoundingClientRect();return t({width:e.width,height:e.height,top:e.top,left:e.left,right:e.right,bottom:e.bottom,x:e.x,y:e.y}),this}on(t,e,n){const s=this.el;cn.has(s)||cn.set(s,new Map);const i=cn.get(s),r=i.get(t);r&&s.removeEventListener(t,r.handler,r.options);const o=e;return s.addEventListener(t,o,n),i.set(t,{handler:o,options:n}),this}off(t,e){const n=this.el,s=cn.get(n);if(!s)return this;if(e){const i=s.get(t);i&&i.handler===e&&(n.removeEventListener(t,i.handler,i.options),s.delete(t))}else{const e=s.get(t);e&&(n.removeEventListener(t,e.handler,e.options),s.delete(t))}return this}once(t,e,n){const s="object"==typeof n?{...n,once:!0}:{once:!0};return this.el.addEventListener(t,e,s),this}delegate(t,e,n,s){const i=t=>{const s=t.target?.closest(e);s&&this.el.contains(s)&&n(t,s)};return this.el.addEventListener(t,i,s),cn.has(this.el)||cn.set(this.el,new Map),cn.get(this.el).set(`${t}:delegate:${e}`,{handler:i,options:s}),this}aria(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("aria-")?n:`aria-${n}`;null==s||!1===s?e.removeAttribute(t):e.setAttribute(t,String(s))}return this}getAttr(t){return this.el.getAttribute(t)}data(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("data-")?n.slice(5):n,i=n.startsWith("data-")?n:`data-${n}`;null==s?e.removeAttribute(i):e.setAttribute(i,String(s));const r=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase());null==s?delete e.dataset[r]:e.dataset[r]=String(s)}return this}}function un(t){if(null!==t&&"object"==typeof t&&!0===t.__isMatesRef__){const e=t;if(void 0===e.value)throw new Error("$(ref): the ref has no element attached yet (ref.value is undefined).\nDOM manipulation via $() must happen after the element has mounted.\nUse one of the lifecycle hooks where the element is guaranteed to exist:\n • onMount() — runs once after the component's first render\n • onPaint() — runs after the browser has painted\n • onUpdate() — runs after every subsequent re-render\n\nExample:\n const inputRef = ref<HTMLInputElement>();\n onMount(() => { $(inputRef).focus(); });");return new hn(e.value)}return new hn(t)}const dn=e=>{const n=Se(),s=e().condition,i=oe(s),r=oe(s);return be(()=>{const t=r();if(t===i.get())return;const s=n.value;if(!s)return void i.set(t);const o=e().config;we({el:s,exit:o?.exit??Qt(200),enter:o?.enter??Jt(250),swap:()=>i.set(t),getEl:()=>n.value,isStale:()=>r.get()!==t})}),rt(()=>{const t=n.value;if(!t)return;const s=e().config;ve(t,s?.enter??Jt(250))}),()=>{const s=i(),{condition:o,trueTpl:a,falseTpl:l}=e();return r.get()!==o&&r.set(o),t.html`
|
|
33
|
-
<div ${
|
|
34
|
-
${
|
|
104
|
+
`}};function Ls(t,e={}){return xs(Ds,{routes:t,options:e})}function Ns(...t){const[e,n]=t;return e.replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g,(t,e)=>{if(!n||!(e in n))throw new Error(`Missing parameter: "${e}"`);return String(n[e])})}const js=()=>{if("undefined"==typeof window)return{};const t=window.location.hash.startsWith("#")?window.location.hash.slice(1):window.location.hash,e=new URLSearchParams(t),n={};for(const[t,s]of e)try{n[t]=JSON.parse(s)}catch{n[t]=s}return n},Us=os(js());let Fs=!1;Es(()=>{const t=Us();Fs||Rs()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+window.location.search+(n?`#${n}`:"");window.history.replaceState(null,"",s)})(t)});const Vs=()=>{Rs()||(Fs=!0,Us.set(js()),Fs=!1)};"undefined"!=typeof window&&window.addEventListener("hashchange",Vs);const Ws=()=>{if("undefined"==typeof window)return{};const t=new URLSearchParams(window.location.search),e={};for(const[n,s]of t)try{e[n]=JSON.parse(s)}catch{e[n]=s}return e},Hs=os(Ws());let Ys=!1;Es(()=>{const t=Hs();Ys||Rs()||(t=>{if("undefined"==typeof window)return;const e=new URLSearchParams;for(const n in t){const s=t[n];null!=s&&e.set(n,"object"==typeof s?JSON.stringify(s):String(s))}const n=e.toString(),s=window.location.pathname+(n?`?${n}`:"")+window.location.hash;window.history.replaceState(null,"",s)})(t)});const Bs=()=>{Rs()||(Ys=!0,Hs.set(Ws()),Ys=!1)};"undefined"!=typeof window&&window.addEventListener("popstate",Bs);const qs={get path(){return Is.get()},get hash(){return Us()},get qsObj(){return Hs()}};function Xs(t,e,n){Rs()||(e?window.history.replaceState(n,"",t):window.history.pushState(n,"",t),Is.set(t))}const Zs=(t,{view:e})=>Ps(t)?e?$s(e,{}):A:null,Gs=(t,e)=>{const n=t.find(t=>Ps(t.path));if(void 0===n)return e?()=>xs(e):()=>A;const{component:s}=n;return We(s),()=>xs(s)};let Ks=null,Js=null;function Qs(t){Ks=t}function ti(t){Js=t}function ei(){return Ks}function ni(){return Js}const si={100:"CONTINUE",101:"SWITCHING_PROTOCOLS",102:"PROCESSING",103:"EARLY_HINTS",200:"OK",201:"CREATED",202:"ACCEPTED",203:"NON_AUTHORITATIVE_INFORMATION",204:"NO_CONTENT",205:"RESET_CONTENT",206:"PARTIAL_CONTENT",207:"MULTI_STATUS",208:"ALREADY_REPORTED",226:"IM_USED",300:"MULTIPLE_CHOICES",301:"MOVED_PERMANENTLY",302:"FOUND",303:"SEE_OTHER",304:"NOT_MODIFIED",305:"USE_PROXY",307:"TEMPORARY_REDIRECT",308:"PERMANENT_REDIRECT",400:"BAD_REQUEST",401:"UNAUTHORIZED",402:"PAYMENT_REQUIRED",403:"FORBIDDEN",404:"NOT_FOUND",405:"METHOD_NOT_ALLOWED",406:"NOT_ACCEPTABLE",407:"PROXY_AUTHENTICATION_REQUIRED",408:"REQUEST_TIMEOUT",409:"CONFLICT",410:"GONE",411:"LENGTH_REQUIRED",412:"PRECONDITION_FAILED",413:"PAYLOAD_TOO_LARGE",414:"URI_TOO_LONG",415:"UNSUPPORTED_MEDIA_TYPE",416:"RANGE_NOT_SATISFIABLE",417:"EXPECTATION_FAILED",418:"IM_A_TEAPOT",421:"MISDIRECTED_REQUEST",422:"UNPROCESSABLE_ENTITY",423:"LOCKED",424:"FAILED_DEPENDENCY",425:"TOO_EARLY",426:"UPGRADE_REQUIRED",428:"PRECONDITION_REQUIRED",429:"TOO_MANY_REQUESTS",431:"REQUEST_HEADER_FIELDS_TOO_LARGE",451:"UNAVAILABLE_FOR_LEGAL_REASONS",500:"INTERNAL_SERVER_ERROR",501:"NOT_IMPLEMENTED",502:"BAD_GATEWAY",503:"SERVICE_UNAVAILABLE",504:"GATEWAY_TIMEOUT",505:"HTTP_VERSION_NOT_SUPPORTED",506:"VARIANT_ALSO_NEGOTIATES",507:"INSUFFICIENT_STORAGE",508:"LOOP_DETECTED",510:"NOT_EXTENDED",511:"NETWORK_AUTHENTICATION_REQUIRED"};function ii(t){return t>=200&&t<300}function ri(t){return"string"==typeof t?{url:t}:t}function oi(t){const{url:e="",host:n="",path:s,params:i={}}=t,r=e||s||"",o=/^https?:\/\//i.test(r)?r:`${n}${r}`,{pathParams:a,qsParams:l}=function(t,e){const n=new Set;for(const[,e]of t.matchAll(/:([a-zA-Z_][a-zA-Z0-9_]*)/g))n.add(e);const s={},i={};for(const[t,r]of Object.entries(e))n.has(t)?s[t]=r:i[t]=r;return{pathParams:s,qsParams:i}}(o,i),c=Object.keys(a).length>0?Ns(o,a):o;if(0===Object.keys(l).length)return c;let h,u;if(/^https?:\/\//i.test(c)){const t=new URL(c);h=t.origin+t.pathname,u=t.search}else{const t=c.indexOf("?");h=-1===t?c:c.slice(0,t),u=-1===t?"":c.slice(t)}const d=new URLSearchParams(u);for(const[t,e]of Object.entries(l))null!=e&&(Array.isArray(e)?e.forEach(e=>d.append(t,String(e))):d.set(t,String(e)));const f=d.toString();return f?`${h}?${f}`:h}function ai(t,e){return t.add(e),()=>t.delete(e)}const li=new Set,ci=new Set,hi=new Set,ui=t=>ai(li,t),di=t=>ai(ci,t),fi=t=>ai(hi,t),pi=()=>{li.clear(),ci.clear(),hi.clear()};class mi{constructor(t={}){this.instanceBeforeFns=[],this.instanceAfterFns=[],this.instanceErrorFns=[],this.baseRequest=t}interceptBefore(t){return this.instanceBeforeFns.push(t),()=>{const e=this.instanceBeforeFns.indexOf(t);-1!==e&&this.instanceBeforeFns.splice(e,1)}}interceptAfter(t){return this.instanceAfterFns.push(t),()=>{const e=this.instanceAfterFns.indexOf(t);-1!==e&&this.instanceAfterFns.splice(e,1)}}interceptError(t){return this.instanceErrorFns.push(t),()=>{const e=this.instanceErrorFns.indexOf(t);-1!==e&&this.instanceErrorFns.splice(e,1)}}clearInterceptors(){this.instanceBeforeFns.length=0,this.instanceAfterFns.length=0,this.instanceErrorFns.length=0}fetch(t){const e=new On,n={...this.baseRequest,...t,headers:{...this.baseRequest.headers,...t.headers},params:{...this.baseRequest.params,...t.params}},{body:s,url:i,host:r,params:o,path:a,...l}=n,c=oi(n),h=function(t){return null==t?{}:"string"==typeof t||t instanceof FormData||t instanceof Blob||t instanceof ArrayBuffer||ArrayBuffer.isView(t)||t instanceof URLSearchParams||t instanceof ReadableStream?{body:t}:{body:JSON.stringify(t),headers:{"Content-Type":"application/json"}}}(s),u=(n.method??"GET").toUpperCase(),d=ei(),f=ni();if(Se()&&d){let t;try{t=c.startsWith("http")?new URL(c).pathname:c.split("?")[0]}catch{t=c.split("?")[0]}if(t.startsWith("/api")){const n=d(u,t);if(n){const t={"content-type":"application/json",...l.headers,...h.headers};if(f){const e=f.headers.get("cookie"),n=f.headers.get("authorization");e&&(t.cookie=e),n&&(t.authorization=n)}const s=new Request(c.startsWith("http")?c:`http://localhost${c}`,{method:u,headers:t,body:h.body??null});return n.handler(s,n.ctx).then(async t=>{if(!t.ok){const n=si[t.status]||"UNKNOWN_ERROR";return void e.reject(new Error(`${n}: ${t.statusText}`))}const n=t.headers.get("content-type");n?.includes("application/json")?e.resolve(await t.json()):e.resolve(t)}).catch(t=>e.reject(t)),e}}}let p=c,m={...l,method:u,...h,headers:{...l.headers,...h.headers}};0===Object.keys(m.headers).length&&delete m.headers;for(const t of this.instanceBeforeFns){const e=t(p,m);p=e.url,m=e.options}for(const t of li){const e=t(p,m);p=e.url,m=e.options}return fetch(p,{...m,signal:e.signal}).then(async t=>{let n=t;for(const t of this.instanceAfterFns)n=t(n);for(const t of ci)n=t(n);if(!n.ok){const t=si[n.status]||"UNKNOWN_ERROR",s=new Error(`${t}: ${n.statusText}`);for(const t of this.instanceErrorFns)try{t(s)}catch(t){}for(const t of hi)try{t(s)}catch(t){}return void e.reject(s)}const s=n.headers.get("content-type");if(s?.includes("application/json")){const t=await n.json();e.resolve(t)}else e.resolve(n)}).catch(t=>{for(const e of this.instanceErrorFns)try{e(t)}catch(t){}for(const e of hi)try{e(t)}catch(t){}e.reject(t)}),e}Fetch(t){return this.fetch(t)}Get(t){return this.fetch({...t,method:"GET"})}Post(t){return this.fetch({...t,method:"POST"})}Put(t){return this.fetch({...t,method:"PUT"})}Patch(t){return this.fetch({...t,method:"PATCH"})}Delete(t){return this.fetch({...t,method:"DELETE"})}fetchAction(t){const{baseRequest:e,options:n}=function(t){if(!t)return{baseRequest:{},options:{}};const{cacheDuration:e,cacheLimit:n,pollInterval:s,allowInRestrictedContext:i,...r}=t;return{baseRequest:r,options:{...void 0!==e&&{cacheDuration:e},...void 0!==n&&{cacheLimit:n},...void 0!==s&&{pollInterval:s},...void 0!==i&&{allowInRestrictedContext:i}}}}(t);return fs(t=>this.fetch({...e,params:{...e.params,...t}}),n)}getAction(t){return this.fetchAction({...t,method:"GET"})}postAction(t){return this.fetchAction({...t,method:"POST"})}putAction(t){return this.fetchAction({...t,method:"PUT"})}patchAction(t){return this.fetchAction({...t,method:"PATCH"})}deleteAction(t){return this.fetchAction({...t,method:"DELETE"})}}const _i=new mi,gi=t=>_i.fetch(ri(t)),yi=t=>_i.Get(ri(t)),vi=t=>_i.Post(ri(t)),wi=t=>_i.Put(ri(t)),bi=t=>_i.Patch(ri(t)),Si=t=>_i.Delete(ri(t)),Ei=t=>_i.fetchAction(t),Ai=t=>_i.getAction(t),Ci=t=>_i.postAction(t),Mi=t=>_i.putAction(t),ki=t=>_i.patchAction(t),xi=t=>_i.deleteAction(t),$i="mates-theme";function Ti(t){return t.startsWith("--")?t:`--${t}`}function Ri(t,e){let n="";for(const t in e){n+=` ${Ti(t)}: ${e[t]};\n`}return n?`${t} {\n${n}}`:""}function Oi(t){const e=Object.keys(t);if(0===e.length)throw new Error("[globalTheme] themes object must have at least one entry.");const n=e[0],s=e[1],i=t[n],r=[];r.push(Ri(":root",i));for(const n of e)r.push(Ri(`[data-theme="${n}"]`,t[n]));void 0!==s&&r.push(function(t){let e="";for(const n in t)e+=` ${Ti(n)}: ${t[n]};\n`;return e?`@media (prefers-color-scheme: dark) {\n :root:not([data-theme]) {\n${e} }\n}`:""}(t[s])),Cn();const o=An(),a=r.filter(Boolean).join("\n");a&&o.appendRules(a);const l=Object.create(null);for(const t in i)l[t]=Ti(t);const c=Object.freeze(l),h=function(){try{return localStorage.getItem($i)}catch{return null}}(),u=new Set(["auto",...e]),d=os(null!==h&&u.has(h)?h:"auto",{skipRestrictedContextCheck:!0});return Object.defineProperty(d,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Es(()=>{const t=d();!function(t){"undefined"!=typeof document&&("auto"===t?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",t))}(t),function(t){try{"auto"===t?localStorage.removeItem($i):localStorage.setItem($i,t)}catch{}}(t)}),{cssVars:c,themeAtom:d}}function zi(t){Cn();const e=An(),n=Ri(":root",t);n&&e.appendRules(n)}function Ii(t){if(null==t)return{action:"remove"};if("boolean"==typeof t)return t?{action:"set",value:""}:{action:"remove"};if("string"==typeof t)return{action:"set",value:t};if("number"==typeof t)return{action:"set",value:String(t)};if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?"boolean"==typeof n?n?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(n)}:{action:"remove"}}if(3===t.length){const[e,n,s]=t,i=e?n:s;return"boolean"==typeof i?i?{action:"set",value:""}:{action:"remove"}:{action:"set",value:String(i)}}}return{action:"remove"}}function Pi(t){return t.startsWith("--")?t:t.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Di(t){if(null==t||!1===t)return null;if("string"==typeof t)return t;if("number"==typeof t)return String(t);if(Array.isArray(t)){if(2===t.length){const[e,n]=t;return e?String(n):null}if(3===t.length){const[e,n,s]=t;return String(e?n:s)}}return null}const Li=new WeakMap,Ni=new WeakMap,ji=new WeakMap,Ui=new WeakMap;class Fi{constructor(t){this.el=t}attr(t){const e=this.el;Li.has(e)||Li.set(e,new Map);const n=Li.get(e),s=new Map;for(const[i,r]of Object.entries(t)){const t=Ii(r);"set"===t.action?(n.get(i)!==t.value&&e.setAttribute(i,t.value),s.set(i,t.value)):n.has(i)&&e.removeAttribute(i)}for(const t of n.keys())s.has(t)||e.removeAttribute(t);return Li.set(e,s),this}updateAttr(t){const e=this.el;Li.has(e)||Li.set(e,new Map);const n=Li.get(e),s=Object.fromEntries(n);t(s);const i=new Map;for(const[t,r]of Object.entries(s))n.get(t)!==r&&e.setAttribute(t,r),i.set(t,r);for(const t of n.keys())i.has(t)||e.removeAttribute(t);return Li.set(e,i),this}style(t){const e=this.el;Ni.has(e)||Ni.set(e,new Map);const n=Ni.get(e),s=new Map;for(const[i,r]of Object.entries(t)){const t=Di(r),o=Pi(i);null!==t?(n.get(o)!==t&&e.style.setProperty(o,t),s.set(o,t)):n.has(o)&&e.style.removeProperty(o)}for(const t of n.keys())s.has(t)||e.style.removeProperty(t);return Ni.set(e,s),this}classes(t){const e=this.el;ji.has(e)||ji.set(e,new Set);const n=ji.get(e),s=function(t){const e=new Set,n=t=>{for(const n of t.split(/\s+/))n&&e.add(n)};if("string"==typeof t)return n(t),e;if(Array.isArray(t)){for(const e of t)if(e||0===e)if("string"!=typeof e){if(Array.isArray(e))if(2===e.length){const[t,s]=e;t&&s&&n(s)}else if(3===e.length){const[t,s,i]=e;n(t?s:i)}}else n(e);return e}if("object"==typeof t&&null!==t)for(const[e,s]of Object.entries(t))s&&n(e);return e}(t);for(const t of s)n.has(t)||e.classList.add(t);for(const t of n)s.has(t)||e.classList.remove(t);return ji.set(e,s),this}addClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.add(n);return this}removeClass(t){const e=this.el;for(const n of t.split(/\s+/))n&&e.classList.remove(n);return this}toggleClass(t,e){const n=this.el;for(const s of t.split(/\s+/))s&&n.classList.toggle(s,e);return this}html(t){if(null==t)throw new Error("$(el).html() — the factory function must return a lit-html TemplateResult (e.g. () => html`<span>${value}</span>`).");return U(t,this.el),this}text(t){return this.el.textContent=String(t),this}focus(t){return this.el.focus(t),this}blur(){return this.el.blur(),this}scroll(t){const e=this.el;return"string"==typeof t?e.scrollTo({top:0,behavior:t}):t?e.scrollTo(t):e.scrollTo({top:0}),this}scrollIntoView(t){return this.el.scrollIntoView(t),this}measure(t){const e=this.el.getBoundingClientRect();return t({width:e.width,height:e.height,top:e.top,left:e.left,right:e.right,bottom:e.bottom,x:e.x,y:e.y}),this}on(t,e,n){const s=this.el;Ui.has(s)||Ui.set(s,new Map);const i=Ui.get(s),r=i.get(t);r&&s.removeEventListener(t,r.handler,r.options);const o=e;return s.addEventListener(t,o,n),i.set(t,{handler:o,options:n}),this}off(t,e){const n=this.el,s=Ui.get(n);if(!s)return this;if(e){const i=s.get(t);i&&i.handler===e&&(n.removeEventListener(t,i.handler,i.options),s.delete(t))}else{const e=s.get(t);e&&(n.removeEventListener(t,e.handler,e.options),s.delete(t))}return this}once(t,e,n){const s="object"==typeof n?{...n,once:!0}:{once:!0};return this.el.addEventListener(t,e,s),this}delegate(t,e,n,s){const i=t=>{const s=t.target?.closest(e);s&&this.el.contains(s)&&n(t,s)};return this.el.addEventListener(t,i,s),Ui.has(this.el)||Ui.set(this.el,new Map),Ui.get(this.el).set(`${t}:delegate:${e}`,{handler:i,options:s}),this}aria(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("aria-")?n:`aria-${n}`;null==s||!1===s?e.removeAttribute(t):e.setAttribute(t,String(s))}return this}getAttr(t){return this.el.getAttribute(t)}data(t){const e=this.el;for(const[n,s]of Object.entries(t)){const t=n.startsWith("data-")?n.slice(5):n,i=n.startsWith("data-")?n:`data-${n}`;null==s?e.removeAttribute(i):e.setAttribute(i,String(s));const r=t.replace(/-([a-z])/g,(t,e)=>e.toUpperCase());null==s?delete e.dataset[r]:e.dataset[r]=String(s)}return this}}function Vi(t){if(null!==t&&"object"==typeof t&&!0===t.__isMatesRef__){const e=t;if(void 0===e.value)throw new Error("$(ref): the ref has no element attached yet (ref.value is undefined).\nDOM manipulation via $() must happen after the element has mounted.\nUse one of the lifecycle hooks where the element is guaranteed to exist:\n • onMount() — runs once after the component's first render\n • onPaint() — runs after the browser has painted\n • onUpdate() — runs after every subsequent re-render\n\nExample:\n const inputRef = ref<HTMLInputElement>();\n onMount(() => { $(inputRef).focus(); });");return new Fi(e.value)}return new Fi(t)}const Wi=t=>{const e=Ms(),n=t().condition,s=os(n),i=os(n);return Es(()=>{const n=i();if(n===s.get())return;const r=e.value;if(!r)return void s.set(n);const o=t().config;Ss({el:r,exit:o?.exit??Dn(200),enter:o?.enter??Pn(250),swap:()=>s.set(n),getEl:()=>e.value,isStale:()=>i.get()!==n})}),$e(()=>{const n=e.value;if(!n)return;const s=t().config;bs(n,s?.enter??Pn(250))}),()=>{const n=s(),{condition:r,trueTpl:o,falseTpl:a}=t();return i.get()!==r&&i.set(r),b`
|
|
105
|
+
<div ${ks(e)} style="position:relative">
|
|
106
|
+
${n?o:a}
|
|
35
107
|
</div>
|
|
36
|
-
`}};function
|
|
37
|
-
<div style="${
|
|
38
|
-
`)
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<div class="${a}" style="${l}">
|
|
42
|
-
${u}
|
|
108
|
+
`}};function Hi(t,e,n=A,s){return xs(Wi,{condition:t,trueTpl:e,falseTpl:n,config:s})}function Yi(t,e,n){const{show:s,...i}=n;return Hi(s,b`<x-view .view=${t} .props=${e}></x-view>`,A,i)}function Bi(t){const e=re.isHookRunning;re.isHookRunning=!0;try{return t()}finally{re.isHookRunning=e}}function qi(t){var e,n,s,i;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap;const r=B(class extends ft{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,null),i.set(this,!1),t.type!==Y)throw new Error("eleHook() must be used as an element expression, e.g. html`<div ${myHook()}>`")}update(i,r){if(!he(this,n,"f")){ue(this,s,i.element,"f");const o=Vi(he(this,s,"f")),a=Bi(()=>t(o,...r));return ue(this,e,a??null,"f"),void ue(this,n,!0,"f")}he(this,e,"f")?.onUpdate&&Bi(()=>he(this,e,"f").onUpdate(...r))}render(...t){}disconnected(){ue(this,i,!0,"f"),he(this,e,"f")?.onCleanup&&he(this,e,"f").onCleanup()}reconnected(){he(this,i,"f")&&(ue(this,i,!1,"f"),ue(this,n,!1,"f"),ue(this,e,null,"f"))}});return(...t)=>r(...t)}const Xi=qi((t,e)=>(t.attr(e),{onUpdate(e){t.attr(e)},onCleanup(){t.attr({})}}));function Zi(t){return Xi(t)}function Gi(t){}const Ki=qi((t,e)=>{const n=t.el;let s=new Set;const i=t=>{const e=(t=>{const e=new Set;if(Array.isArray(t))for(const n of t)if(Array.isArray(n)){if(2===n.length){const[t,s]=n;t&&s&&e.add(s)}else if(3===n.length){const[t,s,i]=n,r=t?s:i;r&&e.add(r)}}else"string"==typeof n&&n&&e.add(n);else for(const[n,s]of Object.entries(t))s&&e.add(n);return e})(t);for(const t of s)e.has(t)||n.classList.remove(t);for(const t of e)s.has(t)||n.classList.add(t);s=e};return i(e),{onUpdate(t){i(t)},onCleanup(){for(const t of s)n.classList.remove(t);s=new Set}}});function Ji(t){return Ki(t)}function Qi(t){}function tr(t){const e=re.isHookRunning;re.isHookRunning=!0;try{return t()}finally{re.isHookRunning=e}}function er(t){var e,n,s,i,r,o;e=new WeakMap,n=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakMap;const a=B(class extends ft{constructor(t){if(super(t),e.set(this,null),n.set(this,!1),s.set(this,!1),i.set(this,!1),r.set(this,null),o.set(this,t=>{he(this,i,"f")?ue(this,r,t,"f"):this.setValue(t)}),t.type!==V)throw new Error("htmlHook() must be used as a child expression, e.g. html`<div>${myHook()}</div>`")}update(s,a){if(ue(this,i,!0,"f"),ue(this,r,null,"f"),he(this,n,"f"))he(this,e,"f")?.onUpdate&&tr(()=>he(this,e,"f").onUpdate(...a));else{const s=tr(()=>t(he(this,o,"f"),...a));ue(this,e,s??null,"f"),ue(this,n,!0,"f")}if(ue(this,i,!1,"f"),null!==he(this,r,"f")){const t=he(this,r,"f");return ue(this,r,null,"f"),t}}render(...t){}disconnected(){ue(this,s,!0,"f"),he(this,e,"f")?.onCleanup&&he(this,e,"f").onCleanup(),ue(this,n,!1,"f"),ue(this,e,null,"f")}reconnected(){he(this,s,"f")&&(ue(this,s,!1,"f"),ue(this,n,!1,"f"),ue(this,e,null,"f"))}});return(...t)=>a(...t)}const nr=qi((t,e)=>{let n=e;const s=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?n.onVisible?.():n.onHidden?.()},{rootMargin:e.rootMargin??"0px",threshold:e.threshold??0});return s.observe(t.el),{onUpdate(t){n=t},onCleanup(){s.disconnect()}}});function sr(t){return nr(t)}function ir(t,e){return nr({onVisible:t,...e})}function rr(t,e){return nr({onHidden:t,...e})}const or=qi((t,e,n)=>{let s=e,i=!1,r=!0;const o=new IntersectionObserver(t=>{for(const e of t){const t=e.isIntersecting;if(r)return r=!1,void(i=t);t&&!i&&s(),i=t}},{rootMargin:n?.rootMargin??"0px",threshold:n?.threshold??0});return o.observe(t.el),{onUpdate(t,e){s=t},onCleanup(){o.disconnect(),i=!1,r=!0}}});function ar(t,e){return or(t,e)}function lr(t,e){return or(t,e)}const cr=qi((t,e)=>{e(t.el)}),hr=qi((t,e)=>{let n=e;return{onUpdate(t){n=t},onCleanup(){n(t.el)}}});function ur(t){return cr(t)}function dr(t){return hr(t)}qi((t,e)=>({onUpdate(e){e(t.el)}}));const fr=er((t,e,n,s,i)=>{function r(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n??{}}:{keyFn:null,template:t,opts:e??{}}}function o(t,e,n,s){const i=s.columns??3,r=s.gap??12,o=s.containerClass??"",a=[`column-count:${i}`,`column-gap:${r}px`,s.containerStyle??""].filter(Boolean).join(";"),l=["break-inside:avoid",`margin-bottom:${r}px`,"display:inline-block","width:100%","box-sizing:border-box"].join(";"),c=t,h=Tt(c,e||((t,e)=>e),(t,e)=>b`
|
|
109
|
+
<div style="${l}">${n(t,e)}</div>
|
|
110
|
+
`);return b`
|
|
111
|
+
<div class="${o}" style="${a}">
|
|
112
|
+
${h}
|
|
43
113
|
</div>
|
|
44
|
-
`}const{keyFn:
|
|
114
|
+
`}const{keyFn:a,template:l,opts:c}=r(n,s,i);return t(o(e,a,l,c)),{onUpdate(e,n,s,i){const{keyFn:a,template:l,opts:c}=r(n,s,i);t(o(e,a,l,c))}}});function pr(t,e,n,s){return fr(t,e,n,s)}var mr,_r;mr=new WeakMap,_r=new WeakMap;const gr=B(class extends ft{constructor(t){if(super(t),mr.set(this,null),_r.set(this,null),t.type!==V)throw new Error("memoTemplate() must be used as a child expression, e.g. html`<div>${memoTemplate(keys, () => html`...`)}</div>`")}update(t,[e,n]){return null!==he(this,mr,"f")&&function(t,e){if(t.length!==e.length)return!1;for(let n=0;n<e.length;n++)if(!Object.is(t[n],e[n]))return!1;return!0}(he(this,mr,"f"),e)||(ue(this,_r,n(),"f"),ue(this,mr,e.slice(),"f")),he(this,_r,"f")}render(t,e){return e()}disconnected(){}reconnected(){}});function yr(t,e){return gr(t,e)}function vr(t,e,n){const s={current:n},i=t=>{s.current?.(t)};return t.addEventListener(e,i),{handler:n,handlerRef:s,cleanup:()=>t.removeEventListener(e,i)}}function wr(t){t.cleanup()}function br(t){for(const e of t.values())e.cleanup();t.clear()}function Sr(t,e){const n={current:e},s=e=>{const s=e.target;s&&!t.contains(s)&&n.current?.(e)};return document.addEventListener("mousedown",s,!0),{handler:e,cleanup:()=>document.removeEventListener("mousedown",s,!0),handlerRef:n}}const Er="__viewport__",Ar=new WeakMap;function Cr(t,e,n){const s=new Set;let i,r,o=!1;for(const[a,l]of Object.entries(e)){if(!l)continue;if("enterViewport"===a){i=l,o=!0;continue}if("exitViewport"===a){r=l,o=!0;continue}s.add(a);const e=n.get(a);e?e.handler!==l&&(e.handlerRef&&(e.handlerRef.current=l),e.handler=l):n.set(a,"clickOutside"===a?Sr(t,l):vr(t,a,l))}if(o){s.add(Er);const e=n.get(Er);if(e){const t=e;t.enterRef&&(t.enterRef.current=i),t.exitRef&&(t.exitRef.current=r)}else n.set(Er,function(t,e,n){const s={current:e},i={current:n},r=new IntersectionObserver(t=>{for(const e of t)e.isIntersecting?s.current?.(e):i.current?.(e)},{threshold:0});return r.observe(t),{handler:e??n??(()=>{}),cleanup:()=>r.disconnect(),enterRef:s,exitRef:i}}(t,i,r))}for(const[t,e]of n)s.has(t)||(wr(e),n.delete(t))}const Mr=qi((t,e)=>{const n=new Map,s=t.el;Cr(s,e,n);const i=()=>{br(n),Ar.delete(s)};return Ar.set(s,i),{onUpdate(t){Cr(s,t,n)},onCleanup(){i()}}});function kr(t){return Mr(t)}function xr(t){Ar.get(t)?.()}const $r=qi((t,e,n)=>{const s=new Map;let i=null,r=n;const o=(t,e)=>{t!==i&&(br(s),i=t),function(t,e,n){const s=new Set;for(const[i,r]of Object.entries(e)){if(!r)continue;s.add(i);const e=n.get(i);e?e.handler!==r&&(e.handlerRef&&(e.handlerRef.current=r),e.handler=r):n.set(i,vr(t,i,r))}for(const[t,e]of n)s.has(t)||(wr(e),n.delete(t))}(t,e,s)},a=()=>{br(s),i=null},l=e.__subscribe(t=>{t?o(t,r):a()});return e.value&&o(e.value,n),{onUpdate(t,n){r=n,e.value&&o(e.value,n)},onCleanup(){a(),l()}}});function Tr(t,e){return $r(t,e)}function Rr(t){for(const e of t){if(!Array.isArray(e))return e;{const[t,n]=e;if(t)return n}}return A}const Or=qi((t,e)=>(t.style(e),{onUpdate(e){t.style(e)}}));function zr(t){return Or(t)}function Ir(t){}const Pr=er((t,e,n)=>{if(n<16)throw new Error(`timer() ms must be at least 16ms (one frame at 60fps), got ${n}`);let s=e,i=n,r=null;const o=()=>t(s()),a=()=>{r=setInterval(o,i)};return o(),a(),{onUpdate(t,e){s=t,e!==i&&(i=e,null!==r&&(clearInterval(r),r=null),a())},onCleanup(){null!==r&&(clearInterval(r),r=null)}}});function Dr(t,e){return Pr(t,e)}
|
|
45
115
|
/**
|
|
46
116
|
* @license
|
|
47
117
|
* Copyright 2021 Google LLC
|
|
48
118
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
49
|
-
*/
|
|
50
|
-
function Un(t){return"horizontal"===t?"width":"height"}function Fn(t){return"horizontal"===t?"height":"width"}class Vn{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:n}=this;Object.assign(this._viewportSize,t),n!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[Un(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:n}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:n||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,n=Math.min(this.items.length,Math.max(0,t.index)),s=this._getItemPosition(n)[this._positionDim];let i=s;if("start"!==e){const t=this._getItemSize(n)[this._sizeDim];if("center"===e)i=s-.5*this._viewDim1+.5*t;else{const n=s-this._viewDim1+t;if("end"===e)i=n;else{const t=this._scrollPosition;i=Math.abs(t-s)<Math.abs(t-n)?s:n}}}return i+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(i)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let n=this._last;for(;n>this._first&&Math.round(this._getItemPosition(n)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)n--;e===this._firstVisible&&n===this._lastVisible||(this._firstVisible=e,this._lastVisible=n,t?.emit&&this._sendVisibilityChangedMessage())}}
|
|
119
|
+
*/function Lr(t){return"horizontal"===t?"width":"height"}function Nr(t){return"horizontal"===t?"height":"width"}class jr{_getDefaultConfig(){return{direction:"vertical"}}constructor(t,e){this._latestCoords={left:0,top:0},this._direction=null,this._viewportSize={width:0,height:0},this.totalScrollSize={width:0,height:0},this.offsetWithinScroller={left:0,top:0},this._pendingReflow=!1,this._pendingLayoutUpdate=!1,this._pin=null,this._firstVisible=0,this._lastVisible=0,this._physicalMin=0,this._physicalMax=0,this._first=-1,this._last=-1,this._sizeDim="height",this._secondarySizeDim="width",this._positionDim="top",this._secondaryPositionDim="left",this._scrollPosition=0,this._scrollError=0,this._items=[],this._scrollSize=1,this._overhang=1e3,this._hostSink=t,Promise.resolve().then(()=>this.config=e||this._getDefaultConfig())}set config(t){Object.assign(this,Object.assign({},this._getDefaultConfig(),t))}get config(){return{direction:this.direction}}get items(){return this._items}set items(t){this._setItems(t)}_setItems(t){t!==this._items&&(this._items=t,this._scheduleReflow())}get direction(){return this._direction}set direction(t){(t="horizontal"===t?t:"vertical")!==this._direction&&(this._direction=t,this._sizeDim="horizontal"===t?"width":"height",this._secondarySizeDim="horizontal"===t?"height":"width",this._positionDim="horizontal"===t?"left":"top",this._secondaryPositionDim="horizontal"===t?"top":"left",this._triggerReflow())}get viewportSize(){return this._viewportSize}set viewportSize(t){const{_viewDim1:e,_viewDim2:n}=this;Object.assign(this._viewportSize,t),n!==this._viewDim2?this._scheduleLayoutUpdate():e!==this._viewDim1&&this._checkThresholds()}get viewportScroll(){return this._latestCoords}set viewportScroll(t){Object.assign(this._latestCoords,t);const e=this._scrollPosition;this._scrollPosition=this._latestCoords[this._positionDim];Math.abs(e-this._scrollPosition)>=1&&this._checkThresholds()}reflowIfNeeded(t=!1){(t||this._pendingReflow)&&(this._pendingReflow=!1,this._reflow())}set pin(t){this._pin=t,this._triggerReflow()}get pin(){if(null!==this._pin){const{index:t,block:e}=this._pin;return{index:Math.max(0,Math.min(t,this.items.length-1)),block:e}}return null}_clampScrollPosition(t){return Math.max(-this.offsetWithinScroller[this._positionDim],Math.min(t,this.totalScrollSize[Lr(this.direction)]-this._viewDim1))}unpin(){null!==this._pin&&(this._sendUnpinnedMessage(),this._pin=null)}_updateLayout(){}get _viewDim1(){return this._viewportSize[this._sizeDim]}get _viewDim2(){return this._viewportSize[this._secondarySizeDim]}_scheduleReflow(){this._pendingReflow=!0}_scheduleLayoutUpdate(){this._pendingLayoutUpdate=!0,this._scheduleReflow()}_triggerReflow(){this._scheduleLayoutUpdate(),Promise.resolve().then(()=>this.reflowIfNeeded())}_reflow(){this._pendingLayoutUpdate&&(this._updateLayout(),this._pendingLayoutUpdate=!1),this._updateScrollSize(),this._setPositionFromPin(),this._getActiveItems(),this._updateVisibleIndices(),this._sendStateChangedMessage()}_setPositionFromPin(){if(null!==this.pin){const t=this._scrollPosition,{index:e,block:n}=this.pin;this._scrollPosition=this._calculateScrollIntoViewPosition({index:e,block:n||"start"})-this.offsetWithinScroller[this._positionDim],this._scrollError=t-this._scrollPosition}}_calculateScrollIntoViewPosition(t){const{block:e}=t,n=Math.min(this.items.length,Math.max(0,t.index)),s=this._getItemPosition(n)[this._positionDim];let i=s;if("start"!==e){const t=this._getItemSize(n)[this._sizeDim];if("center"===e)i=s-.5*this._viewDim1+.5*t;else{const n=s-this._viewDim1+t;if("end"===e)i=n;else{const t=this._scrollPosition;i=Math.abs(t-s)<Math.abs(t-n)?s:n}}}return i+=this.offsetWithinScroller[this._positionDim],this._clampScrollPosition(i)}getScrollIntoViewCoordinates(t){return{[this._positionDim]:this._calculateScrollIntoViewPosition(t)}}_sendUnpinnedMessage(){this._hostSink({type:"unpinned"})}_sendVisibilityChangedMessage(){this._hostSink({type:"visibilityChanged",firstVisible:this._firstVisible,lastVisible:this._lastVisible})}_sendStateChangedMessage(){const t=new Map;if(-1!==this._first&&-1!==this._last)for(let e=this._first;e<=this._last;e++)t.set(e,this._getItemPosition(e));const e={type:"stateChanged",scrollSize:{[this._sizeDim]:this._scrollSize,[this._secondarySizeDim]:null},range:{first:this._first,last:this._last,firstVisible:this._firstVisible,lastVisible:this._lastVisible},childPositions:t};this._scrollError&&(e.scrollError={[this._positionDim]:this._scrollError,[this._secondaryPositionDim]:0},this._scrollError=0),this._hostSink(e)}get _num(){return-1===this._first||-1===this._last?0:this._last-this._first+1}_checkThresholds(){if(0===this._viewDim1&&this._num>0||null!==this._pin)this._scheduleReflow();else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang);this._physicalMin>t||this._physicalMax<e?this._scheduleReflow():this._updateVisibleIndices({emit:!0})}}_updateVisibleIndices(t){if(-1===this._first||-1===this._last)return;let e=this._first;for(;e<this._last&&Math.round(this._getItemPosition(e)[this._positionDim]+this._getItemSize(e)[this._sizeDim])<=Math.round(this._scrollPosition);)e++;let n=this._last;for(;n>this._first&&Math.round(this._getItemPosition(n)[this._positionDim])>=Math.round(this._scrollPosition+this._viewDim1);)n--;e===this._firstVisible&&n===this._lastVisible||(this._firstVisible=e,this._lastVisible=n,t?.emit&&this._sendVisibilityChangedMessage())}}
|
|
51
120
|
/**
|
|
52
121
|
* @license
|
|
53
122
|
* Copyright 2021 Google LLC
|
|
54
123
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
55
|
-
*/class
|
|
124
|
+
*/class Ur{constructor(t){this._map=new Map,this._roundAverageSize=!1,this.totalSize=0,!0===t?.roundAverageSize&&(this._roundAverageSize=!0)}set(t,e){const n=this._map.get(t)||0;this._map.set(t,e),this.totalSize+=e-n}get averageSize(){if(this._map.size>0){const t=this.totalSize/this._map.size;return this._roundAverageSize?Math.round(t):t}return 0}getSize(t){return this._map.get(t)}clear(){this._map.clear(),this.totalSize=0}}
|
|
56
125
|
/**
|
|
57
126
|
* @license
|
|
58
127
|
* Copyright 2021 Google LLC
|
|
59
128
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
60
|
-
*/const
|
|
129
|
+
*/const Fr=t=>Object.assign({type:qr},t);function Vr(t){return"horizontal"===t?"marginLeft":"marginTop"}function Wr(t){return"horizontal"===t?"marginRight":"marginBottom"}function Hr(t){return"horizontal"===t?"xOffset":"yOffset"}function Yr(t,e){const n=[t,e].sort();return n[1]<=0?Math.min(...n):n[0]>=0?Math.max(...n):n[0]+n[1]}class Br{constructor(){this._childSizeCache=new Ur,this._marginSizeCache=new Ur,this._metricsCache=new Map}update(t,e){const n=new Set;Object.keys(t).forEach(s=>{const i=Number(s);this._metricsCache.set(i,t[i]),this._childSizeCache.set(i,t[i][Lr(e)]),n.add(i),n.add(i+1)});for(const t of n){const n=this._metricsCache.get(t)?.[Vr(e)]||0,s=this._metricsCache.get(t-1)?.[Wr(e)]||0;this._marginSizeCache.set(t,Yr(n,s))}}get averageChildSize(){return this._childSizeCache.averageSize}get totalChildSize(){return this._childSizeCache.totalSize}get averageMarginSize(){return this._marginSizeCache.averageSize}get totalMarginSize(){return this._marginSizeCache.totalSize}getLeadingMarginValue(t,e){return this._metricsCache.get(t)?.[Vr(e)]||0}getChildSize(t){return this._childSizeCache.getSize(t)}getMarginSize(t){return this._marginSizeCache.getSize(t)}clear(){this._childSizeCache.clear(),this._marginSizeCache.clear(),this._metricsCache.clear()}}class qr extends jr{constructor(){super(...arguments),this._itemSize={width:100,height:100},this._physicalItems=new Map,this._newPhysicalItems=new Map,this._metricsCache=new Br,this._anchorIdx=null,this._anchorPos=null,this._stable=!0,this._measureChildren=!0,this._estimate=!0}get measureChildren(){return this._measureChildren}updateItemSizes(t){this._metricsCache.update(t,this.direction),this._scheduleReflow()}_getPhysicalItem(t){return this._newPhysicalItems.get(t)??this._physicalItems.get(t)}_getSize(t){return this._getPhysicalItem(t)&&this._metricsCache.getChildSize(t)}_getAverageSize(){return this._metricsCache.averageChildSize||this._itemSize[this._sizeDim]}_estimatePosition(t){const e=this._metricsCache;if(-1===this._first||-1===this._last)return e.averageMarginSize+t*(e.averageMarginSize+this._getAverageSize());if(t<this._first){const n=this._first-t;return this._getPhysicalItem(this._first).pos-(e.getMarginSize(this._first-1)||e.averageMarginSize)-(n*e.averageChildSize+(n-1)*e.averageMarginSize)}{const n=t-this._last;return this._getPhysicalItem(this._last).pos+(e.getChildSize(this._last)||e.averageChildSize)+(e.getMarginSize(this._last)||e.averageMarginSize)+n*(e.averageChildSize+e.averageMarginSize)}}_getPosition(t){const e=this._getPhysicalItem(t),{averageMarginSize:n}=this._metricsCache;return 0===t?this._metricsCache.getMarginSize(0)??n:e?e.pos:this._estimatePosition(t)}_calculateAnchor(t,e){return t<=0?0:e>this._scrollSize-this._viewDim1?this.items.length-1:Math.max(0,Math.min(this.items.length-1,Math.floor((t+e)/2/this._delta)))}_getAnchor(t,e){if(0===this._physicalItems.size)return this._calculateAnchor(t,e);if(this._first<0)return this._calculateAnchor(t,e);if(this._last<0)return this._calculateAnchor(t,e);const n=this._getPhysicalItem(this._first),s=this._getPhysicalItem(this._last),i=n.pos;if(s.pos+this._metricsCache.getChildSize(this._last)<t)return this._calculateAnchor(t,e);if(i>e)return this._calculateAnchor(t,e);let r=this._firstVisible-1,o=-1/0;for(;o<t;){o=this._getPhysicalItem(++r).pos+this._metricsCache.getChildSize(r)}return r}_getActiveItems(){0===this._viewDim1||0===this.items.length?this._clearItems():this._getItems()}_clearItems(){this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;const t=this._newPhysicalItems;this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t,this._stable=!0}_getItems(){const t=this._newPhysicalItems;let e,n;if(this._stable=!0,null!==this.pin){const{index:t}=this.pin;this._anchorIdx=t,this._anchorPos=this._getPosition(t)}if(e=this._scrollPosition-this._overhang,n=this._scrollPosition+this._viewDim1+this._overhang,n<0||e>this._scrollSize)return void this._clearItems();null!==this._anchorIdx&&null!==this._anchorPos||(this._anchorIdx=this._getAnchor(e,n),this._anchorPos=this._getPosition(this._anchorIdx));let s=this._getSize(this._anchorIdx);void 0===s&&(this._stable=!1,s=this._getAverageSize());const i=this._metricsCache.getMarginSize(this._anchorIdx)??this._metricsCache.averageMarginSize,r=this._metricsCache.getMarginSize(this._anchorIdx+1)??this._metricsCache.averageMarginSize;0===this._anchorIdx&&(this._anchorPos=i),this._anchorIdx===this.items.length-1&&(this._anchorPos=this._scrollSize-r-s);let o=0;for(this._anchorPos+s+r<e&&(o=e-(this._anchorPos+s+r)),this._anchorPos-i>n&&(o=n-(this._anchorPos-i)),o&&(this._scrollPosition-=o,e-=o,n-=o,this._scrollError+=o),t.set(this._anchorIdx,{pos:this._anchorPos,size:s}),this._first=this._last=this._anchorIdx,this._physicalMin=this._anchorPos-i,this._physicalMax=this._anchorPos+s+r;this._physicalMin>e&&this._first>0;){let e=this._getSize(--this._first);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._first);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize),this._physicalMin-=e;const s=this._physicalMin;if(t.set(this._first,{pos:s,size:e}),this._physicalMin-=n,!1===this._stable&&!1===this._estimate)break}for(;this._physicalMax<n&&this._last<this.items.length-1;){let e=this._getSize(++this._last);void 0===e&&(this._stable=!1,e=this._getAverageSize());let n=this._metricsCache.getMarginSize(this._last);void 0===n&&(this._stable=!1,n=this._metricsCache.averageMarginSize);const s=this._physicalMax;if(t.set(this._last,{pos:s,size:e}),this._physicalMax+=e+n,!this._stable&&!this._estimate)break}const a=this._calculateError();a&&(this._physicalMin-=a,this._physicalMax-=a,this._anchorPos-=a,this._scrollPosition-=a,t.forEach(t=>t.pos-=a),this._scrollError+=a),this._stable&&(this._newPhysicalItems=this._physicalItems,this._newPhysicalItems.clear(),this._physicalItems=t)}_calculateError(){return 0===this._first?this._physicalMin:this._physicalMin<=0?this._physicalMin-this._first*this._delta:this._last===this.items.length-1?this._physicalMax-this._scrollSize:this._physicalMax>=this._scrollSize?this._physicalMax-this._scrollSize+(this.items.length-1-this._last)*this._delta:0}_reflow(){const{_first:t,_last:e}=this;super._reflow(),(-1===this._first&&-1===this._last||this._first===t&&this._last===e)&&this._resetReflowState()}_resetReflowState(){this._anchorIdx=null,this._anchorPos=null,this._stable=!0}_updateScrollSize(){const{averageMarginSize:t}=this._metricsCache;this._scrollSize=Math.max(1,this.items.length*(t+this._getAverageSize())+t)}get _delta(){const{averageMarginSize:t}=this._metricsCache;return this._getAverageSize()+t}_getItemPosition(t){return{[this._positionDim]:this._getPosition(t),[this._secondaryPositionDim]:0,[Hr(this.direction)]:-(this._metricsCache.getLeadingMarginValue(t,this.direction)??this._metricsCache.averageMarginSize)}}_getItemSize(t){return{[this._sizeDim]:this._getSize(t)||this._getAverageSize(),[this._secondarySizeDim]:this._itemSize[this._secondarySizeDim]}}_viewDim2Changed(){this._metricsCache.clear(),this._scheduleReflow()}}var Xr=Object.freeze({__proto__:null,FlowLayout:qr,flow:Fr});
|
|
61
130
|
/**
|
|
62
131
|
* @license
|
|
63
132
|
* Copyright 2021 Google LLC
|
|
64
133
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
65
|
-
*/function
|
|
134
|
+
*/function Zr(t){return"horizontal"===t?"row":"column"}class Gr extends jr{constructor(){super(...arguments),this._itemSize={},this._gaps={},this._padding={}}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{itemSize:{width:"300px",height:"300px"},gap:"8px",padding:"match-gap"})}get _gap(){return this._gaps.row}get _idealSize(){return this._itemSize[Lr(this.direction)]}get _idealSize1(){return this._itemSize[Lr(this.direction)]}get _idealSize2(){return this._itemSize[Nr(this.direction)]}get _gap1(){return this._gaps[(t=this.direction,"horizontal"===t?"column":"row")];var t}get _gap2(){return this._gaps[Zr(this.direction)]}get _padding1(){const t=this._padding,[e,n]="horizontal"===this.direction?["left","right"]:["top","bottom"];return[t[e],t[n]]}get _padding2(){const t=this._padding,[e,n]="horizontal"===this.direction?["top","bottom"]:["left","right"];return[t[e],t[n]]}set itemSize(t){const e=this._itemSize;"string"==typeof t&&(t={width:t,height:t});const n=parseInt(t.width,10),s=parseInt(t.height,10);n!==e.width&&(e.width=n,this._triggerReflow()),s!==e.height&&(e.height=s,this._triggerReflow())}set gap(t){this._setGap(t)}_setGap(t){const e=t.split(" ").map(t=>function(t){return"auto"===t?1/0:parseInt(t,10)}(t)),n=this._gaps;e[0]!==n.row&&(n.row=e[0],this._triggerReflow()),void 0===e[1]?e[0]!==n.column&&(n.column=e[0],this._triggerReflow()):e[1]!==n.column&&(n.column=e[1],this._triggerReflow())}set padding(t){const e=this._padding,n=t.split(" ").map(t=>function(t){return"match-gap"===t?1/0:parseInt(t,10)}(t));1===n.length?(e.top=e.right=e.bottom=e.left=n[0],this._triggerReflow()):2===n.length?(e.top=e.bottom=n[0],e.right=e.left=n[1],this._triggerReflow()):3===n.length?(e.top=n[0],e.right=e.left=n[1],e.bottom=n[2],this._triggerReflow()):4===n.length&&(["top","right","bottom","left"].forEach((t,s)=>e[t]=n[s]),this._triggerReflow())}}
|
|
66
135
|
/**
|
|
67
136
|
* @license
|
|
68
137
|
* Copyright 2021 Google LLC
|
|
69
138
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
70
|
-
*/class
|
|
139
|
+
*/class Kr extends Gr{constructor(){super(...arguments),this._metrics=null,this.flex=null,this.justify=null}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{flex:!1,justify:"start"})}set gap(t){super._setGap(t)}_updateLayout(){const t=this.justify,[e,n]=this._padding1,[s,i]=this._padding2;["_gap1","_gap2"].forEach(e=>{const n=this[e];if(n===1/0&&!["space-between","space-around","space-evenly"].includes(t))throw new Error("grid layout: gap can only be set to 'auto' when justify is set to 'space-between', 'space-around' or 'space-evenly'");if(n===1/0&&"_gap2"===e)throw new Error(`grid layout: ${Zr(this.direction)}-gap cannot be set to 'auto' when direction is set to ${this.direction}`)});const r=this.flex||["start","center","end"].includes(t),o={rolumns:-1,itemSize1:-1,itemSize2:-1,gap1:this._gap1===1/0?-1:this._gap1,gap2:r?this._gap2:0,padding1:{start:e===1/0?this._gap1:e,end:n===1/0?this._gap1:n},padding2:r?{start:s===1/0?this._gap2:s,end:i===1/0?this._gap2:i}:{start:0,end:0},positions:[]},a=this._viewDim2-o.padding2.start-o.padding2.end;if(a<=0)o.rolumns=0;else{const s=r?o.gap2:0;let i,l=0,c=0;if(a>=this._idealSize2&&(l=Math.floor((a-this._idealSize2)/(this._idealSize2+s))+1,c=l*this._idealSize2+(l-1)*s),this.flex){(a-c)/(this._idealSize2+s)>=.5&&(l+=1),o.rolumns=l,o.itemSize2=Math.round((a-s*(l-1))/l);switch(!0===this.flex?"area":this.flex.preserve){case"aspect-ratio":o.itemSize1=Math.round(this._idealSize1/this._idealSize2*o.itemSize2);break;case Lr(this.direction):o.itemSize1=Math.round(this._idealSize1);break;default:o.itemSize1=Math.round(this._idealSize1*this._idealSize2/o.itemSize2)}}else o.itemSize1=this._idealSize1,o.itemSize2=this._idealSize2,o.rolumns=l;if(r){const e=o.rolumns*o.itemSize2+(o.rolumns-1)*o.gap2;i=this.flex||"start"===t?o.padding2.start:"end"===t?this._viewDim2-o.padding2.end-e:Math.round(this._viewDim2/2-e/2)}else{const s=a-o.rolumns*o.itemSize2;"space-between"===t?(o.gap2=Math.round(s/(o.rolumns-1)),i=0):"space-around"===t?(o.gap2=Math.round(s/o.rolumns),i=Math.round(o.gap2/2)):(o.gap2=Math.round(s/(o.rolumns+1)),i=o.gap2),this._gap1===1/0&&(o.gap1=o.gap2,e===1/0&&(o.padding1.start=i),n===1/0&&(o.padding1.end=i))}for(let t=0;t<o.rolumns;t++)o.positions.push(i),i+=o.itemSize2+o.gap2}this._metrics=o}}
|
|
71
140
|
/**
|
|
72
141
|
* @license
|
|
73
142
|
* Copyright 2021 Google LLC
|
|
74
143
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
75
|
-
*/class
|
|
144
|
+
*/class Jr extends Kr{get _delta(){return this._metrics.itemSize1+this._metrics.gap1}_getItemSize(t){return{[this._sizeDim]:this._metrics.itemSize1,[this._secondarySizeDim]:this._metrics.itemSize2}}_getActiveItems(){const t=this._metrics,{rolumns:e}=t;if(0===e)this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;else{const{padding1:n}=t,s=Math.max(0,this._scrollPosition-this._overhang),i=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang),r=Math.max(0,Math.floor((s-n.start)/this._delta)),o=Math.max(0,Math.ceil((i-n.start)/this._delta));this._first=r*e,this._last=Math.min(o*e-1,this.items.length-1),this._physicalMin=n.start+this._delta*r,this._physicalMax=n.start+this._delta*o}}_getItemPosition(t){const{rolumns:e,padding1:n,positions:s,itemSize1:i,itemSize2:r}=this._metrics;return{[this._positionDim]:n.start+Math.floor(t/e)*this._delta,[this._secondaryPositionDim]:s[t%e],[Lr(this.direction)]:i,[Nr(this.direction)]:r}}_updateScrollSize(){const{rolumns:t,gap1:e,padding1:n,itemSize1:s}=this._metrics;let i=1;if(t>0){const r=Math.ceil(this.items.length/t);i=n.start+r*s+(r-1)*e+n.end}this._scrollSize=i}}
|
|
76
145
|
/**
|
|
77
146
|
* @license
|
|
78
147
|
* Copyright 2021 Google LLC
|
|
79
148
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
80
|
-
*/const
|
|
149
|
+
*/const Qr="MIN";class to extends Kr{constructor(){super(...arguments),this._RANGE_MAP_GRANULARITY=100,this._positions=new Map,this._rangeMap=new Map}_getDefaultConfig(){return Object.assign({},super._getDefaultConfig(),{getAspectRatio:()=>1})}set getAspectRatio(t){this._getAspectRatio=t}_setItems(t){t!==this._items&&this._scheduleLayoutUpdate(),super._setItems(t)}_getItemSize(t){return{[this._sizeDim]:this._metrics.itemSize1,[this._secondarySizeDim]:this._metrics.itemSize2}}_updateLayout(){super._updateLayout(),this._layOutChildren()}_getRangeMapKey(t,e){const n=this._RANGE_MAP_GRANULARITY;return e===Qr?Math.floor(t/n)*n:Math.ceil(t/n)*n}_layOutChildren(){const t=this._RANGE_MAP_GRANULARITY;this._positions.clear(),this._rangeMap.clear();const{rolumns:e,padding1:n,itemSize2:s,gap1:i,positions:r}=this._metrics;let o=n.start;const a=new Array(e).fill(null).map(t=>o);let l=0,c=0,h=1/0,u=-1/0;if(this.items.forEach((e,d)=>{const f=this._getAspectRatio(e),p="horizontal"===this.direction?s*f:s/f,m=a[l],_=r[l];this._positions.set(d,{[this._positionDim]:m,[this._secondaryPositionDim]:_,[this._sizeDim]:p,[this._secondarySizeDim]:s});const g=m+p,y=this._getRangeMapKey(m,Qr);y<h&&(h=y);const v=this._getRangeMapKey(g,"MAX");v>u&&(u=v);for(let e=y;e<=v;e+=t){const[t,n]=this._rangeMap.get(e)??[1/0,-1/0];this._rangeMap.set(e,[Math.min(d,t),Math.max(d,n)])}c=Math.max(c,g+n.end),a[l]+=p+i,o=1/0,a.forEach((t,e)=>{t<o&&(o=t,l=e)})}),h!==1/0)for(let e=0;e<h;e+=t)this._rangeMap.set(e,[-1,-1]);if(u!==-1/0){const e=this._rangeMap.get(u);for(let n=u+t;n<c+t;n+=t)this._rangeMap.set(n,e)}this._scrollSize=c}_getActiveItems(){const t=this._metrics,{rolumns:e}=t;if(0===e||0===this._rangeMap.size)this._first=-1,this._last=-1,this._physicalMin=0,this._physicalMax=0;else{const t=Math.max(0,this._scrollPosition-this._overhang),e=Math.min(this._scrollSize,this._scrollPosition+this._viewDim1+this._overhang),n=this.items.length-1,s=this._getRangeMapKey(t,Qr),i=this._getRangeMapKey(e,"MAX");let r=n,o=0;for(let t=s;t<=i;t+=this._RANGE_MAP_GRANULARITY){const[e,s]=this._rangeMap.get(t)??[n,0];r=Math.min(r,e),o=Math.max(o,s)}this._first=r,this._last=o}}_getItemPosition(t){return this._positions.get(t)}_updateScrollSize(){}}
|
|
81
150
|
/**
|
|
82
151
|
* @license
|
|
83
152
|
* Copyright 2021 Google LLC
|
|
84
153
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
85
|
-
*/class
|
|
154
|
+
*/class eo extends Event{constructor(t){super(eo.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}eo.eventName="rangeChanged";class no extends Event{constructor(t){super(no.eventName,{bubbles:!1}),this.first=t.first,this.last=t.last}}no.eventName="visibilityChanged";class so extends Event{constructor(){super(so.eventName,{bubbles:!1})}}so.eventName="unpinned";
|
|
86
155
|
/**
|
|
87
156
|
* @license
|
|
88
157
|
* Copyright 2021 Google LLC
|
|
89
158
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
90
159
|
*/
|
|
91
|
-
class
|
|
160
|
+
class io{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(this._element=t)}get element(){return this._element||document.scrollingElement||document.documentElement}get scrollTop(){return this.element.scrollTop||window.scrollY}get scrollLeft(){return this.element.scrollLeft||window.scrollX}get scrollHeight(){return this.element.scrollHeight}get scrollWidth(){return this.element.scrollWidth}get viewportHeight(){return this._element?this._element.getBoundingClientRect().height:window.innerHeight}get viewportWidth(){return this._element?this._element.getBoundingClientRect().width:window.innerWidth}get maxScrollTop(){return this.scrollHeight-this.viewportHeight}get maxScrollLeft(){return this.scrollWidth-this.viewportWidth}}class ro extends io{constructor(t,e){super(e),this._clients=new Set,this._retarget=null,this._end=null,this.__destination=null,this.correctingScrollError=!1,this._checkForArrival=this._checkForArrival.bind(this),this._updateManagedScrollTo=this._updateManagedScrollTo.bind(this),this.scrollTo=this.scrollTo.bind(this),this.scrollBy=this.scrollBy.bind(this);const n=this._node;this._originalScrollTo=n.scrollTo,this._originalScrollBy=n.scrollBy,this._originalScroll=n.scroll,this._attach(t)}get _destination(){return this.__destination}get scrolling(){return null!==this._destination}scrollTo(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;this._scrollTo(n)}scrollBy(t,e){const n="number"==typeof t&&"number"==typeof e?{left:t,top:e}:t;void 0!==n.top&&(n.top+=this.scrollTop),void 0!==n.left&&(n.left+=this.scrollLeft),this._scrollTo(n)}_nativeScrollTo(t){this._originalScrollTo.bind(this._element||window)(t)}_scrollTo(t,e=null,n=null){null!==this._end&&this._end(),"smooth"===t.behavior?(this._setDestination(t),this._retarget=e,this._end=n):this._resetScrollState(),this._nativeScrollTo(t)}_setDestination(t){let{top:e,left:n}=t;return e=void 0===e?void 0:Math.max(0,Math.min(e,this.maxScrollTop)),n=void 0===n?void 0:Math.max(0,Math.min(n,this.maxScrollLeft)),(null===this._destination||n!==this._destination.left||e!==this._destination.top)&&(this.__destination={top:e,left:n,behavior:"smooth"},!0)}_resetScrollState(){this.__destination=null,this._retarget=null,this._end=null}_updateManagedScrollTo(t){this._destination&&this._setDestination(t)&&this._nativeScrollTo(this._destination)}managedScrollTo(t,e,n){return this._scrollTo(t,e,n),this._updateManagedScrollTo}correctScrollError(t){this.correctingScrollError=!0,requestAnimationFrame(()=>requestAnimationFrame(()=>this.correctingScrollError=!1)),this._nativeScrollTo(t),this._retarget&&this._setDestination(this._retarget()),this._destination&&this._nativeScrollTo(this._destination)}_checkForArrival(){if(null!==this._destination){const{scrollTop:t,scrollLeft:e}=this;let{top:n,left:s}=this._destination;n=Math.min(n||0,this.maxScrollTop),s=Math.min(s||0,this.maxScrollLeft);const i=Math.abs(n-t),r=Math.abs(s-e);i<1&&r<1&&(this._end&&this._end(),this._resetScrollState())}}detach(t){return this._clients.delete(t),0===this._clients.size&&(this._node.scrollTo=this._originalScrollTo,this._node.scrollBy=this._originalScrollBy,this._node.scroll=this._originalScroll,this._node.removeEventListener("scroll",this._checkForArrival)),null}_attach(t){this._clients.add(t),1===this._clients.size&&(this._node.scrollTo=this.scrollTo,this._node.scrollBy=this.scrollBy,this._node.scroll=this.scrollTo,this._node.addEventListener("scroll",this._checkForArrival))}}
|
|
92
161
|
/**
|
|
93
162
|
* @license
|
|
94
163
|
* Copyright 2021 Google LLC
|
|
95
164
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
96
|
-
*/let
|
|
165
|
+
*/let oo="undefined"!=typeof window?window.ResizeObserver:void 0;const ao=Symbol("virtualizerRef"),lo="virtualizer-sizer";let co;class ho{constructor(t){if(this._benchmarkStart=null,this._layout=null,this._clippingAncestors=[],this._scrollSize=null,this._scrollError=null,this._childrenPos=null,this._childMeasurements=null,this._toBeMeasured=new Map,this._rangeChanged=!0,this._itemsChanged=!0,this._visibilityChanged=!0,this._scrollerController=null,this._isScroller=!1,this._sizer=null,this._hostElementRO=null,this._childrenRO=null,this._mutationObserver=null,this._scrollEventListeners=[],this._scrollEventListenerOptions={passive:!0},this._loadListener=this._childLoaded.bind(this),this._scrollIntoViewTarget=null,this._updateScrollIntoViewCoordinates=null,this._items=[],this._first=-1,this._last=-1,this._firstVisible=-1,this._lastVisible=-1,this._scheduled=new WeakSet,this._measureCallback=null,this._measureChildOverride=null,this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null,this._layoutInitialized=null,this._connected=!1,!t)throw new Error("Virtualizer constructor requires a configuration object");if(!t.hostElement)throw new Error('Virtualizer configuration requires the "hostElement" property');this._init(t)}set items(t){Array.isArray(t)&&t!==this._items&&(this._itemsChanged=!0,this._items=t,this._schedule(this._updateLayout))}_init(t){this._isScroller=!!t.scroller,this._initHostElement(t);const e=t.layout||{};this._layoutInitialized=this._initLayout(e)}_initObservers(){this._mutationObserver=new MutationObserver(this._finishDOMUpdate.bind(this)),this._hostElementRO=new oo(()=>this._hostElementSizeChanged()),this._childrenRO=new oo(this._childrenSizeChanged.bind(this))}_initHostElement(t){this._hostElement=t.hostElement;const e=this._hostElement;this._applyVirtualizerStyles(),e[ao]=this}connected(){this._initObservers();const t=this._isScroller;this._clippingAncestors=function(t,e=!1){let n=!1;return function(t,e=!1){const n=[];let s=e?t:fo(t);for(;null!==s;)n.push(s),s=fo(s);return n}(t,e).filter(t=>{if(n)return!1;const e=getComputedStyle(t);return n="fixed"===e.position,"visible"!==e.overflow})}
|
|
97
166
|
/**
|
|
98
167
|
* @license
|
|
99
168
|
* Copyright 2021 Google LLC
|
|
100
169
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
101
|
-
*/(this._hostElement,t),this._scrollerController=new ls(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${us}]`);e||(e=document.createElement("div"),e.setAttribute(us,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(us,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||ds;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,n;if("function"==typeof t.type){n=t.type;const s={...t};delete s.type,e=s}else e=t;void 0===n&&(ds=n=(await Promise.resolve().then(function(){return Jn})).FlowLayout),this._layout=new n(t=>this._handleLayoutMessage(t),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,n=performance.getEntriesByName("uv-virtualizing","measure").filter(e=>e.startTime>=this._benchmarkStart&&e.startTime<t).reduce((t,e)=>t+e.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:n}}return null}_measureChildren(){const t={},e=this._children,n=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const i=e[s],r=this._first+s;(this._itemsChanged||this._toBeMeasured.has(i))&&(t[r]=n.call(this,i,this._items[r]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:n}=t.getBoundingClientRect();return Object.assign({width:e,height:n},function(t){const e=window.getComputedStyle(t);return{marginTop:ps(e.marginTop),marginRight:ps(e.marginRight),marginBottom:ps(e.marginBottom),marginLeft:ps(e.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:n}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||n)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new os)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(us)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,n=this._layout;if(t&&e&&n){let s,i,r,o;const a=t.getBoundingClientRect();s=0,i=0,r=window.innerHeight,o=window.innerWidth;const l=this._clippingAncestors.map(t=>t.getBoundingClientRect());l.unshift(a);for(const t of l)s=Math.max(s,t.top),i=Math.max(i,t.left),r=Math.min(r,t.bottom),o=Math.min(o,t.right);const c=e.getBoundingClientRect(),h={left:a.left-c.left,top:a.top-c.top},u={width:e.scrollWidth,height:e.scrollHeight},d=s-a.top+t.scrollTop,f=i-a.left+t.scrollLeft,p=Math.max(0,r-s),m=Math.max(0,o-i);n.viewportSize={width:m,height:p},n.viewportScroll={top:d,left:f},n.totalScrollSize=u,n.offsetWithinScroller=h}}_sizeHostElement(t){const e=82e5,n=t&&null!==t.width?Math.min(e,t.width):0,s=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${n}px, ${s}px)`;else{const t=this._hostElement.style;t.minWidth=n?`${n}px`:"100%",t.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:t,left:e,width:n,height:s,xOffset:i,yOffset:r},o)=>{const a=this._children[o-this._first];a&&(a.style.position="absolute",a.style.boxSizing="border-box",a.style.transform=`translate(${e}px, ${t}px)`,void 0!==n&&(a.style.width=`${n}px`),void 0!==s&&(a.style.height=`${s}px`),a.style.left=void 0===i?null:`${i}px`,a.style.top=void 0===r?null:`${r}px`)})}async _adjustRange(t){const{_first:e,_last:n,_firstVisible:s,_lastVisible:i}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==n,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==i}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:n,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-n,left:e-s})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:n}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:n}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new is({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new rs({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function ps(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function ms(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}class gs extends _.AsyncDirective{constructor(e){if(super(e),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(e,n)=>((e,n)=>t.html`${n}: ${JSON.stringify(e,null,2)}`)(e,n+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],e.type!==y.PartType.CHILD)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return d.repeat(e,this._keyFunction,this._renderItem)}update(e,[n]){this._setFunctions(n);const s=this._items!==n.items;return this._items=n.items||[],this._virtualizer?this._updateVirtualizerConfig(e,n):this._initialize(e,n),s?t.noChange:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const n=t.parentNode;this._makeVirtualizer(n,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:n}=t;e&&(this._renderItem=(t,n)=>e(t,n+this._first)),n&&(this._keyFunction=(t,e)=>n(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:n,scroller:s,items:i}=e;this._virtualizer=new fs({hostElement:t,layout:n,scroller:s}),this._virtualizer.items=i,this._virtualizer.connected()}_initialize(t,e){const n=t.parentNode;n&&1===n.nodeType&&(n.addEventListener("rangeChanged",t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())}),this._makeVirtualizer(n,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}}const _s=y.directive(gs);
|
|
170
|
+
*/(this._hostElement,t),this._scrollerController=new ro(this,this._clippingAncestors[0]),this._schedule(this._updateLayout),this._observeAndListen(),this._connected=!0}_observeAndListen(){this._mutationObserver.observe(this._hostElement,{childList:!0}),this._hostElementRO.observe(this._hostElement),this._scrollEventListeners.push(window),window.addEventListener("scroll",this,this._scrollEventListenerOptions),this._clippingAncestors.forEach(t=>{t.addEventListener("scroll",this,this._scrollEventListenerOptions),this._scrollEventListeners.push(t),this._hostElementRO.observe(t)}),this._hostElementRO.observe(this._scrollerController.element),this._children.forEach(t=>this._childrenRO.observe(t)),this._scrollEventListeners.forEach(t=>t.addEventListener("scroll",this,this._scrollEventListenerOptions))}disconnected(){this._scrollEventListeners.forEach(t=>t.removeEventListener("scroll",this,this._scrollEventListenerOptions)),this._scrollEventListeners=[],this._clippingAncestors=[],this._scrollerController?.detach(this),this._scrollerController=null,this._mutationObserver?.disconnect(),this._mutationObserver=null,this._hostElementRO?.disconnect(),this._hostElementRO=null,this._childrenRO?.disconnect(),this._childrenRO=null,this._rejectLayoutCompletePromise("disconnected"),this._connected=!1}_applyVirtualizerStyles(){const t=this._hostElement.style;t.display=t.display||"block",t.position=t.position||"relative",t.contain=t.contain||"size layout",this._isScroller&&(t.overflow=t.overflow||"auto",t.minHeight=t.minHeight||"150px")}_getSizer(){const t=this._hostElement;if(!this._sizer){let e=t.querySelector(`[${lo}]`);e||(e=document.createElement("div"),e.setAttribute(lo,""),t.appendChild(e)),Object.assign(e.style,{position:"absolute",margin:"-2px 0 0 0",padding:0,visibility:"hidden",fontSize:"2px"}),e.textContent=" ",e.setAttribute(lo,""),this._sizer=e}return this._sizer}async updateLayoutConfig(t){await this._layoutInitialized;const e=t.type||co;if("function"==typeof e&&this._layout instanceof e){const e={...t};return delete e.type,this._layout.config=e,!0}return!1}async _initLayout(t){let e,n;if("function"==typeof t.type){n=t.type;const s={...t};delete s.type,e=s}else e=t;void 0===n&&(co=n=(await Promise.resolve().then(function(){return Xr})).FlowLayout),this._layout=new n(t=>this._handleLayoutMessage(t),e),this._layout.measureChildren&&"function"==typeof this._layout.updateItemSizes&&("function"==typeof this._layout.measureChildren&&(this._measureChildOverride=this._layout.measureChildren),this._measureCallback=this._layout.updateItemSizes.bind(this._layout)),this._layout.listenForChildLoadEvents&&this._hostElement.addEventListener("load",this._loadListener,!0),this._schedule(this._updateLayout)}startBenchmarking(){null===this._benchmarkStart&&(this._benchmarkStart=window.performance.now())}stopBenchmarking(){if(null!==this._benchmarkStart){const t=window.performance.now(),e=t-this._benchmarkStart,n=performance.getEntriesByName("uv-virtualizing","measure").filter(e=>e.startTime>=this._benchmarkStart&&e.startTime<t).reduce((t,e)=>t+e.duration,0);return this._benchmarkStart=null,{timeElapsed:e,virtualizationTime:n}}return null}_measureChildren(){const t={},e=this._children,n=this._measureChildOverride||this._measureChild;for(let s=0;s<e.length;s++){const i=e[s],r=this._first+s;(this._itemsChanged||this._toBeMeasured.has(i))&&(t[r]=n.call(this,i,this._items[r]))}this._childMeasurements=t,this._schedule(this._updateLayout),this._toBeMeasured.clear()}_measureChild(t){const{width:e,height:n}=t.getBoundingClientRect();return Object.assign({width:e,height:n},function(t){const e=window.getComputedStyle(t);return{marginTop:uo(e.marginTop),marginRight:uo(e.marginRight),marginBottom:uo(e.marginBottom),marginLeft:uo(e.marginLeft)}}(t))}async _schedule(t){this._scheduled.has(t)||(this._scheduled.add(t),await Promise.resolve(),this._scheduled.delete(t),t.call(this))}async _updateDOM(t){this._scrollSize=t.scrollSize,this._adjustRange(t.range),this._childrenPos=t.childPositions,this._scrollError=t.scrollError||null;const{_rangeChanged:e,_itemsChanged:n}=this;this._visibilityChanged&&(this._notifyVisibility(),this._visibilityChanged=!1),(e||n)&&(this._notifyRange(),this._rangeChanged=!1),this._finishDOMUpdate()}_finishDOMUpdate(){this._connected&&(this._children.forEach(t=>this._childrenRO.observe(t)),this._checkScrollIntoViewTarget(this._childrenPos),this._positionChildren(this._childrenPos),this._sizeHostElement(this._scrollSize),this._correctScrollError(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_updateLayout(){this._layout&&this._connected&&(this._layout.items=this._items,this._updateView(),null!==this._childMeasurements&&(this._measureCallback&&this._measureCallback(this._childMeasurements),this._childMeasurements=null),this._layout.reflowIfNeeded(),this._benchmarkStart&&"mark"in window.performance&&window.performance.mark("uv-end"))}_handleScrollEvent(){if(this._benchmarkStart&&"mark"in window.performance){try{window.performance.measure("uv-virtualizing","uv-start","uv-end")}catch(t){console.warn("Error measuring performance data: ",t)}window.performance.mark("uv-start")}!1===this._scrollerController.correctingScrollError&&this._layout?.unpin(),this._schedule(this._updateLayout)}handleEvent(t){if("scroll"===t.type)(t.currentTarget===window||this._clippingAncestors.includes(t.currentTarget))&&this._handleScrollEvent();else console.warn("event not handled",t)}_handleLayoutMessage(t){"stateChanged"===t.type?this._updateDOM(t):"visibilityChanged"===t.type?(this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._notifyVisibility()):"unpinned"===t.type&&this._hostElement.dispatchEvent(new so)}get _children(){const t=[];let e=this._hostElement.firstElementChild;for(;e;)e.hasAttribute(lo)||t.push(e),e=e.nextElementSibling;return t}_updateView(){const t=this._hostElement,e=this._scrollerController?.element,n=this._layout;if(t&&e&&n){let s,i,r,o;const a=t.getBoundingClientRect();s=0,i=0,r=window.innerHeight,o=window.innerWidth;const l=this._clippingAncestors.map(t=>t.getBoundingClientRect());l.unshift(a);for(const t of l)s=Math.max(s,t.top),i=Math.max(i,t.left),r=Math.min(r,t.bottom),o=Math.min(o,t.right);const c=e.getBoundingClientRect(),h={left:a.left-c.left,top:a.top-c.top},u={width:e.scrollWidth,height:e.scrollHeight},d=s-a.top+t.scrollTop,f=i-a.left+t.scrollLeft,p=Math.max(0,r-s),m=Math.max(0,o-i);n.viewportSize={width:m,height:p},n.viewportScroll={top:d,left:f},n.totalScrollSize=u,n.offsetWithinScroller=h}}_sizeHostElement(t){const e=82e5,n=t&&null!==t.width?Math.min(e,t.width):0,s=t&&null!==t.height?Math.min(e,t.height):0;if(this._isScroller)this._getSizer().style.transform=`translate(${n}px, ${s}px)`;else{const t=this._hostElement.style;t.minWidth=n?`${n}px`:"100%",t.minHeight=s?`${s}px`:"100%"}}_positionChildren(t){t&&t.forEach(({top:t,left:e,width:n,height:s,xOffset:i,yOffset:r},o)=>{const a=this._children[o-this._first];a&&(a.style.position="absolute",a.style.boxSizing="border-box",a.style.transform=`translate(${e}px, ${t}px)`,void 0!==n&&(a.style.width=`${n}px`),void 0!==s&&(a.style.height=`${s}px`),a.style.left=void 0===i?null:`${i}px`,a.style.top=void 0===r?null:`${r}px`)})}async _adjustRange(t){const{_first:e,_last:n,_firstVisible:s,_lastVisible:i}=this;this._first=t.first,this._last=t.last,this._firstVisible=t.firstVisible,this._lastVisible=t.lastVisible,this._rangeChanged=this._rangeChanged||this._first!==e||this._last!==n,this._visibilityChanged=this._visibilityChanged||this._firstVisible!==s||this._lastVisible!==i}_correctScrollError(){if(this._scrollError){const{scrollTop:t,scrollLeft:e}=this._scrollerController,{top:n,left:s}=this._scrollError;this._scrollError=null,this._scrollerController.correctScrollError({top:t-n,left:e-s})}}element(t){return t===1/0&&(t=this._items.length-1),void 0===this._items?.[t]?void 0:{scrollIntoView:(e={})=>this._scrollElementIntoView({...e,index:t})}}_scrollElementIntoView(t){if(t.index>=this._first&&t.index<=this._last)this._children[t.index-this._first].scrollIntoView(t);else if(t.index=Math.min(t.index,this._items.length-1),"smooth"===t.behavior){const e=this._layout.getScrollIntoViewCoordinates(t),{behavior:n}=t;this._updateScrollIntoViewCoordinates=this._scrollerController.managedScrollTo(Object.assign(e,{behavior:n}),()=>this._layout.getScrollIntoViewCoordinates(t),()=>this._scrollIntoViewTarget=null),this._scrollIntoViewTarget=t}else this._layout.pin=t}_checkScrollIntoViewTarget(t){const{index:e}=this._scrollIntoViewTarget||{};e&&t?.has(e)&&this._updateScrollIntoViewCoordinates(this._layout.getScrollIntoViewCoordinates(this._scrollIntoViewTarget))}_notifyRange(){this._hostElement.dispatchEvent(new eo({first:this._first,last:this._last}))}_notifyVisibility(){this._hostElement.dispatchEvent(new no({first:this._firstVisible,last:this._lastVisible}))}get layoutComplete(){return this._layoutCompletePromise||(this._layoutCompletePromise=new Promise((t,e)=>{this._layoutCompleteResolver=t,this._layoutCompleteRejecter=e})),this._layoutCompletePromise}_rejectLayoutCompletePromise(t){null!==this._layoutCompleteRejecter&&this._layoutCompleteRejecter(t),this._resetLayoutCompleteState()}_scheduleLayoutComplete(){this._layoutCompletePromise&&null===this._pendingLayoutComplete&&(this._pendingLayoutComplete=requestAnimationFrame(()=>requestAnimationFrame(()=>this._resolveLayoutCompletePromise())))}_resolveLayoutCompletePromise(){null!==this._layoutCompleteResolver&&this._layoutCompleteResolver(),this._resetLayoutCompleteState()}_resetLayoutCompleteState(){this._layoutCompletePromise=null,this._layoutCompleteResolver=null,this._layoutCompleteRejecter=null,this._pendingLayoutComplete=null}_hostElementSizeChanged(){this._schedule(this._updateLayout)}_childLoaded(){}_childrenSizeChanged(t){if(this._layout?.measureChildren){for(const e of t)this._toBeMeasured.set(e.target,e.contentRect);this._measureChildren()}this._scheduleLayoutComplete(),this._itemsChanged=!1,this._rangeChanged=!1}}function uo(t){const e=t?parseFloat(t):NaN;return Number.isNaN(e)?0:e}function fo(t){if(null!==t.assignedSlot)return t.assignedSlot;if(null!==t.parentElement)return t.parentElement;const e=t.parentNode;return e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host||null}const po=B(class extends ft{constructor(t){if(super(t),this._virtualizer=null,this._first=0,this._last=-1,this._renderItem=(t,e)=>((t,e)=>b`${e}: ${JSON.stringify(t,null,2)}`)(t,e+this._first),this._keyFunction=(t,e)=>(t=>t)(t,this._first),this._items=[],t.type!==V)throw new Error("The virtualize directive can only be used in child expressions")}render(t){t&&this._setFunctions(t);const e=[];if(this._first>=0&&this._last>=this._first)for(let t=this._first;t<=this._last;t++)e.push(this._items[t]);return Tt(e,this._keyFunction,this._renderItem)}update(t,[e]){this._setFunctions(e);const n=this._items!==e.items;return this._items=e.items||[],this._virtualizer?this._updateVirtualizerConfig(t,e):this._initialize(t,e),n?E:this.render()}async _updateVirtualizerConfig(t,e){if(!await this._virtualizer.updateLayoutConfig(e.layout||{})){const n=t.parentNode;this._makeVirtualizer(n,e)}this._virtualizer.items=this._items}_setFunctions(t){const{renderItem:e,keyFunction:n}=t;e&&(this._renderItem=(t,n)=>e(t,n+this._first)),n&&(this._keyFunction=(t,e)=>n(t,e+this._first))}_makeVirtualizer(t,e){this._virtualizer&&this._virtualizer.disconnected();const{layout:n,scroller:s,items:i}=e;this._virtualizer=new ho({hostElement:t,layout:n,scroller:s}),this._virtualizer.items=i,this._virtualizer.connected()}_initialize(t,e){const n=t.parentNode;n&&1===n.nodeType&&(n.addEventListener("rangeChanged",t=>{this._first=t.first,this._last=t.last,this.setValue(this.render())}),this._makeVirtualizer(n,e))}disconnected(){this._virtualizer?.disconnected()}reconnected(){this._virtualizer?.connected()}});
|
|
102
171
|
/**
|
|
103
172
|
* @license
|
|
104
173
|
* Copyright 2021 Google LLC
|
|
@@ -117,5 +186,5 @@ class as{constructor(t){this._element=null;const e=t??window;this._node=e,t&&(th
|
|
|
117
186
|
* can change height dynamically.
|
|
118
187
|
* - `virtualGrid` and `virtualMasonry` still accept explicit sizes since
|
|
119
188
|
* the grid/masonry layouts need them for position pre-computation.
|
|
120
|
-
*/function ys(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const vs=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,ws=t=>"function"==typeof t,bs=t=>"AsyncFunction"===t.constructor.name,Ss=(t,e,n,s)=>{if(vs(t)){const i=t,r=oe(i(),s),o=n(r.set,e),a=n(r.update,e);return r.set=o,r.update=a,i.__subscribe(()=>{et.schedule(()=>r.set(i()))}),ct(r,()=>{o.cancel(),a.cancel()}),r}const i=oe(t,s),r=n(i.set,e),o=n(i.update,e);return i.set=r,i.update=o,ct(i,()=>{r.cancel(),o.cancel()}),i},xs="mates_storage";function Es(t,e){try{null===e?t.removeItem(xs):t.setItem(xs,JSON.stringify(e))}catch{}}function Cs(t,e){const n=oe((()=>{try{return function(t){try{const e=t.getItem(xs);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),s=n.set;n.set=function(e,i=!1){s(e,i);try{Es(t(),n.get())}catch{}};const i=n.update;return n.update=function(e,s=!1){if(null!==n.get()){i(e,s);try{Es(t(),n.get())}catch{}}},e(t=>{if(t.key===xs)if(t.newValue)try{s(JSON.parse(t.newValue))}catch{}else s(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function Ms(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const ks=Cs(()=>localStorage,t=>Ms(e=>{e.storageArea===localStorage&&t(e)})),As=Cs(()=>sessionStorage,t=>Ms(e=>{e.storageArea===sessionStorage&&t(e)})),Os=oe("undefined"!=typeof document?document.title:"");be(()=>{var t;t=Os.get(),"undefined"!=typeof document&&(document.title=t)});const Rs="mates-theme";function Ps(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}let Ts=null;function zs(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const s=10**e;return Math.round(n*s)/s}function Is(t,e,n){const s=oe(t,n),i=oe([],n);function r(){const t=s.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return i.set(n),n}const o=s.set;s.set=function(t,e=!1){o(t,e),r()};const a=s.update;s.update=function(t,e=!1){a(t,e),r()};const l=s;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>i.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===i.get().length,enumerable:!1,configurable:!0}),l.validate=r,l.toFloat=()=>zs(s.get()),l.toFloatString=()=>zs(s.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(s.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}function Ds(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function Ls(t){return null==t||("string"==typeof t||Array.isArray(t)?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"object"==typeof t&&0===Object.keys(t).length)}function js(t){const e=new Set,n=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];let s=t;for(;s&&!n.includes(s);){for(const t of Reflect.ownKeys(s))"constructor"!==t&&e.add(t);s=Object.getPrototypeOf(s)}return Array.from(e)}const Ns=t=>{const e=Z();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;j.viewOuterInProgress=!0;try{n=new t}finally{j.viewOuterInProgress=!1}const s=j.setupInProgress;try{if((()=>{js(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const s=n[t];"function"!=typeof s||s.__version__||(n[t]=s.bind(n))})})(),"function"==typeof n.setup){bs(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),j.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{j.setupInProgress=s}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{j.setupInProgress=s}return n},$s=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(Z().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function Us(t,e){let n=t;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=Object.getPrototypeOf(n)}}function Fs(t,e,n,s=!1){document.addEventListener(t,e,{capture:s}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:s})})}function Vs(t,e,n,s){let i;if("wheelUp"===t||"wheelDown"===t){const r="wheelUp"===t,o=e,a=t=>{(r?t.deltaY>=0:t.deltaY<=0)||(i&&i(),i=o(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void s.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),i&&i()})}const r="scroll"===t||"touchstart"===t||"touchmove"===t,o=e,a=t=>{i&&i(),i=o(t)};window.addEventListener(t,a,{capture:n,passive:r}),s.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),i&&i()})}function Ws(t,e){Q()||(st(),Vs(t,e,!1,Z()))}function Ys(t,e){Q()||(st(),Vs(t,e,!0,Z()))}const Hs=vn((e,n,s)=>{const i=document.createElement("div");Object.assign(i.style,{position:"fixed",inset:"0",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.5)"}),s?.style&&Object.assign(i.style,s.style),s?.onBackdropClick&&i.addEventListener("click",t=>{t.target===i&&s.onBackdropClick()});const r=document.createElement("div");s?.dialogStyle&&Object.assign(r.style,s.dialogStyle),r.addEventListener("click",t=>t.stopPropagation()),t.render(n,r),i.appendChild(r),document.body.appendChild(i);const o=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(e){t.render(e,r)},onCleanup(){i.remove(),document.body.style.overflow=o}}});function qs(t,e,n,s,i,r,o){return t.startsWith("top")?s>=n:t.startsWith("bottom")?i>=n:t.startsWith("left")?r>=e:!!t.startsWith("right")&&o>=e}const Bs=mn((e,n,s)=>{const i=e.el;let r=!1,o=n,a=s;const l=document.createElement("div");l.style.cssText="position:fixed;z-index:9999;margin:0;display:none;background:var(--md-color-surface-raised,#fff);box-shadow:var(--md-shadow-dropdown,0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12));min-width:160px;",a.style&&Object.assign(l.style,a.style),document.body.appendChild(l),t.render(o,l);const c=()=>{const t=i.getBoundingClientRect();l.style.visibility="hidden",l.style.display="block",a.matchAnchorWidth&&(l.style.width=`${t.width}px`);const e=l.offsetWidth,n=l.offsetHeight,s=function(t,e,n,s,i){const r=window.innerWidth,o=window.innerHeight,a=t.top-s,l=o-t.bottom-s,c=t.left-s,h=r-t.right-s;if("auto"===i){const t=["bottom-start","top-start","right","left"];for(const s of t)if(qs(s,e,n,a,l,c,h))return s;return"bottom-start"}if(qs(i,e,n,a,l,c,h))return i;const u=(d=i).startsWith("top")?d.replace("top","bottom"):d.startsWith("bottom")?d.replace("bottom","top"):d.startsWith("left")?d.replace("left","right"):d.startsWith("right")?d.replace("right","left"):d;var d;return qs(u,e,n,a,l,c,h)?u:i}(t,e,n,a.gap??4,a.position??"bottom-start");!function(t,e,n,s,i,r){const o=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+r:n.startsWith("top")?l=e.top-r-i:"right"===n||"left"===n?l=e.top+e.height/2-i/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-i),"bottom"===n||"top"===n?c=e.left+e.width/2-s/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-s:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-s:e.right-s:n.startsWith("right")?c=e.right+r:n.startsWith("left")&&(c=e.left-r-s),t.style.left=`${Math.max(4,Math.min(c,o-s-4))}px`,t.style.top=`${Math.max(4,Math.min(l,a-i-4))}px`}(l,t,s,e,n,a.gap??4),l.style.visibility=""},h=()=>{r&&c()},u=t=>{const e=t.target;l.contains(e)||i.contains(e)||f()},d=t=>{"Escape"===t.key&&f()},f=()=>{r=!1,l.style.display="none",a.onClose?.(i),document.removeEventListener("click",u,{capture:!0}),document.removeEventListener("keydown",d),window.removeEventListener("scroll",h,{capture:!0}),window.removeEventListener("resize",h)},p=t=>{t.stopPropagation(),r?f():(r=!0,c(),a.onOpen?.(l),document.addEventListener("click",u,{capture:!0}),document.addEventListener("keydown",d),window.addEventListener("scroll",h,{passive:!0,capture:!0}),window.addEventListener("resize",h,{passive:!0}))};return i.addEventListener("click",p),{onUpdate(e,n){o=e,a=n,t.render(e,l),n.style&&Object.assign(l.style,n.style),r&&c()},onCleanup(){r&&f(),i.removeEventListener("click",p),l.remove()}}});const Gs=vn((e,n,s)=>{const i=document.createElement("div");if(i.style.position="fixed",i.style.zIndex="9999",s?.style&&Object.assign(i.style,s.style),s?.on)for(const[t,e]of Object.entries(s.on))i.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(s?.target).appendChild(i),t.render(n,i),{onUpdate(e){t.render(e,i)},onCleanup(){i.remove()}}});let Xs=null,Zs=null,Js=null;function Qs(){return Xs||(Xs=document.createElement("div"),Xs.id="mates-tip",Xs.setAttribute("role","tooltip"),Xs.style.cssText="position:fixed;z-index:10000;pointer-events:none;padding:6px 12px;border-radius:4px;font-size:0.8rem;font-family:system-ui,-apple-system,sans-serif;font-weight:500;line-height:1.4;max-width:300px;width:max-content;background:var(--md-sys-color-inverse-surface,#2e3036);color:var(--md-sys-color-inverse-on-surface,#f0f0f8);box-shadow:0 1px 3px rgba(0,0,0,.20),0 2px 6px rgba(0,0,0,.14);letter-spacing:0.01em;white-space:nowrap;display:none;",document.body.appendChild(Xs)),Xs}const Ks=["maxWidth","padding","borderRadius","fontSize","whiteSpace"];function ti(t,e){if(e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.padding&&(t.style.padding=e.padding),e.borderRadius&&(t.style.borderRadius=e.borderRadius),e.fontSize&&(t.style.fontSize=e.fontSize),e.whiteSpace&&(t.style.whiteSpace=e.whiteSpace),e.style)for(const[n,s]of Object.entries(e.style))void 0!==s&&(t.style[n]=s)}function ei(t,e){const n={maxWidth:"300px",padding:"6px 12px",borderRadius:"4px",fontSize:"0.8rem",whiteSpace:"nowrap"};for(const s of Ks)void 0!==e[s]&&(t.style[s]=n[s]);if(e.style){for(const n of Object.keys(e.style))t.style[n]="";t.style.background="var(--md-sys-color-inverse-surface,#2e3036)",t.style.color="var(--md-sys-color-inverse-on-surface,#f0f0f8)"}}function ni(e,n){t.render("string"==typeof n?t.html`${n}`:n,e)}function si(t,e){const n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),i=s.width,r=s.height,o=window.innerWidth,a=window.innerHeight;let l;n.top-8-r>=0?(l=n.top-8-r,e.style.transformOrigin="bottom center"):(l=n.bottom+8,e.style.transformOrigin="top center");let c=n.left+n.width/2-i/2;c=Math.max(4,Math.min(c,o-i-4)),l=Math.max(4,Math.min(l,a-r-4)),e.style.left=`${c}px`,e.style.top=`${l}px`}const ii=mn((t,e,n)=>{const s=t.el;let i=e,r=n,o=null;const a=()=>{null!==Js&&(cancelAnimationFrame(Js),Js=null),null!==o&&(clearTimeout(o),o=null);const t=r.delay??150;o=setTimeout(()=>{o=null;const t=Qs();ni(t,i),ti(t,r),t.style.visibility="hidden",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",t.style.transition="none",t.style.display="block",si(s,t),requestAnimationFrame(()=>{t.style.transition="opacity 0.14s ease, transform 0.14s cubic-bezier(0.22,1,0.36,1)",t.style.visibility="visible",t.style.opacity="1",t.style.transform="scale(1) translateY(0)",Zs=s})},t)},l=()=>{if(null!==o&&(clearTimeout(o),o=null),Zs!==s)return;const t=Qs();t.style.transition="opacity 0.12s ease, transform 0.12s ease",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",Js=requestAnimationFrame(()=>{Js=requestAnimationFrame(()=>{Js=null,Zs===s&&(ei(t,r),t.style.display="none",Zs=null)})})};return s.addEventListener("mouseenter",a),s.addEventListener("mouseleave",l),s.addEventListener("focusin",a),s.addEventListener("focusout",l),s.setAttribute("aria-describedby","mates-tip"),{onUpdate(t,e){if(i=t,r=e,Zs===s){const n=Qs();ni(n,t),ti(n,e),si(s,n)}},onCleanup(){if(null!==o&&(clearTimeout(o),o=null),Zs===s){null!==Js&&(cancelAnimationFrame(Js),Js=null);const t=Qs();ei(t,r),t.style.display="none",Zs=null}s.removeEventListener("mouseenter",a),s.removeEventListener("mouseleave",l),s.removeEventListener("focusin",a),s.removeEventListener("focusout",l)}}});function ri(t,e={}){return ii(t,e)}const oi=ri,ai=1e3,li=3e4,ci=1/0;var hi,ui,di,fi,pi,mi;function gi(t){return"number"==typeof t?`${t}px`:t}class _i extends y.Directive{constructor(t){if(super(t),hi.add(this),ui.set(this,null),di.set(this,""),fi.set(this,""),pi.set(this,new Set),t.type!==y.PartType.CHILD)throw new Error("safeSVG() must be used as a child expression, e.g. html`<div>${safeSVG(markup)}</div>`")}update(e,[n,s]){if(console.log("update"),!n.trimStart().startsWith("<svg"))return console.warn("safeSVG: input does not start with <svg — nothing rendered"),F(this,hi,"m",mi).call(this,e),t.noChange;const i=JSON.stringify(s);if(null===F(this,ui,"f")||n!==F(this,di,"f")){const s=function(t){const e=document.createElement("template");e.innerHTML=t;const n=e.content.firstElementChild;return n instanceof SVGElement?n:null}(n);if(null===s)return console.warn("safeSVG: failed to parse SVG markup — nothing rendered"),F(this,hi,"m",mi).call(this,e),t.noChange;F(this,ui,"f")?.remove(),V(this,ui,s,"f"),V(this,di,n,"f"),V(this,fi,"","f"),V(this,pi,new Set,"f");const i=e.endNode;i.parentNode.insertBefore(F(this,ui,"f"),i)}if(i!==F(this,fi,"f")){const t=function(t,e){const n=new Set,s=(e,s)=>{t.setAttribute(e,s),n.add(e)},i=e.width??e.size,r=e.height??e.size;void 0!==i&&s("width",gi(i)),void 0!==r&&s("height",gi(r)),void 0!==e.fill&&s("fill",e.fill),void 0!==e.stroke&&s("stroke",e.stroke),void 0!==e.strokeWidth&&s("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&s("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&s("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&s("opacity",String(e.opacity)),void 0!==e.viewBox&&s("viewBox",e.viewBox),void 0!==e.transform&&s("transform",e.transform);const o=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&o.push(`width:${gi(a)}`),void 0!==l&&o.push(`height:${gi(l)}`),void 0!==e.color&&o.push(`color:${e.color}`),o.push("display:inline-block"),o.push("vertical-align:middle"),e.style&&o.push(e.style),s("style",o.join(";")),e.class&&s("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(s("aria-label",e.ariaLabel),s("role","img")):c&&s("aria-hidden","true"),n}(F(this,ui,"f"),s);for(const e of F(this,pi,"f"))t.has(e)||F(this,ui,"f").removeAttribute(e);V(this,pi,t,"f"),V(this,fi,i,"f")}return t.noChange}render(e,n){return t.noChange}}ui=new WeakMap,di=new WeakMap,fi=new WeakMap,pi=new WeakMap,hi=new WeakSet,mi=function(t){F(this,ui,"f")?.remove(),V(this,ui,null,"f"),V(this,di,"","f"),V(this,fi,"","f"),V(this,pi,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,s=document.createRange();s.setStartAfter(n),s.setEndBefore(e),s.deleteContents()}};const yi=y.directive(_i);function vi(t,e={}){return yi(t,e)}function wi(){const t=new Uint8Array(16);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=256*Math.random()|0;t[6]=15&t[6]|64,t[8]=63&t[8]|128;const e=Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}let bi=null,Si=null,xi=null;function Ei(t){bi=t}function Ci(t){Si=t}function Mi(){return Si}function ki(){return bi??-(new Date).getTimezoneOffset()}function Ai(){return xi??("undefined"!=typeof navigator?navigator.language:null)??"en"}function Oi(t,e){const n={};for(const s of new Intl.DateTimeFormat("en",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date(e)))"literal"!==s.type&&(n[s.type]=parseInt(s.value,10));const s=24===n.hour?0:n.hour,i=Date.UTC(n.year,n.month-1,n.day,s,n.minute,n.second);return Math.round((i-e)/6e4)||0}function Ri(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"short"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Pi(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Ti(t,e){const n=new Date(t+6e4*e);return{Y:n.getUTCFullYear(),M:n.getUTCMonth()+1,D:n.getUTCDate(),h:n.getUTCHours(),m:n.getUTCMinutes(),s:n.getUTCSeconds(),ms:n.getUTCMilliseconds(),wd:n.getUTCDay()}}const zi=t=>String(t).padStart(2,"0");function Ii(t,e,n){const s={[n]:e};return Si?s.timeZone=Si:(s.timeZone="UTC",t+=6e4*ki()),new Intl.DateTimeFormat(Ai(),s).format(new Date(t))}function Di(t,e){const n=t>=0?"+":"-",s=Math.abs(t);return e?`${n}${zi(Math.floor(s/60))}:${zi(s%60)}`:`${n}${zi(Math.floor(s/60))}${zi(s%60)}`}function Li(t){const e=t.replace(/s$/,"");if("millisecond"===e||"m"===e)return"ms";if("minute"===e)return"min";if(!new Set(["year","month","week","day","hour","min","second","ms"]).has(e))throw new RangeError(`Invalid date unit: "${t}"`);return e}function ji(){try{const t=new Intl.Locale(Ai()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const Ni=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,$i=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Ui(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(Ai(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return $i[t]||""}}function Fi(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(Ai(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function Vi(t){if(t instanceof Number)return t.valueOf();if("number"==typeof t)return t;if("string"==typeof t)return new Date(t).getTime();if(t instanceof Date)return t.getTime();if("object"==typeof t&&null!==t){const{year:e=1970,month:n=1,day:s=1,hour:i=0,minute:r=0,second:o=0,ms:a=0}=t;return Date.UTC(e,n-1,s,i,r,o,a)-6e4*ki()}return NaN}function Wi(t,e,n){const s=Li(n);if("hour"===s)return t+36e5*e;if("min"===s)return t+6e4*e;if("second"===s)return t+1e3*e;if("ms"===s)return t+e;const i=ki(),r=Ti(t,i);let o=r.Y,a=r.M,l=r.D;if("year"===s)o+=e;else if("month"===s){const t=a-1+e;o+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(o,a,0).getDate())}else l+="week"===s?7*e:e;return Date.UTC(o,a-1,l,r.h,r.m,r.s,r.ms)-6e4*i}function Yi(t,e){const n=ki(),s=Ti(t,n),i=Ti(e,n);return s.Y===i.Y&&s.M===i.M&&s.D===i.D}function Hi(t){const e=ki(),n=Ti(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function qi(t,e){const n=ki(),s=Ti(t,n),i=s.h%12||12,r=[],o=e.replace(/\[([^\]]*)\]/g,(t,e)=>(r.push(e),`\0${r.length-1}\0`));Ni.lastIndex=0;return o.replace(Ni,e=>{switch(e){case"YYYY":return String(s.Y);case"YY":return String(s.Y).slice(-2);case"MMMM":return Ii(t,"long","month");case"MMM":return Ii(t,"short","month");case"MM":return zi(s.M);case"M":return String(s.M);case"DD":return zi(s.D);case"D":return String(s.D);case"dddd":return Ii(t,"long","weekday");case"ddd":return Ii(t,"short","weekday");case"HH":return zi(s.h);case"H":return String(s.h);case"hh":return zi(i);case"h":return String(i);case"mm":return zi(s.m);case"ss":return zi(s.s);case"SSS":return r=s.ms,String(r).padStart(3,"0");case"A":return s.h>=12?"PM":"AM";case"a":return s.h>=12?"pm":"am";case"Z":return Di(n,!0);case"ZZ":return Di(n,!1);default:return e}var r}).replace(/\0(\d+)\0/g,(t,e)=>r[+e])}const Bi=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const Gi=Symbol("ts"),Xi=Object.create(Number.prototype);function Zi(t){return function(t){const e=Object.create(Xi);return e[Gi]=t,e}(void 0===t?Date.now():Vi(t))}Object.defineProperties(Xi,{valueOf:{value(){return this[Gi]},writable:!1,configurable:!1},values:{get(){const t=this[Gi],e=Ti(t,ki());return{year:e.Y,month:e.M,monthName:Fi(e.M),dayName:Ui(e.wd),date:e.D,weekStartDayName:Ui(ji()),numberOfDaysOfTheMonth:new Date(e.Y,e.M,0).getDate(),hours:e.h,minutes:e.m,seconds:e.s,milliSeconds:e.ms,timestamp:t,iso:new Date(t).toISOString()}},configurable:!1},toJSON:{value(){const t=this[Gi];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[Gi];return Number.isFinite(t)?new Intl.DateTimeFormat(Ai(),{dateStyle:"medium",...Mi()?{timeZone:Mi()}:{timeZone:"UTC"}}).format(new Date(Mi()?t:t+6e4*ki())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return qi(this[Gi],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:s="long"}=e,i=((void 0!==e.now?Vi(e.now):Date.now())-t)/1e3,r=Math.abs(i),o=i>=0?-1:1,a=new Intl.RelativeTimeFormat(Ai(),{numeric:n,style:s});for(const[t,e]of Bi)if(r>=e)return a.format(o*Math.round(r/e),t);return a.format(0,"second")}(this[Gi],t)},writable:!1,configurable:!1},add:{value(t,e){return this[Gi]=Wi(this[Gi],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[Gi]=Wi(this[Gi],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[Gi]<Vi(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[Gi]>Vi(t)},writable:!1,configurable:!1},isFuture:{value(){return this[Gi]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return Yi(this[Gi],Date.now())},writable:!1,configurable:!1},isToday:{value(){return Yi(this[Gi],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=Wi(Hi(Date.now()),-1,"day");return Yi(this[Gi],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=Wi(Hi(Date.now()),1,"day");return Yi(this[Gi],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const s=Li(n),i=t-e;if("ms"===s)return i;if("second"===s)return Math.trunc(i/1e3);if("min"===s)return Math.trunc(i/6e4);if("hour"===s)return Math.trunc(i/36e5);const r=ki(),o=Ti(t,r),a=Ti(e,r);if("day"===s||"week"===s){const n=Math.floor((t+6e4*r)/864e5)-Math.floor((e+6e4*r)/864e5);return"week"===s?Math.trunc(n/7):n}return"month"===s?12*(o.Y-a.Y)+(o.M-a.M):o.Y-a.Y}(this[Gi],Vi(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=ki(),s=Ti(t,n),i=Ti(e,n);let r=i.Y-s.Y,o=s.M,a=s.D;2===o&&29===a&&((l=i.Y)%4==0&&l%100!=0||l%400==0||(o=3,a=1));var l;return(i.M<o||i.M===o&&i.D<a)&&r--,Math.max(0,r)}(this[Gi],void 0!==t?Vi(t):Date.now())},writable:!1,configurable:!1}}),Object.defineProperty(exports,"html",{enumerable:!0,get:function(){return t.html}}),Object.defineProperty(exports,"noChange",{enumerable:!0,get:function(){return t.noChange}}),Object.defineProperty(exports,"nothing",{enumerable:!0,get:function(){return t.nothing}}),Object.defineProperty(exports,"render",{enumerable:!0,get:function(){return t.render}}),Object.defineProperty(exports,"svg",{enumerable:!0,get:function(){return t.svg}}),Object.defineProperty(exports,"unsafeHTML",{enumerable:!0,get:function(){return e.unsafeHTML}}),Object.defineProperty(exports,"asyncAppend",{enumerable:!0,get:function(){return n.asyncAppend}}),Object.defineProperty(exports,"asyncReplace",{enumerable:!0,get:function(){return s.asyncReplace}}),Object.defineProperty(exports,"litCache",{enumerable:!0,get:function(){return i.cache}}),Object.defineProperty(exports,"classMap",{enumerable:!0,get:function(){return r.classMap}}),Object.defineProperty(exports,"guard",{enumerable:!0,get:function(){return o.guard}}),Object.defineProperty(exports,"ifDefined",{enumerable:!0,get:function(){return a.ifDefined}}),Object.defineProperty(exports,"join",{enumerable:!0,get:function(){return l.join}}),Object.defineProperty(exports,"keyed",{enumerable:!0,get:function(){return c.keyed}}),Object.defineProperty(exports,"live",{enumerable:!0,get:function(){return h.live}}),Object.defineProperty(exports,"range",{enumerable:!0,get:function(){return u.range}}),Object.defineProperty(exports,"repeat",{enumerable:!0,get:function(){return d.repeat}}),Object.defineProperty(exports,"styleMap",{enumerable:!0,get:function(){return f.styleMap}}),Object.defineProperty(exports,"until",{enumerable:!0,get:function(){return p.until}}),Object.defineProperty(exports,"when",{enumerable:!0,get:function(){return m.when}}),exports.$=un,exports.Context=class{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}},exports.Delete=t=>Qe.Delete(He(t)),exports.ErrorTypes=Ye,exports.Fetch=t=>Qe.fetch(He(t)),exports.FetchClient=Je,exports.Get=t=>Qe.Get(He(t)),exports.MA={fadeIn:"mates-fade-in",fadeOut:"mates-fade-out",slideInUp:"mates-slide-in-up",slideOutUp:"mates-slide-out-up",slideInDown:"mates-slide-in-down",slideOutDown:"mates-slide-out-down",slideInLeft:"mates-slide-in-left",slideOutLeft:"mates-slide-out-left",slideInRight:"mates-slide-in-right",slideOutRight:"mates-slide-out-right",scaleIn:"mates-scale-in",scaleOut:"mates-scale-out",springIn:"mates-spring-in",flipInX:"mates-flip-in-x",flipInY:"mates-flip-in-y",blurIn:"mates-blur-in",blurOut:"mates-blur-out",shake:"mates-shake",pulse:"mates-pulse",bounce:"mates-bounce",spin:"mates-spin"},exports.NotificationManager=q,exports.Patch=t=>Qe.Patch(He(t)),exports.Post=t=>Qe.Post(He(t)),exports.Put=t=>Qe.Put(He(t)),exports.Router=(e,n)=>{const s=e.find(t=>Ae(t.path));if(void 0===s)return n?()=>Ee(n):()=>t.nothing;const{component:i}=s;return ut(i),()=>Ee(i)},exports.SyncNotificationManager=B,exports.ZeroPromise=Xt,exports._=at,exports._subToView=lt,exports.action=function(t){N("Action");let e=t;const n=new Set;let s=null,i=null;const r=t=>{n.forEach(e=>{try{e(t)}catch(t){console.error(t)}})};return Object.assign(function(...t){return((t,n)=>{try{let o;return o=s?s((...n)=>e.call(t,...n),...n):e.call(t,...n),i&&(o=i(o)),r(o),o}catch(t){const e=t instanceof Error?t:new Error(String(t));throw r(void 0),e}})(this,t)},{val:()=>e,set:t=>{e=t},__isAction___:!0,__subscribe:t=>(N("subscribe"),n.add(t),()=>n.delete(t)),interceptBefore:t=>{s=t},interceptAfter:t=>{i=t}})},exports.addStoreBeingRead=R,exports.animatedIf=fn,exports.animatedRouter=function(t,e={}){return Ee(Oe,{routes:t,options:e})},exports.animatedX=function(e,n,s){const{show:i,...r}=s;return fn(i,t.html`<x-view .view=${e} .props=${n}></x-view>`,t.nothing,r)},exports.arrayRange=function(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const s=[];if(n>0)for(let i=t;i<e;i+=n)s.push(i);else for(let i=t;i>e;i+=n)s.push(i);return s},exports.assertComponentOuterContext=$,exports.assertNotInRestrictedContext=N,exports.asyncAction=fe,exports.atom=oe,exports.attr=function(t){return gn(t)},exports.blurInPreset=function(t=10,e=400,n="ease-out"){return{keyframes:[{filter:`blur(${t}px)`,opacity:0},{filter:"blur(0px)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.blurOutPreset=function(t=10,e=400,n="ease-in"){return{keyframes:[{filter:"blur(0px)",opacity:1},{filter:`blur(${t}px)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.bouncePreset=function(t=600){return{keyframes:[{transform:"translateY(0)",offset:0},{transform:"translateY(-30%)",offset:.3},{transform:"translateY(0)",offset:.5},{transform:"translateY(-15%)",offset:.7},{transform:"translateY(0)",offset:.85},{transform:"translateY(-5%)",offset:.95},{transform:"translateY(0)",offset:1}],options:{duration:t,easing:"ease",fill:"both"}}},exports.buildPath=Re,exports.buildRequestUrl=qe,exports.cacheAtom=function(t){const e=new Map,n=new Map,s=oe(e,t),i=s.get.bind(s),r=s;return r.add=(t,i,r)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),s.update(e=>{e.set(t,i)}),void 0!==r&&-1!==r&&r>0){const i=setTimeout(()=>{e.delete(t),n.delete(t),s.update(()=>{})},r);n.set(t,i)}},r.get=t=>(i(),e.get(t)),r.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),s.update(()=>{}),!0),r.has=t=>(i(),e.has(t)),r.getAll=()=>(i(),Array.from(e.values())),r.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),s.update(()=>{})},Object.defineProperty(r,"size",{get:()=>(i(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(r,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),ct(s,r.clearAll),r},exports.cacheFn=ue,exports.chunk=function(t,e){if(e<1)return[];const n=[];for(let s=0;s<t.length;s+=e)n.push(t.slice(s,s+e));return n},exports.clamp=function(t,e,n){return Math.min(Math.max(t,e),n)},exports.classes=function(t){return _n(t)},exports.cleanupScheduler=tt,exports.clearInterceptors=()=>{Ge.clear(),Xe.clear(),Ze.clear()},exports.collapseWidthPreset=function(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"auto",overflow:"hidden"},{width:"0",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}},exports.componentRunningStatus=j,exports.computeAutoPlacement=function(t,e,n,s){const i=window.innerHeight-t.bottom-s,r=t.top-s,o=window.innerWidth-t.right-s,a=t.left-s;return i>=n?"bottom":r>=n?"top":o>=e?"right":a>=e?"left":[["bottom",i],["top",r],["right",o],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]},exports.configureCSS=function(t){t.breakpoints&&Object.assign(St,t.breakpoints)},exports.createCacheManager=ue,exports.createManagedTimer=Zt,exports.createPollingManager=de,exports.createReactiveRunner=ie,exports.createTimedAtom=Ss,exports.date=Zi,exports.debounce=_e,exports.debouncedAtom=(t,e,n)=>Ss(t,e,_e,n),exports.deepClone=function t(e,n=new WeakMap){if("function"==typeof structuredClone)return structuredClone(e);if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){const s=new Map;return n.set(e,s),e.forEach((e,i)=>s.set(t(i,n),t(e,n))),s}if(e instanceof Set){const s=new Set;return n.set(e,s),e.forEach(e=>s.add(t(e,n))),s}if(Array.isArray(e)){const s=[];n.set(e,s);for(let i=0;i<e.length;i++)s[i]=t(e[i],n);return s}const s=n.get(e);if(s)return s;const i={};n.set(e,i);for(const s of Object.keys(e))i[s]=t(e[s],n);return i},exports.deepFreeze=ee,exports.deleteAction=t=>Qe.deleteAction(t),exports.df=ee,exports.dialog=function(t,e){return Hs(t,e)},exports.effect=be,exports.effectScheduler=et,exports.eleHook=mn,exports.event=t=>{N("event");const e=t||Math.random().toString(36).substring(2,15),n=new B;return{trigger:t=>{x(e,t),n.trigger(t)},__subscribe:t=>n.subscribe(t),name:e,__isEvent___:!0}},exports.expandWidthPreset=function(t=500,e="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{width:"0",overflow:"hidden"},{width:"auto",overflow:"hidden"}],options:{duration:t,easing:e,fill:"both"}}},exports.fadeInPreset=Jt,exports.fadeOutPreset=Qt,exports.fetchAction=t=>Qe.fetchAction(t),exports.fetchClient=Qe,exports.flipInPreset=function(t="y",e=500,n="ease-out"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(90deg)`,opacity:0},{transform:`${s}(0deg)`,opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.flipOutPreset=function(t="y",e=500,n="ease-in"){const s="x"===t?"rotateX":"rotateY";return{keyframes:[{transform:`${s}(0deg)`,opacity:1},{transform:`${s}(90deg)`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.formAtom=(t,e=[],n)=>Is(t,e,n),exports.get=function(t,e,n){const s=e.replace(/\[(\d+)]/g,".$1").split(".");let i=t;for(const t of s){if(null==i)return n;i=i[t]}return void 0===i?n:i},exports.getAction=t=>Qe.getAction(t),exports.getAllProps=js,exports.getAllTimezones=function(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:Pi(t,e),shortName:Ri(t,e),offset:Oi(t,e)}))},exports.getCalendar=function(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||e<1||e>12)throw new RangeError("getCalendar(year, month): month must be integer 1–12");const n=Zi({year:t,month:e,day:1}),{year:s,month:i,numberOfDaysOfTheMonth:r}=n.values,o=[];for(let t=Ti(n.valueOf(),ki()).wd;t>0;t--)o.push(Zi({year:s,month:i,day:1-t}));for(let t=1;t<=r;t++)o.push(Zi({year:s,month:i,day:t}));const a=o.length%7,l=0===a?0:7-a,c=Zi({year:s,month:i,day:r});for(let t=0;t<l;t++)c.add(1,"day"),o.push(Zi(c.valueOf()));const h=[];for(let t=0;t<o.length;t+=7)h.push(o.slice(t,t+7));return h},exports.getCoords=function(t,e,n){switch(e){case"top":case"top-start":return{top:t.top-n,left:t.left};case"top-end":return{top:t.top-n,left:t.right};case"bottom":case"bottom-start":default:return{top:t.bottom+n,left:t.left};case"bottom-end":return{top:t.bottom+n,left:t.right};case"right":case"right-start":return{top:t.top,left:t.right+n};case"right-end":return{top:t.bottom,left:t.right+n};case"left":case"left-start":return{top:t.top,left:t.left-n};case"left-end":return{top:t.bottom,left:t.left-n}}},exports.getCurrentHost=Z,exports.getLocale=function(){return Ai()},exports.getMonths=function(t){const e=t??Ai(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),s=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),i=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));i.push({number:t,name:n.format(e),shortName:s.format(e)})}return i},exports.getParentScope=$s,exports.getScope=$s,exports.getStoresBeingRead=function(){return M},exports.getTimezoneOffset=function(){return ki()},exports.globalCSS=Ht,exports.globalScheduler=nt,exports.globalTheme=function(t){const e=Object.keys(t);if(0===e.length)throw new Error("[globalTheme] themes object must have at least one entry.");const n=e[0],s=e[1],i=t[n],r=[];r.push(en(":root",i));for(const n of e)r.push(en(`[data-theme="${n}"]`,t[n]));void 0!==s&&r.push(function(t){let e="";for(const n in t)e+=` ${tn(n)}: ${t[n]};\n`;return e?`@media (prefers-color-scheme: dark) {\n :root:not([data-theme]) {\n${e} }\n}`:""}(t[s])),Yt();const o=Wt(),a=r.filter(Boolean).join("\n");a&&o.appendRules(a);const l=Object.create(null);for(const t in i)l[t]=tn(t);const c=Object.freeze(l),h=function(){try{return localStorage.getItem(Ke)}catch{return null}}(),u=new Set(["auto",...e]),d=oe(null!==h&&u.has(h)?h:"auto",{skipRestrictedContextCheck:!0});return Object.defineProperty(d,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),be(()=>{const t=d();!function(t){"undefined"!=typeof document&&("auto"===t?document.documentElement.removeAttribute("data-theme"):document.documentElement.setAttribute("data-theme",t))}(t),function(t){try{"auto"===t?localStorage.removeItem(Ke):localStorage.setItem(Ke,t)}catch{}}(t)}),{cssVars:c,themeAtom:d}},exports.groupBy=function(t,e){const n={};for(const s of t){const t=String(e(s));n[t]||(n[t]=[]),n[t].push(s)}return n},exports.hashAtom=Te,exports.htmlHook=vn,exports.iAtom=ae,exports.injectMatesAnimations=Gt,exports.installDevToolsHooks=function(t){t.registerComponent&&(w.registerComponent=t.registerComponent),t.unregisterComponent&&(w.unregisterComponent=t.unregisterComponent),t.notifyRender&&(w.notifyRender=t.notifyRender),t.getComponentName&&(w.getComponentName=t.getComponentName),t.logComponentMount&&(w.logComponentMount=t.logComponentMount),t.logComponentRender&&(w.logComponentRender=t.logComponentRender),t.logComponentUnmount&&(w.logComponentUnmount=t.logComponentUnmount),t.logAtomSet&&(w.logAtomSet=t.logAtomSet),t.logAtomUpdate&&(w.logAtomUpdate=t.logAtomUpdate),t.logEventTrigger&&(w.logEventTrigger=t.logEventTrigger),t.logCleanupEventTrigger&&(w.logCleanupEventTrigger=t.logCleanupEventTrigger),t.logFetchRequest&&(w.logFetchRequest=t.logFetchRequest),t.logFetchResponse&&(w.logFetchResponse=t.logFetchResponse),t.logFetchError&&(w.logFetchError=t.logFetchError),t.recordRender&&(w.recordRender=t.recordRender)},exports.interceptAfter=t=>Be(Xe,t),exports.interceptBefore=t=>Be(Ge,t),exports.interceptError=t=>Be(Ze,t),exports.isAction=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,exports.isApiResponseSuccess=function(t){return t>=200&&t<300},exports.isAsyncAction=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,exports.isAsyncFunction=bs,exports.isAsyncValue=ut,exports.isAtom=vs,exports.isChannel=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,exports.isConfirmationEvent=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,exports.isDefinedAsGetter=function(t,e){let n=Object.getOwnPropertyDescriptor(t,e),s=Object.getPrototypeOf(t);for(;!n&&s&&s!==Object.prototype;)n=Object.getOwnPropertyDescriptor(s,e),s=Object.getPrototypeOf(s);return n?.get&&"function"==typeof n.get?n.get:null},exports.isDevToolsInstalled=function(){return w.registerComponent!==v},exports.isEffectRunning=O,exports.isEmail=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",exports.isEmpty=Ls,exports.isEvent=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,exports.isFunction=ws,exports.isGetter=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,exports.isInRestrictedContext=function(){return!j.isHookRunning&&(j.templateInProgress||O())},exports.isMax=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`,exports.isMin=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,exports.isPathMatching=Ae,exports.isPattern=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,exports.isReadTrackingEnabled=A,exports.isRequired=t=>(t=>"number"==typeof t||"boolean"==typeof t||!Ls(t))(t)?null:"Required",exports.isSSR=Q,exports.isSetter=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,exports.isUnit=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,exports.iterateDeeply=function t(e,n){if(null==e||"object"!=typeof e)return;const s=Array.isArray(e)?e.map((t,e)=>e):Object.keys(e);for(const i of s){const s=n(i,e[i],e);void 0!==s&&(e[i]=s);const r=e[i];null!==r&&"object"==typeof r&&t(r,n)}},exports.keyframes=function(t,e){Lt("keyframes"),Yt();const n=Nt(t);return Ft.appendRules($t(n,e)),n},exports.lazyLoad=function(t,e){return bn(t,e)},exports.location=$e,exports.lockNavigation=()=>Me.set(!0),exports.logError=U,exports.lsAtom=ks,exports.mapAtom=(t=[],e)=>{const n=new Map(t),s=oe(n,e),i=n.set.bind(n);n.set=(t,e)=>(i(t,e),s.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return s.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),s.update(()=>{})};const a=n.get.bind(n);n.get=t=>(s.get(),a(t));const l=n.has.bind(n);n.has=t=>(s.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(s.get(),h());const u=n.values.bind(n);n.values=()=>(s.get(),u());const d=n.keys.bind(n);n.keys=()=>(s.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),p()),n.update=t=>{const e={set:(t,n)=>(i(t,n),e),delete:t=>r(t),clear:()=>{o()},get:t=>a(t),has:t=>l(t),entries:()=>h(),values:()=>u(),keys:()=>d(),forEach:(t,e)=>f(t,e),[Symbol.iterator]:()=>p(),get size(){return c.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>{const i=a(t);return null==i||"object"!=typeof i||(e(i),s.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},exports.masonryGrid=function(t,e,n,s){return En(t,e,n,s)},exports.maxLength=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,exports.memo=function(t){let e;return ie({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=oe(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e},exports.memoTemplate=function(t,e){return An(t,e)},exports.merge=function t(e,...n){const s={...e};for(const e of n)for(const n of Object.keys(e))Ds(s[n])&&Ds(e[n])?s[n]=t(s[n],e[n]):s[n]=e[n];return s},exports.minLength=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,exports.navigateTo=function(t,e,n){Me()||(e?window.history.replaceState(n,"",t):window.history.pushState(n,"",t),ke.set(t))},exports.navigationLocked=Me,exports.omit=function(t,e){const n={...t};for(const t of e)delete n[t];return n},exports.on=function(t){return Ln(t)},exports.onAllMount=t=>{st(),t.__isOnAllMount__=!0;const e=Z();e.addToCleanUps(t,it),nt.onceIdle(()=>{if(!e.isConnected)return;const n=t();n&&e.addToCleanUps(t,n)})},exports.onBlur=t=>{Ws("blur",t)},exports.onCleanup=t=>{st(),t.__isOnCleanup__=!0;Z().addToCleanUps(t,t)},exports.onClickAway=t=>{if(Q())return;st();const e=Z(!0),n=n=>{const s=n.target;s&&!e.contains(s)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},exports.onConnect=function(t){return Sn(t)},exports.onCopy=t=>{Ws("copy",t)},exports.onCut=t=>{Ws("cut",t)},exports.onDOMReady=t=>{const e=Z();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},exports.onDisconnect=function(t){return xn(t)},exports.onError=t=>{st();const e=Z();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},exports.onFileDrop=t=>{if(Q())return;st();const e=Z();let n;const s=t=>t.preventDefault(),i=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",s),window.addEventListener("drop",i),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",s),window.removeEventListener("drop",i),n&&n()})},exports.onFocus=t=>{Ws("focus",t)},exports.onHidden=function(t,e){return wn({onHidden:t,...e})},exports.onIntersect=function(t){return wn(t)},exports.onInterval=(t,e)=>{if(Q())return;st();const n=Z();let s;const i=setInterval(()=>{s&&s(),s=t()},e);n.addToCleanUps(t,()=>{clearInterval(i),s&&s()})},exports.onKeyDown=t=>{Ws("keydown",t)},exports.onKeyUp=t=>{Ws("keyup",t)},exports.onMount=rt,exports.onNavigate=t=>{if(Q())return;st();const e=Z();let n;const s=ke.__subscribe(()=>{n&&n(),n=t(ke.get())||null});e.addToCleanUps(t,()=>{s(),n&&n()})},exports.onOffline=t=>{Ws("offline",t)},exports.onOnline=t=>{Ws("online",t)},exports.onPaint=t=>{st(),t.__isOnPaint__=!0;const e=Z();e.addToCleanUps(t,it),e.PaintEvent.__subscribe(()=>t())},exports.onParent=function(t,e){return jn(t,e)},exports.onPaste=t=>{Ws("paste",t)},exports.onReferenceChange=(t,e)=>{const n=Z();if(st(),!n)throw new Error("onReferenceChange must be called inside a component");let s=[];t(),s=e(),n.onEachUpdate(()=>{const n=e();s.some((t,e)=>t!==n[e])&&(t(),s=n)})},exports.onResize=(t,e)=>{if(Q())return;st();const n=Z();let s;const i=new ResizeObserver(e=>{for(const n of e)s&&s(),s=t(n)}),r=e||n;i.observe(r),n.addToCleanUps(t,()=>{i.disconnect(),s&&s()})},exports.onScroll=(t,e=window)=>{if(Q())return;st();const n=Z();let s;const i=e=>{s&&s(),s=t(e)};e.addEventListener("scroll",i,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",i),s&&s()})},exports.onScrolledIntoView=function(t,e){return bn(t,e)},exports.onSelectionChange=t=>{if(Q())return;st();let e;Fs("selectionchange",()=>{e&&e(),e=t(window.getSelection())},Z())},exports.onSocket=function(t,e){st();const n=Z(),s=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{s.forEach(t=>t())})},exports.onStorageChange=t=>{Ws("storage",t)},exports.onTimeout=(t,e)=>{if(Q())return;st();const n=Z();let s;const i=setTimeout(()=>{s=t()},e);n.addToCleanUps(t,()=>{clearTimeout(i),s&&s()})},exports.onUpdate=t=>{st();const e=Z();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},exports.onVisibilityChange=t=>{if(Q())return;st();let e;Fs("visibilitychange",()=>{e&&e(),e=t(document.hidden)},Z())},exports.onVisible=function(t,e){return wn({onVisible:t,...e})},exports.onWindow=Ws,exports.onWindowCapture=Ys,exports.onWindowResize=t=>{Ws("resize",t)},exports.onWindowScroll=t=>{Ys("scroll",t)},exports.paginatedAsyncAction=function(t,e){const n=!!e?.allowInRestrictedContext,s=fe(t,e),i=oe(1,{skipRestrictedContextCheck:n}),r=oe(-1,{skipRestrictedContextCheck:n});return Object.assign(s,{page:i,totalPages:r,next:(...t)=>{if(!(-1!==r.val&&i.val>=r.val))return i.update(t=>t+1),s(...t)}})},exports.paginationAtom=(t=1,e)=>{const n=oe(t,e),s=n;return s.next=()=>{n.set(t=>t+1)},s.prev=()=>{n.set(t=>t>1?t-1:t)},s.reset=()=>{n.set(1)},Object.defineProperty(s,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(s,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),s},exports.patchAction=t=>Qe.patchAction(t),exports.pathAtom=ke,exports.pick=function(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n},exports.placementTransform=function(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""},exports.popEffect=T,exports.popup=function(t,e){return Bs(t,"string"==typeof e?{position:e}:e??{})},exports.portal=function(t,e){return Gs(t,e)},exports.postAction=t=>Qe.postAction(t),exports.pulsePreset=function(t=1.05,e=400){return{keyframes:[{transform:"scale(1)"},{transform:`scale(${t})`},{transform:"scale(1)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}},exports.pushEffect=P,exports.putAction=t=>Qe.putAction(t),exports.qsAtom=Le,exports.randomId=wi,exports.ref=Se,exports.registerCleanup=ct,exports.removeAttr=function(t){},exports.removeClasses=function(t){},exports.removeOn=function(t){In.get(t)?.()},exports.removeStyle=function(t){},exports.renderSwitch=function(e){for(const t of e){if(!Array.isArray(t))return t;{const[e,n]=t;if(e)return n}}return t.nothing},exports.renderX=(e,n,s={})=>t.render(Ee(e,s),n),exports.resetComponentState=K,exports.resolveAsyncValue=dt,exports.restoreTracking=I,exports.rootCSS=function(t){Yt();const e=Wt(),n=en(":root",t);n&&e.appendRules(n)},exports.route=(e,{view:n})=>Ae(e)?n?Ce(n,{}):t.nothing:null,exports.safeSVG=vi,exports.safetyCheck=st,exports.saveAndEnableTracking=z,exports.scaleInPreset=function(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:`scale(${t})`,opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:e,easing:n,fill:"both"}}},exports.scaleOutPreset=function(t=0,e=300,n="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"scale(1)",opacity:1},{transform:`scale(${t})`,opacity:0}],options:{duration:e,easing:n,fill:"both"}}},exports.scope=Ns,exports.setAtom=(t=[],e)=>{const n=new Set(t),s=oe(n,e),i=n.add.bind(n);n.add=t=>(i(t),s.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return s.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),s.update(()=>{})};const a=n.has.bind(n);n.has=t=>(s.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(s.get(),c());const h=n.values.bind(n);n.values=()=>(s.get(),h());const u=n.keys.bind(n);n.keys=()=>(s.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),f()),n.update=t=>{const e={add:t=>(i(t),e),delete:t=>r(t),clear:()=>{o()},has:t=>a(t),entries:()=>c(),values:()=>h(),keys:()=>u(),forEach:(t,e)=>d(t,e),[Symbol.iterator]:()=>f(),get size(){return l.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),s.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},exports.setLocale=function(t){xi=t??null},exports.setRef=xe,exports.setSSRApiLookup=function(t){Ue=t},exports.setSSRMode=function(t){J=t},exports.setSSRRequest=function(t){Fe=t},exports.setTimezone=function(t){null==t?(Ei(null),Ci(null)):(Ei(t.offset),Ci(t.name))},exports.setTimezoneOffset=function(t){Ei(t),Ci(null)},exports.setter=ot,exports.shakePreset=function(t=10,e=400){return{keyframes:[{transform:"translateX(0)"},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:`translateX(-${t}px)`},{transform:`translateX(${t}px)`},{transform:"translateX(0)"}],options:{duration:e,easing:"ease-in-out",fill:"both"}}},exports.signal=ae,exports.slideInPreset=function(t="up",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:e?te(t,e):Kt[t],opacity:0},{transform:"translate(0, 0)",opacity:1}],options:{duration:n,easing:s,fill:"both"}}},exports.slideOutPreset=function(t="down",e,n=400,s="cubic-bezier(0.4, 0, 0.2, 1)"){return{keyframes:[{transform:"translate(0, 0)",opacity:1},{transform:e?te(t,e):Kt[t],opacity:0}],options:{duration:n,easing:s,fill:"both"}}},exports.spinPreset=function(t=1,e=600,n="linear"){return{keyframes:[{transform:"rotate(0deg)"},{transform:`rotate(${360*t}deg)`}],options:{duration:e,easing:n,fill:"both"}}},exports.springInPreset=function(t=500,e="cubic-bezier(0.34, 1.56, 0.64, 1)"){return{keyframes:[{transform:"scale(0)",opacity:0},{transform:"scale(1)",opacity:1}],options:{duration:t,easing:e,fill:"both"}}},exports.ssAtom=As,exports.startTracking=D,exports.stopTracking=L,exports.style=function(t){return Nn(t)},exports.stylesheet=function(){Lt("stylesheet");const t=new Ut;return{css:function(e){Lt("css");const n=[],s=Mt(e,n);return n.length>0&&t.appendRules(n.join("\n")),kt(s)},mount:function(){if(function(t){if(j.templateInProgress)throw new Error(`[css-in-js] ${t}() must not be called inside a template function. Call it in the component outer function or at module level.`)}("mount"),null===Z(!1))return t.mount(),()=>t.unmount();rt(()=>(t.mount(),()=>t.unmount()))},keyframes:function(e,n){return Lt("keyframes"),t.keyframes(e,n)}}},exports.superAtom=le,exports.taskAction=function(t){N("taskAction");const e=[];let n=0,s=1,i=!1;const r={skipRestrictedContextCheck:!0},o=oe([],r),a=oe("idle",r),l=oe(0,r);function c(){if(o.set([...e]),0===e.length)return void l.set(0);let t=0;for(const n of e)"running"===n.status?t+=.5:"pending"!==n.status&&(t+=1);l.set(Math.round(t/e.length*100))}function h(){if(i){return void(e.some(t=>"running"===t.status)||a.set("idle"))}if("running"!==a.get())return;const n=e.filter(t=>"running"===t.status).length,r=e.filter(t=>"pending"===t.status);if(0===r.length&&0===n)return void a.set("idle");const o=-1===s?r.length:Math.max(0,s-n);0!==o&&r.slice(0,o).forEach(e=>function(e){const n=new AbortController;e.status="running",e.abortController=n;const s=t(e.input,n.signal);if(s?.__isZeroPromise__){const t=s;e.abortController={signal:t.signal,abort:()=>{t.cancel()}}}c(),Promise.resolve(s).then(t=>{"cancelled"===e.status||(e.status="success",e.result.data=t),e.abortController=null,c(),h()}).catch(t=>{if("cancelled"===e.status||!0===e.abortController?.signal?.aborted)e.status="cancelled",e.abortController=null;else{const n=t instanceof Error?t:new Error(String(t));e.status="failed",e.result.error=n,e.abortController=null,U(n,"taskAction")}c(),h()})}(e))}function u(t){return{id:++n,input:t,status:"pending",result:{data:null,error:null},abortController:null}}function d(t){const n=Array.isArray(t)?t:[t];for(const t of n)e.push(u(t));c(),"running"!==a.get()||i||h()}function f(t=1){"running"!==a.get()&&(s=t,i=!1,a.set("running"),h())}function p(){i=!0,function(){for(const t of e)"running"===t.status&&(t.status="cancelled",t.abortController?.abort(),t.abortController=null)}(),a.set("idle"),c()}function m(t){p(),e.length=0,n=0,c(),d(t)}const g={add:d,start:f,pause:function(){i||(i=!0)},stop:p,delete:function(t){const n=Array.isArray(t)?t:[t],s=new Set(n.map(t=>t.id));for(let t=e.length-1;t>=0;t--){const n=e[t];s.has(n.id)&&("running"===n.status&&(n.status="cancelled",n.abortController?.abort(),n.abortController=null),e.splice(t,1))}c(),"running"!==a.get()||i||h()},clearAndAdd:m,addAndStart:function(t,e=1){d(t),f(e)},clearAndStart:function(t,e=1){m(t),f(e)},isRunning:function(){return"running"===a.val},progress:l,tasks:o,pendingTasks:function(){return o.val.filter(t=>"pending"===t.status)},runningTasks:function(){return o.val.filter(t=>"running"===t.status)},successTasks:function(){return o.val.filter(t=>"success"===t.status)},failedTasks:function(){return o.val.filter(t=>"failed"===t.status)},cancelledTasks:function(){return o.val.filter(t=>"cancelled"===t.status)},__isTaskAction__:!0};return ct(g,p),g},exports.themeAtom=function(){if(Ts)return Ts;const t=oe(function(){try{const t=localStorage.getItem(Rs);return"light"===t||"dark"===t||"auto"===t?t:null}catch{return null}}()??"auto",{skipRestrictedContextCheck:!0}),e=t;return e.setToLight=()=>{t.set("light")},e.setToDark=()=>{t.set("dark")},e.setToAuto=()=>{t.set("auto")},e.toggle=()=>{const e=Ps(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>Ps(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),be(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",Ps(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(Rs):localStorage.setItem(Rs,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),Ts=e,e},exports.throttle=ye,exports.throttledAtom=(t,e,n)=>Ss(t,e,ye,n),exports.timer=function(t,e){return $n(t,e)},exports.tip=oi,exports.titleAtom=Os,exports.tooltip=ri,exports.trackAndSubscribe=ne,exports.uniqBy=function(t,e){const n=new Set,s=[];for(const i of t){const t=e(i);n.has(t)||(n.add(t),s.push(i))}return s},exports.unlockNavigation=()=>Me.set(!1),exports.unsafeSVG=vi,exports.unwrapModule=ft,exports.useContext=function(t){let e=null;const n=new CustomEvent("request-context",{bubbles:!0,composed:!0,detail:{context:t,resolve(t=null){e=t}}});return Z().dispatchEvent(n),e},exports.useScope=Ns,exports.useState=t=>{const e=Z();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=oe(t),s=((t,e,n)=>{const s=js(t);s.forEach(s=>{const i=Us(t,s);if(i?.get){let n,r=-1;const o=i.get;Object.defineProperty(t,s,{get(){const s=e.__version__;return s!==r&&(r=s,n=o.call(t)),n},configurable:!0,enumerable:i.enumerable})}else if(ws(t[s])){if(bs(t[s]))throw new Error(`Async functions are not supported inside ${n}`);const i=t[s];t[s]=(...n)=>{e.update(()=>i.apply(t,n))}}});const i=Object.create(t);return s.forEach(n=>{const s=Us(t,n);if(!s)return;const r=!!s.get,o=!r&&ws(s.value);r||o||Object.defineProperty(i,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),i})(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[s,n.update]},exports.useStore=function(t){return lt(t,!0),t},exports.uuid=wi,exports.validateAll=function(t){const e=[],n={},s=new WeakSet;return function t(i,r){if(null==i)return;const o=typeof i;if("object"!==o&&"function"!==o)return;if(s.has(i))return;if(s.add(i),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(i)){const t=i.validate();return void(t.length>0&&(e.push(...t),n[r]=t))}if(Array.isArray(i)){for(let e=0;e<i.length;e++){const n=r?`${r}[${e}]`:`[${e}]`;t(i[e],n)}return}const a=Object.keys(i);for(const e of a){const n=r?`${r}.${e}`:e;t(i[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}},exports.validateReactiveFunction=se,exports.view=Ce,exports.virtualGrid=function(t,e,n,s){const{keyFn:i,template:r,opts:o}=ys(e,n,s),a={direction:o.direction??"vertical",itemSize:{width:o.itemWidth,height:o.itemHeight},gap:o.gap??"8px",flex:o.flex??!1,...o.pin?{pin:o.pin}:{}};return _s({items:t,renderItem:r,keyFunction:i,scroller:o.scroller,layout:(l=a,Object.assign({type:es},l))});var l},exports.virtualList=function(t,e,n,s){const{keyFn:i,template:r,opts:o}=ys(e,n,s),a={direction:o?.direction??"vertical",...o?.pin?{pin:o.pin}:{}};return _s({items:t,renderItem:r,keyFunction:i,scroller:o?.scroller,layout:Yn(a)})},exports.virtualMasonry=function(t,e,n,s){const{keyFn:i,template:r,opts:o}=ys(e,n,s),a={direction:o.direction??"vertical",getAspectRatio:o.getAspectRatio,gap:o.gap??"8px",flex:!0,...o.itemSize?{itemSize:o.itemSize}:{},...o.pin?{pin:o.pin}:{}};return _s({items:t,renderItem:r,keyFunction:i,scroller:o.scroller,layout:(l=a,Object.assign({type:ss},l))});var l},exports.watch=(t,e)=>{t.__isOn__=!0,N("on");const n=new Set;let s;const i=()=>{if(s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}const e=t();"function"==typeof e&&(s=e)},r=()=>et.schedule(i);e.forEach(t=>{n.add(t.__subscribe(r))});const o=()=>{if(n.forEach(t=>t()),s){try{s()}catch(t){console.error("Error in on() cleanup:",t)}s=void 0}};return ct(t,o),o},exports.withHost=X,exports.withStaggerPreset=function(t,e,n=50){return{keyframes:t.keyframes,options:{...t.options,delay:(t.options.delay??0)+e*n}}},exports.ws=function(t,e={}){$("ws");const{reconnect:n=!0,reconnectDelay:s=ai,reconnectMaxDelay:i=li,reconnectMaxAttempts:r=ci,protocols:o,auth:a,autoConnect:l=!0}=e,c=oe("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=s,p=null,m=!1;const g=[];function _(){null!==p&&(clearTimeout(p),p=null)}function y(){let e;m=!1,_(),c.set("connecting");try{e=function(){if(!a)return t;const e=a(),n=Object.entries(e);if(0===n.length)return t;const s=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${s}`:`${t}?${s}`}()}catch(t){return U(t),void c.set("error")}try{u=o?new WebSocket(e,o):new WebSocket(e)}catch(t){return U(t),c.set("error"),void v()}u.onopen=()=>{m?u?.close():(d=0,f=s,c.set("connected"),function(){for(;g.length>0;){const t=g.shift();u?.readyState===WebSocket.OPEN&&u.send(t)}}())},u.onmessage=t=>{if(m)return;const e="string"==typeof t.data?t.data:String(t.data);let n;try{n=JSON.parse(e)}catch{n=e}var s;s=n,h.forEach(t=>{try{t(s)}catch(t){U(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),v())}}function v(){if(!n||m)return;if(d>=r)return;d++;const t=f;f=Math.min(2*f,i),p=setTimeout(()=>{m||y()},t)}function w(){m=!0,_(),u&&(u.onopen=null,u.onmessage=null,u.onerror=null,u.onclose=null,u.readyState!==WebSocket.OPEN&&u.readyState!==WebSocket.CONNECTING||u.close(1e3,"client disconnect"),u=null),c.set("disconnected"),h.clear(),g.length=0}const b={send:function(t){const e="string"==typeof t?t:JSON.stringify(t);u?.readyState===WebSocket.OPEN?u.send(e):g.push(e)},__subscribe:function(t){return h.add(t),()=>h.delete(t)},status:c,connect:y,disconnect:w,__isWs___:!0};return l?y():c.set("disconnected"),ct(b,w),b},exports.x=Ee,exports.xTabEvent=t=>{N("xTabEvent");const e=new Set,n=n=>{e.forEach(e=>{try{e(n)}catch(e){U(e,`xTabEvent(${t}) handler`)}})},s="undefined"!=typeof BroadcastChannel?new BroadcastChannel(t):null;s&&(s.onmessage=t=>{n(t.data)});return{trigger:e=>{if(x(t,e),s)try{s.postMessage(e)}catch(e){U(e,`xTabEvent(${t}) postMessage`)}n(e)},__subscribe:t=>{e.add(t);const n=()=>{e.delete(t)};return ct(t,n),n},close:()=>{s&&s.close()},name:t,__isEvent___:!0,__isXTabEvent___:!0}};
|
|
189
|
+
*/function mo(t,e,n,s){const{keyFn:i,template:r,opts:o}=yo(e,n,s),a={direction:o?.direction??"vertical",...o?.pin?{pin:o.pin}:{}};return po({items:t,renderItem:r,keyFunction:i,scroller:o?.scroller,layout:Fr(a)})}function _o(t,e,n,s){const{keyFn:i,template:r,opts:o}=yo(e,n,s),a={direction:o.direction??"vertical",itemSize:{width:o.itemWidth,height:o.itemHeight},gap:o.gap??"8px",flex:o.flex??!1,...o.pin?{pin:o.pin}:{}};return po({items:t,renderItem:r,keyFunction:i,scroller:o.scroller,layout:(l=a,Object.assign({type:Jr},l))});var l}function go(t,e,n,s){const{keyFn:i,template:r,opts:o}=yo(e,n,s),a={direction:o.direction??"vertical",getAspectRatio:o.getAspectRatio,gap:o.gap??"8px",flex:!0,...o.itemSize?{itemSize:o.itemSize}:{},...o.pin?{pin:o.pin}:{}};return po({items:t,renderItem:r,keyFunction:i,scroller:o.scroller,layout:(l=a,Object.assign({type:to},l))});var l}function yo(t,e,n){return"function"==typeof e?{keyFn:t,template:e,opts:n}:{keyFn:void 0,template:t,opts:e}}const vo=t=>"function"==typeof t&&!0===t.__isAtom___&&"function"==typeof t.set&&"function"==typeof t.__subscribe,wo=t=>"object"==typeof t&&null!==t&&!0===t.__isUnit___&&"function"==typeof t.__subscribe&&"function"==typeof t.__reset,bo=t=>"function"==typeof t&&!0===t.__isAction___&&"function"==typeof t.__subscribe,So=t=>"function"==typeof t&&!0===t.__isAsyncAction___&&"function"==typeof t.subscribe,Eo=t=>"function"==typeof t&&!0===t.__isSetter___&&"function"==typeof t.__subscribe,Ao=t=>"object"==typeof t&&null!==t&&!0===t.__isEvent___&&"function"==typeof t.__subscribe&&"function"==typeof t.trigger,Co=t=>"object"==typeof t&&null!==t&&!0===t.__isConfirmationEvent___&&"function"==typeof t.requestConfirmation&&"function"==typeof t.onConfirmRequest,Mo=t=>"object"==typeof t&&null!==t&&!0===t.__isChannel___&&"function"==typeof t.join,ko=t=>"function"==typeof t&&!0===t.__isSelector___&&"function"==typeof t.areVersionsChanged,xo=t=>"function"==typeof t,$o=t=>"AsyncFunction"===t.constructor.name,To=(t,e,n,s)=>{if(vo(t)){const i=t,r=os(i(),s),o=n(r.set,e),a=n(r.update,e);return r.set=o,r.update=a,i.__subscribe(()=>{Ce.schedule(()=>r.set(i()))}),je(r,()=>{o.cancel(),a.cancel()}),r}const i=os(t,s),r=n(i.set,e),o=n(i.update,e);return i.set=r,i.update=o,je(i,()=>{r.cancel(),o.cancel()}),i},Ro=(t,e,n)=>To(t,e,gs,n),Oo=(t=[],e)=>{const n=new Map(t),s=os(n,e),i=n.set.bind(n);n.set=(t,e)=>(i(t,e),s.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return s.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),s.update(()=>{})};const a=n.get.bind(n);n.get=t=>(s.get(),a(t));const l=n.has.bind(n);n.has=t=>(s.get(),l(t));const c=Object.getOwnPropertyDescriptor(Map.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),c.get.call(n))});const h=n.entries.bind(n);n.entries=()=>(s.get(),h());const u=n.values.bind(n);n.values=()=>(s.get(),u());const d=n.keys.bind(n);n.keys=()=>(s.get(),d());const f=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),f(t,e));const p=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),p()),n.update=t=>{const e={set:(t,n)=>(i(t,n),e),delete:t=>r(t),clear:()=>{o()},get:t=>a(t),has:t=>l(t),entries:()=>h(),values:()=>u(),keys:()=>d(),forEach:(t,e)=>f(t,e),[Symbol.iterator]:()=>p(),get size(){return c.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>{const i=a(t);return null==i||"object"!=typeof i||(e(i),s.update(()=>{})),n},Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},zo=(t=[],e)=>{const n=new Set(t),s=os(n,e),i=n.add.bind(n);n.add=t=>(i(t),s.update(()=>{}),n);const r=n.delete.bind(n);n.delete=t=>{const e=r(t);return s.update(()=>{}),e};const o=n.clear.bind(n);n.clear=()=>{o(),s.update(()=>{})};const a=n.has.bind(n);n.has=t=>(s.get(),a(t));const l=Object.getOwnPropertyDescriptor(Set.prototype,"size");Object.defineProperty(n,"size",{get:()=>(s.get(),l.get.call(n))});const c=n.entries.bind(n);n.entries=()=>(s.get(),c());const h=n.values.bind(n);n.values=()=>(s.get(),h());const u=n.keys.bind(n);n.keys=()=>(s.get(),u());const d=n.forEach.bind(n);n.forEach=(t,e)=>(s.get(),d(t,e));const f=n[Symbol.iterator].bind(n);return n[Symbol.iterator]=()=>(s.get(),f()),n.update=t=>{const e={add:t=>(i(t),e),delete:t=>r(t),clear:()=>{o()},has:t=>a(t),entries:()=>c(),values:()=>h(),keys:()=>u(),forEach:(t,e)=>d(t,e),[Symbol.iterator]:()=>f(),get size(){return l.get.call(n)}};return t(e),s.update(()=>{}),n},n.updateItem=(t,e)=>(null==t||"object"!=typeof t||(e(t),s.update(()=>{})),n),Object.defineProperty(n,"__isAtom___",{value:s,writable:!1,enumerable:!1}),Object.defineProperty(n,"__version__",{get:()=>s.__version__,enumerable:!1}),n},Io="mates_storage";function Po(t,e){try{null===e?t.removeItem(Io):t.setItem(Io,JSON.stringify(e))}catch{}}function Do(t,e){const n=os((()=>{try{return function(t){try{const e=t.getItem(Io);if(e)return JSON.parse(e)}catch{}return null}(t())}catch{return null}})()),s=n.set;n.set=function(e,i=!1){s(e,i);try{Po(t(),n.get())}catch{}};const i=n.update;return n.update=function(e,s=!1){if(null!==n.get()){i(e,s);try{Po(t(),n.get())}catch{}}},e(t=>{if(t.key===Io)if(t.newValue)try{s(JSON.parse(t.newValue))}catch{}else s(null)}),Object.defineProperty(n,"name",{value:"storageAtom",writable:!0,configurable:!0,enumerable:!1}),n}function Lo(t){"undefined"!=typeof window&&window.addEventListener("storage",t)}const No=Do(()=>localStorage,t=>Lo(e=>{e.storageArea===localStorage&&t(e)})),jo=Do(()=>sessionStorage,t=>Lo(e=>{e.storageArea===sessionStorage&&t(e)})),Uo=(t,e,n)=>To(t,e,ws,n),Fo=os("undefined"!=typeof document?document.title:"");function Vo(t){const e=new Map,n=new Map,s=os(e,t),i=s.get.bind(s),r=s;return r.add=(t,i,r)=>{if(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),s.update(e=>{e.set(t,i)}),void 0!==r&&-1!==r&&r>0){const i=setTimeout(()=>{e.delete(t),n.delete(t),s.update(()=>{})},r);n.set(t,i)}},r.get=t=>(i(),e.get(t)),r.remove=t=>!!e.has(t)&&(n.has(t)&&(clearTimeout(n.get(t)),n.delete(t)),e.delete(t),s.update(()=>{}),!0),r.has=t=>(i(),e.has(t)),r.getAll=()=>(i(),Array.from(e.values())),r.clearAll=()=>{n.forEach(t=>clearTimeout(t)),n.clear(),e.clear(),s.update(()=>{})},Object.defineProperty(r,"size",{get:()=>(i(),e.size),enumerable:!0,configurable:!0}),Object.defineProperty(r,"name",{get:()=>"cacheAtom",enumerable:!0,configurable:!0}),je(s,r.clearAll),r}Es(()=>{var t;t=Fo.get(),"undefined"!=typeof document&&(document.title=t)});const Wo=(t=1,e)=>{const n=os(t,e),s=n;return s.next=()=>{n.set(t=>t+1)},s.prev=()=>{n.set(t=>t>1?t-1:t)},s.reset=()=>{n.set(1)},Object.defineProperty(s,"currentPage",{get:()=>n.get(),enumerable:!1,configurable:!0}),Object.defineProperty(s,"name",{value:"paginationAtom",writable:!0,configurable:!0,enumerable:!1}),s},Ho="mates-theme";function Yo(t){return"auto"===t?function(){try{return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return"light"}}():t}let Bo=null;function qo(){if(Bo)return Bo;const t=os(function(){try{const t=localStorage.getItem(Ho);return"light"===t||"dark"===t||"auto"===t?t:null}catch{return null}}()??"auto",{skipRestrictedContextCheck:!0}),e=t;return e.setToLight=()=>{t.set("light")},e.setToDark=()=>{t.set("dark")},e.setToAuto=()=>{t.set("auto")},e.toggle=()=>{const e=Yo(t.get());t.set("dark"===e?"light":"dark")},Object.defineProperty(e,"resolved",{get:()=>Yo(t.get()),enumerable:!1,configurable:!0}),Object.defineProperty(e,"name",{value:"themeAtom",writable:!0,configurable:!0,enumerable:!1}),Es(()=>{const e=t.get();!function(t){try{document.documentElement.setAttribute("data-theme",Yo(t))}catch{}}(e),function(t){try{"auto"===t?localStorage.removeItem(Ho):localStorage.setItem(Ho,t)}catch{}}(e)}),"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",()=>{"auto"===t.get()&&t.set("auto")}),Bo=e,e}function Xo(t,e=2){let n=parseFloat(String(t).trim());Number.isFinite(n)||(n=0);const s=10**e;return Math.round(n*s)/s}function Zo(t,e,n){const s=os(t,n),i=os([],n);function r(){const t=s.get(),n=e.map(e=>e(t)).filter(t=>null!=t&&""!==t);return i.set(n),n}const o=s.set;s.set=function(t,e=!1){o(t,e),r()};const a=s.update;s.update=function(t,e=!1){a(t,e),r()};const l=s;return Object.defineProperty(l,"__isFormAtom__",{value:!0,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(l,"errors",{get:()=>i.get(),enumerable:!1,configurable:!0}),Object.defineProperty(l,"isValid",{get:()=>0===i.get().length,enumerable:!1,configurable:!0}),l.validate=r,l.toFloat=()=>Xo(s.get()),l.toFloatString=()=>Xo(s.get()).toString(),l.toValidNumber=()=>function(t){const e=Number(t);return Number.isFinite(e)?e:0}(s.get()),Object.defineProperty(l,"name",{value:"formAtom",writable:!0,configurable:!0,enumerable:!1}),l}const Go=(t,e=[],n)=>Zo(t,e,n);function Ko(t){const e=[],n={},s=new WeakSet;return function t(i,r){if(null==i)return;const o=typeof i;if("object"!==o&&"function"!==o)return;if(s.has(i))return;if(s.add(i),function(t){if(null==t)return!1;const e=typeof t;return("object"===e||"function"===e)&&!0===t.__isFormAtom__}(i)){const t=i.validate();return void(t.length>0&&(e.push(...t),n[r]=t))}if(Array.isArray(i)){for(let e=0;e<i.length;e++){const n=r?`${r}[${e}]`:`[${e}]`;t(i[e],n)}return}const a=Object.keys(i);for(const e of a){const n=r?`${r}.${e}`:e;t(i[e],n)}}(t,""),{isValid:0===e.length,errors:e,errorsByField:n}}function Jo(t,e,n){const s=e.replace(/\[(\d+)]/g,".$1").split(".");let i=t;for(const t of s){if(null==i)return n;i=i[t]}return void 0===i?n:i}function Qo(t,e){const n={};for(const s of e)s in t&&(n[s]=t[s]);return n}function ta(t,e){const n={...t};for(const t of e)delete n[t];return n}function ea(t){return null!==t&&"object"==typeof t&&!Array.isArray(t)}function na(t,...e){const n={...t};for(const t of e)for(const e of Object.keys(t))ea(n[e])&&ea(t[e])?n[e]=na(n[e],t[e]):n[e]=t[e];return n}function sa(t,e,n){return Math.min(Math.max(t,e),n)}function ia(t,e,n){if(void 0===e&&(e=t,t=0),void 0===n&&(n=t<=e?1:-1),0===n)return[];const s=[];if(n>0)for(let i=t;i<e;i+=n)s.push(i);else for(let i=t;i>e;i+=n)s.push(i);return s}function ra(t,e){if(e<1)return[];const n=[];for(let s=0;s<t.length;s+=e)n.push(t.slice(s,s+e));return n}function oa(t,e){const n=new Set,s=[];for(const i of t){const t=e(i);n.has(t)||(n.add(t),s.push(i))}return s}function aa(t,e){const n={};for(const s of t){const t=String(e(s));n[t]||(n[t]=[]),n[t].push(s)}return n}function la(t){return null==t||("string"==typeof t||Array.isArray(t)?0===t.length:t instanceof Map||t instanceof Set?0===t.size:"object"==typeof t&&0===Object.keys(t).length)}function ca(t,e){if(null==t||"object"!=typeof t)return;const n=Array.isArray(t)?t.map((t,e)=>e):Object.keys(t);for(const s of n){const n=e(s,t[s],t);void 0!==n&&(t[s]=n);const i=t[s];null!==i&&"object"==typeof i&&ca(i,e)}}const ha=t=>(t=>"number"==typeof t||"boolean"==typeof t||!la(t))(t)?null:"Required",ua=t=>(t=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))(t)?null:"Invalid email",da=t=>e=>((t,e)=>t.length>=e)(e,t)?null:`Min ${t} characters`,fa=t=>e=>((t,e)=>t.length<=e)(e,t)?null:`Max ${t} characters`,pa=(t,e="Invalid format")=>n=>((t,e)=>e.test(t))(n,t)?null:e,ma=t=>e=>((t,e)=>t>=e)(e,t)?null:`Min is ${t}`,_a=t=>e=>((t,e)=>t<=e)(e,t)?null:`Max is ${t}`;function ga(t){let e;return is({name:"Memo",fn:t,onRun:t=>{e?e.set(()=>t):(e=os(void 0,{skipRestrictedContextCheck:!0}),e.set(()=>t,!0))}}),e}function ya(t){const e=new Set,n=[Object.prototype,Array.prototype,Function.prototype,String.prototype,Number.prototype,Boolean.prototype,Symbol.prototype,Date.prototype,RegExp.prototype,Map.prototype,Set.prototype,WeakMap.prototype,WeakSet.prototype,Promise.prototype,Error.prototype];let s=t;for(;s&&!n.includes(s);){for(const t of Reflect.ownKeys(s))"constructor"!==t&&e.add(t);s=Object.getPrototypeOf(s)}return Array.from(e)}const va=t=>{const e=ve();if(e&&e.scopes.has(t))throw new Error("Scope already exists for the same class for this component");let n;re.viewOuterInProgress=!0;try{n=new t}finally{re.viewOuterInProgress=!1}const s=re.setupInProgress;try{if((()=>{ya(n).forEach(t=>{const e=Object.getOwnPropertyDescriptor(n,t)||Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),t);if(e&&(e.get||e.set))return;const s=n[t];"function"!=typeof s||s.__version__||(n[t]=s.bind(n))})})(),"function"==typeof n.setup){$o(n.setup)&&console.warn("Async setup functions are not supported. Please ensure the setup function is synchronous."),re.setupInProgress=!0;try{n.setup(e?._propsFn||(()=>({})))}catch(t){console.error(t)}finally{re.setupInProgress=s}}e&&e.addScope(t,n),n.__isScope___=!0}catch(t){console.error(t)}finally{re.setupInProgress=s}return n},wa=t=>{let e=null;const n=new CustomEvent("request-parent-scope",{bubbles:!0,composed:!0,detail:{ScopeClass:t,resolve:t=>{e=t}}});if(ve().dispatchEvent(n),e)return e;throw new Error(`No parent scope found for ${t.name}`)};function ba(t,e){let n=t;for(;n&&n!==Object.prototype;){const t=Object.getOwnPropertyDescriptor(n,e);if(t)return t;n=Object.getPrototypeOf(n)}}const Sa=t=>{const e=ve();if("object"!=typeof t||null===t)throw new Error("stateObj must be an object");const n=os(t),s=((t,e,n)=>{const s=ya(t);s.forEach(s=>{const i=ba(t,s);if(i?.get){let n,r=-1;const o=i.get;Object.defineProperty(t,s,{get(){const s=e.__version__;return s!==r&&(r=s,n=o.call(t)),n},configurable:!0,enumerable:i.enumerable})}else if(xo(t[s])){if($o(t[s]))throw new Error(`Async functions are not supported inside ${n}`);const i=t[s];t[s]=(...n)=>{e.update(()=>i.apply(t,n))}}});const i=Object.create(t);return s.forEach(n=>{const s=ba(t,n);if(!s)return;const r=!!s.get,o=!r&&xo(s.value);r||o||Object.defineProperty(i,n,{get:()=>e()[n],set(t){e.update(e=>{e[n]=t})},enumerable:!0,configurable:!0})}),i})(t,n,"useState");return e?._useStates&&e._useStates.push({state:t,atom:n}),[s,n.update]},Ea=t=>{ke();const e=ve();e._errorHandlers||(e._errorHandlers=[]),e._errorHandlers.push(t)},Aa=(t,e)=>{const n=ve();if(ke(),!n)throw new Error("onReferenceChange must be called inside a component");let s=[];t(),s=e(),n.onEachUpdate(()=>{const n=e();s.some((t,e)=>t!==n[e])&&(t(),s=n)})};function Ca(t,e,n,s=!1){document.addEventListener(t,e,{capture:s}),n.addToCleanUps(e,()=>{document.removeEventListener(t,e,{capture:s})})}function Ma(t,e,n,s){let i;if("wheelUp"===t||"wheelDown"===t){const r="wheelUp"===t,o=e,a=t=>{(r?t.deltaY>=0:t.deltaY<=0)||(i&&i(),i=o(t))};return window.addEventListener("wheel",a,{capture:n,passive:!0}),void s.addToCleanUps(e,()=>{window.removeEventListener("wheel",a,{capture:n}),i&&i()})}const r="scroll"===t||"touchstart"===t||"touchmove"===t,o=e,a=t=>{i&&i(),i=o(t)};window.addEventListener(t,a,{capture:n,passive:r}),s.addToCleanUps(e,()=>{window.removeEventListener(t,a,{capture:n}),i&&i()})}function ka(t,e){Se()||(ke(),Ma(t,e,!1,ve()))}function xa(t,e){Se()||(ke(),Ma(t,e,!0,ve()))}const $a=t=>{xa("scroll",t)},Ta=t=>{ka("blur",t)},Ra=t=>{ka("focus",t)},Oa=t=>{ka("online",t)},za=t=>{ka("offline",t)},Ia=t=>{ka("resize",t)},Pa=t=>{ka("paste",t)},Da=t=>{ka("copy",t)},La=t=>{ka("cut",t)},Na=t=>{ka("keydown",t)},ja=t=>{ka("keyup",t)},Ua=t=>{if(Se())return;ke();let e;Ca("visibilitychange",()=>{e&&e(),e=t(document.hidden)},ve())},Fa=t=>{if(Se())return;ke();let e;Ca("selectionchange",()=>{e&&e(),e=t(window.getSelection())},ve())},Va=t=>{ka("storage",t)},Wa=t=>{if(Se())return;ke();const e=ve();let n;const s=t=>t.preventDefault(),i=e=>{e.preventDefault(),n&&n(),n=t(e)};window.addEventListener("dragover",s),window.addEventListener("drop",i),e.addToCleanUps(t,()=>{window.removeEventListener("dragover",s),window.removeEventListener("drop",i),n&&n()})},Ha=t=>{if(Se())return;ke();const e=ve(!0),n=n=>{const s=n.target;s&&!e.contains(s)&&t(n)};document.addEventListener("mousedown",n,!0),e.addToCleanUps(t,()=>{document.removeEventListener("mousedown",n,!0)})},Ya=(t,e=window)=>{if(Se())return;ke();const n=ve();let s;const i=e=>{s&&s(),s=t(e)};e.addEventListener("scroll",i,{passive:!0}),n.addToCleanUps(t,()=>{e.removeEventListener("scroll",i),s&&s()})},Ba=(t,e)=>{if(Se())return;ke();const n=ve();let s;const i=new ResizeObserver(e=>{for(const n of e)s&&s(),s=t(n)}),r=e||n;i.observe(r),n.addToCleanUps(t,()=>{i.disconnect(),s&&s()})},qa=t=>{if(Se())return;ke();const e=ve();let n;const s=Is.__subscribe(()=>{n&&n(),n=t(Is.get())||null});e.addToCleanUps(t,()=>{s(),n&&n()})},Xa=(t,e)=>{if(Se())return;ke();const n=ve();let s;const i=setInterval(()=>{s&&s(),s=t()},e);n.addToCleanUps(t,()=>{clearInterval(i),s&&s()})},Za=(t,e)=>{if(Se())return;ke();const n=ve();let s;const i=setTimeout(()=>{s=t()},e);n.addToCleanUps(t,()=>{clearTimeout(i),s&&s()})};function Ga(t,e){ke();const n=ve(),s=e.map(e=>e.__subscribe(t));n.addToCleanUps(t,()=>{s.forEach(t=>t())})}const Ka=t=>{ke();const e=ve();let n;e.onEachUpdate(()=>{n&&n(),n=t()}),e.addToCleanUps(t,()=>{n&&n()})},Ja=t=>{const e=ve();if(!e)throw new Error("onDOMReady must be called within a component context");return e.DOMReadyEvent.__subscribe(t)},Qa=er((t,e,n)=>{const s=document.createElement("div");Object.assign(s.style,{position:"fixed",inset:"0",zIndex:"9999",display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0, 0, 0, 0.5)"}),n?.style&&Object.assign(s.style,n.style),n?.onBackdropClick&&s.addEventListener("click",t=>{t.target===s&&n.onBackdropClick()});const i=document.createElement("div");n?.dialogStyle&&Object.assign(i.style,n.dialogStyle),i.addEventListener("click",t=>t.stopPropagation()),U(e,i),s.appendChild(i),document.body.appendChild(s);const r=document.body.style.overflow;return document.body.style.overflow="hidden",{onUpdate(t){U(t,i)},onCleanup(){s.remove(),document.body.style.overflow=r}}});function tl(t,e){return Qa(t,e)}function el(t,e,n,s,i,r,o){return t.startsWith("top")?s>=n:t.startsWith("bottom")?i>=n:t.startsWith("left")?r>=e:!!t.startsWith("right")&&o>=e}const nl=qi((t,e,n)=>{const s=t.el;let i=!1,r=e,o=n;const a=document.createElement("div");a.style.cssText="position:fixed;z-index:9999;margin:0;display:none;background:var(--md-color-surface-raised,#fff);box-shadow:var(--md-shadow-dropdown,0 5px 5px -3px rgba(0,0,0,.20),0 8px 10px 1px rgba(0,0,0,.14),0 3px 14px 2px rgba(0,0,0,.12));min-width:160px;",o.style&&Object.assign(a.style,o.style),document.body.appendChild(a),U(r,a);const l=()=>{const t=s.getBoundingClientRect();a.style.visibility="hidden",a.style.display="block",o.matchAnchorWidth&&(a.style.width=`${t.width}px`);const e=a.offsetWidth,n=a.offsetHeight,i=function(t,e,n,s,i){const r=window.innerWidth,o=window.innerHeight,a=t.top-s,l=o-t.bottom-s,c=t.left-s,h=r-t.right-s;if("auto"===i){const t=["bottom-start","top-start","right","left"];for(const s of t)if(el(s,e,n,a,l,c,h))return s;return"bottom-start"}if(el(i,e,n,a,l,c,h))return i;const u=(d=i).startsWith("top")?d.replace("top","bottom"):d.startsWith("bottom")?d.replace("bottom","top"):d.startsWith("left")?d.replace("left","right"):d.startsWith("right")?d.replace("right","left"):d;var d;return el(u,e,n,a,l,c,h)?u:i}(t,e,n,o.gap??4,o.position??"bottom-start");!function(t,e,n,s,i,r){const o=window.innerWidth,a=window.innerHeight;let l=0,c=0;n.startsWith("bottom")?l=e.bottom+r:n.startsWith("top")?l=e.top-r-i:"right"===n||"left"===n?l=e.top+e.height/2-i/2:n.endsWith("-start")?l=e.top:n.endsWith("-end")&&(l=e.bottom-i),"bottom"===n||"top"===n?c=e.left+e.width/2-s/2:n.endsWith("-start")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-s:e.left:n.endsWith("-end")?c=n.startsWith("right")?e.right+r:n.startsWith("left")?e.left-r-s:e.right-s:n.startsWith("right")?c=e.right+r:n.startsWith("left")&&(c=e.left-r-s),t.style.left=`${Math.max(4,Math.min(c,o-s-4))}px`,t.style.top=`${Math.max(4,Math.min(l,a-i-4))}px`}(a,t,i,e,n,o.gap??4),a.style.visibility=""},c=()=>{i&&l()},h=t=>{const e=t.target;a.contains(e)||s.contains(e)||d()},u=t=>{"Escape"===t.key&&d()},d=()=>{i=!1,a.style.display="none",o.onClose?.(s),document.removeEventListener("click",h,{capture:!0}),document.removeEventListener("keydown",u),window.removeEventListener("scroll",c,{capture:!0}),window.removeEventListener("resize",c)},f=t=>{t.stopPropagation(),i?d():(i=!0,l(),o.onOpen?.(a),document.addEventListener("click",h,{capture:!0}),document.addEventListener("keydown",u),window.addEventListener("scroll",c,{passive:!0,capture:!0}),window.addEventListener("resize",c,{passive:!0}))};return s.addEventListener("click",f),{onUpdate(t,e){r=t,o=e,U(t,a),e.style&&Object.assign(a.style,e.style),i&&l()},onCleanup(){i&&d(),s.removeEventListener("click",f),a.remove()}}});function sl(t,e){return nl(t,"string"==typeof e?{position:e}:e??{})}function il(t,e,n){switch(e){case"top":case"top-start":return{top:t.top-n,left:t.left};case"top-end":return{top:t.top-n,left:t.right};case"bottom":case"bottom-start":default:return{top:t.bottom+n,left:t.left};case"bottom-end":return{top:t.bottom+n,left:t.right};case"right":case"right-start":return{top:t.top,left:t.right+n};case"right-end":return{top:t.bottom,left:t.right+n};case"left":case"left-start":return{top:t.top,left:t.left-n};case"left-end":return{top:t.bottom,left:t.left-n}}}function rl(t){return"top"===t||"top-start"===t||"top-end"===t?"translateY(-100%)":"left"===t||"left-start"===t||"left-end"===t?"translateX(-100%)":""}function ol(t,e,n,s){const i=window.innerHeight-t.bottom-s,r=t.top-s,o=window.innerWidth-t.right-s,a=t.left-s;if(i>=n)return"bottom";if(r>=n)return"top";if(o>=e)return"right";if(a>=e)return"left";return[["bottom",i],["top",r],["right",o],["left",a]].reduce((t,e)=>e[1]>t[1]?e:t)[0]}const al=er((t,e,n)=>{const s=document.createElement("div");if(s.style.position="fixed",s.style.zIndex="9999",n?.style&&Object.assign(s.style,n.style),n?.on)for(const[t,e]of Object.entries(n.on))s.addEventListener(t,e);return function(t){return t?"string"==typeof t?document.querySelector(t)??document.body:t:document.body}(n?.target).appendChild(s),U(e,s),{onUpdate(t){U(t,s)},onCleanup(){s.remove()}}});function ll(t,e){return al(t,e)}let cl=null,hl=null,ul=null;function dl(){return cl||(cl=document.createElement("div"),cl.id="mates-tip",cl.setAttribute("role","tooltip"),cl.style.cssText="position:fixed;z-index:10000;pointer-events:none;padding:6px 12px;border-radius:4px;font-size:0.8rem;font-family:system-ui,-apple-system,sans-serif;font-weight:500;line-height:1.4;max-width:300px;width:max-content;background:var(--md-sys-color-inverse-surface,#2e3036);color:var(--md-sys-color-inverse-on-surface,#f0f0f8);box-shadow:0 1px 3px rgba(0,0,0,.20),0 2px 6px rgba(0,0,0,.14);letter-spacing:0.01em;white-space:nowrap;display:none;",document.body.appendChild(cl)),cl}const fl=["maxWidth","padding","borderRadius","fontSize","whiteSpace"];function pl(t,e){if(e.maxWidth&&(t.style.maxWidth=e.maxWidth),e.padding&&(t.style.padding=e.padding),e.borderRadius&&(t.style.borderRadius=e.borderRadius),e.fontSize&&(t.style.fontSize=e.fontSize),e.whiteSpace&&(t.style.whiteSpace=e.whiteSpace),e.style)for(const[n,s]of Object.entries(e.style))void 0!==s&&(t.style[n]=s)}function ml(t,e){const n={maxWidth:"300px",padding:"6px 12px",borderRadius:"4px",fontSize:"0.8rem",whiteSpace:"nowrap"};for(const s of fl)void 0!==e[s]&&(t.style[s]=n[s]);if(e.style){for(const n of Object.keys(e.style))t.style[n]="";t.style.background="var(--md-sys-color-inverse-surface,#2e3036)",t.style.color="var(--md-sys-color-inverse-on-surface,#f0f0f8)"}}function _l(t,e){U("string"==typeof e?b`${e}`:e,t)}function gl(t,e){const n=t.getBoundingClientRect(),s=e.getBoundingClientRect(),i=s.width,r=s.height,o=window.innerWidth,a=window.innerHeight;let l;n.top-8-r>=0?(l=n.top-8-r,e.style.transformOrigin="bottom center"):(l=n.bottom+8,e.style.transformOrigin="top center");let c=n.left+n.width/2-i/2;c=Math.max(4,Math.min(c,o-i-4)),l=Math.max(4,Math.min(l,a-r-4)),e.style.left=`${c}px`,e.style.top=`${l}px`}const yl=qi((t,e,n)=>{const s=t.el;let i=e,r=n,o=null;const a=()=>{null!==ul&&(cancelAnimationFrame(ul),ul=null),null!==o&&(clearTimeout(o),o=null);const t=r.delay??150;o=setTimeout(()=>{o=null;const t=dl();_l(t,i),pl(t,r),t.style.visibility="hidden",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",t.style.transition="none",t.style.display="block",gl(s,t),requestAnimationFrame(()=>{t.style.transition="opacity 0.14s ease, transform 0.14s cubic-bezier(0.22,1,0.36,1)",t.style.visibility="visible",t.style.opacity="1",t.style.transform="scale(1) translateY(0)",hl=s})},t)},l=()=>{if(null!==o&&(clearTimeout(o),o=null),hl!==s)return;const t=dl();t.style.transition="opacity 0.12s ease, transform 0.12s ease",t.style.opacity="0",t.style.transform="scale(0.94) translateY(3px)",ul=requestAnimationFrame(()=>{ul=requestAnimationFrame(()=>{ul=null,hl===s&&(ml(t,r),t.style.display="none",hl=null)})})};return s.addEventListener("mouseenter",a),s.addEventListener("mouseleave",l),s.addEventListener("focusin",a),s.addEventListener("focusout",l),s.setAttribute("aria-describedby","mates-tip"),{onUpdate(t,e){if(i=t,r=e,hl===s){const n=dl();_l(n,t),pl(n,e),gl(s,n)}},onCleanup(){if(null!==o&&(clearTimeout(o),o=null),hl===s){null!==ul&&(cancelAnimationFrame(ul),ul=null);const t=dl();ml(t,r),t.style.display="none",hl=null}s.removeEventListener("mouseenter",a),s.removeEventListener("mouseleave",l),s.removeEventListener("focusin",a),s.removeEventListener("focusout",l)}}});function vl(t,e={}){return yl(t,e)}const wl=vl,bl=1e3,Sl=3e4,El=1/0;function Al(t,e={}){le("ws");const{reconnect:n=!0,reconnectDelay:s=bl,reconnectMaxDelay:i=Sl,reconnectMaxAttempts:r=El,protocols:o,auth:a,autoConnect:l=!0}=e,c=os("connecting",{skipRestrictedContextCheck:!0}),h=new Set;let u=null,d=0,f=s,p=null,m=!1;const _=[];function g(){null!==p&&(clearTimeout(p),p=null)}function y(){let e;m=!1,g(),c.set("connecting");try{e=function(){if(!a)return t;const e=a(),n=Object.entries(e);if(0===n.length)return t;const s=n.map(([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`).join("&");return t.includes("?")?`${t}&${s}`:`${t}?${s}`}()}catch(t){return ce(t),void c.set("error")}try{u=o?new WebSocket(e,o):new WebSocket(e)}catch(t){return ce(t),c.set("error"),void v()}u.onopen=()=>{m?u?.close():(d=0,f=s,c.set("connected"),function(){for(;_.length>0;){const t=_.shift();u?.readyState===WebSocket.OPEN&&u.send(t)}}())},u.onmessage=t=>{if(m)return;const e="string"==typeof t.data?t.data:String(t.data);let n;try{n=JSON.parse(e)}catch{n=e}var s;s=n,h.forEach(t=>{try{t(s)}catch(t){ce(t)}})},u.onerror=()=>{c.set("error")},u.onclose=()=>{m||(c.set("disconnected"),v())}}function v(){if(!n||m)return;if(d>=r)return;d++;const t=f;f=Math.min(2*f,i),p=setTimeout(()=>{m||y()},t)}function w(){m=!0,g(),u&&(u.onopen=null,u.onmessage=null,u.onerror=null,u.onclose=null,u.readyState!==WebSocket.OPEN&&u.readyState!==WebSocket.CONNECTING||u.close(1e3,"client disconnect"),u=null),c.set("disconnected"),h.clear(),_.length=0}const b={send:function(t){const e="string"==typeof t?t:JSON.stringify(t);u?.readyState===WebSocket.OPEN?u.send(e):_.push(e)},__subscribe:function(t){return h.add(t),()=>h.delete(t)},status:c,connect:y,disconnect:w,__isWs___:!0};return l?y():c.set("disconnected"),je(b,w),b}class Cl{constructor(){this.id=Math.random().toString(36).substring(2,15),this.context=null}}function Ml(t,e=new WeakMap){if("function"==typeof structuredClone)return structuredClone(t);if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp)return new RegExp(t.source,t.flags);if(t instanceof Map){const n=new Map;return e.set(t,n),t.forEach((t,s)=>n.set(Ml(s,e),Ml(t,e))),n}if(t instanceof Set){const n=new Set;return e.set(t,n),t.forEach(t=>n.add(Ml(t,e))),n}if(Array.isArray(t)){const n=[];e.set(t,n);for(let s=0;s<t.length;s++)n[s]=Ml(t[s],e);return n}const n=e.get(t);if(n)return n;const s={};e.set(t,s);for(const n of Object.keys(t))s[n]=Ml(t[n],e);return s}function kl(t,e){let n=Object.getOwnPropertyDescriptor(t,e),s=Object.getPrototypeOf(t);for(;!n&&s&&s!==Object.prototype;)n=Object.getOwnPropertyDescriptor(s,e),s=Object.getPrototypeOf(s);return n?.get&&"function"==typeof n.get?n.get:null}var xl,$l,Tl,Rl,Ol,zl;function Il(t){return"number"==typeof t?`${t}px`:t}$l=new WeakMap,Tl=new WeakMap,Rl=new WeakMap,Ol=new WeakMap,xl=new WeakSet,zl=function(t){he(this,$l,"f")?.remove(),ue(this,$l,null,"f"),ue(this,Tl,"","f"),ue(this,Rl,"","f"),ue(this,Ol,new Set,"f");const e=t.endNode;if(e?.parentNode){const n=t.startNode,s=document.createRange();s.setStartAfter(n),s.setEndBefore(e),s.deleteContents()}};const Pl=B(class extends q{constructor(t){if(super(t),xl.add(this),$l.set(this,null),Tl.set(this,""),Rl.set(this,""),Ol.set(this,new Set),t.type!==V)throw new Error("safeSVG() must be used as a child expression, e.g. html`<div>${safeSVG(markup)}</div>`")}update(t,[e,n]){if(console.log("update"),!e.trimStart().startsWith("<svg"))return console.warn("safeSVG: input does not start with <svg — nothing rendered"),he(this,xl,"m",zl).call(this,t),E;const s=JSON.stringify(n);if(null===he(this,$l,"f")||e!==he(this,Tl,"f")){const n=function(t){const e=document.createElement("template");e.innerHTML=t;const n=e.content.firstElementChild;return n instanceof SVGElement?n:null}(e);if(null===n)return console.warn("safeSVG: failed to parse SVG markup — nothing rendered"),he(this,xl,"m",zl).call(this,t),E;he(this,$l,"f")?.remove(),ue(this,$l,n,"f"),ue(this,Tl,e,"f"),ue(this,Rl,"","f"),ue(this,Ol,new Set,"f");const s=t.endNode;s.parentNode.insertBefore(he(this,$l,"f"),s)}if(s!==he(this,Rl,"f")){const t=function(t,e){const n=new Set,s=(e,s)=>{t.setAttribute(e,s),n.add(e)},i=e.width??e.size,r=e.height??e.size;void 0!==i&&s("width",Il(i)),void 0!==r&&s("height",Il(r)),void 0!==e.fill&&s("fill",e.fill),void 0!==e.stroke&&s("stroke",e.stroke),void 0!==e.strokeWidth&&s("stroke-width",String(e.strokeWidth)),void 0!==e.strokeLinecap&&s("stroke-linecap",e.strokeLinecap),void 0!==e.strokeLinejoin&&s("stroke-linejoin",e.strokeLinejoin),void 0!==e.opacity&&s("opacity",String(e.opacity)),void 0!==e.viewBox&&s("viewBox",e.viewBox),void 0!==e.transform&&s("transform",e.transform);const o=[],a=e.width??e.size,l=e.height??e.size;void 0!==a&&o.push(`width:${Il(a)}`),void 0!==l&&o.push(`height:${Il(l)}`),void 0!==e.color&&o.push(`color:${e.color}`),o.push("display:inline-block"),o.push("vertical-align:middle"),e.style&&o.push(e.style),s("style",o.join(";")),e.class&&s("class",e.class);const c=e.ariaHidden??!0;return e.ariaLabel?(s("aria-label",e.ariaLabel),s("role","img")):c&&s("aria-hidden","true"),n}(he(this,$l,"f"),n);for(const e of he(this,Ol,"f"))t.has(e)||he(this,$l,"f").removeAttribute(e);ue(this,Ol,t,"f"),ue(this,Rl,s,"f")}return E}render(t,e){return E}});function Dl(t,e={}){return Pl(t,e)}function Ll(){const t=new Uint8Array(16);if("undefined"!=typeof crypto&&crypto.getRandomValues)crypto.getRandomValues(t);else for(let e=0;e<16;e++)t[e]=256*Math.random()|0;t[6]=15&t[6]|64,t[8]=63&t[8]|128;const e=Array.from(t).map(t=>t.toString(16).padStart(2,"0")).join("");return`${e.slice(0,8)}-${e.slice(8,12)}-${e.slice(12,16)}-${e.slice(16,20)}-${e.slice(20,32)}`}let Nl=null,jl=null,Ul=null;function Fl(t){Nl=t}function Vl(t){jl=t}function Wl(){return jl}function Hl(){return Nl??-(new Date).getTimezoneOffset()}function Yl(){return Ul??("undefined"!=typeof navigator?navigator.language:null)??"en"}function Bl(t,e){const n={};for(const s of new Intl.DateTimeFormat("en",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(new Date(e)))"literal"!==s.type&&(n[s.type]=parseInt(s.value,10));const s=24===n.hour?0:n.hour,i=Date.UTC(n.year,n.month-1,n.day,s,n.minute,n.second);return Math.round((i-e)/6e4)||0}function ql(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"short"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Xl(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"long"}).formatToParts(new Date(e)).find(t=>"timeZoneName"===t.type);return n?n.value:t}catch{return t}}function Zl(t,e){const n=new Date(t+6e4*e);return{Y:n.getUTCFullYear(),M:n.getUTCMonth()+1,D:n.getUTCDate(),h:n.getUTCHours(),m:n.getUTCMinutes(),s:n.getUTCSeconds(),ms:n.getUTCMilliseconds(),wd:n.getUTCDay()}}const Gl=t=>String(t).padStart(2,"0");function Kl(t,e,n){const s={[n]:e};return jl?s.timeZone=jl:(s.timeZone="UTC",t+=6e4*Hl()),new Intl.DateTimeFormat(Yl(),s).format(new Date(t))}function Jl(t,e){const n=t>=0?"+":"-",s=Math.abs(t);return e?`${n}${Gl(Math.floor(s/60))}:${Gl(s%60)}`:`${n}${Gl(Math.floor(s/60))}${Gl(s%60)}`}function Ql(t){const e=t.replace(/s$/,"");if("millisecond"===e||"m"===e)return"ms";if("minute"===e)return"min";if(!new Set(["year","month","week","day","hour","min","second","ms"]).has(e))throw new RangeError(`Invalid date unit: "${t}"`);return e}function tc(){try{const t=new Intl.Locale(Yl()),e=t.weekInfo?.firstDay??t.getWeekInfo?.()?.firstDay;if(void 0!==e)return e%7}catch{}return 0}const ec=/YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|H|hh|h|mm|ss|SSS|ZZ|Z|A|a/g,nc=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function sc(t){try{const e=new Date(Date.UTC(2024,0,7+t,12,0,0));return new Intl.DateTimeFormat(Yl(),{weekday:"long",timeZone:"UTC"}).format(e)}catch{return nc[t]||""}}function ic(t){try{const e=new Date(Date.UTC(2024,t-1,15,12,0,0));return new Intl.DateTimeFormat(Yl(),{month:"long",timeZone:"UTC"}).format(e)}catch{return""}}function rc(t){if(t instanceof Number)return t.valueOf();if("number"==typeof t)return t;if("string"==typeof t)return new Date(t).getTime();if(t instanceof Date)return t.getTime();if("object"==typeof t&&null!==t){const{year:e=1970,month:n=1,day:s=1,hour:i=0,minute:r=0,second:o=0,ms:a=0}=t;return Date.UTC(e,n-1,s,i,r,o,a)-6e4*Hl()}return NaN}function oc(t,e,n){const s=Ql(n);if("hour"===s)return t+36e5*e;if("min"===s)return t+6e4*e;if("second"===s)return t+1e3*e;if("ms"===s)return t+e;const i=Hl(),r=Zl(t,i);let o=r.Y,a=r.M,l=r.D;if("year"===s)o+=e;else if("month"===s){const t=a-1+e;o+=Math.floor(t/12),a=(t%12+12)%12+1,l=Math.min(l,new Date(o,a,0).getDate())}else l+="week"===s?7*e:e;return Date.UTC(o,a-1,l,r.h,r.m,r.s,r.ms)-6e4*i}function ac(t,e){const n=Hl(),s=Zl(t,n),i=Zl(e,n);return s.Y===i.Y&&s.M===i.M&&s.D===i.D}function lc(t){const e=Hl(),n=Zl(t,e);return Date.UTC(n.Y,n.M-1,n.D,0,0,0,0)-6e4*e}function cc(t,e){const n=Hl(),s=Zl(t,n),i=s.h%12||12,r=[],o=e.replace(/\[([^\]]*)\]/g,(t,e)=>(r.push(e),`\0${r.length-1}\0`));ec.lastIndex=0;const a=o.replace(ec,e=>{switch(e){case"YYYY":return String(s.Y);case"YY":return String(s.Y).slice(-2);case"MMMM":return Kl(t,"long","month");case"MMM":return Kl(t,"short","month");case"MM":return Gl(s.M);case"M":return String(s.M);case"DD":return Gl(s.D);case"D":return String(s.D);case"dddd":return Kl(t,"long","weekday");case"ddd":return Kl(t,"short","weekday");case"HH":return Gl(s.h);case"H":return String(s.h);case"hh":return Gl(i);case"h":return String(i);case"mm":return Gl(s.m);case"ss":return Gl(s.s);case"SSS":return(t=>String(t).padStart(3,"0"))(s.ms);case"A":return s.h>=12?"PM":"AM";case"a":return s.h>=12?"pm":"am";case"Z":return Jl(n,!0);case"ZZ":return Jl(n,!1);default:return e}});return a.replace(/\0(\d+)\0/g,(t,e)=>r[+e])}const hc=[["year",31536e3],["month",2592e3],["week",604800],["day",86400],["hour",3600],["minute",60],["second",1]];const uc=Symbol("ts"),dc=Object.create(Number.prototype);function fc(t){return function(t){const e=Object.create(dc);return e[uc]=t,e}(void 0===t?Date.now():rc(t))}function pc(t){null==t?(Fl(null),Vl(null)):(Fl(t.offset),Vl(t.name))}function mc(t){Fl(t),Vl(null)}function _c(){return Hl()}function gc(t){!function(t){Ul=t}(t??null)}function yc(){return Yl()}function vc(){let t;try{t=Intl.supportedValuesOf("timeZone")}catch{return[]}const e=Date.now();return t.map(t=>({name:t,longName:Xl(t,e),shortName:ql(t,e),offset:Bl(t,e)}))}function wc(t){const e=t??Yl(),n=new Intl.DateTimeFormat(e,{month:"long",timeZone:"UTC"}),s=new Intl.DateTimeFormat(e,{month:"short",timeZone:"UTC"}),i=[];for(let t=1;t<=12;t++){const e=new Date(Date.UTC(2024,t-1,15,12,0,0));i.push({number:t,name:n.format(e),shortName:s.format(e)})}return i}function bc(t,e){if(!Number.isInteger(t)||!Number.isInteger(e)||e<1||e>12)throw new RangeError("getCalendar(year, month): month must be integer 1–12");const n=fc({year:t,month:e,day:1}),{year:s,month:i,numberOfDaysOfTheMonth:r}=n.values,o=[];for(let t=Zl(n.valueOf(),Hl()).wd;t>0;t--)o.push(fc({year:s,month:i,day:1-t}));for(let t=1;t<=r;t++)o.push(fc({year:s,month:i,day:t}));const a=o.length%7,l=0===a?0:7-a,c=fc({year:s,month:i,day:r});for(let t=0;t<l;t++)c.add(1,"day"),o.push(fc(c.valueOf()));const h=[];for(let t=0;t<o.length;t+=7)h.push(o.slice(t,t+7));return h}Object.defineProperties(dc,{valueOf:{value(){return this[uc]},writable:!1,configurable:!1},values:{get(){const t=this[uc],e=Zl(t,Hl());return{year:e.Y,month:e.M,monthName:ic(e.M),dayName:sc(e.wd),date:e.D,weekStartDayName:sc(tc()),numberOfDaysOfTheMonth:new Date(e.Y,e.M,0).getDate(),hours:e.h,minutes:e.m,seconds:e.s,milliSeconds:e.ms,timestamp:t,iso:new Date(t).toISOString()}},configurable:!1},toJSON:{value(){const t=this[uc];return Number.isFinite(t)?new Date(t).toISOString():"Invalid Date"},writable:!1,configurable:!1},toString:{value(){const t=this[uc];return Number.isFinite(t)?new Intl.DateTimeFormat(Yl(),{dateStyle:"medium",...Wl()?{timeZone:Wl()}:{timeZone:"UTC"}}).format(new Date(Wl()?t:t+6e4*Hl())):"Invalid Date"},writable:!1,configurable:!1},format:{value(t){return cc(this[uc],t)},writable:!1,configurable:!1},formatLongAgo:{value(t){return function(t,e={}){const{numeric:n="auto",style:s="long"}=e,i=((void 0!==e.now?rc(e.now):Date.now())-t)/1e3,r=Math.abs(i),o=i>=0?-1:1,a=new Intl.RelativeTimeFormat(Yl(),{numeric:n,style:s});for(const[t,e]of hc)if(r>=e)return a.format(o*Math.round(r/e),t);return a.format(0,"second")}(this[uc],t)},writable:!1,configurable:!1},add:{value(t,e){return this[uc]=oc(this[uc],t,e),this},writable:!1,configurable:!1},subtract:{value(t,e){return this[uc]=oc(this[uc],-t,e),this},writable:!1,configurable:!1},isBefore:{value(t){return this[uc]<rc(t)},writable:!1,configurable:!1},isAfter:{value(t){return this[uc]>rc(t)},writable:!1,configurable:!1},isFuture:{value(){return this[uc]>Date.now()},writable:!1,configurable:!1},isPresent:{value(){return ac(this[uc],Date.now())},writable:!1,configurable:!1},isToday:{value(){return ac(this[uc],Date.now())},writable:!1,configurable:!1},isYesterday:{value(){const t=oc(lc(Date.now()),-1,"day");return ac(this[uc],t)},writable:!1,configurable:!1},isTomorrow:{value(){const t=oc(lc(Date.now()),1,"day");return ac(this[uc],t)},writable:!1,configurable:!1},getDifference:{value(t,e){return function(t,e,n){const s=Ql(n),i=t-e;if("ms"===s)return i;if("second"===s)return Math.trunc(i/1e3);if("min"===s)return Math.trunc(i/6e4);if("hour"===s)return Math.trunc(i/36e5);const r=Hl(),o=Zl(t,r),a=Zl(e,r);if("day"===s||"week"===s){const n=Math.floor((t+6e4*r)/864e5)-Math.floor((e+6e4*r)/864e5);return"week"===s?Math.trunc(n/7):n}return"month"===s?12*(o.Y-a.Y)+(o.M-a.M):o.Y-a.Y}(this[uc],rc(t),e)},writable:!1,configurable:!1},getAge:{value(t){return function(t,e){const n=Hl(),s=Zl(t,n),i=Zl(e,n);let r=i.Y-s.Y,o=s.M,a=s.D;2===o&&29===a&&((l=i.Y)%4==0&&l%100!=0||l%400==0||(o=3,a=1));var l;return(i.M<o||i.M===o&&i.D<a)&&r--,Math.max(0,r)}(this[uc],void 0!==t?rc(t):Date.now())},writable:!1,configurable:!1}});export{Vi as $,Cl as Context,Si as Delete,si as ErrorTypes,gi as Fetch,mi as FetchClient,yi as Get,Rn as MA,me as NotificationManager,bi as Patch,vi as Post,wi as Put,Gs as Router,_e as SyncNotificationManager,On as ZeroPromise,Ie as _,Pe as _subToView,In as action,Jt as addStoreBeingRead,Hi as animatedIf,Ls as animatedRouter,Yi as animatedX,ia as arrayRange,le as assertComponentOuterContext,ae as assertNotInRestrictedContext,fs as asyncAction,yt as asyncAppend,gt as asyncReplace,os as atom,Zi as attr,Gn as blurInPreset,Kn as blurOutPreset,Hn as bouncePreset,Ns as buildPath,oi as buildRequestUrl,Vo as cacheAtom,us as cacheFn,ra as chunk,sa as clamp,bt as classMap,Ji as classes,Ae as cleanupScheduler,pi as clearInterceptors,Qn as collapseWidthPreset,re as componentRunningStatus,ol as computeAutoPlacement,en as configureCSS,us as createCacheManager,zn as createManagedTimer,ds as createPollingManager,is as createReactiveRunner,To as createTimedAtom,fc as date,gs as debounce,Ro as debouncedAtom,Ml as deepClone,es as deepFreeze,xi as deleteAction,es as df,tl as dialog,Es as effect,Ce as effectScheduler,qi as eleHook,Fe as event,Jn as expandWidthPreset,Pn as fadeInPreset,Dn as fadeOutPreset,Ei as fetchAction,_i as fetchClient,Xn as flipInPreset,Zn as flipOutPreset,Go as formAtom,Jo as get,Ai as getAction,ya as getAllProps,vc as getAllTimezones,bc as getCalendar,il as getCoords,ve as getCurrentHost,yc as getLocale,wc as getMonths,wa as getParentScope,wa as getScope,Gt as getStoresBeingRead,_c as getTimezoneOffset,kn as globalCSS,Me as globalScheduler,Oi as globalTheme,aa as groupBy,Et as guard,Us as hashAtom,b as html,er as htmlHook,as as iAtom,At as ifDefined,Tn as injectMatesAnimations,Ht as installDevToolsHooks,di as interceptAfter,ui as interceptBefore,fi as interceptError,bo as isAction,ii as isApiResponseSuccess,So as isAsyncAction,$o as isAsyncFunction,We as isAsyncValue,vo as isAtom,Mo as isChannel,Co as isConfirmationEvent,kl as isDefinedAsGetter,Yt as isDevToolsInstalled,Kt as isEffectRunning,ua as isEmail,la as isEmpty,Ao as isEvent,xo as isFunction,ko as isGetter,oe as isInRestrictedContext,_a as isMax,ma as isMin,Ps as isPathMatching,pa as isPattern,Zt as isReadTrackingEnabled,ha as isRequired,Se as isSSR,Eo as isSetter,wo as isUnit,ca as iterateDeeply,Ct as join,Mt as keyed,Mn as keyframes,lr as lazyLoad,wt as litCache,kt as live,qs as location,Os as lockNavigation,ce as logError,No as lsAtom,Oo as mapAtom,pr as masonryGrid,fa as maxLength,ga as memo,yr as memoTemplate,na as merge,da as minLength,Xs as navigateTo,Rs as navigationLocked,E as noChange,A as nothing,ta as omit,kr as on,Re as onAllMount,Ta as onBlur,Oe as onCleanup,Ha as onClickAway,ur as onConnect,Da as onCopy,La as onCut,Ja as onDOMReady,dr as onDisconnect,Ea as onError,Wa as onFileDrop,Ra as onFocus,rr as onHidden,sr as onIntersect,Xa as onInterval,Na as onKeyDown,ja as onKeyUp,$e as onMount,qa as onNavigate,za as onOffline,Oa as onOnline,Te as onPaint,Tr as onParent,Pa as onPaste,Aa as onReferenceChange,Ba as onResize,Ya as onScroll,ar as onScrolledIntoView,Fa as onSelectionChange,Ga as onSocket,Va as onStorageChange,Za as onTimeout,Ka as onUpdate,Ua as onVisibilityChange,ir as onVisible,ka as onWindow,xa as onWindowCapture,Ia as onWindowResize,$a as onWindowScroll,ys as paginatedAsyncAction,Wo as paginationAtom,ki as patchAction,Is as pathAtom,Qo as pick,rl as placementTransform,te as popEffect,sl as popup,ll as portal,Ci as postAction,qn as pulsePreset,Qt as pushEffect,Mi as putAction,Hs as qsAtom,Ll as randomId,xt as range,Ms as ref,je as registerCleanup,Gi as removeAttr,Qi as removeClasses,xr as removeOn,Ir as removeStyle,U as render,Rr as renderSwitch,Ts as renderX,Tt as repeat,Ee as resetComponentState,He as resolveAsyncValue,ne as restoreTracking,zi as rootCSS,Zs as route,Dl as safeSVG,ke as safetyCheck,ee as saveAndEnableTracking,Fn as scaleInPreset,Vn as scaleOutPreset,va as scope,zo as setAtom,gc as setLocale,ks as setRef,Qs as setSSRApiLookup,be as setSSRMode,ti as setSSRRequest,pc as setTimezone,mc as setTimezoneOffset,ze as setter,Bn as shakePreset,as as signal,Nn as slideInPreset,jn as slideOutPreset,Wn as spinPreset,Yn as springInPreset,jo as ssAtom,se as startTracking,ie as stopTracking,zr as style,zt as styleMap,bn as stylesheet,ls as superAtom,S as svg,vs as taskAction,qo as themeAtom,ws as throttle,Uo as throttledAtom,Dr as timer,wl as tip,Fo as titleAtom,vl as tooltip,ns as trackAndSubscribe,oa as uniqBy,zs as unlockNavigation,Z as unsafeHTML,Dl as unsafeSVG,Dt as until,Ye as unwrapModule,Ne as useContext,va as useScope,Sa as useState,De as useStore,Ll as uuid,Ko as validateAll,ss as validateReactiveFunction,$s as view,_o as virtualGrid,mo as virtualList,go as virtualMasonry,Le as watch,Lt as when,ye as withHost,ts as withStaggerPreset,Al as ws,xs as x,Ue as xTabEvent};
|
|
121
190
|
//# sourceMappingURL=index.esm.js.map
|