@domphy/ui 0.18.11 → 0.18.13

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.
@@ -2,5 +2,5 @@
2
2
  ${r.join(" \u2192 ")}`),!0}_flushAll(){this._scheduled=!1,Te.delete(this);let e=this._pending;this._pending=new Map;for(let[t,{args:r,chain:o}]of e)J=o,this._flush(t,r);J=[],this._pending.size===0&&(this._selfDepth=0)}_flush(e,t){if(!this._listeners)return;let r=this._listeners[e];if(r){J.push([this,e]),this._flushing.set(e,t);for(let o of[...r])if(r.has(o))try{o(...t)}catch(i){console.error(i)}this._flushing.delete(e),J.pop()}}};function bo(){return Te.size>0}function vo(){let e=0;for(;Te.size>0;){if(e++>1e4){console.error("[Domphy] flushSync: notifier queue did not settle");break}let t=[...Te];Te.clear();for(let r of t)r._flushAll()}}var wt=class{constructor(e,t=typeof e){this.name=t,this._isState=!0,this._notifier=new Ae,this.initialValue=e,this._value=e}get(e){if(e)this.addListener(e);else{let t=$t();t&&this.addListener(t.handler)}return this._value}set(e){this._notifier&&(this._value=e,this._notifier.notify(this.name,e))}reset(){this.set(this.initialValue)}addListener(e){return this._notifier?this._notifier.addListener(this.name,e):()=>{}}removeListener(e){this._notifier&&this._notifier.removeListener(this.name,e)}_dispose(){this._notifier&&(this._notifier._dispose(),this._notifier=null)}};function D(e={},t={}){let r=["animation","transition","boxShadow","textShadow","background","fontFamily"],o=["class","rel","transform","acceptCharset","sandbox"],i=["content"];Object.prototype.toString.call(t)==="[object Object]"&&Object.getPrototypeOf(t)===Object.prototype&&(t=ae(t));for(let n in t){let a=t[n];if(!(a==null||a===""))if(typeof a=="object"&&!Array.isArray(a))typeof e[n]=="object"?e[n]=D(e[n],a):e[n]=a;else if(r.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(", ")}}else e[n]=[e[n],a].filter(c=>c).join(", ");else if(i.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join("")}}else e[n]=[e[n],a].filter(c=>c).join("");else if(o.includes(n))if(typeof e[n]=="function"||typeof a=="function"){let c=e[n];e[n]=u=>{let h=typeof c=="function"?c(u):c,m=typeof a=="function"?a(u):a;return[h,m].filter(d=>d).join(" ")}}else e[n]=[e[n],a].filter(c=>c).join(" ");else if(n.startsWith("on")){let c=n.replace("on","").toLowerCase();Zn(e,c,a)}else if(n.startsWith("_on")){let c=n.replace("_on","");Jn(e,c,a)}else e[n]=a}return e}function _e(e=""){let t=2166136261;for(let r=0;r<e.length;r++)t^=e.charCodeAt(r),t=t*16777619>>>0;return String.fromCharCode(97+t%26)+t.toString(16)}function f(e,t){return e instanceof wt||e!=null&&e._isState?e:new wt(e,t)}function Gn(e){return typeof e=="object"&&e!==null&&e._isState===!0}function Xn(e){return{_isState:!0,get(t){return e.get(t)}}}function Jn(e,t,r){let o=`_on${t}`,i=e[o];typeof i=="function"?e[o]=(...n)=>{i(...n),r(...n)}:e[o]=r}function Zn(e,t,r){let o=qn[t];if(!o)throw Error(`invalid event name "${t}"`);let i=e[o];typeof i=="function"?e[o]=(n,a)=>{i(n,a),r(n,a)}:e[o]=r}function ae(e,t=new WeakMap){if(e===null||typeof e!="object"||typeof e=="function")return e;if(t.has(e))return t.get(e);let r=Object.getPrototypeOf(e);if(r!==Object.prototype&&!Array.isArray(e))return e;let o;if(Array.isArray(e)){o=[],t.set(e,o);for(let i of e)o.push(ae(i,t));return o}if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(e instanceof Map){o=new Map,t.set(e,o);for(let[i,n]of e)o.set(ae(i,t),ae(n,t));return o}if(e instanceof Set){o=new Set,t.set(e,o);for(let i of e)o.add(ae(i,t));return o}if(ArrayBuffer.isView(e))return new e.constructor(e);if(e instanceof ArrayBuffer)return e.slice(0);o=Object.create(r),t.set(e,o);for(let i of Reflect.ownKeys(e))o[i]=ae(e[i],t);return o}function So(e,t=!1){if(Object.prototype.toString.call(e)!=="[object Object]")throw Error(`typeof ${e} is invalid DomphyElement`);let r=Object.keys(e);for(let o=0;o<r.length;o++){let i=r[o],n=e[i];if(o===0&&!Pt.includes(i)&&!i.includes("-")&&!t)throw Error(`key ${i} is not valid HTML tag name`);if(i==="style"&&n&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"style" must be a object');if(i==="$")e.$.forEach(a=>So(a,!0));else{if(i.startsWith("_on")&&typeof n!="function")throw Error(`hook ${i} value "${n}" must be a function `);if(i.startsWith("on")&&typeof n!="function")throw Error(`event ${i} value "${n}" must be a function `);if(i==="_portal"&&typeof n!="function")throw Error('"_portal" must be a function return HTMLElement');if(i==="_context"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_context" must be a object');if(i==="_metadata"&&Object.prototype.toString.call(n)!=="[object Object]")throw Error('"_metadata" must be a object');if(i==="_key"&&typeof n!="string"&&typeof n!="number")throw Error('"_key" must be a string or number')}}return!0}function Xe(e){return/<([a-z][\w-]*)(\s[^>]*)?>.*<\/\1>|<([a-z][\w-]*)(\s[^>]*)?\/>/i.test(e.trim())}function Qn(e){let t=e.replace(/\s+on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"");return t=t.replace(/\/on[a-zA-Z][\w-]*\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]*)/g,"/"),t=t.replace(/((?:href|src|action|formaction)\s*=\s*)(["']?)[\s]*javascript:[^"'\s>]*/gi,"$1$2#"),t}function xo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function wo(e){return Object.keys(e).find(t=>Pt.includes(t))}function Co(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function er(e){if(e.indexOf("@")===0)return[e];for(var t=[],r=0,o=0,i="",n=0,a=e.length;n<a;n++){var c=e[n];if(c==="(")r+=1;else if(c===")")r-=1;else if(c==="[")o+=1;else if(c==="]")o-=1;else if(c===","&&!r&&!o){t.push(i.trim()),i="";continue}i+=c}return t.push(i.trim()),t}function Ct(e){let t=e.trim();return t.startsWith("@")?t.replace(/\s+/g,""):t.replace(/\s*([>+~,])\s*/g,"$1").replace(/\s+/g," ").replace(/\(\s*odd\s*\)/g,"(2n+1)").replace(/\(\s*even\s*\)/g,"(2n)").trim()}function tr(e,t){for(let r=0;r<e.length;r++){let o=e[r],i=null;typeof o.selectorText=="string"?i=Ct(o.selectorText):typeof o.cssText=="string"&&o.cssText.startsWith("@")&&(i=Ct(o.cssText.split("{")[0])),i&&!t.has(i)&&t.set(i,o)}return t}function ko(e,t){var r;let o=e.querySelector("#domphy-style");if(!o){o=document.createElement("style"),o.id="domphy-style";let i=t!=null?t:Kn().cspNonce;i&&(o.nonce=i),e.appendChild(o)}return o.dataset.domphyBase!=="true"&&((r=o.sheet)==null||r.insertRule("[hidden] { display: none !important; }",0),o.dataset.domphyBase="true"),o}var kt=e=>{if(Array.isArray(e.$)){let t={};return e.$.forEach(r=>D(t,kt(r))),delete e.$,D(t,e),t}else return e},or=class{constructor(e,t,r){this._notifier=new Ae,this._releases=[],this.parent=r,this.isBoolean=Ot.includes(e),uo.includes(e)?this.name=e:this.name=Co(e),this.value=void 0,this.set(t)}render(){if(!this.parent||!this.parent.domElement)return;let e=this.parent.domElement,t=["value"];this.isBoolean?this.value===!1||this.value==null?e.removeAttribute(this.name):e.setAttribute(this.name,this.value===!0?"":this.value):this.value==null?e.removeAttribute(this.name):t.includes(this.name)?e[this.name]=this.value:e.setAttribute(this.name,this.value)}set(e){var t,r;let o=this.value;if(this._releases.length){for(let i of this._releases)i();this._releases=[]}if(e==null)this.value=null;else if(typeof e=="function"){let i=()=>{if(!this.parent||this.parent._disposed)return;let n=this.value;this.value=this.isBoolean?!!e(i):e(i),this.render(),n!==this.value&&this._notifier.notify(this.name,this.value)};i.elementNode=this.parent,i.debug=`class:${(t=this.parent)==null?void 0:t.tagName}_${(r=this.parent)==null?void 0:r.nodeId} attribute:${this.name}`,i.onSubscribe=n=>{this._releases.push(n),this.parent&&this.parent.addHook("BeforeRemove",()=>{n(),i=null})},this.value=this.isBoolean?!!e(i):e(i)}else this.value=this.isBoolean?!!e:e;this.render(),o!==this.value&&this._notifier.notify(this.name,this.value)}addListener(e){let t=e;t.onSubscribe=r=>{var o;return(o=this.parent)==null?void 0:o.addHook("BeforeRemove",r)},this._notifier.addListener(this.name,t)}remove(){this.parent&&this.parent.attributes&&this.parent.attributes.remove(this.name),this._dispose()}_dispose(){this._notifier._dispose(),this.value=null,this.parent=null}generateHTML(){let{name:e,value:t}=this;if(this.isBoolean)return t?`${e}`:"";{let r=Array.isArray(t)?JSON.stringify(t):t;return`${e}="${xo(String(r))}"`}}},Eo=class{constructor(e){this.items={},this.parent=e}generateHTML(){if(!this.items)return"";let e=Object.values(this.items).map(t=>t.generateHTML()).join(" ");return e?` ${e}`:""}get(e){var t;if(this.items)return(t=this.items[e])==null?void 0:t.value}set(e,t){!this.items||!this.parent||(this.items[e]?this.items[e].set(t):this.items[e]=new or(e,t,this.parent))}addListener(e,t){this.has(e)&&this.items[e].addListener(t)}has(e){return this.items?Object.hasOwn(this.items,e):!1}remove(e){this.items&&(this.items[e]&&(this.items[e]._dispose(),delete this.items[e]),this.parent&&this.parent.domElement&&this.parent.domElement instanceof Element&&this.parent.domElement.removeAttribute(e))}_dispose(){if(this.items)for(let e in this.items)this.items[e]._dispose();this.items=null,this.parent=null}toggle(e,t){if(!Ot.includes(e))throw Error(`${e} is not a boolean attribute`);t===!0?this.set(e,!0):t===!1?this.remove(e):this.has(e)?this.remove(e):this.set(e,!0)}addClass(e){if(!e||typeof e!="string")return;let t=(o,i)=>{let n=(o||"").split(" ").filter(a=>a);return!n.includes(i)&&n.push(i),n.join(" ")},r=this.get("class");typeof r=="function"?this.set("class",()=>t(r(),e)):this.set("class",t(r,e))}hasClass(e){return!e||typeof e!="string"?!1:(this.get("class")||"").split(" ").filter(t=>t).includes(e)}toggleClass(e){!e||typeof e!="string"||(this.hasClass(e)?this.removeClass(e):this.addClass(e))}removeClass(e){if(!e||typeof e!="string")return;let t=(this.get("class")||"").split(" ").filter(r=>r).filter(r=>r!==e);t.length>0?this.set("class",t.join(" ")):this.remove("class")}replaceClass(e,t){!e||!t||typeof e!="string"||typeof t!="string"||this.hasClass(e)&&(this.removeClass(e),this.addClass(t))}},Ee=typeof process!="undefined"&&process.env!=null&&process.env.NODE_ENV!=="production",nr=class{constructor(e,t,r){this.value="",this.name=e,this.cssName=Co(e),this.parentRule=r,this.set(t)}_domUpdate(){if(!this.parentRule)return;let e=this.parentRule.domRule;if(e&&e.style){let t=e.style;t.setProperty(this.cssName,String(this.value)),de[this.name]&&de[this.name].forEach(r=>{t.setProperty(`-${r}-${this.cssName}`,String(this.value))})}}_dispose(){this.value="",this.parentRule=null}set(e){var t,r,o,i;if(typeof e=="function"){let n=(()=>{var a;!this.parentRule||(a=this.parentRule.parentNode)!=null&&a._disposed||(this.value=e(n),this._domUpdate())});n.onSubscribe=a=>{var c;(c=this.parentRule.parentNode)==null||c.addHook("BeforeRemove",()=>{a(),n=null})},n.elementNode=this.parentRule.root,n.debug=`class:${(r=(t=this.parentRule)==null?void 0:t.root)==null?void 0:r.tagName}_${(i=(o=this.parentRule)==null?void 0:o.root)==null?void 0:i.nodeId} style:${this.name}`,this.value=e(n)}else this.value=e;this._domUpdate()}remove(){if(this.parentRule){if(this.parentRule.domRule instanceof CSSStyleRule){let e=this.parentRule.domRule.style;e.removeProperty(this.cssName),de[this.name]&&de[this.name].forEach(t=>{e.removeProperty(`-${t}-${this.cssName}`)})}delete this.parentRule.styleBlock[this.name],this._dispose()}}cssText(){let e=`${this.cssName}: ${this.value}`;return de[this.name]&&de[this.name].forEach(t=>{e+=`; -${t}-${this.cssName}: ${this.value}`}),e}},me=class Et{constructor(t,r){this.domRule=null,this.styleBlock={},this.selectorText=t,this.styleList=new To(this),this.parent=r}_dispose(){if(this.styleBlock)for(let t of Object.values(this.styleBlock))t._dispose();this.styleList&&this.styleList._dispose(),this.styleBlock=null,this.styleList=null,this.domRule=null,this.parent=null}get root(){let t=this.parent;for(;t instanceof Et;)t=t.parent;return t}get parentNode(){let t=this.parent;for(;t&&t instanceof Et;)t=t.parent;return t}insertStyle(t,r){this.styleBlock&&(this.styleBlock[t]?this.styleBlock[t].set(r):this.styleBlock[t]=new nr(t,r,this))}removeStyle(t){this.styleBlock&&this.styleBlock[t]&&this.styleBlock[t].remove()}cssText(){if(!this.styleBlock||!this.styleList)return"";let t=Object.values(this.styleBlock).map(o=>o.cssText()).join(";"),r=this.styleList.cssText();return`${this.selectorText} { ${t} ${r} } `}mount(t){!t||!this.styleList||(this.domRule=t,"cssRules"in t&&this.styleList.mount(t.cssRules))}remove(){if(this.domRule&&this.domRule.parentStyleSheet){let t=this.domRule.parentStyleSheet,r=t.cssRules;for(let o=0;o<r.length;o++)if(r[o]===this.domRule){t.deleteRule(o);break}}this._dispose()}render(t){if(!this.styleBlock||!this.styleList)return;let r=Object.values(this.styleBlock).map(o=>o.cssText()).join(";");try{if(this.selectorText.startsWith("@")){if(/^@(media|supports|container|layer)\b/.test(this.selectorText)){let o=t.insertRule(`${this.selectorText} {}`,t.cssRules.length),i=t.cssRules[o];"cssRules"in i&&(this.mount(i),this.styleList.render(i))}else if(this.selectorText.startsWith("@keyframes")||this.selectorText.startsWith("@font-face")){let o=this.cssText(),i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];this.mount(n)}}else{let o=`${this.selectorText} { ${r} }`,i=t.insertRule(o,t.cssRules.length),n=t.cssRules[i];n&&"selectorText"in n&&this.mount(n)}}catch(o){console.warn("Failed to insert rule:",this.selectorText,o)}}},To=class{constructor(e){this.items=[],this.domStyle=null,this.parent=e}get parentNode(){let e=this.parent;for(;e&&e instanceof me;)e=e.parent;return e}addCSS(e,t=""){if(!this.items||!this.parent)return;let r={},o=[];function i(n,a){return n.startsWith("&")?`${a}${n.slice(1)}`:`${a} ${n}`}for(let n in e){let a=e[n],c=er(n);for(let u of c){let h=i(u,t);if(/^@(container|layer|supports|media)\b/.test(u)){if(typeof a=="object"&&a!=null){let m=new me(u,this.parent);m.styleList.addCSS(a,t),o.push(m)}}else if(u.startsWith("@keyframes")){let m=new me(u,this.parent);m.styleList.addCSS(a,""),this.items.push(m)}else if(u.startsWith("@font-face")){let m=new me(u,this.parent);for(let d in a)m.insertStyle(d,a[d]);this.items.push(m)}else if(typeof a=="object"&&a!=null){let m=new me(h,this.parent);this.items.push(m);for(let[d,g]of Object.entries(a))if(typeof g=="object"&&g!=null){let b=i(d,h);d.startsWith("&")?this.addCSS(g,b):m.styleList.insertRule(b).styleList.addCSS(g,b)}else m.insertStyle(d,g)}else r[u]=a}}if(Object.keys(r).length){let n=new me(t,this.parent);for(let a in r)n.insertStyle(a,r[a]);this.items.push(n)}for(let n of o)this.items.push(n)}cssText(){return this.items?this.items.map(e=>e.cssText()).join(""):""}insertRule(e){if(!this.items||!this.parent)return null;let t=this.items.find(r=>r.selectorText===e);return t||(t=new me(e,this.parent),this.items.push(t)),t}hydrate(e){if(this.items)for(let t of this.items){let r=e.get(Ct(t.selectorText));r&&t.mount(r)}}mount(e){if(!this.items)return;if(!e)throw Error("Require domRuleList argument");let t=0,r=o=>o.replace("(odd)","(2n+1)").replace("(even)","(2n)");this.items.forEach((o,i)=>{let n=i-t,a=e[n];a&&(o.selectorText.startsWith("@")&&a instanceof CSSKeyframesRule||"keyText"in a?o.mount(a):"selectorText"in a?a.selectorText!==r(o.selectorText)?t+=1:o.mount(a):"cssRules"in a&&o.mount(a))})}render(e){e instanceof HTMLStyleElement?(this.domStyle=e,this.items.forEach(t=>t.render(e.sheet))):e instanceof CSSGroupingRule&&this.items.forEach(t=>t.render(e))}_dispose(){if(this.items)for(let e=0;e<this.items.length;e++)this.items[e]._dispose();this.items=[],this.parent=null,this.domStyle=null}},V=class ke{constructor(t,r=null,o=0){this._disposed=!1,this._beforeRemoveFired=!1,this.type="ElementNode",this.parent=null,this.children=new _o(this),this.styles=new To(this),this.attributes=new Eo(this),this.domElement=null,this._hooks={},this._events=null,this._boundEvents=new Set,this._context={},this._metadata={},this.key=null;var i,n;t=ae(t),So(t),t.style=t.style||{},this.parent=r,this.tagName=wo(t),t=kt(t),this.key=(i=t._key)!=null?i:null,this._context=t._context||{},this._metadata=t._metadata||{};let a=`${(n=this.parent)==null?void 0:n.nodeId}.${o}`,c=JSON.stringify(t.style||{},(h,m)=>typeof m=="function"?a:m);this.nodeId=_e(a+c),this.attributes.addClass(`${this.tagName}_${this.nodeId}`),t._onSchedule&&t._onSchedule(this,t),this.merge(t);let u=t[this.tagName];u!=null&&(typeof u=="function"?this._setupFunctionChildren(u):this.children.update(Array.isArray(u)?u:[u])),this._hooks.Init&&this._hooks.Init(this)}_setupFunctionChildren(t){let r=()=>{if(!this._disposed)try{let o=t(r);this.children.update(Array.isArray(o)?o:[o])}catch(o){this._handleError(o)}};r.elementNode=this,r.debug=`class:${this.tagName}_${this.nodeId} children`,r.onSubscribe=o=>{this._childrenRelease=()=>{o(),r=null},this.addHook("BeforeRemove",()=>{var i;(i=this._childrenRelease)==null||i.call(this),this._childrenRelease=void 0})},r()}_createDOMNode(){let t=mo.includes(this.tagName)?document.createElementNS("http://www.w3.org/2000/svg",this.tagName):document.createElement(this.tagName);if(this.domElement=t,this._events)for(let r in this._events)this._bindEvent(r);return this.attributes&&Object.values(this.attributes.items).forEach(r=>r.render()),t}_bindEvent(t){if(!this.domElement||this._boundEvents.has(t))return;this._boundEvents.add(t);let r=o=>{var i,n;return(n=(i=this._events)==null?void 0:i[t])==null?void 0:n.call(i,o,this)};this.domElement.addEventListener(t,r),this.addHook("BeforeRemove",o=>{var i;(i=o.domElement)==null||i.removeEventListener(t,r),r=null})}_dispose(){var t,r,o,i;this._disposed||(this._disposed=!0,this._beforeRemoveFired||(this._beforeRemoveFired=!0,(r=(t=this._hooks).BeforeRemove)==null||r.call(t,this,()=>{})),this.children&&this.children._dispose(),this.styles&&(this.styles.items.forEach(n=>n.remove()),this.styles._dispose()),this.attributes&&this.attributes._dispose(),(i=(o=this._hooks).Remove)==null||i.call(o,this),this.domElement=null,this._hooks={},this._events=null,this._context={},this._metadata={},this.parent=null)}merge(t){D(this._context,t._context),D(this._metadata,t._metadata);let r=Object.keys(t);for(let o=0;o<r.length;o++){let i=r[o],n=t[i];["$","_onSchedule","_key","_context","_metadata","style",this.tagName].includes(i)||(["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"].includes(i)?this.addHook(i.substring(3),n):i.startsWith("on")?this.addEvent(i.substring(2).toLowerCase(),n):i==="_portal"?this._portal=n:i==="class"&&typeof n=="string"?this.attributes.addClass(n):this.attributes.set(i,n))}t.style&&this.styles.addCSS(t.style||{},`.${`${this.tagName}_${this.nodeId}`}`)}patch(t){var r;let o=ae(t);o.style=o.style||{},o=kt(o);let i=o[this.tagName];if(typeof i=="function")(r=this._childrenRelease)==null||r.call(this),this._childrenRelease=void 0,this._setupFunctionChildren(i);else{let m=i==null?[]:Array.isArray(i)?i:[i];this.children.update(m,!!this.domElement,!0)}o._context&&D(this._context,o._context),o._metadata&&D(this._metadata,o._metadata);let n=`${this.tagName}_${this.nodeId}`,a=["$","_onSchedule","_key","_context","_metadata","style",this.tagName],c=["_onInit","_onInsert","_onMount","_onBeforeUpdate","_onUpdate","_onBeforeRemove","_onRemove","_onError"],u=new Set(["class"]),h=null;this._events={};for(let m of Object.keys(o)){if(a.includes(m)||c.includes(m)||m==="_portal")continue;let d=o[m];m.startsWith("on")&&typeof d=="function"?this.addEvent(m.substring(2).toLowerCase(),d):m==="class"&&typeof d=="string"?h=d:(this.attributes.set(m,d),u.add(m))}if(this.attributes.set("class",h?`${n} ${h}`:n),this.attributes.items)for(let m of Object.keys(this.attributes.items))u.has(m)||this.attributes.remove(m);if(this._events)for(let m in this._events)this._bindEvent(m)}_handleError(t){let r=this;for(;r;){if(r._hooks.Error){let o=r;r._hooks.Error(o,t,()=>{o.children.update([])});return}r=r.parent}console.error("[Domphy] Unhandled error in reactive child:",t)}addEvent(t,r){this._events=this._events||{};let o=this._events[t];typeof o=="function"?this._events[t]=(i,n)=>{o(i,n),r(i,n)}:this._events[t]=r}addHook(t,r){let o=this._hooks[t];if(typeof o=="function"){let i=((...n)=>{o(...n),r(...n)});try{Object.defineProperty(i,"length",{value:Math.max(o.length,r.length),configurable:!0})}catch(n){}this._hooks[t]=i}else this._hooks[t]=r}getRoot(){let t=this;for(;t&&t instanceof ke&&t.parent;)t=t.parent;return t}getContext(t){let r=this;for(;r&&(!r._context||!Object.hasOwn(r._context,t));)r=r.parent;return r&&r._context?r._context[t]:void 0}setContext(t,r){this._context=this._context||{},this._context[t]=r}getMetadata(t){return this._metadata?this._metadata[t]:void 0}setMetadata(t,r){this._metadata=this._metadata||{},this._metadata[t]=r}generateCSS(){if(!this.styles||!this.children)return"";let t=this.styles.cssText();return t+=this.children.items.map(r=>r instanceof ke?r.generateCSS():"").join(""),t}generateHTML(){if(!this.children||!this.attributes)return"";let t=this.attributes.generateHTML();if(ho.includes(this.tagName))return`<${this.tagName}${t}>`;let r=this.children.generateHTML();return`<${this.tagName}${t}>${r}</${this.tagName}>`}mount(t,r){if(!t)throw new Error("Missing dom node on bind");if(Ee&&!r&&this.parent===null&&t.childNodes.length>0&&console.warn("[Domphy] mount() was called without a style element on already-rendered DOM. Reactive style updates after hydration will be dropped \u2014 pass the server-rendered <style> element as the second argument to mount()."),this.domElement=t,this._events)for(let o in this._events)this._bindEvent(o);if(this.children&&this.children.items.forEach((o,i)=>{let n=t.childNodes[i];n&&(o instanceof ke?o.mount(n):o.domText=n)}),r){let o=r.sheet;o&&this._hydrateStyles(tr(o.cssRules,new Map))}this._hooks.Mount&&this._hooks.Mount(this)}_hydrateStyles(t){var r;if((r=this.styles)==null||r.hydrate(t),this.children)for(let o of this.children.items)o instanceof ke&&o._hydrateStyles(t)}render(t){let r=this._createDOMNode();t.appendChild(r),this._hooks.Mount&&this._hooks.Mount(this);let o=this.getRoot().styles.domStyle,i=t.getRootNode(),n=i instanceof ShadowRoot?i:document.head;return o||(o=ko(n)),this.styles.render(o),this.children.items.forEach(a=>{if(a instanceof ke&&a._portal){let c=a._portal(this.getRoot());c&&a.render(c)}else a.render(r)}),r}remove(){if(this.parent)this.parent.children.remove(this);else{let t=()=>{var r;(r=this.domElement)==null||r.remove(),this._dispose()};if(this._hooks.BeforeRemove&&this.domElement){let r=!1,o=()=>{r||(r=!0,t())};this._beforeRemoveFired=!0,this._hooks.BeforeRemove(this,o),this._hooks.BeforeRemove.length<2&&!r?o():Ee&&!r&&setTimeout(()=>{r||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else t()}}},vt=class{constructor(e,t){this.type="TextNode",this.parent=t,this.text=e===""?"\u200B":String(e)}_createDOMNode(){let e;if(Xe(this.text)){let t=document.createElement("template");t.innerHTML=this.text.trim(),t.content.querySelectorAll("*").forEach(r=>{for(let o of Array.from(r.attributes))/^on/i.test(o.name)?r.removeAttribute(o.name):/^(?:href|src|action|formaction)$/i.test(o.name)&&/^\s*javascript:/i.test(o.value)&&r.setAttribute(o.name,"#")}),e=t.content.firstChild||document.createTextNode("")}else e=document.createTextNode(this.text);return this.domText=e,e}setText(e){var t;let r=e===""?"\u200B":String(e);if(r===this.text&&this.domText)return;let o=Xe(this.text);if(this.text=r,!this.domText)return;if(!o&&!Xe(r)&&this.domText.nodeType===3){this.domText.nodeValue=r;return}let i=this.domText,n=this._createDOMNode();(t=i.parentNode)==null||t.replaceChild(n,i)}_dispose(){this.domText=void 0,this.text=""}generateHTML(){return this.text==="\u200B"?"&#8203;":Xe(this.text)?Qn(this.text):xo(this.text)}render(e){let t=this._createDOMNode();e.appendChild(t)}},Tt=new Set;function rr(){Tt.clear()}var _o=class{constructor(e){this.items=[],this._nextKey=0,this.owner=e}_createNode(e){return typeof e=="object"&&e!==null?new V(e,this.owner,this._nextKey++):new vt(e==null?"":String(e),this.owner)}_moveDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof V?e.domElement:e.domText;if(!o)return;let i=this.items[t+1],n=i instanceof V?i.domElement:i instanceof vt?i.domText:null;o!==n&&r.insertBefore(o,n!=null?n:null)}_swapDomElement(e,t){if(!this.owner||!this.owner.domElement)return;let r=this.owner.domElement,o=e instanceof V?e.domElement:e.domText,i=t instanceof V?t.domElement:t.domText;if(!o||!i)return;let n=o.nextSibling,a=i.nextSibling;r.insertBefore(o,a),r.insertBefore(i,n)}update(e,t=!0,r=!1){var o,i,n,a;let c=this.items.slice(),u=new Map;for(let v of c)v instanceof V&&v.key!==null&&v.key!==void 0&&u.set(v.key,v);!r&&this.owner.domElement&&((i=(o=this.owner._hooks)==null?void 0:o.BeforeUpdate)==null||i.call(o,this.owner,e));let h=new Set(c),m=new Set,d=0,g=Ee&&c.length>0?e.length!==c.length:!1;for(let v=0;v<e.length;v++){let S=e[v],x=typeof S=="object"&&S!==null,C=x?S._key:void 0,k=x?wo(S):void 0;if(Ee&&x&&C===void 0&&d++,C!==void 0){let E=u.get(C);if(E instanceof V&&E.tagName===k){u.delete(C);let _=this.items.indexOf(E);if(_!==v&&_>=0){let O=!!E._portal;this.move(_,v,O?!1:t,!0)}E.parent=this.owner,E.patch(S),m.add(E);continue}}else if(x){let E=this.items[v];if(E instanceof V&&E.key==null&&E.tagName===k&&h.has(E)&&!m.has(E)){E.parent=this.owner,E.patch(S),m.add(E);continue}}else{let E=this.items[v];if(E instanceof vt&&h.has(E)&&!m.has(E)){E.setText(S==null?"":S),m.add(E);continue}}m.add(this.insert(S,v,t,!0))}let b=this.items.slice(e.length);for(let v of b)this.remove(v,t,!0);if(u.forEach(v=>this.remove(v,t,!0)),Ee&&c.length>0&&d>0&&g){let v=this.owner.nodeId;if(!Tt.has(v)){Tt.add(v);let S=`[domphy] unkeyed list length changed \u2014 DOM nodes reused by position may not match their data slot (focus/scroll/input-value drift). Add _key to each item. (parent <${this.owner.tagName}>, ${d} unkeyed item${d===1?"":"s"})`;console.warn(S)}}r||(a=(n=this.owner._hooks)==null?void 0:n.Update)==null||a.call(n,this.owner)}insert(e,t,r=!0,o=!1){var i,n;let a=this.items.length,c=typeof t!="number"||Number.isNaN(t)||t<0||t>a?a:t,u=this._createNode(e);if(this.items.splice(c,0,u),u instanceof V){u._hooks.Insert&&u._hooks.Insert(u);let h=this.owner.domElement;if(r&&h)if(u._portal){let m=u._portal(this.owner.getRoot());m&&u.render(m)}else{let m=u._createDOMNode(),d=(i=h.childNodes[c])!=null?i:null;h.insertBefore(m,d);let g=h.getRootNode(),b=g instanceof ShadowRoot?g:document.head,v=ko(b);u.styles.render(v),u._hooks.Mount&&u._hooks.Mount(u),u.children.items.forEach(S=>{if(S instanceof V&&S._portal){let x=S._portal(S.getRoot());x&&S.render(x)}else S.render(m)})}}else{let h=this.owner.domElement;if(r&&h){let m=u._createDOMNode(),d=(n=h.childNodes[c])!=null?n:null;h.insertBefore(m,d)}}return!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner),u}remove(e,t=!0,r=!1){let o=this.items.indexOf(e);if(!(o<0)){if(e instanceof V){if(e._beforeRemoveFired)return;let i=()=>{let n=e.domElement,a=this.items.indexOf(e);a>=0&&this.items.splice(a,1),t&&n&&n.remove(),e._dispose()};if(e._hooks.BeforeRemove&&e.domElement){let n=!1,a=()=>{n||(n=!0,i())};e._beforeRemoveFired=!0,e._hooks.BeforeRemove(e,a),e._hooks.BeforeRemove.length<2&&!n?a():Ee&&!n&&setTimeout(()=>{n||console.warn("[Domphy] _onBeforeRemove declared a `done` parameter (e.g. an exit animation) but did not call it within 5s \u2014 the element will stay in the DOM. Call done() when cleanup finishes.")},5e3)}else i()}else{let i=e.domText;this.items.splice(o,1),t&&i&&i.remove(),e._dispose()}!r&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}}clear(e=!0,t=!1){if(this.items.length===0)return;let r=this.items.slice();for(let o of r)this.remove(o,e,!0);!t&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}_dispose(){this.items.forEach(e=>e._dispose()),this.items=[]}swap(e,t,r=!0,o=!1){if(e<0||t<0||e>=this.items.length||t>=this.items.length||e===t)return;let i=this.items[e],n=this.items[t];this.items[e]=n,this.items[t]=i,r&&this._swapDomElement(i,n),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}move(e,t,r=!0,o=!1){if(e<0||e>=this.items.length||t<0||t>=this.items.length||e===t)return;let i=this.items[e];this.items.splice(e,1),this.items.splice(t,0,i),r&&this._moveDomElement(i,t),!o&&this.owner.domElement&&this.owner._hooks.Update&&this.owner._hooks.Update(this.owner)}generateHTML(){let e="";for(let t of this.items)e+=t.generateHTML();return e}},he=new Set,_t=!1;function Oo(e){he.add(e),!_t&&(_t=!0,Dt(Po))}function Po(){for(_t=!1;he.size>0;){let e=[...he];he.clear();for(let t of e)try{t()}catch(r){console.error("[Domphy] Uncaught error in effect:",r)}}}function ir(){let e=0;for(;bo()||he.size>0;){if(e++>1e4){console.error("[Domphy] flushSync did not settle");break}vo(),Po()}}var Me=[];function ar(){return Me.length?Me[Me.length-1]:null}function Lt(e){let t=ar();t&&t._add(e)}var lr=class{constructor(){this._disposers=new Set,this._stopped=!1}_add(e){if(this._stopped){e();return}this._disposers.add(e)}run(e){Me.push(this);try{return e()}finally{Me.pop()}}stop(){if(!this._stopped){this._stopped=!0;for(let e of this._disposers)e();this._disposers.clear()}}};function sr(){let e=new lr;return Lt(()=>e.stop()),e}function $o(e){let t=!1,r=!1,o=()=>{t||n()},i=new po(()=>{t||Oo(o)}),n=()=>{if(!(t||r)){r=!0,i.reset();try{go(i,e)}finally{r=!1}}},a=()=>{t||(t=!0,i.reset(),he.delete(o))};return Lt(a),n(),a}function cr(e){let t="computed",r=new Ae,o,i=!0,n=!1,a=()=>{i&&r.listenerCount(t)>0&&h()},c=new po(()=>{i||(i=!0,Oo(a))}),u=()=>{c.reset(),o=go(c,e),i=!1,n=!0},h=()=>{let d=o,g=n;u(),!(g&&o===d)&&r.notify(t,o)},m=d=>{if(d)r.addListener(t,d);else{let g=$t();g&&r.addListener(t,g.handler)}return i&&u(),o};return Lt(()=>{c.reset(),he.delete(a),r._dispose()}),{_isState:!0,_notifier:r,get:m}}function ur(e){return yo(e)}function mr(e){return Yn(e)}function dr(e,t,r){let o,i=!0;return $o(()=>{let n=typeof e=="function"?e():e.get();(!i||r!=null&&r.immediate)&&t(n,o),o=n,i=!1})}function hr(e){return e?Promise.resolve().then(e):Promise.resolve()}var fr=class{constructor(e){this._notifier=new Ae,this.initialRecord=so({},e),this._record=so({},e)}get(e,t){if(t)this._notifier.addListener(e,t);else{let r=$t();r&&this._notifier.addListener(e,r.handler)}return this._record[e]}set(e,t){this._record[e]=t,this._notifier.notify(e,t)}addListener(e,t){return this._notifier.addListener(e,t)}removeListener(e,t){this._notifier.removeListener(e,t)}reset(e){this.set(e,this.initialRecord[e])}_dispose(){this._notifier._dispose()}};var tt={};Ge(tt,{ElementTones:()=>Ne,applySystemTheme:()=>wr,getTheme:()=>Z,setTheme:()=>br,themeApply:()=>Sr,themeCSS:()=>zt,themeColor:()=>l,themeColorToken:()=>Nt,themeDensity:()=>p,themeFluidSpacing:()=>xr,themeName:()=>et,themeSize:()=>y,themeSpacing:()=>s,themeTokens:()=>zo,themeVars:()=>Ve});var pr={direction:"darken",colors:{primary:["#ffffff","#e3ecff","#c6daff","#aac8ff","#8fb6ff","#76a3ff","#5f91fc","#4a7ff4","#386ee7","#2a5ed7","#1e4ec2","#1440aa","#0c3290","#072674","#041a57","#020f38","#010419","#000000"],secondary:["#ffffff","#fce6ea","#faced6","#f7b5c2","#f29db0","#ec859e","#e36e8d","#d8597d","#ca456e","#b93460","#a42351","#8e1643","#770b36","#5f0529","#46031d","#2d0210","#130104","#000000"],info:["#ffffff","#dcf0f9","#b7e1f6","#90d2f1","#6ac3eb","#42b4e2","#16a4d5","#0094c4","#0084b2","#00739e","#00638a","#005476","#004461","#00354d","#002638","#001623","#00070d","#000000"],success:["#ffffff","#e3f3dc","#c6e8b8","#a9dd94","#8ed171","#75c450","#61b635","#51a51f","#429304","#358100","#2a7000","#215f00","#194d00","#123c00","#0b2b00","#051a00","#010900","#000000"],warning:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],attention:["#ffffff","#ffeada","#ffd3b3","#ffbd8d","#ffa96b","#ff9853","#ec8640","#d77531","#c16523","#aa5718","#944a0f","#7e3d09","#673106","#512504","#3b1a03","#250e02","#0e0401","#000000"],error:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],danger:["#ffffff","#fce7e4","#fbcfca","#f8b7b0","#f59f96","#ef877e","#e86f67","#de5852","#d3403e","#c5282c","#b30a1b","#9e000b","#860001","#6c0000","#510000","#340000","#170000","#000000"],highlight:["#ffffff","#f9f5cd","#f4eb95","#efe05a","#e6d427","#d3c100","#bfad00","#ab9b00","#988900","#857700","#736600","#615600","#4f4600","#3e3600","#2c2700","#1b1700","#090700","#000000"],neutral:["#ffffff","#ededed","#dbdbdb","#cacaca","#bababa","#ababab","#9b9b9b","#8d8d8d","#7e7e7e","#707070","#636363","#565656","#484848","#383838","#282828","#181818","#080808","#000000"]},baseTones:{highlight:5,warning:6,error:8,danger:8,secondary:8,primary:9,info:8,success:8,neutral:8},fontSizes:["0.75rem","0.875rem","1rem","1.25rem","1.5625rem","1.9375rem","2.4375rem","3.0625rem"],densities:[.75,1,1.5,2,2.5],darkBias:1,custom:{}},Be=pr,At=e=>JSON.parse(JSON.stringify(e)),Lo=e=>e.replace(/[^a-zA-Z0-9_-]/g,"_"),Oe={light:At(Be),dark:vr(Be)},Qe=null,Rt=new Map;function Vt(e){let t=Object.keys(e.colors)[0];return t?e.colors[t].length:0}function gr(e){for(let t in e)if(!Object.keys(Be).includes(t))throw new Error(`Invalid key: ${t}`);if(e.fontSizes&&!Array.isArray(e.fontSizes))throw new Error("fontSize must be array of string");if(e.densities&&(!Array.isArray(e.densities)||e.densities.some(t=>typeof t!="number")))throw new Error("densities must be array of number");if("custom"in e){let t=e.custom;if(typeof t!="object"||t===null)throw new Error("Invalid custom property: must be an object")}}function Ro(e,t){var r;for(let o in t)t[o]&&typeof t[o]=="object"&&!Array.isArray(t[o])?((r=e[o])!=null||(e[o]={}),Ro(e[o],t[o])):e[o]=t[o]}function yr(e,t){let r={},o=Vt(t);for(let n in t){let a=t[n];if(n==="colors")for(let c in t.colors)[...Array(o).keys()].forEach(u=>r[`--${c}-${u}`]=t.colors[c][u]);else if(n==="fontSizes")[...Array(8).keys()].forEach(c=>r[`--fontSize-${c}`]=t.fontSizes[c]);else if(n==="custom"&&a&&typeof a=="object")for(let c in a)r[`--custom-${Lo(c)}`]=a[c]}let i="";for(let n in r)i+=` ${n}: ${r[n]};
3
3
  `;return`[data-theme="${e}"] {
4
4
  ${i}}`}function Z(e){if(!Oe[e])throw Error(`Theme "${e}" not found`);return Oe[e]}function br(e,t){gr(t),Oe[e]||(Oe[e]=At(Be)),Ro(Oe[e],t),Qe=null,Rt.clear()}function vr(e){let t=At(e);t.direction="lighten";for(let r in t.colors)t.colors[r].reverse(),t.baseTones[r]=t.colors[r].length-1-t.baseTones[r];return t}function zo(e){let t=Rt.get(e);if(t)return t;let r=Z(e),o=Vt(r),i={};for(let n in r){let a=r[n];if(n==="colors")for(let c in r.colors){let u={};[...Array(o).keys()].forEach(h=>u[h]=r.colors[c][h]),i[c]=u}else if(n==="fontSizes")i.fontSizes=r.fontSizes;else if(n==="densities")i.densities=r.densities;else if(n==="custom"&&(i.custom={},a&&typeof a=="object"))for(let c in a)i.custom[c]=a[c]}return Rt.set(e,i),i}function Ve(){if(Qe)return Qe;let e=Z("light"),t=Vt(e),r={};for(let o in e){let i=e[o];if(o==="colors")for(let n in e.colors){let a={};[...Array(t).keys()].forEach(c=>a[c]=`var(--${n}-${c})`),r[n]=a}else if(o==="fontSizes")r.fontSizes=[...Array(8).keys()].map(n=>`var(--fontSize-${n})`);else if(o==="custom"&&(r.custom={},i&&typeof i=="object"))for(let n in i)r.custom[n]=`var(--custom-${Lo(n)})`}return Qe=r,r}function zt(){return Object.entries(Oe).map(([e,t])=>yr(e,t)).join(`
5
- `)}function Sr(e){var t;if(typeof document!="undefined")if(e){e.textContent=zt();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=zt(),document.head.appendChild(e)}function s(e){return`${e/4}em`}function xr(e,t,r=320,o=1280){let i=e/4,n=t/4,a=(n-i)/(o-r)*100,c=i-a*r/100,u=parseFloat(c.toFixed(4))===0?`${a.toFixed(4)}vw`:`${c.toFixed(4)}em + ${a.toFixed(4)}vw`;return`clamp(${i}em, ${u}, ${n}em)`}function wr(e=document.documentElement,t={}){let{persist:r=!0,storageKey:o="dp-theme"}=t,i=()=>{if(r){let c=localStorage.getItem(o);if(c==="light"||c==="dark")return c}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};e.setAttribute("data-theme",i());let n=window.matchMedia("(prefers-color-scheme: dark)"),a=c=>{(!r||!localStorage.getItem(o))&&e.setAttribute("data-theme",c.matches?"dark":"light")};return n.addEventListener("change",a),()=>n.removeEventListener("change",a)}function et(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var It=["inherit"];[...Array(5).keys()].forEach(e=>{It.push(`decrease-${e}`),It.push(`increase-${e}`)});function Cr(e,t="inherit"){if(!It.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function kr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=Cr(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function p(e){let t=kr(e);return Z(e?et(e):"light").densities[t]}var Mt=["inherit"];[...Array(8).keys()].forEach(e=>{Mt.push(`decrease-${e}`),Mt.push(`increase-${e}`)});function Io(e,t="inherit"){if(!Mt.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(7,r))}function Er(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Io(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function y(e,t="inherit"){let r=Io(Er(e),t);return Ve().fontSizes[r]}var le=Be.colors.neutral.length,Ne=["inherit","base"];[...Array(le).keys()].forEach(e=>{Ne.push(`decrease-${e}`),Ne.push(`increase-${e}`),Ne.push(`shift-${e}`)});function Do(e,t){if(e<0||e>le-1)return e;let r=e+t;return r=Math.max(0,Math.min(le-1,r)),r}function Tr(e,t){if(e<0||e>le-1)return e;let r=Math.floor((le-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(le-1,o)),o}function He(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ne.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return Do(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return Do(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Tr(e,r)}else return e}function Mo(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=He(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Ao(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===le-1?le-1-r:e}function l(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r;if(!e)return t==="base"?Ve()[o][Z("light").baseTones[o]]:Ve()[o][He(0,t)];let i=et(e),n;if(t==="base")n=Z(i).baseTones[o];else{let c=Z(i),u=Ao(Mo(e),c.direction,c.darkBias);n=He(u,t)}let a=Ve()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[n]}function Nt(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r,i=e?et(e):"light",n=zo(i);if(!e)return t==="base"?n[o][Z("light").baseTones[o]]:n[o][He(0,t)];let a;if(t==="base")a=Z(i).baseTones[o];else{let c=Z(i),u=Ao(Mo(e),c.direction,c.darkBias);a=He(u,t)}return n[o][a]}var ft={};Ge(ft,{abbreviation:()=>_r,accordion:()=>Or,alert:()=>Pr,avatar:()=>$r,badge:()=>Dr,blockquote:()=>Lr,breadcrumb:()=>Rr,breadcrumbEllipsis:()=>zr,button:()=>Ir,buttonGhost:()=>Mr,buttonSwitch:()=>Ar,card:()=>Vr,code:()=>Nr,combobox:()=>_i,command:()=>Oi,commandItem:()=>$i,commandSearch:()=>Pi,datePicker:()=>Li,descriptionList:()=>Ii,details:()=>Mi,dialog:()=>Ai,divider:()=>Vi,drawer:()=>Ni,emphasis:()=>Bi,empty:()=>Hi,errorBoundary:()=>ji,fab:()=>Wi,figure:()=>Ki,formGroup:()=>Ui,heading:()=>Yi,horizontalRule:()=>Gi,icon:()=>Xi,image:()=>Ji,inputCheckbox:()=>Zi,inputColor:()=>Qi,inputDateTime:()=>ea,inputFile:()=>ta,inputNumber:()=>oa,inputOTP:()=>ia,inputPassword:()=>ra,inputRadio:()=>aa,inputRange:()=>la,inputSearch:()=>sa,inputSwitch:()=>ca,inputText:()=>ua,keyboard:()=>ma,label:()=>da,link:()=>ha,linkButton:()=>fa,list:()=>pa,listItem:()=>ga,listItemButton:()=>ya,mark:()=>ba,menu:()=>va,menuItem:()=>Sa,motion:()=>xa,orderedList:()=>wa,pagination:()=>ka,paragraph:()=>Ea,popover:()=>Ta,popoverArrow:()=>Jt,preformated:()=>_a,progress:()=>Oa,rating:()=>Da,ringProgress:()=>La,scrollArea:()=>Ra,segmented:()=>za,segmentedItem:()=>Ia,select:()=>Ma,selectBox:()=>Aa,selectItem:()=>Va,selectList:()=>Na,skeleton:()=>Ba,small:()=>Ha,spinner:()=>ja,splitter:()=>Fa,splitterHandle:()=>Ka,splitterPanel:()=>Wa,stepItem:()=>Ua,steps:()=>qa,strong:()=>Ya,subscript:()=>Ga,superscript:()=>Xa,tab:()=>Ja,tabPanel:()=>Qa,table:()=>Za,tabs:()=>el,tag:()=>We,textarea:()=>tl,timeline:()=>ol,timelineItem:()=>nl,toast:()=>rl,toggle:()=>il,toggleGroup:()=>al,toolbar:()=>ll,toolbarSpacer:()=>sl,tooltip:()=>cl,transitionGroup:()=>ul,unorderedList:()=>ml});function _r(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>y(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function Or(e={}){var i,n;let{type:t="single"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onMount:a=>{if(t!=="single")return;let c=a.domElement;if(!c)return;let u=h=>{let m=h.target.closest("summary");if(!m)return;let d=m.closest("details");!d||d.parentElement!==c||d.open||Array.from(c.querySelectorAll(":scope > details")).forEach(g=>{g!==d&&(g.open=!1)})};c.addEventListener("click",u),a.addHook("Remove",()=>c.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:a=>s(p(a)*1),outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:a=>`1px solid ${l(a,"shift-4",r.get(a))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`}}}}function Pr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>y(o,"inherit")}}}function $r(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>y(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Dr(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>y(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function Lr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),margin:0}}}function Rr(e={}){var o;let{separator:t="/"}=e,r=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>y(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function zr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>y(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}function Ir(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Mr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*1),borderRadius:o=>s(p(o)*1),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",color:o=>l(o,"shift-6",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-4","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Ar(e={}){var n,a;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"neutral","color"),i=f((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Vr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(p(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(p(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(p(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(p(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function Nr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}var Br=Object.defineProperty,Hr=Object.defineProperties,jr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,Vo=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Yo.call(t,r)&&Vo(e,r,t[r]);if(nt)for(var r of nt(t))Go.call(t,r)&&Vo(e,r,t[r]);return e},ge=(e,t)=>Hr(e,jr(t)),Xo=(e,t)=>{var r={};for(var o in e)Yo.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&nt)for(var o of nt(e))t.indexOf(o)<0&&Go.call(e,o)&&(r[o]=e[o]);return r},ve=(e,t,r)=>new Promise((o,i)=>{var n=u=>{try{c(r.next(u))}catch(h){i(h)}},a=u=>{try{c(r.throw(u))}catch(h){i(h)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,a);c((r=r.apply(e,t)).next())}),Fr=["top","right","bottom","left"],No=["start","end"],us=Fr.reduce((e,t)=>e.concat(t,`${t}-${No[0]}`,`${t}-${No[1]}`),[]),rt=Math.min,pe=Math.max,it=Math.round,ot=Math.floor,Q=e=>({x:e,y:e}),Wr={left:"right",right:"left",bottom:"top",top:"bottom"};function Bo(e,t,r){return pe(e,rt(t,r))}function st(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Jo(e){return e==="x"?"y":"x"}function Zo(e){return e==="y"?"height":"width"}function se(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Qo(e){return Jo(se(e))}function Kr(e,t,r=!1){let o=ct(e),i=Qo(e),n=Zo(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=at(a)),[a,at(a)]}function Ur(e){let t=at(e);return[jt(e),t,jt(t)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Ho=["left","right"],jo=["right","left"],qr=["top","bottom"],Yr=["bottom","top"];function Gr(e,t,r){switch(e){case"top":case"bottom":return r?t?jo:Ho:t?Ho:jo;case"left":case"right":return t?qr:Yr;default:return[]}}function Xr(e,t,r,o){let i=ct(e),n=Gr(ye(e),r==="start",o);return i&&(n=n.map(a=>`${a}-${i}`),t&&(n=n.concat(n.map(jt)))),n}function at(e){let t=ye(e);return Wr[t]+e.slice(t.length)}function Jr(e){return Y({top:0,right:0,bottom:0,left:0},e)}function Zr(e){return typeof e!="number"?Jr(e):{top:e,right:e,bottom:e,left:e}}function lt(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Fo({reference:e,floating:t},r,o){let i=se(r),n=Qo(r),a=Zo(n),c=ye(r),u=i==="y",h=e.x+e.width/2-t.width/2,m=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,g;switch(c){case"top":g={x:h,y:e.y-t.height};break;case"bottom":g={x:h,y:e.y+e.height};break;case"right":g={x:e.x+e.width,y:m};break;case"left":g={x:e.x-t.width,y:m};break;default:g={x:e.x,y:e.y}}switch(ct(r)){case"start":g[n]-=d*(o&&u?-1:1);break;case"end":g[n]+=d*(o&&u?-1:1);break;default:}return g}function Qr(e){return ve(this,arguments,function*(t,r={}){var o,i,n,a,c,u;let{x:h,y:m,platform:d,rects:g,elements:b,strategy:v}=t,{boundary:S="clippingAncestors",rootBoundary:x="viewport",elementContext:C="floating",altBoundary:k=!1,padding:E=0}=st(r,t),_=Zr(E),O=b[k?C==="floating"?"reference":"floating":C],R=lt(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,O))==null||i?O:O.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,b.floating)),boundary:S,rootBoundary:x,strategy:v})),z=C==="floating"?{x:h,y:m,width:g.floating.width,height:g.floating.height}:g.reference,ie=yield(a=d.getOffsetParent)==null?void 0:a.call(d,b.floating),W=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(u=d.getScale)==null?void 0:u.call(d,ie))||{x:1,y:1}:{x:1,y:1},H=lt(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:z,offsetParent:ie,strategy:v}):z);return{top:(R.top-H.top+_.top)/W.y,bottom:(H.bottom-R.bottom+_.bottom)/W.y,left:(R.left-H.left+_.left)/W.x,right:(H.right-R.right+_.right)/W.x}})}var ei=50,ti=(e,t,r)=>ve(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:a=[],platform:c}=r,u=c.detectOverflow?c:ge(Y({},c),{detectOverflow:Qr}),h=yield(o=c.isRTL)==null?void 0:o.call(c,t),m=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:g}=Fo(m,i,h),b=i,v=0,S={};for(let x=0;x<a.length;x++){let C=a[x];if(!C)continue;let{name:k,fn:E}=C,{x:_,y:O,data:R,reset:z}=yield E({x:d,y:g,initialPlacement:i,placement:b,strategy:n,middlewareData:S,rects:m,platform:u,elements:{reference:e,floating:t}});d=_!=null?_:d,g=O!=null?O:g,S[k]=Y(Y({},S[k]),R),z&&v<ei&&(v++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(m=z.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):z.rects),{x:d,y:g}=Fo(m,b,h)),x=-1)}return{x:d,y:g,placement:b,strategy:n,middlewareData:S}});var oi=(e={})=>({name:"flip",options:e,fn(t){return ve(this,null,function*(){var r,o,i,n,a,c;let{placement:u,middlewareData:h,rects:m,initialPlacement:d,platform:g,elements:b}=t,v=st(e,t),{mainAxis:S=!0,crossAxis:x=!0,fallbackPlacements:C,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:_=!0}=v,O=Xo(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=h.arrow)!=null&&r.alignmentOffset)return{};let R=ye(u),z=se(d),ie=ye(d)===d,W=yield(o=g.isRTL)==null?void 0:o.call(g,b.floating),H=C||(ie||!_?[at(d)]:Ur(d)),qe=E!=="none";!C&&qe&&H.push(...Xr(d,_,E,W));let pt=[d,...H],xe=yield g.detectOverflow(t,O),j=[],oe=((i=h.flip)==null?void 0:i.overflows)||[];if(S&&j.push(xe[R]),x){let ne=Kr(u,m,W);j.push(xe[ne[0]],xe[ne[1]])}if(oe=[...oe,{placement:u,overflows:j}],!j.every(ne=>ne<=0)){let ne=(((n=h.flip)==null?void 0:n.index)||0)+1,Re=pt[ne];if(Re&&(!(x==="alignment"&&z!==se(Re))||oe.every(N=>se(N.placement)===z?N.overflows[0]>0:!0)))return{data:{index:ne,overflows:oe},reset:{placement:Re}};let ue=(a=oe.filter(N=>N.overflows[0]<=0).sort((N,U)=>N.overflows[1]-U.overflows[1])[0])==null?void 0:a.placement;if(!ue)switch(k){case"bestFit":{let N=(c=oe.filter(U=>{if(qe){let q=se(U.placement);return q===z||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,ze)=>q+ze,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:c[0];N&&(ue=N);break}case"initialPlacement":ue=d;break;default:}if(u!==ue)return{reset:{placement:ue}}}return{}})}});var ni=new Set(["left","top"]);function ri(e,t){return ve(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,a=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=ye(o),u=ct(o),h=se(o)==="y",m=ni.has(c)?-1:1,d=a&&h?-1:1,g=st(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),h?{x:v*d,y:b*m}:{x:b*m,y:v*d}})}var ii=(e=0)=>({name:"offset",options:e,fn(t){return ve(this,null,function*(){var r,o;let{x:i,y:n,placement:a,middlewareData:c}=t,u=yield ri(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:n+u.y,data:ge(Y({},u),{placement:a})}})}}),ai=(e={})=>({name:"shift",options:e,fn(t){return ve(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,a=st(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:h={fn:({x:k,y:E})=>({x:k,y:E})}}=a,m=Xo(a,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},g=yield n.detectOverflow(t,m),b=se(ye(i)),v=Jo(b),S=d[v],x=d[b];if(c){let k=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=S+g[k],O=S-g[E];S=Bo(_,S,O)}if(u){let k=b==="y"?"top":"left",E=b==="y"?"bottom":"right",_=x+g[k],O=x-g[E];x=Bo(_,x,O)}let C=h.fn(ge(Y({},t),{[v]:S,[b]:x}));return ge(Y({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[v]:c,[b]:u}}})})}});function ut(){return typeof window!="undefined"}function De(e){return en(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(en(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function en(e){return ut()?e instanceof Node||e instanceof F(e).Node:!1}function G(e){return ut()?e instanceof Element||e instanceof F(e).Element:!1}function re(e){return ut()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function Wo(e){return!ut()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function Fe(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function li(e){return/^(table|td|th)$/.test(De(e))}function mt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var si=/transform|translate|scale|rotate|perspective|filter/,ci=/paint|layout|strict|content/,fe=e=>!!e&&e!=="none",Bt;function Wt(e){let t=G(e)?X(e):e;return fe(t.transform)||fe(t.translate)||fe(t.scale)||fe(t.rotate)||fe(t.perspective)||!Kt()&&(fe(t.backdropFilter)||fe(t.filter))||si.test(t.willChange||"")||ci.test(t.contain||"")}function ui(e){let t=ce(e);for(;re(t)&&!$e(t);){if(Wt(t))return t;if(mt(t))return null;t=ce(t)}return null}function Kt(){return Bt==null&&(Bt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bt}function $e(e){return/^(html|body|#document)$/.test(De(e))}function X(e){return F(e).getComputedStyle(e)}function dt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(De(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||ee(e);return Wo(t)?t.host:t}function tn(e){let t=ce(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&Fe(t)?t:tn(t)}function je(e,t=[],r=!0){var o;let i=tn(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=F(i);if(n){let c=Ft(a);return t.concat(a,a.visualViewport||[],Fe(i)?i:[],c&&r?je(c):[])}else return t.concat(i,je(i,[],r))}function Ft(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function on(e){let t=X(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=it(r)!==n||it(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function Ut(e){return G(e)?e:e.contextElement}function Pe(e){let t=Ut(e);if(!re(t))return Q(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=on(t),a=(n?it(r.width):r.width)/o,c=(n?it(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var mi=Q(0);function nn(e){let t=F(e);return!Kt()||!t.visualViewport?mi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function di(e,t=!1,r){return!r||t&&r!==F(e)?!1:t}function be(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=Ut(e),a=Q(1);t&&(o?G(o)&&(a=Pe(o)):a=Pe(e));let c=di(n,r,o)?nn(n):Q(0),u=(i.left+c.x)/a.x,h=(i.top+c.y)/a.y,m=i.width/a.x,d=i.height/a.y;if(n){let g=F(n),b=o&&G(o)?F(o):o,v=g,S=Ft(v);for(;S&&o&&b!==v;){let x=Pe(S),C=S.getBoundingClientRect(),k=X(S),E=C.left+(S.clientLeft+parseFloat(k.paddingLeft))*x.x,_=C.top+(S.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,h*=x.y,m*=x.x,d*=x.y,u+=E,h+=_,v=F(S),S=Ft(v)}}return lt({width:m,height:d,x:u,y:h})}function ht(e,t){let r=dt(e).scrollLeft;return t?t.left+r:be(ee(e)).left+r}function rn(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-ht(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function hi({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=ee(r),a=e?mt(e.floating):!1;if(r===n||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=Q(1),h=Q(0),m=re(r);if((m||!m&&!i)&&((De(r)!=="body"||Fe(n))&&(c=dt(r)),m)){let g=be(r);u=Pe(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}let d=n&&!m&&!i?rn(n,c):Q(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+h.x+d.x,y:t.y*u.y-c.scrollTop*u.y+h.y+d.y}}function fi(e){return Array.from(e.getClientRects())}function pi(e){let t=ee(e),r=dt(e),o=e.ownerDocument.body,i=pe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=pe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+ht(e),c=-r.scrollTop;return X(o).direction==="rtl"&&(a+=pe(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Ko=25;function gi(e,t){let r=F(e),o=ee(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){n=i.width,a=i.height;let m=Kt();(!m||m&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let h=ht(o);if(h<=0){let m=o.ownerDocument,d=m.body,g=getComputedStyle(d),b=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Ko&&(n-=v)}else h<=Ko&&(n+=h);return{width:n,height:a,x:c,y:u}}function yi(e,t){let r=be(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=re(e)?Pe(e):Q(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,u=i*n.x,h=o*n.y;return{width:a,height:c,x:u,y:h}}function Uo(e,t,r){let o;if(t==="viewport")o=gi(e,r);else if(t==="document")o=pi(ee(e));else if(G(t))o=yi(t,r);else{let i=nn(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lt(o)}function an(e,t){let r=ce(e);return r===t||!G(r)||$e(r)?!1:X(r).position==="fixed"||an(r,t)}function bi(e,t){let r=t.get(e);if(r)return r;let o=je(e,[],!1).filter(c=>G(c)&&De(c)!=="body"),i=null,n=X(e).position==="fixed",a=n?ce(e):e;for(;G(a)&&!$e(a);){let c=X(a),u=Wt(a);!u&&c.position==="fixed"&&(i=null),(n?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Fe(a)&&!u&&an(e,a))?o=o.filter(h=>h!==a):i=c,a=ce(a)}return t.set(e,o),o}function vi({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?mt(e)?[]:bi(e,this._c):[].concat(t),r],n=Uo(e,i[0],o),a=n.top,c=n.right,u=n.bottom,h=n.left;for(let m=1;m<i.length;m++){let d=Uo(e,i[m],o);a=pe(d.top,a),c=rt(d.right,c),u=rt(d.bottom,u),h=pe(d.left,h)}return{width:c-h,height:u-a,x:h,y:a}}function Si(e){let{width:t,height:r}=on(e);return{width:t,height:r}}function xi(e,t,r){let o=re(t),i=ee(t),n=r==="fixed",a=be(e,!0,n,t),c={scrollLeft:0,scrollTop:0},u=Q(0);function h(){u.x=ht(i)}if(o||!o&&!n)if((De(t)!=="body"||Fe(i))&&(c=dt(t)),o){let b=be(t,!0,n,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&h();n&&!o&&i&&h();let m=i&&!o&&!n?rn(i,c):Q(0),d=a.left+c.scrollLeft-u.x-m.x,g=a.top+c.scrollTop-u.y-m.y;return{x:d,y:g,width:a.width,height:a.height}}function Ht(e){return X(e).position==="static"}function qo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ee(e)===r&&(r=r.ownerDocument.body),r}function ln(e,t){let r=F(e);if(mt(e))return r;if(!re(e)){let i=ce(e);for(;i&&!$e(i);){if(G(i)&&!Ht(i))return i;i=ce(i)}return r}let o=qo(e,t);for(;o&&li(o)&&Ht(o);)o=qo(o,t);return o&&$e(o)&&Ht(o)&&!Wt(o)?r:o||ui(e)||r}var wi=function(e){return ve(this,null,function*(){let t=this.getOffsetParent||ln,r=this.getDimensions,o=yield r(e.floating);return{reference:xi(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Ci(e){return X(e).direction==="rtl"}var ki={convertOffsetParentRelativeRectToViewportRelativeRect:hi,getDocumentElement:ee,getClippingRect:vi,getOffsetParent:ln,getElementRects:wi,getClientRects:fi,getDimensions:Si,getScale:Pe,isElement:G,isRTL:Ci};function sn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ei(e,t){let r=null,o,i=ee(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function a(c=!1,u=1){n();let h=e.getBoundingClientRect(),{left:m,top:d,width:g,height:b}=h;if(c||t(),!g||!b)return;let v=ot(d),S=ot(i.clientWidth-(m+g)),x=ot(i.clientHeight-(d+b)),C=ot(m),k={rootMargin:`${-v}px ${-S}px ${-x}px ${-C}px`,threshold:pe(0,rt(1,u))||1},E=!0;function _(O){let R=O[0].intersectionRatio;if(R!==u){if(!E)return a();R?a(!1,R):o=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!sn(h,e.getBoundingClientRect())&&a(),E=!1}try{r=new IntersectionObserver(_,ge(Y({},k),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(_,k)}r.observe(e)}return a(!0),n}function cn(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,h=Ut(e),m=i||n?[...h?je(h):[],...t?je(t):[]]:[];m.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=h&&c?Ei(h,r):null,g=-1,b=null;a&&(b=new ResizeObserver(([C])=>{C&&C.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{b==null||b.observe(t)})),r()}),h&&!u&&b.observe(h),t&&b.observe(t));let v,S=u?be(e):null;u&&x();function x(){let C=be(e);S&&!sn(S,C)&&r(),S=C,v=requestAnimationFrame(x)}return r(),()=>{m.forEach(C=>{i&&C.removeEventListener("scroll",r),n&&C.removeEventListener("resize",r)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(v)}}var un=ii;var mn=ai,dn=oi;var hn=(e,t,r)=>{let o=new Map,i=Y({platform:ki},r),n=ge(Y({},i.platform),{_c:o});return ti(e,t,ge(Y({},i),{platform:n}))};function te(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=null,u=null,h=!1,m=f(t),d=()=>{h||!u||(h=!0,c=u.children.insert(e.content))},g=()=>{d(),n&&a&&(i&&i(),i=cn(n,a,()=>{hn(n,a,{placement:r.get(),middleware:[un(12),dn(),mn()],strategy:"fixed"}).then(({x:k,y:E,placement:_})=>{Object.assign(a.style,{left:`${k}px`,top:`${E}px`}),r.set(_)})}),m.set(!0))},b=()=>{i&&i(),i=null,m.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(g,100)},S=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},x={style:{position:"fixed",pointerEvents:"auto",visibility:k=>m.get(k)?"visible":"hidden"},_onMount:k=>a=k.domElement,_portal:k=>{var _;let E=k.domElement.querySelector("#domphy-floating");if(!E){let O={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};E=k.children.insert(O).domElement}if(n&&E instanceof HTMLElement&&!E.hasAttribute("data-theme")){let O=(_=n.closest("[data-theme]"))==null?void 0:_.getAttribute("data-theme");O&&E.setAttribute("data-theme",O)}return E}};return D(e.content,x),{show:v,hide:S,anchorPartial:{onKeyDown:k=>k.key==="Escape"&&S(),_onMount:k=>{u=k.getRoot(),n=k.domElement;let E=_=>{if(!m.get()||!n||!a)return;let O=_.target;!n.contains(O)&&!a.contains(O)&&S()};k.getRoot().domElement.addEventListener("click",E),k.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),k.getRoot().domElement.removeEventListener("click",E)})}}}}var Ti='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function We(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:Ti,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}function _i(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&h()};D(e.content,d);let g={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:x=>y(x,"inherit"),color:x=>l(x,"shift-9",o),backgroundColor:x=>l(x,"inherit",o)},b;e.input?(D(e.input,{onFocus:()=>u(),style:g,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>u(),value:x=>(a.get(x),""),style:g,_key:"combobox-input"};let v={div:x=>{let C=a.get(x),k=Array.isArray(C)?C:[C],_=t.filter(O=>k.includes(O.value)).map(O=>({span:O.label,$:[We({color:o,removable:!0})],_key:O.value,_onRemove:R=>{let z=a.get(),W=(Array.isArray(z)?z:[z]).filter(H=>H!==O.value);n?a.set(W):a.set(W[0])}}));return _.push(b),_},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},S={_onInsert:x=>{x.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:x=>x.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:x=>`1px solid ${l(x,"shift-4","neutral")}`,paddingBlock:x=>s(p(x)*1),paddingInline:x=>s(p(x)*1),borderRadius:x=>s(p(x)*1),fontSize:x=>y(x,"inherit"),color:x=>l(x,"shift-9",o),backgroundColor:x=>l(x,"inherit",o)}};return D(m,S),m}function Oi(){return{_onSchedule:(e,t)=>{D(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Pi(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>y(o,"inherit"),paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function $i(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var h,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(m=(h=n.textContent)==null?void 0:h.toLowerCase())!=null?m:"",c=d=>{n.hidden=d.length>0&&!a.includes(d.toLowerCase())};c(i.query.get());let u=i.query.addListener(c);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>y(o,"inherit"),height:o=>s(6+p(o)*2),paddingInline:o=>s(p(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}var A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Se=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),qt=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Ke=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Yt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Gt=(e,t)=>Se(e,-((e.getDay()-t+7)%7));function Di(e){var t,r;try{let o=new Intl.Locale(e),i=(r=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?r:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function Li(e={}){var Zt,Qt,eo,to;let{mode:t="single",time:r=!1,min:o,max:i,disabledDate:n,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,h=(Zt=e.weekStartsOn)!=null?Zt:Di(a),m=f((Qt=e.accentColor)!=null?Qt:"primary","accentColor"),d=f((eo=e.placement)!=null?eo:"bottom-start"),g=f((to=e.value)!=null?to:t==="range"?[null,null]:null),b=u?g.addListener(w=>u(w)):null,v=(()=>{let w=g.get(),T=t==="range"?w==null?void 0:w[0]:w;return T instanceof Date?T:new Date})(),S=f(v.getFullYear(),"viewYear"),x=f(v.getMonth(),"viewMonth"),C=f(A(v),"focused"),k=f(null,"hovered"),E=f(v.getHours(),"hour"),_=f(v.getMinutes(),"minute"),O=null,R=new Intl.DateTimeFormat(a,Ce({dateStyle:"medium"},r?{timeStyle:"short"}:{})),z=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),ie=new Intl.DateTimeFormat(a,{weekday:"short"}),W=new Intl.DateTimeFormat(a,{dateStyle:"full"}),H=w=>w?R.format(w):"",qe=w=>{if(c)return c(w);if(t==="range"){let[T,P]=w!=null?w:[null,null];return T?`${H(T)} \u2013 ${H(P)}`:""}return H(w)},pt=Array.from({length:7},(w,T)=>ie.format(new Date(2023,0,1+(T+h)%7))),xe=w=>!!o&&A(w)<A(o)||!!i&&A(w)>A(i)||!!n&&n(w),j=w=>{if(!r)return A(w);let T=A(w);return T.setHours(E.get(),_.get(),0,0),T},oe=w=>{var $;if(xe(w))return;if(t==="single"){g.set(j(w)),r||yt();return}let[T,P]=($=g.get())!=null?$:[null,null];!T||T&&P?g.set([j(w),null]):A(w)<A(T)?(g.set([j(w),j(T)]),r||yt()):(g.set([T,j(w)]),r||yt())},ne=()=>{var w;if(r)if(t==="single"){let T=g.get();T&&g.set(j(T))}else{let[T,P]=(w=g.get())!=null?w:[null,null];g.set([T&&j(T),P&&j(P)])}},Re=(w,T)=>{var we;if(t!=="range")return!1;let[P,$]=(we=g.get(T))!=null?we:[null,null],I=$!=null?$:k.get(T);if(!P||!I)return!1;let L=A(P)<=A(I)?P:I,K=A(P)<=A(I)?I:P,B=A(w);return B>=A(L)&&B<=A(K)},ue=(w,T)=>{let P=g.get(T);if(t==="range"){let[$,I]=P!=null?P:[null,null];return Ke(w,$)||Ke(w,I)}return Ke(w,P)},N=w=>{S.set(w.getFullYear()),x.set(w.getMonth())},U=w=>{let T=qt(new Date(S.get(),x.get(),1),w);N(T)},q=w=>S.set(S.get()+w),ze=()=>{setTimeout(()=>{var w;(w=O==null?void 0:O.querySelector(`[data-date="${Yt(C.get())}"]`))==null||w.focus()},0)},Cn=On(),{show:kn,hide:En,anchorPartial:gt}=te({open:!1,placement:d,content:Cn});function yt(){En()}gt.onClick=()=>{};let Tn={type:"text",readonly:!0,value:w=>qe(g.get(w)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{bt()},onFocus:()=>{bt()},onKeyDown:w=>{let T=w.key;(T==="ArrowDown"||T==="Enter")&&(w.preventDefault(),bt())},_onMount:w=>b&&w.addHook("Remove",()=>{b()})};function bt(){var T;let w=(T=_n())!=null?T:new Date;C.set(A(w)),N(w),kn(),ze()}function _n(){var T;let w=g.get();return t==="range"?(T=w==null?void 0:w[0])!=null?T:null:w!=null?w:null}return D(gt,Tn),gt;function On(){let w=(L,K,B)=>({button:L,type:"button",ariaLabel:K,onClick:B,style:Ri()}),T={div:[w("\xAB","Previous year",()=>q(-1)),w("\u2039","Previous month",()=>U(-1)),{div:L=>z.format(new Date(S.get(L),x.get(L),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:L=>y(L)}},w("\u203A","Next month",()=>U(1)),w("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:s(1),marginBottom:s(2)}},P={div:pt.map((L,K)=>({div:L,style:{textAlign:"center",fontSize:B=>y(B,"decrease-1"),fontWeight:"600",color:B=>l(B,"shift-7"),paddingBlock:s(1)},_key:K})),role:"row",style:fn()},$={div:L=>Pn(L),role:"grid",ariaLabel:"Calendar",onKeyDown:Rn,onMouseLeave:()=>t==="range"&&k.set(null),style:{display:"flex",flexDirection:"column",gap:s(.5)}},I=[T,P,$];return r&&I.push(Dn()),I.push(Ln()),{div:I,role:"dialog",ariaModal:"false",_onMount:L=>{O=L.domElement},style:{minWidth:s(70),padding:s(3),borderRadius:s(2),backgroundColor:L=>l(L,"base"),color:L=>l(L,"shift-10"),border:L=>`1px solid ${l(L,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function Pn(w){let T=new Date(S.get(w),x.get(w),1),P=x.get(w),$=Gt(T,h),I=[];for(let L=0;L<6;L++){let K=[];for(let B=0;B<7;B++){let we=Se($,L*7+B);K.push($n(we,P,w))}I.push({div:K,role:"row",style:fn(),_key:L})}return I}function $n(w,T,P){let $=xe(w),I=ue(w,P),L=Re(w,P),K=w.getMonth()!==T,B=Ke(w,C.get(P)),we=Ke(w,new Date);return{button:String(w.getDate()),type:"button",role:"gridcell",tabIndex:B?0:-1,ariaSelected:I,ariaDisabled:$,disabled:$,ariaLabel:W.format(w),dataDate:Yt(w),onClick:()=>oe(w),onMouseEnter:()=>t==="range"&&k.set(w),style:{appearance:"none",border:"none",cursor:$?"not-allowed":"pointer",aspectRatio:"1",borderRadius:s(1),fontSize:M=>y(M),fontFamily:"inherit",opacity:$?.35:K?.5:1,backgroundColor:M=>I?l(M,"shift-7",m.get(M)):L?l(M,"shift-2",m.get(M)):"transparent",color:M=>I?l(M,"shift-0",m.get(M)):l(M,"shift-9"),outline:we?M=>`1px solid ${l(M,"shift-6",m.get(M))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:M=>I?l(M,"shift-7",m.get(M)):l(M,"shift-3",m.get(M))},"&:focus-visible":{outline:M=>`2px solid ${l(M,"shift-6",m.get(M))}`}},_key:Yt(w)}}function Dn(){let w=(T,P,$)=>({select:Array.from({length:T},(I,L)=>({option:String(L).padStart(2,"0"),value:String(L),selected:K=>P.get(K)===L,_key:L})),ariaLabel:$,onChange:I=>{P.set(Number(I.target.value)),ne()},style:zi()});return{div:[w(24,E,"Hour"),{span:":",style:{fontWeight:"600"}},w(60,_,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:s(1),marginTop:s(3)}}}function Ln(){let w=(T,P)=>({button:T,type:"button",onClick:P,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:$=>y($,"decrease-1"),color:$=>l($,"shift-8",m.get($)),padding:s(1)}});return{div:[w("Today",()=>{let T=new Date;C.set(A(T)),N(T),ze()}),w("Clear",()=>{g.set(t==="range"?[null,null]:null),k.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:s(2),paddingTop:s(2),borderTop:T=>`1px solid ${l(T,"shift-3")}`}}}function Rn(w){let T=w,P=C.get(),$=null;switch(T.key){case"ArrowLeft":$=Se(P,-1);break;case"ArrowRight":$=Se(P,1);break;case"ArrowUp":$=Se(P,-7);break;case"ArrowDown":$=Se(P,7);break;case"Home":$=Gt(P,h);break;case"End":$=Se(Gt(P,h),6);break;case"PageUp":$=qt(P,T.shiftKey?-12:-1);break;case"PageDown":$=qt(P,T.shiftKey?12:1);break;case"Enter":case" ":T.preventDefault(),oe(P);return;default:return}T.preventDefault(),C.set($),N($),ze()}}function fn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:s(.5)}}function Ri(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>y(e),color:e=>l(e,"shift-8"),width:s(7),height:s(7),borderRadius:s(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function zi(){return{fontFamily:"inherit",fontSize:e=>y(e),padding:s(1),borderRadius:s(1),border:e=>`1px solid ${l(e,"shift-4")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"shift-9")}}function Ii(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function Mi(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>y(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(p(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(p(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(p(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(p(a)*1),paddingBottom:a=>s(p(a)*3)}}}}var pn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Ai(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r),i=null,n=!1;return{_onInsert:a=>{a.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(a,c)=>{if(a.target!==c.domElement)return;let u=c.domElement.getBoundingClientRect();a.clientX>=u.left&&a.clientX<=u.right&&a.clientY>=u.top&&a.clientY<=u.bottom||o.set(!1)},onTransitionEnd:(a,c)=>{if(!n)return;n=!1,c.domElement.close(),document.body.style.overflow="",i==null||i.focus(),i=null},_onMount:a=>{let c=a.domElement;c.setAttribute("aria-modal","true");let u=null,h=b=>{if(b.key!=="Tab")return;let v=Array.from(c.querySelectorAll(pn)).filter(C=>!C.closest("[aria-hidden='true']")&&C.offsetParent!==null);if(!v.length){b.preventDefault();return}let S=v[0],x=v[v.length-1];b.shiftKey?(document.activeElement===S||document.activeElement===c)&&(b.preventDefault(),x.focus()):document.activeElement===x&&(b.preventDefault(),S.focus())},m=b=>{b.preventDefault(),o.set(!1)};c.addEventListener("cancel",m);let d=b=>{b?(i=document.activeElement,c.showModal(),document.body.style.overflow="hidden",c.addEventListener("keydown",h),requestAnimationFrame(()=>{c.style.opacity="1";let v=c.querySelector(pn);v==null||v.focus()})):(n=!0,c.style.opacity="0",c.removeEventListener("keydown",h),u=setTimeout(()=>{u=null,n&&(n=!1,c.close(),document.body.style.overflow="",i==null||i.focus(),i=null)},350))};d(o.get());let g=o.addListener(d);a.addHook("Remove",()=>{u&&(clearTimeout(u),u=null),g(),c.removeEventListener("cancel",m),document.body.style.overflow="",c.removeEventListener("keydown",h),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-10",t),backgroundColor:a=>l(a,"inherit",t),border:"none",padding:a=>s(p(a)*3),boxShadow:a=>`0 ${s(9)} ${s(16)} ${l(a,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:a=>l(a,"shift-2","neutral"),opacity:.75}}}}function Vi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Xt={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},gn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Ue=e=>e==="left"||e==="right";function yn(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Ni(e={}){let{color:t="neutral",open:r=!1,placement:o="end",size:i}=e,n=f(r),a=o==="start"||o==="end",c=yn(o,!1),u=Ue(c)?s(80):s(64),h=i!=null?i:u;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,d)=>{m.target===d.domElement&&n.set(!1)},_onMount:m=>{let d=m.domElement;d.setAttribute("aria-modal","true");let g=O=>{O.preventDefault(),n.set(!1)};d.addEventListener("cancel",g);let b=a&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),v=yn(o,b);a&&(d.style.transform=Xt[v],d.style.margin=gn[v],d.style.width=Ue(v)?h:"100dvw",d.style.height=Ue(v)?"100dvh":h);let S=!1,x=null,C=()=>{x=null,S&&(S=!1,d.close(),document.body.style.overflow="")},k=O=>{O.target===d&&O.propertyName==="transform"&&C()};d.addEventListener("transitionend",k);let E=O=>{O?(S=!1,d.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(S=!0,d.style.transform=Xt[v],x=setTimeout(C,350))};E(n.get());let _=n.addListener(E);m.addHook("Remove",()=>{x&&(clearTimeout(x),x=null),_(),d.removeEventListener("cancel",g),d.removeEventListener("transitionend",k),document.body.style.overflow=""})},style:{transform:Xt[c],transition:"transform 0.25s ease",fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(p(m)*3),margin:gn[c],width:Ue(c)?h:"100dvw",height:Ue(c)?"100dvh":h,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Bi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>y(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function Hi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:s(3),paddingBlock:s(12),paddingInline:s(6),textAlign:"center",color:o=>l(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>l(o,"shift-5",t.get(o))}}}}function ji(e={}){return{_onError:(t,r,o)=>{var n,a;(n=e.onError)==null||n.call(e,r);let i=typeof e.fallback=="function"?e.fallback(r,o):(a=e.fallback)!=null?a:{div:"An error occurred."};t.children.update([i])}}}var Fi={small:8,medium:10,large:14};function Wi(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=s(Fi[(i=e.size)!=null?i:"medium"]);return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:r,height:r,borderRadius:"50%",fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n,"shift-9",t.get(n)),color:n=>l(n,"shift-0",t.get(n)),boxShadow:n=>`0 ${s(1)} ${s(4)} ${l(n,"shift-4","neutral")}`,transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-10",t.get(n)),boxShadow:n=>`0 ${s(2)} ${s(6)} ${l(n,"shift-5","neutral")}`},"&:focus-visible":{outline:n=>`2px solid ${l(n,"shift-6",t.get(n))}`,outlineOffset:"2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Ki(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>y(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Ui(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*3),border:"none",borderRadius:n=>s(p(n)*2),fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>y(n,"inherit"),fontWeight:600,paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(p(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>y(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var qi={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Yi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=qi[o.elementNode.tagName]||"inherit";return y(o,i)}}}}function Gi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function Xi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:s(4),height:s(4),flexShrink:"0",fontSize:o=>y(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function Ji(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function Zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>y(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Qi(e={}){return{type:"color",_onSchedule:(t,r)=>{t.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:t=>y(t,"inherit"),paddingBlock:t=>s(p(t)*1),paddingInline:t=>s(p(t)*1),blockSize:t=>s(6+p(t)*2),inlineSize:t=>s(6+p(t)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:t=>s(p(t)*1)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>l(t,"shift-2","neutral"),outline:t=>`1px solid ${l(t,"shift-4","neutral")}`}}}}function ea(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>y(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(p(a)*1),paddingInline:a=>s(p(a)*3),height:a=>s(6+p(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function ta(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-11",t.get(n)),backgroundColor:n=>l(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(p(n)*3),paddingInlineEnd:n=>s(p(n)*1.5),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}var bn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',na='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>';function ra(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onMount:n=>{let a=n.domElement,c=!1,u=document.createElement("input");u.type="password",u.style.cssText="flex:1;min-width:0;border:none;outline:none;background:transparent;padding:0;margin:0;font:inherit;color:inherit;";let h=document.createElement("button");h.type="button",h.setAttribute("aria-label","Show password"),h.style.cssText="background:none;border:none;padding:0;margin:0;cursor:pointer;color:inherit;display:flex;align-items:center;flex-shrink:0;opacity:0.6;",h.innerHTML=bn;let m=()=>{c=!c,u.type=c?"text":"password",h.innerHTML=c?na:bn,h.setAttribute("aria-label",c?"Hide password":"Show password")};h.addEventListener("click",m),a.appendChild(u),a.appendChild(h),n.addHook("Remove",()=>{h.removeEventListener("click",m)})},style:{display:"flex",alignItems:"center",gap:n=>s(p(n)*1),paddingBlock:n=>s(p(n)*1),paddingInline:n=>s(p(n)*3),borderRadius:n=>s(p(n)*1),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),fontSize:n=>y(n,"inherit"),"&:focus-within":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`}}}}function ia(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:`${s(9)}!important`}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),u=a.target,h=c.indexOf(u);u.value&&h<c.length-1&&c[h+1].focus()},i=a=>{let c=r(),u=a.target,h=c.indexOf(u);a.key==="Backspace"&&!u.value&&h>0&&c[h-1].focus(),a.key==="ArrowLeft"&&h>0&&c[h-1].focus(),a.key==="ArrowRight"&&h<c.length-1&&c[h+1].focus()},n=a=>{var g,b,v;a.preventDefault();let c=(b=(g=a.clipboardData)==null?void 0:g.getData("text"))!=null?b:"",u=r(),h=u.indexOf(a.target),m=h===-1?0:h;[...c].forEach((S,x)=>{u[m+x]&&(u[m+x].value=S)});let d=Math.min(m+c.length-1,u.length-1);(v=u[d])==null||v.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function aa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>y(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function la(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function sa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),minWidth:s(32),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function ca(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>y(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ua(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function ma(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function da(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>y(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function ha(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function fa(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:o=>y(o,"inherit"),textDecoration:"none",paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*1),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")}}}}function pa(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function ga(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:r=>s(p(r)*2),paddingBlock:r=>s(t?1:p(r)*2),paddingInline:r=>s(p(r)*3),fontSize:r=>y(r,"inherit")}}}function ya(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=(n=e.accentColor)!=null?n:"primary",{dense:o=!1}=e;return{cursor:"pointer",style:{appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:a=>s(p(a)*2),paddingBlock:a=>s(o?1:p(a)*2),paddingInline:a=>s(p(a)*3),fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),borderRadius:a=>s(p(a)*1),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:a=>l(a,"shift-2",t.get(a))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:a=>l(a,"shift-3",r),color:a=>l(a,"shift-12",r)},"&:focus-visible":{outline:a=>`2px solid ${l(a,"shift-6",r)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function ba(e={}){var r;let t=f((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function va(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};D(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(p(i)*2),paddingInline:i=>s(p(i)*2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",t)}}}function Sa(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,h;i.tagName!=="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch must be used inside a "menu"');return}let a=(h=(u=i.parent)==null?void 0:u.children.items)!=null?h:[];a=a.filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i);n.selectable&&(i.attributes.set("ariaCurrent",m=>n.activeKey.get(m)===c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var m,d,g,b;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(m=n.domElement)==null||m.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((g=(d=n.parent)==null?void 0:d.children.items)!=null?g:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem");if(!c.length)return;let u=c.indexOf(n),h=u;a==="ArrowDown"?h=(u+1)%c.length:a==="ArrowUp"?h=(u-1+c.length)%c.length:a==="Home"?h=0:a==="End"&&(h=c.length-1),(b=c[h].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>y(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9",r),backgroundColor:i=>l(i,"inherit",r),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2",r)},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var vn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Le=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function xa(e={}){var a,c,u,h;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(h=i.iterations)!=null?h:1,fill:"both"};return{_onMount:m=>{let d=m.domElement;if(!d||typeof d.animate!="function")return;let g=vn(r)?r.get():r;if(g?d.animate(t?[Le(t),Le(g)]:[Le(g)],n):t&&Object.assign(d.style,Le(t)),vn(r)){let b=r.addListener(v=>{d.animate([Le(v)],n)});m.setMetadata("motionRelease",b)}},_onBeforeRemove:(m,d)=>{let g=m.domElement;if(!g||!o||typeof g.animate!="function")return d();g.animate([Le(o)],n).finished.then(d,d)},_onRemove:m=>{let d=m.getMetadata("motionRelease");d==null||d()}}}function wa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Ca(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function ka(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+p(u)*2),height:u=>s(6+p(u)*2),paddingInline:u=>s(p(u)*2),borderRadius:u=>s(p(u)*1),border:"none",cursor:"pointer",fontSize:u=>y(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=io(Ce({},n),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let h={div:m=>{let d=i.get(m),g=[];g.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of Ca(d,t))if(b==="...")g.push({span:"\u2026",ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(p(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=b===d;g.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?a:n})}return g.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),g},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(h)},style:{display:"inline-flex"}}}function Ea(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Ta(e){var g;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),a=f(r),{show:c,hide:u,anchorPartial:h}=te({open:n,placement:a,content:e.content}),m={role:"dialog",dataTone:"shift-14",style:{backgroundColor:b=>l(b,"inherit"),boxShadow:b=>`0 4px 20px ${l(b,"shift-6")}`},onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:b=>{let v=b.attributes.get("id");i=v||b.nodeId,!v&&b.attributes.set("id",i)}};return(g=e.content).$||(g.$=[]),e.content.$.push(m),D(h,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(n.get()?u():c())},onKeyDown:b=>{b.key==="Escape"&&n.get()&&u()},onFocus:()=>o==="hover"&&c(),onBlur:(b,v)=>{let S=b.relatedTarget,x=v.getRoot().domElement,C=i?x.querySelector(`#${CSS.escape(i)}`):null;S&&(C!=null&&C.contains(S))||u()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),h}function Jt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=f(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=m=>{var d;return(d=a[n.get(m)])!=null?d:a["bottom-end"]},u=m=>m.includes("start")?o:m.includes("end")?"auto":"50%",h=m=>m.includes("end")?o:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>y(m),backgroundColor:m=>l(m),color:m=>l(m,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:m=>l(m,"inherit",r),borderWidth:i?"1px":"0px",borderColor:m=>l(m,"inherit",r),borderTopStyle:m=>{let d=c(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=c(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=c(m);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:m=>{let d=c(m);return d.includes("right")?0:d.includes("left")?"auto":h(d)},bottom:m=>{let d=c(m);return d.includes("bottom")?0:d.includes("top")?"auto":h(d)},left:m=>{let d=c(m);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:m=>{let d=c(m),g=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${g},${b}) rotate(45deg)`}}}}}function _a(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*2)}}}function Oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}var Pa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',$a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Da(e={}){var a,c;let{max:t=5,readOnly:r=!1,onChange:o}=e,i=(a=e.color)!=null?a:"warning",n=f((c=e.value)!=null?c:0);return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:s(.5),fontSize:"1.5rem",cursor:r?"default":"pointer",color:u=>l(u,"shift-8",i)},_onMount:u=>{let h=u.domElement,m=n.get(),d=0,g=()=>{let v=d>0?d:m;Array.from(h.children).forEach((S,x)=>{S.innerHTML=x<v?Pa:$a})};h.innerHTML="";for(let v=1;v<=t;v++){let S=document.createElement("button");if(S.type="button",S.setAttribute("aria-label",`${v} star${v>1?"s":""}`),S.style.cssText="background:none;border:none;padding:0;cursor:inherit;color:inherit;font-size:inherit;display:flex;align-items:center;",!r){let x=v;S.addEventListener("click",()=>{let C=x===m?0:x;m=C,n.set(C),o==null||o(C),d=0,g()}),S.addEventListener("mouseenter",()=>{d=x,g()}),S.addEventListener("mouseleave",()=>{d=0,g()}),S.addEventListener("keydown",C=>{var _;let k=m;if(C.key==="ArrowRight"||C.key==="ArrowUp")k=Math.min(t,m+1),C.preventDefault();else if(C.key==="ArrowLeft"||C.key==="ArrowDown")k=Math.max(0,m-1),C.preventDefault();else return;m=k,n.set(k),o==null||o(k),g();let E=k>0?k-1:0;(_=h.children[E])==null||_.focus()})}h.appendChild(S)}g();let b=n.addListener(v=>{m=v,d===0&&g()});u.addHook("Remove",b)}}}function La(e={}){var u,h,m;let{size:t=16,thickness:r=.25}=e,o=f((u=e.value)!=null?u:0,"value"),i=f((h=e.color)!=null?h:"primary","color"),n=f((m=e.trackColor)!=null?m:"neutral","trackColor"),a=Math.round((1-r)*100),c=`radial-gradient(circle closest-side, transparent ${a}%, black ${a}%)`;return{role:"progressbar",ariaValuenow:d=>String(Math.round(o.get(d))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:d=>{d.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:s(t),height:s(t),borderRadius:"50%",background:d=>`conic-gradient(from -90deg, ${l(d,"shift-9",i.get(d))} ${o.get(d)}%, ${l(d,"shift-3",n.get(d))} 0%)`,WebkitMask:c,mask:c}}}function Ra(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{overflow:"auto","&::-webkit-scrollbar":{width:s(2),height:s(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>l(o,"shift-5",t.get(o)),borderRadius:s(999),border:`${s(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>l(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${l(o,"shift-5",t.get(o))} transparent`}}}function za(e={}){var r;let{color:t="neutral"}=e;return{role:"radiogroup",_context:{segmented:{value:f((r=e.value)!=null?r:"")}},style:{display:"inline-flex",paddingBlock:s(1),paddingInline:s(1),gap:s(.5),borderRadius:s(10),backgroundColor:o=>l(o,"shift-2",t)}}}function Ia(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"radio",_onInsert:n=>{var m,d;n.tagName!=="button"&&console.warn('"segmentedItem" patch must use button tag');let a=n.getContext("segmented");if(!a){console.warn('"segmentedItem" patch must be used inside a "segmented"');return}let u=((d=(m=n.parent)==null?void 0:m.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="radio"),h=n.key!==null&&n.key!==void 0?String(n.key):String(u.indexOf(n));n.attributes.set("ariaChecked",g=>a.value.get(g)===h),n.addEvent("click",()=>a.value.set(h))},style:{cursor:"pointer",fontSize:n=>y(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(3),border:"none",borderRadius:s(10),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:"transparent",transition:"background-color 300ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:n=>l(n,"shift-3",t.get(n))},"&[aria-checked=true]":{backgroundColor:n=>l(n,"shift-0",r.get(n)),color:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ma(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>y(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(p(o)*1),paddingBlock:o=>s(p(o)*1),paddingLeft:o=>s(p(o)*3),paddingRight:o=>s(p(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Nt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function Aa(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&h()};D(e.content,d);let g={div:v=>{let S=a.get(v),x=Array.isArray(S)?S:[S];return t.filter(k=>x.includes(k.value)).map(k=>({span:k.label,$:[We({color:o,removable:n})],_key:k.value,_onRemove:E=>{let _=a.get(),R=(Array.isArray(_)?_:[_]).filter(z=>z!==k.value);n?a.set(R):a.set(R[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(g),onClick:()=>c.get()?h():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+p(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(p(v)*2),borderRadius:v=>s(p(v)*1),fontSize:v=>y(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return D(m,b),m}function Va(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",u=>{let h=c.get(u);return a.multiple?h.includes(o):h===o}),n.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(h=>h!==o)):c.set(u.concat([o])):u!==o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>y(n,"inherit"),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function Na(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=f((a=e.value)!=null?a:r?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(m=>({input:null,name:e.name,value:m==null?"":String(m)}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(p(c)*2),paddingInline:c=>s(p(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function Ba(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=_e(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>y(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}function Ha(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}var xn={to:{transform:"rotate(360deg)"}},Sn=_e(JSON.stringify(xn));function ja(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>y(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Sn} 0.7s linear infinite`,[`@keyframes ${Sn}`]:xn}}}function Fa(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{D(a,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Wa(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function Ka(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize",r.setAttribute("aria-orientation",o?"vertical":"horizontal"),r.setAttribute("aria-valuemin",String(t.min)),r.setAttribute("aria-valuemax",String(t.max)),r.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let i=t.size.addListener(u=>{r.setAttribute("aria-valuenow",String(Math.round(u)))}),n=u=>{let h=u.shiftKey?10:1,m=null;o?u.key==="ArrowRight"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowLeft"&&(m=Math.max(t.size.get()-h,t.min)):u.key==="ArrowDown"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowUp"&&(m=Math.max(t.size.get()-h,t.min)),u.key==="Home"?m=t.min:u.key==="End"&&(m=t.max),m!==null&&(u.preventDefault(),t.size.set(m))},a=null,c=u=>{u.preventDefault();let h=r.parentElement,m=g=>{let b=h.getBoundingClientRect(),v=o?(g.clientX-b.left)/b.width*100:(g.clientY-b.top)/b.height*100;t.size.set(Math.min(Math.max(v,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null};a=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null},document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)};r.addEventListener("keydown",n),r.addEventListener("mousedown",c),e.addHook("Remove",()=>{a==null||a(),i(),r.removeEventListener("keydown",n),r.removeEventListener("mousedown",c)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${l(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',width:s(1),height:s(1),borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function Ua(){let e="neutral",t="primary";return{_onInsert:r=>{var c,u;let o=r.getContext("steps");if(!o){console.warn('"stepItem" patch must be used inside a "steps"');return}e=o.color,t=o.accentColor;let a=((u=(c=r.parent)==null?void 0:c.children.items)!=null?u:[]).filter(h=>h.type==="ElementNode").indexOf(r);r.domElement&&(r.domElement.dataset.step=String(a+1)),r.attributes.set("dataStatus",h=>{let m=o.current.get(h);return a<m?"done":a===m?"active":"pending"}),r.attributes.set("ariaCurrent",h=>o.current.get(h)===a?"step":void 0)},style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:s(1),flex:"1",fontSize:r=>y(r,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:s(6),height:s(6),borderRadius:s(999),fontSize:r=>y(r,"decrease-1"),fontWeight:"600",flexShrink:"0",border:r=>`2px solid ${l(r,"shift-4",e)}`,backgroundColor:r=>l(r,"inherit"),color:r=>l(r,"shift-8"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:s(3),right:`calc(50% + ${s(3)})`,left:`calc(-50% + ${s(3)})`,height:"2px",backgroundColor:r=>l(r,"shift-3",e),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:r=>l(r,"shift-6",t),borderColor:r=>l(r,"shift-6",t),color:r=>l(r,"shift-15",t)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:r=>l(r,"shift-3",e),borderColor:r=>l(r,"shift-3",e),color:r=>l(r,"shift-9",e)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:r=>l(r,"shift-3",e)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:r=>l(r,"shift-6",t)},"&[data-status=pending]":{color:r=>l(r,"shift-7")},"&[data-status=active]":{color:r=>l(r,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:r=>l(r,"shift-8")}}}}function qa(e={}){var n,a,c;let t=(n=e.direction)!=null?n:"horizontal",r=(a=e.color)!=null?a:"neutral",o=(c=e.accentColor)!=null?c:"primary";return{_onSchedule:(u,h)=>{var d;let m={_context:{steps:{current:f((d=e.current)!=null?d:0),direction:t,color:r,accentColor:o}}};D(h,m)},style:{display:"flex",flexDirection:t==="vertical"?"column":"row",alignItems:t==="vertical"?"flex-start":"center",gap:s(2),listStyle:"none",margin:"0",padding:"0"}}}function Ya(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>y(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Ga(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Xa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Ja(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var h,m;i.tagName!=="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(m=(h=i.parent)==null?void 0:h.children.items)!=null?m:[];a=a.filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="tab");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i),u={id:`tab${i.parent.nodeId}${c}`,ariaControls:`tabpanel${i.parent.nodeId}${c}`,ariaSelected:d=>n.activeKey.get(d)===c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var C,k,E,_;let g=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(g))return;d.preventDefault();let b=((k=(C=i.parent)==null?void 0:C.children.items)!=null?k:[]).filter(O=>O.type==="ElementNode"&&O.attributes.get("role")==="tab");if(!b.length)return;let v=b.indexOf(i),S=v;g==="ArrowRight"?S=(v+1)%b.length:g==="ArrowLeft"?S=(v-1+b.length)%b.length:g==="Home"?S=0:g==="End"&&(S=b.length-1);let x=b[S];n.activeKey.set((E=x.key)!=null?E:S),(_=x.domElement)==null||_.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>y(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function Za(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>y(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>`${l(o,"shift-2")}!important`}}}}function Qa(){return{role:"tabpanel",style:{paddingBlock:t=>s(p(t)*2),paddingInline:t=>s(p(t)*2)},_onInsert:t=>{var a,c;let r=t.getContext("tabs");if(!r){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(a=t.parent)==null?void 0:a.children.items)!=null?c:[];o=o.filter(u=>u.type==="ElementNode"&&u.attributes.get("role")==="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.indexOf(t),n={id:`tabpanel${t.parent.nodeId}${i}`,ariaLabelledby:`tab${t.parent.nodeId}${i}`,hidden:u=>r.activeKey.get(u)!==i};t.merge(n)}}}function el(e={}){return{role:"tablist",ariaOrientation:"horizontal",_onSchedule:(r,o)=>{var n;let i={_context:{tabs:{activeKey:f((n=e.activeKey)!=null?n:0)}}};D(o,i)}}}function tl(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let c=a.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=`${c.scrollHeight}px`};c.addEventListener("input",u),u(),a.addHook("Remove",()=>c.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(p(a)*2),paddingBlock:a=>s(p(a)*1.5),border:"none",borderRadius:a=>s(p(a)*1.5),fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),"&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${s(.5)} solid ${l(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function ol(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function nl(e={}){var n,a,c;let{last:t=!1}=e,r=(n=e.color)!=null?n:"neutral",o=(a=e.accentColor)!=null?a:"primary",i=f((c=e.active)!=null?c:!1);return{style:Ce({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>s(p(u)*2),paddingBottom:u=>t?"0":s(p(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>l(u,"shift-8",i.get(u)?o:r),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${s(p(u)*4)}`,width:"2px",backgroundColor:u=>l(u,"shift-3",r)}})}}function rl(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let h=u.domElement.querySelector(`#domphy-toast-${t}`);return h||(h=u.children.insert(c).domElement),h},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(p(u)*2),paddingInline:u=>s(p(u)*4),borderRadius:u=>s(p(u)*2),fontSize:u=>y(u,"inherit"),color:u=>l(u,"shift-9",r),backgroundColor:u=>l(u,"inherit",r),boxShadow:u=>`0 ${s(2)} ${s(9)} ${l(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,h)=>{let m=!1,d=null,g=()=>{m||(m=!0,d&&(clearTimeout(d),d=null),u.domElement.removeEventListener("transitionend",b),h())},b=v=>{v.propertyName==="transform"&&g()};u.domElement.addEventListener("transitionend",b),d=setTimeout(g,350),u.addHook("Remove",()=>{var v;d&&(clearTimeout(d),d=null),(v=u.domElement)==null||v.removeEventListener("transitionend",b)}),o.set(!1)}}}function il(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var m,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup");if(!a){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(m=n.parent)==null?void 0:m.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="button"),h=n.key!==null&&n.key!==void 0?String(n.key):String(u.indexOf(n));n.attributes.set("ariaPressed",g=>{let b=a.value.get(g);return Array.isArray(b)?b.includes(h):b===h}),n.addEvent("click",()=>{let g=a.value.get();if(a.multiple){let b=Array.isArray(g)?[...g]:[];a.value.set(b.includes(h)?b.filter(v=>v!==h):[...b,h])}else a.value.set(g===h?"":h)})},style:{cursor:"pointer",fontSize:n=>y(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function al(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function ll(e={}){var r;let t=(r=e.gap)!=null?r:4;return{style:{display:"flex",alignItems:"center",gap:o=>s(p(o)*t)}}}function sl(){return{div:null,style:{flex:"1 1 0"}}}function cl(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),a=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,c={span:b=>n.get(b),id:a},{show:u,hide:h,anchorPartial:m}=te({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:b=>s(p(b)*1),paddingInline:b=>s(p(b)*3),borderRadius:b=>s(p(b)*1),color:b=>l(b,"shift-9"),backgroundColor:b=>l(b),fontSize:b=>y(b,"inherit")},$:[Jt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),D(m,{ariaDescribedby:a,onMouseEnter:()=>u(),onMouseLeave:()=>h(),onFocus:()=>u(),onBlur:()=>h(),onKeyDown:b=>b.key==="Escape"&&h()}),m}function wn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function ul(e={}){let{duration:t=300,delay:r=0}=e,o=new Map,i=new Map,n=new Set,a=new Set;return{_onMount:c=>{c.addHook("Remove",()=>{for(let u of Array.from(i.values()))u();i.clear();for(let u of n)clearTimeout(u);n.clear();for(let u of a)cancelAnimationFrame(u);a.clear()})},_onBeforeUpdate:c=>{o=new Map,c.children.items.forEach((u,h)=>{if(!(u instanceof V))return;let m=u.domElement;m&&o.set(wn(u,h),m.getBoundingClientRect())})},_onUpdate:c=>{c.children.items.forEach((u,h)=>{var O;if(!(u instanceof V))return;let m=u.domElement;if(!m)return;let d=wn(u,h),g=o.get(d);if(!g)return;let b=m.getBoundingClientRect(),v=g.left-b.left,S=g.top-b.top;if(Math.abs(v)<.5&&Math.abs(S)<.5)return;(O=i.get(m))==null||O(),m.style.transition="none",m.style.transform=`translate(${v}px, ${S}px)`,m.getBoundingClientRect();let x=requestAnimationFrame(()=>{a.delete(x),m.style.transition=`transform ${t}ms ease ${r}ms`,m.style.transform="translate(0px, 0px)"});a.add(x);let C=!1,k=null,E=()=>{C||(C=!0,k&&(n.delete(k),k=null),i.delete(m),m.removeEventListener("transitionend",_),m.style.transition="",m.style.transform="")},_=R=>{R.propertyName==="transform"&&E()};i.set(m,()=>{C=!0,k&&(clearTimeout(k),n.delete(k),k=null),i.delete(m),m.removeEventListener("transitionend",_)}),m.addEventListener("transitionend",_),k=setTimeout(E,t+r+34),n.add(k)}),o.clear()}}}function ml(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}return Bn(dl);})();
5
+ `)}function Sr(e){var t;if(typeof document!="undefined")if(e){e.textContent=zt();return}else e=(t=document.getElementById("domphy-themes"))!=null?t:Object.assign(document.createElement("style"),{id:"domphy-themes"}),e.textContent=zt(),document.head.appendChild(e)}function s(e){return`calc(${e/4}em)`}function xr(e,t,r=320,o=1280){let i=e/4,n=t/4,a=(n-i)/(o-r)*100,c=i-a*r/100,u=parseFloat(c.toFixed(4))===0?`${a.toFixed(4)}vw`:`${c.toFixed(4)}em + ${a.toFixed(4)}vw`;return`clamp(${i}em, ${u}, ${n}em)`}function wr(e=document.documentElement,t={}){let{persist:r=!0,storageKey:o="dp-theme"}=t,i=()=>{if(r){let c=localStorage.getItem(o);if(c==="light"||c==="dark")return c}return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"};e.setAttribute("data-theme",i());let n=window.matchMedia("(prefers-color-scheme: dark)"),a=c=>{(!r||!localStorage.getItem(o))&&e.setAttribute("data-theme",c.matches?"dark":"light")};return n.addEventListener("change",a),()=>n.removeEventListener("change",a)}function et(e){let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTheme"));)t=t.parent;let r="light";return t&&t.attributes&&t.attributes.has("dataTheme")&&(r=t.attributes.get("dataTheme"),typeof e=="function"&&t.attributes.addListener("dataTheme",e)),r}var It=["inherit"];[...Array(5).keys()].forEach(e=>{It.push(`decrease-${e}`),It.push(`increase-${e}`)});function Cr(e,t="inherit"){if(!It.includes(t))throw Error(`density name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(4,r))}function kr(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataDensity"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataDensity")&&(r=Cr(r,t.attributes.get("dataDensity")),typeof e=="function"&&t.attributes.addListener("dataDensity",e)),r}function p(e){let t=kr(e);return Z(e?et(e):"light").densities[t]}var Mt=["inherit"];[...Array(8).keys()].forEach(e=>{Mt.push(`decrease-${e}`),Mt.push(`increase-${e}`)});function Io(e,t="inherit"){if(!Mt.includes(t))throw Error(`size name "${t}" invalid`);let r;if(t==="inherit")r=e;else if(t!=null&&t.startsWith("increase-")){let o=parseInt(t.replace("increase-",""),10);r=e+o}else if(t!=null&&t.startsWith("decrease-")){let o=parseInt(t.replace("decrease-",""),10);r=e-o}else r=e;return Math.max(0,Math.min(7,r))}function Er(e){if(!e)return 2;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataSize"));)t=t.parent;let r=2;return t&&t.attributes&&t.attributes.has("dataSize")&&(r=Io(r,t.attributes.get("dataSize")),typeof e=="function"&&t.attributes.addListener("dataSize",e)),r}function y(e,t="inherit"){let r=Io(Er(e),t);return Ve().fontSizes[r]}var le=Be.colors.neutral.length,Ne=["inherit","base"];[...Array(le).keys()].forEach(e=>{Ne.push(`decrease-${e}`),Ne.push(`increase-${e}`),Ne.push(`shift-${e}`)});function Do(e,t){if(e<0||e>le-1)return e;let r=e+t;return r=Math.max(0,Math.min(le-1,r)),r}function Tr(e,t){if(e<0||e>le-1)return e;let r=Math.floor((le-1)/2),o=e<=r?e+t:e-t;return o=Math.max(0,Math.min(le-1,o)),o}function He(e,t="inherit"){if(typeof t=="number")return t;if(t==="inherit")return e;if(!Ne.includes(t))throw Error(`tone name "${t}" invalid`);if(t.startsWith("increase-")){let r=parseInt(t.replace("increase-",""),10);return Do(e,r)}else if(t.startsWith("decrease-")){let r=parseInt(t.replace("decrease-",""),10);return Do(e,-r)}else if(t.startsWith("shift-")){let r=parseInt(t.replace("shift-",""),10);return Tr(e,r)}else return e}function Mo(e){if(!e)return 0;let t=typeof e=="function"?e.elementNode:e;for(;t&&(!t.attributes||!t.attributes.get("dataTone"));)t=t.parent;let r=0;return t&&t.attributes&&t.attributes.has("dataTone")&&(r=He(r,t.attributes.get("dataTone")),typeof e=="function"&&t.attributes.addListener("dataTone",e)),r}function Ao(e,t,r){return r<=0?e:t==="lighten"&&e===0?r:t==="darken"&&e===le-1?le-1-r:e}function l(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r;if(!e)return t==="base"?Ve()[o][Z("light").baseTones[o]]:Ve()[o][He(0,t)];let i=et(e),n;if(t==="base")n=Z(i).baseTones[o];else{let c=Z(i),u=Ao(Mo(e),c.direction,c.darkBias);n=He(u,t)}let a=Ve()[o];if(!a)throw Error(`color "${o}" not found on theme "${i}"`);return a[n]}function Nt(e,t="inherit",r="inherit"){let o=r==="inherit"?"neutral":r,i=e?et(e):"light",n=zo(i);if(!e)return t==="base"?n[o][Z("light").baseTones[o]]:n[o][He(0,t)];let a;if(t==="base")a=Z(i).baseTones[o];else{let c=Z(i),u=Ao(Mo(e),c.direction,c.darkBias);a=He(u,t)}return n[o][a]}var ft={};Ge(ft,{abbreviation:()=>_r,accordion:()=>Or,alert:()=>Pr,avatar:()=>$r,badge:()=>Dr,blockquote:()=>Lr,breadcrumb:()=>Rr,breadcrumbEllipsis:()=>zr,button:()=>Ir,buttonGhost:()=>Mr,buttonSwitch:()=>Ar,card:()=>Vr,code:()=>Nr,combobox:()=>_i,command:()=>Oi,commandItem:()=>$i,commandSearch:()=>Pi,datePicker:()=>Li,descriptionList:()=>Ii,details:()=>Mi,dialog:()=>Ai,divider:()=>Vi,drawer:()=>Ni,emphasis:()=>Bi,empty:()=>Hi,errorBoundary:()=>ji,fab:()=>Wi,figure:()=>Ki,formGroup:()=>Ui,heading:()=>Yi,horizontalRule:()=>Gi,icon:()=>Xi,image:()=>Ji,inputCheckbox:()=>Zi,inputColor:()=>Qi,inputDateTime:()=>ea,inputFile:()=>ta,inputNumber:()=>oa,inputOTP:()=>ia,inputPassword:()=>ra,inputRadio:()=>aa,inputRange:()=>la,inputSearch:()=>sa,inputSwitch:()=>ca,inputText:()=>ua,keyboard:()=>ma,label:()=>da,link:()=>ha,linkButton:()=>fa,list:()=>pa,listItem:()=>ga,listItemButton:()=>ya,mark:()=>ba,menu:()=>va,menuItem:()=>Sa,motion:()=>xa,orderedList:()=>wa,pagination:()=>ka,paragraph:()=>Ea,popover:()=>Ta,popoverArrow:()=>Jt,preformated:()=>_a,progress:()=>Oa,rating:()=>Da,ringProgress:()=>La,scrollArea:()=>Ra,segmented:()=>za,segmentedItem:()=>Ia,select:()=>Ma,selectBox:()=>Aa,selectItem:()=>Va,selectList:()=>Na,skeleton:()=>Ba,small:()=>Ha,spinner:()=>ja,splitter:()=>Fa,splitterHandle:()=>Ka,splitterPanel:()=>Wa,stepItem:()=>Ua,steps:()=>qa,strong:()=>Ya,subscript:()=>Ga,superscript:()=>Xa,tab:()=>Ja,tabPanel:()=>Qa,table:()=>Za,tabs:()=>el,tag:()=>We,textarea:()=>tl,timeline:()=>ol,timelineItem:()=>nl,toast:()=>rl,toggle:()=>il,toggleGroup:()=>al,toolbar:()=>ll,toolbarSpacer:()=>sl,tooltip:()=>cl,transitionGroup:()=>ul,unorderedList:()=>ml});function _r(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="abbr"&&console.warn('"abbreviation" primitive patch must use abbr tag')},style:{fontSize:n=>y(n),backgroundColor:n=>l(n),color:n=>l(n,"shift-10",t.get(n)),textDecorationLine:"underline",textDecorationStyle:"dotted",textDecorationColor:n=>l(n,"shift-7",t.get(n)),textUnderlineOffset:s(.72),cursor:"help","&:hover":{color:n=>l(n,"shift-11",r.get(n)),textDecorationColor:n=>l(n,"shift-9",r.get(n))}}}}function Or(e={}){var i,n;let{type:t="single"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onMount:a=>{if(t!=="single")return;let c=a.domElement;if(!c)return;let u=h=>{let m=h.target.closest("summary");if(!m)return;let d=m.closest("details");!d||d.parentElement!==c||d.open||Array.from(c.querySelectorAll(":scope > details")).forEach(g=>{g!==d&&(g.open=!1)})};c.addEventListener("click",u),a.addHook("Remove",()=>c.removeEventListener("click",u))},style:{display:"flex",flexDirection:"column",borderRadius:a=>s(p(a)*1),outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,outlineOffset:"-1px",overflow:"hidden","& > details":{borderBottom:a=>`1px solid ${l(a,"shift-4",r.get(a))}`},"& > details:last-child":{borderBottom:"none"},"& > details > summary:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`}}}}function Pr(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{role:"alert",dataTone:"shift-2",style:{display:"flex",alignItems:"flex-start",gap:s(3),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-8",t.get(o))}`,backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),fontSize:o=>y(o,"inherit")}}}function $r(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{dataTone:"shift-2",style:{position:"relative",display:"inline-flex",alignItems:"center",justifyContent:"center",overflow:"hidden",borderRadius:"50%",flexShrink:0,width:s(9),height:s(9),fontSize:o=>y(o,"inherit"),fontWeight:"600",userSelect:"none",backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-11",t.get(o)),"& img":{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover"}}}}function Dr(e={}){var i;let{label:t=999}=e,r=f(t),o=f((i=e.color)!=null?i:"danger","color");return{style:{position:"relative","&::after":{content:n=>`"${r.get(n)}"`,position:"absolute",top:0,right:0,transform:"translate(50%,-50%)",paddingInline:s(1),minWidth:s(6),display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:n=>y(n,"decrease-1"),borderRadius:s(999),backgroundColor:n=>l(n,"shift-9",o.get(n)),color:n=>l(n,"shift-0",o.get(n))}}}}function Lr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="blockquote"&&console.warn('"blockquote" primitive patch must use blockquote tag')},dataTone:"shift-2",style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o,"inherit",t.get(o)),boxShadow:o=>`inset ${s(1)} 0 0 0 ${l(o,"shift-4",t.get(o))}`,border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),margin:0}}}function Rr(e={}){var o;let{separator:t="/"}=e,r=f((o=e.color)!=null?o:"neutral","color");return{_onInsert:i=>{i.tagName!=="nav"&&console.warn('"breadcrumb" patch must use nav tag')},ariaLabel:"breadcrumb",style:{display:"flex",alignItems:"center",flexWrap:"wrap",fontSize:i=>y(i,"inherit"),gap:s(1),color:i=>l(i,"shift-9",r.get(i)),backgroundColor:i=>l(i,"inherit",r.get(i)),"& > *":{display:"inline-flex",alignItems:"center",color:i=>l(i,"shift-8",r.get(i))},"& > *:not(:last-child)::after":{content:`"${t}"`,color:i=>l(i,"shift-4",r.get(i)),paddingInlineStart:s(1)},"& > [aria-current=page]":{color:i=>l(i,"shift-10",r.get(i)),pointerEvents:"none"}}}}function zr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"breadcrumbEllipsis" patch must use button tag')},ariaLabel:"More breadcrumb items",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:o=>y(o,"inherit"),paddingInline:s(1),border:"none",background:"none",cursor:"pointer",color:o=>l(o,"shift-8",t.get(o)),borderRadius:s(1),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",t.get(o))}`,outlineOffset:s(.5)}}}}function Ir(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"button" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*1),width:"fit-content",display:"flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Mr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="button"&&console.warn('"buttonGhost" primitive patch must use button tag')},style:{appearance:"none",fontSize:o=>y(o,"inherit"),paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*1),borderRadius:o=>s(p(o)*1),display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",fontFamily:"inherit",lineHeight:"inherit",border:"none",background:"none",outline:"none",color:o=>l(o,"shift-6",t.get(o)),"&:hover:not([disabled]):not([aria-busy=true])":{color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-4","neutral")},"&[aria-busy=true]":{opacity:.7,cursor:"wait",pointerEvents:"none"}}}}function Ar(e={}){var n,a;let{checked:t=!1}=e,r=f(t),o=f((n=e.color)!=null?n:"neutral","color"),i=f((a=e.accentColor)!=null?a:"primary","accentColor");return{_onSchedule:c=>{c.tagName!=="button"&&console.warn('"buttonSwitch" primitive patch must use button tag')},role:"switch",ariaChecked:c=>r.get(c),dataTone:"shift-2",onClick:()=>r.set(!r.get()),style:{position:"relative",display:"inline-flex",alignItems:"center",fontSize:c=>y(c),border:"none",outlineWidth:"1px",outline:c=>`1px solid ${l(c,"shift-3",o.get(c))}`,minWidth:s(12),minHeight:s(6),borderRadius:s(999),paddingLeft:s(7),paddingRight:s(2),transition:"padding-left 0.3s, padding-right 0.3s",backgroundColor:c=>l(c,"inherit",o.get(c)),"& > :first-child":{content:'""',position:"absolute",display:"inline-flex",alignItems:"center",left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",width:s(5),height:s(5),borderRadius:s(999),color:c=>l(c,"shift-9"),backgroundColor:c=>l(c,"decrease-2",o.get(c))},"&[aria-checked=true]":{backgroundColor:c=>l(c,"increase-3",i.get(c)),outline:"none",color:c=>l(c,"decrease-2"),paddingLeft:s(2),paddingRight:s(7)},"&[aria-checked=true] > :first-child":{left:`calc(100% - ${s(5.5)})`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Vr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"grid",gridTemplateColumns:"1fr auto",gridTemplateAreas:'"image image" "title aside" "desc aside" "content content" "footer footer"',borderRadius:o=>s(p(o)*2),backgroundColor:o=>l(o,"inherit",t.get(o)),color:o=>l(o,"shift-10",t.get(o)),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,outlineOffset:"-1px",overflow:"hidden","& > img":{gridArea:"image",width:"100%",height:"auto",display:"block"},"& > :is(h1,h2,h3,h4,h5,h6)":{gridArea:"title",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),fontWeight:"600",margin:0},"& > p":{gridArea:"desc",paddingInline:o=>s(p(o)*4),color:o=>l(o,"shift-9",t.get(o)),margin:0},"& > aside":{gridArea:"aside",alignSelf:"center",padding:o=>s(p(o)*2),height:"auto"},"& > div":{gridArea:"content",padding:o=>s(p(o)*4),color:o=>l(o,"shift-10",t.get(o))},"& > footer":{gridArea:"footer",display:"flex",gap:s(2),paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*4),borderTop:o=>`1px solid ${l(o,"shift-3",t.get(o))}`}}}}function Nr(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="code"&&console.warn('"code" primitive patch must use code tag')},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),paddingInline:s(1.5),borderRadius:s(1)}}}var Br=Object.defineProperty,Hr=Object.defineProperties,jr=Object.getOwnPropertyDescriptors,nt=Object.getOwnPropertySymbols,Yo=Object.prototype.hasOwnProperty,Go=Object.prototype.propertyIsEnumerable,Vo=(e,t,r)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y=(e,t)=>{for(var r in t||(t={}))Yo.call(t,r)&&Vo(e,r,t[r]);if(nt)for(var r of nt(t))Go.call(t,r)&&Vo(e,r,t[r]);return e},ge=(e,t)=>Hr(e,jr(t)),Xo=(e,t)=>{var r={};for(var o in e)Yo.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&nt)for(var o of nt(e))t.indexOf(o)<0&&Go.call(e,o)&&(r[o]=e[o]);return r},ve=(e,t,r)=>new Promise((o,i)=>{var n=u=>{try{c(r.next(u))}catch(h){i(h)}},a=u=>{try{c(r.throw(u))}catch(h){i(h)}},c=u=>u.done?o(u.value):Promise.resolve(u.value).then(n,a);c((r=r.apply(e,t)).next())}),Fr=["top","right","bottom","left"],No=["start","end"],us=Fr.reduce((e,t)=>e.concat(t,`${t}-${No[0]}`,`${t}-${No[1]}`),[]),rt=Math.min,pe=Math.max,it=Math.round,ot=Math.floor,Q=e=>({x:e,y:e}),Wr={left:"right",right:"left",bottom:"top",top:"bottom"};function Bo(e,t,r){return pe(e,rt(t,r))}function st(e,t){return typeof e=="function"?e(t):e}function ye(e){return e.split("-")[0]}function ct(e){return e.split("-")[1]}function Jo(e){return e==="x"?"y":"x"}function Zo(e){return e==="y"?"height":"width"}function se(e){let t=e[0];return t==="t"||t==="b"?"y":"x"}function Qo(e){return Jo(se(e))}function Kr(e,t,r=!1){let o=ct(e),i=Qo(e),n=Zo(i),a=i==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[n]>t.floating[n]&&(a=at(a)),[a,at(a)]}function Ur(e){let t=at(e);return[jt(e),t,jt(t)]}function jt(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}var Ho=["left","right"],jo=["right","left"],qr=["top","bottom"],Yr=["bottom","top"];function Gr(e,t,r){switch(e){case"top":case"bottom":return r?t?jo:Ho:t?Ho:jo;case"left":case"right":return t?qr:Yr;default:return[]}}function Xr(e,t,r,o){let i=ct(e),n=Gr(ye(e),r==="start",o);return i&&(n=n.map(a=>`${a}-${i}`),t&&(n=n.concat(n.map(jt)))),n}function at(e){let t=ye(e);return Wr[t]+e.slice(t.length)}function Jr(e){return Y({top:0,right:0,bottom:0,left:0},e)}function Zr(e){return typeof e!="number"?Jr(e):{top:e,right:e,bottom:e,left:e}}function lt(e){let{x:t,y:r,width:o,height:i}=e;return{width:o,height:i,top:r,left:t,right:t+o,bottom:r+i,x:t,y:r}}function Fo({reference:e,floating:t},r,o){let i=se(r),n=Qo(r),a=Zo(n),c=ye(r),u=i==="y",h=e.x+e.width/2-t.width/2,m=e.y+e.height/2-t.height/2,d=e[a]/2-t[a]/2,g;switch(c){case"top":g={x:h,y:e.y-t.height};break;case"bottom":g={x:h,y:e.y+e.height};break;case"right":g={x:e.x+e.width,y:m};break;case"left":g={x:e.x-t.width,y:m};break;default:g={x:e.x,y:e.y}}switch(ct(r)){case"start":g[n]-=d*(o&&u?-1:1);break;case"end":g[n]+=d*(o&&u?-1:1);break;default:}return g}function Qr(e){return ve(this,arguments,function*(t,r={}){var o,i,n,a,c,u;let{x:h,y:m,platform:d,rects:g,elements:b,strategy:v}=t,{boundary:S="clippingAncestors",rootBoundary:x="viewport",elementContext:C="floating",altBoundary:k=!1,padding:E=0}=st(r,t),_=Zr(E),O=b[k?C==="floating"?"reference":"floating":C],R=lt(yield d.getClippingRect({element:(i=yield(o=d.isElement)==null?void 0:o.call(d,O))==null||i?O:O.contextElement||(yield(n=d.getDocumentElement)==null?void 0:n.call(d,b.floating)),boundary:S,rootBoundary:x,strategy:v})),z=C==="floating"?{x:h,y:m,width:g.floating.width,height:g.floating.height}:g.reference,ie=yield(a=d.getOffsetParent)==null?void 0:a.call(d,b.floating),W=(yield(c=d.isElement)==null?void 0:c.call(d,ie))?(yield(u=d.getScale)==null?void 0:u.call(d,ie))||{x:1,y:1}:{x:1,y:1},H=lt(d.convertOffsetParentRelativeRectToViewportRelativeRect?yield d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:b,rect:z,offsetParent:ie,strategy:v}):z);return{top:(R.top-H.top+_.top)/W.y,bottom:(H.bottom-R.bottom+_.bottom)/W.y,left:(R.left-H.left+_.left)/W.x,right:(H.right-R.right+_.right)/W.x}})}var ei=50,ti=(e,t,r)=>ve(null,null,function*(){var o;let{placement:i="bottom",strategy:n="absolute",middleware:a=[],platform:c}=r,u=c.detectOverflow?c:ge(Y({},c),{detectOverflow:Qr}),h=yield(o=c.isRTL)==null?void 0:o.call(c,t),m=yield c.getElementRects({reference:e,floating:t,strategy:n}),{x:d,y:g}=Fo(m,i,h),b=i,v=0,S={};for(let x=0;x<a.length;x++){let C=a[x];if(!C)continue;let{name:k,fn:E}=C,{x:_,y:O,data:R,reset:z}=yield E({x:d,y:g,initialPlacement:i,placement:b,strategy:n,middlewareData:S,rects:m,platform:u,elements:{reference:e,floating:t}});d=_!=null?_:d,g=O!=null?O:g,S[k]=Y(Y({},S[k]),R),z&&v<ei&&(v++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(m=z.rects===!0?yield c.getElementRects({reference:e,floating:t,strategy:n}):z.rects),{x:d,y:g}=Fo(m,b,h)),x=-1)}return{x:d,y:g,placement:b,strategy:n,middlewareData:S}});var oi=(e={})=>({name:"flip",options:e,fn(t){return ve(this,null,function*(){var r,o,i,n,a,c;let{placement:u,middlewareData:h,rects:m,initialPlacement:d,platform:g,elements:b}=t,v=st(e,t),{mainAxis:S=!0,crossAxis:x=!0,fallbackPlacements:C,fallbackStrategy:k="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:_=!0}=v,O=Xo(v,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((r=h.arrow)!=null&&r.alignmentOffset)return{};let R=ye(u),z=se(d),ie=ye(d)===d,W=yield(o=g.isRTL)==null?void 0:o.call(g,b.floating),H=C||(ie||!_?[at(d)]:Ur(d)),qe=E!=="none";!C&&qe&&H.push(...Xr(d,_,E,W));let pt=[d,...H],xe=yield g.detectOverflow(t,O),j=[],oe=((i=h.flip)==null?void 0:i.overflows)||[];if(S&&j.push(xe[R]),x){let ne=Kr(u,m,W);j.push(xe[ne[0]],xe[ne[1]])}if(oe=[...oe,{placement:u,overflows:j}],!j.every(ne=>ne<=0)){let ne=(((n=h.flip)==null?void 0:n.index)||0)+1,Re=pt[ne];if(Re&&(!(x==="alignment"&&z!==se(Re))||oe.every(N=>se(N.placement)===z?N.overflows[0]>0:!0)))return{data:{index:ne,overflows:oe},reset:{placement:Re}};let ue=(a=oe.filter(N=>N.overflows[0]<=0).sort((N,U)=>N.overflows[1]-U.overflows[1])[0])==null?void 0:a.placement;if(!ue)switch(k){case"bestFit":{let N=(c=oe.filter(U=>{if(qe){let q=se(U.placement);return q===z||q==="y"}return!0}).map(U=>[U.placement,U.overflows.filter(q=>q>0).reduce((q,ze)=>q+ze,0)]).sort((U,q)=>U[1]-q[1])[0])==null?void 0:c[0];N&&(ue=N);break}case"initialPlacement":ue=d;break;default:}if(u!==ue)return{reset:{placement:ue}}}return{}})}});var ni=new Set(["left","top"]);function ri(e,t){return ve(this,null,function*(){var r;let{placement:o,platform:i,elements:n}=e,a=yield(r=i.isRTL)==null?void 0:r.call(i,n.floating),c=ye(o),u=ct(o),h=se(o)==="y",m=ni.has(c)?-1:1,d=a&&h?-1:1,g=st(t,e),{mainAxis:b,crossAxis:v,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),h?{x:v*d,y:b*m}:{x:b*m,y:v*d}})}var ii=(e=0)=>({name:"offset",options:e,fn(t){return ve(this,null,function*(){var r,o;let{x:i,y:n,placement:a,middlewareData:c}=t,u=yield ri(t,e);return a===((r=c.offset)==null?void 0:r.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+u.x,y:n+u.y,data:ge(Y({},u),{placement:a})}})}}),ai=(e={})=>({name:"shift",options:e,fn(t){return ve(this,null,function*(){let{x:r,y:o,placement:i,platform:n}=t,a=st(e,t),{mainAxis:c=!0,crossAxis:u=!1,limiter:h={fn:({x:k,y:E})=>({x:k,y:E})}}=a,m=Xo(a,["mainAxis","crossAxis","limiter"]),d={x:r,y:o},g=yield n.detectOverflow(t,m),b=se(ye(i)),v=Jo(b),S=d[v],x=d[b];if(c){let k=v==="y"?"top":"left",E=v==="y"?"bottom":"right",_=S+g[k],O=S-g[E];S=Bo(_,S,O)}if(u){let k=b==="y"?"top":"left",E=b==="y"?"bottom":"right",_=x+g[k],O=x-g[E];x=Bo(_,x,O)}let C=h.fn(ge(Y({},t),{[v]:S,[b]:x}));return ge(Y({},C),{data:{x:C.x-r,y:C.y-o,enabled:{[v]:c,[b]:u}}})})}});function ut(){return typeof window!="undefined"}function De(e){return en(e)?(e.nodeName||"").toLowerCase():"#document"}function F(e){var t;return((t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)||window}function ee(e){var t;return(t=(en(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function en(e){return ut()?e instanceof Node||e instanceof F(e).Node:!1}function G(e){return ut()?e instanceof Element||e instanceof F(e).Element:!1}function re(e){return ut()?e instanceof HTMLElement||e instanceof F(e).HTMLElement:!1}function Wo(e){return!ut()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof F(e).ShadowRoot}function Fe(e){let{overflow:t,overflowX:r,overflowY:o,display:i}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&i!=="inline"&&i!=="contents"}function li(e){return/^(table|td|th)$/.test(De(e))}function mt(e){try{if(e.matches(":popover-open"))return!0}catch(t){}try{return e.matches(":modal")}catch(t){return!1}}var si=/transform|translate|scale|rotate|perspective|filter/,ci=/paint|layout|strict|content/,fe=e=>!!e&&e!=="none",Bt;function Wt(e){let t=G(e)?X(e):e;return fe(t.transform)||fe(t.translate)||fe(t.scale)||fe(t.rotate)||fe(t.perspective)||!Kt()&&(fe(t.backdropFilter)||fe(t.filter))||si.test(t.willChange||"")||ci.test(t.contain||"")}function ui(e){let t=ce(e);for(;re(t)&&!$e(t);){if(Wt(t))return t;if(mt(t))return null;t=ce(t)}return null}function Kt(){return Bt==null&&(Bt=typeof CSS!="undefined"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Bt}function $e(e){return/^(html|body|#document)$/.test(De(e))}function X(e){return F(e).getComputedStyle(e)}function dt(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(De(e)==="html")return e;let t=e.assignedSlot||e.parentNode||Wo(e)&&e.host||ee(e);return Wo(t)?t.host:t}function tn(e){let t=ce(e);return $e(t)?e.ownerDocument?e.ownerDocument.body:e.body:re(t)&&Fe(t)?t:tn(t)}function je(e,t=[],r=!0){var o;let i=tn(e),n=i===((o=e.ownerDocument)==null?void 0:o.body),a=F(i);if(n){let c=Ft(a);return t.concat(a,a.visualViewport||[],Fe(i)?i:[],c&&r?je(c):[])}else return t.concat(i,je(i,[],r))}function Ft(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function on(e){let t=X(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,i=re(e),n=i?e.offsetWidth:r,a=i?e.offsetHeight:o,c=it(r)!==n||it(o)!==a;return c&&(r=n,o=a),{width:r,height:o,$:c}}function Ut(e){return G(e)?e:e.contextElement}function Pe(e){let t=Ut(e);if(!re(t))return Q(1);let r=t.getBoundingClientRect(),{width:o,height:i,$:n}=on(t),a=(n?it(r.width):r.width)/o,c=(n?it(r.height):r.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!c||!Number.isFinite(c))&&(c=1),{x:a,y:c}}var mi=Q(0);function nn(e){let t=F(e);return!Kt()||!t.visualViewport?mi:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function di(e,t=!1,r){return!r||t&&r!==F(e)?!1:t}function be(e,t=!1,r=!1,o){let i=e.getBoundingClientRect(),n=Ut(e),a=Q(1);t&&(o?G(o)&&(a=Pe(o)):a=Pe(e));let c=di(n,r,o)?nn(n):Q(0),u=(i.left+c.x)/a.x,h=(i.top+c.y)/a.y,m=i.width/a.x,d=i.height/a.y;if(n){let g=F(n),b=o&&G(o)?F(o):o,v=g,S=Ft(v);for(;S&&o&&b!==v;){let x=Pe(S),C=S.getBoundingClientRect(),k=X(S),E=C.left+(S.clientLeft+parseFloat(k.paddingLeft))*x.x,_=C.top+(S.clientTop+parseFloat(k.paddingTop))*x.y;u*=x.x,h*=x.y,m*=x.x,d*=x.y,u+=E,h+=_,v=F(S),S=Ft(v)}}return lt({width:m,height:d,x:u,y:h})}function ht(e,t){let r=dt(e).scrollLeft;return t?t.left+r:be(ee(e)).left+r}function rn(e,t){let r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-ht(e,r),i=r.top+t.scrollTop;return{x:o,y:i}}function hi({elements:e,rect:t,offsetParent:r,strategy:o}){let i=o==="fixed",n=ee(r),a=e?mt(e.floating):!1;if(r===n||a&&i)return t;let c={scrollLeft:0,scrollTop:0},u=Q(1),h=Q(0),m=re(r);if((m||!m&&!i)&&((De(r)!=="body"||Fe(n))&&(c=dt(r)),m)){let g=be(r);u=Pe(r),h.x=g.x+r.clientLeft,h.y=g.y+r.clientTop}let d=n&&!m&&!i?rn(n,c):Q(0);return{width:t.width*u.x,height:t.height*u.y,x:t.x*u.x-c.scrollLeft*u.x+h.x+d.x,y:t.y*u.y-c.scrollTop*u.y+h.y+d.y}}function fi(e){return Array.from(e.getClientRects())}function pi(e){let t=ee(e),r=dt(e),o=e.ownerDocument.body,i=pe(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),n=pe(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),a=-r.scrollLeft+ht(e),c=-r.scrollTop;return X(o).direction==="rtl"&&(a+=pe(t.clientWidth,o.clientWidth)-i),{width:i,height:n,x:a,y:c}}var Ko=25;function gi(e,t){let r=F(e),o=ee(e),i=r.visualViewport,n=o.clientWidth,a=o.clientHeight,c=0,u=0;if(i){n=i.width,a=i.height;let m=Kt();(!m||m&&t==="fixed")&&(c=i.offsetLeft,u=i.offsetTop)}let h=ht(o);if(h<=0){let m=o.ownerDocument,d=m.body,g=getComputedStyle(d),b=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,v=Math.abs(o.clientWidth-d.clientWidth-b);v<=Ko&&(n-=v)}else h<=Ko&&(n+=h);return{width:n,height:a,x:c,y:u}}function yi(e,t){let r=be(e,!0,t==="fixed"),o=r.top+e.clientTop,i=r.left+e.clientLeft,n=re(e)?Pe(e):Q(1),a=e.clientWidth*n.x,c=e.clientHeight*n.y,u=i*n.x,h=o*n.y;return{width:a,height:c,x:u,y:h}}function Uo(e,t,r){let o;if(t==="viewport")o=gi(e,r);else if(t==="document")o=pi(ee(e));else if(G(t))o=yi(t,r);else{let i=nn(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return lt(o)}function an(e,t){let r=ce(e);return r===t||!G(r)||$e(r)?!1:X(r).position==="fixed"||an(r,t)}function bi(e,t){let r=t.get(e);if(r)return r;let o=je(e,[],!1).filter(c=>G(c)&&De(c)!=="body"),i=null,n=X(e).position==="fixed",a=n?ce(e):e;for(;G(a)&&!$e(a);){let c=X(a),u=Wt(a);!u&&c.position==="fixed"&&(i=null),(n?!u&&!i:!u&&c.position==="static"&&i&&(i.position==="absolute"||i.position==="fixed")||Fe(a)&&!u&&an(e,a))?o=o.filter(h=>h!==a):i=c,a=ce(a)}return t.set(e,o),o}function vi({element:e,boundary:t,rootBoundary:r,strategy:o}){let i=[...t==="clippingAncestors"?mt(e)?[]:bi(e,this._c):[].concat(t),r],n=Uo(e,i[0],o),a=n.top,c=n.right,u=n.bottom,h=n.left;for(let m=1;m<i.length;m++){let d=Uo(e,i[m],o);a=pe(d.top,a),c=rt(d.right,c),u=rt(d.bottom,u),h=pe(d.left,h)}return{width:c-h,height:u-a,x:h,y:a}}function Si(e){let{width:t,height:r}=on(e);return{width:t,height:r}}function xi(e,t,r){let o=re(t),i=ee(t),n=r==="fixed",a=be(e,!0,n,t),c={scrollLeft:0,scrollTop:0},u=Q(0);function h(){u.x=ht(i)}if(o||!o&&!n)if((De(t)!=="body"||Fe(i))&&(c=dt(t)),o){let b=be(t,!0,n,t);u.x=b.x+t.clientLeft,u.y=b.y+t.clientTop}else i&&h();n&&!o&&i&&h();let m=i&&!o&&!n?rn(i,c):Q(0),d=a.left+c.scrollLeft-u.x-m.x,g=a.top+c.scrollTop-u.y-m.y;return{x:d,y:g,width:a.width,height:a.height}}function Ht(e){return X(e).position==="static"}function qo(e,t){if(!re(e)||X(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return ee(e)===r&&(r=r.ownerDocument.body),r}function ln(e,t){let r=F(e);if(mt(e))return r;if(!re(e)){let i=ce(e);for(;i&&!$e(i);){if(G(i)&&!Ht(i))return i;i=ce(i)}return r}let o=qo(e,t);for(;o&&li(o)&&Ht(o);)o=qo(o,t);return o&&$e(o)&&Ht(o)&&!Wt(o)?r:o||ui(e)||r}var wi=function(e){return ve(this,null,function*(){let t=this.getOffsetParent||ln,r=this.getDimensions,o=yield r(e.floating);return{reference:xi(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Ci(e){return X(e).direction==="rtl"}var ki={convertOffsetParentRelativeRectToViewportRelativeRect:hi,getDocumentElement:ee,getClippingRect:vi,getOffsetParent:ln,getElementRects:wi,getClientRects:fi,getDimensions:Si,getScale:Pe,isElement:G,isRTL:Ci};function sn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ei(e,t){let r=null,o,i=ee(e);function n(){clearTimeout(o),r==null||r.disconnect(),r=null}function a(c=!1,u=1){n();let h=e.getBoundingClientRect(),{left:m,top:d,width:g,height:b}=h;if(c||t(),!g||!b)return;let v=ot(d),S=ot(i.clientWidth-(m+g)),x=ot(i.clientHeight-(d+b)),C=ot(m),k={rootMargin:`${-v}px ${-S}px ${-x}px ${-C}px`,threshold:pe(0,rt(1,u))||1},E=!0;function _(O){let R=O[0].intersectionRatio;if(R!==u){if(!E)return a();R?a(!1,R):o=setTimeout(()=>{a(!1,1e-7)},1e3)}R===1&&!sn(h,e.getBoundingClientRect())&&a(),E=!1}try{r=new IntersectionObserver(_,ge(Y({},k),{root:i.ownerDocument}))}catch(O){r=new IntersectionObserver(_,k)}r.observe(e)}return a(!0),n}function cn(e,t,r,o={}){let{ancestorScroll:i=!0,ancestorResize:n=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,h=Ut(e),m=i||n?[...h?je(h):[],...t?je(t):[]]:[];m.forEach(C=>{i&&C.addEventListener("scroll",r,{passive:!0}),n&&C.addEventListener("resize",r)});let d=h&&c?Ei(h,r):null,g=-1,b=null;a&&(b=new ResizeObserver(([C])=>{C&&C.target===h&&b&&t&&(b.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{b==null||b.observe(t)})),r()}),h&&!u&&b.observe(h),t&&b.observe(t));let v,S=u?be(e):null;u&&x();function x(){let C=be(e);S&&!sn(S,C)&&r(),S=C,v=requestAnimationFrame(x)}return r(),()=>{m.forEach(C=>{i&&C.removeEventListener("scroll",r),n&&C.removeEventListener("resize",r)}),d==null||d(),b==null||b.disconnect(),b=null,u&&cancelAnimationFrame(v)}}var un=ii;var mn=ai,dn=oi;var hn=(e,t,r)=>{let o=new Map,i=Y({platform:ki},r),n=ge(Y({},i.platform),{_c:o});return ti(e,t,ge(Y({},i),{platform:n}))};function te(e){let{open:t=!1,placement:r}=e,o=null,i=null,n=null,a=null,c=null,u=null,h=!1,m=f(t),d=()=>{h||!u||(h=!0,c=u.children.insert(e.content))},g=()=>{d(),n&&a&&(i&&i(),i=cn(n,a,()=>{hn(n,a,{placement:r.get(),middleware:[un(12),dn(),mn()],strategy:"fixed"}).then(({x:k,y:E,placement:_})=>{Object.assign(a.style,{left:`${k}px`,top:`${E}px`}),r.set(_)})}),m.set(!0))},b=()=>{i&&i(),i=null,m.set(!1)},v=()=>{o&&clearTimeout(o),o=setTimeout(g,100)},S=()=>{o&&clearTimeout(o),o=setTimeout(b,100)},x={style:{position:"fixed",pointerEvents:"auto",visibility:k=>m.get(k)?"visible":"hidden"},_onMount:k=>a=k.domElement,_portal:k=>{var _;let E=k.domElement.querySelector("#domphy-floating");if(!E){let O={div:[],id:"domphy-floating",style:{position:"fixed",inset:0,zIndex:20,pointerEvents:"none"}};E=k.children.insert(O).domElement}if(n&&E instanceof HTMLElement&&!E.hasAttribute("data-theme")){let O=(_=n.closest("[data-theme]"))==null?void 0:_.getAttribute("data-theme");O&&E.setAttribute("data-theme",O)}return E}};return D(e.content,x),{show:v,hide:S,anchorPartial:{onKeyDown:k=>k.key==="Escape"&&S(),_onMount:k=>{u=k.getRoot(),n=k.domElement;let E=_=>{if(!m.get()||!n||!a)return;let O=_.target;!n.contains(O)&&!a.contains(O)&&S()};k.getRoot().domElement.addEventListener("click",E),k.addHook("BeforeRemove",()=>{o&&clearTimeout(o),i&&(i(),i=null),c&&c.remove(),k.getRoot().domElement.removeEventListener("click",E)})}}}}var Ti='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6.707 5.293l5.293 5.292l5.293 -5.292a1 1 0 0 1 1.414 1.414l-5.292 5.293l5.292 5.293a1 1 0 0 1 -1.414 1.414l-5.293 -5.292l-5.293 5.292a1 1 0 1 1 -1.414 -1.414l5.292 -5.293l-5.292 -5.293a1 1 0 0 1 1.414 -1.414" /></svg>';function We(e={}){var o;let{removable:t=!1}=e,r=f((o=e.color)!=null?o:"neutral","color");return{dataTone:"shift-2",_onInit:i=>{let n={span:Ti,onClick:a=>{a.stopPropagation(),i.remove()},style:{display:"inline-flex",alignItems:"center",cursor:"pointer",borderRadius:s(1),width:s(4),height:s(4),flexShrink:0,"&:hover":{backgroundColor:a=>l(a,"shift-4",r.get(a))}}};t&&i.children.insert(n)},style:{display:"inline-flex",alignItems:"center",whiteSpace:"nowrap",userSelect:"none",height:s(6),paddingBlock:"0px",borderRadius:s(1),paddingInlineStart:s(2),paddingInlineEnd:t?s(1):s(2),gap:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",r.get(i)),color:i=>l(i,"shift-9",r.get(i)),border:"none",outlineOffset:"-1px",outline:i=>`1px solid ${l(i,"shift-4",r.get(i))}`}}}function _i(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&h()};D(e.content,d);let g={border:"none",outline:"none",padding:0,margin:0,flex:1,height:s(6),marginInlineStart:s(2),fontSize:x=>y(x,"inherit"),color:x=>l(x,"shift-9",o),backgroundColor:x=>l(x,"inherit",o)},b;e.input?(D(e.input,{onFocus:()=>u(),style:g,_key:"combobox-input"}),b=e.input):b={input:null,onFocus:()=>u(),value:x=>(a.get(x),""),style:g,_key:"combobox-input"};let v={div:x=>{let C=a.get(x),k=Array.isArray(C)?C:[C],_=t.filter(O=>k.includes(O.value)).map(O=>({span:O.label,$:[We({color:o,removable:!0})],_key:O.value,_onRemove:R=>{let z=a.get(),W=(Array.isArray(z)?z:[z]).filter(H=>H!==O.value);n?a.set(W):a.set(W[0])}}));return _.push(b),_},style:{display:"flex",flexWrap:"wrap",gap:s(1)}},S={_onInsert:x=>{x.tagName!=="div"&&console.warn('"combobox" primitive patch must use div tag')},_onInit:x=>x.children.insert(v),style:{minWidth:s(32),outlineOffset:"-1px",outline:x=>`1px solid ${l(x,"shift-4","neutral")}`,paddingBlock:x=>s(p(x)*1),paddingInline:x=>s(p(x)*1),borderRadius:x=>s(p(x)*1),fontSize:x=>y(x,"inherit"),color:x=>l(x,"shift-9",o),backgroundColor:x=>l(x,"inherit",o)}};return D(m,S),m}function Oi(){return{_onSchedule:(e,t)=>{D(t,{_context:{command:{query:f("")}}})},style:{display:"flex",flexDirection:"column",overflow:"hidden"}}}function Pi(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="input"&&console.warn('"commandSearch" patch must use input tag')},_onMount:o=>{let i=o.getContext("command");if(!i){console.warn('"commandSearch" patch must be used inside a "command"');return}let n=o.domElement,a=()=>i.query.set(n.value);n.addEventListener("input",a),o.addHook("Remove",()=>n.removeEventListener("input",a))},style:{fontFamily:"inherit",fontSize:o=>y(o,"inherit"),paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*2),border:"none",borderBottom:o=>`1px solid ${l(o,"shift-3",t)}`,outline:"none",color:o=>l(o,"shift-10",t),backgroundColor:o=>l(o,"inherit",t),"&::placeholder":{color:o=>l(o,"shift-7")},"&:focus-visible":{borderBottomColor:o=>l(o,"shift-6",r)}}}}function $i(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{role:"option",_onMount:o=>{var h,m;let i=o.getContext("command");if(!i){console.warn('"commandItem" patch must be used inside a "command"');return}let n=o.domElement,a=(m=(h=n.textContent)==null?void 0:h.toLowerCase())!=null?m:"",c=d=>{n.hidden=d.length>0&&!a.includes(d.toLowerCase())};c(i.query.get());let u=i.query.addListener(c);o.addHook("Remove",u)},style:{cursor:"pointer",display:"flex",alignItems:"center",width:"100%",fontSize:o=>y(o,"inherit"),height:o=>s(6+p(o)*2),paddingInline:o=>s(p(o)*3),border:"none",outline:"none",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),"&:hover:not([disabled])":{backgroundColor:o=>l(o,"shift-2",t)},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`,outlineOffset:`-${s(.5)}`}}}}var A=e=>new Date(e.getFullYear(),e.getMonth(),e.getDate()),Se=(e,t)=>new Date(e.getFullYear(),e.getMonth(),e.getDate()+t),qt=(e,t)=>new Date(e.getFullYear(),e.getMonth()+t,e.getDate()),Ke=(e,t)=>!!e&&!!t&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate(),Yt=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`,Gt=(e,t)=>Se(e,-((e.getDay()-t+7)%7));function Di(e){var t,r;try{let o=new Intl.Locale(e),i=(r=(t=o.getWeekInfo)==null?void 0:t.call(o))!=null?r:o.weekInfo;if(i!=null&&i.firstDay)return i.firstDay%7}catch(o){}return 0}function Li(e={}){var Zt,Qt,eo,to;let{mode:t="single",time:r=!1,min:o,max:i,disabledDate:n,locale:a=typeof navigator!="undefined"?navigator.language:"en-US",format:c,onChange:u}=e,h=(Zt=e.weekStartsOn)!=null?Zt:Di(a),m=f((Qt=e.accentColor)!=null?Qt:"primary","accentColor"),d=f((eo=e.placement)!=null?eo:"bottom-start"),g=f((to=e.value)!=null?to:t==="range"?[null,null]:null),b=u?g.addListener(w=>u(w)):null,v=(()=>{let w=g.get(),T=t==="range"?w==null?void 0:w[0]:w;return T instanceof Date?T:new Date})(),S=f(v.getFullYear(),"viewYear"),x=f(v.getMonth(),"viewMonth"),C=f(A(v),"focused"),k=f(null,"hovered"),E=f(v.getHours(),"hour"),_=f(v.getMinutes(),"minute"),O=null,R=new Intl.DateTimeFormat(a,Ce({dateStyle:"medium"},r?{timeStyle:"short"}:{})),z=new Intl.DateTimeFormat(a,{month:"long",year:"numeric"}),ie=new Intl.DateTimeFormat(a,{weekday:"short"}),W=new Intl.DateTimeFormat(a,{dateStyle:"full"}),H=w=>w?R.format(w):"",qe=w=>{if(c)return c(w);if(t==="range"){let[T,P]=w!=null?w:[null,null];return T?`${H(T)} \u2013 ${H(P)}`:""}return H(w)},pt=Array.from({length:7},(w,T)=>ie.format(new Date(2023,0,1+(T+h)%7))),xe=w=>!!o&&A(w)<A(o)||!!i&&A(w)>A(i)||!!n&&n(w),j=w=>{if(!r)return A(w);let T=A(w);return T.setHours(E.get(),_.get(),0,0),T},oe=w=>{var $;if(xe(w))return;if(t==="single"){g.set(j(w)),r||yt();return}let[T,P]=($=g.get())!=null?$:[null,null];!T||T&&P?g.set([j(w),null]):A(w)<A(T)?(g.set([j(w),j(T)]),r||yt()):(g.set([T,j(w)]),r||yt())},ne=()=>{var w;if(r)if(t==="single"){let T=g.get();T&&g.set(j(T))}else{let[T,P]=(w=g.get())!=null?w:[null,null];g.set([T&&j(T),P&&j(P)])}},Re=(w,T)=>{var we;if(t!=="range")return!1;let[P,$]=(we=g.get(T))!=null?we:[null,null],I=$!=null?$:k.get(T);if(!P||!I)return!1;let L=A(P)<=A(I)?P:I,K=A(P)<=A(I)?I:P,B=A(w);return B>=A(L)&&B<=A(K)},ue=(w,T)=>{let P=g.get(T);if(t==="range"){let[$,I]=P!=null?P:[null,null];return Ke(w,$)||Ke(w,I)}return Ke(w,P)},N=w=>{S.set(w.getFullYear()),x.set(w.getMonth())},U=w=>{let T=qt(new Date(S.get(),x.get(),1),w);N(T)},q=w=>S.set(S.get()+w),ze=()=>{setTimeout(()=>{var w;(w=O==null?void 0:O.querySelector(`[data-date="${Yt(C.get())}"]`))==null||w.focus()},0)},Cn=On(),{show:kn,hide:En,anchorPartial:gt}=te({open:!1,placement:d,content:Cn});function yt(){En()}gt.onClick=()=>{};let Tn={type:"text",readonly:!0,value:w=>qe(g.get(w)),ariaHaspopup:"dialog",ariaLabel:"Choose date",style:{cursor:"pointer"},onClick:()=>{bt()},onFocus:()=>{bt()},onKeyDown:w=>{let T=w.key;(T==="ArrowDown"||T==="Enter")&&(w.preventDefault(),bt())},_onMount:w=>b&&w.addHook("Remove",()=>{b()})};function bt(){var T;let w=(T=_n())!=null?T:new Date;C.set(A(w)),N(w),kn(),ze()}function _n(){var T;let w=g.get();return t==="range"?(T=w==null?void 0:w[0])!=null?T:null:w!=null?w:null}return D(gt,Tn),gt;function On(){let w=(L,K,B)=>({button:L,type:"button",ariaLabel:K,onClick:B,style:Ri()}),T={div:[w("\xAB","Previous year",()=>q(-1)),w("\u2039","Previous month",()=>U(-1)),{div:L=>z.format(new Date(S.get(L),x.get(L),1)),ariaLive:"polite",style:{flex:"1",textAlign:"center",fontWeight:"600",fontSize:L=>y(L)}},w("\u203A","Next month",()=>U(1)),w("\xBB","Next year",()=>q(1))],style:{display:"flex",alignItems:"center",gap:s(1),marginBottom:s(2)}},P={div:pt.map((L,K)=>({div:L,style:{textAlign:"center",fontSize:B=>y(B,"decrease-1"),fontWeight:"600",color:B=>l(B,"shift-7"),paddingBlock:s(1)},_key:K})),role:"row",style:fn()},$={div:L=>Pn(L),role:"grid",ariaLabel:"Calendar",onKeyDown:Rn,onMouseLeave:()=>t==="range"&&k.set(null),style:{display:"flex",flexDirection:"column",gap:s(.5)}},I=[T,P,$];return r&&I.push(Dn()),I.push(Ln()),{div:I,role:"dialog",ariaModal:"false",_onMount:L=>{O=L.domElement},style:{minWidth:s(70),padding:s(3),borderRadius:s(2),backgroundColor:L=>l(L,"base"),color:L=>l(L,"shift-10"),border:L=>`1px solid ${l(L,"shift-4")}`,boxShadow:"0 8px 24px rgba(0,0,0,0.18)"}}}function Pn(w){let T=new Date(S.get(w),x.get(w),1),P=x.get(w),$=Gt(T,h),I=[];for(let L=0;L<6;L++){let K=[];for(let B=0;B<7;B++){let we=Se($,L*7+B);K.push($n(we,P,w))}I.push({div:K,role:"row",style:fn(),_key:L})}return I}function $n(w,T,P){let $=xe(w),I=ue(w,P),L=Re(w,P),K=w.getMonth()!==T,B=Ke(w,C.get(P)),we=Ke(w,new Date);return{button:String(w.getDate()),type:"button",role:"gridcell",tabIndex:B?0:-1,ariaSelected:I,ariaDisabled:$,disabled:$,ariaLabel:W.format(w),dataDate:Yt(w),onClick:()=>oe(w),onMouseEnter:()=>t==="range"&&k.set(w),style:{appearance:"none",border:"none",cursor:$?"not-allowed":"pointer",aspectRatio:"1",borderRadius:s(1),fontSize:M=>y(M),fontFamily:"inherit",opacity:$?.35:K?.5:1,backgroundColor:M=>I?l(M,"shift-7",m.get(M)):L?l(M,"shift-2",m.get(M)):"transparent",color:M=>I?l(M,"shift-0",m.get(M)):l(M,"shift-9"),outline:we?M=>`1px solid ${l(M,"shift-6",m.get(M))}`:"none",outlineOffset:"-2px","&:hover:not([disabled])":{backgroundColor:M=>I?l(M,"shift-7",m.get(M)):l(M,"shift-3",m.get(M))},"&:focus-visible":{outline:M=>`2px solid ${l(M,"shift-6",m.get(M))}`}},_key:Yt(w)}}function Dn(){let w=(T,P,$)=>({select:Array.from({length:T},(I,L)=>({option:String(L).padStart(2,"0"),value:String(L),selected:K=>P.get(K)===L,_key:L})),ariaLabel:$,onChange:I=>{P.set(Number(I.target.value)),ne()},style:zi()});return{div:[w(24,E,"Hour"),{span:":",style:{fontWeight:"600"}},w(60,_,"Minute")],style:{display:"flex",alignItems:"center",justifyContent:"center",gap:s(1),marginTop:s(3)}}}function Ln(){let w=(T,P)=>({button:T,type:"button",onClick:P,style:{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:$=>y($,"decrease-1"),color:$=>l($,"shift-8",m.get($)),padding:s(1)}});return{div:[w("Today",()=>{let T=new Date;C.set(A(T)),N(T),ze()}),w("Clear",()=>{g.set(t==="range"?[null,null]:null),k.set(null)})],style:{display:"flex",justifyContent:"space-between",marginTop:s(2),paddingTop:s(2),borderTop:T=>`1px solid ${l(T,"shift-3")}`}}}function Rn(w){let T=w,P=C.get(),$=null;switch(T.key){case"ArrowLeft":$=Se(P,-1);break;case"ArrowRight":$=Se(P,1);break;case"ArrowUp":$=Se(P,-7);break;case"ArrowDown":$=Se(P,7);break;case"Home":$=Gt(P,h);break;case"End":$=Se(Gt(P,h),6);break;case"PageUp":$=qt(P,T.shiftKey?-12:-1);break;case"PageDown":$=qt(P,T.shiftKey?12:1);break;case"Enter":case" ":T.preventDefault(),oe(P);return;default:return}T.preventDefault(),C.set($),N($),ze()}}function fn(){return{display:"grid",gridTemplateColumns:"repeat(7, 1fr)",gap:s(.5)}}function Ri(){return{appearance:"none",border:"none",background:"transparent",cursor:"pointer",fontFamily:"inherit",fontSize:e=>y(e),color:e=>l(e,"shift-8"),width:s(7),height:s(7),borderRadius:s(1),"&:hover":{backgroundColor:e=>l(e,"shift-3")}}}function zi(){return{fontFamily:"inherit",fontSize:e=>y(e),padding:s(1),borderRadius:s(1),border:e=>`1px solid ${l(e,"shift-4")}`,backgroundColor:e=>l(e,"base"),color:e=>l(e,"shift-9")}}function Ii(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="dl"&&console.warn('"descriptionList" primitive patch must use dl tag')},style:{display:"grid",gridTemplateColumns:`minmax(${s(24)}, max-content) 1fr`,columnGap:s(4),margin:0,"& dt":{margin:0,fontWeight:600,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-10",t.get(o))},"& dd":{margin:0,fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}}function Mi(e={}){var i,n;let{duration:t=240}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{_onInsert:a=>{a.tagName!=="details"&&console.warn('"details" primitive patch must use details tag')},style:{fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),overflow:"hidden","& > summary":{backgroundColor:a=>l(a,"shift-2",r.get(a)),color:a=>l(a,"shift-10",r.get(a)),fontSize:a=>y(a,"inherit"),listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",gap:s(2),cursor:"pointer",userSelect:"none",fontWeight:500,paddingInline:a=>s(p(a)*4),height:s(10)},"& > summary::-webkit-details-marker":{display:"none"},"& > summary::marker":{content:'""'},"& > summary::after":{content:'""',width:s(2),height:s(2),flexShrink:0,marginTop:`-${s(.5)}`,borderInlineEnd:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,borderBottom:a=>`${s(.5)} solid ${l(a,"shift-9",r.get(a))}`,transform:"rotate(45deg)",transition:`transform ${t}ms ease`},"&[open] > summary::after":{transform:"rotate(-135deg)"},"& > summary:hover":{backgroundColor:a=>l(a,"shift-3",r.get(a))},"& > summary:focus-visible":{borderRadius:a=>s(p(a)*2),outlineOffset:`-${s(.5)}`,outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"& > :not(summary)":{maxHeight:"0px",opacity:0,overflow:"hidden",paddingInline:a=>s(p(a)*3),paddingTop:0,paddingBottom:0,transition:`max-height ${t}ms ease, opacity ${t}ms ease, padding ${t}ms ease`},"&[open] > :not(summary)":{maxHeight:s(250),opacity:1,paddingTop:a=>s(p(a)*1),paddingBottom:a=>s(p(a)*3)}}}}var pn='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), details, [tabindex]:not([tabindex="-1"])';function Ai(e={}){let{color:t="neutral",open:r=!1}=e,o=f(r),i=null,n=!1;return{_onInsert:a=>{a.tagName!=="dialog"&&console.warn('"dialog" primitive patch must use dialog tag')},onClick:(a,c)=>{if(a.target!==c.domElement)return;let u=c.domElement.getBoundingClientRect();a.clientX>=u.left&&a.clientX<=u.right&&a.clientY>=u.top&&a.clientY<=u.bottom||o.set(!1)},onTransitionEnd:(a,c)=>{if(!n)return;n=!1,c.domElement.close(),document.body.style.overflow="",i==null||i.focus(),i=null},_onMount:a=>{let c=a.domElement;c.setAttribute("aria-modal","true");let u=null,h=b=>{if(b.key!=="Tab")return;let v=Array.from(c.querySelectorAll(pn)).filter(C=>!C.closest("[aria-hidden='true']")&&C.offsetParent!==null);if(!v.length){b.preventDefault();return}let S=v[0],x=v[v.length-1];b.shiftKey?(document.activeElement===S||document.activeElement===c)&&(b.preventDefault(),x.focus()):document.activeElement===x&&(b.preventDefault(),S.focus())},m=b=>{b.preventDefault(),o.set(!1)};c.addEventListener("cancel",m);let d=b=>{b?(i=document.activeElement,c.showModal(),document.body.style.overflow="hidden",c.addEventListener("keydown",h),requestAnimationFrame(()=>{c.style.opacity="1";let v=c.querySelector(pn);v==null||v.focus()})):(n=!0,c.style.opacity="0",c.removeEventListener("keydown",h),u=setTimeout(()=>{u=null,n&&(n=!1,c.close(),document.body.style.overflow="",i==null||i.focus(),i=null)},350))};d(o.get());let g=o.addListener(d);a.addHook("Remove",()=>{u&&(clearTimeout(u),u=null),g(),c.removeEventListener("cancel",m),document.body.style.overflow="",c.removeEventListener("keydown",h),i==null||i.focus(),i=null})},style:{opacity:"0",transition:"opacity 200ms ease",fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-10",t),backgroundColor:a=>l(a,"inherit",t),border:"none",padding:a=>s(p(a)*3),boxShadow:a=>`0 ${s(9)} ${s(16)} ${l(a,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:a=>l(a,"shift-2","neutral"),opacity:.75}}}}function Vi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"separator",_onInsert:o=>{o.tagName!=="div"&&console.warn('"divider" patch should be used with <div>')},style:{display:"flex",justifyContent:"center",alignItems:"baseline",gap:s(2),fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),minHeight:"1lh","&::before":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"},"&::after":{content:'""',flex:1,borderColor:o=>l(o,"shift-4",t.get(o)),borderWidth:"1px",borderBottomStyle:"solid"}}}}var Xt={left:"translateX(-100%)",right:"translateX(100%)",top:"translateY(-100%)",bottom:"translateY(100%)"},gn={left:"0 auto 0 0",right:"0 0 0 auto",top:"0 0 auto 0",bottom:"auto 0 0 0"},Ue=e=>e==="left"||e==="right";function yn(e,t){return e==="start"?t?"right":"left":e==="end"?t?"left":"right":e}function Ni(e={}){let{color:t="neutral",open:r=!1,placement:o="end",size:i}=e,n=f(r),a=o==="start"||o==="end",c=yn(o,!1),u=Ue(c)?s(80):s(64),h=i!=null?i:u;return{_onInsert:m=>{m.tagName!=="dialog"&&console.warn('"drawer" patch must use dialog tag')},onClick:(m,d)=>{m.target===d.domElement&&n.set(!1)},_onMount:m=>{let d=m.domElement;d.setAttribute("aria-modal","true");let g=O=>{O.preventDefault(),n.set(!1)};d.addEventListener("cancel",g);let b=a&&(d.ownerDocument.documentElement.dir==="rtl"||d.ownerDocument.dir==="rtl"),v=yn(o,b);a&&(d.style.transform=Xt[v],d.style.margin=gn[v],d.style.width=Ue(v)?h:"100dvw",d.style.height=Ue(v)?"100dvh":h);let S=!1,x=null,C=()=>{x=null,S&&(S=!1,d.close(),document.body.style.overflow="")},k=O=>{O.target===d&&O.propertyName==="transform"&&C()};d.addEventListener("transitionend",k);let E=O=>{O?(S=!1,d.showModal(),document.body.style.overflow="hidden",requestAnimationFrame(()=>{d.style.transform="translate(0, 0)"})):(S=!0,d.style.transform=Xt[v],x=setTimeout(C,350))};E(n.get());let _=n.addListener(E);m.addHook("Remove",()=>{x&&(clearTimeout(x),x=null),_(),d.removeEventListener("cancel",g),d.removeEventListener("transitionend",k),document.body.style.overflow=""})},style:{transform:Xt[c],transition:"transform 0.25s ease",fontSize:m=>y(m,"inherit"),color:m=>l(m,"shift-10",t),backgroundColor:m=>l(m,"inherit",t),border:"none",padding:m=>s(p(m)*3),margin:gn[c],width:Ue(c)?h:"100dvw",height:Ue(c)?"100dvh":h,maxWidth:"100dvw",maxHeight:"100dvh",boxShadow:m=>`0 ${s(4)} ${s(12)} ${l(m,"shift-4","neutral")}`,"&::backdrop":{backgroundColor:m=>l(m,"shift-2","neutral"),opacity:.75}}}}function Bi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="em"&&console.warn('"emphasis" primitive patch must use em tag')},style:{fontSize:o=>y(o,"inherit"),fontStyle:"italic",color:o=>l(o,"shift-10",t.get(o))}}}function Hi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:s(3),paddingBlock:s(12),paddingInline:s(6),textAlign:"center",color:o=>l(o,"shift-6",t.get(o)),"& > :first-child":{color:o=>l(o,"shift-5",t.get(o))}}}}function ji(e={}){return{_onError:(t,r,o)=>{var n,a;(n=e.onError)==null||n.call(e,r);let i=typeof e.fallback=="function"?e.fallback(r,o):(a=e.fallback)!=null?a:{div:"An error occurred."};t.children.update([i])}}}var Fi={small:8,medium:10,large:14};function Wi(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=s(Fi[(i=e.size)!=null?i:"medium"]);return{_onInsert:n=>{n.tagName!=="button"&&console.warn('"fab" patch must use button tag')},style:{appearance:"none",border:"none",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",flexShrink:0,width:r,height:r,borderRadius:"50%",fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n,"shift-9",t.get(n)),color:n=>l(n,"shift-0",t.get(n)),boxShadow:n=>`0 ${s(1)} ${s(4)} ${l(n,"shift-4","neutral")}`,transition:"background-color 200ms ease, box-shadow 200ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-10",t.get(n)),boxShadow:n=>`0 ${s(2)} ${s(6)} ${l(n,"shift-5","neutral")}`},"&:focus-visible":{outline:n=>`2px solid ${l(n,"shift-6",t.get(n))}`,outlineOffset:"2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function Ki(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="figure"&&console.warn('"figure" primitive patch must use figure tag')},style:{display:"flex",flexDirection:"column",gap:s(2),marginInline:0,marginTop:s(3),marginBottom:s(3),color:o=>l(o,"shift-9",t.get(o)),"& img, & svg, & video, & canvas":{display:"block",maxWidth:"100%",borderRadius:s(2)},"& figcaption":{fontSize:o=>y(o,"decrease-1"),color:o=>l(o,"shift-8",t.get(o)),lineHeight:1.45}}}}function Ui(e={}){var i;let{layout:t="horizontal"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=t==="vertical";return{_onInsert:n=>{n.tagName!=="fieldset"&&console.warn('"formGroup" patch must use fieldset tag')},style:{margin:0,paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*3),border:"none",borderRadius:n=>s(p(n)*2),fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n,"inherit",r.get(n)),display:"grid",gridTemplateColumns:o?"minmax(0, 1fr)":"max-content minmax(0, 1fr)",columnGap:s(4),rowGap:s(3),alignItems:"start","& > legend":{gridColumn:"1 / -1",margin:0,fontSize:n=>y(n,"inherit"),fontWeight:600,paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*2),color:n=>l(n,"shift-9",r.get(n)),backgroundColor:n=>l(n,"inherit",r.get(n))},"& > label":{gridColumn:"1",alignSelf:"start",margin:0,paddingBlock:n=>o?"0px":s(p(n)*1)},"& > label:has(+ :not(legend, label, p) + p)":{gridRow:o?"auto":"span 2"},"& > :not(legend, label, p)":{gridColumn:o?"1":"2",minWidth:0,width:"100%",boxSizing:"border-box"},"& > p":{gridColumn:o?"1":"2",minWidth:0,margin:0,marginBlockStart:`calc(${s(2)} * -1)`,fontSize:n=>y(n,"decrease-1"),color:n=>l(n,"shift-9",r.get(n))}}}}var qi={h6:"decrease-1",h5:"inherit",h4:"increase-1",h3:"increase-2",h2:"increase-3",h1:"increase-4"};function Yi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{["h1","h2","h3","h4","h5","h6"].includes(o.tagName)||console.warn('"heading" primitive patch must use heading tags [h1...h6]')},style:{color:o=>l(o,"shift-11",t.get(o)),marginTop:0,marginBottom:s(2),fontSize:o=>{let i=qi[o.elementNode.tagName]||"inherit";return y(o,i)}}}}function Gi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="hr"&&console.warn('"horizontalRule" primitive patch must use hr tag')},style:{border:0,height:"1px",marginInline:0,marginTop:s(3),marginBottom:s(3),backgroundColor:o=>l(o,"shift-4",t.get(o))}}}function Xi(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="span"&&console.warn('"icon" primitive patch should use span tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",alignSelf:"center",justifySelf:"center",verticalAlign:"middle",width:s(4),height:s(4),flexShrink:"0",fontSize:o=>y(o),backgroundColor:"transparent",color:o=>l(o,"shift-9",t.get(o))}}}function Ji(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="img"&&console.warn('"image" primitive patch must use img tag')},style:{display:"block",width:"100%",maxWidth:"100%",height:"auto",objectFit:"cover",borderRadius:s(2),backgroundColor:o=>l(o,"inherit",t.get(o))}}}function Zi(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"checkbox",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputCheckbox" primitive patch must use input tag')},style:{appearance:"none",fontSize:n=>y(n,"inherit"),display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:s(1),lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:checked::after":{content:'""',display:"block",position:"absolute",top:"25%",insetInlineStart:"37%",width:"20%",height:"30%",border:n=>`${s(.5)} solid ${l(n,"inherit",r.get(n))}`,borderTop:0,borderInlineStart:0,transform:"rotate(45deg)"},"&:indeterminate::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`,backgroundColor:n=>l(n,"shift-3",r.get(n))},"&:indeterminate::after":{content:'""',position:"absolute",inset:"30%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:indeterminate:hover:not([disabled])::after":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:s(1.5),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function Qi(e={}){return{type:"color",_onSchedule:(t,r)=>{t.tagName!=="input"&&console.warn('"inputColor" primitive patch must use input tag'),r.type="color"},style:{appearance:"none",border:"none",cursor:"pointer",fontSize:t=>y(t,"inherit"),paddingBlock:t=>s(p(t)*1),paddingInline:t=>s(p(t)*1),blockSize:t=>s(6+p(t)*2),inlineSize:t=>s(6+p(t)*2),backgroundColor:"transparent","&::-webkit-color-swatch-wrapper":{margin:0,padding:0},"&::-webkit-color-swatch":{borderRadius:t=>s(p(t)*1)},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:t=>l(t,"shift-2","neutral"),outline:t=>`1px solid ${l(t,"shift-4","neutral")}`}}}}function ea(e={}){var i,n;let{mode:t="datetime-local"}=e,r=f((i=e.color)!=null?i:"neutral","color"),o=f((n=e.accentColor)!=null?n:"primary","accentColor");return{type:t,_onSchedule:(a,c)=>{a.tagName!=="input"&&console.warn('"inputDateTime" primitive patch must use input tag'),c.type=t},style:{fontFamily:"inherit",fontSize:a=>y(a,"inherit"),lineHeight:"inherit",color:a=>l(a,"shift-9",r.get(a)),backgroundColor:a=>l(a,"inherit",r.get(a)),border:"none",outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",r.get(a))}`,borderRadius:a=>s(p(a)*1),paddingInline:a=>s(p(a)*3),height:a=>s(6+p(a)*2),"&::-webkit-calendar-picker-indicator":{cursor:"pointer",opacity:.85},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",o.get(a))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),backgroundColor:a=>l(a,"shift-2","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-6","error")}`}}}}function ta(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"file",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputFile" primitive patch must use input tag'),a.type="file"},style:{display:"inline-flex",alignItems:"center",fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*1),"&::-webkit-file-upload-button":{marginTop:n=>s(p(n)),fontFamily:"inherit",fontSize:"inherit",border:"none",borderRadius:s(1),height:s(6),paddingInline:s(2),cursor:"pointer",color:n=>l(n,"shift-11",t.get(n)),backgroundColor:n=>l(n,"shift-1",t.get(n))},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.8,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,backgroundColor:n=>l(n,"shift-1","neutral")},"&[disabled]::-webkit-file-upload-button":{cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-3","neutral")}}}}function oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"number",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputNumber" primitive patch must use input tag'),a.type="number"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInlineStart:n=>s(p(n)*3),paddingInlineEnd:n=>s(p(n)*1.5),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button":{opacity:1},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")}}}}var bn='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0"/><path d="M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6"/></svg>',na='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" width="1em" height="1em"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M10.585 10.587a2 2 0 0 0 2.829 2.828"/><path d="M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87"/><path d="M3 3l18 18"/></svg>';function ra(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="div"&&console.warn('"inputPassword" patch must use div tag')},_onMount:n=>{let a=n.domElement,c=!1,u=document.createElement("input");u.type="password",u.style.cssText="flex:1;min-width:0;border:none;outline:none;background:transparent;padding:0;margin:0;font:inherit;color:inherit;";let h=document.createElement("button");h.type="button",h.setAttribute("aria-label","Show password"),h.style.cssText="background:none;border:none;padding:0;margin:0;cursor:pointer;color:inherit;display:flex;align-items:center;flex-shrink:0;opacity:0.6;",h.innerHTML=bn;let m=()=>{c=!c,u.type=c?"text":"password",h.innerHTML=c?na:bn,h.setAttribute("aria-label",c?"Hide password":"Show password")};h.addEventListener("click",m),a.appendChild(u),a.appendChild(h),n.addHook("Remove",()=>{h.removeEventListener("click",m)})},style:{display:"flex",alignItems:"center",gap:n=>s(p(n)*1),paddingBlock:n=>s(p(n)*1),paddingInline:n=>s(p(n)*3),borderRadius:n=>s(p(n)*1),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),fontSize:n=>y(n,"inherit"),"&:focus-within":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`}}}}function ia(){return{style:{display:"flex",alignItems:"center",gap:s(2),"& > *":{minWidth:`${s(9)}!important`}},_onMount:e=>{let t=e.domElement,r=()=>Array.from(t.querySelectorAll("input")),o=a=>{let c=r(),u=a.target,h=c.indexOf(u);u.value&&h<c.length-1&&c[h+1].focus()},i=a=>{let c=r(),u=a.target,h=c.indexOf(u);a.key==="Backspace"&&!u.value&&h>0&&c[h-1].focus(),a.key==="ArrowLeft"&&h>0&&c[h-1].focus(),a.key==="ArrowRight"&&h<c.length-1&&c[h+1].focus()},n=a=>{var g,b,v;a.preventDefault();let c=(b=(g=a.clipboardData)==null?void 0:g.getData("text"))!=null?b:"",u=r(),h=u.indexOf(a.target),m=h===-1?0:h;[...c].forEach((S,x)=>{u[m+x]&&(u[m+x].value=S)});let d=Math.min(m+c.length-1,u.length-1);(v=u[d])==null||v.focus()};t.addEventListener("input",o),t.addEventListener("keydown",i),t.addEventListener("paste",n),e.addHook("Remove",()=>{t.removeEventListener("input",o),t.removeEventListener("keydown",i),t.removeEventListener("paste",n)})}}}function aa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"radio",_onInsert:n=>{if(n.tagName!=="input"){console.warn('"inputRadio" primitive patch must use input tag and radio type');return}},style:{fontSize:n=>y(n,"inherit"),appearance:"none",display:"inline-flex",position:"relative",width:s(6),height:s(6),justifyContent:"center",alignItems:"center",transition:"background-color 300ms, outline-color 300ms",margin:0,padding:0,"&::before":{content:'""',display:"block",borderRadius:"50%",lineHeight:1,cursor:"pointer",border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),width:s(4),height:s(4)},"&:hover::before":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&:checked::before":{outline:n=>`1px solid ${l(n,"shift-6",r.get(n))}`},"&:checked::after":{content:'""',position:"absolute",inset:"30%",borderRadius:"50%",backgroundColor:n=>l(n,"shift-8",r.get(n))},"&:checked:hover:not([disabled])::before":{backgroundColor:n=>l(n,"shift-7",r.get(n))},"&:focus-visible":{borderRadius:"50%",outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{cursor:"not-allowed"},"&[disabled]::before, &[disabled]::after":{outline:"none",backgroundColor:n=>l(n,"shift-4","neutral"),pointerEvents:"none"}}}}function la(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"range",_onInsert:n=>{n.tagName!=="input"&&console.warn('"inputRange" primitive patch must use input tag')},style:{appearance:"none",width:"100%",margin:0,padding:0,height:s(4),background:"transparent",cursor:"pointer","&::-webkit-slider-runnable-track":{height:s(1.5),borderRadius:s(999),backgroundColor:n=>l(n,"shift-3",t.get(n))},"&::-webkit-slider-thumb":{appearance:"none",width:s(4),height:s(4),borderRadius:s(999),border:"none",marginTop:`calc((${s(1.5)} - ${s(4)}) / 2)`,backgroundColor:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])::-webkit-slider-thumb":{backgroundColor:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:s(1),borderRadius:s(2)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function sa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"search",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputSearch" primitive patch must use input tag'),a.type="search"},style:{fontFamily:"inherit",fontSize:n=>y(n,"inherit"),lineHeight:"inherit",color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,borderRadius:n=>s(p(n)*1),minWidth:s(32),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),"&::placeholder":{color:n=>l(n,"shift-7",t.get(n))},"&::-webkit-search-decoration":{display:"none"},"&::-webkit-search-cancel-button":{cursor:"pointer"},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral"),backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`}}}}function ca(e={}){var r;let t=f((r=e.accentColor)!=null?r:"primary","accentColor");return{role:"switch",dataTone:"shift-2",type:"checkbox",_onSchedule:o=>{if(o.tagName!=="input"){console.warn('"inputSwitch" primitive patch must use input tag');return}},style:{fontSize:o=>y(o,"inherit"),appearance:"none",position:"relative",display:"inline-flex",width:s(9),height:s(6),cursor:"pointer",margin:"0",paddingBlock:s(1),"&:checked":{"&::before":{backgroundColor:o=>l(o,"increase-3",t.get(o))},"&::after":{left:`calc(100% - ${s(3.5)})`}},"&::after":{content:'""',aspectRatio:"1/1",position:"absolute",width:s(3),height:s(3),borderRadius:s(999),left:s(.5),top:"50%",transform:"translateY(-50%)",transition:"left 0.3s",backgroundColor:o=>l(o,"decrease-3")},"&::before":{content:'""',width:"100%",borderRadius:s(999),display:"inline-block",fontSize:o=>y(o,"inherit"),lineHeight:1,backgroundColor:o=>l(o)},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function ua(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{type:"text",_onSchedule:(n,a)=>{n.tagName!=="input"&&console.warn('"inputText" primitive patch must use input tag and text type'),a.type="text"},style:{fontFamily:"inherit",lineHeight:"inherit",minWidth:s(10),paddingInline:n=>s(p(n)*3),paddingBlock:n=>s(p(n)*1),borderRadius:n=>s(p(n)*1),fontSize:n=>y(n,"inherit"),border:"none",outlineOffset:"-1px",outline:n=>`1px solid ${l(n,"shift-4",t.get(n))}`,color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),"&::placeholder":{color:n=>l(n,"shift-7")},"&:not(:placeholder-shown)":{color:n=>l(n,"shift-10")},"&:hover:not([disabled]):not([aria-busy=true]), &:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",backgroundColor:n=>l(n,"shift-2","neutral"),outline:n=>`1px solid ${l(n,"shift-4","neutral")}`,color:n=>l(n,"shift-8","neutral")},"&:invalid:not(:placeholder-shown)":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=error]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","error")}`},"&[data-status=warning]":{outline:n=>`${s(.5)} solid ${l(n,"shift-6","warning")}`}}}}function ma(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="kbd"&&console.warn('"keyboard" primitive patch must use kbd tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),paddingBlock:s(.5),paddingInline:s(1.5),borderRadius:s(1),outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`}}}function da(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="label"&&console.warn('"label" primitive patch must use label tag')},style:{display:"inline-flex",alignItems:"center",gap:s(2),fontSize:n=>y(n,"inherit"),color:n=>l(n,"shift-9",t.get(n)),cursor:"pointer","&:focus-within":{color:n=>l(n,"shift-10",r.get(n))},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function ha(e={}){var o,i;let t=f((o=e.color)!=null?o:"primary","color"),r=f((i=e.accentColor)!=null?i:"secondary","accentColor");return{_onInsert:n=>{n.tagName!=="a"&&console.warn('"link" primitive patch must use a tag')},style:{fontSize:n=>y(n,"inherit"),backgroundColor:n=>l(n),color:n=>l(n,"shift-9",t.get(n)),textDecoration:"none","&:visited":{color:n=>l(n,"shift-9",r.get(n))},"&:hover:not([disabled])":{color:n=>l(n,"shift-10",t.get(n)),textDecoration:"underline"},"&:focus-visible":{borderRadius:s(1),outlineOffset:s(1),outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:n=>l(n,"shift-8","neutral")}}}}function fa(e={}){var r;let t=f((r=e.color)!=null?r:"primary","color");return{_onInsert:o=>{o.tagName!=="a"&&console.warn('"linkButton" primitive patch must use a tag')},style:{fontSize:o=>y(o,"inherit"),textDecoration:"none",paddingBlock:o=>s(p(o)*1),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*1),width:"fit-content",display:"inline-flex",justifyContent:"center",alignItems:"center",gap:o=>s(p(o)*1),userSelect:"none",cursor:"pointer",outlineOffset:"-1px",outlineWidth:"1px",outline:o=>`1px solid ${l(o,"shift-4",t.get(o))}`,color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),"&:hover":{color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"shift-2",t.get(o))},"&:focus-visible":{boxShadow:o=>`inset 0 0 0 ${s(.5)} ${l(o,"shift-6",t.get(o))}`},"&[aria-disabled=true]":{opacity:.7,cursor:"not-allowed",pointerEvents:"none",backgroundColor:o=>l(o,"shift-2","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,color:o=>l(o,"shift-8","neutral")}}}}function pa(e={}){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function ga(e={}){let{dense:t=!1}=e;return{style:{display:"flex",alignItems:"center",gap:r=>s(p(r)*2),paddingBlock:r=>s(t?1:p(r)*2),paddingInline:r=>s(p(r)*3),fontSize:r=>y(r,"inherit")}}}function ya(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=(n=e.accentColor)!=null?n:"primary",{dense:o=!1}=e;return{cursor:"pointer",style:{appearance:"none",border:"none",background:"transparent",textDecoration:"none",textAlign:"left",display:"flex",alignItems:"center",width:"100%",gap:a=>s(p(a)*2),paddingBlock:a=>s(o?1:p(a)*2),paddingInline:a=>s(p(a)*3),fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),borderRadius:a=>s(p(a)*1),transition:"background-color 150ms ease","&:hover:not([disabled])":{backgroundColor:a=>l(a,"shift-2",t.get(a))},"&[aria-current=page], &[aria-selected=true]":{backgroundColor:a=>l(a,"shift-3",r),color:a=>l(a,"shift-12",r)},"&:focus-visible":{outline:a=>`2px solid ${l(a,"shift-6",r)}`,outlineOffset:"-2px"},"&[disabled]":{opacity:.5,cursor:"not-allowed"}}}}function ba(e={}){var r;let t=f((r=e.accentColor)!=null?r:"highlight","accentColor");return{_onInsert:o=>{o.tagName!=="mark"&&console.warn('"mark" primitive patch must use mark tag')},dataTone:"shift-2",style:{display:"inline-flex",alignItems:"center",fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),height:s(6),borderRadius:s(1),paddingInline:s(1.5)}}}function va(e={}){let{color:t="neutral",selectable:r=!0}=e;return{role:"menu",dataTone:"shift-17",_onSchedule:(i,n)=>{var c;let a={_context:{menu:{activeKey:f((c=e.activeKey)!=null?c:null),selectable:r}}};D(n,a)},style:{display:"flex",flexDirection:"column",paddingBlock:i=>s(p(i)*2),paddingInline:i=>s(p(i)*2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",t)}}}function Sa(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"menuitem",_onInsert:i=>{var u,h;i.tagName!=="button"&&console.warn('"menuItem" patch must use button tag');let n=i.getContext("menu");if(!n){console.warn('"menuItem" patch requires a parent with $: [menu()] \u2014 no menu context found');return}let a=(h=(u=i.parent)==null?void 0:u.children.items)!=null?h:[];a=a.filter(m=>m.type==="ElementNode"&&m.attributes.get("role")==="menuitem");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i);n.selectable&&(i.attributes.set("ariaCurrent",m=>n.activeKey.get(m)===c||void 0),i.addEvent("click",()=>n.activeKey.set(c)))},onKeyDown:(i,n)=>{var m,d,g,b;let a=i.key;if(a==="Enter"||a===" "){i.preventDefault(),(m=n.domElement)==null||m.click();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(a))return;i.preventDefault();let c=((g=(d=n.parent)==null?void 0:d.children.items)!=null?g:[]).filter(v=>v.type==="ElementNode"&&v.attributes.get("role")==="menuitem");if(!c.length)return;let u=c.indexOf(n),h=u;a==="ArrowDown"?h=(u+1)%c.length:a==="ArrowUp"?h=(u-1+c.length)%c.length:a==="Home"?h=0:a==="End"&&(h=c.length-1),(b=c[h].domElement)==null||b.focus()},style:{cursor:"pointer",display:"flex",alignItems:"center",gap:i=>s(2),width:"100%",fontSize:i=>y(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*3),border:"none",outline:"none",color:i=>l(i,"shift-9",r),backgroundColor:i=>l(i,"inherit",r),"&:hover:not([disabled]):not([aria-current=true])":{backgroundColor:i=>l(i,"shift-2",r)},"&[aria-current=true]":{backgroundColor:i=>l(i,"shift-3",t),color:i=>l(i,"shift-10")},"&:focus-visible":{outline:i=>`${s(.5)} solid ${l(i,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}var vn=e=>!!e&&typeof e.get=="function"&&e._isState===!0,Le=e=>{let t={},r=[];for(let o in e){let i=e[o];o==="x"?r.push(`translateX(${typeof i=="number"?`${i}px`:i})`):o==="y"?r.push(`translateY(${typeof i=="number"?`${i}px`:i})`):o==="scale"?r.push(`scale(${i})`):o==="rotate"?r.push(`rotate(${typeof i=="number"?`${i}deg`:i})`):t[o]=i}return r.length&&(t.transform=r.join(" ")),t};function xa(e={}){var a,c,u,h;let{initial:t,animate:r,exit:o,transition:i={}}=e,n={duration:(a=i.duration)!=null?a:300,delay:(c=i.delay)!=null?c:0,easing:(u=i.easing)!=null?u:"ease",iterations:(h=i.iterations)!=null?h:1,fill:"both"};return{_onMount:m=>{let d=m.domElement;if(!d||typeof d.animate!="function")return;let g=vn(r)?r.get():r;if(g?d.animate(t?[Le(t),Le(g)]:[Le(g)],n):t&&Object.assign(d.style,Le(t)),vn(r)){let b=r.addListener(v=>{d.animate([Le(v)],n)});m.setMetadata("motionRelease",b)}},_onBeforeRemove:(m,d)=>{let g=m.domElement;if(!g||!o||typeof g.animate!="function")return d();g.animate([Le(o)],n).finished.then(d,d)},_onRemove:m=>{let d=m.getMetadata("motionRelease");d==null||d()}}}function wa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ol"&&console.warn('"orderedList" primitive patch must use ol tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"decimal",listStylePosition:"outside"}}}function Ca(e,t){if(t<=7)return Array.from({length:t},(n,a)=>a+1);let r=[1];e>3&&r.push("...");let o=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let n=o;n<=i;n++)r.push(n);return e<t-2&&r.push("..."),r.push(t),r}function ka(e){var c;let{total:t,color:r="neutral",accentColor:o="primary"}=e,i=f((c=e.value)!=null?c:1),n={display:"inline-flex",alignItems:"center",justifyContent:"center",minWidth:u=>s(6+p(u)*2),height:u=>s(6+p(u)*2),paddingInline:u=>s(p(u)*2),borderRadius:u=>s(p(u)*1),border:"none",cursor:"pointer",fontSize:u=>y(u,"inherit"),backgroundColor:"transparent",color:u=>l(u,"shift-9",r),"&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-2",r)},"&[disabled]":{opacity:.4,cursor:"not-allowed"}},a=io(Ce({},n),{backgroundColor:u=>l(u,"shift-6",o),color:u=>l(u,"shift-11",o),fontWeight:"600",cursor:"default","&:hover:not([disabled])":{backgroundColor:u=>l(u,"shift-6",o)}});return{role:"navigation",ariaLabel:"Pagination",_onInsert:u=>{u.tagName!=="div"&&console.warn('"pagination" patch must use div tag')},_onInit:u=>{let h={div:m=>{let d=i.get(m),g=[];g.push({button:"\u2039",type:"button",ariaLabel:"Previous page",disabled:d<=1,onClick:()=>d>1&&i.set(d-1),style:n});for(let b of Ca(d,t))if(b==="...")g.push({span:"\u2026",ariaHidden:"true",style:{display:"inline-flex",alignItems:"center",paddingInline:v=>s(p(v)*2),color:v=>l(v,"shift-7",r)}});else{let v=b===d;g.push({button:String(b),type:"button",ariaLabel:`Page ${b}`,ariaCurrent:v?"page":void 0,disabled:v,onClick:()=>i.set(b),style:v?a:n})}return g.push({button:"\u203A",type:"button",ariaLabel:"Next page",disabled:d>=t,onClick:()=>d<t&&i.set(d+1),style:n}),g},style:{display:"flex",alignItems:"center",gap:s(1)}};u.children.insert(h)},style:{display:"inline-flex"}}}function Ea(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="p"&&console.warn('"paragraph" primitive patch must use p tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),lineHeight:1.5,marginTop:0,marginBottom:0}}}function Ta(e){var g;let{open:t=!1,placement:r="bottom",openOn:o="click"}=e,i=null,n=f(t),a=f(r),{show:c,hide:u,anchorPartial:h}=te({open:n,placement:a,content:e.content}),m={role:"dialog",dataTone:"shift-14",style:{backgroundColor:b=>l(b,"inherit")},onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),_onInsert:b=>{let v=b.attributes.get("id");i=v||b.nodeId,!v&&b.attributes.set("id",i)}};return(g=e.content).$||(g.$=[]),e.content.$.push(m),D(h,{ariaHaspopup:"dialog",ariaExpanded:b=>n.get(b),onMouseEnter:()=>o==="hover"&&c(),onMouseLeave:()=>o==="hover"&&u(),onClick:()=>{o==="click"&&(n.get()?u():c())},onKeyDown:b=>{b.key==="Escape"&&n.get()&&u()},onFocus:()=>o==="hover"&&c(),onBlur:(b,v)=>{let S=b.relatedTarget,x=v.getRoot().domElement,C=i?x.querySelector(`#${CSS.escape(i)}`):null;S&&(C!=null&&C.contains(S))||u()},_onMount:b=>i&&b.attributes.set("ariaControls",i)}),h}function Jt(e={}){let{placement:t="bottom-end",color:r="neutral",sideOffset:o=s(6),bordered:i=!0}=e,n=f(t),a={top:"bottom",bottom:"top",left:"right",right:"left","top-start":"bottom-end","top-end":"bottom-start","bottom-start":"top-end","bottom-end":"top-start","left-start":"right-end","left-end":"right-start","right-start":"left-end","right-end":"left-start"},c=m=>{var d;return(d=a[n.get(m)])!=null?d:a["bottom-end"]},u=m=>m.includes("start")?o:m.includes("end")?"auto":"50%",h=m=>m.includes("end")?o:m.includes("start")?"auto":"50%";return{style:{fontSize:m=>y(m),backgroundColor:m=>l(m),color:m=>l(m,"shift-9",r),position:"relative","&::after":{content:'""',position:"absolute",width:s(1.5),height:s(1.5),backgroundColor:m=>l(m,"inherit",r),borderWidth:i?"1px":"0px",borderColor:m=>l(m,"inherit",r),borderTopStyle:m=>{let d=c(m);return d.includes("top")||d.includes("right")?"solid":"none"},borderBottomStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("left")?"solid":"none"},borderLeftStyle:m=>{let d=c(m);return d.includes("top")||d.includes("left")?"solid":"none"},borderRightStyle:m=>{let d=c(m);return d.includes("bottom")||d.includes("right")?"solid":"none"},top:m=>{let d=c(m);return d.includes("top")?0:d.includes("bottom")?"auto":u(d)},right:m=>{let d=c(m);return d.includes("right")?0:d.includes("left")?"auto":h(d)},bottom:m=>{let d=c(m);return d.includes("bottom")?0:d.includes("top")?"auto":h(d)},left:m=>{let d=c(m);return d.includes("left")?0:d.includes("right")?"auto":u(d)},transform:m=>{let d=c(m),g=d.includes("right")||d.includes("end")&&!d.includes("left")?"50%":"-50%",b=d.includes("bottom")||d.includes("end")&&!d.includes("top")?"50%":"-50%";return`translate(${g},${b}) rotate(45deg)`}}}}}function _a(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataTone:"shift-2",_onInsert:o=>{o.tagName!=="pre"&&console.warn('"preformated" primitive patch must use pre tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),backgroundColor:o=>l(o,"inherit",t.get(o)),border:"none",paddingBlock:o=>s(p(o)*2),paddingInline:o=>s(p(o)*3),borderRadius:o=>s(p(o)*2)}}}function Oa(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{_onInsert:n=>{n.tagName!=="progress"&&console.warn('"progress" primitive patch must use progress tag')},style:{appearance:"none",width:"100%",height:s(2),border:0,borderRadius:s(999),overflow:"hidden",backgroundColor:n=>l(n,"shift-3",t.get(n)),"&::-webkit-progress-bar":{backgroundColor:n=>l(n,"shift-3",t.get(n)),borderRadius:s(999)},"&::-webkit-progress-value":{backgroundColor:n=>l(n,"shift-9",r.get(n)),borderRadius:s(999),transition:"width 220ms ease"}}}}var Pa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M12 17.27L18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"/></svg>',$a='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" width="1em" height="1em"><path d="M22 9.24l-7.19-.62L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21 12 17.27 18.18 21l-1.63-7.03L22 9.24zM12 15.4l-3.76 2.27 1-4.28-3.32-2.88 4.38-.38L12 6.1l1.71 4.04 4.38.38-3.32 2.88 1 4.28L12 15.4z"/></svg>';function Da(e={}){var a,c;let{max:t=5,readOnly:r=!1,onChange:o}=e,i=(a=e.color)!=null?a:"warning",n=f((c=e.value)!=null?c:0);return{role:"group",ariaLabel:"Rating",style:{display:"inline-flex",gap:s(.5),fontSize:"1.5rem",cursor:r?"default":"pointer",color:u=>l(u,"shift-8",i)},_onMount:u=>{let h=u.domElement,m=n.get(),d=0,g=()=>{let v=d>0?d:m;Array.from(h.children).forEach((S,x)=>{S.innerHTML=x<v?Pa:$a})};h.innerHTML="";for(let v=1;v<=t;v++){let S=document.createElement("button");if(S.type="button",S.setAttribute("aria-label",`${v} star${v>1?"s":""}`),S.style.cssText="background:none;border:none;padding:0;cursor:inherit;color:inherit;font-size:inherit;display:flex;align-items:center;",!r){let x=v;S.addEventListener("click",()=>{let C=x===m?0:x;m=C,n.set(C),o==null||o(C),d=0,g()}),S.addEventListener("mouseenter",()=>{d=x,g()}),S.addEventListener("mouseleave",()=>{d=0,g()}),S.addEventListener("keydown",C=>{var _;let k=m;if(C.key==="ArrowRight"||C.key==="ArrowUp")k=Math.min(t,m+1),C.preventDefault();else if(C.key==="ArrowLeft"||C.key==="ArrowDown")k=Math.max(0,m-1),C.preventDefault();else return;m=k,n.set(k),o==null||o(k),g();let E=k>0?k-1:0;(_=h.children[E])==null||_.focus()})}h.appendChild(S)}g();let b=n.addListener(v=>{m=v,d===0&&g()});u.addHook("Remove",b)}}}function La(e={}){var u,h,m;let{size:t=16,thickness:r=.25}=e,o=f((u=e.value)!=null?u:0,"value"),i=f((h=e.color)!=null?h:"primary","color"),n=f((m=e.trackColor)!=null?m:"neutral","trackColor"),a=Math.round((1-r)*100),c=`radial-gradient(circle closest-side, transparent ${a}%, black ${a}%)`;return{role:"progressbar",ariaValuenow:d=>String(Math.round(o.get(d))),ariaValuemin:"0",ariaValuemax:"100",_onInsert:d=>{d.tagName!=="div"&&console.warn('"ringProgress" patch must use div tag')},style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:s(t),height:s(t),borderRadius:"50%",background:d=>`conic-gradient(from -90deg, ${l(d,"shift-9",i.get(d))} ${o.get(d)}%, ${l(d,"shift-3",n.get(d))} 0%)`,WebkitMask:c,mask:c}}}function Ra(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{style:{overflow:"auto","&::-webkit-scrollbar":{width:s(2),height:s(2)},"&::-webkit-scrollbar-track":{background:"transparent"},"&::-webkit-scrollbar-thumb":{backgroundColor:o=>l(o,"shift-5",t.get(o)),borderRadius:s(999),border:`${s(.5)} solid transparent`,backgroundClip:"content-box"},"&::-webkit-scrollbar-thumb:hover":{backgroundColor:o=>l(o,"shift-7",t.get(o))},scrollbarWidth:"thin",scrollbarColor:o=>`${l(o,"shift-5",t.get(o))} transparent`}}}function za(e={}){var r;let{color:t="neutral"}=e;return{role:"radiogroup",_context:{segmented:{value:f((r=e.value)!=null?r:"")}},style:{display:"inline-flex",paddingBlock:s(1),paddingInline:s(1),gap:s(.5),borderRadius:s(10),backgroundColor:o=>l(o,"shift-2",t)}}}function Ia(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"radio",_onInsert:n=>{var m,d;n.tagName!=="button"&&console.warn('"segmentedItem" patch must use button tag');let a=n.getContext("segmented");if(!a){console.warn('"segmentedItem" patch must be used inside a "segmented"');return}let u=((d=(m=n.parent)==null?void 0:m.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="radio"),h=n.key!==null&&n.key!==void 0?String(n.key):String(u.indexOf(n));n.attributes.set("ariaChecked",g=>a.value.get(g)===h),n.addEvent("click",()=>a.value.set(h))},style:{cursor:"pointer",fontSize:n=>y(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(3),border:"none",borderRadius:s(10),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:"transparent",transition:"background-color 300ms ease","&:hover:not([disabled]):not([aria-checked=true])":{backgroundColor:n=>l(n,"shift-3",t.get(n))},"&[aria-checked=true]":{backgroundColor:n=>l(n,"shift-0",r.get(n)),color:n=>l(n,"shift-10",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function Ma(e={}){let{color:t="neutral",accentColor:r="primary"}=e;return{_onInsert:o=>{o.tagName!=="select"&&console.warn('"select" primitive patch must use select tag')},style:{appearance:"none",fontFamily:"inherit",fontSize:o=>y(o,"inherit"),lineHeight:"inherit",color:o=>l(o,"shift-9",t),backgroundColor:o=>l(o,"inherit",t),border:"none",outlineOffset:"-1px",outline:o=>`1px solid ${l(o,"shift-4",t)}`,borderRadius:o=>s(p(o)*1),paddingBlock:o=>s(p(o)*1),paddingLeft:o=>s(p(o)*3),paddingRight:o=>s(p(o)*5),backgroundImage:o=>{let i=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 6"><path d="M1 1l4 4 4-4" stroke="${Nt(o,"shift-7")}" stroke-width="1.5" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg>`;return`url("data:image/svg+xml,${encodeURIComponent(i)}")`},backgroundRepeat:"no-repeat",backgroundPosition:`right ${s(2)} center`,backgroundSize:`${s(2.5)} ${s(1.5)}`,"&:not([multiple])":{height:o=>s(6+p(o)*2)},"&:hover:not([disabled]):not([aria-busy=true])":{outline:o=>`${s(.5)} solid ${l(o,"shift-5",r)}`},"&:focus-visible":{outline:o=>`${s(.5)} solid ${l(o,"shift-6",r)}`},"& optgroup":{color:o=>l(o,"shift-11",t)},"& option[disabled]":{color:o=>l(o,"shift-7","neutral")},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:o=>l(o,"shift-8","neutral"),outline:o=>`1px solid ${l(o,"shift-4","neutral")}`,backgroundColor:o=>l(o,"shift-2","neutral")}}}}function Aa(e){let{options:t=[],placement:r="bottom",color:o="neutral",open:i=!1,multiple:n=!1}=e,a=f(e.value),c=f(i),{show:u,hide:h,anchorPartial:m}=te({open:c,placement:f(r),content:e.content}),d={onClick:()=>!n&&h()};D(e.content,d);let g={div:v=>{let S=a.get(v),x=Array.isArray(S)?S:[S];return t.filter(k=>x.includes(k.value)).map(k=>({span:k.label,$:[We({color:o,removable:n})],_key:k.value,_onRemove:E=>{let _=a.get(),R=(Array.isArray(_)?_:[_]).filter(z=>z!==k.value);n?a.set(R):a.set(R[0])}}))},style:{display:"flex",flexWrap:"wrap",gap:s(1),flex:1}},b={_onInsert:v=>{v.tagName!=="div"&&console.warn('"selectBox" patch must use div tag')},_onInit:v=>v.children.insert(g),onClick:()=>c.get()?h():u(),style:{cursor:"pointer",display:"flex",alignItems:"center",minHeight:v=>s(6+p(v)*2),minWidth:s(32),outlineOffset:"-1px",outline:v=>`1px solid ${l(v,"shift-4","neutral")}`,paddingInline:v=>s(p(v)*2),borderRadius:v=>s(p(v)*1),fontSize:v=>y(v,"inherit"),color:v=>l(v,"shift-9",o),backgroundColor:v=>l(v,"inherit",o)}};return D(m,b),m}function Va(e={}){let{accentColor:t="primary",color:r="neutral",value:o=null}=e;return{role:"option",_onInit:n=>{n.tagName!=="div"&&console.warn('"selectItem" patch must use div tag');let a=n.getContext("select");if(a){let c=a.value;n.attributes.set("ariaSelected",u=>{let h=c.get(u);return a.multiple?h.includes(o):h===o}),n.addEvent("click",()=>{let u=c.get();a.multiple?u.includes(o)?c.set(u.filter(h=>h!==o)):c.set(u.concat([o])):u!==o&&c.set(o)})}},style:{cursor:"pointer",display:"flex",alignItems:"center",fontSize:n=>y(n,"inherit"),height:n=>s(6+p(n)*2),paddingInline:n=>s(p(n)*3),border:"none",outline:"none",color:n=>l(n,"shift-9",r),backgroundColor:n=>l(n,"inherit",r),"&:hover:not([disabled]):not([aria-selected=true])":{backgroundColor:n=>l(n,"shift-2",r)},"&[aria-selected=true]":{backgroundColor:n=>l(n,"shift-6",t),color:n=>l(n,"shift-11")},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",t)}`,outlineOffset:`-${s(.5)}`}}}}function Na(e={}){var a;let{color:t="neutral",multiple:r=!1}=e,o=f((a=e.value)!=null?a:r?[]:null),i={div:c=>{let u=o.get(c);return(Array.isArray(u)?u:[u]).map(m=>({input:null,name:e.name,value:m==null?"":String(m)}))},hidden:!0};return{dataTone:"shift-17",_context:{select:{value:o,multiple:r}},_onInit:c=>{c.tagName!=="div"&&console.warn('"selectList" patch must use a div tag'),c.children.insert(i)},style:{display:"flex",flexDirection:"column",paddingBlock:c=>s(p(c)*2),paddingInline:c=>s(p(c)*2),fontSize:c=>y(c,"inherit"),backgroundColor:c=>l(c,"inherit",t)}}}function Ba(e={}){var i;let t=f((i=e.color)!=null?i:"neutral","color"),r={"0%,100%":{opacity:1},"50%":{opacity:.4}},o=_e(JSON.stringify(r));return{ariaHidden:"true",dataTone:"shift-2",style:{fontSize:n=>y(n),color:n=>l(n,"shift-9",t.get(n)),height:s(6),display:"block",borderRadius:s(1),backgroundColor:n=>l(n,"inherit",t.get(n)),animation:`${o} 1.5s ease-in-out infinite`,[`@keyframes ${o}`]:r}}}function Ha(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{dataSize:"decrease-1",style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o))}}}var xn={to:{transform:"rotate(360deg)"}},Sn=_e(JSON.stringify(xn));function ja(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{role:"status",ariaLabel:"loading",_onInsert:o=>{o.tagName!=="span"&&console.warn('"spinner" patch must use span tag')},style:{fontSize:o=>y(o),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),display:"inline-block",margin:0,flexShrink:0,width:s(6),height:s(6),borderRadius:"50%",border:o=>`${s(.5)} solid ${l(o,"shift-4",t.get(o))}`,borderTopColor:o=>l(o,"shift-9",t.get(o)),boxSizing:"border-box",padding:0,animation:`${Sn} 0.7s linear infinite`,[`@keyframes ${Sn}`]:xn}}}function Fa(e={}){let{direction:t="horizontal",defaultSize:r=50,min:o=10,max:i=90}=e;return{_onSchedule:(n,a)=>{D(a,{_context:{splitter:{direction:t,size:f(r),min:o,max:i}}})},style:{display:"flex",flexDirection:t==="horizontal"?"row":"column",overflow:"hidden"}}}function Wa(){return{_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterPanel" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal"?"width":"height";r.style[o]=`${t.size.get()}%`,r.style.flexShrink="0",r.style.overflow="auto";let i=t.size.addListener(n=>{r.style[o]=`${n}%`});e.addHook("Remove",i)}}}function Ka(){return{role:"separator",tabindex:0,_onMount:e=>{let t=e.getContext("splitter");if(!t){console.warn('"splitterHandle" patch must be used inside a "splitter"');return}let r=e.domElement,o=t.direction==="horizontal";r.style.cursor=o?"col-resize":"row-resize",r.setAttribute("aria-orientation",o?"vertical":"horizontal"),r.setAttribute("aria-valuemin",String(t.min)),r.setAttribute("aria-valuemax",String(t.max)),r.setAttribute("aria-valuenow",String(Math.round(t.size.get())));let i=t.size.addListener(u=>{r.setAttribute("aria-valuenow",String(Math.round(u)))}),n=u=>{let h=u.shiftKey?10:1,m=null;o?u.key==="ArrowRight"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowLeft"&&(m=Math.max(t.size.get()-h,t.min)):u.key==="ArrowDown"?m=Math.min(t.size.get()+h,t.max):u.key==="ArrowUp"&&(m=Math.max(t.size.get()-h,t.min)),u.key==="Home"?m=t.min:u.key==="End"&&(m=t.max),m!==null&&(u.preventDefault(),t.size.set(m))},a=null,c=u=>{u.preventDefault();let h=r.parentElement,m=g=>{let b=h.getBoundingClientRect(),v=o?(g.clientX-b.left)/b.width*100:(g.clientY-b.top)/b.height*100;t.size.set(Math.min(Math.max(v,t.min),t.max))},d=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null};a=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("mouseup",d),a=null},document.addEventListener("mousemove",m),document.addEventListener("mouseup",d)};r.addEventListener("keydown",n),r.addEventListener("mousedown",c),e.addHook("Remove",()=>{a==null||a(),i(),r.removeEventListener("keydown",n),r.removeEventListener("mousedown",c)})},style:{flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e=>l(e,"shift-2"),"&:hover":{backgroundColor:e=>l(e,"shift-3")},"&:focus-visible":{outline:e=>`2px solid ${l(e,"shift-6")}`,outlineOffset:"2px"},"&::after":{content:'""',width:s(1),height:s(1),borderRadius:s(999),backgroundColor:e=>l(e,"shift-4")}}}}function Ua(){let e="neutral",t="primary";return{_onInsert:r=>{var c,u;let o=r.getContext("steps");if(!o){console.warn('"stepItem" patch must be used inside a "steps"');return}e=o.color,t=o.accentColor;let a=((u=(c=r.parent)==null?void 0:c.children.items)!=null?u:[]).filter(h=>h.type==="ElementNode").indexOf(r);r.domElement&&(r.domElement.dataset.step=String(a+1)),r.attributes.set("dataStatus",h=>{let m=o.current.get(h);return a<m?"done":a===m?"active":"pending"}),r.attributes.set("ariaCurrent",h=>o.current.get(h)===a?"step":void 0)},style:{position:"relative",display:"flex",flexDirection:"column",alignItems:"center",gap:s(1),flex:"1",fontSize:r=>y(r,"decrease-1"),textAlign:"center","&::before":{content:"attr(data-step)",display:"flex",alignItems:"center",justifyContent:"center",width:s(6),height:s(6),borderRadius:s(999),fontSize:r=>y(r,"decrease-1"),fontWeight:"600",flexShrink:"0",border:r=>`2px solid ${l(r,"shift-4",e)}`,backgroundColor:r=>l(r,"inherit"),color:r=>l(r,"shift-8"),transition:"background-color 200ms ease, color 200ms ease, border-color 200ms ease",zIndex:"1"},"&:not(:first-child)::after":{content:'""',position:"absolute",top:s(3),right:`calc(50% + ${s(3)})`,left:`calc(-50% + ${s(3)})`,height:"2px",backgroundColor:r=>l(r,"shift-3",e),zIndex:"0"},"&[data-status=active]::before":{backgroundColor:r=>l(r,"shift-6",t),borderColor:r=>l(r,"shift-6",t),color:r=>l(r,"shift-15",t)},"&[data-status=done]::before":{content:'"\u2713"',backgroundColor:r=>l(r,"shift-3",e),borderColor:r=>l(r,"shift-3",e),color:r=>l(r,"shift-9",e)},"&[data-status=done]:not(:first-child)::after":{backgroundColor:r=>l(r,"shift-3",e)},"&[data-status=active]:not(:first-child)::after":{backgroundColor:r=>l(r,"shift-6",t)},"&[data-status=pending]":{color:r=>l(r,"shift-7")},"&[data-status=active]":{color:r=>l(r,"shift-10"),fontWeight:"600"},"&[data-status=done]":{color:r=>l(r,"shift-8")}}}}function qa(e={}){var n,a,c;let t=(n=e.direction)!=null?n:"horizontal",r=(a=e.color)!=null?a:"neutral",o=(c=e.accentColor)!=null?c:"primary";return{_onSchedule:(u,h)=>{var d;let m={_context:{steps:{current:f((d=e.current)!=null?d:0),direction:t,color:r,accentColor:o}}};D(h,m)},style:{display:"flex",flexDirection:t==="vertical"?"column":"row",alignItems:t==="vertical"?"flex-start":"center",gap:s(2),listStyle:"none",margin:"0",padding:"0"}}}function Ya(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="strong"&&console.warn('"strong" primitive patch must use strong tag')},style:{fontSize:o=>y(o,"inherit"),fontWeight:700,color:o=>l(o,"shift-11",t.get(o)),backgroundColor:o=>l(o)}}}function Ga(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sub"&&console.warn('"subscript" primitive patch must use sub tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"sub",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Xa(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="sup"&&console.warn('"superscript" primitive patch must use sup tag')},style:{fontSize:o=>y(o,"decrease-1"),verticalAlign:"super",lineHeight:0,color:o=>l(o,"shift-9",t.get(o))}}}function Ja(e={}){let{accentColor:t="primary",color:r="neutral"}=e;return{role:"tab",_onInsert:i=>{var h,m;i.tagName!=="button"&&console.warn('"tab" patch must use button tag');let n=i.getContext("tabs");if(!n){console.warn('"tab" patch must be used inside a "tabs"');return}let a=(m=(h=i.parent)==null?void 0:h.children.items)!=null?m:[];a=a.filter(d=>d.type==="ElementNode"&&d.attributes.get("role")==="tab");let c=i.key!==null&&i.key!==void 0?i.key:a.indexOf(i),u={id:`tab${i.parent.nodeId}${c}`,ariaControls:`tabpanel${i.parent.nodeId}${c}`,ariaSelected:d=>n.activeKey.get(d)===c,onClick:()=>n.activeKey.set(c),onKeyDown:d=>{var C,k,E,_;let g=d.key;if(!["ArrowLeft","ArrowRight","Home","End"].includes(g))return;d.preventDefault();let b=((k=(C=i.parent)==null?void 0:C.children.items)!=null?k:[]).filter(O=>O.type==="ElementNode"&&O.attributes.get("role")==="tab");if(!b.length)return;let v=b.indexOf(i),S=v;g==="ArrowRight"?S=(v+1)%b.length:g==="ArrowLeft"?S=(v-1+b.length)%b.length:g==="Home"?S=0:g==="End"&&(S=b.length-1);let x=b[S];n.activeKey.set((E=x.key)!=null?E:S),(_=x.domElement)==null||_.focus()}};i.merge(u)},style:{cursor:"pointer",fontSize:i=>y(i,"inherit"),height:i=>s(6+p(i)*2),paddingInline:i=>s(p(i)*4),border:"none",outline:"none",color:i=>l(i,"shift-9"),backgroundColor:i=>l(i,"inherit"),boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-1",r)}`,"&:hover:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-2",r)}`},"&[aria-selected=true]:not([disabled])":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`},"&:focus-visible":{boxShadow:i=>`inset 0 -${s(.5)} 0 0 ${l(i,"shift-6",t)}`}}}}function Za(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="table"&&console.warn('"table" primitive patch must use table tag')},style:{fontSize:o=>y(o,"inherit"),color:o=>l(o,"shift-9",t.get(o)),width:"100%",borderCollapse:"collapse","& caption":{captionSide:"bottom"},"& th, & thead td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit")},"& td":{textAlign:"left",paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-9",t.get(o)),boxShadow:o=>`inset 0 1px 0 ${l(o,"shift-3",t.get(o))}`,fontSize:o=>y(o,"inherit")},"& tfoot th, & tfoot td":{textAlign:"left",fontWeight:500,paddingInline:o=>s(p(o)*3),paddingBlock:o=>s(p(o)*1),color:o=>l(o,"shift-10",t.get(o)),backgroundColor:o=>l(o,"inherit"),boxShadow:o=>`inset 0 -1px 0 ${l(o,"shift-4",t.get(o))}`},"& tr":{backgroundColor:o=>l(o,"inherit")},"& tbody tr:hover":{backgroundColor:o=>`${l(o,"shift-2")}!important`}}}}function Qa(){return{role:"tabpanel",style:{paddingBlock:t=>s(p(t)*2),paddingInline:t=>s(p(t)*2)},_onInsert:t=>{var a,c;let r=t.getContext("tabs");if(!r){console.warn('"tabPanel" patch must be used inside a "tabs"');return}let o=(c=(a=t.parent)==null?void 0:a.children.items)!=null?c:[];o=o.filter(u=>u.type==="ElementNode"&&u.attributes.get("role")==="tabpanel");let i=t.key!==null&&t.key!==void 0?t.key:o.indexOf(t),n={id:`tabpanel${t.parent.nodeId}${i}`,ariaLabelledby:`tab${t.parent.nodeId}${i}`,hidden:u=>r.activeKey.get(u)!==i};t.merge(n)}}}function el(e={}){return{role:"tablist",ariaOrientation:"horizontal",_onSchedule:(r,o)=>{var n;let i={_context:{tabs:{activeKey:f((n=e.activeKey)!=null?n:0)}}};D(o,i)}}}function tl(e={}){var i,n;let t=f((i=e.color)!=null?i:"neutral","color"),r=f((n=e.accentColor)!=null?n:"primary","accentColor"),{autoResize:o=!1}=e;return{_onInsert:a=>{a.tagName!=="textarea"&&console.warn('"textarea" primitive patch must use textarea tag')},_onMount:a=>{if(o){let c=a.domElement;c.style.overflow="hidden";let u=()=>{c.style.height="auto",c.style.height=`${c.scrollHeight}px`};c.addEventListener("input",u),u(),a.addHook("Remove",()=>c.removeEventListener("input",u))}},style:{fontFamily:"inherit",lineHeight:"inherit",resize:"vertical",paddingInline:a=>s(p(a)*2),paddingBlock:a=>s(p(a)*1.5),border:"none",borderRadius:a=>s(p(a)*1.5),fontSize:a=>y(a,"inherit"),color:a=>l(a,"shift-9",t.get(a)),outlineOffset:"-1px",outline:a=>`1px solid ${l(a,"shift-4",t.get(a))}`,backgroundColor:a=>l(a,"inherit",t.get(a)),"&::placeholder":{color:a=>l(a,"shift-7")},"&:hover:not([disabled]):not([aria-busy=true])":{outline:a=>`${s(.5)} solid ${l(a,"shift-5",r.get(a))}`},"&:focus-visible":{outline:a=>`${s(.5)} solid ${l(a,"shift-6",r.get(a))}`},"&:invalid":{outline:a=>`${s(.5)} solid ${l(a,"shift-5","error")}`},"&[disabled]":{opacity:.7,cursor:"not-allowed",color:a=>l(a,"shift-8","neutral"),outline:a=>`1px solid ${l(a,"shift-4","neutral")}`,backgroundColor:a=>l(a,"shift-2","neutral")}}}}function ol(){return{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column"}}}function nl(e={}){var n,a,c;let{last:t=!1}=e,r=(n=e.color)!=null?n:"neutral",o=(a=e.accentColor)!=null?a:"primary",i=f((c=e.active)!=null?c:!1);return{style:Ce({display:"grid",gridTemplateColumns:"2rem 1fr",columnGap:u=>s(p(u)*2),paddingBottom:u=>t?"0":s(p(u)*4),position:"relative","&::before":{content:'""',display:"block",width:"0.75rem",height:"0.75rem",borderRadius:"50%",justifySelf:"center",marginTop:"0.25em",transition:"background-color 200ms ease, opacity 200ms ease",backgroundColor:u=>l(u,"shift-8",i.get(u)?o:r),opacity:u=>i.get(u)?"1":"0.4"}},t?{}:{"&::after":{content:'""',position:"absolute",left:"calc(1rem - 1px)",top:"1.25rem",bottom:u=>`-${s(p(u)*4)}`,width:"2px",backgroundColor:u=>l(u,"shift-3",r)}})}}function rl(e={}){let{position:t="top-center",color:r="neutral"}=e,o=f(!1),i=t.startsWith("top"),n=t.endsWith("center"),a=t.endsWith("right"),c={div:[],id:`domphy-toast-${t}`,style:{position:"fixed",display:"flex",flexDirection:i?"column":"column-reverse",alignItems:n?"center":a?"end":"start",inset:0,gap:s(4),zIndex:30,padding:s(6),pointerEvents:"none"}};return{_portal:u=>{let h=u.domElement.querySelector(`#domphy-toast-${t}`);return h||(h=u.children.insert(c).domElement),h},role:"status",ariaAtomic:"true",dataTone:"shift-17",style:{minWidth:s(32),pointerEvents:"auto",paddingBlock:u=>s(p(u)*2),paddingInline:u=>s(p(u)*4),borderRadius:u=>s(p(u)*2),fontSize:u=>y(u,"inherit"),color:u=>l(u,"shift-9",r),backgroundColor:u=>l(u,"inherit",r),boxShadow:u=>`0 ${s(2)} ${s(9)} ${l(u,"shift-4","neutral")}`,opacity:u=>Number(o.get(u)),transform:u=>o.get(u)?"translateY(0)":i?"translateY(-100%)":"translateY(100%)",transition:"opacity 300ms ease, transform 300ms ease"},_onMount:()=>requestAnimationFrame(()=>o.set(!0)),_onBeforeRemove:(u,h)=>{let m=!1,d=null,g=()=>{m||(m=!0,d&&(clearTimeout(d),d=null),u.domElement.removeEventListener("transitionend",b),h())},b=v=>{v.propertyName==="transform"&&g()};u.domElement.addEventListener("transitionend",b),d=setTimeout(g,350),u.addHook("Remove",()=>{var v;d&&(clearTimeout(d),d=null),(v=u.domElement)==null||v.removeEventListener("transitionend",b)}),o.set(!1)}}}function il(e={}){var o,i;let t=f((o=e.color)!=null?o:"neutral","color"),r=f((i=e.accentColor)!=null?i:"primary","accentColor");return{role:"button",_onInsert:n=>{var m,d;n.tagName!=="button"&&console.warn('"toggle" patch must use button tag');let a=n.getContext("toggleGroup");if(!a){console.warn('"toggle" patch must be used inside a "toggleGroup"');return}let u=((d=(m=n.parent)==null?void 0:m.children.items)!=null?d:[]).filter(g=>g.type==="ElementNode"&&g.attributes.get("role")==="button"),h=n.key!==null&&n.key!==void 0?String(n.key):String(u.indexOf(n));n.attributes.set("ariaPressed",g=>{let b=a.value.get(g);return Array.isArray(b)?b.includes(h):b===h}),n.addEvent("click",()=>{let g=a.value.get();if(a.multiple){let b=Array.isArray(g)?[...g]:[];a.value.set(b.includes(h)?b.filter(v=>v!==h):[...b,h])}else a.value.set(g===h?"":h)})},style:{cursor:"pointer",fontSize:n=>y(n,"inherit"),height:s(6),paddingBlock:s(1),paddingInline:s(2),border:"none",borderRadius:s(1),color:n=>l(n,"shift-9",t.get(n)),backgroundColor:n=>l(n,"inherit",t.get(n)),transition:"background-color 300ms ease","&:hover:not([disabled])":{backgroundColor:n=>l(n,"shift-2",t.get(n))},"&[aria-pressed=true]":{backgroundColor:n=>l(n,"shift-3",r.get(n)),color:n=>l(n,"shift-12",r.get(n))},"&:focus-visible":{outline:n=>`${s(.5)} solid ${l(n,"shift-6",r.get(n))}`,outlineOffset:`-${s(.5)}`},"&[disabled]":{opacity:.7,cursor:"not-allowed"}}}}function al(e={}){var o;let{multiple:t=!1,color:r="neutral"}=e;return{role:"group",_context:{toggleGroup:{value:f((o=e.value)!=null?o:t?[]:""),multiple:t}},style:{display:"flex",paddingBlock:s(1),paddingInline:s(1),gap:s(1),borderRadius:s(2),fontSize:i=>y(i,"inherit"),backgroundColor:i=>l(i,"inherit",r),outline:i=>`1px solid ${l(i,"shift-3",r)}`,outlineOffset:"-1px"}}}function ll(e={}){var r;let t=(r=e.gap)!=null?r:4;return{style:{display:"flex",alignItems:"center",gap:o=>s(p(o)*t)}}}function sl(){return{div:null,style:{flex:"1 1 0"}}}function cl(e={}){let{open:t=!1,placement:r="top",content:o="Tooltip Content"}=e,i=f(r),n=f(o),a=`domphy-tt-${Math.random().toString(36).slice(2,9)}`,c={span:b=>n.get(b),id:a},{show:u,hide:h,anchorPartial:m}=te({open:t,placement:i,content:c}),d={role:"tooltip",dataSize:"decrease-1",dataTone:"shift-17",style:{paddingBlock:b=>s(p(b)*1),paddingInline:b=>s(p(b)*3),borderRadius:b=>s(p(b)*1),color:b=>l(b,"shift-9"),backgroundColor:b=>l(b),fontSize:b=>y(b,"inherit")},$:[Jt({placement:i,bordered:!1})]};return c.$||(c.$=[]),c.$.push(d),D(m,{ariaDescribedby:a,onMouseEnter:()=>u(),onMouseLeave:()=>h(),onFocus:()=>u(),onBlur:()=>h(),onKeyDown:b=>b.key==="Escape"&&h()}),m}function wn(e,t){return e.key!==void 0&&e.key!==null?String(e.key):`index-${t}`}function ul(e={}){let{duration:t=300,delay:r=0}=e,o=new Map,i=new Map,n=new Set,a=new Set;return{_onMount:c=>{c.addHook("Remove",()=>{for(let u of Array.from(i.values()))u();i.clear();for(let u of n)clearTimeout(u);n.clear();for(let u of a)cancelAnimationFrame(u);a.clear()})},_onBeforeUpdate:c=>{o=new Map,c.children.items.forEach((u,h)=>{if(!(u instanceof V))return;let m=u.domElement;m&&o.set(wn(u,h),m.getBoundingClientRect())})},_onUpdate:c=>{c.children.items.forEach((u,h)=>{var O;if(!(u instanceof V))return;let m=u.domElement;if(!m)return;let d=wn(u,h),g=o.get(d);if(!g)return;let b=m.getBoundingClientRect(),v=g.left-b.left,S=g.top-b.top;if(Math.abs(v)<.5&&Math.abs(S)<.5)return;(O=i.get(m))==null||O(),m.style.transition="none",m.style.transform=`translate(${v}px, ${S}px)`,m.getBoundingClientRect();let x=requestAnimationFrame(()=>{a.delete(x),m.style.transition=`transform ${t}ms ease ${r}ms`,m.style.transform="translate(0px, 0px)"});a.add(x);let C=!1,k=null,E=()=>{C||(C=!0,k&&(n.delete(k),k=null),i.delete(m),m.removeEventListener("transitionend",_),m.style.transition="",m.style.transform="")},_=R=>{R.propertyName==="transform"&&E()};i.set(m,()=>{C=!0,k&&(clearTimeout(k),n.delete(k),k=null),i.delete(m),m.removeEventListener("transitionend",_)}),m.addEventListener("transitionend",_),k=setTimeout(E,t+r+34),n.add(k)}),o.clear()}}}function ml(e={}){var r;let t=f((r=e.color)!=null?r:"neutral","color");return{_onInsert:o=>{o.tagName!=="ul"&&console.warn('"unorderedList" primitive patch must use ul tag')},style:{fontSize:o=>y(o,"inherit"),backgroundColor:o=>l(o),color:o=>l(o,"shift-9",t.get(o)),marginTop:0,marginBottom:0,paddingLeft:s(3),listStyleType:"disc",listStylePosition:"outside"}}}return Bn(dl);})();
6
6
  //# sourceMappingURL=core-theme-ui.global.js.map