domma-js 0.52.3 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/types/index.d.ts +5 -0
- package/assets/types/smooth-caret.d.ts +12 -0
- package/package.json +2 -2
- package/public/dist/bundles/domma-complete.css +14 -14
- package/public/dist/bundles/domma-data-focused.css +14 -14
- package/public/dist/bundles/domma-essentials.css +14 -14
- package/public/dist/bundles/domma-full.css +14 -14
- package/public/dist/bundles/domma-minimal.css +8 -8
- package/public/dist/domma-flags.esm.js +3 -3
- package/public/dist/domma-flags.min.js +3 -3
- package/public/dist/domma-syntax.min.js +3 -3
- package/public/dist/domma.css +3 -3
- package/public/dist/domma.esm.js +5 -5
- package/public/dist/domma.min.js +5 -5
- package/public/dist/elements.css +3 -3
- package/public/dist/grid.css +3 -3
- package/public/dist/syntax.css +3 -3
- package/public/dist/themes/domma-themes.css +3 -3
package/public/dist/domma.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Domma v0.
|
|
2
|
+
* Domma v0.53.0
|
|
3
3
|
* Dynamic Object Manipulation & Modeling API
|
|
4
4
|
* (c) 2026 Darryl Waterhouse & DCBW-IT
|
|
5
|
-
* Built: 2026-10-
|
|
6
|
-
* Commit:
|
|
5
|
+
* Built: 2026-10-15T22:10:46.255Z
|
|
6
|
+
* Commit: e15cc27
|
|
7
7
|
*/
|
|
8
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Domma={})}(this,function(e){"use strict";function t(e){if(null==e)return"";const t=document.createElement("div");return t.textContent=String(e),t.innerHTML}function n(){return"undefined"!=typeof window&&void 0!==window.DOMPurify}const s={ALLOWED_TAGS:["b","i","em","strong","u","s","mark","small","del","ins","sub","sup","p","br","hr","div","span","blockquote","pre","code","ul","ol","li","dl","dt","dd","h1","h2","h3","h4","h5","h6","a","table","thead","tbody","tfoot","tr","th","td","caption","col","colgroup","img","figure","figcaption","article","section","nav","aside","header","footer","main","time","address"],ALLOWED_ATTR:["href","title","target","rel","class","id","alt","src","width","height","colspan","rowspan","aria-label","aria-describedby","aria-hidden","role"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,FORCE_BODY:!0},o={default:s,strict:{ALLOWED_TAGS:["b","i","em","strong","p","br","a","ul","ol","li"],ALLOWED_ATTR:["href","title","target"],ALLOW_DATA_ATTR:!1},basic:{ALLOWED_TAGS:["b","i","em","strong","br"],ALLOWED_ATTR:[],ALLOW_DATA_ATTR:!1}};function i(e,i={}){if(null==e||""===e)return"";if(e=String(e),n()){const n=i.preset||"default",r={...o[n]||s,...i.allowedTags&&{ALLOWED_TAGS:i.allowedTags},...i.allowedAttrs&&{ALLOWED_ATTR:i.allowedAttrs},...void 0!==i.allowDataAttrs&&{ALLOW_DATA_ATTR:i.allowDataAttrs}};try{return window.DOMPurify.sanitize(e,r)}catch(n){return console.error("DOMPurify sanitisation failed:",n),t(e)}}return console.warn("DOMPurify not available. Using HTML escape fallback. For better XSS protection, include DOMPurify."),t(e)}"undefined"==typeof window||n()||console.warn("%c⚠️ Security Warning: DOMPurify not loaded","color: orange; font-weight: bold; font-size: 14px;","\nFor robust XSS protection, include DOMPurify before Domma:",'\n<script src="https://cdn.jsdelivr.net/npm/dompurify@3/dist/purify.min.js"><\/script>',"\nCurrently using HTML escape fallback.");var r={sanitise:i,sanitiseBasic:function(e){return i(e,{preset:"basic"})},sanitiseUserContent:function(e){return i(e,{preset:"strict"})},escape:function(e){return t(e)},hasDOMPurify:function(){return n()}};class a{constructor(e,t){if("string"==typeof e)if(e.trim().startsWith("<")){const t=document.createElement("div");t.innerHTML=e.trim(),this.elements=Array.from(t.children)}else{const n=t||document;this.elements=Array.from(n.querySelectorAll(e))}else e instanceof Node?this.elements=[e]:e instanceof NodeList||e instanceof HTMLCollection?this.elements=Array.from(e):Array.isArray(e)?this.elements=e.filter(e=>e instanceof HTMLElement):this.elements=e instanceof a?[...e.elements]:[];this.length=this.elements.length;for(let e=0;e<this.elements.length;e++)this[e]=this.elements[e]}find(e){const t=[];return this.elements.forEach(n=>{t.push(...n.querySelectorAll(e))}),new a(t)}children(e){const t=[];return this.elements.forEach(e=>{t.push(...e.children)}),new a(e?t.filter(t=>t.matches(e)):t)}parent(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&(e&&!n.parentElement.matches(e)||t.includes(n.parentElement)||t.push(n.parentElement))}),new a(t)}parents(e){const t=[];return this.elements.forEach(n=>{let s=n.parentElement;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.parentElement}),new a(t)}closest(e){const t=[];return this.elements.forEach(n=>{const s=n.closest(e);s&&!t.includes(s)&&t.push(s)}),new a(t)}siblings(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&Array.from(n.parentElement.children).forEach(s=>{s===n||t.includes(s)||e&&!s.matches(e)||t.push(s)})}),new a(t)}next(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new a(t)}nextAll(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.nextElementSibling}),new a(t)}prev(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new a(t)}prevAll(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.unshift(s),s=s.previousElementSibling}),new a(t)}first(){return new a(this.elements[0]?[this.elements[0]]:[])}last(){return new a(this.elements.length?[this.elements[this.elements.length-1]]:[])}eq(e){const t=e<0?this.elements.length+e:e;return new a(this.elements[t]?[this.elements[t]]:[])}get(e){if(void 0===e)return this.elements;const t=e<0?this.elements.length+e:e;return this.elements[t]}filter(e){return new a("function"==typeof e?this.elements.filter((t,n)=>e.call(t,n,t)):this.elements.filter(t=>t.matches(e)))}not(e){return new a("function"==typeof e?this.elements.filter((t,n)=>!e.call(t,n,t)):this.elements.filter(t=>!t.matches(e)))}is(e){return this.elements.some(t=>t.matches(e))}has(e){return new a(this.elements.filter(t=>t.querySelector(e)))}add(e){const t=new a(e),n=[...this.elements];return t.elements.forEach(e=>{n.includes(e)||n.push(e)}),new a(n)}contents(){const e=[];return this.elements.forEach(t=>{e.push(...t.childNodes)}),new a(e)}toArray(){return[...this.elements]}index(e){if(void 0===e){const e=this.elements[0];return e&&e.parentElement?Array.from(e.parentElement.children).indexOf(e):-1}return"string"==typeof e?new a(e).elements.indexOf(this.elements[0]):this.elements.indexOf(e)}each(e){return this.elements.forEach((t,n)=>e.call(t,n,t)),this}html(e,t={}){if(void 0===e){const e=this.elements[0];return e?e.innerHTML:""}return!1!==t.safe&&(e=r.sanitise(e,t)),this.each((t,n)=>{n.innerHTML=e})}text(e){return void 0===e?this.elements.map(e=>e.textContent).join(""):this.each((t,n)=>{n.textContent=e})}val(e){if(void 0===e){const e=this.elements[0];if(!e)return;return"checkbox"===e.type||"radio"===e.type?e.checked?e.value:void 0:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}return this.each((t,n)=>{"checkbox"===n.type||"radio"===n.type?n.checked=Array.isArray(e)?e.includes(n.value):n.value===e:"SELECT"===n.tagName&&n.multiple&&Array.isArray(e)?Array.from(n.options).forEach(t=>{t.selected=e.includes(t.value)}):n.value=e})}attr(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.setAttribute(e,t)})}):void 0===t?this.elements[0]?this.elements[0].getAttribute(e):void 0:this.each((n,s)=>{s.setAttribute(e,t)})}removeAttr(e){const t=e.split(/\s+/);return this.each((e,n)=>{t.forEach(e=>n.removeAttribute(e))})}prop(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n[e]=t})}):void 0===t?this.elements[0]?this.elements[0][e]:void 0:this.each((n,s)=>{s[e]=t})}removeProp(e){return this.each((t,n)=>{delete n[e]})}data(e,t){if(void 0===e){const e=this.elements[0];if(!e)return;const t={};return Object.keys(e.dataset).forEach(n=>{t[n]=e.dataset[n]}),t}return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.dataset[e]=t})}):void 0===t?this.elements[0]?this.elements[0].dataset[e]:void 0:this.each((n,s)=>{s.dataset[e]=t})}removeData(e){return this.each((t,n)=>{delete n.dataset[e]})}css(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.style[e]=t})}):void 0===t?this.elements[0]?getComputedStyle(this.elements[0])[e]:"":this.each((n,s)=>{s.style[e]=t})}addClass(e){if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.add(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.add(...t)})}removeClass(e){if(void 0===e)return this.each((e,t)=>{t.className=""});if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.remove(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.remove(...t)})}toggleClass(e,t){if("function"==typeof e)return this.each((n,s)=>{const o=e.call(s,n,s.className,t);o&&o.split(/\s+/).filter(Boolean).forEach(e=>{s.classList.toggle(e,t)})});const n=e.split(/\s+/).filter(Boolean);return this.each((e,s)=>{n.forEach(e=>{s.classList.toggle(e,t)})})}hasClass(e){return this.elements.some(t=>t.classList.contains(e))}append(e){const t=this.elements.length-1;return this.each((n,s)=>{this._getNodes(e,n,s,n===t).forEach(e=>s.appendChild(e))})}prepend(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.firstChild;o.forEach(e=>s.insertBefore(e,i))})}after(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode,r=s.nextSibling;o.forEach(e=>i.insertBefore(e,r))})}before(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode;o.forEach(e=>i.insertBefore(e,s))})}appendTo(e){return new a(e).append(this),this}prependTo(e){return new a(e).prepend(this),this}insertAfter(e){return new a(e).after(this),this}insertBefore(e){return new a(e).before(this),this}wrap(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);n.parentNode&&(n.parentNode.insertBefore(s,n),s.appendChild(n))})}wrapAll(e){if(0===this.elements.length)return this;const t=this._getWrapper(e,0,this.elements[0]);return this.elements[0].parentNode.insertBefore(t,this.elements[0]),this.elements.forEach(e=>t.appendChild(e)),this}wrapInner(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);for(;n.firstChild;)s.appendChild(n.firstChild);n.appendChild(s)})}unwrap(e){return this.parent(e).each((e,t)=>{const n=t.parentNode;for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}),this}remove(e){return(e?this.filter(e):this).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this}detach(){return this.remove()}empty(){return this.each((e,t)=>{t.innerHTML=""})}clone(e=!0){return new a(this.elements.map(t=>t.cloneNode(e)))}replaceWith(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode;o.forEach((e,t)=>{0===t?i.replaceChild(e,s):i.insertBefore(e,o[t-1].nextSibling)})})}replaceAll(e){return new a(e).replaceWith(this),this}_getNodes(e,t,n,s=!0){if("function"==typeof e&&(e=e.call(n,t,n.innerHTML)),"string"==typeof e){if(e.trim().startsWith("<")){const t=document.createElement("div");return t.innerHTML=e,Array.from(t.childNodes)}return[document.createTextNode(e)]}return e instanceof HTMLElement?[s?e:e.cloneNode(!0)]:e instanceof a?e.elements.map(e=>s?e:e.cloneNode(!0)):[]}_getWrapper(e,t,n){let s;if("function"==typeof e&&(e=e.call(n,t)),"string"==typeof e){const t=document.createElement("div");t.innerHTML=e.trim(),s=t.firstElementChild}else s=e instanceof HTMLElement?e.cloneNode(!0):e instanceof a?e.elements[0].cloneNode(!0):document.createElement("div");return s}on(e,t,n){"function"==typeof t&&(n=t,t=null);const s=e.split(/\s+/);return this.each((e,o)=>{s.forEach(e=>{if(t){const s=e=>{const s=e.target.closest(t);s&&o.contains(s)&&n.call(s,e)};o.addEventListener(e,s),o._dommaHandlers=o._dommaHandlers||[],o._dommaHandlers.push({event:e,selector:t,handler:n,delegated:s})}else o.addEventListener(e,n)})})}off(e,t,n){return"function"==typeof t&&(n=t,t=null),this.each((s,o)=>{if(e){e.split(/\s+/).forEach(e=>{t&&o._dommaHandlers?o._dommaHandlers=o._dommaHandlers.filter(s=>!!(s.event!==e||s.selector!==t||n&&s.handler!==n)||(o.removeEventListener(e,s.delegated),!1)):n&&o.removeEventListener(e,n)})}})}one(e,t,n){"function"==typeof t&&(n=t,t=null);const s=this,o=function(i){n.call(this,i),s.off(e,t,o)};return this.on(e,t,o)}trigger(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.each((e,t)=>{t.dispatchEvent(n)})}triggerNative(e){return this.each((t,n)=>{const s=new Event(e,{bubbles:!0,cancelable:!0});n.dispatchEvent(s)})}click(e){return e?this.on("click",e):this.triggerNative("click")}dblclick(e){return e?this.on("dblclick",e):this.trigger("dblclick")}mousedown(e){return e?this.on("mousedown",e):this.trigger("mousedown")}mouseup(e){return e?this.on("mouseup",e):this.trigger("mouseup")}mousemove(e){return e?this.on("mousemove",e):this.trigger("mousemove")}mouseover(e){return e?this.on("mouseover",e):this.trigger("mouseover")}mouseout(e){return e?this.on("mouseout",e):this.trigger("mouseout")}mouseenter(e){return e?this.on("mouseenter",e):this.trigger("mouseenter")}mouseleave(e){return e?this.on("mouseleave",e):this.trigger("mouseleave")}keydown(e){return e?this.on("keydown",e):this.trigger("keydown")}keyup(e){return e?this.on("keyup",e):this.trigger("keyup")}keypress(e){return e?this.on("keypress",e):this.trigger("keypress")}focus(e){return e?this.on("focus",e):this.each((e,t)=>t.focus())}blur(e){return e?this.on("blur",e):this.each((e,t)=>t.blur())}change(e){return e?this.on("change",e):this.trigger("change")}select(e){return e?this.on("select",e):this.trigger("select")}submit(e){return e?this.on("submit",e):this.each((e,t)=>{t.submit&&t.submit()})}scroll(e){return e?this.on("scroll",e):this.trigger("scroll")}resize(e){return e?this.on("resize",e):this.trigger("resize")}hover(e,t){return this.on("mouseenter",e),t?this.on("mouseleave",t):this.on("mouseleave",e),this}show(e,t){return this.each((n,s)=>{e?(s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",t&&setTimeout(()=>t.call(s),this._getDuration(e))})):(s.style.display="",t&&t.call(s))})}hide(e,t){return this.each((n,s)=>{e?(s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))):(s.style.display="none",t&&t.call(s))})}toggle(e,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new a(s).show(e,t):new a(s).hide(e,t)})}fadeIn(e=400,t){return this.each((n,s)=>{s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",setTimeout(()=>{s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}fadeOut(e=400,t){return this.each((n,s)=>{s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})}fadeToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display||"0"===getComputedStyle(s).opacity?new a(s).fadeIn(e,t):new a(s).fadeOut(e,t)})}fadeTo(e,t,n){return this.each((s,o)=>{o.style.display="",o.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{o.style.opacity=String(t),setTimeout(()=>{o.style.transition="",n&&n.call(o)},this._getDuration(e))})})}slideUp(e=400,t){return this.each((n,s)=>{const o=s.offsetHeight;s.style.overflow="hidden",s.style.height=o+"px",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height="0",setTimeout(()=>{s.style.display="none",s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideDown(e=400,t){return this.each((n,s)=>{s.style.display="";const o=s.scrollHeight;s.style.overflow="hidden",s.style.height="0",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height=o+"px",setTimeout(()=>{s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new a(s).slideDown(e,t):new a(s).slideUp(e,t)})}animate(e,t=400,n="ease",s){"function"==typeof t?(s=t,t=400,n="ease"):"function"==typeof n&&(s=n,n="ease");const o=Object.keys(e).join(", "),i=this._getDuration(t);return this.each((t,r)=>{r.style.transition=`${o} ${i}ms ${n}`,requestAnimationFrame(()=>{Object.entries(e).forEach(([e,t])=>{r.style[e]="number"==typeof t?t+"px":t}),setTimeout(()=>{r.style.transition="",s&&s.call(r)},i)})})}stop(){return this.each((e,t)=>{const n=getComputedStyle(t);t.style.transition="none",["opacity","height","width"].forEach(e=>{t.style[e]&&(t.style[e]=n[e])})})}delay(e){return new Promise(t=>{setTimeout(()=>t(this),e)})}_getDuration(e){return"number"==typeof e?e:"fast"===e?200:"slow"===e?600:400}width(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().width}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new a(n).width()):e;n.style.width="number"==typeof s?s+"px":s})}height(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().height}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new a(n).height()):e;n.style.height="number"==typeof s?s+"px":s})}innerWidth(){const e=this.elements[0];return e?e.clientWidth:void 0}innerHeight(){const e=this.elements[0];return e?e.clientHeight:void 0}outerWidth(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetWidth;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginLeft)+parseFloat(e.marginRight)}return n}outerHeight(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetHeight;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginTop)+parseFloat(e.marginBottom)}return n}offset(e){if(void 0===e){const e=this.elements[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}return this.each((t,n)=>{"static"===getComputedStyle(n).position&&(n.style.position="relative");const s=new a(n).offset(),o=parseFloat(getComputedStyle(n).left)||0,i=parseFloat(getComputedStyle(n).top)||0;void 0!==e.left&&(n.style.left=o+e.left-s.left+"px"),void 0!==e.top&&(n.style.top=i+e.top-s.top+"px")})}position(){const e=this.elements[0];if(e)return{top:e.offsetTop,left:e.offsetLeft}}scrollTop(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageYOffset:e.scrollTop}return this.each((t,n)=>{n===window?window.scrollTo(window.pageXOffset,e):n.scrollTop=e})}scrollLeft(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageXOffset:e.scrollLeft}return this.each((t,n)=>{n===window?window.scrollTo(e,window.pageYOffset):n.scrollLeft=e})}offsetParent(){return new a(this.elements.map(e=>e.offsetParent||document.body))}}const l=(e,t)=>"function"==typeof e?("loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(),new a([])):new a(e,t),d={async request(e,t,n=null,s={}){const o={method:e,headers:{...s.headers},credentials:s.credentials||"include",...s};n&&"GET"!==e&&"HEAD"!==e&&(o.headers["Content-Type"]="application/json",o.body=JSON.stringify(n));try{const e=await fetch(t,o);if(!e.ok){let t=`HTTP Error: ${e.status}`;try{const n=await e.json();n.message?t=n.message:n.error&&(t=n.error)}catch(n){t=`HTTP Error: ${e.status} ${e.statusText}`}throw new Error(t)}return await e.json()}catch(e){throw s.silent||console.error("Domma HTTP Error:",e),e}},get(e,t){return this.request("GET",e,null,t)},post(e,t,n){return this.request("POST",e,t,n)},put(e,t,n){return this.request("PUT",e,t,n)},patch(e,t,n){return this.request("PATCH",e,t,n)},delete(e,t){return this.request("DELETE",e,{delete:!0},t)},head(e,t){return this.request("HEAD",e,null,t)},options(e,t){return this.request("OPTIONS",e,null,t)}},c={chunk(e,t=1){if(!e||t<1)return[];const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n},compact:e=>e?e.filter(Boolean):[],concat:(e,...t)=>e?e.concat(...t):[],difference(e,...t){if(!e)return[];const n=new Set(t.flat());return e.filter(e=>!n.has(e))},differenceBy(e,t,n){if(!e)return[];const s=new Set(t.map(n));return e.filter(e=>!s.has(n(e)))},differenceWith:(e,t,n)=>e?e.filter(e=>!t.some(t=>n(e,t))):[],drop:(e,t=1)=>e?e.slice(t):[],dropRight(e,t=1){if(!e)return[];const n=e.length-t;return n>0?e.slice(0,n):[]},dropRightWhile(e,t){if(!e)return[];let n=e.length;for(;n--&&t(e[n],n,e););return e.slice(0,n+1)},dropWhile(e,t){if(!e)return[];let n=0;for(;n<e.length&&t(e[n],n,e);)n++;return e.slice(n)},eq:(e,t)=>e===t||e!=e&&t!=t,fill:(e,t,n=0,s)=>e?e.fill(t,n,s):[],findIndex(e,t,n=0){if(!e)return-1;for(let s=n;s<e.length;s++)if(t(e[s],s,e))return s;return-1},findLastIndex(e,t,n){if(!e)return-1;for(let s=void 0!==n?n:e.length-1;s>=0;s--)if(t(e[s],s,e))return s;return-1},first:e=>e?e[0]:void 0,head(e){return this.first(e)},flatten:e=>e?e.flat(1):[],flattenDeep:e=>e?e.flat(1/0):[],flattenDepth:(e,t=1)=>e?e.flat(t):[],fromPairs:e=>e?Object.fromEntries(e):{},indexOf:(e,t,n=0)=>e?e.indexOf(t,n):-1,initial:e=>e?e.slice(0,-1):[],intersection(...e){if(!e.length)return[];return e[0].filter(t=>e.every(e=>e.includes(t)))},join:(e,t=",")=>e?e.join(t):"",last:e=>e?e[e.length-1]:void 0,lastIndexOf:(e,t,n)=>e?void 0!==n?e.lastIndexOf(t,n):e.lastIndexOf(t):-1,nth(e,t=0){if(e)return t<0?e[e.length+t]:e[t]},pull(e,...t){if(!e)return[];const n=new Set(t);for(let t=e.length-1;t>=0;t--)n.has(e[t])&&e.splice(t,1);return e},pullAt(e,...t){if(!e)return[];const n=t.flat().sort((e,t)=>t-e),s=[];return n.forEach(t=>{t>=0&&t<e.length&&s.unshift(e.splice(t,1)[0])}),s},reverse:e=>e?e.reverse():[],slice:(e,t=0,n)=>e?void 0!==n?e.slice(t,n):e.slice(t):[],tail:e=>e?e.slice(1):[],take:(e,t=1)=>e?e.slice(0,t):[],takeRight(e,t=1){if(!e)return[];const n=Math.max(0,e.length-t);return e.slice(n)},union:(...e)=>[...new Set(e.flat())],uniq:e=>e?[...new Set(e)]:[],uniqBy(e,t){if(!e)return[];const n=new Set;return e.filter(e=>{const s=t(e);return!n.has(s)&&(n.add(s),!0)})},without(e,...t){if(!e)return[];const n=new Set(t);return e.filter(e=>!n.has(e))},xor(...e){if(!e.length)return[];const t=new Map;return e.flat().forEach(e=>{t.set(e,(t.get(e)||0)+1)}),[...t.entries()].filter(([,e])=>1===e).map(([e])=>e)},zip(...e){if(!e.length)return[];const t=Math.max(...e.map(e=>e.length)),n=[];for(let s=0;s<t;s++)n.push(e.map(e=>e[s]));return n},zipObject(e,t){if(!e)return{};const n={};return e.forEach((e,s)=>{n[e]=t?t[s]:void 0}),n},times(e,t){if((e=Math.floor(e))<1)return[];const n=new Array(e);for(let s=0;s<e;s++)n[s]=t?t(s):s;return n},range(e,t,n){if(void 0===t&&(t=e,e=0),0===(n=void 0===n?e<t?1:-1:n))return[];const s=Math.max(Math.ceil((t-e)/(n||1)),0),o=new Array(s);for(let t=0;t<s;t++)o[t]=e+t*n;return o},uniqueId:(()=>{let e=0;return function(t=""){const n=++e;return t?`${t}${n}`:String(n)}})(),countBy(e,t){const n={};return this.each(e,e=>{const s=t(e);n[s]=(n[s]||0)+1}),n},each:(e,t)=>(Array.isArray(e)?e.forEach((n,s)=>t(n,s,e)):e&&"object"==typeof e&&Object.keys(e).forEach(n=>t(e[n],n,e)),e),forEach(e,t){return this.each(e,t)},eachRight(e,t){if(Array.isArray(e))for(let n=e.length-1;n>=0;n--)t(e[n],n,e);else if(e&&"object"==typeof e){Object.keys(e).reverse().forEach(n=>t(e[n],n,e))}return e},forEachRight(e,t){return this.eachRight(e,t)},every:(e,t)=>Array.isArray(e)?e.every(t):!e||"object"!=typeof e||Object.values(e).every(t),filter:(e,t)=>Array.isArray(e)?e.filter(t):e&&"object"==typeof e?Object.values(e).filter(t):[],find:(e,t)=>Array.isArray(e)?e.find(t):e&&"object"==typeof e?Object.values(e).find(t):void 0,findLast(e,t){if(Array.isArray(e)){for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return e[n]}else if(e&&"object"==typeof e){return Object.values(e).reverse().find(t)}},flatMap(e,t){return this.map(e,t).flat(1)},flatMapDeep(e,t){return this.map(e,t).flat(1/0)},groupBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]||(n[s]=[]),n[s].push(e)}),n},includes:(e,t,n=0)=>"string"==typeof e||Array.isArray(e)?e.includes(t,n):!(!e||"object"!=typeof e)&&Object.values(e).includes(t),keyBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]=e}),n},map:(e,t)=>Array.isArray(e)?e.map(t):e&&"object"==typeof e?Object.entries(e).map(([n,s])=>t(s,n,e)):[],orderBy(e,t,n){const s=Array.isArray(e)?[...e]:Object.values(e),o=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n||"asc"];return s.sort((e,t)=>{for(let n=0;n<o.length;n++){const s=o[n],r=i[n]||"asc",a="function"==typeof s?s(e):e[s],l="function"==typeof s?s(t):t[s];if(a<l)return"asc"===r?-1:1;if(a>l)return"asc"===r?1:-1}return 0})},partition(e,t){const n=[],s=[];return this.each(e,(o,i)=>{t(o,i,e)?n.push(o):s.push(o)}),[n,s]},reduce(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduce(t,n):e.reduce(t);if(e&&"object"==typeof e){const s=Object.entries(e);let o=n,i=0;void 0===o&&s.length>0&&(o=s[0][1],i=1);for(let n=i;n<s.length;n++){const[i,r]=s[n];o=t(o,r,i,e)}return o}return n},reduceRight(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduceRight(t,n):e.reduceRight(t);if(e&&"object"==typeof e){const s=Object.entries(e).reverse();let o=n,i=0;void 0===o&&s.length>0&&(o=s[0][1],i=1);for(let n=i;n<s.length;n++){const[i,r]=s[n];o=t(o,r,i,e)}return o}return n},reject(e,t){return this.filter(e,(e,n,s)=>!t(e,n,s))},sample(e){const t=Array.isArray(e)?e:Object.values(e||{});return t[Math.floor(Math.random()*t.length)]},sampleSize(e,t=1){return this.shuffle(Array.isArray(e)?[...e]:Object.values(e||{})).slice(0,t)},shuffle(e){const t=Array.isArray(e)?[...e]:Object.values(e||{});for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},size:e=>null==e?0:"string"==typeof e||Array.isArray(e)?e.length:"object"==typeof e?Object.keys(e).length:0,some:(e,t)=>Array.isArray(e)?e.some(t):!(!e||"object"!=typeof e)&&Object.values(e).some(t),sortBy:(e,t)=>(Array.isArray(e)?[...e]:Object.values(e)).sort((e,n)=>{const s="function"==typeof t?t(e):e[t],o="function"==typeof t?t(n):n[t];return s<o?-1:s>o?1:0}),after(e,t){let n=0;return function(...s){if(++n>=e)return t.apply(this,s)}},ary:(e,t=e.length)=>function(...n){return e.apply(this,n.slice(0,t))},before(e,t){let n,s=0;return function(...o){return++s<e&&(n=t.apply(this,o)),n}},bind:(e,t,...n)=>function(...s){return e.apply(t,[...n,...s])},curry:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...s,...e])}},curryRight:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...e,...s])}},debounce(e,t=0,n={}){let s,o,i,r,a,l=0;const d=n.leading||!1,c=!1!==n.trailing,h=n.maxWait;function u(t){const n=o,s=i;return o=i=void 0,l=t,r=e.apply(s,n),r}function p(e){const n=e-a;return void 0===a||n>=t||n<0||void 0!==h&&e-l>=h}function m(){const e=Date.now();if(p(e))return f(e);s=setTimeout(m,function(e){const n=e-a,s=e-l,o=t-n;return void 0!==h?Math.min(o,h-s):o}(e))}function f(e){return s=void 0,c&&o?u(e):(o=i=void 0,r)}function g(...e){const n=Date.now(),c=p(n);if(o=e,i=this,a=n,c){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),d?u(e):r}(a);if(void 0!==h)return s=setTimeout(m,t),u(a)}return void 0===s&&(s=setTimeout(m,t)),r}return g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,o=a=i=s=void 0},g.flush=function(){return void 0===s?r:f(Date.now())},g},defer(e,...t){return setTimeout(()=>e.apply(this,t),1)},delay(e,t,...n){return setTimeout(()=>e.apply(this,n),t)},flip:e=>function(...t){return e.apply(this,t.reverse())},flow(...e){const t=e.length;return 0===t?function(e){return e}:1===t?e[0]:function(...n){let s=e[0].apply(this,n);for(let n=1;n<t;n++)s=e[n].call(this,s);return s}},compose(...e){return this.flow(...e.reverse())},memoize(e,t){const n=new Map,s=function(...s){const o=t?t.apply(this,s):s[0];if(n.has(o))return n.get(o);const i=e.apply(this,s);return n.set(o,i),i};return s.cache=n,s},negate:e=>function(...t){return!e.apply(this,t)},once(e){return this.before(2,e)},partial:(e,...t)=>function(...n){return e.apply(this,[...t,...n])},partialRight:(e,...t)=>function(...n){return e.apply(this,[...n,...t])},throttle(e,t=0,n={}){const s=!1!==n.leading,o=!1!==n.trailing;return this.debounce(e,t,{leading:s,trailing:o,maxWait:t})},unary(e){return this.ary(e,1)},wrap:(e,t)=>function(...n){return t.apply(this,[e,...n])},assign:(e,...t)=>Object.assign(e||{},...t),assignIn(e,...t){const n=e||{};return t.forEach(e=>{if(e)for(const t in e)n[t]=e[t]}),n},extend(e,...t){return this.assignIn(e,...t)},at(e,...t){return t.flat().map(t=>this.get(e,t))},clone:e=>null===e||"object"!=typeof e?e:Array.isArray(e)?[...e]:{...e},cloneDeep(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>this.cloneDeep(e));if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=this.cloneDeep(e[n]));return t},defaults(e,...t){const n=e||{};return t.forEach(e=>{e&&Object.keys(e).forEach(t=>{void 0===n[t]&&(n[t]=e[t])})}),n},defaultsDeep(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],o=e[t];void 0===s?n[t]=this.cloneDeep(o):s&&"object"==typeof s&&o&&"object"==typeof o&&!Array.isArray(s)&&!Array.isArray(o)&&this.defaultsDeep(s,o)})}),n},entries:e=>e?Object.entries(e):[],toPairs(e){return this.entries(e)},findKey(e,t){if(e)for(const n of Object.keys(e))if(t(e[n],n,e))return n},findLastKey(e,t){if(!e)return;const n=Object.keys(e).reverse();for(const s of n)if(t(e[s],s,e))return s},forIn(e,t){if(e)for(const n in e)if(!1===t(e[n],n,e))break;return e},forOwn(e,t){if(e)for(const n of Object.keys(e))if(!1===t(e[n],n,e))break;return e},get(e,t,n){if(!e)return n;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let o=e;for(const e of s){if(null==o)return n;o=o[e]}return void 0===o?n:o},has(e,t){if(!e)return!1;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(const e of n){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;s=s[e]}return!0},invert(e){const t={};return e&&Object.entries(e).forEach(([e,n])=>{t[n]=e}),t},invertBy(e,t=e=>e){const n={};return e&&Object.entries(e).forEach(([e,s])=>{const o=t(s);n[o]||(n[o]=[]),n[o].push(e)}),n},keys:e=>e?Object.keys(e):[],keysIn(e){const t=[];for(const n in e)t.push(n);return t},mapKeys(e,t){const n={};return e&&Object.entries(e).forEach(([s,o])=>{n[t(o,s,e)]=o}),n},mapValues(e,t){const n={};return e&&Object.entries(e).forEach(([s,o])=>{n[s]=t(o,s,e)}),n},merge(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],o=e[t];s&&"object"==typeof s&&o&&"object"==typeof o&&!Array.isArray(s)&&!Array.isArray(o)?this.merge(s,o):n[t]=o})}),n},omit(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return Object.keys(e).forEach(t=>{n.has(t)||(s[t]=e[t])}),s},omitBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)||(n[e]=s)}),n},pick(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return n.forEach(t=>{t in e&&(s[t]=e[t])}),s},pickBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)&&(n[e]=s)}),n},set(e,t,n){if(!e)return e;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let o=e;for(let e=0;e<s.length-1;e++){const t=s[e],n=s[e+1];t in o&&null!==o[t]&&"object"==typeof o[t]||(o[t]=/^\d+$/.test(n)?[]:{}),o=o[t]}return o[s[s.length-1]]=n,e},unset(e,t){if(!e)return!0;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(let e=0;e<n.length-1;e++){const t=n[e];if(!(t in s))return!0;s=s[t]}return delete s[n[n.length-1]]},setIfUndefined(e,t,n){return void 0===this.get(e,t)&&this.set(e,t,n),e},values:e=>e?Object.values(e):[],valuesIn(e){const t=[];for(const n in e)t.push(e[n]);return t},isArray:e=>Array.isArray(e),isBoolean:e=>"boolean"==typeof e||e instanceof Boolean,isDate:e=>e instanceof Date,isEmpty:e=>null==e||(Array.isArray(e)||"string"==typeof e?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"!=typeof e||0===Object.keys(e).length),isEqual(e,t){if(e===t)return!0;if(null===e||null===t)return e===t;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>this.isEqual(e,t[n]));if(Array.isArray(e)||Array.isArray(t))return!1;const n=Object.keys(e),s=Object.keys(t);return n.length===s.length&&n.every(n=>this.isEqual(e[n],t[n]))},isMatch(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t);for(const s of n){const n=e[s],o=t[s];if("object"==typeof o&&null!==o){if(!this.isMatch(n,o))return!1}else if(n!==o)return!1}return!0},isFinite:e=>Number.isFinite(e),isFunction:e=>"function"==typeof e,isInteger:e=>Number.isInteger(e),isNaN:e=>Number.isNaN(e),isNil:e=>null==e,isNull:e=>null===e,isNumber:e=>"number"==typeof e||e instanceof Number,isObject:e=>null!==e&&"object"==typeof e,isPlainObject(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},isRegExp:e=>e instanceof RegExp,isString:e=>"string"==typeof e||e instanceof String,isSymbol:e=>"symbol"==typeof e,isUndefined:e=>void 0===e,parseInt:(e,t)=>(void 0===t&&(t=/^0x/i.test(e)?16:10),null==e?NaN:"number"==typeof e?Math.trunc(e):(e=String(e).trim(),parseInt(e,t))),toNumber(e){if("number"==typeof e)return e;if("symbol"==typeof e)return NaN;if(this.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=this.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.trim();const t=/^0b[01]+$/i.test(e),n=/^0o[0-7]+$/i.test(e),s=/^[-+]0x[0-9a-f]+$/i.test(e);return t||n?parseInt(e.slice(2),t?2:8):s?NaN:+e},toInteger(e){const t=this.toNumber(e);return Number.isNaN(t)?0:0!==t&&Number.isFinite(t)?Math.trunc(t):t},toFinite(e){const t=17976931348623157e292;if(!e)return 0===e?e:0;const n=this.toNumber(e);return n===1/0?t:n===-1/0?-t:n==n?n:0},toSafeInteger(e){const t=9007199254740991,n=this.toInteger(e);return n<-9007199254740991?-9007199254740991:n>t?t:n},toString(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>null==e?"":this.toString(e)).join(",");if("symbol"==typeof e)return e.toString();const t=String(e);return"0"===t&&1/e==-1/0?"-0":t},toArray(e){return e?this.isArray(e)?[...e]:"string"==typeof e?e.split(""):this.isObject(e)?"function"==typeof e[Symbol.iterator]?[...e]:Object.values(e):[]:[]},castArray(...e){if(!e.length)return[];const t=e[0];return this.isArray(t)?t:[t]},toLength(e){const t=4294967295,n=this.toInteger(e);return n<0?0:n>t?t:n},toPlainObject(e){const t={};for(const n in e)t[n]=e[n];return t},add:(e,t)=>e+t,ceil(e,t=0){const n=Math.pow(10,t);return Math.ceil(e*n)/n},divide:(e,t)=>e/t,floor(e,t=0){const n=Math.pow(10,t);return Math.floor(e*n)/n},max:e=>e&&e.length?Math.max(...e):void 0,maxBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])>("function"==typeof t?t(e):e[t])?n:e)},mean(e){return e&&e.length?this.sum(e)/e.length:NaN},meanBy(e,t){return e&&e.length?this.sumBy(e,t)/e.length:NaN},min:e=>e&&e.length?Math.min(...e):void 0,minBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])<("function"==typeof t?t(e):e[t])?n:e)},multiply:(e,t)=>e*t,round(e,t=0){const n=Math.pow(10,t);return Math.round(e*n)/n},subtract:(e,t)=>e-t,sum:e=>e?e.reduce((e,t)=>e+t,0):0,sumBy:(e,t)=>e?e.reduce((e,n)=>e+("function"==typeof t?t(n):n[t]),0):0,clamp:(e,t,n)=>(void 0===n&&(n=t,t=void 0),void 0!==t&&e<t?t:void 0!==n&&e>n?n:e),inRange:(e,t,n)=>(void 0===n&&(n=t,t=0),t>n&&([t,n]=[n,t]),e>=t&&e<n),random:(e=0,t=1,n)=>("boolean"==typeof e?(n=e,e=0,t=1):"boolean"==typeof t&&(n=t,t=e,e=0),e>t&&([e,t]=[t,e]),n||e%1!=0||t%1!=0?e+Math.random()*(t-e):e+Math.floor(Math.random()*(t-e+1))),camelCase:e=>e?e.replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()):"",capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",endsWith:(e,t,n)=>!!e&&(void 0!==n?e.slice(0,n).endsWith(t):e.endsWith(t)),escape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,e=>t[e])},kebabCase:e=>e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():"",lowerCase(e){return e?this.words(e).join(" ").toLowerCase():""},lowerFirst:e=>e?e.charAt(0).toLowerCase()+e.slice(1):"",pad(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s,i=Math.floor(o/2),r=o-i;return n.repeat(Math.ceil(i/n.length)).slice(0,i)+e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},padEnd(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s;return e+n.repeat(Math.ceil(o/n.length)).slice(0,o)},padStart(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s;return n.repeat(Math.ceil(o/n.length)).slice(0,o)+e},repeat:(e="",t=1)=>e.repeat(Math.max(0,Math.floor(t))),replace:(e="",t,n)=>e.replace(t,n),snakeCase(e){return e?this.words(e).join("_").toLowerCase():""},split:(e="",t,n)=>e.split(t,n),startCase(e){return e?this.words(e).map(e=>this.capitalize(e)).join(" "):""},startsWith:(e,t,n=0)=>!!e&&e.startsWith(t,n),toLower:e=>e?e.toLowerCase():"",toUpper:e=>e?e.toUpperCase():"",trim(e="",t){if(!t)return e.trim();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+|[${n}]+$`,"g"),"")},trimEnd(e="",t){if(!t)return e.trimEnd();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`[${n}]+$`,"g"),"")},trimStart(e="",t){if(!t)return e.trimStart();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+`,"g"),"")},truncate(e="",t={}){const n=t.length||30,s=t.omission||"...",o=t.separator;if(e.length<=n)return e;let i=n-s.length;if(i<1)return s;let r=e.slice(0,i);if(o){const e="string"==typeof o?r.lastIndexOf(o):r.search(new RegExp(o.source+"(?!.*"+o.source+")"));e>-1&&(r=r.slice(0,e))}return r+s},unescape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>t[e])},upperCase(e){return e?this.words(e).join(" ").toUpperCase():""},upperFirst:e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",words:(e="",t)=>t?e.match(t)||[]:(e=e.replace(/([a-z])([A-Z])/g,"$1 $2")).match(/[a-zA-Z0-9]+/g)||[],sprintf(e,...t){if(!e)return"";let n=0;return e.replace(/%(?:(\d+)\$)?([+-])?(\d+)?(?:\.(\d+))?([sdifojx%])/g,(e,s,o,i,r,a)=>{if("%"===a)return"%";const l=s?parseInt(s,10)-1:n++,d=t[l];if(void 0===d)return e;if(null===d)return"null";let c;switch(a){case"s":default:c=String(d);break;case"d":case"i":c=String(parseInt(d,10));break;case"f":const e=parseFloat(d);c=void 0!==r?e.toFixed(parseInt(r,10)):String(e);break;case"o":c=Object.prototype.toString.call(d);break;case"j":try{c=JSON.stringify(d)}catch(e){c="[Circular]"}break;case"x":c=parseInt(d,10).toString(16)}if(i){const e=parseInt(i,10),t="0"===o?"0":" ";c="-"===o?c.padEnd(e," "):c.padStart(e,t)}if("+"===o&&("d"===a||"i"===a||"f"===a)){parseFloat(c)>=0&&!c.startsWith("+")&&(c="+"+c)}return c})},format(e,...t){return this.sprintf(e,...t)},template(e,t={}){const{partials:n={},helpers:s={}}=t,o=e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),i=(e,t)=>"."===t?e:t.startsWith("@")?e[t]:t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:"",e),r=(e,t,a=null)=>{let l=e;return l=l.replace(/\{\{#with\s+([^}]+)\}\}([\s\S]*?)\{\{\/with\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return o&&"object"==typeof o?r(s,o,t):""}),l=l.replace(/\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return Array.isArray(o)?o.map((e,n)=>{const i="object"==typeof e?{...e,"@index":n,"@first":0===n,"@last":n===o.length-1}:{".":e,"@index":n,"@first":0===n,"@last":n===o.length-1};return r(s,i,t)}).join(""):""}),l=l.replace(/\{\{#if\s+([^}]+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g,(e,n,s,o="")=>{const l=i(t,n.trim()),d=Array.isArray(l)?l.length>0:Boolean(l);return r(d?s:o,t,a)}),l=l.replace(/\{\{#unless\s+([^}]+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return(Array.isArray(o)?0===o.length:!o)?r(s,t,a):""}),l=l.replace(/\{\{>\s*([^}]+)\}\}/g,(e,s)=>{const o=n[s.trim()];return o?r(o,t,a):""}),l=l.replace(/\{\{\{([^}]+)\}\}\}/g,(e,n)=>{const s=i(t,n.trim());return null!=s?String(s):""}),l=l.replace(/\{\{([^#/>][^}]*)\}\}/g,(e,n)=>{const r=n.trim(),a=r.match(/^(\w+)\s+(.+)$/);if(a&&s[a[1]]){const e=a[2].split(/\s+/).map(e=>/^["'].*["']$/.test(e)?e.slice(1,-1):i(t,e));return o(s[a[1]](...e))}const l=i(t,r);return o(l)}),l};return(t={})=>r(e,t)},render(e,t,n={}){return this.template(e,n)(t)},async copyToClipboard(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){}const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(e){return!1}finally{document.body.removeChild(t)}},escapeHtml:e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),chain(e){const t={_value:e,value(){return this._value}};["chunk","compact","concat","difference","drop","dropRight","fill","findIndex","findLastIndex","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","join","last","lastIndexOf","nth","pull","pullAll","pullAt","remove","reverse","slice","sortedIndex","sortedUniq","tail","take","takeRight","union","uniq","uniqBy","unzip","without","xor","zip","countBy","each","every","filter","find","findLast","flatMap","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","assign","assignIn","at","defaults","entries","extend","findKey","findLastKey","forIn","forOwn","functions","get","has","invert","invertBy","invoke","keys","mapKeys","mapValues","merge","omit","omitBy","pick","pickBy","result","set","toPairs","transform","unset","update","values","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return this._value=c[e](this._value,...t),this})});return["sum","mean","min","max","toArray","toJSON","toString"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return c[e](this._value,...t)})}),t}};class h{constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={...this.constructor.defaults,...t},this._eventHandlers=[],this.element&&(this.element._dommaComponent=this)}on(e,t){this.options[e]&&"function"==typeof this.options[e]&&this.options[e](t)}setOptions(e){return this.options={...this.options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}_addEventListener(e,t,n){e.addEventListener(t,n),this._eventHandlers.push({element:e,event:t,handler:n})}destroy(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[],this.element&&delete this.element._dommaComponent}}class u extends h{static defaults={data:[],idKey:"id",parentKey:"parent_id",childrenKey:"children",labelKey:"name",iconKey:"icon",colorKey:"color",expandedByDefault:!0,expandedNodes:[],selectable:!0,multiSelect:!1,selectedNodes:[],renderNode:null,getBadge:null,getNodeIcon:null,getNodeClass:null,actions:[],indentSize:1.5,showIcons:!0,showToggleButtons:!0,toggleIcon:"chevron-down",onSelect:null,onDeselect:null,onExpand:null,onCollapse:null,onAction:null,onClick:null};constructor(e,t={}){super(e,t),this.element?(this._tree=[],this._flatMap={},this._expandedNodes=new Set,this._selectedNodes=new Set,this._init()):console.error("TreeView: Element not found",e)}_init(){this.element.classList.contains("dm-treeview")||this.element.classList.add("dm-treeview"),this.options.expandedNodes.length>0&&this.options.expandedNodes.forEach(e=>this._expandedNodes.add(e)),this.options.selectedNodes.length>0&&this.options.selectedNodes.forEach(e=>this._selectedNodes.add(e)),this.options.data&&this.options.data.length>0&&this.setData(this.options.data),this._setupEventListeners()}_setupEventListeners(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-node");if(!t||e.target.closest(".dm-treeview-toggle")||e.target.closest(".dm-treeview-action"))return;const n=this._parseNodeId(t.dataset.nodeId);this._handleSelect(n,e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-toggle");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId);this.toggle(n)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-action");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId),s=t.dataset.action;this._handleAction(s,n,e)}})}_buildTree(e){const t={},n=[],s=this.options.idKey,o=this.options.parentKey,i=this.options.childrenKey;return e.forEach(e=>{t[e[s]]={...e,[i]:[]}}),e.forEach(e=>{const r=t[e[s]],a=e[o];null==a?n.push(r):t[a]?t[a][i].push(r):n.push(r)}),this._sortTree(n),{tree:n,nodeMap:t}}_sortTree(e){const t=this.options.childrenKey,n=this.options.labelKey;e.sort((e,t)=>{const s=(e[n]||"").toLowerCase(),o=(t[n]||"").toLowerCase();return s.localeCompare(o)}),e.forEach(e=>{e[t]&&e[t].length>0&&this._sortTree(e[t])})}_render(){const e=this._tree.map(e=>this._renderNode(e,0)).join("");this.element.innerHTML=e}_renderNode(e,t){const n=this.options.idKey,s=this.options.childrenKey,o=e[n],i=e[s]&&e[s].length>0,r=this._expandedNodes.has(o),a=this._selectedNodes.has(o),l={isExpanded:r,isSelected:a,hasChildren:i},d=this.options.renderNode?this.options.renderNode(e,t,l):this._defaultRenderNode(e,t,l),c=this.options.getBadge?this.options.getBadge(e):null;let h=`\n <div class="dm-treeview-node ${a?"dm-treeview-node-selected":""} ${this.options.getNodeClass?this.options.getNodeClass(e):""}"\n data-node-id="${o}"\n data-depth="${t}"\n style="padding-left: ${t*this.options.indentSize}rem;">\n <div class="dm-treeview-node-content">\n ${i&&this.options.showToggleButtons?this._renderToggle(o,r):'<span class="dm-treeview-spacer"></span>'}\n ${d}\n ${null!=c?`<span class="dm-treeview-badge">${c}</span>`:""}\n </div>\n ${this.options.actions.length>0?this._renderActions(e):""}\n </div>\n `;return i&&r&&(h+=`<div class="dm-treeview-children" data-parent-id="${o}">`,e[s].forEach(e=>{h+=this._renderNode(e,t+1)}),h+="</div>"),h}_defaultRenderNode(e,t,n){const s=this.options.labelKey,o=this.options.iconKey,i=this.options.colorKey,r=e[s]||"",a=this.options.getNodeIcon?this.options.getNodeIcon(e):e[o],l=e[i];let d="";return this.options.showIcons&&a&&(d+=`<span class="dm-treeview-icon" data-icon="${a}" ${l?`style="color: ${l};"`:""}></span>`),d+=`<span class="dm-treeview-label">${this._escapeHtml(r)}</span>`,d}_renderToggle(e,t){return`\n <button type="button"\n class="dm-treeview-toggle ${t?"dm-treeview-expanded":"dm-treeview-collapsed"}"\n data-node-id="${e}"\n aria-label="${t?"Collapse":"Expand"}">\n <span data-icon="${this.options.toggleIcon}"></span>\n </button>\n `}_renderActions(e){const t=e[this.options.idKey],n=this.options.actions.filter(t=>"function"!=typeof t.visible||t.visible(e));if(0===n.length)return"";let s='<div class="dm-treeview-actions">';return n.forEach(e=>{s+=`\n <button type="button"\n class="dm-treeview-action"\n data-node-id="${t}"\n data-action="${e.name}"\n title="${e.tooltip||e.name}"\n aria-label="${e.tooltip||e.name}">\n ${e.icon?`<span data-icon="${e.icon}"></span>`:e.name}\n </button>\n `}),s+="</div>",s}_handleSelect(e,t){if(!this.options.selectable)return;const n=this._flatMap[e];if(!n)return;"function"==typeof this.options.onClick&&this.options.onClick(e,n,t);const s=this._selectedNodes.has(e);this.options.multiSelect?s?this.deselect(e):this.select(e):s?this.deselect(e):(this.deselectAll(!0),this.select(e))}_handleAction(e,t,n){const s=this._flatMap[t];s&&"function"==typeof this.options.onAction&&this.options.onAction(e,t,s,n)}_parseNodeId(e){const t=Number(e);return isNaN(t)||e!==t.toString()?e:t}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}setData(e){const{tree:t,nodeMap:n}=this._buildTree(e);return this._tree=t,this._flatMap=n,this.options.expandedByDefault&&Object.keys(n).forEach(e=>{const t=n[e],s=this.options.childrenKey;t[s]&&t[s].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this._render(),this}getData(){return this._tree}getFlatData(){return Object.values(this._flatMap)}refresh(){return this._render(),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&window.Domma.icons.scan(this.element),this}getNode(e){return this._flatMap[e]||null}updateNode(e,t){const n=this._flatMap[e];return n&&(Object.assign(n,t),this.refresh()),this}select(e,t=!1){if(!this.options.selectable)return this;const n=this._flatMap[e];return n?(this._selectedNodes.add(e),this.refresh(),t||"function"!=typeof this.options.onSelect||this.options.onSelect(e,n,null),this):this}deselect(e,t=!1){const n=this._flatMap[e];return n?(this._selectedNodes.delete(e),this.refresh(),t||"function"!=typeof this.options.onDeselect||this.options.onDeselect(e,n,null),this):this}toggleSelect(e){return this._selectedNodes.has(e)?this.deselect(e):this.select(e),this}selectAll(){return this.options.multiSelect?(Object.keys(this._flatMap).forEach(e=>{this._selectedNodes.add(this._parseNodeId(e))}),this.refresh(),this):this}deselectAll(e=!1){const t=Array.from(this._selectedNodes);return this._selectedNodes.clear(),this.refresh(),e||"function"!=typeof this.options.onDeselect||t.forEach(e=>{const t=this._flatMap[e];t&&this.options.onDeselect(e,t,null)}),this}getSelected(){return Array.from(this._selectedNodes)}getSelectedNodes(){return this.getSelected().map(e=>this._flatMap[e]).filter(Boolean)}isSelected(e){return this._selectedNodes.has(e)}expand(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.add(e),this.refresh(),t||"function"!=typeof this.options.onExpand||this.options.onExpand(e,n,null),this):this}collapse(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.delete(e),this.refresh(),t||"function"!=typeof this.options.onCollapse||this.options.onCollapse(e,n,null),this):this}toggle(e){return this._expandedNodes.has(e)?this.collapse(e):this.expand(e),this}expandAll(){return Object.keys(this._flatMap).forEach(e=>{const t=this._flatMap[e],n=this.options.childrenKey;t[n]&&t[n].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this.refresh(),this}collapseAll(){return this._expandedNodes.clear(),this.refresh(),this}isExpanded(e){return this._expandedNodes.has(e)}getExpanded(){return Array.from(this._expandedNodes)}getParent(e){const t=this._flatMap[e];if(!t)return null;const n=t[this.options.parentKey];return null!=n&&this._flatMap[n]||null}getChildren(e){const t=this._flatMap[e];if(!t)return[];return t[this.options.childrenKey]||[]}getAncestors(e){const t=[];let n=this.getParent(e);for(;n;)t.unshift(n),n=this.getParent(n[this.options.idKey]);return t}getDescendants(e){const t=[];return this.getChildren(e).forEach(e=>{t.push(e);const n=e[this.options.idKey];t.push(...this.getDescendants(n))}),t}getSiblings(e){if(!this._flatMap[e])return[];const t=this.getParent(e);return t?this.getChildren(t[this.options.idKey]).filter(t=>t[this.options.idKey]!==e):this._tree.filter(t=>t[this.options.idKey]!==e)}getLevel(e){return this.getAncestors(e).length}find(e){for(const t in this._flatMap){const n=this._flatMap[t];if(e(n))return n}return null}filter(e){const t=[];for(const n in this._flatMap){const s=this._flatMap[n];e(s)&&t.push(s)}return t}forEach(e){for(const t in this._flatMap)e(this._flatMap[t],t);return this}scrollToNode(e,t={}){const n=this.element.querySelector(`[data-node-id="${e}"]`);return n&&n.scrollIntoView({behavior:t.behavior||"smooth",block:t.block||"center",inline:t.inline||"nearest"}),this}destroy(){this._tree=[],this._flatMap={},this._expandedNodes.clear(),this._selectedNodes.clear(),this.element.innerHTML="",super.destroy()}}const p="domma-theme",m="domma-theme-variant",f="dm-theme-",g=["ocean-light","ocean-dark","forest-light","forest-dark","sunset-light","sunset-dark","royal-light","royal-dark","lemon-light","lemon-dark","silver-light","silver-dark","charcoal-light","charcoal-dark","christmas-light","christmas-dark","unicorn-light","unicorn-dark","dreamy-light","dreamy-dark","grayve-light","grayve-dark","mint-light","mint-dark","wedding-light","wedding-dark","core-light","corporate-light","corporate-dark","admin-smooth-steel","admin-smooth-indigo","admin-smooth-teal","admin-sharp-steel","admin-sharp-indigo","admin-sharp-teal","admin-slate-steel","admin-slate-indigo","admin-slate-teal"],v="charcoal-dark";const b=new class{constructor(){this._theme=v,this._listeners=[],this._target=null,this._initialised=!1,this._systemMediaQuery=null,this._autoDetect=!1,this._disabled=!1}init(e={}){const{theme:t=null,autoDetect:n=!1,persist:s=!0,disabled:o=!1,target:i=document.body}=e;if(o)return this._disabled=!0,this._initialised=!0,this;this._target="string"==typeof i?document.querySelector(i):i,this._target||(this._target=document.body),this._persist=s,this._autoDetect=n;let r=t;if(s){const e=this._loadFromStorage();e&&!t&&(r=e)}if(n&&!r){r="dark"===this._getSystemPreference()?"charcoal-dark":"charcoal-light",this._setupSystemListener()}return r=r||v,g.includes(r)||(console.warn(`Invalid theme: ${r}. Using default: ${v}`),r=v),this._theme=r,this._applyTheme(),this._initialised=!0,this}get(){return this._theme}getBase(){return this._theme.split("-").slice(0,-1).join("-")}getMode(){return this._theme.split("-").pop()}isDark(){return"dark"===this.getMode()}isLight(){return"light"===this.getMode()}set(e){if(!g.includes(e))return console.warn(`Invalid theme: ${e}. Available themes: ${g.join(", ")}`),this;const t=this._theme;return t===e||(this._theme=e,this._applyTheme(),this._saveToStorage(),this._notifyListeners(t,e)),this}setVariant(){return console.warn('[ThemeEngine] setVariant() is deprecated. Use set() with full theme name (e.g., set("ocean-dark"))'),this}toggle(){return console.warn("[ThemeEngine] toggle() is deprecated. Use variant selector UI or set() method."),this}onChange(e){return"function"!=typeof e?(console.warn("onChange requires a function callback"),()=>{}):(this._listeners.push(e),()=>{const t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)})}preview(e){if(!g.includes(e))return console.warn(`Invalid theme for preview: ${e}`),()=>{};const t=this._theme;return this._theme=e,this._applyTheme(!1),()=>{this._theme=t,this._applyTheme(!1)}}listThemes(){return[...g]}listBases(){return["ocean","forest","sunset","royal","lemon","silver","charcoal","christmas","unicorn","dreamy","grayve","mint","wedding","corporate","admin-smooth","admin-sharp","admin-slate"]}listVariants(){return console.warn("[ThemeEngine] listVariants() is deprecated. Use listThemes() instead."),this.listBases()}getConfig(){return{theme:this._theme,base:this.getBase(),mode:this.getMode(),autoDetect:this._autoDetect,persist:this._persist,disabled:this._disabled}}_updateMetaThemeColor(){const e={light:"#ffffff",dark:"#121212"};let t=document.querySelector('meta[name="theme-color"]');t||(t=document.createElement("meta"),t.name="theme-color",document.head.appendChild(t)),t.content=e[this.getMode()]||e.dark}isDisabled(){return this._disabled}enable(){return this._disabled=!1,this._target||(this._target=document.body),this._applyTheme(),this}disable(){if(this._disabled=!0,this._target){const e=this._target.className.split(" ").filter(e=>!e.startsWith(f));this._target.className=e.join(" ").trim(),this._target.removeAttribute("data-mode")}return this}_applyTheme(e=!0){if(this._disabled)return;const t=this._target||document.body;if(!t)return void console.error("[ThemeEngine] No target element available for theme application");const n=t.className.split(" ").filter(e=>!e.startsWith(f));n.push(`${f}${this._theme}`),t.className=n.join(" ").trim();const s=this.isDark()?"dark":"light";t.setAttribute("data-mode",s),e&&this._updateMetaThemeColor()}_saveToStorage(){if(this._persist&&"undefined"!=typeof localStorage)try{localStorage.setItem(p,this._theme),localStorage.removeItem(m)}catch(e){}}_loadFromStorage(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(p);if(e&&g.includes(e))return e;const t=e,n=localStorage.getItem(m);if(t&&["light","dark"].includes(t)){const e=`${n||"charcoal"}-${t}`;if(console.log(`[ThemeEngine] Migrating theme: ${t} + ${n} → ${e}`),g.includes(e))return localStorage.setItem(p,e),localStorage.removeItem(m),e}return null}catch(e){return null}}_getSystemPreference(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}_setupSystemListener(){if("undefined"==typeof window||!window.matchMedia)return;this._systemMediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{if(!this._autoDetect)return;const t=e.matches?"dark":"light",n=`${this.getBase()}-${t}`;g.includes(n)&&this.set(n)};this._systemMediaQuery.addEventListener?this._systemMediaQuery.addEventListener("change",e):this._systemMediaQuery.addListener(e)}_notifyListeners(e,t){this._listeners.forEach(n=>{try{n(e,t)}catch(e){console.error("[ThemeEngine] Error in change listener:",e)}})}destroy(){this._systemMediaQuery&&this._systemMediaQuery.removeEventListener,this._listeners=[],this._target=null,this._initialised=!1}};"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{b._initialised||b.init({persist:!0,autoDetect:!1})}):b._initialised||b.init({persist:!0,autoDetect:!1}));const _="dm-context-cursor-rules",y={fill:"#111827",halo:"#ffffff"},k="M1,1 L1,17 L5.2,12.9 L8,19 L10.6,17.7 L7.9,11.8 L13.6,11.6 Z",w=[15.5,18.5,21.5];function x(e=("undefined"!=typeof document?document:null)){if(!e||!e.documentElement||"function"!=typeof getComputedStyle)return{...y};let t;try{t=getComputedStyle(e.documentElement)}catch{return{...y}}const n=(t.getPropertyValue("--dm-text")||"").trim(),s=(t.getPropertyValue("--dm-text-inverse")||"").trim();return{fill:n||y.fill,halo:s||y.halo}}function M(e={}){return`url('data:image/svg+xml,${t=function({size:e=26,fill:t,halo:n}={}){const s=t&&n?{fill:t,halo:n}:{...x(),...t?{fill:t}:{},...n?{halo:n}:{}},o=Math.max(12,Math.min(32,Number(e)||26)),i=(e,t,n)=>`<path d="M17.2 ${e}h5.4" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,r=(e,t,n)=>`<path d="M14.4 ${e}h.01" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,a=w.map(e=>r(e,s.halo,3.6)+i(e,s.halo,3.4)).join(""),l=w.map(e=>r(e,s.fill,1.9)+i(e,s.fill,1.7)).join("");return[`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 26 26">`,`<path d="${k}" fill="${s.halo}" stroke="${s.halo}" stroke-width="2.6" stroke-linejoin="round"/>`,`<path d="${k}" fill="${s.fill}"/>`,a,l,"</svg>"].join("")}(e),encodeURIComponent(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/!/g,"%21")}') 1 1, context-menu`;var t}const L=new Map,C=new Map;let E=null;function A(e,t){return`${e}{cursor:${t};}@media (forced-colors:active){${e}{cursor:context-menu;}}`}function S(){const e=function(){if("undefined"==typeof document)return null;let e=document.getElementById(_);return e||(e=document.createElement("style"),e.id=_,document.head.appendChild(e)),e}();if(!e)return;if(!L.size&&!C.size)return void(e.textContent="");const t=x(),n=[];C.forEach(({selector:e,value:t})=>n.push(A(e,t))),L.forEach(({selector:e,size:s})=>{n.push(A(e,M({size:s,...t})))}),e.textContent=n.join("\n")}function $(){L.size&&!E?E=b.onChange(()=>S()):!L.size&&E&&(E(),E=null)}function z(e,t,n){t&&(L.delete(e),C.delete(e),"glyph"===n.kind?L.set(e,{selector:t,size:n.size||26}):"keyword"===n.kind?C.set(e,{selector:t,value:"context-menu"}):"custom"===n.kind&&n.value&&C.set(e,{selector:t,value:n.value}),$(),S())}const j=new Set;let B=null,T=!1,D=0,W=0;const H=e=>"function"==typeof e,O={primary:"var(--dm-primary)",success:"var(--dm-success)",danger:"var(--dm-danger)",warning:"var(--dm-warning)",info:"var(--dm-info)"},I={none:"0",sm:"sm",md:"md",lg:"lg",xl:"xl"};const N=e=>H(e)&&H(e.subscribe);function P(e,...t){return N(e)?e():H(e)?e(...t):e}function V(e){const t=[];let n=e instanceof Element?e:null;for(;n;){const e=[];for(const t of j)t._enabledFlag&&t.matchesContainer(n)&&e.push(t);e.length>1&&e.sort((e,t)=>t.options.priority-e.options.priority);for(const s of e)t.push({instance:s,container:n});n=n.parentElement||(n.parentNode&&n.parentNode.host?n.parentNode.host:null)}return t}function F(e,t){const n=V(e),s=n.findIndex(e=>e.instance.options.exclusive);let o=0,i=null;if(s>-1){const r=n[s];i=r.instance._accept(r.container,e,t),i&&(o=s)}const r=[];for(let a=o;a<n.length;a++){if(a===s&&i){r.push(i);continue}const o=n[a],l=o.instance._accept(o.container,e,t);l&&r.push(l)}return r}let R=null,q=null,U=null,K=null,Y=null,G=null,J=null;function X(){T||"undefined"==typeof document||(T=!0,R=e=>{e.shiftKey&&function(e){for(const t of V(e))if(t.instance.options.nativeOnShift)return!0;return!1}(e.target)||(B&&B.close(),function(e,t,n){const s=F(e.target,e);if(!s.length)return!1;const o=s[0],i=o.instance._assembleItems(s,e);!i.length&&!o.instance.options.render||(e.preventDefault(),W=Date.now(),o.instance._openResolved(t,n,o,i,e,!1,s))}(e,e.clientX,e.clientY))},document.addEventListener("contextmenu",R),q=e=>{const t="ContextMenu"===e.key,n="F10"===e.key&&e.shiftKey;if(!t&&!n)return;if(B)return;const s=document.activeElement;if(!s||s===document.body)return;const o=F(s,e);if(!o.length)return;const i=o[0];if(!i.instance.options.keyboardTrigger)return;const r=i.instance._assembleItems(o,e);if(!r.length&&!i.instance.options.render)return;e.preventDefault();const a=s.getBoundingClientRect();W=Date.now(),i.instance._openResolved(a.left+a.width/2,a.top+a.height/2,i,r,e,!0,o)},document.addEventListener("keydown",q),U=e=>{if(B)return;if(!e.touches||1!==e.touches.length)return;const t=e.touches[0],n=F(e.target,e);if(!n.length)return;const s=n[0],o=s.instance.options.longPress;o&&(J={x:t.clientX,y:t.clientY,target:e.target},G=setTimeout(()=>{if(G=null,Date.now()-W<400)return;const t=s.instance._assembleItems(n,e);(t.length||s.instance.options.render)&&(W=Date.now(),s.instance._openResolved(J.x,J.y,s,t,e,!1,n))},o))},K=e=>{if(!(G&&J&&e.touches&&e.touches.length))return;const t=e.touches[0];(Math.abs(t.clientX-J.x)>10||Math.abs(t.clientY-J.y)>10)&&(clearTimeout(G),G=null)},Y=()=>{G&&(clearTimeout(G),G=null)},document.addEventListener("touchstart",U,{passive:!0}),document.addEventListener("touchmove",K,{passive:!0}),document.addEventListener("touchend",Y),document.addEventListener("touchcancel",Y))}class Z extends h{static defaults={items:[],match:null,exclude:null,enabled:!0,inherit:"append",priority:0,exclusive:!1,nativeOnShift:!0,closeOnSelect:!0,closeOnEscape:!0,closeOnClickOutside:!0,closeOnScroll:!0,longPress:500,cursor:"auto",cursorSize:26,className:"",minWidth:"200px",maxWidth:"320px",maxHeight:"60vh",offset:[2,2],flip:!0,animation:!0,animationDuration:120,transition:"scale",easing:"cubic-bezier(0.16, 1, 0.3, 1)",accent:null,surface:null,radius:null,shadow:null,opacity:null,density:"comfortable",itemTemplate:null,submenuDelay:150,render:null,keyboardTrigger:!0,typeahead:!0,ariaLabel:"Context menu",model:null,modelKey:null,onBeforeOpen:null,onOpen:null,onClose:null,onSelect:null};constructor(e,t={}){super(e,t),this.selector="string"==typeof e?e:null,this._node=this.selector?null:this.element,this._menu=null,this._submenus=[],this._isOpen=!1,this._enabledFlag=!0,this._focusIndex=-1,this._renderedItems=[],this._ctx=null,this._typeaheadBuffer="",this._typeaheadTimer=null,this._submenuTimer=null,this._observableDispose=null,this._restoreFocusTo=null,this._chain=null,this._cursorId=++D,j.add(this),X(),this._applyTouchCallout(),this._applyCursor()}_applyCursor(){const{cursor:e,cursorSize:t,match:n}=this.options;if(!1===e||null===e||"undefined"==typeof document)return;let s=this.selector;if(!s){if(!this._node)return;this._node.setAttribute("data-dm-ctx-cursor",String(this._cursorId)),s=`[data-dm-ctx-cursor="${this._cursorId}"]`}const o=n?`${s} ${n}`:s;"auto"===e?z(this._cursorId,o,{kind:"keyword"}):"glyph"===e?z(this._cursorId,o,{kind:"glyph",size:t}):"string"==typeof e&&z(this._cursorId,o,{kind:"custom",value:e})}_applyTouchCallout(){this.options.longPress&&this.selector&&"undefined"!=typeof document&&document.querySelectorAll(this.selector).forEach(e=>{e.style.webkitTouchCallout="none"})}matchesContainer(e){return this.selector?H(e.matches)&&e.matches(this.selector):e===this._node}_accept(e,t,n){const s=this.options;if(s.exclude&&t.closest(s.exclude)&&e.contains(t.closest(s.exclude)))return null;let o=e;if(s.match){const n=t.closest(s.match);if(!n||!e.contains(n))return null;o=n}const i={target:o,container:e,x:n&&void 0!==n.clientX?n.clientX:0,y:n&&void 0!==n.clientY?n.clientY:0,event:n,menu:null,instance:this};return P(s.enabled,o,i)?s.onBeforeOpen&&!1===s.onBeforeOpen(i)?null:{instance:this,container:e,target:o,ctx:i}:null}_ownItems(e){const t=this.options;let n;return n=t.model&&t.modelKey&&H(t.model.get)?t.model.get(t.modelKey):P(t.items,e.target,e.ctx),Array.isArray(n)?n:[]}_assembleItems(e,t){const n=e[0],s=this._ownItems(n),o=this.options.inherit;if(!o||e.length<2)return this._filterItems(s,n);let i=[];for(let t=1;t<e.length;t++){const n=e[t],s=n.instance._filterItems(n.instance._ownItems(n),n);s.length&&(i.length&&i.push({type:"divider"}),i=i.concat(s))}const r=this._filterItems(s,n);return i.length?r.length?"prepend"===o?i.concat([{type:"divider"}],r):r.concat([{type:"divider"}],i):i:r}_filterItems(e,t){const n=e.filter(e=>!!e&&(void 0===e.visible||!!P(e.visible,t.target,t.ctx))),s=[];for(const e of n){const t="divider"===e.type||e.divider;(!t||s.length&&!s[s.length-1]._isDivider)&&s.push(t?{type:"divider",_isDivider:!0}:e)}for(;s.length&&s[s.length-1]._isDivider;)s.pop();return s}open(e,t,n){const s=n||(this.selector?document.querySelector(this.selector):this._node);if(!s)return this;const o=F(s,{clientX:e,clientY:t,target:s}),i=o.find(e=>e.instance===this)||o[0];if(!i)return this;const r=[i,...o.filter(e=>e!==i)],a=i.instance._assembleItems(r,null);return a.length||i.instance.options.render?(B&&B.close(),i.instance._openResolved(e,t,i,a,null,!1,r),this):this}_openResolved(e,t,n,s,o,i=!1,r=null){B&&B!==this&&B.close(),this._isOpen&&this.close();const a=this.options;if(this._chain=r||[n],this._ctx=n.ctx,this._ctx.x=e,this._ctx.y=t,this._renderedItems=s,this._restoreFocusTo=i?document.activeElement:null,a.render){const n=a.render(this._ctx);return n?(this._menu=n,n.parentNode||document.body.appendChild(n),n.style.position="fixed",this._applyTheme(n),n.classList.add("is-open"),this._ctx.menu=n,this._positionAt(n,e,t),this._bindOpenListeners(),this._isOpen=!0,B=this,void(a.onOpen&&a.onOpen(this._ctx))):(this._chain=null,void(this._ctx=null))}this._menu=this._createMenu(),this._renderInto(this._menu,s,n),document.body.appendChild(this._menu),this._ctx.menu=this._menu,this._positionAt(this._menu,e,t),this._bindOpenListeners(),this._isOpen=!0,B=this,N(a.items)&&(this._observableDispose=a.items.subscribe(()=>{this._isOpen&&this.refresh()})),a.animation?requestAnimationFrame(()=>{this._menu&&this._menu.classList.add("is-open")}):this._menu.classList.add("is-open"),this._menu.focus({preventScroll:!0}),i&&this._moveFocus(1),a.onOpen&&a.onOpen(this._ctx)}close(){if(!this._isOpen)return this;this._closeSubmenus(0),this._unbindOpenListeners(),this._observableDispose&&(H(this._observableDispose)?this._observableDispose():H(this._observableDispose.dispose)&&this._observableDispose.dispose(),this._observableDispose=null);const e=this._menu,t=this.options;return this._menu=null,this._isOpen=!1,this._focusIndex=-1,B===this&&(B=null),e&&(t.animation?(e.classList.remove("is-open"),setTimeout(()=>e.remove(),t.animationDuration)):e.remove()),this._restoreFocusTo&&H(this._restoreFocusTo.focus)&&this._restoreFocusTo.focus({preventScroll:!0}),this._restoreFocusTo=null,t.onClose&&t.onClose(this._ctx),this._ctx=null,this}refresh(){if(!this._isOpen||!this._ctx)return this;const e=this._chain&&this._chain.length?this._chain[0]:{instance:this,container:this._ctx.container,target:this._ctx.target,ctx:this._ctx},t=this._assembleItems(this._chain&&this._chain.length?this._chain:[e],null);return this._renderedItems=t,this._closeSubmenus(0),this._renderInto(this._menu,t,e),this._positionAt(this._menu,this._ctx.x,this._ctx.y),this}isOpen(){return this._isOpen}setItems(e){return this.options.items=e,this._isOpen&&this.refresh(),this}enable(){return this._enabledFlag=!0,this}disable(){return this._isOpen&&this.close(),this._enabledFlag=!1,this}_createMenu(e=!1){const t=this.options,n=document.createElement("div");return n.className="dm-context-menu"+(e?" dm-context-menu-sub":"")+(t.className?" "+t.className:""),n.setAttribute("role","menu"),n.setAttribute("tabindex","-1"),e||n.setAttribute("aria-label",t.ariaLabel),n.style.minWidth=t.minWidth,n.style.maxWidth=t.maxWidth,n.style.maxHeight=t.maxHeight,this._applyTheme(n),n}_applyTheme(e){const t=this.options;e.dataset.transition=t.animation?t.transition||"scale":"none","compact"===t.density&&(e.dataset.density="compact");const n=(t,n)=>{null!=n&&""!==n&&e.style.setProperty(t,n)};var s;if(n("--dm-ctx-accent",(s=t.accent)?O[s]||s:null),n("--dm-ctx-surface",t.surface),n("--dm-ctx-radius",function(e){return e?"none"===e?"0":I[e]?`var(--dm-radius-${e})`:e:null}(t.radius)),n("--dm-ctx-shadow",function(e){return e?"none"===e?"none":I[e]?`var(--dm-shadow-${e})`:e:null}(t.shadow)),n("--dm-ctx-duration",`${t.animationDuration}ms`),n("--dm-ctx-easing",t.easing),null!==t.opacity&&void 0!==t.opacity){const e=Math.min(100,Math.max(20,Number(t.opacity)||100));e<100&&n("--dm-ctx-opacity",String(e/100))}}_renderInto(e,t,n){if(!e)return;e.innerHTML="";const s=this.options;t.forEach((t,o)=>{if("divider"===t.type||t.divider){const t=document.createElement("div");return t.className="dm-context-menu-divider",t.setAttribute("role","separator"),void e.appendChild(t)}if("header"===t.type||t.header){const n=document.createElement("div");return n.className="dm-context-menu-header",n.setAttribute("role","presentation"),n.textContent=t.header||t.label||"",void e.appendChild(n)}const i=!!P(t.disabled,n.target,n.ctx),r=document.createElement("button");r.type="button",r.className="dm-context-menu-item",r.setAttribute("role","checkbox"===t.type?"menuitemcheckbox":"radio"===t.type?"menuitemradio":"menuitem"),r.setAttribute("tabindex","-1"),r.dataset.index=String(o),t.danger&&r.classList.add("is-danger");for(const e of[].concat(t.className||[]).join(" ").split(/\s+/))e&&r.classList.add(e);if(i&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0),"checkbox"===t.type||"radio"===t.type){const e=!!P(t.checked,n.target,n.ctx);r.setAttribute("aria-checked",String(e)),e&&r.classList.add("is-checked")}if(s.itemTemplate)r.innerHTML=s.itemTemplate(t,o);else{const e=document.createElement("span");e.className="dm-context-menu-icon",t.icon&&(e.setAttribute("data-icon",t.icon),e.setAttribute("data-size","16")),r.appendChild(e);const n=document.createElement("span");if(n.className="dm-context-menu-label",n.textContent=t.label||t.text||t.name||"",r.appendChild(n),t.shortcut){const e=document.createElement("span");e.className="dm-context-menu-shortcut",e.textContent=t.shortcut,r.appendChild(e)}}const a=t.submenu;if(a){r.classList.add("has-submenu"),r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false");const e=document.createElement("span");e.className="dm-context-menu-chevron",e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-size","14"),r.appendChild(e)}i||(r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),a?this._openSubmenu(r,t,n,this._depthOf(e)):this._activate(t,o)}),r.addEventListener("mouseenter",()=>{this._closeSubmenus(this._depthOf(e)),clearTimeout(this._submenuTimer),a&&(this._submenuTimer=setTimeout(()=>this._openSubmenu(r,t,n,this._depthOf(e)),s.submenuDelay))})),e.appendChild(r)}),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&H(window.Domma.icons.scan)&&window.Domma.icons.scan(e)}_depthOf(e){const t=this._submenus.indexOf(e);return-1===t?0:t+1}_openSubmenu(e,t,n,s){this._closeSubmenus(s);const o=this._filterItems(P(t.submenu,n.target,n.ctx)||[],n);if(!o.length)return;const i=this._createMenu(!0);this._renderInto(i,o,n),document.body.appendChild(i),this._submenus[s]=i;const r=e.getBoundingClientRect();this._positionAt(i,r.right,r.top,r),e.setAttribute("aria-expanded","true"),e.classList.add("is-open"),i.dataset.owner=e.dataset.index,this.options.animation?requestAnimationFrame(()=>i.classList.add("is-open")):i.classList.add("is-open")}_closeSubmenus(e){for(let t=this._submenus.length-1;t>=e;t--){const e=this._submenus[t];if(!e)continue;const n=this._menu&&void 0!==e.dataset.owner?this._menu.querySelector(`[data-index="${e.dataset.owner}"]`):null;n&&(n.setAttribute("aria-expanded","false"),n.classList.remove("is-open")),e.remove(),this._submenus.splice(t,1)}}_activate(e,t){const n=this._ctx,s=this.options;s.onSelect&&s.onSelect(e,n),H(e.action)&&e.action(n?n.target:null,n),s.closeOnSelect&&this.close()}_positionAt(e,t,n,s=null){const o=this.options,[i,r]=o.offset,a=e.offsetWidth,l=e.offsetHeight,d=document.documentElement.clientWidth,c=document.documentElement.clientHeight;let h=t+i,u=n+r;if(o.flip){if(h+a>d-8){const e=s?s.left-a:t-a-i;e>=8&&(h=e)}if(u+l>c-8){const e=s?n-l+s.height:n-l-r;e>=8&&(u=e)}}h=a<=d-16?Math.max(8,Math.min(h,d-a-8)):8,u=l<=c-16?Math.max(8,Math.min(u,c-l-8)):8,e.style.left=h+"px",e.style.top=u+"px"}_bindOpenListeners(){const e=this.options;this._outsideHandler=e=>{this._isOpen&&(this._menu&&this._menu.contains(e.target)||this._submenus.some(t=>t&&t.contains(e.target))||this.close())},e.closeOnClickOutside&&document.addEventListener("mousedown",this._outsideHandler,!0),this._contextHandler=e=>{this._menu&&this._menu.contains(e.target)&&e.preventDefault()},document.addEventListener("contextmenu",this._contextHandler),this._keyHandler=e=>this._onKeyDown(e),document.addEventListener("keydown",this._keyHandler,!0),e.closeOnScroll&&(this._scrollHandler=()=>this.close(),window.addEventListener("scroll",this._scrollHandler,!0)),this._resizeHandler=()=>this.close(),window.addEventListener("resize",this._resizeHandler)}_unbindOpenListeners(){this._outsideHandler&&(document.removeEventListener("mousedown",this._outsideHandler,!0),this._outsideHandler=null),this._contextHandler&&(document.removeEventListener("contextmenu",this._contextHandler),this._contextHandler=null),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,!0),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),clearTimeout(this._submenuTimer),clearTimeout(this._typeaheadTimer)}_focusableItems(){const e=this._submenus.length?this._submenus[this._submenus.length-1]:this._menu;return e?Array.from(e.querySelectorAll(".dm-context-menu-item:not(.is-disabled)")):[]}_moveFocus(e){const t=this._focusableItems();if(!t.length)return;let n=t.indexOf(document.activeElement)+e;n<0&&(n=t.length-1),n>=t.length&&(n=0),t[n].focus({preventScroll:!0})}_onKeyDown(e){if(!this._isOpen)return;const t=this.options;switch(e.key){case"Escape":if(!t.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void(this._submenus.length?this._closeSubmenus(this._submenus.length-1):this.close());case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"Home":{e.preventDefault();const t=this._focusableItems()[0];return void(t&&t.focus({preventScroll:!0}))}case"End":{e.preventDefault();const t=this._focusableItems();return void(t.length&&t[t.length-1].focus({preventScroll:!0}))}case"ArrowRight":{const t=document.activeElement;return void(t&&t.classList.contains("has-submenu")&&(e.preventDefault(),t.click(),requestAnimationFrame(()=>this._moveFocus(1))))}case"ArrowLeft":if(this._submenus.length){e.preventDefault(),this._closeSubmenus(this._submenus.length-1);const t=this._focusableItems();t.length&&t[0].focus({preventScroll:!0})}return;case"Enter":case" ":{const t=document.activeElement;return void(t&&t.classList.contains("dm-context-menu-item")&&(e.preventDefault(),t.click()))}}!t.typeahead||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||this._typeahead(e.key)}_typeahead(e){clearTimeout(this._typeaheadTimer),this._typeaheadBuffer+=e.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeaheadBuffer=""},600);const t=this._focusableItems().find(e=>{const t=e.querySelector(".dm-context-menu-label");return t&&t.textContent.toLowerCase().startsWith(this._typeaheadBuffer)});t&&t.focus({preventScroll:!0})}destroy(){var e;this.close(),j.delete(this),e=this._cursorId,(L.delete(e)||C.delete(e))&&($(),S()),this._node&&this._node.getAttribute("data-dm-ctx-cursor")===String(this._cursorId)&&this._node.removeAttribute("data-dm-ctx-cursor"),T&&!j.size&&(T=!1,document.removeEventListener("contextmenu",R),document.removeEventListener("keydown",q),document.removeEventListener("touchstart",U),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",Y),document.removeEventListener("touchcancel",Y),R=q=U=K=Y=null),super.destroy()}}Z.closeAll=function(){B&&B.close()},Z.active=function(){return B},Z.registry=function(e=null){return e?V(e).map(e=>e.instance):Array.from(j)};const Q={_prefix:"domma:",_available:null,isAvailable(){if(null!==this._available)return this._available;try{const e=`${this._prefix}__test__`;localStorage.setItem(e,"test"),localStorage.removeItem(e),this._available=!0}catch(e){this._available=!1}return this._available},_prefixKey(e){return`${this._prefix}${e}`},_unprefixKey(e){return e.slice(this._prefix.length)},get(e,t=null){if(!this.isAvailable())return t;try{const n=this._prefixKey(e),s=localStorage.getItem(n);return null===s?t:JSON.parse(s)}catch(n){return console.warn(`Domma storage: Failed to parse key "${e}"`,n),t}},set(e,t){if(!this.isAvailable())return!1;try{const n=this._prefixKey(e),s=JSON.stringify(t);return localStorage.setItem(n,s),!0}catch(t){return console.warn(`Domma storage: Failed to set key "${e}"`,t),!1}},remove(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return localStorage.removeItem(t),!0}catch(t){return console.warn(`Domma storage: Failed to remove key "${e}"`,t),!1}},has(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return null!==localStorage.getItem(t)}catch(e){return!1}},clear(){if(!this.isAvailable())return 0;try{const e=this.keys();return e.forEach(e=>this.remove(e)),e.length}catch(e){return console.warn("Domma storage: Failed to clear storage",e),0}},keys(){if(!this.isAvailable())return[];try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith(this._prefix)&&e.push(this._unprefixKey(n))}return e}catch(e){return[]}},size(e){if(!this.isAvailable())return 0;try{const t=this._prefixKey(e),n=localStorage.getItem(t);return n?new Blob([n]).size:0}catch(e){return 0}},totalSize(){if(!this.isAvailable())return 0;try{let e=0;return this.keys().forEach(t=>{e+=this.size(t)}),e}catch(e){return 0}},getAll(){if(!this.isAvailable())return{};const e={};return this.keys().forEach(t=>{e[t]=this.get(t)}),e},setAll(e){if(!this.isAvailable()||!e)return!1;let t=!0;return Object.keys(e).forEach(n=>{this.set(n,e[n])||(t=!1)}),t}},ee="sortable:",te='input, textarea, select, button, option, a[href], [contenteditable=""], [contenteditable="true"]',ne=e=>"function"==typeof e;class se extends h{static defaults={items:null,handle:null,nest:!1,live:null,axis:"y",key:"data-id",animation:200,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)",threshold:4,touchDelay:220,nestZone:.5,accepts:null,disabled:!1,keyboard:!0,persist:!1,autoScroll:!0,ghostParent:null,onStart:null,onMove:null,onSort:null,onDrop:null,onCancel:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._drag=null,this._pending=null,this._animating=new WeakSet,this._flips=new WeakMap,this._docHandlers=[],this.element.classList.add("dm-sortable"),this._markHandles(),"undefined"!=typeof MutationObserver&&(this._observer=new MutationObserver(()=>this._markHandles()),this._observer.observe(this.element,{childList:!0,subtree:!0})),this._addEventListener(this.element,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this.element,"dragstart",e=>{(this._pending||this._drag)&&e.preventDefault()}),this.options.persist&&this._isLive()&&this.restore())}toArray(){return this._items().map(e=>this._keyOf(e))}sort(e,{animate:t=!0}={}){const n=()=>{const t=this._items(),n=new Map(e.map((e,t)=>[String(e),t])),s=t.filter(e=>n.has(this._keyOf(e)));if(!s.length)return;const o=[...s].sort((e,t)=>n.get(this._keyOf(e))-n.get(this._keyOf(t)));s.map(e=>{const t=document.createComment("");return e.before(t),t}).forEach((e,t)=>{e.replaceWith(o[t])})};return t?this.animate(n):n(),this}restore(){const e=this._storageKey()?Q.get(this._storageKey()):null;return Array.isArray(e)&&e.length&&this.sort(e,{animate:!1}),this}forget(){const e=this._storageKey();return e&&Q.remove(e),this}animate(e){const t=this._snapshot(),n=e();return n&&ne(n.then)?n.then(e=>(this._playFlip(t),e)):(this._playFlip(t),n)}enable(){return this.options.disabled=!1,this.element?.classList.remove("dm-sortable-disabled"),this}disable(){return this._drag&&this._cancel(),this.options.disabled=!0,this.element?.classList.add("dm-sortable-disabled"),this}get dragging(){return!!this._drag}destroy(){this._drag&&this._finish(!1),this._clearPending(),this._observer?.disconnect(),this._liveRegion?.remove(),this.element&&(this.element.classList.remove("dm-sortable","dm-sortable-disabled","dm-sortable-active"),this.element.querySelectorAll(".dm-sortable-handle").forEach(e=>e.classList.remove("dm-sortable-handle"))),super.destroy()}_applyOptions(){this._markHandles(),this.element?.classList.toggle("dm-sortable-disabled",!!this.options.disabled)}_isLive(){return null==this.options.live?!this.options.nest:!!this.options.live}_items(){const e=this.element;if(!e)return[];return(this.options.items?Array.from(e.querySelectorAll(this.options.items)):Array.from(e.children)).filter(t=>!t.classList.contains("dm-sortable-ghost")&&!t.classList.contains("dm-sortable-indicator")&&!t.classList.contains("dm-sortable-live")&&this._ownerOf(t)===e)}_ownerOf(e){let t=e.parentElement;for(;t&&!t.classList.contains("dm-sortable");)t=t.parentElement;return t}_itemFrom(e){if(!(e instanceof Element))return null;const t=this._items();let n=e;for(;n&&n!==this.element;){if(t.includes(n))return n;n=n.parentElement}return null}_keyOf(e){const t=this.options.key,n=t?e.getAttribute(t):null;return null==n?null:String(n)}_byKey(e){return null==e?null:this._items().find(t=>this._keyOf(t)===e)||null}_markHandles(){this.element&&this.options.handle&&this.element.querySelectorAll(this.options.handle).forEach(e=>{e.classList.contains("dm-sortable-handle")||e.classList.add("dm-sortable-handle")})}_storageKey(){const e=this.options.persist;return e?!0===e?this.element?.id?ee+this.element.id:null:ee+e:null}_duration(){return function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animation)||0)}_onPointerDown(e){if(this.options.disabled||this._drag||this._pending||0!==e.button||e._dmSortable)return;const t=this._itemFrom(e.target);if(!t)return;e._dmSortable=!0;const{handle:n}=this.options;if(n){const s=e.target.closest(n);if(!s||!t.contains(s))return;e.preventDefault()}else if(e.target.closest(te)&&e.target.closest(te)!==t)return;const s="touch"===e.pointerType&&!n;this._pending={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,ready:!s,timer:null},s&&(this._pending.timer=setTimeout(()=>{this._pending&&(this._pending.ready=!0,this._guard(()=>this._begin(this._pending.startX,this._pending.startY)))},this.options.touchDelay)),this._listenDoc("pointermove",e=>this._guard(()=>this._onPointerMove(e))),this._listenDoc("pointerup",e=>this._guard(()=>this._onPointerUp(e))),this._listenDoc("pointercancel",e=>this._guard(()=>this._onPointerCancel(e))),this._listenDoc("keydown",e=>{"Escape"===e.key&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._guard(()=>this._cancel()))},!0),this._listenDoc("contextmenu",e=>{this._drag&&e.preventDefault()},!0),this._listenWin("blur",()=>this._guard(()=>{this._drag?this._cancel():this._clearPending()})),this._listenDoc("touchmove",e=>{this._drag&&e.preventDefault()},{passive:!1})}_onPointerMove(e){const t=this._pending;if(t&&e.pointerId===t.pointerId&&!this._drag){const n=Math.hypot(e.clientX-t.startX,e.clientY-t.startY);if(!t.ready)return void(n>8&&this._clearPending());if(n<this.options.threshold)return;this._begin(t.startX,t.startY)}if(this._drag&&e.pointerId===this._drag.pointerId){if("mouse"===e.pointerType&&0===e.buttons)return void this._onPointerUp(e);e.preventDefault(),this._moveTo(e.clientX,e.clientY)}}_guard(e){try{return e()}catch(e){if(this._drag){try{this._cancel()}catch{}this._drag&&this._finish(!1)}else this._clearPending();throw e}}_onPointerUp(e){if(this._drag&&e.pointerId===this._drag.pointerId)return this._moveTo(e.clientX,e.clientY),void this._drop();this._clearPending()}_onPointerCancel(e){this._drag&&e.pointerId===this._drag.pointerId?this._cancel():this._clearPending()}_listenDoc(e,t,n){document.addEventListener(e,t,n),this._docHandlers.push({target:document,event:e,handler:t,opts:n})}_listenWin(e,t,n){window.addEventListener(e,t,n),this._docHandlers.push({target:window,event:e,handler:t,opts:n})}_unlistenDoc(){for(const{target:e,event:t,handler:n,opts:s}of this._docHandlers)e.removeEventListener(t,n,s);this._docHandlers=[]}_clearPending(){this._pending?.timer&&clearTimeout(this._pending.timer),this._pending=null,this._drag||this._unlistenDoc()}_begin(e,t){const{item:n,pointerId:s}=this._pending;this._pending.timer&&clearTimeout(this._pending.timer),this._pending=null;const o=n.getBoundingClientRect(),i=this._items(),r=n.cloneNode(!0);r.removeAttribute("id"),this.options.key&&r.removeAttribute(this.options.key),r.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),r.classList.add("dm-sortable-ghost"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,{position:"fixed",left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`,margin:"0",boxSizing:"border-box",pointerEvents:"none",transform:"translate3d(0, 0, 0)"}),(this.options.ghostParent||this.element).appendChild(r),requestAnimationFrame(()=>r.classList.add("dm-sortable-ghost-lifted")),n.classList.add("dm-sortable-placeholder"),this.element.classList.add("dm-sortable-active"),document.documentElement.classList.add("dm-sortable-dragging");try{window.getSelection?.().removeAllRanges()}catch{}if(this._drag={item:n,pointerId:s,ghost:r,rect:o,offsetX:e-o.left,offsetY:t-o.top,x:e,y:t,from:i.indexOf(n),previous:i.map(e=>this._keyOf(e)),origin:{parent:n.parentNode,next:n.nextSibling},key:this._keyOf(n),target:null,zone:null,indicator:null,scrollRaf:null},!this._isLive()){const e=document.createElement("div");e.className="dm-sortable-indicator",e.setAttribute("aria-hidden","true"),this.element.appendChild(e),this._drag.indicator=e}this._emit("start",{item:n,from:this._drag.from}),this.options.autoScroll&&this._scrollLoop()}_moveTo(e,t){const n=this._drag;if(!n||n.settling)return;n.x=e,n.y=t,n.ghost.style.transform=`translate3d(${e-n.offsetX-n.rect.left}px, ${t-n.offsetY-n.rect.top}px, 0)`;const s=document.elementFromPoint(e,t),o=s?this._itemFrom(s):null;this._isLive()?o&&o!==n.item&&!this._animating.has(o)&&this._liveSwap(o,e,t):this._indicate(o,e,t),this._emit("move",{item:n.item,target:n.target||o,zone:n.zone,x:e,y:t})}_liveSwap(e,t,n){const s=this._drag,o=this._items(),i=o.indexOf(s.item),r=o.indexOf(e);if(i<0||r<0)return;const a=s.item.getBoundingClientRect(),l=e.getBoundingClientRect(),d="x"===this.options.axis,c=d?t:n,h=d?a.width:a.height,u=d?l.left:l.top,p=d?l.right:l.bottom,m=i<r;(m?c>p-h:c<u+h)&&(this.options.accepts&&!this.options.accepts(s.item,e,m?"after":"before")||this._flipItems(()=>{m?e.after(s.item):e.before(s.item)}))}_zoneFor(e,t,n){const s=e.getBoundingClientRect(),o="x"===this.options.axis,i=o?s.width:s.height,r=i?(o?t-s.left:n-s.top)/i:.5;if(this.options.nest){const e=(1-Math.min(Math.max(this.options.nestZone,0),1))/2;return r<e?"before":r>1-e?"after":"into"}return r<.5?"before":"after"}_indicate(e,t,n){const s=this._drag;let o=null;if(e&&e!==s.item&&(o=this._zoneFor(e,t,n),this.options.accepts&&!this.options.accepts(s.item,e,o)))if("into"===o){const i=e.getBoundingClientRect(),r="x"===this.options.axis?i.left+i.width/2:i.top+i.height/2;o=("x"===this.options.axis?t:n)<r?"before":"after",this.options.accepts(s.item,e,o)||(o=null)}else o=null;o||(e=null),s.target===e&&s.zone===o||(s.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),e&&e.classList.add("dm-sortable-over",`dm-sortable-over-${o}`),s.target=e,s.zone=o),this._placeIndicator()}_placeIndicator(){const e=this._drag,t=e?.indicator;if(!t)return;if(!e.target)return void t.classList.remove("is-visible");const n=e.target.getBoundingClientRect(),s="x"===this.options.axis;let o;o="into"===e.zone?{left:n.left,top:n.top,width:n.width,height:n.height}:s?{left:("before"===e.zone?n.left:n.right)-1.5,top:n.top,width:3,height:n.height}:{left:n.left,top:("before"===e.zone?n.top:n.bottom)-1.5,width:n.width,height:3};const i=!t.classList.contains("is-visible");i&&(t.style.transition="none"),Object.assign(t.style,{left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`}),t.classList.toggle("is-into","into"===e.zone),t.classList.add("is-visible"),i&&(t.offsetWidth,t.style.transition="")}_drop(){const e=this._drag;if(!e)return;if(this._suppressClick(),this._isLive()){const t=this.toArray(),n=this._items().indexOf(e.item),s=n!==e.from;return this._finish(!0),s&&(this._save(t),this._emit("sort",{item:e.item,from:e.from,to:n,order:t,previous:e.previous})),void this._emit("end",{item:e.item,changed:s})}const{target:t,zone:n}=e;if(!t||!n)return void this._cancel();const s={item:e.item,target:t,zone:n,key:e.key,targetKey:this._keyOf(t)};this._unlistenDoc(),e.scrollRaf&&cancelAnimationFrame(e.scrollRaf),e.settling=!0;let o=!0;const i=this.animate(()=>{if(ne(this.options.onDrop)){const e=this.options.onDrop(s);return!1===e&&(o=!1),e}"before"===n?t.before(e.item):"after"===n&&t.after(e.item)});this._dispatch("drop",s);const r=()=>{this._drag===e&&(o?(this._finish(!0),this._emit("end",{item:e.item,changed:!0})):this._cancel())};i&&ne(i.then)?i.then(r,()=>{this._drag===e&&this._cancel()}):r()}_cancel(){const e=this._drag;e&&(this._isLive()&&this._flipItems(()=>{e.origin.parent&&e.origin.parent.insertBefore(e.item,e.origin.next?.parentNode===e.origin.parent?e.origin.next:null)}),this._finish(!1),this._emit("cancel",{item:e.item}),this._emit("end",{item:e.item,changed:!1}))}_finish(e){const t=this._drag;if(!t)return;this._drag=null,this._unlistenDoc(),t.scrollRaf&&cancelAnimationFrame(t.scrollRaf),t.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),t.indicator?.remove(),this.element?.classList.remove("dm-sortable-active"),document.documentElement.classList.remove("dm-sortable-dragging");const n=(e&&null!=t.key?this._byKey(t.key):null)||(t.item.isConnected?t.item:null);t.item!==n&&t.item.classList.remove("dm-sortable-placeholder");const s=t.ghost,o=this._duration();if(!n||!o)return s.remove(),n?.classList.remove("dm-sortable-placeholder"),void(n&&this._announce(n));s.isConnected||(this.options.ghostParent||this.element).appendChild(s),n.classList.add("dm-sortable-placeholder","dm-sortable-landing");const i=n.getBoundingClientRect();s.style.transition=`transform ${o}ms ${this.options.easing}, width ${o}ms ${this.options.easing}, height ${o}ms ${this.options.easing}, scale ${o}ms ${this.options.easing}, box-shadow ${o}ms ${this.options.easing}`,s.classList.remove("dm-sortable-ghost-lifted"),s.style.transform=`translate3d(${i.left-t.rect.left}px, ${i.top-t.rect.top}px, 0)`,s.style.width=`${i.width}px`,s.style.height=`${i.height}px`;let r=!1;const a=()=>{r||(r=!0,s.remove(),n.classList.remove("dm-sortable-placeholder","dm-sortable-landing"),this._announce(n))};s.addEventListener("transitionend",e=>{"transform"===e.propertyName&&a()}),setTimeout(a,o+80)}_suppressClick(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,!0),setTimeout(()=>document.removeEventListener("click",e,!0),0)}_scrollLoop(){const e=this._drag;if(!e)return;const t="x"===this.options.axis?"x":"y",n=function(e,t){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const e=getComputedStyle(n),s="x"===t?e.overflowX:e.overflowY;if(("x"===t?n.scrollWidth>n.clientWidth:n.scrollHeight>n.clientHeight)&&/(auto|scroll|overlay)/.test(s))return n;n=n.parentElement}return null}(this.element,t),s=()=>{if(this._drag!==e||e.settling)return;const o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},i="x"===t?e.x:e.y,r="x"===t?o.left:o.top,a="x"===t?o.right:o.bottom;let l=0;if(i<r+48?l=-Math.ceil(18*(1-Math.max(i-r,0)/48)):i>a-48&&(l=Math.ceil(18*(1-Math.max(a-i,0)/48))),l){const s=n||window;"x"===t?s.scrollBy(l,0):s.scrollBy(0,l),this._moveTo(e.x,e.y)}e.scrollRaf=requestAnimationFrame(s)};e.scrollRaf=requestAnimationFrame(s)}_onKeyDown(e){if(!this.options.keyboard||this.options.disabled||this._drag||!this._isLive()||!e.altKey)return;const t="x"===this.options.axis,n=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";if(e.key!==n&&e.key!==s)return;const o=this._itemFrom(e.target);if(!o||e.target!==o&&(!this.options.handle||!e.target.closest(this.options.handle)))return;const i=this._items(),r=i.indexOf(o),a=e.key===n?r-1:r+1;if(a<0||a>=i.length)return;const l=i[a];if(this.options.accepts&&!this.options.accepts(o,l,e.key===n?"before":"after"))return;e.preventDefault();const d=i.map(e=>this._keyOf(e));this._flipItems(()=>{e.key===n?l.before(o):l.after(o)}),e.target.focus();const c=this.toArray();this._save(c),this._emit("sort",{item:o,from:r,to:a,order:c,previous:d}),this._emit("end",{item:o,changed:!0}),this._announce(o)}_announce(e){const t=this._items(),n=t.indexOf(e);if(!(n<0)){if(!this._liveRegion){const e=document.createElement("div");e.className="dm-sortable-live",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),this._liveRegion=e}this._liveRegion.textContent=`Moved to position ${n+1} of ${t.length}`}}_snapshot({withDragged:e=!1}={}){const t=new Map,n=this._drag;for(const s of this._items()){if(n&&s===n.item&&!e)continue;const o=s.getBoundingClientRect();t.set(s,o);const i=this._keyOf(s);null!=i&&t.set(`key:${i}`,o)}return t}_playFlip(e){const t=this._duration();if(t)for(const n of this._items()){const s=this._keyOf(n),o=e.get(n)||(null!=s?e.get(`key:${s}`):null);if(!o||!ne(n.animate))continue;const i=n.getBoundingClientRect(),r=o.left-i.left,a=o.top-i.top;if(Math.abs(r)<.5&&Math.abs(a)<.5)continue;this._flips.get(n)?.cancel(),this._animating.add(n);const l=n.animate([{transform:`translate(${r}px, ${a}px)`},{transform:"translate(0, 0)"}],{duration:t,easing:this.options.easing});this._flips.set(n,l);const d=()=>{this._flips.get(n)===l&&(this._flips.delete(n),this._animating.delete(n))};l.onfinish=d,l.oncancel=d}}_flipItems(e){const t=this._snapshot({withDragged:!0});e(),this._playFlip(t)}_save(e){const t=this._storageKey();t&&this._isLive()&&Q.set(t,e.filter(e=>null!=e))}_emit(e,t){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];ne(n)&&n(t),this._dispatch(e,t)}_dispatch(e,t){this.element?.dispatchEvent(new CustomEvent(`sortable:${e}`,{detail:t,bubbles:!0}))}}const oe="input-group-icon",ie=/^[a-z0-9-]+$/i,re=/^(text|search|email|url|tel|password|number|date|datetime-local|time|month|week)$/,ae=/^(text|search|email|url|tel|password)$/;let le=0;function de(e){return null==e||!1===e||""===e?null:"string"==typeof e||"number"==typeof e?{text:String(e)}:"object"!=typeof e?null:e.icon&&ie.test(e.icon)?{icon:e.icon}:null!=e.text&&""!==e.text?{text:String(e.text)}:null}function ce(){return"undefined"!=typeof window&&(window.Domma?.icons||window.I)||null}function he(e,t){e.textContent="";const n=document.createElement("span");n.setAttribute("data-icon",t),n.setAttribute("aria-hidden","true"),e.appendChild(n),ce()?.scan?.(e)}function ue(e,t){const n=document.createElement("span");if(n.className=`input-group-addon input-group-addon-${t}`,n.setAttribute("aria-hidden","true"),e.icon){const t=document.createElement("span");t.setAttribute("data-icon",e.icon),n.appendChild(t)}else n.textContent=e.text;return n}function pe(e,t,n,s){const o=document.createElement("button");return o.type="button",o.className=`input-group-btn input-group-btn-${t} input-group-${e}`,o.setAttribute("aria-label",n),he(o,s),o}function me(e){const t=String(e),n=t.match(/e-(\d+)$/i);if(n)return Number(n[1]);const s=t.indexOf(".");return-1===s?0:t.length-s-1}function fe(e,t){const n=e.getAttribute(t);if(null==n||""===n||"any"===n)return null;const s=Number(n);return Number.isFinite(s)?s:null}class ge extends h{static defaults={prefix:null,suffix:null,reveal:!1,clear:!1,stepper:!1,counter:!1,labels:{reveal:"Show password",clear:"Clear",decrease:"Decrease",increase:"Increase"}};constructor(e,t={}){if(super(e,t),this.options.labels={...ge.defaults.labels,...t.labels||{}},this.input=this.element,this._extraHandlers=[],this._timers={},this.extras={},!this.input)return;const n=this.input.parentElement;this._ownsWrapper=!(n&&n.classList.contains(oe)),this._ownsWrapper?(this.wrapper=document.createElement("div"),this.wrapper.className=oe,this.input.before(this.wrapper),this.wrapper.appendChild(this.input)):this.wrapper=n,this._manageAddons=this._ownsWrapper||"prefix"in t||"suffix"in t,this._render(),this._buildExtras()}update(e={}){const{prefix:t,suffix:n}=e;let s=!1;void 0!==t&&(this.options.prefix=t,s=!0),void 0!==n&&(this.options.suffix=n,s=!0),s&&(this._manageAddons=!0,this._render());const o=["reveal","clear","stepper","counter"].filter(t=>void 0!==e[t]);return o.length||e.labels?(o.forEach(t=>{this.options[t]=e[t]}),e.labels&&(this.options.labels={...this.options.labels,...e.labels}),this._teardownExtras(),this._buildExtras()):this._syncEdges(),this}refresh(){const e=this.extras;if(!e||!this.input)return this;const t=this.input,n=t.disabled||t.readOnly;if(e.clear&&(e.clear.hidden=n||""===t.value),e.reveal&&(e.reveal.disabled=t.disabled),e.decrease){const{min:s,max:o}=this._limits(),i=""===t.value?null:Number(t.value),r=null!=i&&Number.isFinite(i);e.decrease.disabled=n||r&&null!=s&&i<=s,e.increase.disabled=n||r&&null!=o&&i>=o,[e.decrease,e.increase].forEach(e=>{e.disabled&&document.activeElement===e&&t.focus()}),e.decrease.disabled&&e.increase.disabled&&this._stopRepeat()}if(e.counter){const n=this._counterLimit(),s=t.value.length;e.counter.textContent=n?`${s} / ${n}`:String(s),e.counter.classList.toggle("is-warning",!!n&&s>=Math.ceil(.9*n)&&s<=n),e.counter.classList.toggle("is-over",!!n&&s>n)}return this._syncEdges(),this}_applyOptions(){this.options.labels={...ge.defaults.labels,...this.options.labels||{}},this._render(),this._teardownExtras(),this._buildExtras()}_render(){const e=this.wrapper;if(e){if(this._manageAddons){e.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove());const t=de(this.options.prefix),n=de(this.options.suffix);t&&e.prepend(ue(t,"left")),n&&e.append(ue(n,"right")),(t&&t.icon||n&&n.icon)&&ce()?.scan?.(e)}this._syncEdges()}}_syncEdges(){const e=this.wrapper;if(!e||!this.input)return;const t=e=>e&&!e.hidden;let n=!1,s=!1;for(let e=this.input.previousElementSibling;e;e=e.previousElementSibling)if(t(e)){n=!0;break}for(let e=this.input.nextElementSibling;e;e=e.nextElementSibling)if(t(e)){s=!0;break}e.classList.toggle("has-addon-left",n),e.classList.toggle("has-addon-right",s)}_listen(e,t,n,s){e.addEventListener(t,n,s),this._extraHandlers.push({el:e,event:t,handler:n,opts:s})}_limits(){return{min:fe(this.input,"min"),max:fe(this.input,"max"),step:fe(this.input,"step")}}_counterLimit(){const e=this.options.counter;if("number"==typeof e&&e>0)return e;const t=this.input.maxLength;return t>0?t:null}_buildExtras(){const e=this.input,t=this.wrapper;if(!e||!t)return;const n=this.options,s=n.labels,o=e.tagName.toLowerCase(),i="textarea"===o?"textarea":(e.getAttribute("type")||"text").toLowerCase(),r="password"===i,a={},l=[];if(n.stepper&&"number"===i&&(a.decrease=pe("decrease","left",s.decrease,"minus"),a.increase=pe("increase","right",s.increase,"plus"),e.before(a.decrease),this._bindStep(a.decrease,-1),this._bindStep(a.increase,1)),n.clear&&("textarea"===o||re.test(i))&&(a.clear=pe("clear","right",s.clear,"x"),l.push(a.clear),this._listen(a.clear,"mousedown",e=>e.preventDefault()),this._listen(a.clear,"click",()=>{e.value="",this._emit(),e.focus(),this.refresh()})),n.reveal&&r&&(a.reveal=pe("reveal","right",s.reveal,"eye"),a.reveal.setAttribute("aria-pressed","false"),l.push(a.reveal),this._listen(a.reveal,"mousedown",e=>e.preventDefault()),this._listen(a.reveal,"click",()=>this._setRevealed("true"!==a.reveal.getAttribute("aria-pressed")))),a.increase&&l.push(a.increase),l.length&&e.after(...l),e.id&&Object.values(a).forEach(t=>t.setAttribute("aria-controls",e.id)),n.counter&&("textarea"===o||ae.test(i))){a.counter=document.createElement("div"),a.counter.className="form-counter",a.counter.id=`${e.id||"input"}-counter-${++le}`,a.counter.setAttribute("aria-live","polite"),t.after(a.counter);const n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);this._describedBy=e.getAttribute("aria-describedby"),e.setAttribute("aria-describedby",[...n,a.counter.id].join(" "))}this.extras=a,Object.keys(a).length&&(this._listen(e,"input",()=>this.refresh()),this._listen(e,"change",()=>this.refresh()),e.form&&this._listen(e.form,"reset",()=>{a.reveal&&this._setRevealed(!1),this._timers.reset=setTimeout(()=>this.refresh(),0)})),this.refresh()}_setRevealed(e){const t=this.extras?.reveal;t&&(this.input.type=e?"text":"password",t.setAttribute("aria-pressed",e?"true":"false"),he(t,e?"eye-off":"eye"))}_emit(){this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0}))}step(e){const t=this.input;if(!t||t.disabled||t.readOnly)return this;const{min:n,max:s,step:o}=this._limits(),i=o&&o>0?o:1,r=null!=n?n:0,a=Math.max(me(i),me(r)),l=""!==t.value&&Number.isFinite(Number(t.value))?Number(t.value):null,d=((l??0)-r)/i;let c=r+(e>0?Math.floor(d+1e-9)+1:Math.ceil(d-1e-9)-1)*i;return null!=n&&c<n&&(c=n),null!=s&&c>s&&(c=s),c=Number(c.toFixed(a)),l!==c&&(t.value=String(c),this._emit()),this.refresh(),this}_bindStep(e,t){this._listen(e,"pointerdown",n=>{0!==n.button||e.disabled||(n.preventDefault(),this._pointerStepped=!0,this.step(t),this._stopRepeat(),this._timers.delay=setTimeout(()=>{this._timers.repeat=setInterval(()=>{e.disabled?this._stopRepeat():this.step(t)},70)},400))}),["pointerup","pointerleave","pointercancel","blur"].forEach(t=>{this._listen(e,t,()=>this._stopRepeat())}),this._listen(e,"click",e=>{e.detail>0&&this._pointerStepped?this._pointerStepped=!1:this.step(t)})}_stopRepeat(){clearTimeout(this._timers.delay),clearInterval(this._timers.repeat),this._timers.delay=this._timers.repeat=null}_teardownExtras(){this._stopRepeat(),clearTimeout(this._timers.reset);for(const{el:e,event:t,handler:n,opts:s}of this._extraHandlers)e.removeEventListener(t,n,s);this._extraHandlers=[];const e=this.extras||{};e.reveal&&this.input&&(this.input.type="password"),e.counter&&this.input&&(this._describedBy?this.input.setAttribute("aria-describedby",this._describedBy):this.input.removeAttribute("aria-describedby")),Object.values(e).forEach(e=>e.remove()),this.extras={},this._syncEdges()}destroy(){this._teardownExtras(),this.wrapper&&(this._manageAddons&&this.wrapper.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove()),this._syncEdges(),this._ownsWrapper&&this.wrapper.parentNode&&(this.wrapper.before(this.input),this.wrapper.remove())),this.wrapper=null,super.destroy()}}const ve=new Set(["text","card","list","table","custom"]),be={type:"text",lines:null,count:null,rows:5,columns:4,header:!0,avatar:!0,image:!0,animate:!0,template:null,label:"Loading..."},_e=new WeakMap;function ye(e){return e?"string"==typeof e?document.querySelector(e):1===e.nodeType?e:"number"==typeof e.length&&e[0]&&1===e[0].nodeType?e[0]:null:null}function ke(e,t){const n=parseInt(e,10);return Number.isFinite(n)&&n>0?Math.min(n,100):t}function we(e,t){let n="";for(let s=0;s<e;s++)n+=t(s);return n}function xe(e,t=""){const n=t?` ${t}`:"";return`<div class="skeleton-lines">${we(e,()=>`<div class="skeleton skeleton-text${n}"></div>`)}</div>`}function Me(e={}){const t={...be,...e};switch(ve.has(t.type)?t.type:"text"){case"card":{const e=ke(t.lines,3);return we(ke(t.count,1),()=>'<div class="skeleton-card">'+(t.image?'<div class="skeleton skeleton-image"></div>':"")+'<div class="skeleton-card-body"><div class="skeleton skeleton-heading"></div>'+xe(e)+"</div></div>")}case"list":{const e=ke(t.lines,2);return'<div class="skeleton-list">'+we(ke(t.count,3),()=>'<div class="skeleton-list-item">'+(t.avatar?'<div class="skeleton skeleton-circle"></div>':"")+'<div class="skeleton-list-item-content"><div class="skeleton skeleton-text skeleton-w-50"></div>'+we(e-1,()=>'<div class="skeleton skeleton-text skeleton-text-sm skeleton-w-75"></div>')+"</div></div>")+"</div>"}case"table":{const e=ke(t.columns,4),n=t=>we(e,()=>`<div class="skeleton skeleton-text${t}"></div>`);return`<div class="skeleton-table" style="--dm-skeleton-columns: ${e}">`+(t.header?`<div class="skeleton-table-row skeleton-table-head">${n(" skeleton-w-50")}</div>`:"")+we(ke(t.rows,5),()=>`<div class="skeleton-table-row">${n("")}</div>`)+"</div>"}case"custom":{const e="function"==typeof t.template?t.template(t):t.template;return null==e?"":String(e)}default:return we(ke(t.count,1),()=>xe(ke(t.lines,3)))}}function Le(e){const t=e.dataset||{},n={};t.skeleton&&ve.has(t.skeleton)&&(n.type=t.skeleton);for(const e of["lines","count","rows","columns"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["avatar","image","animate","header"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return t.skeletonLabel&&(n.label=t.skeletonLabel),n}function Ce(e,t={}){const n=ye(e);if(!n)return null;const s=_e.get(n);s&&s.remove();const o={...be,...Le(n),...t},i=document.createDocumentFragment();for(;n.firstChild;)i.appendChild(n.firstChild);const r=document.createElement("template");r.innerHTML=Me(o);const a=Array.from(r.content.childNodes);for(const e of a)1===e.nodeType&&(e.setAttribute("aria-hidden","true"),o.animate||e.classList.add("skeleton-static"));const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),n.appendChild(r.content),n.appendChild(l),setTimeout(()=>{l.parentNode===n&&(l.textContent=o.label)},100),n.setAttribute("aria-busy","true"),n.classList.add("is-skeleton-loading");let d=!0;const c=()=>{for(const e of a)e.parentNode===n&&n.removeChild(e);l.parentNode===n&&n.removeChild(l),n.setAttribute("aria-busy","false"),n.classList.remove("is-skeleton-loading"),n.hasAttribute("data-skeleton")&&n.setAttribute("data-skeleton-done",""),_e.get(n)===h&&_e.delete(n),d=!1},h={element:n,options:o,get active(){return d},remove:()=>d?(c(),n.appendChild(i),n):n,replace(e){const t=_e.get(n);return!d&&t&&t!==h?n:(d&&c(),n.textContent="",null==e||("string"==typeof e?n.innerHTML=e:e.nodeType?n.appendChild(e):"number"==typeof e.length&&Array.from(e).forEach(e=>e&&e.nodeType&&n.appendChild(e))),n)},destroy:()=>h.remove()};return _e.set(n,h),h}Ce.while=async function(e,t,n={}){const s=Ce(e,n);try{const e=await("function"==typeof t?t():t);return s&&s.remove(),e}catch(e){throw s&&s.remove(),e}},Ce.get=function(e){const t=ye(e);return t&&_e.get(t)||null},Ce.remove=function(e){const t=Ce.get(e);return t?t.remove():null},Ce.scan=function(e=document){const t=ye(e)||document;return Array.from(t.querySelectorAll("[data-skeleton]")).filter(e=>!_e.has(e)&&!e.hasAttribute("data-skeleton-done")).map(e=>Ce(e))},Ce.markup=Me;const Ee=["top","bottom","left","right"],Ae={top:"bottom",bottom:"top",left:"right",right:"left"},Se={top:["right","left"],bottom:["right","left"],left:["bottom","top"],right:["bottom","top"]},$e=["bottom","top","right","left"],ze=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","summary",'[contenteditable=""]','[contenteditable="true"]',"[tabindex]"].join(","),je="a[href], button, input, select, textarea, summary",Be=e=>"function"==typeof e,Te=e=>"undefined"!=typeof Node&&e instanceof Node,De=[],We=new WeakMap;let He=0,Oe=!1;function Ie(e){return e?"string"==typeof e?document.querySelector(e):Te(e)?e:"function"==typeof e.get&&Te(e.get(0))?e.get(0):Te(e[0])?e[0]:null:null}function Ne(e){return e?Array.from(e.querySelectorAll(ze)).filter(e=>!(e.tabIndex<0)&&(!e.closest("[hidden], [inert]")&&("function"!=typeof e.checkVisibility||e.checkVisibility({visibilityProperty:!0})))):[]}function Pe(e){if(e&&"object"==typeof e)return{show:Number(e.show)||0,hide:Number(e.hide)||0};const t=Number(e)||0;return{show:t,hide:t}}const Ve=".dm-context-menu";function Fe(e){const t=e.target;if(!(t instanceof Element&&t.closest(Ve)))for(const e of De.slice().reverse())e._open&&e.options.closeOnOutside&&(e._contains(t)||e.hide({returnFocus:!1}))}function Re(e){if("Escape"!==e.key&&"Esc"!==e.key)return;const t=De[De.length-1];if(!t||!t.options.closeOnEscape)return;const n=e.target;if(t._panel&&n instanceof Node&&t._panel.contains(n))return;if(n instanceof Element&&n.closest(Ve))return;const s=t._contains(document.activeElement);e.preventDefault(),e.stopPropagation(),t.hide({returnFocus:s})}function qe(e){const t=e.target;if(!(t instanceof Element&&t.closest(Ve)))for(const e of De.slice().reverse())e._open&&e._closesOnFocusLeave()&&(e._contains(t)||e.hide({returnFocus:!1}))}function Ue(){Oe&&!De.length&&(Oe=!1,document.removeEventListener("pointerdown",Fe,!0),document.removeEventListener("keydown",Re,!0),document.removeEventListener("focusin",qe,!0))}class Ke extends h{static defaults={content:"",title:"",html:!1,trigger:"click",placement:"bottom",flip:!0,offset:10,arrow:!0,dismissible:!1,closeOnOutside:!0,closeOnEscape:!0,group:"default",width:null,maxWidth:null,className:"",id:null,role:null,ariaLabel:null,autoFocus:null,trapFocus:!1,delay:{show:80,hide:120},animation:!0,animationDuration:150,container:null,zIndex:null,onShow:null,onShown:null,onHide:null,onHidden:null};constructor(e,t={}){if(super(Ie(e),t),this._open=!1,this._panel=null,this._parent=null,this._timers={show:null,hide:null,remove:null,shown:null},this._triggerHandlers=[],this._openHandlers=[],this._savedAttrs=null,this._frame=null,this._resizeObserver=null,this._destroyed=!1,!this.element)return;const n=We.get(this.element);n&&n!==this&&(n.destroy(),this.element._dommaComponent=this),We.set(this.element,this),this.id=this.options.id||"dm-popover-"+ ++He,this._saveAttrs(),this._applyTriggerAria(),this._bindTrigger()}get panel(){return this._panel}get trigger(){return this.element}isOpen(){return this._open}show(e={}){if(!this.element||this._destroyed||!this.element.isConnected)return this;if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open)return this;if(!this._emit("show",!0))return this;this._openedBy=e.via||"api";const t=this._ensurePanel();this._render(),this._parent=De.slice().reverse().find(e=>e!==this&&e._panel&&e._panel.contains(this.element))||null;const n=this.options.group;if(null!=n&&!1!==n)for(const e of De.slice())e!==this&&e.options.group===n&&(e._isAncestorOf(this)||e.hide({returnFocus:!1}));clearTimeout(this._timers.remove),clearTimeout(this._timers.shown);const s=Ie(this.options.container)||document.body;if(t.parentNode!==s&&s.appendChild(t),this._open=!0,De.push(this),Oe||"undefined"==typeof document||(Oe=!0,document.addEventListener("pointerdown",Fe,!0),document.addEventListener("keydown",Re,!0),document.addEventListener("focusin",qe,!0)),this._bindOpen(),this._setExpanded(!0),t.classList.remove("is-open"),this.update(),!this._open)return this;t.offsetHeight,t.classList.add("is-open");(void 0!==e.focus?e.focus:null!==this.options.autoFocus?this.options.autoFocus:"click"===this._openedBy||"api"===this._openedBy&&this._triggers().includes("click"))&&this._focusInside();const o=this._duration();return o?this._timers.shown=setTimeout(()=>{this._open&&this._emit("shown")},o):this._emit("shown"),this}hide(e={}){if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),!this._open)return this;if(!this._emit("hide",!e._force)&&!e._force)return this;for(const e of De.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});const t=this._panel,n=t&&t.contains(document.activeElement),s=void 0!==e.returnFocus?e.returnFocus:n;this._open=!1,this._parent=null;const o=De.indexOf(this);if(o>-1&&De.splice(o,1),this._unbindOpen(),Ue(),this._setExpanded(!1),clearTimeout(this._timers.shown),s&&this.element&&Be(this.element.focus)){this._returningFocus=!0;try{this.element.focus({preventScroll:!0})}finally{this._returningFocus=!1}}if(t){t.classList.remove("is-open");const e=()=>{this._open||(t.remove(),this._emit("hidden"))},n=this._duration();n?this._timers.remove=setTimeout(e,n):e()}return this}toggle(e={}){return this._open?this.hide(e):this.show(e)}setContent(e){return this.options.content=e,this._panel&&(this._renderBody(),this._open&&this.update()),this}setTitle(e){return this.options.title=e,this._panel&&(this._renderTitle(),this._open&&this.update()),this}update(){return this._open&&this._panel&&this.element?this.element.isConnected?(this._position(),this):(this.hide({returnFocus:!1}),this):this}destroy(){if(this._destroyed)return;this._destroyed=!0;if(De.indexOf(this)>-1){for(const e of De.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});De.splice(De.indexOf(this),1)}const e=this._panel&&this._panel.contains(document.activeElement);this._open=!1,this._unbindOpen(),Ue(),Object.values(this._timers).forEach(e=>clearTimeout(e)),this._panel&&(this._panel.remove(),this._panel=null),this._unbindTrigger(),this._restoreAttrs(),e&&this.element&&Be(this.element.focus)&&this.element.focus({preventScroll:!0}),this.element&&We.get(this.element)===this&&We.delete(this.element),Be(this._onDestroy)&&this._onDestroy(this),super.destroy()}setOptions(e={}){return this._changedKeys=Object.keys(e||{}),super.setOptions(e)}_applyOptions(){if(this.element&&!this._destroyed){if(this._unbindTrigger(),this._applyTriggerAria(),this._bindTrigger(),this._panel){this._styleNode();const e=this._changedKeys||[];(e.includes("content")||e.includes("html"))&&this._renderBody(),e.includes("title")||e.includes("html")?this._renderTitle():this._label(),this._open&&this.update()}this._changedKeys=null}}_triggers(){return String(this.options.trigger||"click").split(/[\s,]+/).filter(Boolean)}_role(){if(this.options.role)return this.options.role;const e=this._triggers();return e.length&&e.every(e=>"hover"===e||"focus"===e)?"tooltip":"dialog"}_closesOnFocusLeave(){const e=this._triggers();return this.options.closeOnOutside||e.includes("focus")||e.includes("hover")}_on(e,t,n,s){e.addEventListener(t,n),s.push({el:e,event:t,handler:n})}_bindTrigger(){const e=this.element,t=this._triggerHandlers,n=this._triggers(),s=()=>Pe(this.options.delay);n.includes("click")&&(this._on(e,"click",t=>{if(e.matches?.("a[href]")&&t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void(!1!==this.options.autoFocus&&this._focusInside());this.toggle({via:"click"})},t),e.matches?.(je)||this._on(e,"keydown",t=>{if(t.target===e&&!t.repeat&&("Enter"===t.key||" "===t.key)){if(t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void this._focusInside();this.toggle({focus:!0,via:"click"})}},t)),n.includes("hover")&&(this._on(e,"mouseenter",()=>this._scheduleShow(s().show),t),this._on(e,"mouseleave",()=>this._scheduleHide(s().hide,"hover"),t)),(n.includes("focus")||n.includes("hover"))&&(this._on(e,"focusin",()=>{this._returningFocus||this.show({focus:!1,via:"focus"})},t),this._on(e,"focusout",e=>{this._contains(e.relatedTarget)||this._scheduleHide(0,"focus")},t)),this._on(e,"keydown",e=>{if("Tab"!==e.key||e.shiftKey||!this._open||!this._panel)return;const t=Ne(this._panel);t.length&&(e.preventDefault(),t[0].focus())},t)}_unbindTrigger(){for(const{el:e,event:t,handler:n}of this._triggerHandlers)e.removeEventListener(t,n);this._triggerHandlers=[]}_scheduleShow(e){clearTimeout(this._timers.hide),clearTimeout(this._timers.show),this._open||(e>0?this._timers.show=setTimeout(()=>this.show({focus:!1,via:"hover"}),e):this.show({focus:!1,via:"hover"}))}_scheduleHide(e,t=null){clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open&&(t&&"click"===this._openedBy||(e>0?this._timers.hide=setTimeout(()=>this.hide(),e):this.hide()))}_saveAttrs(){const e=this.element,t=["aria-haspopup","aria-expanded","aria-controls","aria-describedby","tabindex","role"];this._savedAttrs={};for(const n of t)this._savedAttrs[n]=e.hasAttribute(n)?e.getAttribute(n):null}_restoreAttrs(){const e=this.element;if(e&&this._savedAttrs){for(const[t,n]of Object.entries(this._savedAttrs))null===n?e.removeAttribute(t):e.setAttribute(t,n);e.classList.remove("dm-popover-trigger","is-popover-open")}}_applyTriggerAria(){const e=this.element;this._restoreAttrs(),e.classList.add("dm-popover-trigger"),"dialog"===this._role()&&(e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",this._open?"true":"false"));const t=this._triggers();!(t.includes("click")||t.includes("focus")||t.includes("hover"))||e.matches?.(je)||e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),!t.includes("click")||e.matches?.(je)||e.hasAttribute("role")||e.setAttribute("role","button"),this._open&&this._setExpanded(!0)}_setExpanded(e){const t=this.element;if(t)if(t.classList.toggle("is-popover-open",e),"dialog"===this._role())t.setAttribute("aria-expanded",e?"true":"false"),e?t.setAttribute("aria-controls",this.id):null!=this._savedAttrs?.["aria-controls"]?t.setAttribute("aria-controls",this._savedAttrs["aria-controls"]):t.removeAttribute("aria-controls");else{const n=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==this.id);e&&n.push(this.id),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}}_ensurePanel(){if(this._panel)return this._panel;const e=document.createElement("div");e.id=this.id,e.setAttribute("tabindex","-1");const t=document.createElement("div");t.className="dm-popover-arrow",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="dm-popover-header";const s=document.createElement("div");s.className="dm-popover-title",s.id=`${this.id}-title`,n.appendChild(s);const o=document.createElement("div");o.className="dm-popover-body";const i=document.createElement("button");i.type="button",i.className="dm-popover-close",i.setAttribute("aria-label","Close");const r=document.createElement("span");return r.setAttribute("data-icon","x"),r.setAttribute("data-icon-size","16"),r.setAttribute("aria-hidden","true"),i.appendChild(r),e.append(t,n,o,i),this._panel=e,this._parts={arrow:t,header:n,title:s,body:o,close:i},i.addEventListener("click",()=>this.hide({returnFocus:!0})),e.addEventListener("keydown",e=>this._onPanelKeyDown(e)),e.addEventListener("mouseenter",()=>{this._triggers().includes("hover")&&clearTimeout(this._timers.hide)}),e.addEventListener("mouseleave",()=>{this._triggers().includes("hover")&&this._scheduleHide(Pe(this.options.delay).hide,"hover")}),e.addEventListener("focusout",e=>{const t=this._triggers();(t.includes("focus")||t.includes("hover"))&&(this._contains(e.relatedTarget)||this._scheduleHide(0,"focus"))}),this._styleNode(),e}_styleNode(){const e=this._panel,t=this.options,n=this._role(),s=["dm-popover"];t.dismissible&&s.push("is-dismissible"),t.arrow||s.push("no-arrow"),this._open&&s.push("is-open"),e.classList.contains("has-title")&&s.push("has-title"),e.classList.contains("is-detached")&&s.push("is-detached"),t.className&&s.push(...String(t.className).split(/\s+/).filter(Boolean)),e.className=s.join(" "),e.setAttribute("role",n),e.dataset.animation=t.animation?"on":"off",e.style.setProperty("--dm-popover-duration",`${this._duration()}ms`);const o=(t,n)=>{null==n||""===n?e.style.removeProperty(t):e.style.setProperty(t,"number"==typeof n?`${n}px`:String(n))};o("--dm-popover-width",t.width),o("--dm-popover-max-width",t.maxWidth),null!==t.zIndex&&void 0!==t.zIndex?e.style.zIndex=String(t.zIndex):e.style.removeProperty("z-index"),this._parts.arrow.hidden=!t.arrow,this._parts.close.hidden=!t.dismissible}_render(){this._renderTitle(),this._renderBody()}_renderTitle(){const{title:e,header:t}=this._parts,n=this._fill(e,this.options.title);t.hidden=!n,this._panel.classList.toggle("has-title",n),this._label()}_renderBody(){this._fill(this._parts.body,this.options.content),"undefined"!=typeof window&&window.Domma?.icons&&Be(window.Domma.icons.scan)&&window.Domma.icons.scan(this._panel)}_label(){const e=this._panel;!this._parts.header.hidden?(e.setAttribute("aria-labelledby",this._parts.title.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.options.ariaLabel?e.setAttribute("aria-label",this.options.ariaLabel):e.removeAttribute("aria-label"))}_fill(e,t){e.textContent="";let n=t;if(Be(n)&&(n=n.call(this,this)),null==n||!1===n||""===n)return!1;if(Te(n))return e.appendChild(n),!0;if("object"==typeof n&&"number"==typeof n.length&&Te(n[0]))return Array.from(n).forEach(t=>Te(t)&&e.appendChild(t)),!0;const s=String(n);return this.options.html?e.innerHTML=r.sanitise(s):e.textContent=s,!0}_duration(){return!this.options.animation||function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animationDuration)||0)}_focusInside(){const e=this._panel;if(!e)return;(Ne(e).filter(e=>!e.closest(".dm-popover-close"))[0]||e).focus({preventScroll:!0})}_onPanelKeyDown(e){if(!this._open)return;if("Escape"===e.key||"Esc"===e.key){if(e.defaultPrevented||!this.options.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void this.hide({returnFocus:!0})}if("Tab"!==e.key)return;const t=Ne(this._panel),n=t[0],s=t[t.length-1],o=document.activeElement;if(this.options.trapFocus)return t.length?void(!e.shiftKey||o!==n&&o!==this._panel?e.shiftKey||o!==s||(e.preventDefault(),n.focus()):(e.preventDefault(),s.focus())):void e.preventDefault();if(e.shiftKey&&(!t.length||o===n||o===this._panel))return e.preventDefault(),void this.element.focus();if(!(e.shiftKey||t.length&&o!==s)){const t=this._nextTabbableAfterTrigger();e.preventDefault(),this.hide({returnFocus:!t}),t&&(t.focus(),document.activeElement!==t&&this.element.focus({preventScroll:!0}))}}_nextTabbableAfterTrigger(){const e=this.element,t=e.closest(".dm-popover");return Ne(t||document.body).filter(n=>n.closest(".dm-popover")===t&&!e.contains(n)).find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||null}_bindOpen(){const e=this._openHandlers,t=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame;this._frameIsTimeout=!e;const t=e?requestAnimationFrame:e=>setTimeout(e,16);this._frame=t(()=>{this._frame=null,this.update()})},n=()=>t();window.addEventListener("scroll",n,{capture:!0,passive:!0}),e.push({el:window,event:"scroll",handler:n,capture:!0}),window.addEventListener("resize",t),e.push({el:window,event:"resize",handler:t}),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(t),this._resizeObserver.observe(this._panel),this._resizeObserver.observe(this.element))}_unbindOpen(){for(const{el:e,event:t,handler:n,capture:s}of this._openHandlers)e.removeEventListener(t,n,s?{capture:!0}:void 0);this._openHandlers=[],this._resizeObserver?.disconnect(),this._resizeObserver=null,this._frame&&(this._frameIsTimeout?clearTimeout(this._frame):"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this._frame),this._frame=null)}_contains(e){return!(!e||!Te(e))&&(!(!this.element||!this.element.contains(e))||(!(!this._panel||!this._panel.contains(e))||De.some(t=>t!==this&&t._parent===this&&t._contains(e))))}_isAncestorOf(e){let t=e._parent;for(;t;){if(t===this)return!0;t=t._parent}return!1}_position(){const e=this._panel,t=this.options,n=this.element.getBoundingClientRect(),{width:s,height:o}=function(){const e=document.documentElement;return{width:e.clientWidth||window.innerWidth||0,height:e.clientHeight||window.innerHeight||0}}(),i=n.bottom<0||n.top>o||n.right<0||n.left>s;e.classList.toggle("is-detached",i),e.style.left="0px",e.style.top="0px";const r=e.offsetWidth,a=e.offsetHeight,[l,d]=function(e){if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0];const t=Number(e);return[0,Number.isFinite(t)?t:10]}(t.offset);let[c,h]=function(e){const[t,n]=String(e||"bottom").split("-");return["auto"===t||Ee.includes(t)?t:"bottom","start"===n||"end"===n?n:"center"]}(t.placement);const u={top:n.top-8,bottom:o-n.bottom-8,left:n.left-8,right:s-n.right-8},p=e=>u[e]>=(e=>("top"===e||"bottom"===e?a:r)+d)(e);if("auto"===c)c=$e.find(p)||$e.reduce((e,t)=>u[t]>u[e]?t:e);else if(t.flip&&!p(c)){const e=[Ae[c],...Se[c]].find(p);e?c=e:u[Ae[c]]>u[c]&&(c=Ae[c])}let m,f;const g="top"===c||"bottom"===c;g?(f="top"===c?n.top-d-a:n.bottom+d,m="start"===h?n.left+l:"end"===h?n.right-r-l:n.left+n.width/2-r/2+l):(m="left"===c?n.left-d-r:n.right+d,f="start"===h?n.top+l:"end"===h?n.bottom-a-l:n.top+n.height/2-a/2+l);const v=(e,t,n)=>t+16>n?8:Math.min(Math.max(e,8),n-t-8);m=v(m,r,s),f=v(f,a,o),e.style.left=`${Math.round(m)}px`,e.style.top=`${Math.round(f)}px`,e.dataset.side=c,e.dataset.placement="center"===h?c:`${c}-${h}`;const b=this._parts.arrow;if(t.arrow)if(g){const t=n.left+n.width/2-m-(e.clientLeft||0);b.style.left=`${Math.round(Math.min(Math.max(t,12),r-12))}px`,b.style.top=""}else{const t=n.top+n.height/2-f-(e.clientTop||0);b.style.top=`${Math.round(Math.min(Math.max(t,12),a-12))}px`,b.style.left=""}}_emit(e,t=!1){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];let s=!0;if(Be(n)&&!1===n.call(this,this)&&t&&(s=!1),!this.element)return s;const o=new CustomEvent(`popover:${e}`,{detail:{popover:this},bubbles:!0,cancelable:t}),i=this.element.dispatchEvent(o);return s&&(i||!t)}static scan(e=document,t=null){const n="string"==typeof e?document.querySelector(e):Ie(e)||e;if(!n||!Be(n.querySelectorAll))return[];const s=[],o="[data-popover], [data-popover-content]",i=Array.from(n.querySelectorAll(o));Be(n.matches)&&n.matches(o)&&i.unshift(n);for(const e of i){if(We.has(e))continue;const n=Ke.optionsFromAttributes(e);s.push(t?t(e,n):new Ke(e,n))}return s}static optionsFromAttributes(e){const t=e.dataset||{},n={},s=e=>void 0!==e&&"false"!==e&&"0"!==e;if(t.popover&&(n.content=t.popover),t.popoverContent){const e=document.querySelector(t.popoverContent);e&&(n.content=()=>{if("TEMPLATE"===e.tagName)return e.content.cloneNode(!0);const t=e.cloneNode(!0);return t.removeAttribute("id"),t.removeAttribute("hidden"),t})}return t.popoverTitle&&(n.title=t.popoverTitle),t.popoverTrigger&&(n.trigger=t.popoverTrigger),t.popoverPlacement&&(n.placement=t.popoverPlacement),void 0!==t.popoverGroup&&(n.group=""===t.popoverGroup||"none"===t.popoverGroup?null:t.popoverGroup),void 0!==t.popoverDismissible&&(n.dismissible=s(t.popoverDismissible)),void 0!==t.popoverArrow&&(n.arrow=s(t.popoverArrow)),t.popoverWidth&&(n.width=t.popoverWidth),t.popoverMaxWidth&&(n.maxWidth=t.popoverMaxWidth),t.popoverClass&&(n.className=t.popoverClass),n}static closeAll(e){for(const t of De.slice().reverse())void 0!==e&&t.options.group!==e||t.hide({returnFocus:!1})}static getInstance(e){const t=Ie(e);return t&&We.get(t)||null}static openPopovers(){return De.slice()}}const Ye=["xs","sm","md","lg","xl"],Ge=["circle","rounded","square"],Je=["online","away","busy","offline"],Xe={none:0,sm:.15,md:.25,lg:.4},Ze=/^[a-z0-9-]+$/i,Qe={name:null,src:null,alt:null,size:"md",shape:"circle",status:null,statusLabels:null,icon:null,title:null,ring:!1,tone:null,decorative:!1},et={online:"online",away:"away",busy:"busy",offline:"offline"},tt=new WeakMap,nt=new WeakMap;function st(e){return!!e&&"object"==typeof e&&1===e.nodeType}function ot(e){return e?"string"==typeof e?document.querySelector(e):st(e)?e:"function"==typeof e.get&&st(e.get(0))?e.get(0):"number"==typeof e.length&&st(e[0])?e[0]:null:null}function it(e){const t=e.match(/^\P{M}\p{M}*/u);return t?t[0]:""}function rt(e){if(null==e)return"";let t=String(e).trim();if(!t)return"";const n=t.indexOf("@");n>0&&!/\s/.test(t)&&(t=t.slice(0,n)),t=t.replace(/\([^)]*\)|\[[^\]]*\]/g," ");const s=t.split(/[\s._+\-]+/u).map(e=>e.replace(/^[^\p{L}\p{N}]+/u,"")).filter(Boolean);if(!s.length)return"";return(it(s[0])+(s.length>1?it(s[s.length-1]):"")).toUpperCase()}function at(e){const t=String(e??"").trim().toLowerCase().replace(/\s+/g," ");let n=2166136261;for(const e of t)n^=e.codePointAt(0),n=Math.imul(n,16777619);return(n>>>0)%8}function lt(e,t,n){return e.includes(t)?t:n}function dt(e,t){if(t&&!e.icon){const e=document.createElement("span");return e.className="avatar-initials",e.setAttribute("aria-hidden","true"),e.textContent=t,e}const n=document.createElement("span");return n.className="avatar-icon",n.setAttribute("aria-hidden","true"),n.setAttribute("data-icon",e.icon&&Ze.test(e.icon)?e.icon:"user"),n}function ct(e){e.querySelector(".avatar-icon[data-icon]")&&("undefined"!=typeof window&&(window.Domma?.icons||window.I)||null)?.scan?.(e)}function ht(e,t,n=null){const s=lt(Ye,t.size,"md"),o=lt(Ge,t.shape,"circle"),i=rt(t.name||(t.alt&&!t.src?t.alt:"")),r=function(e){const t=parseInt(e.tone,10);if(Number.isFinite(t))return(t%8+8)%8;const n=e.name||e.alt||e.src;return n?at(n):null}(t);if(e.classList.remove(...function(e){return Array.from(e.classList).filter(e=>"avatar"===e||/^avatar-(xs|sm|md|lg|xl|rounded|square|ring|tone-\d+)$/.test(e))}(e)),e.classList.add("avatar",`avatar-${s}`),"circle"!==o&&e.classList.add(`avatar-${o}`),null!=r&&e.classList.add(`avatar-tone-${r}`),t.ring&&e.classList.add("avatar-ring"),e.textContent="",t.src){const n=document.createElement("img");n.className="avatar-img",n.alt="",n.decoding="async",n.addEventListener("error",()=>{n.parentNode===e&&(e.replaceChild(dt(t,i),n),e.classList.add("avatar-img-failed"),ct(e))},{once:!0}),n.src=String(t.src),e.appendChild(n)}else e.appendChild(dt(t,i));e.classList.remove("avatar-img-failed");const a=lt(Je,t.status,null);if(a){const t=document.createElement("span");t.className=`avatar-status avatar-status-${a}`,t.setAttribute("aria-hidden","true"),e.appendChild(t)}const l=function(e){const t=String(e.alt??e.name??"").trim(),n=lt(Je,e.status,null);if(!n)return t;const s=e.statusLabels&&e.statusLabels[n]||et[n];return t?`${t} (${s})`:s}(t),d=/^(A|BUTTON)$/.test(e.tagName);e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-hidden"),t.decorative&&!d?e.setAttribute("aria-hidden","true"):l?(d||e.setAttribute("role","img"),e.setAttribute("aria-label",l)):d||e.setAttribute("aria-hidden","true");const c=!0===t.title?l:t.title;return c?e.setAttribute("title",String(c)):null!=n?e.setAttribute("title",n):e.removeAttribute("title"),ct(e),{initials:i,tone:r,label:l,size:s,shape:o}}function ut(e){const t=e.dataset||{},n={},s=e.classList,o=Ye.find(e=>s.contains(`avatar-${e}`));o&&(n.size=o),s.contains("avatar-rounded")&&(n.shape="rounded"),s.contains("avatar-square")&&(n.shape="square"),s.contains("avatar-ring")&&(n.ring=!0);const i=Array.from(s).find(e=>/^avatar-tone-\d+$/.test(e));i&&(n.tone=Number(i.slice(12))),t.avatar&&(n.name=t.avatar);const r=["src","alt","size","shape","status","icon","title","tone"];for(const e of r){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["ring","decorative"]){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return n}const pt=["role","aria-label","aria-hidden","title"];function mt(e,t={}){let n;if(e&&"object"==typeof e&&!st(e)&&"number"!=typeof e.length&&"function"!=typeof e.get&&(t=e,e=null),null==e)n=document.createElement("span");else if(n=ot(e),!n)return null;const s=tt.get(n);s&&s.destroy();const o={children:document.createDocumentFragment(),classes:new Set(n.classList),attrs:Object.fromEntries(pt.map(e=>[e,n.getAttribute(e)]))};for(;n.firstChild;)o.children.appendChild(n.firstChild);let i={...Qe,...ut(n),...t},r=ht(n,i,o.attrs.title);const a={element:n,get options(){return i},get initials(){return r.initials},get tone(){return r.tone},get label(){return r.label},update:(e={})=>(i={...i,...e},r=ht(n,i,o.attrs.title),a),destroy(){if(tt.get(n)!==a)return n;tt.delete(n),n.textContent="",n.appendChild(o.children),n.className=[...o.classes].join(" "),n.className||n.removeAttribute("class");for(const[e,t]of Object.entries(o.attrs))null==t?n.removeAttribute(e):n.setAttribute(e,t);return n.hasAttribute("data-avatar")&&n.setAttribute("data-avatar-done",""),n}};return tt.set(n,a),a}mt.initials=rt,mt.tone=at,mt.get=function(e){const t=ot(e);return t&&tt.get(t)||null},mt.scan=function(e=document){const t=ot(e)||document;if("function"!=typeof t.querySelectorAll)return[];const n=Array.from(t.querySelectorAll("[data-avatar]"));return"function"==typeof t.matches&&t.matches("[data-avatar]")&&n.unshift(t),n.filter(e=>!tt.has(e)&&!e.hasAttribute("data-avatar-done")).map(e=>mt(e))};const ft={people:[],max:null,size:"md",shape:"circle",overlap:null,label:null,statusLabels:null,onMore:null,popover:!0,moreLabel:null};function gt(e){return null==e?null:"string"==typeof e?{name:e}:"object"==typeof e?e:null}function vt(e,t,n={}){const s=e.href&&(e.name||e.alt)?e.href:null,o=document.createElement(s?"a":"span");s&&o.setAttribute("href",String(s));return mt(o,{name:e.name,src:e.src,alt:e.alt,status:e.status,icon:e.icon,tone:e.tone,title:e.title??!0,size:t.size,shape:t.shape,statusLabels:t.statusLabels,...n}).element}function bt(e,t={}){const n=ot(e);if(!n)return null;const s=nt.get(n);s&&s.destroy();const o=/^(UL|OL)$/.test(n.tagName),i=document.createDocumentFragment(),r=new Set(n.classList),a=n.getAttribute("aria-label"),l=n.style.getPropertyValue("--dm-avatar-overlap");for(;n.firstChild;)i.appendChild(n.firstChild);const d=o?n:document.createElement("ul");o||n.appendChild(d);let c={...ft,...t};const h={people:[],shown:[],hidden:[],more:null,popover:null},u=()=>{h.popover&&h.popover.destroy(),h.popover=null,h.more=null},p=()=>{const e=document.activeElement,t=!!e&&(h.more&&h.more===e||h.popover&&h.popover.panel&&h.popover.panel.contains(e));u();const n=(Array.isArray(c.people)?c.people:[]).map(gt).filter(Boolean),s=lt(Ye,c.size,"md"),i=parseInt(c.max,10),r=Number.isFinite(i)&&i>=0&&i<n.length?i:n.length;h.people=n,h.shown=n.slice(0,r),h.hidden=n.slice(r),d.textContent="";for(const e of Array.from(d.classList))/^avatar-group-(xs|sm|md|lg|xl)$/.test(e)&&d.classList.remove(e);d.classList.add("avatar-group",`avatar-group-${s}`),c.label?d.setAttribute("aria-label",String(c.label)):o&&null!=a?d.setAttribute("aria-label",a):d.removeAttribute("aria-label");const l=null==(p=c.overlap)||""===p?null:"number"==typeof p&&Number.isFinite(p)?`${p}px`:Object.prototype.hasOwnProperty.call(Xe,p)?`calc(var(--dm-avatar-size, 2.5rem) * ${Xe[p]})`:String(p);var p;null!=l?d.style.setProperty("--dm-avatar-overlap",l):d.style.removeProperty("--dm-avatar-overlap");let m=h.shown.length+1;for(const e of h.shown){const t=document.createElement("li");t.className="avatar-group-item",t.style.setProperty("--dm-avatar-z",String(m--)),t.appendChild(vt(e,{...c,size:s})),d.appendChild(t)}if(h.hidden.length){const e=h.hidden.length,t=h.hidden.map(e=>e.name||e.alt||"").filter(Boolean),n=document.createElement("li");n.className="avatar-group-item",n.style.setProperty("--dm-avatar-z",String(m));const o=document.createElement("button");o.type="button",o.className=`avatar avatar-more avatar-${s}`,"rounded"!==c.shape&&"square"!==c.shape||o.classList.add(`avatar-${c.shape}`),o.textContent=`+${e}`;const i="function"==typeof c.moreLabel?c.moreLabel(e,t):`${e} more${t.length?`: ${function(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}(t)}`:""}`;o.setAttribute("aria-label",String(i)),n.appendChild(o),d.appendChild(n),h.more=o;const r=h.hidden;"function"==typeof c.onMore?o.addEventListener("click",e=>c.onMore(r.slice(),e)):!1!==c.popover?h.popover=new Ke(o,{title:`${e} more`,content:()=>function(e,t){const n=document.createElement("ul");n.className="avatar-more-list";for(const s of e){const e=document.createElement("li"),o=document.createElement(s.href?"a":"span");o.className="avatar-more-person",s.href&&o.setAttribute("href",String(s.href));const i=document.createElement("span");mt(i,{name:s.name,alt:s.alt,src:s.src,icon:s.icon,tone:s.tone,size:"xs",shape:t.shape,decorative:!0});const r=document.createElement("span");r.className="avatar-more-name",r.textContent=s.name||s.alt||"",o.append(i,r),e.appendChild(o),n.appendChild(e)}return n}(r,c),placement:"bottom",className:"avatar-more-popover",maxWidth:"18rem"}):t.length&&(o.title=t.join(", "))}t&&(h.more?h.more.focus():(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus()))};p();const m={element:d,get options(){return c},get people(){return h.people},get shown(){return h.shown},get hidden(){return h.hidden},get more(){return h.more},get popover(){return h.popover},update:(e={})=>(c={...c,...e},p(),m),setPeople:e=>m.update({people:e}),destroy:()=>(nt.get(n)!==m||(nt.delete(n),u(),o?(d.textContent="",d.className=[...r].join(" "),d.className||d.removeAttribute("class"),null==a?d.removeAttribute("aria-label"):d.setAttribute("aria-label",a),l?d.style.setProperty("--dm-avatar-overlap",l):d.style.removeProperty("--dm-avatar-overlap")):n.textContent="",n.appendChild(i)),n)};return nt.set(n,m),m}bt.get=function(e){const t=ot(e);return t&&nt.get(t)||null};class _t extends HTMLElement{static defaults={};static get observedAttributes(){return[]}constructor(){super(),this._eventHandlers=[],this._options={},this._initialised=!1,this.attachShadow({mode:"open"})}connectedCallback(){this._initialised||(this._options={...this._mergeOptions(),...this._options},this._onBeforeMount?.(),this._injectStyles(),this._render(),this._bindEvents(),this._initialised=!0),this._onConnect?.()}disconnectedCallback(){this._onBeforeUnmount?.(),this._cleanup(),this._onDisconnect?.()}attributeChangedCallback(e,t,n){t!==n&&this._initialised&&(this._options[this._attrToOption(e)]=this._parseAttrValue(n),this._onAttributeChange?.(e,t,n))}_onBeforeMount(){}_onUpdated(){}_onBeforeUnmount(){}_mergeOptions(){const e={...this.constructor.defaults};for(const t of this.attributes){e[this._attrToOption(t.name)]=this._parseAttrValue(t.value)}return e}_attrToOption(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_parseAttrValue(e){if(""===e||"true"===e)return!0;if("false"===e)return!1;if(!isNaN(e)&&""!==e)return Number(e);try{return JSON.parse(e)}catch{return e}}_injectStyles(){const e=document.createElement("style");e.textContent=this._getStyles(),this.shadowRoot.appendChild(e)}_getStyles(){return this.constructor.styles||""}_render(){}_bindEvents(){}_addEventListener(e,t,n,s){e.addEventListener(t,n,s),this._eventHandlers.push({element:e,event:t,handler:n,options:s})}_cleanup(){for(const{element:e,event:t,handler:n,options:s}of this._eventHandlers)e.removeEventListener(t,n,s);this._eventHandlers=[]}_emit(e,t={}){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}setOptions(e){return this._options={...this._options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}destroy(){this._cleanup(),this.remove()}}const yt="\n * {\n box-sizing: border-box;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n";class kt extends _t{static defaults={variant:"primary",size:"medium",pill:!1,outline:!1,removable:!1};static get observedAttributes(){return["variant","size","pill","outline","removable"]}static variants={primary:{bg:"var(--dm-primary, #4f46e5)",color:"#fff"},secondary:{bg:"var(--dm-secondary, #6b7280)",color:"#fff"},success:{bg:"var(--dm-success, #10b981)",color:"#fff"},danger:{bg:"var(--dm-danger, #ef4444)",color:"#fff"},warning:{bg:"var(--dm-warning, #f59e0b)",color:"#000"},info:{bg:"var(--dm-info, #3b82f6)",color:"#fff"},light:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},dark:{bg:"var(--dm-surface-overlay, #1f2937)",color:"var(--dm-white, #fff)"}};static sizes={small:{padding:"2px 6px",fontSize:"10px"},medium:{padding:"4px 10px",fontSize:"12px"},large:{padding:"6px 14px",fontSize:"14px"}};_getStyles(){return`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n ${yt}\n \n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n transition: opacity var(--dm-transition-fast);\n }\n\n button:hover {\n opacity: 0.8;\n }\n\n button:focus {\n outline: 2px solid var(--dm-primary);\n outline-offset: 2px;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n\n :host {\n display: inline-flex;\n }\n\n .badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-weight: 500;\n line-height: 1;\n transition: all 150ms ease;\n }\n\n .badge-clickable {\n cursor: pointer;\n }\n\n .remove-btn {\n margin-left: 2px;\n width: 14px;\n height: 14px;\n font-size: 16px;\n line-height: 1;\n opacity: 0.7;\n }\n\n .remove-btn:hover {\n opacity: 1;\n }\n `}_render(){const{variant:e,size:t,pill:n,outline:s,removable:o}=this._options,i=kt.variants[e]||kt.variants.primary,r=kt.sizes[t]||kt.sizes.medium,a=document.createElement("span");a.className="badge",a.setAttribute("part","badge");const l=n?"9999px":"4px",d=s?"transparent":i.bg,c=s?i.bg:i.color,h=s?`1px solid ${i.bg}`:"none";a.style.cssText=`\n background: ${d};\n color: ${c};\n border: ${h};\n border-radius: ${l};\n padding: ${r.padding};\n font-size: ${r.fontSize};\n `;const u=document.createElement("slot");if(a.appendChild(u),o){const e=document.createElement("button");e.className="remove-btn",e.setAttribute("part","remove-btn"),e.setAttribute("aria-label","Remove"),e.textContent="×",this._addEventListener(e,"click",e=>{e.stopPropagation(),this._emit("remove",{badge:this}),this.remove()}),a.appendChild(e)}this._badge=a,this.shadowRoot.appendChild(a)}_bindEvents(){this._addEventListener(this._badge,"click",e=>{e.target.classList.contains("remove-btn")||this._emit("click",{badge:this,event:e})})}_onAttributeChange(e,t,n){this.shadowRoot.textContent="",this._injectStyles(),this._render(),this._bindEvents()}_applyOptions(){this.shadowRoot.textContent="",this._injectStyles(),this._render(),this._bindEvents()}setVariant(e){return this.setAttribute("variant",e),this}setSize(e){return this.setAttribute("size",e),this}setText(e){return this.textContent=e,this}}customElements.get("domma-badge")||customElements.define("domma-badge",kt);class wt extends _t{static defaults={count:0,variant:"danger",dot:!1,pulse:!1,borderColor:null};static get observedAttributes(){return["count","variant","dot","pulse","border-color"]}static variants={primary:{bg:"var(--dm-primary, #4f46e5)",color:"#fff"},secondary:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},success:{bg:"var(--dm-success, #10b981)",color:"#fff"},danger:{bg:"var(--dm-danger, #ef4444)",color:"#fff"},warning:{bg:"var(--dm-warning, #f59e0b)",color:"#000"},info:{bg:"var(--dm-info, #3b82f6)",color:"#fff"},light:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},dark:{bg:"var(--dm-surface-overlay, #1f2937)",color:"#fff"}};_getStyles(){return`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n ${yt}\n\n :host {\n position: relative;\n display: inline-flex;\n }\n\n .counter {\n position: absolute;\n top: -6px;\n right: -8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.3em;\n font-size: 0.65rem;\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n line-height: 1;\n border-radius: 9999px;\n border: 2px solid var(--dm-background, #fff);\n z-index: 1;\n transition: transform 150ms ease;\n }\n\n .counter.dot {\n top: -2px;\n right: -2px;\n min-width: 0.5rem;\n height: 0.5rem;\n padding: 0;\n }\n\n .counter.hidden {\n display: none;\n }\n\n @keyframes badge-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }\n 50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }\n }\n\n .counter.pulse {\n animation: badge-pulse 2s ease-in-out infinite;\n }\n `}_render(){const{count:e,variant:t,dot:n,pulse:s,borderColor:o}=this._options,i=wt.variants[t]||wt.variants.danger,r=document.createElement("slot"),a=document.createElement("span");a.className="counter",a.setAttribute("part","counter"),a.setAttribute("aria-live","polite"),a.setAttribute("role","status"),a.style.backgroundColor=i.bg,a.style.color=i.color,o&&(a.style.borderColor=o),n?(a.classList.add("dot"),a.textContent=""):a.textContent=String(e),s&&a.classList.add("pulse"),n||0!==Number(e)||a.classList.add("hidden"),this._counter=a,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(a)}_onAttributeChange(e,t,n){this.shadowRoot.textContent="",this._injectStyles(),this._render()}_applyOptions(){this.shadowRoot.textContent="",this._injectStyles(),this._render()}setCount(e){return this._options.count=Number(e),this.setAttribute("count",String(e)),this}increment(e=1){const t=(Number(this._options.count)||0)+e;return this.setCount(t),this}decrement(e=1){const t=Math.max(0,(Number(this._options.count)||0)-e);return this.setCount(t),this}setDot(e){return this._options.dot=e,e?this.setAttribute("dot",""):this.removeAttribute("dot"),this}setVariant(e){return this.setAttribute("variant",e),this}setPulse(e){return this._options.pulse=e,e?this.setAttribute("pulse",""):this.removeAttribute("pulse"),this}getCount(){return Number(this._options.count)||0}}customElements.get("domma-number-badge")||customElements.define("domma-number-badge",wt);class xt extends _t{static defaults={content:"",position:"top",trigger:"hover",delay:0,hideDelay:0,animation:!0,offset:8,html:!1,visible:!1};static get observedAttributes(){return["content","position","trigger","delay","hide-delay","animation","offset","html","visible"]}constructor(){super(),this._tooltip=null,this._isVisible=!1,this._showTimeout=null,this._hideTimeout=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: contents;\n }\n\n .tooltip-wrapper {\n position: relative;\n display: inline-block;\n }\n\n .tooltip {\n position: fixed;\n z-index: 1000;\n padding: 0.5rem 0.75rem;\n background: var(--dm-text, #212529);\n color: var(--dm-surface, #fff);\n border-radius: 4px;\n font-size: 0.875rem;\n line-height: 1.4;\n max-width: 250px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n }\n\n .tooltip.show {\n opacity: 1;\n }\n\n /* Arrow */\n .tooltip::before {\n content: \'\';\n position: absolute;\n width: 0;\n height: 0;\n border: 5px solid transparent;\n }\n\n .tooltip[data-position="top"]::before {\n bottom: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="bottom"]::before {\n top: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="left"]::before {\n right: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="right"]::before {\n left: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--dm-text, #212529);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const e=document.createElement("div");e.className="tooltip-wrapper",e.setAttribute("part","wrapper");const t=document.createElement("slot");e.appendChild(t),this.shadowRoot.appendChild(e),this._wrapper=e}_bindEvents(){const{trigger:e}=this._options;"hover"===e?(this._addEventListener(this._wrapper,"mouseenter",()=>this.show()),this._addEventListener(this._wrapper,"mouseleave",()=>this.hide())):"click"===e?this._addEventListener(this._wrapper,"click",()=>this.toggle()):"focus"===e&&(this._addEventListener(this._wrapper,"focusin",()=>this.show()),this._addEventListener(this._wrapper,"focusout",()=>this.hide()))}_onAttributeChange(e,t,n){switch(e){case"content":this._tooltip&&this._isVisible&&this._updateTooltipContent();break;case"position":this._tooltip&&this._isVisible&&this._positionTooltip();break;case"trigger":this._cleanup(),this._bindEvents();break;case"visible":""===n||"true"===n?this.show():this.hide()}}_onConnect(){this._options.visible&&this.show()}_onDisconnect(){clearTimeout(this._showTimeout),clearTimeout(this._hideTimeout),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}show(){if(clearTimeout(this._hideTimeout),this._isVisible)return this;const{delay:e}=this._options;return this._showTimeout=setTimeout(()=>{this._createTooltip(),this._positionTooltip(),this._emit("show")},e),this}hide(){if(clearTimeout(this._showTimeout),!this._isVisible)return this;const{hideDelay:e}=this._options;return this._hideTimeout=setTimeout(()=>{this._tooltip&&(this._tooltip.classList.remove("show"),this._tooltip.style.opacity="0",setTimeout(()=>{this._tooltip&&(this._tooltip.remove(),this._tooltip=null),this._isVisible=!1,this._emit("hide")},150))},e),this}toggle(){return this._isVisible?this.hide():this.show()}isVisible(){return this._isVisible}setContent(e){return this.setAttribute("content",e),this}setPosition(e){return this.setAttribute("position",e),this}_createTooltip(){const{content:e,position:t,html:n}=this._options;if(this._tooltip=document.createElement("div"),this._tooltip.className="domma-tooltip",this._tooltip.setAttribute("data-position",t),this._applyTooltipStyles(),n){const t="undefined"!=typeof DOMPurify?DOMPurify.sanitize(e):e;this._tooltip.innerHTML=t}else this._tooltip.textContent=e;document.body.appendChild(this._tooltip),this._tooltip.offsetHeight,this._tooltip.classList.add("show"),this._tooltip.style.opacity="1",this._isVisible=!0}_applyTooltipStyles(){Object.assign(this._tooltip.style,{position:"fixed",zIndex:"1000",padding:"0.5rem 0.75rem",background:"var(--dm-text, #212529)",color:"var(--dm-surface, #fff)",borderRadius:"4px",fontSize:"0.875rem",lineHeight:"1.4",maxWidth:"250px",pointerEvents:"none",transition:"opacity 0.15s ease",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}),this._tooltip.style.opacity="0",this._injectGlobalTooltipStyles()}_injectGlobalTooltipStyles(){if(document.getElementById("domma-tooltip-styles"))return;const e=document.createElement("style");e.id="domma-tooltip-styles",e.textContent='\n .domma-tooltip.show {\n opacity: 1 !important;\n }\n\n /* Arrow */\n .domma-tooltip::before {\n content: \'\';\n position: absolute;\n width: 0;\n height: 0;\n border: 5px solid transparent;\n }\n\n .domma-tooltip[data-position="top"]::before {\n bottom: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="bottom"]::before {\n top: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="left"]::before {\n right: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="right"]::before {\n left: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--dm-text, #212529);\n }\n ',document.head.appendChild(e)}_updateTooltipContent(){const{content:e,html:t}=this._options;if(t){const t="undefined"!=typeof DOMPurify?DOMPurify.sanitize(e):e;this._tooltip.innerHTML=t}else this._tooltip.textContent=e;this._positionTooltip()}_positionTooltip(){if(!this._tooltip||!this._wrapper)return;const{position:e,offset:t}=this._options,n=this._wrapper.getBoundingClientRect(),s=this._tooltip.getBoundingClientRect();let o,i;switch(e){case"top":default:o=n.top-s.height-t,i=n.left+(n.width-s.width)/2;break;case"bottom":o=n.bottom+t,i=n.left+(n.width-s.width)/2;break;case"left":o=n.top+(n.height-s.height)/2,i=n.left-s.width-t;break;case"right":o=n.top+(n.height-s.height)/2,i=n.right+t}const r=window.innerWidth,a=window.innerHeight;i<0&&(i=8),i+s.width>r&&(i=r-s.width-8),o<0&&(o=8),o+s.height>a&&(o=a-s.height-8),this._tooltip.style.top=o+"px",this._tooltip.style.left=i+"px"}}customElements.get("domma-tooltip")||customElements.define("domma-tooltip",xt);class Mt extends _t{static defaults={type:"spinner",size:"medium",color:"primary",overlay:!1,text:"",centered:!0,visible:!0};static sizes={small:24,medium:40,large:64};static colors={primary:"var(--dm-primary, #6495ED)",secondary:"var(--dm-secondary, #6c757d)",success:"var(--dm-success, #28a745)",danger:"var(--dm-danger, #dc3545)",warning:"var(--dm-warning, #ffc107)",info:"var(--dm-info, #17a2b8)",white:"#ffffff",dark:"var(--dm-surface-overlay, #343a40)"};static get observedAttributes(){return["type","size","color","overlay","text","centered","visible"]}constructor(){super(),this._visible=!1}_getSize(){const{size:e}=this._options;return"number"==typeof e?e:isNaN(e)?Mt.sizes[e]||Mt.sizes.medium:parseInt(e,10)}_getColor(){const{color:e}=this._options;return Mt.colors[e]||e}_injectStyles(){const e=document.createElement("style");e.textContent="\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .loader-wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .loader-wrapper.hidden {\n display: none !important;\n }\n\n .loader-wrapper.overlay {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n }\n\n .loader-wrapper.centered {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n .loader-text {\n color: var(--loader-text-color, var(--dm-text, #212529));\n font-size: var(--dm-text-sm, 0.875rem);\n }\n\n .loader-wrapper.overlay .loader-text {\n color: #ffffff;\n }\n\n /* Spinner */\n .loader-spinner {\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n /* Dots */\n .loader-dots {\n display: flex;\n gap: var(--dot-gap);\n }\n\n .loader-dots span {\n border-radius: 50%;\n animation: bounce 1.4s ease-in-out infinite both;\n }\n\n .loader-dots span:nth-child(1) { animation-delay: 0s; }\n .loader-dots span:nth-child(2) { animation-delay: 0.16s; }\n .loader-dots span:nth-child(3) { animation-delay: 0.32s; }\n\n @keyframes bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n\n /* Pulse */\n .loader-pulse {\n border-radius: 50%;\n animation: pulse 1.2s ease-in-out infinite;\n }\n\n @keyframes pulse {\n 0% { transform: scale(0); opacity: 1; }\n 100% { transform: scale(1); opacity: 0; }\n }\n\n /* Bars */\n .loader-bars {\n display: flex;\n align-items: center;\n gap: var(--bar-gap);\n }\n\n .loader-bars span {\n border-radius: 2px;\n animation: bars 1s ease-in-out infinite;\n }\n\n .loader-bars span:nth-child(1) { animation-delay: 0s; }\n .loader-bars span:nth-child(2) { animation-delay: 0.1s; }\n .loader-bars span:nth-child(3) { animation-delay: 0.2s; }\n .loader-bars span:nth-child(4) { animation-delay: 0.3s; }\n\n @keyframes bars {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n ",this.shadowRoot.appendChild(e)}_render(){const e=this._getSize(),t=this._getColor(),{type:n,overlay:s,text:o,centered:i,visible:r}=this._options;switch(this._wrapper=document.createElement("div"),this._wrapper.className="loader-wrapper",this._wrapper.setAttribute("part","wrapper"),this._wrapper.setAttribute("role","status"),this._wrapper.setAttribute("aria-live","polite"),s&&this._wrapper.classList.add("overlay"),i&&!s&&this._wrapper.classList.add("centered"),r||this._wrapper.classList.add("hidden"),this._loaderEl=document.createElement("div"),this._loaderEl.className=`loader-${n}`,this._loaderEl.setAttribute("part","loader"),n){case"dots":this._renderDots(e,t);break;case"pulse":this._renderPulse(e,t);break;case"bars":this._renderBars(e,t);break;default:this._renderSpinner(e,t)}this._wrapper.appendChild(this._loaderEl),o&&(this._textEl=document.createElement("span"),this._textEl.className="loader-text",this._textEl.setAttribute("part","text"),this._textEl.textContent=o,this._wrapper.appendChild(this._textEl)),this.shadowRoot.appendChild(this._wrapper),this._visible=r}_renderSpinner(e,t){const n=Math.max(2,e/10);this._loaderEl.style.cssText=`\n width: ${e}px;\n height: ${e}px;\n border: ${n}px solid ${t};\n border-top-color: transparent;\n `}_renderDots(e,t){const n=e/4,s=n/2;this._loaderEl.style.setProperty("--dot-gap",`${s}px`);for(let e=0;e<3;e++){const e=document.createElement("span");e.style.cssText=`\n width: ${n}px;\n height: ${n}px;\n background: ${t};\n `,this._loaderEl.appendChild(e)}}_renderPulse(e,t){this._loaderEl.style.cssText=`\n width: ${e}px;\n height: ${e}px;\n background: ${t};\n `}_renderBars(e,t){const n=e/6,s=e,o=n/2;this._loaderEl.style.cssText=`\n height: ${s}px;\n `,this._loaderEl.style.setProperty("--bar-gap",`${o}px`);for(let e=0;e<4;e++){const e=document.createElement("span");e.style.cssText=`\n width: ${n}px;\n height: 100%;\n background: ${t};\n `,this._loaderEl.appendChild(e)}}_onAttributeChange(e,t,n){if(this._wrapper)switch(e){case"type":case"size":case"color":this._loaderEl.remove(),this._textEl&&this._textEl.remove(),this._loaderEl=document.createElement("div"),this._loaderEl.className=`loader-${this._options.type}`,this._loaderEl.setAttribute("part","loader");const e=this._getSize(),t=this._getColor();switch(this._options.type){case"dots":this._renderDots(e,t);break;case"pulse":this._renderPulse(e,t);break;case"bars":this._renderBars(e,t);break;default:this._renderSpinner(e,t)}this._wrapper.insertBefore(this._loaderEl,this._wrapper.firstChild);break;case"text":n?(this._textEl||(this._textEl=document.createElement("span"),this._textEl.className="loader-text",this._textEl.setAttribute("part","text"),this._wrapper.appendChild(this._textEl)),this._textEl.textContent=n):this._textEl&&(this._textEl.remove(),this._textEl=null);break;case"overlay":this._wrapper.classList.toggle("overlay",""===n||"true"===n);break;case"centered":this._wrapper.classList.toggle("centered",""===n||"true"===n);break;case"visible":const s=""===n||"true"===n;this._visible=s,this._wrapper.classList.toggle("hidden",!s)}}show(){return this._visible=!0,this._wrapper.classList.remove("hidden"),this.setAttribute("visible",""),this._emit("show"),this}hide(){return this._visible=!1,this._wrapper.classList.add("hidden"),this.removeAttribute("visible"),this._emit("hide"),this}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}setText(e){return this.setAttribute("text",e),this}setType(e){return this.setAttribute("type",e),this}setSize(e){return this.setAttribute("size",String(e)),this}setColor(e){return this.setAttribute("color",e),this}}customElements.get("domma-loader")||customElements.define("domma-loader",Mt);class Lt extends _t{static defaults={showAfter:null,duration:300,position:"bottom-right",offset:16,target:null,zIndex:1e3,visible:!1};static get observedAttributes(){return["show-after","duration","position","offset","target","z-index","visible"]}constructor(){super(),this._isVisible=!1,this._isScrolling=!1,this._scrollContainer=null,this._scrollHandler=null}_injectStyles(){const e=document.createElement("style");e.textContent="\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n position: fixed;\n z-index: var(--z-index, 1000);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .back-to-top-button {\n padding: 0.5rem;\n background: var(--dm-surface, #fff);\n border: 1px solid var(--dm-border, #dee2e6);\n border-radius: 9999px;\n cursor: pointer;\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n visibility: hidden;\n transform: translateY(10px);\n transition: opacity 0.2s ease, transform 0.15s ease, visibility 0.2s, background 0.2s ease, box-shadow 0.15s ease;\n }\n\n .back-to-top-button.visible {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .back-to-top-button:hover {\n background: var(--dm-hover-bg, rgba(0,0,0,0.04));\n transform: translateY(0) scale(1.1);\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n }\n\n svg {\n color: var(--dm-text, #212529);\n }\n ",this.shadowRoot.appendChild(e)}_render(){const{position:e,offset:t,zIndex:n}=this._options,s="bottom-left"===e;this.style.position="fixed",this.style.bottom=`${t}px`,this.style[s?"left":"right"]=`${t}px`,this.style.zIndex=n,this._button=document.createElement("button"),this._button.className="back-to-top-button",this._button.setAttribute("part","button"),this._button.setAttribute("title","Back to top"),this._button.setAttribute("aria-label","Scroll back to top");const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","20"),o.setAttribute("height","20"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M18 15l-6-6-6 6"),o.appendChild(i),this._button.appendChild(o),this.shadowRoot.appendChild(this._button)}_bindEvents(){this._addEventListener(this._button,"click",e=>{e.preventDefault(),this.scroll()}),this._setupScrollMonitoring()}_setupScrollMonitoring(){if(this._scrollHandler){(this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler)}this._options.target?this._scrollContainer="string"==typeof this._options.target?document.querySelector(this._options.target):this._options.target:this._scrollContainer=null;const e=this._scrollContainer||window;this._scrollHandler=()=>this._checkVisibility(),e.addEventListener("scroll",this._scrollHandler,{passive:!0}),this._checkVisibility()}_checkVisibility(){const e=this._options.showAfter??(this._scrollContainer?this._scrollContainer.clientHeight:window.innerHeight),t=(this._scrollContainer?this._scrollContainer.scrollTop:window.scrollY)>e;t&&!this._isVisible?this.show():!t&&this._isVisible&&this.hide()}_onAttributeChange(e,t,n){switch(e){case"position":case"offset":case"z-index":const{position:e,offset:t,zIndex:s}=this._options,o="bottom-left"===e;this.style.bottom=`${t}px`,this.style.left=o?`${t}px`:"",this.style.right=o?"":`${t}px`,this.style.zIndex=s;break;case"target":case"show-after":this._setupScrollMonitoring();break;case"visible":""===n||"true"===n?this.show():this.hide()}}_onConnect(){this._setupScrollMonitoring()}_onDisconnect(){if(this._scrollHandler){(this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler)}}scroll(){if(this._isScrolling)return this;this._isScrolling=!0;const e=this._scrollContainer?this._scrollContainer.scrollTop:window.scrollY,t=performance.now(),n=this._options.duration,s=o=>{const i=o-t,r=Math.min(i/n,1),a=(l=r)*(2-l);var l;this._scrollContainer?this._scrollContainer.scrollTop=e*(1-a):window.scrollTo(0,e*(1-a)),r<1?requestAnimationFrame(s):this._isScrolling=!1};return requestAnimationFrame(s),this}show(){return this._isVisible||(this._isVisible=!0,this._button.classList.add("visible"),this._emit("show")),this}hide(){return this._isVisible?(this._isVisible=!1,this._button.classList.remove("visible"),this._emit("hide"),this):this}toggle(){return this._isVisible?this.hide():this.show()}isVisible(){return this._isVisible}getButton(){return this._button}setShowAfter(e){return this.setAttribute("show-after",String(e)),this}setPosition(e){return this.setAttribute("position",e),this}setOffset(e){return this.setAttribute("offset",String(e)),this}}customElements.get("domma-back-to-top")||customElements.define("domma-back-to-top",Lt);class Ct extends _t{static defaults={message:"",title:"",type:"default",position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,html:!1,icon:"",actions:[],visible:!1};static get observedAttributes(){return["message","title","type","position","duration","pause-on-hover","show-progress","animation","animation-duration","closable","html","icon","visible"]}constructor(){super(),this._progressBar=null,this._timeout=null,this._isPaused=!1,this._remainingTime=0,this._startTime=null,this._isVisible=!1}_injectStyles(){const e=document.createElement("style");e.textContent=`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n min-width: 300px;\n max-width: 500px;\n margin-bottom: 12px;\n opacity: 0;\n transform: translateX(100%);\n transition: opacity ${this._options.animationDuration}ms ease,\n transform ${this._options.animationDuration}ms ease;\n }\n\n :host([hidden]) { display: none; }\n :host(.show) { opacity: 1; transform: translateX(0); }\n :host(.hiding) { opacity: 0; transform: translateX(100%); }\n\n .toast {\n position: relative;\n display: flex;\n align-items: flex-start;\n padding: 16px;\n background: var(--toast-bg);\n color: var(--toast-color);\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n overflow: hidden;\n }\n\n :host([type="default"]) { --toast-bg: #1f2937; --toast-color: #fff; --toast-accent: #6b7280; }\n :host([type="success"]) { --toast-bg: #065f46; --toast-color: #fff; --toast-accent: #10b981; }\n :host([type="error"]) { --toast-bg: #991b1b; --toast-color: #fff; --toast-accent: #ef4444; }\n :host([type="warning"]) { --toast-bg: #92400e; --toast-color: #fff; --toast-accent: #f59e0b; }\n :host([type="info"]) { --toast-bg: #1e40af; --toast-color: #fff; --toast-accent: #3b82f6; }\n\n .toast-icon { flex-shrink: 0; margin-right: 12px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }\n .toast-icon svg { width: 20px; height: 20px; }\n .toast-content { flex: 1; min-width: 0; }\n .toast-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }\n .toast-message { font-size: 14px; line-height: 1.4; }\n .toast-actions { display: flex; gap: 8px; margin-top: 8px; }\n .toast-close { flex-shrink: 0; margin-left: 12px; padding: 0; background: none; border: none; color: currentColor; cursor: pointer; opacity: 0.7; transition: opacity 0.15s ease; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }\n .toast-close:hover { opacity: 1; }\n .toast-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }\n .toast-progress-bar { height: 100%; background: var(--toast-accent); transition: width linear; }\n `,this.shadowRoot.appendChild(e)}_render(){const{message:e,title:t,closable:n,icon:s,showProgress:o}=this._options,i=document.createElement("div");i.className="toast";const r="error"===this._options.type;if(i.setAttribute("role",r?"alert":"status"),i.setAttribute("aria-live",r?"assertive":"polite"),i.setAttribute("aria-atomic","true"),s){const e=document.createElement("div");e.className="toast-icon",e.innerHTML=s,i.appendChild(e)}const a=document.createElement("div");if(a.className="toast-content",t){const e=document.createElement("div");e.className="toast-title",e.textContent=t,a.appendChild(e)}const l=document.createElement("div");if(l.className="toast-message",this._options.html?l.innerHTML=e:l.textContent=e,a.appendChild(l),this._options.actions&&this._options.actions.length&&this._renderActions(a),i.appendChild(a),n){const e=document.createElement("button");e.className="toast-close",e.setAttribute("aria-label","Close"),e.innerHTML="×",this._addEventListener(e,"click",()=>this.close()),i.appendChild(e)}if(o&&this._options.duration>0){const e=document.createElement("div");e.className="toast-progress",this._progressBar=document.createElement("div"),this._progressBar.className="toast-progress-bar",this._progressBar.style.width="100%",e.appendChild(this._progressBar),i.appendChild(e)}this.shadowRoot.appendChild(i),this._toast=i}_renderActions(e){const t=document.createElement("div");t.className="toast-actions",this._options.actions.forEach((e,n)=>{const s=document.createElement("button");s.textContent=e.label,s.style.cssText=`padding: 6px 12px; border: none; border-radius: 4px; font-size: 12px; font-weight: 500; cursor: pointer; background: ${e.primary?"var(--toast-accent)":"rgba(255,255,255,0.2)"}; color: #fff;`,this._addEventListener(s,"click",()=>{this._emit("action",{action:e,index:n}),!1!==e.closeOnClick&&this.close()}),t.appendChild(s)}),e.appendChild(t)}_bindEvents(){this._options.pauseOnHover&&(this._addEventListener(this._toast,"mouseenter",()=>this._pause()),this._addEventListener(this._toast,"mouseleave",()=>this._resume()))}_onAttributeChange(e,t,n){if(this._toast)switch(e){case"message":case"title":case"icon":this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents();break;case"visible":""===n||"true"===n?this.show():this.close();break;case"duration":this._options.duration=parseInt(n,10),this._isVisible&&this._options.duration>0&&this._startTimer()}}_onConnect(){this._options.visible&&this.show()}_onDisconnect(){this._clearTimer()}show(){return this._isVisible||(this._isVisible=!0,this._remainingTime=this._options.duration,requestAnimationFrame(()=>{this.classList.add("show"),this.classList.remove("hiding")}),this._options.duration>0&&this._startTimer(),this._emit("show")),this}close(){return this._isVisible?(this._clearTimer(),this._isVisible=!1,this.classList.add("hiding"),this.classList.remove("show"),setTimeout(()=>{this._emit("close"),this.remove()},this._options.animationDuration),this):this}_startTimer(){this._clearTimer(),this._options.duration<=0||(this._startTime=Date.now(),this._timeout=setTimeout(()=>this.close(),this._remainingTime),this._progressBar&&(this._progressBar.style.transition=`width ${this._remainingTime}ms linear`,requestAnimationFrame(()=>this._progressBar.style.width="0%")))}_clearTimer(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null)}_pause(){if(this._isPaused||!this._timeout)return;this._isPaused=!0,this._clearTimer();const e=Date.now()-this._startTime;if(this._remainingTime=Math.max(0,this._remainingTime-e),this._progressBar){this._progressBar.style.transition="none";const e=parseFloat(getComputedStyle(this._progressBar).width);this._progressBar.style.width=e+"px"}this._emit("pause")}_resume(){this._isPaused&&(this._isPaused=!1,this._startTimer(),this._emit("resume"))}setMessage(e){return this.setAttribute("message",e),this}setTitle(e){return this.setAttribute("title",e),this}setType(e){return this.setAttribute("type",e),this}setActions(e){this._options.actions=e;const t=this._toast.querySelector(".toast-content"),n=t.querySelector(".toast-actions");return n&&n.remove(),e&&e.length&&this._renderActions(t),this}isVisible(){return this._isVisible}}customElements.get("domma-toast")||customElements.define("domma-toast",Ct);class Et extends _t{static defaults={backdrop:!0,backdropClose:!0,keyboard:!0,animation:"fade",animationDuration:300,closeButton:!0,size:"medium",centered:!0,scrollable:!1,title:"",content:"",footer:"",buttons:[],className:"",headerClass:"",bodyClass:"",footerClass:"",visible:!1};static get observedAttributes(){return["visible","backdrop","backdrop-close","keyboard","animation","animation-duration","close-button","size","centered","scrollable","title","content","footer","class-name"]}constructor(){super(),this._backdrop=null,this._isOpen=!1,this._keyHandler=null,this._dialog=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: none;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1050;\n align-items: center;\n justify-content: center;\n }\n\n :host([visible]) {\n display: flex;\n }\n\n .modal-dialog {\n background: var(--dm-surface, #fff);\n border-radius: 8px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n max-width: 90%;\n max-height: 90vh;\n overflow: hidden;\n position: relative;\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n transition: opacity var(--animation-duration, 300ms) ease,\n transform var(--animation-duration, 300ms) ease;\n }\n\n :host(.show) .modal-dialog {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n\n :host([size="small"]) .modal-dialog { max-width: 400px; }\n :host([size="medium"]) .modal-dialog { max-width: 600px; }\n :host([size="large"]) .modal-dialog { max-width: 800px; }\n :host([size="xl"]) .modal-dialog { max-width: 1000px; }\n\n :host([animation="zoom"]) .modal-dialog {\n transform: scale(0.7);\n }\n\n :host([animation="zoom"].show) .modal-dialog {\n transform: scale(1);\n }\n\n :host([animation="slide"]) .modal-dialog {\n transform: translateY(-50px);\n }\n\n :host([animation="slide"].show) .modal-dialog {\n transform: translateY(0);\n }\n\n .modal-content {\n display: flex;\n flex-direction: column;\n }\n\n .modal-header {\n position: relative;\n padding: 1.5rem 1.5rem 1rem;\n border-bottom: 1px solid var(--dm-border, #e5e7eb);\n }\n\n .modal-title {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--dm-text, #212529);\n }\n\n .modal-close {\n position: absolute;\n right: 1rem;\n top: 1rem;\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: var(--dm-text-muted, #6b7280);\n line-height: 1;\n padding: 0;\n width: 2rem;\n height: 2rem;\n transition: color 0.15s ease;\n }\n\n .modal-close:hover {\n color: var(--dm-text, #212529);\n }\n\n .modal-body {\n padding: 1.5rem;\n color: var(--dm-text, #212529);\n }\n\n .modal-body-scrollable {\n max-height: 60vh;\n overflow-y: auto;\n }\n\n .modal-footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n background: var(--dm-surface-secondary, var(--dm-surface, #f9fafb)); /* --dm-surface-subtle is in no theme: dark themes got a white footer */\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: -1;\n opacity: 0;\n transition: opacity var(--animation-duration, 300ms) ease;\n }\n\n :host(.show) .modal-backdrop {\n opacity: 1;\n }\n\n /* Button styles */\n button:not(.modal-close) {\n padding: 0.5rem 1rem;\n border: none;\n border-radius: 4px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n\n .btn-primary {\n background: var(--dm-primary, #6495ED);\n color: white;\n }\n\n .btn-primary:hover {\n background: var(--dm-primary-dark, #4169E1);\n }\n\n .btn-secondary {\n background: var(--dm-secondary, #6c757d);\n color: white;\n }\n\n .btn-secondary:hover {\n background: var(--dm-secondary-dark, #5a6268);\n }\n\n .btn-success {\n background: var(--dm-success, #28a745);\n color: white;\n }\n\n .btn-success:hover {\n background: var(--dm-success-dark, #218838);\n }\n\n .btn-danger {\n background: var(--dm-danger, #dc3545);\n color: white;\n }\n\n .btn-danger:hover {\n background: var(--dm-danger-dark, #c82333);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const{title:e,content:t,footer:n,closeButton:s,buttons:o,headerClass:i,bodyClass:r,footerClass:a,scrollable:l,backdrop:d}=this._options;d&&(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",this.shadowRoot.appendChild(this._backdrop)),this._dialog=document.createElement("div"),this._dialog.className="modal-dialog",this._dialog.setAttribute("part","dialog"),this._dialog.setAttribute("role","dialog"),this._dialog.setAttribute("aria-modal","true");const c=document.createElement("div");if(c.className="modal-content",e||s){const t=document.createElement("div");if(t.className="modal-header"+(i?" "+i:""),t.setAttribute("part","header"),e){const n=document.createElement("h3");n.className="modal-title",n.textContent=e,t.appendChild(n)}if(s){const e=document.createElement("button");e.className="modal-close",e.setAttribute("part","close"),e.setAttribute("aria-label","Close"),e.innerHTML="×",this._addEventListener(e,"click",()=>this.close()),t.appendChild(e)}c.appendChild(t)}const h=document.createElement("div");h.className=`modal-body${r?" "+r:""}${l?" modal-body-scrollable":""}`,h.setAttribute("part","body");const u=document.createElement("slot");if(t?h.textContent=t:h.appendChild(u),c.appendChild(h),o&&o.length>0)this._renderFooter(c,o,a);else if(n){const e=document.createElement("div");e.className="modal-footer"+(a?" "+a:""),e.setAttribute("part","footer"),e.textContent=n,c.appendChild(e)}this._dialog.appendChild(c),this.shadowRoot.appendChild(this._dialog)}_renderFooter(e,t,n){const s=document.createElement("div");s.className="modal-footer"+(n?" "+n:""),s.setAttribute("part","footer"),t.forEach((e,t)=>{const n=document.createElement("button");n.className=`btn btn-${e.variant||"secondary"}`,n.textContent=e.text||"Button",n.setAttribute("data-button-id",e.id||`btn-${t}`),this._addEventListener(n,"click",()=>{this._emit("buttonclick",{buttonId:e.id||`btn-${t}`,button:e}),!1!==e.close&&this.close()}),s.appendChild(n)}),e.appendChild(s)}_bindEvents(){this._options.keyboard&&(this._keyHandler=e=>{"Escape"===e.key&&this._isOpen&&this.close()},document.addEventListener("keydown",this._keyHandler)),this._backdrop&&this._options.backdropClose&&this._addEventListener(this,"click",e=>{e.target===this&&this.close()})}_onAttributeChange(e,t,n){if(this._dialog)switch(e){case"visible":""===n||"true"===n?this.open():this.close();break;case"title":case"content":case"footer":case"close-button":this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents()}}_onConnect(){this._options.visible&&this.open()}_onDisconnect(){this._keyHandler&&document.removeEventListener("keydown",this._keyHandler)}open(){return this._isOpen||(this._isOpen=!0,this.setAttribute("visible",""),this._emit("open"),requestAnimationFrame(()=>{this.classList.add("show")}),setTimeout(()=>{this._emit("opened")},this._options.animationDuration)),this}close(){return this._isOpen?(this._emit("close"),this.classList.remove("show"),setTimeout(()=>{this._isOpen=!1,this.removeAttribute("visible"),this._emit("closed")},this._options.animationDuration),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setTitle(e){return this.setAttribute("title",e),this}setContent(e){const t=this._dialog.querySelector(".modal-body");return t&&(t.textContent=e),this}setButtons(e){this._options.buttons=e;const t=this._dialog.querySelector(".modal-content"),n=t.querySelector(".modal-footer");return n&&n.remove(),e&&e.length>0&&this._renderFooter(t,e,this._options.footerClass),this}}customElements.get("domma-modal")||customElements.define("domma-modal",Et);class At extends _t{static defaults={hoverable:!0,shadow:"medium",rounded:!0,animation:!0,animationDuration:200,collapsible:!1,collapsed:!1,persistKey:null,collapseIcon:"chevron-down",visible:!0};static get observedAttributes(){return["hoverable","shadow","rounded","animation","animation-duration","collapsible","collapsed","persist-key","collapse-icon","visible"]}constructor(){super(),this._header=null,this._body=null,this._collapseIcon=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n background: var(--dm-surface, #fff);\n border: 1px solid var(--dm-border, #e5e7eb);\n border-radius: 8px;\n overflow: hidden;\n margin-bottom: 1.5rem;\n transition: transform var(--animation-duration, 200ms) ease,\n box-shadow var(--animation-duration, 200ms) ease;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host([shadow="none"]) {\n box-shadow: none;\n }\n\n :host([shadow="small"]) {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n }\n\n :host([shadow="medium"]) {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n }\n\n :host([shadow="large"]) {\n box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);\n }\n\n :host([rounded="false"]) {\n border-radius: 0;\n }\n\n :host([hoverable]:hover) {\n transform: scale(1.02);\n box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);\n }\n\n :host([animation="false"]) {\n transition: none;\n }\n\n /* Collapsible styles */\n :host([collapsible]) ::slotted(.card-header),\n .card-header-wrapper[data-collapsible="true"] {\n cursor: pointer;\n user-select: none;\n }\n\n .card-header-wrapper {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n border-bottom: 1px solid var(--dm-card-border, var(--dm-border, #e5e7eb));\n background: var(--dm-card-header-bg, var(--dm-surface-secondary, #f8fafc));\n }\n\n .card-header-content {\n flex: 1;\n background: transparent;\n }\n\n /* Strip the slotted header\'s own background/border so the wrapper provides\n a single uniform background across the full header row (text + icon).\n Without this, the text area gets double-tinted and looks darker\n than the transparent arrow area. */\n :host([collapsible]) ::slotted(.card-header) {\n background: transparent !important;\n border-bottom: none !important;\n }\n\n .card-collapse-icon {\n margin-left: 1rem;\n display: flex;\n align-items: center;\n transition: transform 200ms ease;\n color: var(--dm-text-secondary);\n background: transparent;\n padding: 1rem 1.5rem;\n }\n\n :host([collapsed]) .card-collapse-icon {\n transform: rotate(-90deg);\n }\n\n .card-body-wrapper {\n overflow: hidden;\n transition: height 200ms ease;\n }\n\n :host([collapsed]) .card-body-wrapper {\n height: 0 !important;\n }\n\n ::slotted(.card-header) {\n margin: 0;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--dm-card-border, var(--dm-border, #e5e7eb));\n background: var(--dm-card-header-bg, var(--dm-surface-secondary, #f8fafc));\n }\n\n ::slotted(.card-body) {\n padding: 1.5rem;\n }\n\n ::slotted(.card-footer) {\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n background: var(--dm-background-alt, #f8fafc);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const{collapsible:e,collapsed:t}=this._options,n=document.createElement("slot");n.name="header";const s=document.createElement("slot");s.name="body";const o=document.createElement("slot");o.name="footer";const i=document.createElement("slot");if(this._bodyWrapper=document.createElement("div"),this._bodyWrapper.className="card-body-wrapper",e){this._headerWrapper=document.createElement("div"),this._headerWrapper.className="card-header-wrapper",this._headerWrapper.setAttribute("data-collapsible","true");const e=document.createElement("div");e.className="card-header-content",e.appendChild(n),this._collapseIcon=document.createElement("span"),this._collapseIcon.className="card-collapse-icon",this._collapseIcon.innerHTML=this._getCollapseIconSVG(),this._headerWrapper.appendChild(e),this._headerWrapper.appendChild(this._collapseIcon),this.shadowRoot.appendChild(this._headerWrapper)}else this.shadowRoot.appendChild(n);this._bodyWrapper.appendChild(s),this._bodyWrapper.appendChild(i),this.shadowRoot.appendChild(this._bodyWrapper),this.shadowRoot.appendChild(o)}_getCollapseIconSVG(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>'}_bindEvents(){this._options.collapsible&&this._headerWrapper&&this._addEventListener(this._headerWrapper,"click",()=>this.toggle())}_onAttributeChange(e,t,n){switch(e){case"collapsed":{const e=""===n||"true"===n;this.isCollapsed()!==e&&this._setCollapsed(e,!1);break}case"collapsible":(this._headerWrapper||this._collapseIcon)&&(this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents())}}_onConnect(){this._options.collapsible&&this._headerWrapper&&0===this._eventHandlers.length&&this._addEventListener(this._headerWrapper,"click",()=>this.toggle()),this._options.collapsible&&this._restoreState()}_onDisconnect(){this._options.collapsible&&this.isCollapsed()&&this._saveState()}_getStorageKey(){return this._options.persistKey||(this.id?`domma-card-${this.id}`:null)}_restoreState(){if(!this._options.collapsible)return;const e=this._getStorageKey();if(e&&"undefined"!=typeof Domma&&Domma.storage){const t=Domma.storage.get(e);if(t?.collapsed)return void this._setCollapsed(!0,!1)}this._options.collapsed&&this._setCollapsed(!0,!1)}_saveState(){const e=this._getStorageKey();e&&"undefined"!=typeof Domma&&Domma.storage&&Domma.storage.set(e,{collapsed:this.isCollapsed()})}_setCollapsed(e,t=!0){if(this._bodyWrapper){if(e){const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px",this._bodyWrapper.offsetHeight,this._bodyWrapper.style.height="0px",this.setAttribute("collapsed",""),this._emit("collapse")}else{this.removeAttribute("collapsed");const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px",setTimeout(()=>{this._bodyWrapper&&!this.hasAttribute("collapsed")&&(this._bodyWrapper.style.height="auto")},this._options.animationDuration),this._emit("expand")}t&&this._saveState()}}collapse(){return this._setCollapsed(!0),this}expand(){return this._setCollapsed(!1),this}toggle(){return this._setCollapsed(!this.isCollapsed()),this}isCollapsed(){return this.hasAttribute("collapsed")}setShadow(e){return this.setAttribute("shadow",e),this}setHoverable(e){return e?this.setAttribute("hoverable",""):this.removeAttribute("hoverable"),this}setContent(e){let t=this.querySelector('[slot="body"]');t||(t=document.createElement("div"),t.setAttribute("slot","body"),t.className="card-body",this.appendChild(t));const n="undefined"!=typeof Domma&&Domma.sanitize&&"function"==typeof Domma.sanitize.sanitize?Domma.sanitize.sanitize(e):e;return t.innerHTML=n,"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(t),this}getBody(){let e=this.querySelector('[slot="body"]');return e||(e=document.createElement("div"),e.setAttribute("slot","body"),e.className="card-body",this.appendChild(e)),e}updateHeight(){if(this._options.collapsible&&!this.isCollapsed()&&this._bodyWrapper){this._bodyWrapper.style.height="auto";const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px"}return this}}function St(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function $t(e,t,n){if(e&&t)for(const s of Array.from(e.attributes)){const o=s.name;if("class"!==o)t.hasAttribute(o)||t.setAttribute(o,s.value);else for(const s of e.classList)s!==n&&t.classList.add(s)}}function zt(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-loader");for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,e=>{n(s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):null!=n&&s.setAttribute(St(e),String(n));return n.appendChild(s),s._dommaComponent=s,{element:s,options:s._options,show(){return s.show(),this},hide(){return s.hide(),this},toggle(){return s.toggle(),this},isVisible:()=>s.isVisible(),setText(e){return s.setText(e),this},setType(e){return s.setType(e),this},setSize(e){return s.setSize(e),this},setColor(e){return s.setColor(e),this},destroy(){s.destroy()}}}customElements.get("domma-card")||customElements.define("domma-card",At);class jt{static defaults={position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,maxToasts:5};static _containers={};static _toasts=[];static _getContainer(e){if(!jt._containers[e]){const t=document.createElement("div");t.className=`domma-toast-container domma-toast-${e}`,t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.cssText=`\n position: fixed;\n z-index: 9999;\n pointer-events: none;\n ${e.includes("top")?"top: 16px;":"bottom: 16px;"}\n ${e.includes("right")?"right: 16px;":"left: 16px;"}\n display: flex;\n flex-direction: column;\n gap: 12px;\n `,document.body.appendChild(t),jt._containers[e]=t}return jt._containers[e]}static show(e,t={}){const n={...jt.defaults,...t},s=jt._getContainer(n.position);for(;jt._toasts.length>=n.maxToasts;){const e=jt._toasts.shift();e&&e.close()}const o=document.createElement("domma-toast");o.style.pointerEvents="auto",o.setAttribute("role","error"===n.type?"alert":"status"),o.setAttribute("aria-live","error"===n.type?"assertive":"polite"),o.setAttribute("aria-atomic","true"),o.setAttribute("message",e),n.title&&o.setAttribute("title",n.title),n.type&&o.setAttribute("type",n.type),n.position&&o.setAttribute("position",n.position),void 0!==n.duration&&o.setAttribute("duration",String(n.duration)),void 0!==n.pauseOnHover&&o.setAttribute("pause-on-hover",String(n.pauseOnHover)),void 0!==n.showProgress&&o.setAttribute("show-progress",String(n.showProgress)),n.animation&&o.setAttribute("animation",n.animation),void 0!==n.animationDuration&&o.setAttribute("animation-duration",String(n.animationDuration)),void 0!==n.closable&&o.setAttribute("closable",String(n.closable)),void 0!==n.html&&o.setAttribute("html",String(n.html)),n.icon&&o.setAttribute("icon",n.icon),n.actions&&n.actions.length>0&&(o._options=o._options||{},o._options.actions=n.actions);for(const[e,t]of Object.entries(n))if("function"==typeof t){const n=e.replace(/^on/,"").toLowerCase(),s=e=>t(e.detail||o);o.addEventListener(n,s)}s.appendChild(o),o.show();const i={element:o,close(){o.close();const e=jt._toasts.indexOf(i);return e>-1&&jt._toasts.splice(e,1),this},setMessage(e){return o.setMessage(e),this},setTitle(e){return o.setTitle(e),this},setType(e){return o.setType(e),this},setActions(e){return o.setActions(e),this},isVisible:()=>o.isVisible()};return jt._toasts.push(i),i}static success(e,t={}){return jt.show(e,{...t,type:"success",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>'})}static error(e,t={}){return jt.show(e,{...t,type:"error",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>'})}static warning(e,t={}){return jt.show(e,{...t,type:"warning",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>'})}static info(e,t={}){return jt.show(e,{...t,type:"info",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>'})}static closeAll(){jt._toasts.forEach(e=>e.close()),jt._toasts=[]}}class Bt{static _container=null;static _zIndexBase=1050;static _activeModals=[];static _defaults={size:"large",title:"",content:"",buttons:[{id:"close",text:"Close",variant:"secondary"}],backdrop:!0,backdropClose:!0,keyboard:!0,animation:"fade",animationDuration:300,className:"",headerClass:"",bodyClass:"",footerClass:"",scrollable:!1,onButtonClick:null,onOpen:null,onClose:null};static _ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",this._container.style.cssText="position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1040;",document.body.appendChild(this._container)),this._container}static _getNextZIndex(){return this._zIndexBase+10*this._activeModals.length}static createModal(e={}){const t={...this._defaults,...e},n=this._ensureContainer(),s=document.createElement("domma-modal");if(s.style.zIndex=this._getNextZIndex(),s.style.pointerEvents="auto",t.size&&s.setAttribute("size",t.size),t.title&&s.setAttribute("title",t.title),t.content){const e="undefined"!=typeof window?window.DOMPurify:null;s.innerHTML=e?.sanitize?e.sanitize(t.content):t.content}void 0!==t.backdrop&&s.setAttribute("backdrop",String(t.backdrop)),void 0!==t.backdropClose&&s.setAttribute("backdrop-close",String(t.backdropClose)),void 0!==t.keyboard&&s.setAttribute("keyboard",String(t.keyboard)),t.animation&&s.setAttribute("animation",t.animation),void 0!==t.animationDuration&&s.setAttribute("animation-duration",String(t.animationDuration)),void 0!==t.scrollable&&s.setAttribute("scrollable",String(t.scrollable)),t.className&&s.setAttribute("class-name",t.className),void 0!==t.closeButton&&s.setAttribute("close-button",String(t.closeButton)),t.onOpen&&s.addEventListener("open",()=>t.onOpen(o)),t.onClose&&s.addEventListener("close",()=>t.onClose(o)),t.onButtonClick&&s.addEventListener("buttonclick",e=>{t.onButtonClick(e.detail.buttonId,o)}),t.buttons&&t.buttons.length>0&&(s._options=s._options||{},s._options.buttons=t.buttons,s._options.footerClass=t.footerClass),n.appendChild(s);const o={element:s,_factoryCreated:!0,open(){return s.open(),Bt._activeModals.push(this),this},close(){s.close();const e=Bt._activeModals.indexOf(this);return e>-1&&Bt._activeModals.splice(e,1),this},toggle(){return s.toggle(),this},isOpen:()=>s.isOpen(),setTitle(e){return s.setTitle(e),this},setContent(e){return s.setContent(e),this},setButtons(e){return s.setButtons(e),this},remove(){return this.close(),setTimeout(()=>{s.remove();const e=Bt._activeModals.indexOf(this);e>-1&&Bt._activeModals.splice(e,1)},t.animationDuration),this},destroy(){this.remove()}};return o}static showModal(e={}){return new Promise(t=>{this.createModal({...e,onButtonClick:(n,s)=>{e.onButtonClick&&e.onButtonClick(n,s),t(n)}}).open()})}}class Tt extends h{static defaults={active:0,animation:"fade",animationDuration:200,tabSelector:".tab-item, [data-tab]",panelSelector:".tab-panel, [data-panel]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._activeIndex=this.options.active,this._init()}_init(){if(!this.element)return;const e=this.options;this._tabs=this.element.querySelectorAll(e.tabSelector),this._panels=this.element.querySelectorAll(e.panelSelector);const t=this.element.querySelector(".tabs-list, .tab-list, .nav-tabs, [data-tab-list]")||this.element;t.hasAttribute("role")||t.setAttribute("role","tablist"),this._tabs.forEach((e,t)=>{e.hasAttribute("role")||e.setAttribute("role","tab");const n=this._panels[t];n&&(n.hasAttribute("role")||n.setAttribute("role","tabpanel"),e.id||(e.id="dm-tab-"+Math.random().toString(36).substring(2,9)),n.id||(n.id="dm-panel-"+Math.random().toString(36).substring(2,9)),e.hasAttribute("aria-controls")||e.setAttribute("aria-controls",n.id),n.hasAttribute("aria-labelledby")||n.setAttribute("aria-labelledby",e.id)),this._addEventListener(e,"click",e=>{e.preventDefault(),this.activate(t)})}),this._updateState()}activate(e){if("string"==typeof e){const t=Array.from(this._tabs).findIndex(t=>t.dataset?.tab===e||t.getAttribute("data-tab")===e||t.getAttribute("href")===e||t.getAttribute("href")===`#${e}`);e=-1!==t?t:Number(e)}if(e===this._activeIndex)return this;if(e<0||e>=this._tabs.length)return this;const t=this.options,n=this._activeIndex;return this._activeIndex=e,this._updateState(),t.onChange&&t.onChange({index:e,oldIndex:n,tab:this._tabs[e],panel:this._panels[e]}),this}_updateState(){const e=this.options;this._tabs.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-selected",s?"true":"false"),t.setAttribute("tabindex",s?"0":"-1"),s?t.classList.add(e.activeClass):t.classList.remove(e.activeClass)}),this._panels.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-hidden",s?"false":"true"),s?(t.style.display="block","fade"===e.animation&&(t.style.opacity="0",t.style.transition=`opacity ${e.animationDuration}ms ease`,t.offsetHeight,t.style.opacity="1")):t.style.display="none"})}getActive(){return this._activeIndex}show(e){return this.activate(e)}next(){const e=(this._activeIndex+1)%this._tabs.length;return this.activate(e)}prev(){const e=(this._activeIndex-1+this._tabs.length)%this._tabs.length;return this.activate(e)}}class Dt extends h{static defaults={allowMultiple:!1,multiExpand:null,activeIndex:null,animation:!0,animationDuration:300,headerSelector:".accordion-header, [data-accordion-header]",contentSelector:".accordion-body, .accordion-content, [data-accordion-content]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),null!==this.options.multiExpand&&(this.options.allowMultiple=this.options.multiExpand),this._init()}_init(){if(!this.element)return;const e=this.options;this._headers=this.element.querySelectorAll(e.headerSelector);const t=[...this.element.querySelectorAll(e.contentSelector)];this._contents=t.filter(e=>!t.some(t=>t!==e&&t.contains(e))),this._contents.forEach((t,n)=>{const s=this._headers[n];s&&(s.hasAttribute("role")||"BUTTON"===s.tagName||s.setAttribute("role","button"),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.id||(s.id="dm-accordion-hdr-"+Math.random().toString(36).substring(2,9)),t.id||(t.id="dm-accordion-body-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-controls")||s.setAttribute("aria-controls",t.id),t.hasAttribute("aria-labelledby")||t.setAttribute("aria-labelledby",s.id),t.hasAttribute("role")||t.setAttribute("role","region")),t.style.overflow="hidden",t.style.transition=e.animation?`height ${e.animationDuration}ms ease`:"none";const o=s?.parentElement;let i=o?.classList.contains(e.activeClass);null!==e.activeIndex&&(i=Array.isArray(e.activeIndex)?e.activeIndex.includes(n):e.activeIndex===n,i?o?.classList.add(e.activeClass):o?.classList.remove(e.activeClass)),s&&s.setAttribute("aria-expanded",i?"true":"false"),t.setAttribute("aria-hidden",i?"false":"true"),t.style.height=i?"auto":"0"}),this._headers.forEach((e,t)=>{this._addEventListener(e,"click",()=>{this.toggle(t)}),this._addEventListener(e,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle(t))})})}toggle(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement,i=o?.classList.contains(t.activeClass);return t.allowMultiple||this._headers.forEach((t,n)=>{n!==e&&this._close(n)}),i?this._close(e):this._open(e),t.onChange&&t.onChange({index:e,isOpen:!i,header:n,content:s}),this}_open(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement;n&&n.setAttribute("aria-expanded","true"),s&&s.setAttribute("aria-hidden","false"),o?.classList.add(t.activeClass),s.style.height=s.scrollHeight+"px",setTimeout(()=>{s.style.height="auto"},t.animationDuration)}_close(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement;n&&n.setAttribute("aria-expanded","false"),s&&s.setAttribute("aria-hidden","true"),o?.classList.remove(t.activeClass),s.style.height=s.scrollHeight+"px",s.offsetHeight,s.style.height="0"}open(e){return e>=0&&e<this._headers.length&&this._open(e),this}close(e){return e>=0&&e<this._headers.length&&this._close(e),this}openAll(){return this._headers.forEach((e,t)=>this._open(t)),this}closeAll(){return this._headers.forEach((e,t)=>this._close(t)),this}}class Wt extends h{static defaults={selectable:!1,multiSelect:!1,activeClass:"active",disabledClass:"disabled",itemSelector:".list-group-item",keyboard:!0,loop:!0,focusOnInit:!1,onChange:null,onSelect:null,onDeselect:null};constructor(e,t={}){super(e,t),this._items=[],this._focusedIndex=-1,this._init()}_init(){if(this.element&&(this.refresh(),this.options.selectable&&(this.element.setAttribute("role","listbox"),this.options.multiSelect&&this.element.setAttribute("aria-multiselectable","true")),this._addEventListener(this.element,"click",e=>{if(!this.options.selectable)return;const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;if(t.classList.contains(this.options.disabledClass))return;const n=this._items.indexOf(t);-1!==n&&this._handleItemClick(n,e)}),this._addEventListener(this.element,"focusin",e=>{const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;const n=this._items.indexOf(t);-1!==n&&(this._focusedIndex=n)}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)&&e.setAttribute("aria-disabled","true")}),this.options.keyboard&&this._setupKeyboard(),this._initTabindex(),this.options.focusOnInit&&this._items.length>0)){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));-1!==e&&this._moveFocus(e)}}_initTabindex(){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));this._items.forEach((t,n)=>{t.setAttribute("tabindex",n===e?"0":"-1")}),-1!==e&&(this._focusedIndex=e)}_setupKeyboard(){this._addEventListener(this.element,"keydown",e=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,1));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,-1));break;case"Home":e.preventDefault(),this._moveFocus(this._firstEnabledIndex());break;case"End":e.preventDefault(),this._moveFocus(this._lastEnabledIndex());break;case"Enter":case" ":if(e.preventDefault(),this.options.selectable&&-1!==this._focusedIndex){const t=this._items[this._focusedIndex];t&&!t.classList.contains(this.options.disabledClass)&&this._handleItemClick(this._focusedIndex,e)}}})}_nextEnabledIndex(e,t){const n=this._items.length;if(0===n)return-1;let s=e,o=0;do{if(s+=t,this.options.loop)s=(s%n+n)%n;else{if(s<0)return this._firstEnabledIndex();if(s>=n)return this._lastEnabledIndex()}if(o++,o>n)return-1}while(this._items[s].classList.contains(this.options.disabledClass));return s}_firstEnabledIndex(){return this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass))}_lastEnabledIndex(){for(let e=this._items.length-1;e>=0;e--)if(!this._items[e].classList.contains(this.options.disabledClass))return e;return-1}_moveFocus(e){-1===e||e>=this._items.length||(-1!==this._focusedIndex&&this._items[this._focusedIndex]&&this._items[this._focusedIndex].setAttribute("tabindex","-1"),this._items[e].setAttribute("tabindex","0"),this._items[e].focus({preventScroll:!0}),this._focusedIndex=e)}_handleItemClick(e,t){const n=this._items[e],s=n.classList.contains(this.options.activeClass);if(this.options.multiSelect)s?(n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(n,e,t)):(n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(n,e,t));else{if(this._items.filter((t,n)=>n!==e&&t.classList.contains(this.options.activeClass)).forEach(e=>{e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false");const n=this._items.indexOf(e);this.options.onDeselect&&this.options.onDeselect(e,n,t)}),s)return n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(n,e,t),void(this.options.onChange&&this.options.onChange(this.getSelected(),t));n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(n,e,t)}this.options.onChange&&this.options.onChange(this.getSelected(),t)}_updateAriaSelected(){this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",String(e.classList.contains(this.options.activeClass)))})}select(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.contains(this.options.disabledClass)||(this.options.multiSelect||this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(e,t,null))}),t.classList.add(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(t,e,null),this.options.onChange&&this.options.onChange(this.getSelected(),null)),this}deselect(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(t,e,null),this.options.onChange&&this.options.onChange(this.getSelected(),null),this}toggle(e){if(e<0||e>=this._items.length)return this;return this._items[e].classList.contains(this.options.activeClass)?this.deselect(e):this.select(e)}selectAll(){return this.options.multiSelect?(this._items.forEach((e,t)=>{e.classList.contains(this.options.disabledClass)||(e.classList.add(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(e,t,null))}),this.options.onChange&&this.options.onChange(this.getSelected(),null),this):this}deselectAll(){return this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(e,t,null))}),this.options.onChange&&this.options.onChange(this.getSelected(),null),this}getSelected(){return this._items.filter(e=>e.classList.contains(this.options.activeClass))}isSelected(e){return!(e<0||e>=this._items.length)&&this._items[e].classList.contains(this.options.activeClass)}enable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.disabledClass),t.removeAttribute("aria-disabled"),this}disable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.add(this.options.disabledClass),t.setAttribute("aria-disabled","true"),this}getItems(){return[...this._items]}getItem(e){return this._items[e]||null}refresh(){return this.element?(this._items=Array.from(this.element.querySelectorAll(this.options.itemSelector)),this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",e.classList.contains(this.options.activeClass)?"true":"false")}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}),this._initTabindex(),this):this}destroy(){this._items.forEach(e=>{e.removeAttribute("tabindex"),e.removeAttribute("aria-disabled")}),this.options.selectable&&(this.element.removeAttribute("role"),this.element.removeAttribute("aria-multiselectable"),this._items.forEach(e=>{e.removeAttribute("aria-selected")})),super.destroy()}}class Ht extends h{static defaults={trigger:"click",position:"bottom-start",offset:[0,4],animation:!0,animationDuration:150,hoverOpenDelay:0,hoverCloseDelay:300,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOthers:!0,flip:!0,items:[],model:null,modelKey:null,itemTemplate:null,onOpen:null,onClose:null,onSelect:null};static _open=new Set;constructor(e,t={}){super(e,t),this._menu=null,this._isOpen=!1,this._items=[...this.options.items],this._selectedValue=null,this._modelUnsubscribe=null,this._hoverOpenTimer=null,this._hoverCloseTimer=null,this._removeTimer=null,this._init()}_init(){if(!this.element)return;const e=this.options;this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._addEventListener(this.element,"click",()=>{"hover"===e.trigger?this.open():this.toggle()}),"hover"===e.trigger&&(this._addEventListener(this.element,"mouseenter",()=>this._hoverIn()),this._addEventListener(this.element,"mouseleave",()=>this._hoverOut())),e.closeOnClickOutside&&(this._outsideClickHandler=e=>{this._isOpen&&(this.element.contains(e.target)||this._menu&&this._menu.contains(e.target)||this.close())},document.addEventListener("click",this._outsideClickHandler)),e.closeOnEscape&&(this._keydownHandler=e=>{"Escape"===e.key&&this._isOpen&&(this.close(),"function"==typeof this.element.focus&&this.element.focus())},document.addEventListener("keydown",this._keydownHandler)),e.model&&e.modelKey&&this._bindToModel(e.model,e.modelKey)}_bindToModel(e,t){if(e&&"function"==typeof e.get){const n=e.get(t);Array.isArray(n)&&(this._items=[...n]);const s=e=>{Array.isArray(e)&&(this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()))};"function"==typeof e.onFieldChange?this._modelUnsubscribe=e.onFieldChange(t,s):"function"==typeof e.onChange&&(this._modelUnsubscribe=e.onChange(({field:e,newValue:n})=>{e===t&&s(n)}))}}open(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),this._isOpen)return this;const e=this.options;return e.closeOthers&&Ht._open.forEach(e=>{e!==this&&e.close()}),e.onOpen&&e.onOpen(this),this._menu?(this._renderMenu(),this._menu.style.pointerEvents="",this._menu.classList.add("show")):this._createMenu(),this._isOpen=!0,Ht._open.add(this),this.element.setAttribute("aria-expanded","true"),this._positionMenu(),this._bindOpenListeners(),this}close(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen)return this;const e=this.options,t=e.animation?e.animationDuration:0;this._isOpen=!1,Ht._open.delete(this),this.element.setAttribute("aria-expanded","false"),this._unbindOpenListeners();const n=this._menu;return n&&(n.classList.remove("show"),n.style.pointerEvents="none",this._removeTimer=setTimeout(()=>{this._removeTimer=null,this._menu=null,n.remove()},t)),e.onClose&&e.onClose(this),this}toggle(){return this._isOpen?this.close():this.open()}_hoverIn(){if(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null,this._isOpen)return;const e=this.options.hoverOpenDelay;e?(clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=setTimeout(()=>this.open(),e)):this.open()}_hoverOut(){clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=null,this._scheduleHoverClose()}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{this._hoverCloseTimer=null,this.close()},this.options.hoverCloseDelay)}_pointerInSafeZone(e,t){if(!this.element)return!1;const n=this.element.getBoundingClientRect(),s=this._menu?this._menu.getBoundingClientRect():null,o=n=>!!n&&e>=n.left-2&&e<=n.right+2&&t>=n.top-2&&t<=n.bottom+2;if(o(n))return!0;if(!s)return!1;if(o(s))return!0;if(e<Math.min(n.left,s.left)-2)return!1;if(e>Math.max(n.right,s.right)+2)return!1;if(t<Math.min(n.top,s.top)-2)return!1;if(t>Math.max(n.bottom,s.bottom)+2)return!1;if(s.top>=n.bottom){if(t>=n.bottom-2&&t<=s.top+2)return!0}else if(n.top>=s.bottom&&t>=s.bottom-2&&t<=n.top+2)return!0;if(s.left>=n.right){if(e>=n.right-2&&e<=s.left+2)return!0}else if(n.left>=s.right&&e>=s.right-2&&e<=n.left+2)return!0;return!1}_bindOpenListeners(){this._openListenersBound||(this._openListenersBound=!0,this._repositionHandler=()=>this._positionMenu(),window.addEventListener("resize",this._repositionHandler),window.addEventListener("scroll",this._repositionHandler,!0),"hover"===this.options.trigger&&(this._pointerMoveHandler=e=>{this._isOpen&&(this._pointerInSafeZone(e.clientX,e.clientY)?(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null):this._hoverCloseTimer||this._scheduleHoverClose())},document.addEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerLeaveHandler=()=>this._scheduleHoverClose(),document.documentElement.addEventListener("mouseleave",this._pointerLeaveHandler)))}_unbindOpenListeners(){this._openListenersBound&&(this._openListenersBound=!1,this._repositionHandler&&(window.removeEventListener("resize",this._repositionHandler),window.removeEventListener("scroll",this._repositionHandler,!0),this._repositionHandler=null),this._pointerMoveHandler&&(document.removeEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerMoveHandler=null),this._pointerLeaveHandler&&(document.documentElement.removeEventListener("mouseleave",this._pointerLeaveHandler),this._pointerLeaveHandler=null))}_createMenu(){const e=this.options;this._menu=document.createElement("div"),this._menu.className="domma-dropdown-menu",this._menu.setAttribute("role","menu"),this._renderMenu(),document.body.appendChild(this._menu),this._addEventListener(this._menu,"click",e=>{const t=e.target.closest(".domma-dropdown-item");if(!t||!this._menu||!this._menu.contains(t))return;if(t.classList.contains("disabled"))return;const n=Number(t.dataset.index);this._selectItem(this._items[n],n,t.dataset.value)}),"hover"===e.trigger&&(this._addEventListener(this._menu,"mouseenter",()=>{clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null}),this._addEventListener(this._menu,"mouseleave",()=>this._scheduleHoverClose())),this._menu.offsetHeight,this._menu.classList.add("show")}_renderMenu(){if(!this._menu)return;const e=this.options;this._menu.innerHTML="",this._items.forEach((t,n)=>{const s=document.createElement("div");if(s.className="domma-dropdown-item",s.setAttribute("role","menuitem"),s.dataset.index=n,"string"==typeof t)s.textContent=t,s.dataset.value=t;else{if(t.divider)return s.className="domma-dropdown-divider",s.setAttribute("role","separator"),void this._menu.appendChild(s);if(t.header)return s.className="domma-dropdown-header",s.setAttribute("role","presentation"),s.textContent=t.header,void this._menu.appendChild(s);if(e.itemTemplate?s.innerHTML=e.itemTemplate(t,n):s.textContent=t.label||t.text||t.name||"",s.dataset.value=void 0!==t.value?t.value:n,t.disabled&&(s.classList.add("disabled"),s.setAttribute("aria-disabled","true")),t.icon){const e=document.createElement("span");e.className="domma-dropdown-icon",e.innerHTML=t.icon,s.insertBefore(e,s.firstChild)}}this._menu.appendChild(s)})}_selectItem(e,t,n){const s=this.options;if(this._selectedValue=n,s.onSelect&&s.onSelect({item:e,index:t,value:n},this),s.model&&s.modelKey&&"function"==typeof s.model.set){const e=s.selectedKey||s.modelKey+"_selected";s.model.set(e,n)}s.closeOnSelect&&this.close()}_positionMenu(){if(!this._menu||!this.element)return;const e=this.options,t=this.element.getBoundingClientRect(),[n,s]=e.offset,o=this._menu.offsetWidth,i=this._menu.offsetHeight,r=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=e=>{switch(e){case"bottom-end":return[t.bottom+s,t.right-o+n];case"top-start":return[t.top-i-s,t.left+n];case"top-end":return[t.top-i-s,t.right-o+n];case"left-start":return[t.top+s,t.left-o-n];case"left-end":return[t.bottom-i+s,t.left-o-n];case"right-start":return[t.top+s,t.right+n];case"right-end":return[t.bottom-i+s,t.right+n];default:return[t.bottom+s,t.left+n]}},d=String(e.position||"bottom-start").split("-"),c=["bottom","top","left","right"].includes(d[0])?d[0]:"bottom",h="end"===d[1]?"end":"start";let[u,p]=l(`${c}-${h}`);if(e.flip){const e={bottom:"top",top:"bottom",left:"right",right:"left"},d=a-8-(t.bottom+s),m=t.top-s-8,f=r-8-(t.right+n),g=t.left-n-8;("bottom"===c&&i>d&&m>=i||"top"===c&&i>m&&d>=i||"right"===c&&o>f&&g>=o||"left"===c&&o>g&&f>=o)&&([u,p]=l(`${e[c]}-${h}`)),o<=r-16&&(p=Math.max(8,Math.min(p,r-o-8))),i<=a-16&&(u=Math.max(8,Math.min(u,a-i-8)))}u+=window.scrollY,p+=window.scrollX,this._menu.style.top=u+"px",this._menu.style.left=p+"px"}setItems(e){return this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()),this}addItem(e){return this._items.push(e),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}removeItem(e){return this._items.splice(e,1),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}getSelected(){return this._selectedValue}isOpen(){return this._isOpen}destroy(){super.destroy(),clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),clearTimeout(this._removeTimer),this._unbindOpenListeners(),Ht._open.delete(this),this._outsideClickHandler&&(document.removeEventListener("click",this._outsideClickHandler),this._outsideClickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this._modelUnsubscribe&&"function"==typeof this._modelUnsubscribe&&this._modelUnsubscribe(),this._menu&&(this._menu.remove(),this._menu=null),this._isOpen=!1}}class Ot{static permission="undefined"!=typeof Notification?Notification.permission:"denied";static isSupported="undefined"!=typeof Notification;static _instances=[];static defaults={title:"Notification",body:"",icon:null,badge:null,tag:null,requireInteraction:!1,silent:!1,data:null,onClick:null,onClose:null,onError:null,onShow:null};static async requestPermission(){if(!Ot.isSupported)return console.warn("Notifications are not supported in this browser"),"denied";try{const e=await Notification.requestPermission();return Ot.permission=e,e}catch(e){return console.error("Error requesting notification permission:",e),"denied"}}static notify(e,t={}){const n=new Ot({title:e,...t});return n.show(),n}static closeAll(){Ot._instances.forEach(e=>{e.isShown()&&e.close()}),Ot._instances=[]}constructor(e={}){this.options={...Ot.defaults,...e},this.notification=null,this._shown=!1}async show(){if(!Ot.isSupported)return console.warn("Notifications are not supported in this browser"),this.options.onError&&this.options.onError(new Error("Notifications not supported")),this;if("granted"!==Ot.permission){if("default"!==Ot.permission)return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this;if("granted"!==await Ot.requestPermission())return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this}try{const e={};this.options.body&&(e.body=this.options.body),this.options.icon&&(e.icon=this.options.icon),this.options.badge&&(e.badge=this.options.badge),this.options.tag&&(e.tag=this.options.tag),void 0!==this.options.requireInteraction&&(e.requireInteraction=this.options.requireInteraction),void 0!==this.options.silent&&(e.silent=this.options.silent),this.options.data&&(e.data=this.options.data),this.notification=new Notification(this.options.title,e),this._shown=!0,Ot._instances.push(this),this.options.onClick&&(this.notification.onclick=e=>{this.options.onClick(e,this)}),this.options.onClose?this.notification.onclose=e=>{this._shown=!1;const t=Ot._instances.indexOf(this);t>-1&&Ot._instances.splice(t,1),this.options.onClose(e,this)}:this.notification.onclose=()=>{this._shown=!1;const e=Ot._instances.indexOf(this);e>-1&&Ot._instances.splice(e,1)},this.options.onError&&(this.notification.onerror=e=>{this._shown=!1,this.options.onError(e,this)}),this.options.onShow&&(this.notification.onshow=e=>{this.options.onShow(e,this)})}catch(e){console.error("Error showing notification:",e),this.options.onError&&this.options.onError(e)}return this}close(){return this.notification&&this._shown&&(this.notification.close(),this._shown=!1),this}isShown(){return this._shown}}class It extends h{static defaults={duration:6e4,autoStart:!1,format:"mm:ss",showControls:!1,updateInterval:100,notification:!1,notificationOptions:{},sound:!1,soundUrl:null,onTick:null,onComplete:null,onStart:null,onPause:null,onReset:null};constructor(e,t={}){super(e,t),e||(this.element=null,this.options={...It.defaults,...t}),this._running=!1,this._remaining=this.options.duration,this._intervalId=null,this._startTime=null,this._pausedTime=null,this._display=null,this._controls=null,this._audio=null,this._init()}_init(){this.element&&(this._createDisplay(),this.options.showControls&&this._createControls()),this.options.sound&&this.options.soundUrl&&(this._audio=new Audio(this.options.soundUrl)),this.options.autoStart&&this.start()}_createDisplay(){if(!this.element)return;const e=document.createElement("div");e.className="dm-timer",this._display=document.createElement("div"),this._display.className="dm-timer-display";const t=document.createElement("span");t.className="dm-timer-time",t.textContent=this._formatTime(this._remaining),this._display.appendChild(t),e.appendChild(this._display),this.element.innerHTML="",this.element.appendChild(e),this._container=e}_createControls(){if(!this.element||!this._container)return;const e=document.createElement("div");e.className="dm-timer-controls",this._startBtn=document.createElement("button"),this._startBtn.className="dm-timer-button dm-timer-start",this._startBtn.textContent="Start",this._startBtn.addEventListener("click",()=>this.start()),this._pauseBtn=document.createElement("button"),this._pauseBtn.className="dm-timer-button dm-timer-pause",this._pauseBtn.textContent="Pause",this._pauseBtn.style.display="none",this._pauseBtn.addEventListener("click",()=>this.pause()),this._resetBtn=document.createElement("button"),this._resetBtn.className="dm-timer-button dm-timer-reset",this._resetBtn.textContent="Reset",this._resetBtn.addEventListener("click",()=>this.reset()),e.appendChild(this._startBtn),e.appendChild(this._pauseBtn),e.appendChild(this._resetBtn),this._container.appendChild(e),this._controls=e}_updateDisplay(){if(!this._display)return;const e=this._display.querySelector(".dm-timer-time");e&&(e.textContent=this._formatTime(this._remaining))}_formatTime(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60),o=t%60,i=this.options.format.toLowerCase();if("hh:mm:ss"===i)return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`;if("mm:ss"===i){const e=Math.floor(t/60);return`${String(e).padStart(2,"0")}:${String(o).padStart(2,"0")}`}return"ss"===i?String(t).padStart(2,"0"):`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`}_tick(){if(!this._running)return;const e=Date.now()-this._startTime;this._remaining=Math.max(0,this.options.duration-e),this._updateDisplay(),this.options.onTick&&this.options.onTick(this._remaining),0===this._remaining&&this._complete()}_complete(){if(this.stop(),this.options.sound&&this._audio&&this._audio.play().catch(e=>{console.warn("Failed to play timer sound:",e)}),this.options.notification&&Ot.isSupported){const e={title:"Timer Complete",body:"Your countdown has finished",...this.options.notificationOptions};Ot.notify(e.title,e)}this.options.onComplete&&this.options.onComplete()}start(){return this._running||(this._running=!0,this._startTime=Date.now()-(this.options.duration-this._remaining),this._intervalId=setInterval(()=>this._tick(),this.options.updateInterval),this._startBtn&&(this._startBtn.style.display="none"),this._pauseBtn&&(this._pauseBtn.style.display="inline-block"),this.options.onStart&&this.options.onStart()),this}pause(){return this._running?(this._running=!1,this._pausedTime=Date.now(),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this.options.onPause&&this.options.onPause(),this):this}reset(){return this.stop(),this._remaining=this.options.duration,this._updateDisplay(),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this.options.onReset&&this.options.onReset(),this}stop(){return this._running=!1,this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this}add(e){return this._remaining=Math.min(this._remaining+e,864e5),this._updateDisplay(),this}subtract(e){return this._remaining=Math.max(0,this._remaining-e),this._updateDisplay(),0===this._remaining&&this._running&&this._complete(),this}setDuration(e){return this.options.duration=e,this._running||(this._remaining=e,this._updateDisplay()),this}isRunning(){return this._running}getRemaining(){return this._remaining}getElapsed(){return this.options.duration-this._remaining}destroy(){this.stop(),this._startBtn&&this._startBtn.removeEventListener("click",this.start),this._pauseBtn&&this._pauseBtn.removeEventListener("click",this.pause),this._resetBtn&&this._resetBtn.removeEventListener("click",this.reset),this.element&&this._container&&this.element.removeChild(this._container),this._display=null,this._controls=null,this._audio=null,this._container=null,super.destroy&&super.destroy()}}class Nt{static defaults={alarms:[],timezone:"local",checkInterval:3e4,storageKey:"domma-alarms",onTrigger:null,onSnooze:null,onDismiss:null,onAlarmAdd:null,onAlarmRemove:null};static _instance=null;static _checkInterval=null;static _nextAlarmId=1;constructor(e={}){if(Nt._instance)return Nt._instance;this.options={...Nt.defaults,...e},this._alarms=[],this._init(),Nt._instance=this}_init(){this._loadAlarms(),this._startChecking()}_loadAlarms(){try{const e=localStorage.getItem(this.options.storageKey);if(e){const t=JSON.parse(e);if(this._alarms=Array.isArray(t)?t:[],this._alarms.length>0){const e=Math.max(...this._alarms.map(e=>{const t=String(e.id).match(/\d+$/);return t?parseInt(t[0]):0}));Nt._nextAlarmId=e+1}}else this.options.alarms&&this.options.alarms.length>0&&(this._alarms=this.options.alarms.map(e=>({id:"alarm-"+Nt._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e})),this._saveAlarms())}catch(e){console.error("Failed to load alarms from localStorage:",e),this._alarms=[]}}_saveAlarms(){try{localStorage.setItem(this.options.storageKey,JSON.stringify(this._alarms))}catch(e){console.error("Failed to save alarms to localStorage:",e)}}_startChecking(){Nt._checkInterval||(Nt._checkInterval=setInterval(()=>{this._checkAlarms()},this.options.checkInterval),this._checkAlarms())}_stopChecking(){Nt._checkInterval&&(clearInterval(Nt._checkInterval),Nt._checkInterval=null)}_checkAlarms(){const e=new Date;this._alarms.forEach(t=>{t.enabled&&(t.snoozedUntil&&e<new Date(t.snoozedUntil)||(t.snoozedUntil&&e>=new Date(t.snoozedUntil)&&(t.snoozedUntil=null,this._saveAlarms()),this._shouldTrigger(t,e)&&this._triggerAlarm(t)))})}_shouldTrigger(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),o=t.getHours(),i=t.getMinutes();if(o!==n||i!==s)return!1;if(e.lastTriggered){if(t-new Date(e.lastTriggered)<5e4)return!1}return!!this._matchesRepeatPattern(e,t)}_parseTime(e){const[t,n]=e.split(":").map(e=>parseInt(e,10));return{hours:t,minutes:n}}_matchesRepeatPattern(e,t){if(!e.repeat)return!0;const n=t.getDay();if("daily"===e.repeat)return!0;if("weekdays"===e.repeat)return n>=1&&n<=5;if("weekends"===e.repeat)return 0===n||6===n;if(Array.isArray(e.repeat)){const t=["sun","mon","tue","wed","thu","fri","sat"][n];return e.repeat.includes(t)}return!1}_triggerAlarm(e){if(e.lastTriggered=Date.now(),this._saveAlarms(),e.sound&&e.soundUrl){new Audio(e.soundUrl).play().catch(e=>{console.warn("Failed to play alarm sound:",e)})}if(e.notification&&Ot.isSupported){const t={title:"Alarm",body:e.label||`Alarm at ${e.time}`,requireInteraction:!0,...e.notificationOptions};Ot.notify(t.title,t)}this.options.onTrigger&&this.options.onTrigger(e),e.repeat||(e.enabled=!1,this._saveAlarms())}add(e){const t={id:"alarm-"+Nt._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e};return this._alarms.push(t),this._saveAlarms(),this.options.onAlarmAdd&&this.options.onAlarmAdd(t),t}remove(e){const t=this._alarms.findIndex(t=>t.id===e);if(-1===t)return!1;const n=this._alarms.splice(t,1)[0];return this._saveAlarms(),this.options.onAlarmRemove&&this.options.onAlarmRemove(n),!0}update(e,t){const n=this._alarms.find(t=>t.id===e);return n?(Object.assign(n,t),this._saveAlarms(),n):null}enable(e){return null!==this.update(e,{enabled:!0})}disable(e){return null!==this.update(e,{enabled:!1})}toggle(e){const t=this._alarms.find(t=>t.id===e);return t?(t.enabled=!t.enabled,this._saveAlarms(),t.enabled):null}snooze(e,t=3e5){const n=this._alarms.find(t=>t.id===e);return!!n&&(n.snoozedUntil=Date.now()+t,this._saveAlarms(),this.options.onSnooze&&this.options.onSnooze(n,t),!0)}getAlarms(){return[...this._alarms]}getAlarm(e){return this._alarms.find(t=>t.id===e)||null}getNextAlarm(){const e=new Date;let t=null,n=null;return this._alarms.forEach(s=>{if(!s.enabled)return;const o=this._getNextOccurrence(s,e);o&&(!n||o<n)&&(n=o,t={...s,nextTrigger:o})}),t}_getNextOccurrence(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),o=new Date(t),i=new Date(o);i.setHours(n,s,0,0),i<=o&&i.setDate(i.getDate()+1);for(let t=0;t<7;t++){if(this._matchesRepeatPattern(e,i))return i;i.setDate(i.getDate()+1)}return null}clearAll(){return this._alarms=[],this._saveAlarms(),this}destroy(){this._stopChecking(),this._alarms=[],Nt._instance=null}}class Pt extends h{static defaults={autoplay:!1,interval:5e3,pauseOnHover:!0,loop:!0,animation:"slide",animationDuration:500,animationEasing:"ease",heightMode:"crop",height:null,showArrows:!0,showIndicators:!0,slideSelector:".carousel-slide, [data-slide]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._currentIndex=0,this._autoplayTimer=null,this._isAnimating=!1,this._init()}_init(){if(!this.element)return;const e=this.options;if(this._slides=this.element.querySelectorAll(e.slideSelector),this._track=this.element.querySelector(".carousel-track"),0===this._slides.length)return;this.element.style.position="relative",this.element.style.overflow="hidden";const t="fade"===e.animation||"crossfade"===e.animation;this._slides.forEach((n,s)=>{t?(n.style.position=0===s?"relative":"absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.opacity=0===s?"1":"0",n.style.zIndex=0===s?"1":"0",n.style.transition=`opacity ${e.animationDuration}ms ${e.animationEasing}`):(n.style.position="relative",n.style.width="100%",n.style.flexShrink="0")}),"slide"===e.animation&&this._track&&(this._track.style.display="flex",this._track.style.transition=`transform ${e.animationDuration}ms ${e.animationEasing}`),this._initHeight(),e.showArrows&&this._createArrows(),e.showIndicators&&this._createIndicators(),e.autoplay&&(this._startAutoplay(),e.pauseOnHover&&(this._addEventListener(this.element,"mouseenter",()=>this._stopAutoplay()),this._addEventListener(this.element,"mouseleave",()=>this._startAutoplay()))),this._addEventListener(this.element,"keydown",e=>{"ArrowLeft"===e.key&&this.prev(),"ArrowRight"===e.key&&this.next()}),this.element.tabIndex=0,this._updateState()}_initHeight(){this._images=Array.from(this._slides,e=>e.querySelector(":scope > img")).filter(Boolean),this._originalHeight=this.element.style.getPropertyValue("--dm-carousel-height"),this._originalHeightPriority=this.element.style.getPropertyPriority("--dm-carousel-height"),this._wasSized=this.element.classList.contains("carousel-sized");const e=()=>this._sizeSlides();for(const t of this._images)this._addEventListener(t,"load",e),this._addEventListener(t,"error",e);"undefined"!=typeof ResizeObserver?(this._heightObserver=new ResizeObserver(e),this._heightObserver.observe(this.element)):this._addEventListener(window,"resize",e),e()}_sizeSlides(){const e=this.element.clientWidth,t=Number(this.options.height);let n=t>0&&Number.isFinite(t)?t:0;if(!n){const t=this._images.filter(e=>e.naturalWidth>0&&e.naturalHeight>0).map(t=>e*t.naturalHeight/t.naturalWidth);if(!t.length||!e)return;const s=Math.min(...t);n="average"===this.options.heightMode?(s+Math.max(...t))/2:s;for(const e of this._slides)if(!e.querySelector(":scope > img")){const t=e.style.height;e.style.height="auto",n=Math.max(n,e.scrollHeight),e.style.height=t}}const s=`${n}px`;this.element.style.getPropertyValue("--dm-carousel-height")!==s&&this.element.style.setProperty("--dm-carousel-height",s),this.element.classList.add("carousel-sized")}_applyOptions(){this._images&&this._sizeSlides()}_createArrows(){const e=document.createElement("button");e.className="carousel-arrow carousel-prev",e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>',e.style.cssText="\n position: absolute;\n top: 50%;\n left: 1rem;\n transform: translateY(-50%);\n z-index: 10;\n background: rgba(255,255,255,0.9);\n border: none;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n ",this._addEventListener(e,"click",()=>this.prev()),this._addEventListener(e,"mouseenter",()=>e.style.background="#fff"),this._addEventListener(e,"mouseleave",()=>e.style.background="rgba(255,255,255,0.9)");const t=document.createElement("button");t.className="carousel-arrow carousel-next",t.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>',t.style.cssText=e.style.cssText.replace("left: 1rem","right: 1rem"),this._addEventListener(t,"click",()=>this.next()),this._addEventListener(t,"mouseenter",()=>t.style.background="#fff"),this._addEventListener(t,"mouseleave",()=>t.style.background="rgba(255,255,255,0.9)"),this.element.appendChild(e),this.element.appendChild(t),this._prevBtn=e,this._nextBtn=t}_createIndicators(){const e=document.createElement("div");e.className="carousel-indicators",e.style.cssText="\n position: absolute;\n bottom: 1rem;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 0.5rem;\n z-index: 10;\n ",this._slides.forEach((t,n)=>{const s=document.createElement("button");s.className="carousel-indicator",s.style.cssText="\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.5);\n cursor: pointer;\n padding: 0;\n transition: all 0.2s ease;\n ",this._addEventListener(s,"click",()=>this.goTo(n)),e.appendChild(s)}),this.element.appendChild(e),this._indicators=e}_updateState(e=null){const t=this.options;if("fade"===t.animation?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):"crossfade"===t.animation?null===e||e===this._currentIndex?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):this._applyCrossfade(e,this._currentIndex):this._track&&(this._track.style.transform=`translateX(-${100*this._currentIndex}%)`),this._indicators){this._indicators.querySelectorAll(".carousel-indicator").forEach((e,t)=>{e.style.background=t===this._currentIndex?"rgba(255,255,255,1)":"rgba(255,255,255,0.5)",e.style.transform=t===this._currentIndex?"scale(1.2)":"scale(1)"})}!t.loop&&this._prevBtn&&this._nextBtn&&(this._prevBtn.style.opacity=0===this._currentIndex?"0.3":"1",this._prevBtn.style.pointerEvents=0===this._currentIndex?"none":"auto",this._nextBtn.style.opacity=this._currentIndex===this._slides.length-1?"0.3":"1",this._nextBtn.style.pointerEvents=this._currentIndex===this._slides.length-1?"none":"auto")}_applyCrossfade(e,t){const n=this._slides[e],s=this._slides[t];s.style.position="absolute",s.style.opacity="0",s.style.zIndex="2",n.style.position="relative",n.style.opacity="1",n.style.zIndex="1",this._slides.forEach((n,s)=>{s!==e&&s!==t&&(n.style.position="absolute",n.style.opacity="0",n.style.zIndex="0")}),s.offsetWidth,requestAnimationFrame(()=>{s.style.opacity="1",n.style.opacity="0"}),this._crossfadeSwapTimer&&clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=setTimeout(()=>{s.style.position="relative",s.style.zIndex="1",n.style.position="absolute",n.style.zIndex="0",this._crossfadeSwapTimer=null},this.options.animationDuration)}_startAutoplay(){this._autoplayTimer||(this._autoplayTimer=setInterval(()=>{this.next()},this.options.interval))}_stopAutoplay(){this._autoplayTimer&&(clearInterval(this._autoplayTimer),this._autoplayTimer=null)}goTo(e){if(this._isAnimating)return this;const t=this.options,n=this._currentIndex,s=this._slides.length-1;if(t.loop)e<0&&(e=s),e>s&&(e=0);else if(e<0||e>s)return this;return e===this._currentIndex||(this._isAnimating=!0,this._currentIndex=e,this._updateState(n),setTimeout(()=>{this._isAnimating=!1},t.animationDuration),t.onChange&&t.onChange({index:e,oldIndex:n,slide:this._slides[e]})),this}next(){return this.goTo(this._currentIndex+1)}prev(){return this.goTo(this._currentIndex-1)}play(){return this._startAutoplay(),this}pause(){return this._stopAutoplay(),this}getIndex(){return this._currentIndex}getSlide(e=this._currentIndex){return this._slides[e]}destroy(){super.destroy(),this._stopAutoplay(),this._heightObserver?.disconnect(),this.element&&this._images&&(this._wasSized||this.element.classList.remove("carousel-sized"),this._originalHeight?this.element.style.setProperty("--dm-carousel-height",this._originalHeight,this._originalHeightPriority):this.element.style.removeProperty("--dm-carousel-height")),this._crossfadeSwapTimer&&(clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=null)}}class Vt extends h{static defaults={message:'We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.',acceptAllText:"Accept All",rejectAllText:"Reject All",customizeText:"Customize",savePreferencesText:"Save Preferences",privacyPolicyText:"Privacy Policy",privacyPolicyUrl:"/privacy-policy",cookiePolicyText:"Cookie Policy",cookiePolicyUrl:null,categories:{necessary:{label:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",required:!0},functional:{label:"Functional Cookies",description:"These cookies enable personalized features and functionality.",required:!1},analytics:{label:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",required:!1},marketing:{label:"Marketing Cookies",description:"These cookies are used to deliver relevant ads and marketing campaigns.",required:!1}},position:"bottom",theme:"light",layout:"bar",animation:!0,backdrop:!1,autoShow:!0,hideAfterAction:!0,reopenSelector:"[data-cookie-consent-open]",storageKey:"domma-cookie-consent",storageDuration:365,defaultState:"undecided",requireExplicitConsent:!0,consentVersion:"1.0",onVersionMismatch:null,onAccept:null,onReject:null,onCustomize:null,onChange:null,onShow:null,onHide:null};constructor(e={}){super(null,e),this._state=null,this._preferences={},this._customizeModal=null,this._isVisible=!1,this._init()}_init(){this._loadPreferences(),this._createUI(),this._setupEventHandlers(),this.options.autoShow&&!this._hasConsented()&&this.show(),this._setupReopenTriggers()}_loadPreferences(){const e=Domma.storage.get(this.options.storageKey);if(e&&e.timestamp){if((Date.now()-e.timestamp)/864e5<=this.options.storageDuration)return e.version&&e.version!==this.options.consentVersion?(this._state="undecided",this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),void(this.options.onVersionMismatch&&this.options.onVersionMismatch(e.version,this.options.consentVersion))):(this._state=e.state,void(this._preferences=e.preferences||{}))}this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent})}_savePreferences(){Domma.storage.set(this.options.storageKey,{state:this._state,preferences:this._preferences,timestamp:Date.now(),version:this.options.consentVersion})}_hasConsented(){return"accepted"===this._state||"rejected"===this._state||"customized"===this._state}_createUI(){this.element=document.createElement("div"),this.element.className=`dm-cookie-consent dm-cookie-consent-${this.options.position} dm-cookie-consent-${this.options.layout} dm-cookie-consent-${this.options.theme}`,this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Cookie consent"),this.element.style.display="none",this.options.animation&&this.element.classList.add("dm-cookie-consent-animated");let e='<div class="dm-cookie-consent-content">';e+=`<div class="dm-cookie-consent-message">${this.options.message}`;const t=[];this.options.privacyPolicyUrl&&t.push(`<a href="${this.options.privacyPolicyUrl}" target="_blank" rel="noopener">${this.options.privacyPolicyText}</a>`),this.options.cookiePolicyUrl&&t.push(`<a href="${this.options.cookiePolicyUrl}" target="_blank" rel="noopener">${this.options.cookiePolicyText}</a>`),t.length>0&&(e+=` ${t.join(" | ")}`),e+="</div>",e+='<div class="dm-cookie-consent-buttons">',Object.keys(this.options.categories).length>1&&(e+=`<button type="button" class="btn btn-outline dm-cookie-consent-customize">${this.options.customizeText}</button>`),e+=`<button type="button" class="btn btn-outline dm-cookie-consent-reject">${this.options.rejectAllText}</button>`,e+=`<button type="button" class="btn btn-primary dm-cookie-consent-accept">${this.options.acceptAllText}</button>`,e+="</div></div>",this.options.backdrop&&"modal"===this.options.layout&&(e=`<div class="dm-cookie-consent-backdrop"></div>${e}`),this.element.innerHTML=e,document.body.appendChild(this.element)}_createCustomizeModal(){if(this._customizeModal)return;this._customizeModal=document.createElement("div"),this._customizeModal.className="dm-cookie-consent-modal",this._customizeModal.setAttribute("role","dialog"),this._customizeModal.setAttribute("aria-label","Customize cookie preferences");let e='<div class="dm-cookie-consent-modal-content">';e+='<div class="dm-cookie-consent-modal-header">',e+="<h3>Cookie Preferences</h3>",e+='<button type="button" class="dm-cookie-consent-modal-close" aria-label="Close">×</button>',e+="</div>",e+='<div class="dm-cookie-consent-modal-body">',Object.entries(this.options.categories).forEach(([t,n])=>{const s=this._preferences[t]?"checked":"",o=n.required?"disabled":"";e+='<div class="dm-cookie-consent-category">',e+='<label class="dm-cookie-consent-category-label">',e+=`<input type="checkbox" class="dm-cookie-consent-category-toggle" data-category="${t}" ${s} ${o}>`,e+='<div class="dm-cookie-consent-category-info">',e+=`<div class="dm-cookie-consent-category-name">${n.label}`,n.required&&(e+=' <span class="dm-cookie-consent-required">(Required)</span>'),e+="</div>",e+=`<div class="dm-cookie-consent-category-description">${n.description}</div>`,e+="</div></label></div>"}),e+="</div>",e+='<div class="dm-cookie-consent-modal-footer">',e+='<button type="button" class="btn btn-outline dm-cookie-consent-modal-cancel">Cancel</button>',e+=`<button type="button" class="btn btn-primary dm-cookie-consent-modal-save">${this.options.savePreferencesText}</button>`,e+="</div></div>",e=`<div class="dm-cookie-consent-modal-backdrop"></div>${e}`,this._customizeModal.innerHTML=e,document.body.appendChild(this._customizeModal),this._setupModalHandlers()}_setupEventHandlers(){const e=this.element.querySelector(".dm-cookie-consent-accept");e&&e.addEventListener("click",()=>this.accept());const t=this.element.querySelector(".dm-cookie-consent-reject");t&&t.addEventListener("click",()=>this.reject());const n=this.element.querySelector(".dm-cookie-consent-customize");if(n&&n.addEventListener("click",()=>this.showCustomize()),this.options.backdrop&&"modal"===this.options.layout){const e=this.element.querySelector(".dm-cookie-consent-backdrop");e&&e.addEventListener("click",()=>{this.options.requireExplicitConsent||this.hide()})}}_setupModalHandlers(){if(!this._customizeModal)return;const e=this._customizeModal.querySelector(".dm-cookie-consent-modal-close");e&&e.addEventListener("click",()=>this.hideCustomize());const t=this._customizeModal.querySelector(".dm-cookie-consent-modal-cancel");t&&t.addEventListener("click",()=>this.hideCustomize());const n=this._customizeModal.querySelector(".dm-cookie-consent-modal-save");n&&n.addEventListener("click",()=>this.saveCustomPreferences());const s=this._customizeModal.querySelector(".dm-cookie-consent-modal-backdrop");s&&s.addEventListener("click",()=>this.hideCustomize())}_setupReopenTriggers(){this.options.reopenSelector&&document.addEventListener("click",e=>{e.target.closest(this.options.reopenSelector)&&(e.preventDefault(),this.show())})}show(){this._isVisible||(this.element.style.display="",this.options.animation?requestAnimationFrame(()=>{this.element.classList.add("dm-cookie-consent-visible")}):this.element.classList.add("dm-cookie-consent-visible"),this._isVisible=!0,this.options.onShow&&this.options.onShow.call(this))}hide(){if(!this._isVisible)return;const e=()=>{this.element.style.display="none",this._isVisible=!1,this.options.onHide&&this.options.onHide.call(this)};this.options.animation?(this.element.classList.remove("dm-cookie-consent-visible"),setTimeout(e,300)):(this.element.classList.remove("dm-cookie-consent-visible"),e())}accept(){Object.keys(this.options.categories).forEach(e=>{this._preferences[e]=!0}),this._state="accepted",this._savePreferences(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}reject(){Object.entries(this.options.categories).forEach(([e,t])=>{this._preferences[e]=t.required}),this._state="rejected",this._savePreferences(),this.options.onReject&&this.options.onReject.call(this),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}showCustomize(){this._createCustomizeModal(),this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;e.checked=this._preferences[t]||!1}),this._customizeModal.style.display="flex",this.options.animation?requestAnimationFrame(()=>{this._customizeModal.classList.add("dm-cookie-consent-modal-visible")}):this._customizeModal.classList.add("dm-cookie-consent-modal-visible"),this.options.onCustomize&&this.options.onCustomize.call(this,this._preferences)}hideCustomize(){if(!this._customizeModal)return;const e=()=>{this._customizeModal.style.display="none"};this.options.animation?(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),setTimeout(e,300)):(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),e())}saveCustomPreferences(){this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;this._preferences[t]=e.checked}),this._state="customized",this._savePreferences(),this.hideCustomize(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}getState(){return this._state}getPreferences(){return{...this._preferences}}isAccepted(e=null){return e?!0===this._preferences[e]:"accepted"===this._state||"customized"===this._state}reset(){this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),Domma.storage.remove(this.options.storageKey),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences)}destroy(){this.hide(),this.hideCustomize(),this.element&&(this.element.remove(),this.element=null),this._customizeModal&&(this._customizeModal.remove(),this._customizeModal=null)}}const Ft={_container:null,_stack:[],_topHandler(){for(let e=this._stack.length-1;e>=0;e--)if(this._stack[e].overlay.isConnected)return this._stack[e].handler;return null},_defaults:{title:"",message:"",confirmText:"OK",cancelText:"Cancel",inputPlaceholder:"",inputValue:"",inputType:"text",animation:!0,backdrop:!0,backdropClose:!1,keyboard:!0,danger:!1,className:""},_ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",document.body.appendChild(this._container)),this._container},_createDialog(e,t){const n={...this._defaults,...t},s=this._ensureContainer();return new Promise(t=>{const o=document.createElement("div");o.className="dm-dialog-overlay"+(n.animation?" dm-dialog-animate":"");const i=document.createElement("div");i.className=`dm-dialog dm-dialog-${e}${n.className?" "+n.className:""}`,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let a='<div class="dm-dialog-content">';if(n.title){a+=`<div class="dm-dialog-header"><h3 class="dm-dialog-title">${r.sanitise(String(n.title),{preset:"basic"})}</h3></div>`}if(a+='<div class="dm-dialog-body">',n.message){a+=`<p class="dm-dialog-message">${r.sanitise(String(n.message),{preset:"basic"})}</p>`}if("prompt"===e){const e=r.sanitise(String(n.inputPlaceholder||""),{preset:"basic"}),t=r.sanitise(String(n.inputValue||""),{preset:"basic"});a+=`<input type="${n.inputType}" class="dm-dialog-input form-input" placeholder="${e}" value="${t}">`}a+="</div>",a+='<div class="dm-dialog-footer">',"confirm"!==e&&"prompt"!==e||(a+=`<button type="button" class="btn btn-outline dm-dialog-cancel">${n.cancelText}</button>`);a+=`<button type="button" class="btn ${n.danger?"btn-danger":"btn-primary"} dm-dialog-confirm">${n.confirmText}</button>`,a+="</div></div>",i.innerHTML=a,o.appendChild(i),s.appendChild(o);const l=i.querySelector(".dm-dialog-confirm"),d=i.querySelector(".dm-dialog-cancel"),c=i.querySelector(".dm-dialog-input"),h=c||n.danger&&d||l;setTimeout(()=>h?.focus(),50),c&&c.select();let u=!1,p=()=>{};const m=e=>{u||(u=!0,p(),n.animation?(o.classList.add("dm-dialog-closing"),setTimeout(()=>{o.remove(),t(e)},200)):(o.remove(),t(e)))},f=()=>{m("prompt"===e?c.value:"confirm"===e||void 0)},g=()=>{m("prompt"===e&&null)};l.addEventListener("click",f),d?.addEventListener("click",g),n.backdropClose&&o.addEventListener("click",e=>{e.target===o&&g()});const v=new Set;i.addEventListener("keydown",e=>{e.repeat||v.add(e.key),"Enter"!==e.key&&" "!==e.key||!e.repeat||v.has(e.key)||e.preventDefault()});const b=e=>{e.preventDefault(),e.stopImmediatePropagation()},_=t=>{if(Ft._topHandler()===_)if(t.repeat||v.add(t.key),"Escape"===t.key)b(t),n.keyboard&&g();else if("Enter"===t.key&&n.keyboard){if(t.repeat&&!v.has("Enter"))return;if("function"==typeof t.target?.closest&&t.target.closest("button")&&i.contains(t.target))return;if(n.danger&&"confirm"===e)return void b(t);"prompt"===e&&t.target!==c||(b(t),f())}};Ft._stack.push({overlay:o,handler:_});let y=!1;const k=setTimeout(()=>{u||(y=!0,window.addEventListener("keydown",_,!0))},0);p=()=>{clearTimeout(k);const e=Ft._stack.findIndex(e=>e.handler===_);-1!==e&&Ft._stack.splice(e,1),y&&window.removeEventListener("keydown",_,!0)}})},alert(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("alert",{...t,message:e})},confirm(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("confirm",{...t,message:e})},prompt(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("prompt",{...t,message:e})}};class Rt extends h{static defaults={mode:"single",activeClass:"active",allowEmpty:!1,onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.buttons=Array.from(this.element.querySelectorAll(".btn")),this.buttons.forEach((e,t)=>{e.dataset.index=t,this._addEventListener(e,"click",n=>{n.preventDefault(),this._handleClick(e,t)})}))}_handleClick(e,t){const n=e.classList.contains(this.options.activeClass);"single"===this.options.mode?n&&this.options.allowEmpty?this.options.allowEmpty&&e.classList.remove(this.options.activeClass):(this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),e.classList.add(this.options.activeClass)):e.classList.toggle(this.options.activeClass),this.options.onChange&&this.options.onChange(this.getValue(),t,e)}getValue(){const e=this.buttons.map((e,t)=>e.classList.contains(this.options.activeClass)?t:-1).filter(e=>-1!==e);return"single"===this.options.mode?e.length>0?e[0]:null:e}getActive(){const e=this.buttons.filter(e=>e.classList.contains(this.options.activeClass));return"single"===this.options.mode?e.length>0?e[0]:null:e}setValue(e){const t=Array.isArray(e)?e:[e];return this.buttons.forEach((e,n)=>{t.includes(n)?e.classList.add(this.options.activeClass):e.classList.remove(this.options.activeClass)}),this}toggle(e){return e>=0&&e<this.buttons.length&&this._handleClick(this.buttons[e],e),this}selectAll(){return"multiple"===this.options.mode&&(this.buttons.forEach(e=>e.classList.add(this.options.activeClass)),this.options.onChange&&this.options.onChange(this.getValue(),-1,null)),this}deselectAll(){return this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),this.options.onChange&&this.options.onChange(this.getValue(),-1,null),this}}class qt extends h{static defaults={items:[],separator:"/",homeIcon:!1,responsive:!0,onChange:null};static separators={"/":"/",">":"›","→":"→",chevron:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>'};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_getSeparatorHTML(){const{separator:e}=this.options;return qt.separators[e]||e}_render(){const{items:e,homeIcon:t,responsive:n}=this.options,s=this._getSeparatorHTML();this.element.className="dm-breadcrumbs",n&&this.element.classList.add("dm-breadcrumbs-responsive"),this.element.setAttribute("aria-label","Breadcrumb");let o="";e.forEach((n,i)=>{const r=i===e.length-1,a=0===i;i>0&&(o+=`<span class="dm-breadcrumbs-separator" aria-hidden="true">${s}</span>`);let l=n.text||n;a&&t&&(l=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align: middle; margin-right: 4px;"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>${l}`),r||n.active?o+=`<span class="dm-breadcrumbs-item active" aria-current="page">${l}</span>`:o+=`<a href="${n.url||"#"}" class="dm-breadcrumbs-item dm-breadcrumbs-link" data-index="${i}">${l}</a>`}),this.element.innerHTML=o,this._injectStyles()}_injectStyles(){}_bindEvents(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-breadcrumbs-link");if(t){const n=parseInt(t.dataset.index,10);this.options.onChange&&(e.preventDefault(),this.options.onChange(this.options.items[n],n,e))}})}setItems(e){return this.options.items=e,this._render(),this}addItem(e){if(this.options.items.length>0){const e=this.options.items[this.options.items.length-1];"object"==typeof e&&(e.active=!1)}return this.options.items.push(e),this._render(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render()),this}getItems(){return[...this.options.items]}}class Ut extends h{static defaults={brand:null,items:[],position:"static",variant:"light",collapsible:!0,collapseAt:993,appearOnHover:!1,hoverCloseDelay:250,actions:[],onItemClick:null};constructor(e,t={}){super(e,t),this._isCollapsed=!0,this._pinned=null,this._hoverSuppressed=null,this._navCloseTimer=null,this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_render(){const{brand:e,items:t,position:n,variant:s,collapsible:o,actions:i}=this.options;this.element.className="navbar",this.element.classList.add(`navbar-${s}`),"static"!==n&&this.element.classList.add(`navbar-${n}`),this.element.setAttribute("role","navigation");let r='<div class="navbar-container">';e&&(r+='<div class="navbar-brand">',e.url&&(r+=`<a href="${e.url}" class="navbar-brand-link">`),e.html?r+=e.html:(e.logo&&(r+=`<img src="${e.logo}" alt="${e.text||""}" class="navbar-logo">`),e.text&&(r+=`<span class="navbar-brand-text">${e.text}</span>`)),e.url&&(r+="</a>"),r+="</div>"),o&&(r+='\n <button class="navbar-toggle" aria-label="Toggle navigation" aria-expanded="false">\n <span class="navbar-toggle-icon"></span>\n </button>\n '),r+='<div class="navbar-collapse">',r+='<ul class="navbar-nav">',r+=this._renderItems(t,0,""),r+="</ul>",i&&i.length>0&&(r+='<div class="navbar-actions">',i.forEach((e,t)=>{const n=e.variant||"primary",s=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";r+=`<a href="${e.url||"#"}" class="navbar-action dm-btn dm-btn-${n}" data-action="${t}">${s}${e.text}</a>`}),r+="</div>"),r+="</div>",r+="</div>",this.element.innerHTML=r,this._toggle=this.element.querySelector(".navbar-toggle"),this._collapse=this.element.querySelector(".navbar-collapse"),this._scanIcons()}_renderItems(e,t,n){let s="";return(e||[]).forEach((e,o)=>{const i=""===n?`${o}`:`${n}.${o}`;if(e.divider)return void(s+='<li class="navbar-dropdown-divider"></li>');const r=e.items&&e.items.length>0,a=0===t?18:16,l=e.icon?`<span data-icon="${e.icon}" data-size="${a}" style="margin-right: 6px; vertical-align: middle;"></span>`:"",d='<svg class="navbar-caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>';if(r)0===t?(s+='<li class="navbar-item navbar-dropdown">',s+=`<button class="navbar-link navbar-dropdown-toggle" data-index="${o}" data-path="${i}">${l}${e.text}${d}</button>`,s+='<ul class="navbar-dropdown-menu">'):(s+='<li class="navbar-item navbar-dropdown navbar-dropdown-sub">',s+=`<button class="navbar-dropdown-toggle navbar-submenu-toggle" data-path="${i}">${l}${e.text}${d}</button>`,s+='<ul class="navbar-dropdown-menu navbar-dropdown-submenu">'),s+=this._renderItems(e.items,t+1,i),s+="</ul></li>";else{const r=e.url||"#",a=e.external||r.startsWith("http://")||r.startsWith("https://")?' target="_blank" rel="noopener noreferrer"':"";if(0===t)s+=`<li class="navbar-item"><a href="${r}" class="navbar-link${e.active?" active":""}" data-index="${o}" data-path="${i}"${a}>${l}${e.text}</a></li>`;else{s+=`<li><a href="${r}" class="navbar-dropdown-item" data-path="${i}"${1===t?` data-index="${n}" data-subindex="${o}"`:""}${a}>${l}${e.text}</a></li>`}}}),s}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",()=>{this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-link:not(.navbar-dropdown-toggle)");if(t){const n=parseInt(t.dataset.index,10);this.options.onItemClick&&(e.preventDefault(),this.options.onItemClick(this.options.items[n],n,e)),window.innerWidth<this.options.collapseAt&&this.collapse()}const n=e.target.closest(".navbar-dropdown-item");if(n&&this.options.onItemClick){e.preventDefault();const t=n.dataset.path,s=t?t.split(".").map(e=>parseInt(e,10)):[parseInt(n.dataset.index,10),parseInt(n.dataset.subindex,10)];let o={items:this.options.items};for(let e=0;e<s.length-1;e++)o=o.items[s[e]];const i=s[s.length-1],r=o.items[i],a=o.items===this.options.items?null:o;this.options.onItemClick(r,i,e,a)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-dropdown-toggle");if(!t)return;const n=t.closest(".navbar-dropdown");if(this._pinned===n)return this._pinned=null,this._hoverSuppressed=n,void this._reconcileDropdowns(null,!0);this._pinned=n,this._hoverSuppressed=null,this._reconcileDropdowns(n)}),this._addEventListener(document,"click",e=>{e.target.closest(".navbar-dropdown")||(this._pinned=null,this._hoverSuppressed=null,this._reconcileDropdowns(null,!0))}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&(this._collapse?.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false"))}),this.options.appearOnHover&&(this._addEventListener(this.element,"mouseover",e=>{window.innerWidth<this.options.collapseAt||e.target.closest(".navbar-dropdown")&&(this._hoverSuppressed&&this._hoverSuppressed.contains(e.target)||(this._hoverSuppressed=null,clearTimeout(this._navCloseTimer),this._reconcileDropdowns(e.target)))}),this._addEventListener(this.element,"mouseout",e=>{window.innerWidth<this.options.collapseAt||e.relatedTarget&&this.element.contains(e.relatedTarget)||(clearTimeout(this._navCloseTimer),this._navCloseTimer=setTimeout(()=>{this._reconcileDropdowns(null)},this.options.hoverCloseDelay))}))}_reconcileDropdowns(e,t=!1){const n=new Set,s=e=>{for(let t=e;t&&t!==this.element;t=t.parentElement)t.classList&&t.classList.contains("navbar-dropdown")&&n.add(t)};s(e),!t&&this._pinned&&s(this._pinned),this.element.querySelectorAll(".navbar-dropdown").forEach(e=>{n.has(e)?e.classList.contains("open")||(e.classList.add("open"),this._positionMenu(e)):e.classList.remove("open")})}_positionMenu(e){if(window.innerWidth<this.options.collapseAt)return;const t=e.querySelector(":scope > .navbar-dropdown-menu");if(!t)return;const n=t.classList.contains("navbar-dropdown-submenu");t.classList.remove("navbar-dropdown-flip-x","navbar-dropdown-flip-end"),t.style.top="",t.style.maxHeight="",t.style.overflowY="",requestAnimationFrame(()=>{let e=t.getBoundingClientRect();if(!e.width&&!e.height)return;e.right>window.innerWidth-8&&(t.classList.add(n?"navbar-dropdown-flip-x":"navbar-dropdown-flip-end"),e=t.getBoundingClientRect());const s=e.bottom-(window.innerHeight-8);s>0&&(n?t.style.top=-Math.min(Math.ceil(s),Math.floor(e.top-8))+"px":t.querySelector(".navbar-dropdown-sub")||(t.style.maxHeight=Math.max(120,Math.floor(window.innerHeight-e.top-8))+"px",t.style.overflowY="auto"))})}setActive(e){return this.options.items.forEach((t,n)=>{t.active=n===e}),this._render(),this}setItems(e){return this.options.items=e,this._render(),this}expand(){return this._collapse&&(this._collapse.classList.add("show"),this._isCollapsed=!1,this._toggle&&this._toggle.setAttribute("aria-expanded","true")),this}collapse(){return this._collapse&&(this._collapse.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false")),this}toggle(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}destroy(){clearTimeout(this._navCloseTimer),this._pinned=null,this._hoverSuppressed=null,super.destroy()}}class Kt extends h{static defaults={position:"left",fixed:!0,width:"250px",top:"0",header:null,items:[],footer:null,variant:"dark",collapsible:!0,collapseAt:768,activeSection:null,expandedSections:[],persistExpanded:!1,persistKey:null,animationDuration:200,push:!0,contentSelector:".main-content",scrollSpy:!1,scrollSpyOffset:"-100px 0px -50% 0px",scrollSpyThreshold:.5,floating:!1,customContent:null,collapsibleDesktop:!1,collapsedWidth:"60px",persistCollapsed:!1,persistCollapseKey:null,onItemClick:null,onToggle:null,onExpand:null,onCollapse:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._isCollapsed=!1,this._expandedItems=new Set(this.options.expandedSections||[]),this._init()}_init(){this.element&&(this._loadExpandedState(),this._loadCollapsedState(),this._findContentElement(),this._render(),this._bindEvents(),this._scanIcons(),this._handleInitialPushState(),this.options.scrollSpy&&this._initScrollSpy(),this._isCollapsed&&this.options.collapsibleDesktop&&setTimeout(()=>{this._createFloatingToggle()},0))}_findContentElement(){this.options.push&&this.options.contentSelector&&(this._contentElement=document.querySelector(this.options.contentSelector),this._contentElement||console.warn(`[Sidebar] Push mode enabled but content element "${this.options.contentSelector}" not found`))}_handleInitialPushState(){if(this.options.push&&this._contentElement){const e=window.innerWidth>=this.options.collapseAt;(!this.options.collapsible||e)&&this._applyPush()}}_render(){const{position:e,fixed:t,width:n,top:s,header:o,items:i,footer:r,variant:a,collapsible:l,collapsibleDesktop:d,collapsedWidth:c}=this.options;this.element.className="sidebar",this.element.classList.add(`sidebar-${a}`),this.element.classList.add(`sidebar-${e}`),t&&this.element.classList.add("sidebar-fixed"),d&&this.element.classList.add("sidebar-desktop-collapsible"),this._isCollapsed&&d&&this.element.classList.add("sidebar-collapsed"),n&&(this.element.style.setProperty("--sidebar-width",n),this.element.style.width=n),c&&this.element.style.setProperty("--sidebar-collapsed-width",c),s&&t&&(this.element.style.top=s,this.element.style.height=`calc(100vh - ${s})`),this.element.setAttribute("role","navigation"),this.element.setAttribute("aria-label","Sidebar navigation");let h="";if(o){if(h+='<div class="sidebar-header">',o.icon&&(h+=`<span class="sidebar-header-icon" data-icon="${o.icon}" data-size="24"></span>`),o.title&&(h+=`<h3 class="sidebar-header-title">${o.title}</h3>`),l&&!1!==o.toggle){const e="right"===this.options.position?"chevron-right":"chevron-left",t=this._isCollapsed&&d?"chevron-right":e;h+=`\n <button class="sidebar-toggle-btn" aria-label="Toggle sidebar" aria-expanded="${this._isOpen}">\n <span class="sidebar-toggle-icon" data-icon="${t}" data-size="20"></span>\n </button>\n `}h+="</div>"}h+='<nav class="sidebar-nav">',h+=this._renderItems(i),h+="</nav>",r&&(h+='<div class="sidebar-footer">',r.html?h+=r.html:r.text&&(h+=`<p class="sidebar-footer-text">${r.text}</p>`),h+="</div>"),this.element.innerHTML=h,this._toggle=this.element.querySelector(".sidebar-toggle-btn"),this._nav=this.element.querySelector(".sidebar-nav"),this._overlay=null,this._floatingToggle=null}_renderItems(e,t=0,n=""){if(!e||0===e.length)return"";let s=`<ul class="sidebar-menu" data-depth="${t}">`;return e.forEach((e,o)=>{const i=n?`${n}.${o}`:`${o}`;if(e.divider)return void(s+='<li class="sidebar-divider"></li>');if(e.heading)return void(s+=`<li class="sidebar-heading">${e.heading}</li>`);const r=e.items&&e.items.length>0,a=this._expandedItems.has(i),l=e.section===this.options.activeSection;s+=`<li class="sidebar-item ${r?"has-children":""} ${a?"open":""}" data-path="${i}" data-depth="${t}">`,s+=r?`\n <button class="sidebar-link sidebar-link-toggle ${l?"active":""}" data-path="${i}">\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n <svg class="sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M9 18l6-6-6-6"/>\n </svg>\n </button>\n `:`\n <a href="${e.url||"#"}" class="sidebar-link ${l?"active":""}" data-path="${i}" ${e.section?`data-section="${e.section}"`:""}>\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n </a>\n `,r&&(s+=`<div class="sidebar-submenu" ${a?'style="display: block;"':""}>`,s+=this._renderItems(e.items,t+1,i),s+="</div>"),s+="</li>"}),s+="</ul>",s}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",e=>{e.stopPropagation();window.innerWidth>=this.options.collapseAt&&this.options.collapsibleDesktop?this.toggleCollapse():this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link:not(.sidebar-link-toggle)");if(t){const n=t.dataset.path,s=this._getItemByPath(n);s&&s.section&&this.setActive(s.section),this.options.onItemClick&&this.options.onItemClick(s,n,e),window.innerWidth<this.options.collapseAt&&this.close()}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link-toggle");if(t){e.preventDefault();const n=t.dataset.path,s=t.closest(".sidebar-item");this._toggleSubmenu(s,n)}}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&this.close()}),this._addEventListener(document,"click",e=>{this._isOpen&&!this.element.contains(e.target)&&window.innerWidth<this.options.collapseAt&&this.close()})}_toggleSubmenu(e,t){const n=e.querySelector(":scope > .sidebar-submenu");if(!n)return;const s=e.classList.contains("open"),o=this._getItemByPath(t),i=parseInt(e.dataset.depth,10);s?(this._collapseSubmenu(e,n),this._expandedItems.delete(t),this.options.onCollapse&&this.options.onCollapse(o,i)):(this._expandSubmenu(e,n),this._expandedItems.add(t),this.options.onExpand&&this.options.onExpand(o,i)),this._saveExpandedState()}_expandSubmenu(e,t){e.classList.add("open"),t.style.display="block";const n=t.scrollHeight;t.style.height="0",t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height=`${n}px`,setTimeout(()=>{t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_collapseSubmenu(e,t){const n=t.scrollHeight;t.style.height=`${n}px`,t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height="0",setTimeout(()=>{e.classList.remove("open"),t.style.display="",t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_getItemByPath(e){if(!e)return null;const t=e.split(".").map(e=>parseInt(e,10));let n=this.options.items;for(const e of t){if(!n||!n[e])return null;n=n[e],n.items&&t.indexOf(e)<t.length-1&&(n=n.items)}return n}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_loadExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=localStorage.getItem(e);if(t){const e=JSON.parse(t);this._expandedItems=new Set(e)}}catch(e){console.warn("Failed to load sidebar expanded state:",e)}}_saveExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=Array.from(this._expandedItems);localStorage.setItem(e,JSON.stringify(t))}catch(e){console.warn("Failed to save sidebar expanded state:",e)}}_loadCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`,t=localStorage.getItem(e);null!==t&&(this._isCollapsed="true"===t)}catch(e){console.warn("Failed to load sidebar collapsed state:",e)}}_saveCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`;localStorage.setItem(e,this._isCollapsed.toString())}catch(e){console.warn("Failed to save sidebar collapsed state:",e)}}_initScrollSpy(){const e=[];this.element.querySelectorAll(".sidebar-link[data-section]").forEach(t=>{const n=t.dataset.section,s=document.getElementById(n);s&&e.push({element:s,id:n,link:t})}),0!==e.length&&(this._scrollSpyObserver=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=e.find(e=>e.element===t.target);n&&this.setActive(n.id)}})},{threshold:this.options.scrollSpyThreshold,rootMargin:this.options.scrollSpyOffset}),e.forEach(({element:e})=>{this._scrollSpyObserver.observe(e)}))}_createOverlay(){this._overlay||(this._overlay=document.createElement("div"),this._overlay.className="sidebar-overlay",document.body.appendChild(this._overlay),this._addEventListener(this._overlay,"click",()=>{this.close()}))}_removeOverlay(){this._overlay&&(this._overlay.remove(),this._overlay=null)}_applyPush(){if(!this.options.push||!this._contentElement)return;const e="right"===this.options.position?"sidebar-push-active-right":"sidebar-push-active";this._contentElement.classList.add(e),this._contentElement.style.setProperty("--sidebar-push-width",this.options.width)}_removePush(){this.options.push&&this._contentElement&&this._contentElement.classList.remove("sidebar-push-active","sidebar-push-active-right")}open(){return this._isOpen||(this._isOpen=!0,this.element.classList.add("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","true"),window.innerWidth<this.options.collapseAt&&this._createOverlay(),this._applyPush(),this.options.onToggle&&this.options.onToggle(!0)),this}close(){return this._isOpen?(this._isOpen=!1,this.element.classList.remove("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","false"),this._removeOverlay(),this._removePush(),this.options.onToggle&&this.options.onToggle(!1),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}collapse(){return!this.options.collapsibleDesktop||this._isCollapsed||(this._isCollapsed=!0,this.element.classList.add("sidebar-collapsed"),this._saveCollapsedState(),this._createFloatingToggle(),this._removePush(),this.options.onCollapse&&this.options.onCollapse()),this}expand(){if(!this.options.collapsibleDesktop||!this._isCollapsed)return this;this._isCollapsed=!1,this.element.classList.remove("sidebar-collapsed"),this._saveCollapsedState(),this._removeFloatingToggle(),this._applyPush();const e="right"===this.options.position?"chevron-right":"chevron-left";return this._updateToggleIcon(e),this.options.onExpand&&this.options.onExpand(),this}_createFloatingToggle(){if(this._floatingToggle)return;this._floatingToggle=document.createElement("button"),this._floatingToggle.className="sidebar-floating-toggle show","right"===this.options.position&&this._floatingToggle.classList.add("right");const e="right"===this.options.position?"chevron-left":"chevron-right";this._floatingToggle.innerHTML=`<span data-icon="${e}" data-size="20"></span>`,this._floatingToggle.addEventListener("click",()=>{this.expand()}),document.body.appendChild(this._floatingToggle),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._floatingToggle)}_removeFloatingToggle(){this._floatingToggle&&(this._floatingToggle.remove(),this._floatingToggle=null)}_updateToggleIcon(e){if(!this._toggle)return;const t=this._toggle.querySelector(".sidebar-toggle-icon");t&&(t.setAttribute("data-icon",e),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._toggle))}destroy(){this._removeFloatingToggle(),super.destroy()}toggleCollapse(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}setActive(e){return this.options.activeSection=e,this.element.querySelectorAll(".sidebar-link").forEach(t=>{t.dataset.section===e?t.classList.add("active"):t.classList.remove("active")}),this}setItems(e){return this.options.items=e,this._expandedItems.clear(),this._render(),this._bindEvents(),this._scanIcons(),this}addItem(e,t=null){return null===t||t>=this.options.items.length?this.options.items.push(e):this.options.items.splice(t,0,e),this._render(),this._bindEvents(),this._scanIcons(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render(),this._bindEvents(),this._scanIcons()),this}expandAll(){return this.element.querySelectorAll(".sidebar-item.has-children").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&!e.classList.contains("open")&&(this._expandSubmenu(e,n),this._expandedItems.add(t))}),this._saveExpandedState(),this}collapseAll(){return this.element.querySelectorAll(".sidebar-item.has-children.open").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&(this._collapseSubmenu(e,n),this._expandedItems.delete(t))}),this._saveExpandedState(),this}destroy(){this._scrollSpyObserver&&(this._scrollSpyObserver.disconnect(),this._scrollSpyObserver=null),this._removeOverlay(),super.destroy()}}class Yt extends h{static defaults={variant:"light",layout:"simple",brand:null,columns:[],links:[],social:[],copyright:null,className:"",position:"static"};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._scanIcons())}_render(){const{variant:e,layout:t,brand:n,columns:s,links:o,social:i,copyright:r,className:a,position:l}=this.options;this.element.className="footer",this.element.classList.add(`footer-${e}`),this.element.classList.add(`footer-${t}`),"static"!==l&&this.element.classList.add(`footer-${l}`),a&&this.element.classList.add(a),this.element.setAttribute("role","contentinfo");let d='<div class="footer-container">';"columns"===t&&s&&s.length>0?d+=this._renderColumnsLayout(n,s,i,r):d+="minimal"===t?this._renderMinimalLayout(r,i):this._renderSimpleLayout(n,o,i,r),d+="</div>",this.element.innerHTML=d}_renderSimpleLayout(e,t,n,s){let o='<div class="footer-simple-content">';return e&&(o+='<div class="footer-brand">',e.url&&(o+=`<a href="${e.url}" class="footer-brand-link">`),e.logo&&(o+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(o+=`<span class="footer-brand-text">${e.text}</span>`),e.url&&(o+="</a>"),o+="</div>"),t&&t.length>0&&(o+='<nav class="footer-nav">',t.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";o+=`<a href="${e.url||"#"}" class="footer-link">${t}${e.text}</a>`}),o+="</nav>"),n&&n.length>0&&(o+=this._renderSocial(n)),o+="</div>",s&&(o+=this._renderCopyright(s)),o}_renderColumnsLayout(e,t,n,s){let o="";return o+='<div class="footer-columns-content">',e&&(o+='<div class="footer-column footer-column-brand">',e.logo&&(o+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(o+=`<p class="footer-brand-text">${e.text}</p>`),e.description&&(o+=`<p class="footer-brand-description">${e.description}</p>`),o+="</div>"),t.forEach(e=>{o+='<div class="footer-column">',e.title&&(o+=`<h4 class="footer-column-title">${e.title}</h4>`),e.links&&e.links.length>0&&(o+='<ul class="footer-column-links">',e.links.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";o+=`<li><a href="${e.url||"#"}" class="footer-column-link">${t}${e.text}</a></li>`}),o+="</ul>"),o+="</div>"}),o+="</div>",o+='<div class="footer-bottom">',n&&n.length>0&&(o+=this._renderSocial(n)),s&&(o+=this._renderCopyright(s)),o+="</div>",o}_renderMinimalLayout(e,t){let n='<div class="footer-minimal-content">';return e&&(n+=this._renderCopyright(e)),t&&t.length>0&&(n+=this._renderSocial(t)),n+="</div>",n}_renderSocial(e){let t='<div class="footer-social">';return e.forEach(e=>{t+=`\n <a href="${e.url||"#"}" class="footer-social-link" aria-label="${e.label||e.icon}" target="_blank" rel="noopener noreferrer">\n <span data-icon="${e.icon}" data-size="20"></span>\n </a>\n `}),t+="</div>",t}_renderCopyright(e){return`<div class="footer-copyright">${"string"==typeof e?e:e.text||`© ${e.year||(new Date).getFullYear()} All rights reserved`}</div>`}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}setBrand(e){return this.options.brand=e,this._render(),this._scanIcons(),this}setLinks(e){return this.options.links=e,this._render(),this._scanIcons(),this}setColumns(e){return this.options.columns=e,this._render(),this._scanIcons(),this}setSocial(e){return this.options.social=e,this._render(),this._scanIcons(),this}setCopyright(e){return this.options.copyright=e,this._render(),this}}class Gt extends h{static defaults={data:[],dataSource:null,minChars:1,maxResults:10,debounce:300,filterFn:null,renderItem:null,highlightMatches:!0,position:"auto",placeholder:"",emptyMessage:"No results found",loadingMessage:"Loading...",caseSensitive:!1,selectOnEnter:!0,clearOnSelect:!1,onSelect:null,onChange:null,onOpen:null,onClose:null,onFilter:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._isOpen=!1,this._activeIndex=-1,this._filteredData=[],this._loading=!1,this._debounceTimer=null,this._dropdown=null,this._list=null,this._loadingEl=null,this._emptyEl=null,this._init();const n=e=>{e!==this.getValue()&&this.setValue(e)};this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)}))}_init(){this.element&&("INPUT"===this.element.tagName?(this.options.placeholder&&this.element.setAttribute("placeholder",this.options.placeholder),this._createDropdown(),this._bindEvents(),this.element.setAttribute("role","combobox"),this.element.setAttribute("aria-autocomplete","list"),this.element.setAttribute("aria-expanded","false"),this.element.setAttribute("aria-controls",this._dropdown.id)):console.error("Autocomplete requires an input element"))}_createDropdown(){let e=this.element.parentElement;e&&e.classList.contains("dm-autocomplete")||(e=document.createElement("div"),e.className="dm-autocomplete",this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element)),this._dropdown=document.createElement("div"),this._dropdown.className="dm-autocomplete-dropdown",this._dropdown.id=`autocomplete-${Math.random().toString(36).substr(2,9)}`,this._dropdown.setAttribute("role","listbox"),this._dropdown.style.display="none",this._loadingEl=document.createElement("div"),this._loadingEl.className="dm-autocomplete-loading",this._loadingEl.textContent=this.options.loadingMessage,this._loadingEl.style.display="none",this._dropdown.appendChild(this._loadingEl),this._emptyEl=document.createElement("div"),this._emptyEl.className="dm-autocomplete-empty",this._emptyEl.textContent=this.options.emptyMessage,this._emptyEl.style.display="none",this._dropdown.appendChild(this._emptyEl),this._list=document.createElement("ul"),this._list.className="dm-autocomplete-list",this._dropdown.appendChild(this._list),e.appendChild(this._dropdown)}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this.element,"input",e),this._addEventListener(this.element,"keydown",t),this._addEventListener(this.element,"focus",()=>{this.element.value.length>=this.options.minChars&&this._filterData(this.element.value)}),this._addEventListener(this.element,"blur",e=>{setTimeout(()=>{this._dropdown.contains(document.activeElement)||this.close()},200)})}_handleInput(e){const t=e.target.value;this._debounceTimer&&clearTimeout(this._debounceTimer),this.model&&this.modelKey&&this.model.set(this.modelKey,t),this.options.onChange&&this.options.onChange(t,e),t.length<this.options.minChars?this.close():this._debounceTimer=setTimeout(()=>{this._filterData(t)},this.options.debounce)}_handleKeydown(e){if(!this._isOpen)return void("ArrowDown"===e.key&&this.element.value.length>=this.options.minChars&&(e.preventDefault(),this._filterData(this.element.value)));const t=this._list.querySelectorAll(".dm-autocomplete-item");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Enter":e.preventDefault(),this._activeIndex>=0&&this.options.selectOnEnter&&this._selectItem(this._activeIndex);break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this._activeIndex>=0&&(e.preventDefault(),this._selectItem(this._activeIndex)),this.close()}}async _filterData(e){let t=[];if(this.options.dataSource){this._setLoading(!0);try{t=await this.options.dataSource(e)}catch(e){console.error("Autocomplete dataSource error:",e),t=[]}this._setLoading(!1)}else{const n=this.options.filterFn||this._defaultFilter.bind(this);t=this.options.data.filter(t=>n(t,e))}this.options.maxResults&&(t=t.slice(0,this.options.maxResults)),this.options.onFilter&&(t=this.options.onFilter(t,e)||t),this._filteredData=t,this._renderResults(e)}_defaultFilter(e,t){const n="string"==typeof e?e:e.label||e.value||String(e),s=this.options.caseSensitive?t:t.toLowerCase();return(this.options.caseSensitive?n:n.toLowerCase()).includes(s)}_renderResults(e){if(this._list.innerHTML="",this._activeIndex=-1,0===this._filteredData.length)return this._emptyEl.style.display="block",this._list.style.display="none",void this.open();this._emptyEl.style.display="none",this._list.style.display="block",this._filteredData.forEach((t,n)=>{const s=document.createElement("li");if(s.className="dm-autocomplete-item",s.setAttribute("role","option"),s.setAttribute("data-index",n),this.options.renderItem){const n=this.options.renderItem(t,e);s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const n="string"==typeof t?t:t.label||t.value||String(t);this.options.highlightMatches?s.innerHTML=this._highlightMatch(n,e):s.textContent=n}s.addEventListener("click",()=>{this._selectItem(n)}),s.addEventListener("mouseenter",()=>{this._activeIndex=n,this._updateActive()}),this._list.appendChild(s)}),this.open()}_highlightMatch(e,t){if(!t)return e;const n=new RegExp(`(${this._escapeRegex(t)})`,this.options.caseSensitive?"g":"gi");return e.replace(n,'<span class="dm-autocomplete-match">$1</span>')}_escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_updateActive(){const e=this._list.querySelectorAll(".dm-autocomplete-item");if(e.forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.setAttribute("aria-selected","true"),e.scrollIntoView({block:"nearest"})):(e.classList.remove("active"),e.setAttribute("aria-selected","false"))}),this._activeIndex>=0){const t=e[this._activeIndex];if(t){const e=t.id||`autocomplete-item-${this._activeIndex}`;t.id=e,this.element.setAttribute("aria-activedescendant",e)}}else this.element.removeAttribute("aria-activedescendant")}_selectItem(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value||t.label||String(t);this.element.value=n,this.options.onSelect&&this.options.onSelect(t,{target:this.element}),this.options.clearOnSelect&&setTimeout(()=>{this.element.value=""},100),this.close(),this.element.focus()}_setLoading(e){this._loading=e,e?(this._loadingEl.style.display="block",this._list.style.display="none",this._emptyEl.style.display="none",this.open()):this._loadingEl.style.display="none"}_updatePosition(){if(!this._isOpen||!this._dropdown)return;const e=this.element.getBoundingClientRect(),t=this._dropdown.offsetHeight,n=window.innerHeight;let s=this.options.position;if("auto"===s){const o=n-e.bottom,i=e.top;s=o>=t||o>=i?"below":"above"}"above"===s?(this._dropdown.style.top="auto",this._dropdown.style.bottom="100%",this._dropdown.style.marginBottom="4px",this._dropdown.style.marginTop="0"):(this._dropdown.style.top="100%",this._dropdown.style.bottom="auto",this._dropdown.style.marginTop="4px",this._dropdown.style.marginBottom="0")}open(){return this._isOpen||(this._isOpen=!0,this._dropdown.style.display="block",this.element.setAttribute("aria-expanded","true"),this._updatePosition(),this.options.onOpen&&this.options.onOpen()),this}close(){return this._isOpen?(this._isOpen=!1,this._dropdown.style.display="none",this.element.setAttribute("aria-expanded","false"),this._activeIndex=-1,this.options.onClose&&this.options.onClose(),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setValue(e){return this.element.value=e,this}getValue(){return this.element.value}setData(e){return this.options.data=e,this}refresh(){const e=this.element.value;return e.length>=this.options.minChars&&this._filterData(e),this}focus(){return this.element.focus(),this}clearValue(){return this.element.value="",this.close(),this}destroy(){this.close(),this._dropdown&&this._dropdown.parentNode&&this._dropdown.parentNode.removeChild(this._dropdown),this._debounceTimer&&clearTimeout(this._debounceTimer),this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Jt extends h{static defaults={data:[],value:[],placeholder:"Add items...",searchable:!0,creatable:!1,maxItems:null,duplicates:!1,clearable:!0,size:"medium",renderPill:null,renderOption:null,pillTemplate:"<span>{label}</span>",validatePill:null,maxItemsMessage:"Maximum {max} items allowed",duplicateMessage:"Item already exists",noResultsMessage:"No results found",onAdd:null,onRemove:null,onChange:null,onCreate:null,onMaxReached:null,onValidationError:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._pills=[],this._isOpen=!1,this._activeIndex=-1,this._container=null,this._input=null,this._clearBtn=null,this._dropdown=null,this._optionsList=null,this._filteredData=[],this._init();const n=e=>{if(!Array.isArray(e))return;const t=this.getValue();JSON.stringify(t)!==JSON.stringify(e)&&this.setValue(e)};this._container&&(this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)})))}_init(){this.element&&("INPUT"===this.element.tagName?(this.element.style.display="none",this._createStructure(),this.options.value&&this.options.value.length>0&&this.options.value.forEach(e=>{const t=this._findItemByValue(e);t?this._addPill(t.value,t.label):"string"==typeof e&&this._addPill(e,e)}),this._bindEvents(),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false")):console.error("Pillbox requires an input element"))}_createStructure(){const e=document.createElement("div");if(e.className=`dm-pillbox dm-pillbox-${this.options.size}`,this._container=document.createElement("div"),this._container.className="dm-pillbox-container",this._input=document.createElement("input"),this._input.type="text",this._input.className="dm-pillbox-input",this._input.placeholder=this.options.placeholder,this._container.appendChild(this._input),e.appendChild(this._container),this.options.clearable&&(this._clearBtn=document.createElement("button"),this._clearBtn.type="button",this._clearBtn.className="dm-pillbox-clear",this._clearBtn.innerHTML="×",this._clearBtn.title="Clear all",this._clearBtn.style.display="none",e.appendChild(this._clearBtn)),this.options.searchable){this._dropdown=document.createElement("div"),this._dropdown.className="dm-pillbox-dropdown",this._dropdown.style.display="none",this._optionsList=document.createElement("ul"),this._optionsList.className="dm-pillbox-options",this._dropdown.appendChild(this._optionsList);const t=document.createElement("div");t.className="dm-pillbox-empty",t.textContent=this.options.noResultsMessage,t.style.display="none",this._dropdown.appendChild(t),e.appendChild(this._dropdown)}this.element.parentNode.insertBefore(e,this.element.nextSibling),this._wrapper=e}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this._input,"input",e),this._addEventListener(this._input,"keydown",t),this._addEventListener(this._input,"focus",()=>{this.options.searchable&&this._input.value&&this._filterOptions(this._input.value)}),this._addEventListener(this._input,"blur",()=>{setTimeout(()=>{this._dropdown?.contains(document.activeElement)||this.close()},200)}),this._clearBtn&&this._addEventListener(this._clearBtn,"click",()=>{this.clear(),this._input.focus()}),this._addEventListener(this._container,"click",e=>{e.target===this._container&&this._input.focus()})}_handleInput(e){const t=e.target.value;this.options.searchable&&t?this._filterOptions(t):this.close()}_handleKeydown(e){const t=this._input.value;if("Backspace"===e.key&&!t&&this._pills.length>0){e.preventDefault();const t=this._container.querySelectorAll(".dm-pill")[this._pills.length-1];return void this._removePill(t)}if("Enter"===e.key&&t)return e.preventDefault(),void(this._isOpen&&this._activeIndex>=0?this._selectOption(this._activeIndex):this.options.creatable&&this._createPill(t));if(this._isOpen){const t=this._optionsList.querySelectorAll(".dm-pillbox-option");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this.close()}}}_filterOptions(e){const t=e.toLowerCase(),n=this._pills.map(e=>e.value);this._filteredData=this.options.data.filter(e=>{const s="string"==typeof e?e:e.value,o="string"==typeof e?e:e.label||e.value;return!n.includes(s)&&(!e.disabled&&o.toLowerCase().includes(t))}),this._renderOptions()}_renderOptions(){this._optionsList.innerHTML="",this._activeIndex=-1;const e=this._dropdown.querySelector(".dm-pillbox-empty");if(0===this._filteredData.length)return e.style.display="block",this._optionsList.style.display="none",void this.open();e.style.display="none",this._optionsList.style.display="block",this._filteredData.forEach((e,t)=>{const n=document.createElement("li");if(n.className="dm-pillbox-option",n.setAttribute("data-index",t),this.options.renderOption){const t=this.options.renderOption(e);n.innerHTML="string"==typeof t?t:"","string"!=typeof t&&n.appendChild(t)}else{const t="string"==typeof e?e:e.label||e.value;n.textContent=t}n.addEventListener("click",()=>{this._selectOption(t)}),n.addEventListener("mouseenter",()=>{this._activeIndex=t,this._updateActive()}),this._optionsList.appendChild(n)}),this.open()}_updateActive(){this._optionsList.querySelectorAll(".dm-pillbox-option").forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.scrollIntoView({block:"nearest"})):e.classList.remove("active")})}_selectOption(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value,s="string"==typeof t?t:t.label||t.value;this._addPill(n,s),this._input.value="",this.close(),this._input.focus()}_createPill(e){if(!e.trim())return;const t=this._validate(e);t?this.options.onValidationError&&this.options.onValidationError(t,e):(this._addPill(e,e),this._input.value="",this.options.onCreate&&this.options.onCreate(e))}_addPill(e,t){const n=this._validate(e);if(n)return void(this.options.onValidationError&&this.options.onValidationError(n,e));const s=document.createElement("div");if(s.className="dm-pill",s.setAttribute("data-value",e),this.options.renderPill){const n=this.options.renderPill({value:e,label:t});s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const e=this.options.pillTemplate.replace("{label}",t);s.innerHTML=e}const o=document.createElement("button");o.type="button",o.className="dm-pill-remove",o.innerHTML="×",o.title=`Remove ${t}`,o.addEventListener("click",e=>{e.stopPropagation(),this._removePill(s)}),s.appendChild(o),this._container.insertBefore(s,this._input),this._pills.push({value:e,label:t,element:s}),this._updateHiddenInput(),this._clearBtn&&(this._clearBtn.style.display="block"),this.options.onAdd&&this.options.onAdd(e,s),this._triggerChange()}_removePill(e){const t=e.getAttribute("data-value"),n=this._pills.findIndex(e=>e.value===t);-1!==n&&(this._pills[n],e.remove(),this._pills.splice(n,1),this._updateHiddenInput(),0===this._pills.length&&this._clearBtn&&(this._clearBtn.style.display="none"),this.options.onRemove&&this.options.onRemove(t,e),this._triggerChange())}_validate(e){if(this.options.maxItems&&this._pills.length>=this.options.maxItems)return this.options.onMaxReached&&this.options.onMaxReached(),this.options.maxItemsMessage.replace("{max}",this.options.maxItems);if(!this.options.duplicates&&this._pills.some(t=>t.value===e))return this.options.duplicateMessage;if(this.options.validatePill){const t=this.options.validatePill(e);if(!0!==t&&void 0!==t)return"string"==typeof t?t:"Invalid value"}return null}_findItemByValue(e){return this.options.data.find(t=>("string"==typeof t?t:t.value)===e)}_updateHiddenInput(){const e=this._pills.map(e=>e.value);this.element.value=JSON.stringify(e)}_triggerChange(){const e=this.getValue();this.model&&this.modelKey&&this.model.set(this.modelKey,e),this.options.onChange&&this.options.onChange(e)}open(){return!this._dropdown||this._isOpen||(this._isOpen=!0,this._dropdown.style.display="block",this._input.setAttribute("aria-expanded","true")),this}close(){return this._dropdown&&this._isOpen?(this._isOpen=!1,this._dropdown.style.display="none",this._input.setAttribute("aria-expanded","false"),this._activeIndex=-1,this):this}isOpen(){return this._isOpen}getValue(){return this._pills.map(e=>e.value)}setValue(e){return this.clear(),Array.isArray(e)&&e.forEach(e=>{const t=this._findItemByValue(e);if(t){const n="string"==typeof t?t:t.label||t.value;this._addPill(e,n)}else"string"==typeof e&&this._addPill(e,e)}),this}addPill(e,t){return t=t||e,this._addPill(e,t),this}removePill(e){const t=this._container.querySelector(`.dm-pill[data-value="${e}"]`);return t&&this._removePill(t),this}removePillAt(e){return e>=0&&e<this._pills.length&&this._removePill(this._pills[e].element),this}clear(){return[...this._pills].forEach(e=>{this._removePill(e.element)}),this}getCount(){return this._pills.length}setData(e){return this.options.data=e,this}focus(){return this._input.focus(),this}enable(){return this._input.disabled=!1,this._wrapper.classList.remove("disabled"),this}disable(){return this._input.disabled=!0,this._wrapper.classList.add("disabled"),this.close(),this}destroy(){this.close(),this._wrapper&&this._wrapper.parentNode&&this._wrapper.parentNode.removeChild(this._wrapper),this.element.style.display="",this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Xt extends h{static _stack=[];static _top(){return Xt._prune(),Xt._stack[Xt._stack.length-1]||null}static _prune(){Xt._stack=Xt._stack.filter(e=>e._isOpen&&e.element&&e.element.isConnected)}static _removeFromStack(e){Xt._prune();const t=Xt._stack.lastIndexOf(e);-1!==t&&Xt._stack.splice(t,1)}static defaults={position:"right",size:"lg",backdrop:!0,backdropClose:!0,keyboard:!0,animation:!0,animationDuration:300,closeOnEscape:!0,title:"",content:"",closable:!0,closeIcon:"x",headerClass:"",bodyClass:"",footerClass:"",customSizes:{},onOpen:null,onClose:null,onClosed:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._backdrop=null,this._originalBodyOverflow=null,this._keydownHandler=null,this._init()}_init(){this.element&&(this._setupElement(),this._bindEvents())}_setupElement(){const e=this.element;this.options,e.classList.add("dm-slideover"),e.style.position="fixed",e.style.top="0",e.style.height="100vh",e.style.backgroundColor="var(--dm-surface, #fff)",e.style.boxShadow=this._getBoxShadow(),e.style.zIndex="9999",e.style.display="none",e.style.flexDirection="column",e.style.overflow="hidden",this._applyPosition(),this._applySize(),this._applyAnimation()}_applyPosition(){const e=this.element,t=this.options.position;switch(e.classList.remove("dm-slideover-left","dm-slideover-right","dm-slideover-top","dm-slideover-bottom"),e.classList.add(`dm-slideover-${t}`),t){case"left":e.style.left="-100%",e.style.right="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"right":e.style.right="-100%",e.style.left="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"top":e.style.top="-100%",e.style.bottom="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue();break;case"bottom":e.style.bottom="-100%",e.style.top="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue()}}_applySize(){const e=this._getSizeValue(),t=this.options.position;["left","right"].includes(t)?this.element.style.width=e:this.element.style.height=e}_getSizeValue(){const{size:e,customSizes:t}=this.options;if(t&&t[e])return t[e];const n={sm:"25%",md:"50%",lg:"75%",xl:"90%",full:"100%"};return"string"==typeof e&&(e.includes("px")||e.includes("%")||e.includes("rem")||e.includes("em"))?e:n[e]||n.lg}_applyAnimation(){this.options.animation?this.element.style.transition=`all ${this.options.animationDuration}ms ease`:this.element.style.transition="none"}_getBoxShadow(){switch(this.options.position){case"left":return"2px 0 8px rgba(0,0,0,0.15)";case"right":default:return"-2px 0 8px rgba(0,0,0,0.15)";case"top":return"0 2px 8px rgba(0,0,0,0.15)";case"bottom":return"0 -2px 8px rgba(0,0,0,0.15)"}}_bindEvents(){if(this.options.closable){const e=this.element.querySelector('[data-dismiss="slideover"], .dm-slideover-close');e&&this._addEventListener(e,"click",()=>this.close())}this._keydownHandler=e=>{if(this._isOpen&&this.options.keyboard&&"Escape"===e.key){if(Xt._top()!==this)return;this.options.closeOnEscape&&this.close()}}}_createBackdrop(){this.options.backdrop&&(this._backdrop=document.createElement("div"),this._backdrop.className="dm-slideover-backdrop",this._backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9998;\n display: none;\n transition: opacity ${this.options.animationDuration}ms ease;\n opacity: 0;\n `,this.options.backdropClose&&this._backdrop.addEventListener("click",()=>this.close()),document.body.appendChild(this._backdrop))}_showBackdrop(){this._backdrop&&(this._backdrop.style.display="block",requestAnimationFrame(()=>{this._backdrop.style.opacity="1"}))}_hideBackdrop(){this._backdrop&&(this._backdrop.style.opacity="0",setTimeout(()=>{this._backdrop&&(this._backdrop.style.display="none")},this.options.animationDuration))}_getOpenPosition(){switch(this.options.position){case"left":return{left:"0",right:"auto"};case"right":return{right:"0",left:"auto"};case"top":return{top:"0",bottom:"auto"};case"bottom":return{bottom:"0",top:"auto"}}}open(){if(this._isOpen)return this;const e=this.element;if(!e)return this;this.options.backdrop&&!this._backdrop&&this._createBackdrop(),this._originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._showBackdrop(),e.style.display="flex";const t=this._getOpenPosition();return requestAnimationFrame(()=>{Object.assign(e.style,t)}),this.options.keyboard&&document.addEventListener("keydown",this._keydownHandler),this._isOpen=!0,Xt._removeFromStack(this),Xt._stack.push(this),setTimeout(()=>{this.options.onOpen&&this.options.onOpen(this),this._createForm()},this.options.animationDuration),this}_createForm(){if(this._schema&&!this._formaForm&&window.Domma&&window.Domma.forms&&window.Domma.forms.create)try{console.log("📝 Creating Forma form with schema:",this._schema);let e=this._schema;if(this._schema.fields&&Array.isArray(this._schema.fields)){e={};for(const t of this._schema.fields)t.name&&(e[t.name]={type:t.type||"string",label:t.label,required:t.required||!1,default:t.defaultValue,min:t.validation?.minLength,max:t.validation?.maxLength,pattern:t.validation?.pattern?new RegExp(t.validation.pattern):void 0,options:t.options,formConfig:{placeholder:t.placeholder,hint:t.help,rows:t.rows,accept:t.accept,multiple:t.multiple}});console.log("📝 Converted schema:",e)}const t={onSubmit:(e,t)=>(console.log("📝 Schema form submitted:",e),this._onSave&&this._onSave(e,t,this),!1),onCancel:()=>{console.log("📝 Schema form cancelled"),this.close()},layout:"stacked",showLabels:!0,showHelperText:!0,showHints:!0,cssFramework:"domma",className:"domma-form",fieldClassName:"col-6 mb-3",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint"};this._formaForm=window.Domma.forms.create(e,this._data||{},t),this._formaForm.renderTo("#schema-form-container"),console.log("📝 Forma form created and rendered successfully")}catch(e){console.error("📝 Failed to create Forma form:",e);const t=this.element.querySelector(".dm-slideover-body");t&&(t.innerHTML="<p>Form creation failed. Please try again.</p>")}}close(){if(!this._isOpen)return this;const e=this.element;if(!e)return this;if(this.options.onClose&&this.options.onClose(this),this._applyPosition(),this._hideBackdrop(),null!==this._originalBodyOverflow&&(document.body.style.overflow=this._originalBodyOverflow),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Xt._removeFromStack(this),this._formaForm)try{this._formaForm.destroy&&this._formaForm.destroy(),this._formaForm=null;const t=e.querySelector("#schema-form-container");t&&(t.innerHTML="")}catch(e){console.warn("Error cleaning up form:",e)}return setTimeout(()=>{e.style.display="none",this._isOpen=!1,this.options.onClosed&&this.options.onClosed(this)},this.options.animationDuration),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setTitle(e){const t=this.element.querySelector(".dm-slideover-header .dm-slideover-title");return t&&(t.textContent=e),this}setContent(e){const t=this.element.querySelector(".dm-slideover-body");return t&&("string"==typeof e?t.innerHTML=r.sanitise(String(e)):e instanceof Element&&(t.innerHTML="",t.appendChild(e))),this}setSize(e){return this.options.size=e,this._applySize(),this}setPosition(e){return this.options.position=e,this.element.style.boxShadow=this._getBoxShadow(),this._applyPosition(),this}destroy(){this.close(),this._backdrop&&(this._backdrop.remove(),this._backdrop=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Xt._removeFromStack(this),super.destroy()}static create(e={}){const t=document.createElement("div");t.className="dm-slideover";const{title:n,content:s,schema:o,data:i={},closable:r=!0,closeIcon:a="x",onSave:l}=e;let d="";if((n||r)&&(d+='<div class="dm-slideover-header">',n&&(d+=`<h5 class="dm-slideover-title">${n}</h5>`),r&&(d+='<button type="button" class="btn btn-ghost-secondary dm-slideover-close" data-dismiss="slideover" aria-label="Close">',window.Domma&&window.Domma.icons?d+=Domma.icons.render(a,{size:20}).outerHTML:d+="×",d+="</button>"),d+="</div>"),d+='<div class="dm-slideover-body">',o?(d+='<div class="container-fluid p-4">',d+='<div class="card">',d+='<div class="card-body p-4">',d+='<div class="row g-3" id="schema-form-container"></div>',d+="</div>",d+="</div>",d+="</div>"):s&&(d+="string"==typeof s?s:""),d+="</div>",t.innerHTML=d,document.body.appendChild(t),s instanceof Element&&!o){const e=t.querySelector(".dm-slideover-body");e.innerHTML="",e.appendChild(s)}const c=new Xt(t,e);return c._schema=o,c._data=i,c._onSave=l,c}}class Zt extends h{static defaults={mode:"timeline",items:[],layout:"vertical",animation:!0,animationDelay:100,responsive:!0,theme:"default",clickable:!1,onItemClick:null,allowHtml:!1,yearWidth:"80px",contentMaxWidth:"600px",dateFormat:"YYYY",showConnector:!0,showProgress:!0,progressPosition:"top",statusIcons:!0,allowStatusChange:!1,onStatusChange:null,currentItem:null,completedAnimation:!0,icons:{planned:"circle","in-progress":"clock",completed:"check-circle",blocked:"alert-circle",cancelled:"x-circle"},colors:{planned:"var(--dm-gray-400)","in-progress":"var(--dm-primary)",completed:"var(--dm-success)",blocked:"var(--dm-danger)",cancelled:"var(--dm-gray-500)"}};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.element.classList.add("dm-progression",`dm-progression-${this.options.mode}`,`dm-progression-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this._attachEvents(),this.options.animation&&this._animateItems())}_renderItems(){const e=this.options.items;Array.isArray(e)&&0!==e.length&&(this.element.innerHTML="","roadmap"===this.options.mode&&this.options.showProgress&&"top"===this.options.progressPosition&&this._renderProgressBar(),e.forEach((e,t)=>{const n="roadmap"===this.options.mode?this._renderRoadmapItem(e,t):this._renderTimelineItem(e,t);this.element.appendChild(n)}),"roadmap"===this.options.mode&&this.options.showProgress&&"bottom"===this.options.progressPosition&&this._renderProgressBar())}_renderTimelineItem(e,t){const n=document.createElement("div");return n.className="dm-progression-item dm-timeline-item",n.setAttribute("data-index",t),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease"),n.innerHTML=`\n <div class="dm-progression-marker dm-timeline-year">${this._escapeHtml(e.year||e.date||"")}</div>\n <div class="dm-progression-content dm-timeline-content">\n <h4 class="dm-progression-title dm-timeline-title">${this._escapeHtml(e.title||"")}</h4>\n <p class="dm-progression-description dm-timeline-description">${this._renderContent(e.description||"")}</p>\n </div>\n `,n}_renderRoadmapItem(e,t){const n=document.createElement("div"),s=e.status||"planned",o=this.options.currentItem===e.id||this.options.currentItem===t;n.className=`dm-progression-item dm-progression-status-${s}${o?" dm-progression-current":""}`,n.setAttribute("data-index",t),n.setAttribute("data-id",e.id||t),n.setAttribute("data-status",s),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease");let i='<div class="dm-progression-marker dm-progression-status-marker">';this.options.statusIcons&&this.options.icons[s]?i+=`<span class="dm-progression-status-icon" data-icon="${this.options.icons[s]}"></span>`:i+='<span class="dm-progression-status-dot"></span>',i+="</div>";let r='<div class="dm-progression-content">';return e.date&&(r+=`<div class="dm-progression-date">${this._escapeHtml(e.date)}</div>`),r+=`<h4 class="dm-progression-title">${this._escapeHtml(e.title||"")}</h4>`,e.description&&(r+=`<p class="dm-progression-description">${this._renderContent(e.description)}</p>`),"in-progress"===s&&"number"==typeof e.progress&&(r+=`\n <div class="dm-progression-item-progress">\n <div class="dm-progression-item-progress-bar" style="width: ${Math.min(100,Math.max(0,e.progress))}%"></div>\n </div>\n <div class="dm-progression-item-progress-text">${e.progress}%</div>\n `),e.priority&&(r+=`<span class="dm-progression-priority dm-progression-priority-${e.priority}">${this._escapeHtml(e.priority)}</span>`),e.tags&&Array.isArray(e.tags)&&e.tags.length>0&&(r+='<div class="dm-progression-tags">',e.tags.forEach(e=>{r+=`<span class="dm-progression-tag">${this._escapeHtml(e)}</span>`}),r+="</div>"),e.assignee&&(r+=`<div class="dm-progression-assignee">${this._escapeHtml(e.assignee)}</div>`),r+="</div>",n.innerHTML=i+r,n}_renderProgressBar(){const e=this.getProgress(),t=document.createElement("div");t.className="dm-progression-progress",t.innerHTML=`\n <div class="dm-progression-progress-bar" style="width: ${e}%"></div>\n <div class="dm-progression-progress-text">${Math.round(e)}% Complete</div>\n `,this.element.appendChild(t)}_attachEvents(){this.options.clickable&&(this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-item");if(t){const e=parseInt(t.getAttribute("data-index"),10),n=this.options.items[e];n&&this.options.onItemClick&&this.options.onItemClick(n,e,t)}}),"roadmap"===this.options.mode&&this.options.allowStatusChange&&this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-marker");if(t){const e=t.closest(".dm-progression-item"),n=parseInt(e.getAttribute("data-index"),10),s=this.options.items[n];s&&"completed"!==s.status&&this._cycleStatus(s,n)}}))}_cycleStatus(e,t){const n=["planned","in-progress","completed"],s=n.indexOf(e.status||"planned"),o=n[(s+1)%n.length];this.setStatus(t,o)}_animateItems(){this.element.querySelectorAll(".dm-progression-item").forEach((e,t)=>{setTimeout(()=>{e.style.opacity="1",e.style.transform="translateY(0)"},t*this.options.animationDelay)})}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}_sanitizeHtml(e){return"undefined"!=typeof DOMPurify?DOMPurify.sanitize(e,{ALLOWED_TAGS:["p","strong","em","u","br","ul","ol","li","code","pre","a","h1","h2","h3","h4","h5","h6","blockquote","span","div"],ALLOWED_ATTR:["href","target","class","id"]}):(console.warn("DOMPurify not available, falling back to HTML escaping"),this._escapeHtml(e))}_renderContent(e){return this.options.allowHtml?this._sanitizeHtml(e):this._escapeHtml(e)}_findItemIndex(e){return"number"==typeof e?e:this.options.items.findIndex(t=>t.id===e)}setItems(e){return this.options.items=e,this._renderItems(),this.options.animation&&this._animateItems(),this}addItem(e){return this.options.items.push(e),this._renderItems(),this.options.animation&&this._animateItems(),this}getItems(){return[...this.options.items]}getItem(e){const t=this._findItemIndex(e);return t>=0?{...this.options.items[t]}:null}updateItem(e,t){const n=this._findItemIndex(e);return n>=0&&(this.options.items[n]={...this.options.items[n],...t},this._renderItems(),this.options.animation&&this._animateItems()),this}removeItem(e){const t=this._findItemIndex(e);return t>=0&&(this.options.items.splice(t,1),this._renderItems(),this.options.animation&&this._animateItems()),this}setLayout(e){return this.element.classList.remove(`dm-progression-${this.options.layout}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.layout}`),this.options.layout=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`),this}setTheme(e){return"default"!==this.options.theme&&(this.element.classList.remove(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.theme=e,"default"!==e&&(this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`)),this}setMode(e){return this.element.classList.remove(`dm-progression-${this.options.mode}`),"timeline"===this.options.mode&&(this.element.classList.remove("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.mode=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===e&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this.options.animation&&this._animateItems(),this}getMode(){return this.options.mode}refresh(){return this._renderItems(),this.options.animation&&this._animateItems(),this}setStatus(e,t){const n=this._findItemIndex(e);if(n>=0){const e=this.options.items[n].status;this.options.items[n].status=t,this.options.onStatusChange&&this.options.onStatusChange(this.options.items[n],e,t),this._renderItems(),this.options.animation&&this._animateItems()}return this}getStatus(e){const t=this.getItem(e);return t?t.status:null}getItemsByStatus(e){return this.options.items.filter(t=>t.status===e)}setCurrent(e){const t=this._findItemIndex(e);return t>=0&&(this.options.currentItem=this.options.items[t].id||t,this._renderItems(),this.options.animation&&this._animateItems()),this}getCurrent(){return null===this.options.currentItem?null:this.getItem(this.options.currentItem)}getProgress(){if("roadmap"!==this.options.mode||0===this.options.items.length)return 0;const e=this.options.items.filter(e=>"completed"===e.status).length;return Math.round(e/this.options.items.length*100)}markComplete(e){return this.setStatus(e,"completed")}markInProgress(e){return this.setStatus(e,"in-progress")}markBlocked(e){return this.setStatus(e,"blocked")}}class Qt extends h{static defaults={width:null,height:180,penColour:"#000000",penWidth:2,format:"png",label:"Signature",guideLine:!0,placeholder:"Sign here",colours:["#000000","#1e40af","#15803d","#b91c1c"],widths:[1,2,4],toolbar:!0,name:"signature",disabled:!1,typeFallback:!1,minStrokeLength:3,respectMotionPreference:!0,onChange:null,onClear:null,onBegin:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._strokes=[],this._undoneStrokes=[],this._currentStroke=null,this._mode="draw",this._isDrawing=!1,this._currentColour=this.options.penColour,this._currentWidth=this.options.penWidth,this._resizeObserver=null,this._canvas=null,this._ctx=null,this._canvasW=0,this._canvasH=0,this._dpr=1,this._render(),this._initCanvas(),this._initEvents(),this.options.disabled&&this.disable())}_esc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_render(){const e=this.options,t=this._esc.bind(this),n=e.colours.map(e=>{const n=t(e),s=e===this._currentColour;return`<button class="signature-colour-swatch${s?" active":""}" data-colour="${n}" style="background:${n}" aria-label="Pen colour ${n}" aria-pressed="${s}" title="${n}"></button>`}).join(""),s=e.widths.map(e=>{const t=parseFloat(e)||2,n=t===this._currentWidth,s=Math.max(2,Math.min(2.5*t,12));return`<button class="signature-width-btn${n?" active":""}" data-width="${t}" aria-label="Pen width ${t}px" aria-pressed="${n}">\n <span class="signature-width-dot" style="width:${s}px;height:${s}px;"></span>\n </button>`}).join(""),o=e.typeFallback?'\n <div class="signature-mode-toggle" role="group" aria-label="Input mode">\n <button class="signature-mode-btn active" data-mode="draw" aria-pressed="true">Draw</button>\n <button class="signature-mode-btn" data-mode="type" aria-pressed="false">Type</button>\n </div>':"",i=e.toolbar?`\n <div class="signature-toolbar">\n <span class="signature-label">${t(e.label)}</span>\n <div class="signature-colours" role="group" aria-label="Pen colour">${n}</div>\n <div class="signature-widths" role="group" aria-label="Pen width">${s}</div>\n <div class="signature-actions">\n <button class="signature-btn" data-action="undo" aria-label="Undo" disabled>\n <span data-icon="undo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn" data-action="redo" aria-label="Redo" disabled>\n <span data-icon="redo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn signature-btn-clear" data-action="clear" aria-label="Clear signature">Clear</button>\n </div>\n ${o}\n </div>`:"",r=parseInt(e.height,10)||180,a=t(e.format.toUpperCase()),l=t(e.name),d=t(e.placeholder),c=`\n ${i}\n <div class="signature-canvas-wrapper" style="height:${r}px;">\n <canvas class="signature-canvas" tabindex="0" aria-label="Draw your signature here"></canvas>\n ${e.guideLine?'<div class="signature-guide-line" aria-hidden="true"></div>':""}\n <div class="signature-placeholder" aria-hidden="true">${d}</div>\n <input class="signature-type-input" type="text" placeholder="${d}" style="display:none;" aria-label="Type your signature">\n </div>\n <div class="signature-footer">\n <span class="signature-status" aria-live="polite">Draw your signature above</span>\n <span class="signature-format-badge">${a}</span>\n </div>\n <input type="hidden" name="${l}" value="">\n `;this.element.classList.add("signature"),this.element.setAttribute("role","application"),this.element.setAttribute("aria-label",t(e.label)),this.element.textContent="",this.element.insertAdjacentHTML("afterbegin",c),this._canvas=this.element.querySelector(".signature-canvas"),this._wrapper=this.element.querySelector(".signature-canvas-wrapper"),this._placeholder=this.element.querySelector(".signature-placeholder"),this._statusEl=this.element.querySelector(".signature-status"),this._hiddenInput=this.element.querySelector('input[type="hidden"]'),this._typeInput=this.element.querySelector(".signature-type-input"),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(this.element)}_initCanvas(){this._canvas&&(this._ctx=this._canvas.getContext("2d"),this._scaleCanvas(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._scaleCanvas(),this._redraw()}),this._resizeObserver.observe(this._wrapper)))}_scaleCanvas(){const e=window.devicePixelRatio||1,t=this._wrapper.clientWidth,n=this._wrapper.clientHeight;this._canvas.width=t*e,this._canvas.height=n*e,this._ctx.setTransform(e,0,0,e,0,0),this._dpr=e,this._canvasW=t,this._canvasH=n}_initEvents(){const e=this._canvas;e&&(this._addEventListener(e,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(e,"pointermove",e=>this._onPointerMove(e)),this._addEventListener(e,"pointerup",e=>this._onPointerUp(e)),this._addEventListener(e,"pointercancel",e=>this._onPointerUp(e)),this._addEventListener(e,"pointerleave",e=>{this._isDrawing&&this._onPointerUp(e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest("[data-action]");if(t){const e=t.dataset.action;return void("undo"===e?this.undo():"redo"===e?this.redo():"clear"===e&&this.clear())}const n=e.target.closest(".signature-colour-swatch");if(n)return void this._setColour(n.dataset.colour);const s=e.target.closest(".signature-width-btn");if(s)return void this._setPenWidth(parseFloat(s.dataset.width));const o=e.target.closest(".signature-mode-btn");o&&this._setMode(o.dataset.mode)}),this._typeInput&&this._addEventListener(this._typeInput,"input",()=>this._renderTypeToCanvas()))}_onPointerDown(e){if(this.options.disabled||"draw"!==this._mode)return;e.preventDefault(),this._canvas.setPointerCapture(e.pointerId),this._isDrawing=!0,this.element.classList.add("signature-signing");const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke={points:[{x:t,y:n,pressure:s}],colour:this._currentColour,width:this._currentWidth},this._undoneStrokes=[],this._updateState(),"function"==typeof this.options.onBegin&&this.options.onBegin(this._currentStroke)}_onPointerMove(e){if(!this._isDrawing||!this._currentStroke)return;e.preventDefault();const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke.points.push({x:t,y:n,pressure:s}),this._redrawCurrentStroke()}_onPointerUp(e){if(!this._isDrawing)return;this._isDrawing=!1,this.element.classList.remove("signature-signing"),this._currentStroke&&this._currentStroke.points.length>=this.options.minStrokeLength&&this._strokes.push(this._currentStroke);const t=this._currentStroke;this._currentStroke=null,this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onEnd&&t&&this.options.onEnd(t),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value)}_getPoint(e){const t=this._canvas.getBoundingClientRect();return{x:(e.clientX-t.left)/this._canvasW,y:(e.clientY-t.top)/this._canvasH}}_redraw(){if(!this._ctx)return;const e=this._canvasW,t=this._canvasH;this._ctx.clearRect(0,0,e,t);for(const n of this._strokes)this._drawStroke(this._ctx,n,e,t);this._placeholder&&(this._placeholder.style.display=this._strokes.length>0?"none":"")}_redrawCurrentStroke(){this._redraw(),this._currentStroke&&this._drawStroke(this._ctx,this._currentStroke,this._canvasW,this._canvasH)}_drawStroke(e,t,n,s){const o=t.points;if(0!==o.length){if(e.save(),e.strokeStyle=t.colour,e.fillStyle=t.colour,e.lineCap="round",e.lineJoin="round",1===o.length){const i=t.width*(.4+.6*o[0].pressure);e.beginPath(),e.arc(o[0].x*n,o[0].y*s,i/2,0,2*Math.PI),e.fill()}else{e.beginPath(),e.moveTo(o[0].x*n,o[0].y*s);for(let i=1;i<o.length-1;i++){const r=(o[i].x+o[i+1].x)/2*n,a=(o[i].y+o[i+1].y)/2*s;e.lineWidth=t.width*(.4+.6*o[i].pressure),e.quadraticCurveTo(o[i].x*n,o[i].y*s,r,a),e.stroke(),e.beginPath(),e.moveTo(r,a)}const i=o[o.length-1];e.lineWidth=t.width*(.4+.6*i.pressure),e.lineTo(i.x*n,i.y*s),e.stroke()}e.restore()}}_updateState(){const e=this.element.querySelector('[data-action="undo"]'),t=this.element.querySelector('[data-action="redo"]');e&&(e.disabled=0===this._strokes.length),t&&(t.disabled=0===this._undoneStrokes.length),this._statusEl&&(this._isDrawing?this._statusEl.textContent="Signing…":this._strokes.length>0?this._statusEl.textContent="Signature captured":this._statusEl.textContent="Draw your signature above")}_setColour(e){this._currentColour=e,this.element.querySelectorAll(".signature-colour-swatch").forEach(t=>{const n=t.dataset.colour===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setPenWidth(e){this._currentWidth=e,this.element.querySelectorAll(".signature-width-btn").forEach(t=>{const n=parseFloat(t.dataset.width)===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setMode(e){if(this._mode===e)return;this._mode=e,this.element.querySelectorAll(".signature-mode-btn").forEach(t=>{const n=t.dataset.mode===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")});this.element.querySelectorAll('.signature-colours, .signature-widths, [data-action="undo"], [data-action="redo"]').forEach(t=>{t.style.display="type"===e?"none":""}),"type"===e?(this._canvas.style.display="none",this._typeInput&&(this._typeInput.style.display="",this._typeInput.focus())):(this._canvas.style.display="",this._typeInput&&(this._typeInput.style.display="none")),this.clear(!0)}_renderTypeToCanvas(){const e=this._typeInput?this._typeInput.value.trim():"";this._strokes=[],this._undoneStrokes=[];const t=this._ctx,n=this._canvasW,s=this._canvasH;t.clearRect(0,0,n,s),e&&(t.save(),t.fillStyle=this._currentColour,t.font=`${Math.min(.55*s,72)}px 'Brush Script MT', 'Segoe Script', cursive`,t.textAlign="center",t.textBaseline="middle",t.fillText(e,n/2,s/2),t.restore()),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value)}_updateHiddenInput(){if(!this._hiddenInput)return;const e=this.isEmpty()&&"type"!==this._mode;this._hiddenInput.value=e?"":this.toBase64()}toBase64(e){return"svg"===(e||this.options.format)?this._toSVGBase64():this._canvas.toDataURL("image/png")}_toSVGBase64(){const e=this._canvasW,t=this._canvasH;let n="";for(const s of this._strokes){const o=s.points;if(0===o.length)continue;let i=`M ${(o[0].x*e).toFixed(2)} ${(o[0].y*t).toFixed(2)}`;for(let n=1;n<o.length-1;n++){const s=((o[n].x+o[n+1].x)/2*e).toFixed(2),r=((o[n].y+o[n+1].y)/2*t).toFixed(2);i+=` Q ${(o[n].x*e).toFixed(2)} ${(o[n].y*t).toFixed(2)} ${s} ${r}`}if(o.length>1){const n=o[o.length-1];i+=` L ${(n.x*e).toFixed(2)} ${(n.y*t).toFixed(2)}`}const r=o.reduce((e,t)=>e+t.pressure,0)/o.length,a=(s.width*(.4+.6*r)).toFixed(2);n+=`<path d="${i}" stroke="${s.colour}" stroke-width="${a}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>\n`}return"data:image/svg+xml;base64,"+btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">\n${n}</svg>`)}isEmpty(){return"type"===this._mode?!this._typeInput||""===this._typeInput.value.trim():0===this._strokes.length}clear(e=!1){!e&&this._strokes.length>0&&(this._undoneStrokes=[...this._strokes,...this._undoneStrokes]),this._strokes=[],this._currentStroke=null,this._redraw(),this._updateState(),this._hiddenInput&&(this._hiddenInput.value=""),e||(this._statusEl&&(this._statusEl.textContent="Signature cleared"),"function"==typeof this.options.onClear&&this.options.onClear(),"function"==typeof this.options.onChange&&this.options.onChange(""))}undo(){0!==this._strokes.length&&(this._undoneStrokes.unshift(this._strokes.pop()),this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value))}redo(){0!==this._undoneStrokes.length&&(this._strokes.push(this._undoneStrokes.shift()),this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value))}disable(){this.options.disabled=!0,this.element.classList.add("signature-disabled"),this._canvas&&this._canvas.setAttribute("aria-disabled","true"),this._typeInput&&(this._typeInput.disabled=!0),this.element.querySelectorAll("[data-action]").forEach(e=>{e.disabled=!0})}enable(){this.options.disabled=!1,this.element.classList.remove("signature-disabled"),this._canvas&&this._canvas.removeAttribute("aria-disabled"),this._typeInput&&(this._typeInput.disabled=!1),this._updateState();const e=this.element.querySelector('[data-action="clear"]');e&&(e.disabled=!1)}destroy(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),super.destroy()}}const en=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function nn(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return"";const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function sn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getFullYear(),e.getMonth(),e.getDate());if("number"==typeof e)return sn(new Date(e));const t=String(e??"").trim();if(!t)return null;const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(t);if(n){const e=new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));return e.getMonth()===Number(n[2])-1?e:null}const s=new Date(t);return Number.isNaN(s.getTime())?null:new Date(s.getFullYear(),s.getMonth(),s.getDate())}function on(e,t){if(!e)return"";const n=e=>String(e).padStart(2,"0"),s={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:en[e.getMonth()],MMM:en[e.getMonth()].slice(0,3),MM:n(e.getMonth()+1),M:String(e.getMonth()+1),DDDD:tn[e.getDay()],DDD:tn[e.getDay()].slice(0,3),DD:n(e.getDate()),D:String(e.getDate())};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|D/g,e=>s[e])}function rn(e,t){return Boolean(e)&&Boolean(t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}class an extends h{static defaults={value:null,format:"YYYY-MM-DD",min:null,max:null,firstDay:1,disabledDates:null,openOnFocus:!0,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,clearable:!0,todayButton:!0,readonlyInput:!1,inline:!1,position:"bottom-start",offset:[0,4],weekNumbers:!1,placeholder:null,onChange:null,onOpen:null,onClose:null};static _open=null;constructor(e,t={}){super(e,t),this.element&&(this._panel=null,this._isOpen=!1,this._value=null,this._view=null,this._focused=null,this._init())}_init(){const e=this.element,t=this.options;"INPUT"===e.tagName&&"date"===e.type&&(e.type="text"),e.setAttribute("autocomplete","off"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","false"),t.readonlyInput&&(e.readOnly=!0),null!==t.placeholder?e.placeholder=t.placeholder:e.placeholder||(e.placeholder=t.format);const n=null!==t.value&&void 0!==t.value&&""!==t.value?t.value:e.value;if(this._value=this._clamp(sn(n)),this._view=this._value?new Date(this._value):this._clamp(new Date)||new Date,this._renderInput(),t.inline)return this._buildPanel(),e.insertAdjacentElement("afterend",this._panel),this._panel.classList.add("dm-datepicker--inline"),this._paint(),void(this._isOpen=!0);this._addEventListener(e,"click",()=>this.open()),t.openOnFocus&&this._addEventListener(e,"focus",()=>this.open()),this._addEventListener(e,"keydown",e=>this._onInputKey(e)),this._addEventListener(e,"change",()=>{if(this._suppress)return;const t=sn(e.value);this.setValue(t?nn(t):"",{silent:!1,fromInput:!0})})}getValue(){return this._value?nn(this._value):""}getDate(){return this._value?new Date(this._value):null}setValue(e,{silent:t=!1,fromInput:n=!1}={}){const s=this._clamp(sn(e)),o=!rn(s,this._value)||!s!=!this._value;return this._value=s,s&&(this._view=new Date(s)),this._renderInput(),this._panel&&this._paint(),o&&!t&&(n||(this._suppress=!0,this.element.dispatchEvent(new Event("input",{bubbles:!0})),this.element.dispatchEvent(new Event("change",{bubbles:!0})),this._suppress=!1),"function"==typeof this.options.onChange&&this.options.onChange(this.getValue(),this.getDate(),this)),this}clear(){return this.setValue("")}_renderInput(){const e=this.getValue();this._suppress=!0,this.element.value=this._value?on(this._value,this.options.format):"",this._suppress=!1,"YYYY-MM-DD"===this.options.format?delete this.element.dataset.date:this.element.dataset.date=e}_min(){return sn(this.options.min)}_max(){return sn(this.options.max)}_clamp(e){if(!e)return null;const t=this._min(),n=this._max();return t&&e<t?new Date(t):n&&e>n?new Date(n):e}_disabled(e){const t=this._min(),n=this._max();if(t&&e<t)return!0;if(n&&e>n)return!0;if("function"==typeof this.options.disabledDates)try{return Boolean(this.options.disabledDates(new Date(e)))}catch{return!1}return!1}_buildPanel(){const e=document.createElement("div");e.className="dm-datepicker",this.options.weekNumbers&&e.setAttribute("data-week-numbers",""),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","false"),e.setAttribute("aria-label","Choose a date");const t=document.createElement("div");t.className="dm-datepicker-head";const n=document.createElement("button");n.type="button",n.className="dm-datepicker-nav",n.setAttribute("aria-label","Previous month"),n.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>',this._addEventListener(n,"click",()=>this._shiftMonth(-1));const s=document.createElement("button");s.type="button",s.className="dm-datepicker-nav",s.setAttribute("aria-label","Next month"),s.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>',this._addEventListener(s,"click",()=>this._shiftMonth(1));const o=document.createElement("select");o.className="dm-datepicker-select",o.setAttribute("aria-label","Month"),en.forEach((e,t)=>{const n=document.createElement("option");n.value=String(t),n.textContent=e,o.appendChild(n)}),this._addEventListener(o,"change",()=>{this._view=new Date(this._view.getFullYear(),Number(o.value),1),this._paint()});const i=document.createElement("select");i.className="dm-datepicker-select",i.setAttribute("aria-label","Year"),this._addEventListener(i,"change",()=>{this._view=new Date(Number(i.value),this._view.getMonth(),1),this._paint()}),t.appendChild(n);const r=document.createElement("div");r.className="dm-datepicker-pickers",r.appendChild(o),r.appendChild(i),t.appendChild(r),t.appendChild(s),e.appendChild(t);const a=document.createElement("div");a.className="dm-datepicker-grid",a.setAttribute("role","grid"),e.appendChild(a);const l=document.createElement("div");l.className="dm-datepicker-foot",e.appendChild(l),this._addEventListener(a,"click",e=>{const t=e.target.closest("[data-dm-date]");t&&!t.hasAttribute("aria-disabled")&&(this.setValue(t.dataset.dmDate),this.options.closeOnSelect&&!this.options.inline&&this.close({focus:!0}))}),this._addEventListener(e,"keydown",e=>this._onPanelKey(e)),this._panel=e,this._grid=a,this._foot=l,this._monthSelect=o,this._yearSelect=i}_shiftMonth(e){this._view=new Date(this._view.getFullYear(),this._view.getMonth()+e,1),this._paint()}_paint(){const e=this.options,t=this._view,n=new Date,s=this._min(),o=this._max(),i=s?s.getFullYear():n.getFullYear()-100,r=o?o.getFullYear():n.getFullYear()+10;if(this._yearSelect.dataset.from!==String(i)||this._yearSelect.dataset.to!==String(r)){this._yearSelect.textContent="";for(let e=r;e>=i;e--){const t=document.createElement("option");t.value=String(e),t.textContent=String(e),this._yearSelect.appendChild(t)}this._yearSelect.dataset.from=String(i),this._yearSelect.dataset.to=String(r)}this._monthSelect.value=String(t.getMonth()),this._yearSelect.value=String(t.getFullYear());const a=this._grid;a.textContent="";const l=document.createElement("div");if(l.className="dm-datepicker-row dm-datepicker-weekdays",l.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week",l.appendChild(e)}for(let t=0;t<7;t++){const n=tn[(e.firstDay+t)%7],s=document.createElement("span");s.className="dm-datepicker-weekday",s.setAttribute("role","columnheader"),s.setAttribute("aria-label",n),s.textContent=n.slice(0,2),l.appendChild(s)}a.appendChild(l);const d=new Date(t.getFullYear(),t.getMonth(),1),c=(d.getDay()-e.firstDay+7)%7,h=new Date(d.getFullYear(),d.getMonth(),1-c);for(let s=0;s<6;s++){const o=document.createElement("div");if(o.className="dm-datepicker-row",o.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week";const t=new Date(h);t.setDate(h.getDate()+7*s),e.textContent=String(this._weekNumber(t)),o.appendChild(e)}for(let e=0;e<7;e++){const i=new Date(h.getFullYear(),h.getMonth(),h.getDate()+7*s+e),r=document.createElement("button");r.type="button",r.className="dm-datepicker-day",r.dataset.dmDate=nn(i),r.setAttribute("role","gridcell"),r.textContent=String(i.getDate()),r.setAttribute("aria-label",on(i,"DDDD D MMMM YYYY")),i.getMonth()!==t.getMonth()&&r.classList.add("is-outside"),rn(i,n)&&r.classList.add("is-today"),rn(i,this._value)&&(r.classList.add("is-selected"),r.setAttribute("aria-selected","true")),this._disabled(i)&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0);const a=this._focused||this._value||n;r.tabIndex=rn(i,a)?0:-1,o.appendChild(r)}a.appendChild(o)}this._paintFoot()}_paintFoot(){const e=this._foot;e.textContent="";const t=this.options;if(t.todayButton){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Today",n.addEventListener("click",()=>{const e=new Date;if(this._disabled(e))return this._view=new Date(e.getFullYear(),e.getMonth(),1),void this._paint();this.setValue(nn(e)),t.closeOnSelect&&!t.inline&&this.close({focus:!0})}),e.appendChild(n)}if(t.clearable){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Clear",n.disabled=!this._value,n.addEventListener("click",()=>{this.clear(),t.inline||this.close({focus:!0})}),e.appendChild(n)}e.childNodes.length?e.parentNode||this._panel.appendChild(e):e.remove()}_weekNumber(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()+3-(t.getDay()+6)%7);const n=new Date(t.getFullYear(),0,4);return n.setDate(n.getDate()+3-(n.getDay()+6)%7),1+Math.round((t-n)/6048e5)}open(){return this._isOpen||this.options.inline||this.element.disabled||(an._open&&an._open!==this&&an._open.close(),this._panel||this._buildPanel(),document.body.appendChild(this._panel),this._focused=this._value?new Date(this._value):null,this._paint(),this._position(),this._isOpen=!0,an._open=this,this.element.setAttribute("aria-expanded","true"),this._onOutside=e=>{this._panel.contains(e.target)||e.target===this.element||this.close()},this._onReposition=()=>this._position(),this.options.closeOnClickOutside&&setTimeout(()=>document.addEventListener("mousedown",this._onOutside,!0),0),window.addEventListener("resize",this._onReposition),window.addEventListener("scroll",this._onReposition,!0),"function"==typeof this.options.onOpen&&this.options.onOpen(this)),this}close({focus:e=!1}={}){return!this._isOpen||this.options.inline||(document.removeEventListener("mousedown",this._onOutside,!0),window.removeEventListener("resize",this._onReposition),window.removeEventListener("scroll",this._onReposition,!0),this._panel?.remove(),this._isOpen=!1,an._open===this&&(an._open=null),this.element.setAttribute("aria-expanded","false"),e&&this.element.focus(),"function"==typeof this.options.onClose&&this.options.onClose(this)),this}toggle(){return this._isOpen?this.close():this.open()}_position(){const e=this._panel;if(!e)return;const t=this.element.getBoundingClientRect(),[n,s]=this.options.offset;e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0";const o=e.getBoundingClientRect();let i=t.bottom+s,r=t.left+n;i+o.height>window.innerHeight&&t.top-o.height-s>0&&(i=t.top-o.height-s),this.options.position.endsWith("-end")&&(r=t.right-o.width),r=Math.max(8,Math.min(r,window.innerWidth-o.width-8)),e.style.top=`${i+window.scrollY}px`,e.style.left=`${r+window.scrollX}px`,e.style.visibility=""}_onInputKey(e){"ArrowDown"!==e.key&&"Enter"!==e.key?"Escape"===e.key&&this._isOpen&&(e.preventDefault(),this.close()):this._isOpen||(e.preventDefault(),this.open(),this._panel?.querySelector('[tabindex="0"]')?.focus())}_onPanelKey(e){const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key],n=this._focused||this._value||new Date;if(void 0!==t)return e.preventDefault(),void this._moveFocus(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t));if("PageUp"===e.key||"PageDown"===e.key){e.preventDefault();const t="PageUp"===e.key?-1:1;return void this._moveFocus(new Date(n.getFullYear(),n.getMonth()+t,n.getDate()))}if("Home"===e.key||"End"===e.key){e.preventDefault();const t="Home"===e.key?new Date(n.getFullYear(),n.getMonth(),1):new Date(n.getFullYear(),n.getMonth()+1,0);return void this._moveFocus(t)}"Escape"===e.key&&this.options.closeOnEscape&&(e.preventDefault(),this.close({focus:!0}))}_moveFocus(e){this._focused=e,e.getMonth()===this._view.getMonth()&&e.getFullYear()===this._view.getFullYear()||(this._view=new Date(e.getFullYear(),e.getMonth(),1)),this._paint(),this._panel?.querySelector(`[data-dm-date="${nn(e)}"]`)?.focus()}destroy(){this.close(),this._panel?.remove(),this._panel=null,super.destroy()}}const ln={_instances:new Map,card(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-card");let o=null;for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,()=>{n(o||s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):null!=n&&s.setAttribute(St(e),String(n));if(t.title){const e=document.createElement("div");e.setAttribute("slot","header"),e.className="card-header";const n=document.createElement("h4");if(n.className="card-title",t.icon){const e=document.createElement("span");e.setAttribute("data-icon",t.icon),e.className="card-title-icon",n.appendChild(e)}n.appendChild(document.createTextNode(t.title)),e.appendChild(n),s.appendChild(e)}if(t.content){const e=document.createElement("div");e.setAttribute("slot","body"),e.className="card-body";const n="undefined"!=typeof Domma&&Domma.sanitize&&"function"==typeof Domma.sanitize.sanitize?Domma.sanitize.sanitize(t.content):t.content;e.innerHTML=n,s.appendChild(e)}return Array.from(n.children).forEach(e=>{e.classList.contains("card-header")?e.setAttribute("slot","header"):e.classList.contains("card-body")?e.setAttribute("slot","body"):e.classList.contains("card-footer")&&e.setAttribute("slot","footer"),s.appendChild(e)}),$t(n,s,"card"),n.replaceWith(s),o={element:s,options:s._options,collapse(){return s.collapse(),this},expand(){return s.expand(),this},toggle(){return s.toggle(),this},isCollapsed:()=>s.isCollapsed(),setShadow(e){return s.setShadow(e),this},setHoverable(e){return s.setHoverable(e),this},setContent(e){return s.setContent(e),this},getBody:()=>s.getBody(),updateHeight(){return s.updateHeight(),this},destroy(){s.destroy()}},o}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},modal(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return Bt.createModal(e);const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-modal");for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,e=>{n(e.detail||s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):"buttons"===e&&Array.isArray(n)?(s._options=s._options||{},s._options.buttons=n):null!=n&&s.setAttribute(St(e),String(n));for(;n.firstChild;)s.appendChild(n.firstChild);$t(n,s,"modal"),s.hasAttribute("role")||s.setAttribute("role","dialog"),s.hasAttribute("aria-modal")||s.setAttribute("aria-modal","true");const o=s.querySelector(".modal-title");o?(o.id||(o.id="dm-modal-title-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-labelledby")||s.setAttribute("aria-labelledby",o.id)):t.title&&!s.hasAttribute("aria-label")&&s.setAttribute("aria-label",t.title);const i=s.querySelector("[data-close], .modal-close, .btn-close, .close");return i&&!i.hasAttribute("aria-label")&&i.setAttribute("aria-label","Close"),n.replaceWith(s),{element:s,options:s._options,open(){return s.open(),this},close(){return s.close(),this},toggle(){return s.toggle(),this},isOpen:()=>s.isOpen(),setTitle(e){return s.setTitle(e),this},setContent(e){return s.setContent(e),this},setButtons(e){return s.setButtons(e),this},destroy(){s.destroy()},remove(){s.remove()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},tabs(e,t={}){const n=new Tt(e,t);return n.element&&this._instances.set(n.element,n),n},accordion(e,t={}){const n=new Dt(e,t);return n.element&&this._instances.set(n.element,n),n},tooltip(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e];if(0===n.length)return null;const s=[];return n.forEach(e=>{if(!e)return;const n=void 0===t.content||null===t.content||""===t.content?{...t,content:e.dataset.tooltip||e.title||""}:t,o=e=>{for(const[t,s]of Object.entries(n))if("function"==typeof s){const n=t.replace(/^on/,"").toLowerCase();e.addEventListener(n,()=>s(e))}else"delay"===t&&"object"==typeof s?(void 0!==s.show&&e.setAttribute("delay",String(s.show)),void 0!==s.hide&&e.setAttribute("hide-delay",String(s.hide))):"boolean"==typeof s?s&&e.setAttribute(St(t),""):null!=s&&e.setAttribute(St(t),String(s))};let i;e.parentNode&&"DOMMA-TOOLTIP"===e.parentNode.tagName?(i=e.parentNode,o(i)):(i=document.createElement("domma-tooltip"),o(i),e.parentNode.insertBefore(i,e),i.appendChild(e),i._dommaComponent=i),s.push({element:i,options:i._options,show(){return i.show(),this},hide(){return i.hide(),this},toggle(){return i.toggle(),this},setContent(e){return i.setContent(e),this},setPosition(e){return i.setPosition(e),this},isVisible:()=>i.isVisible(),destroy(){const e=i.querySelector("*");e&&i.parentNode&&i.parentNode.insertBefore(e,i),i.remove()}})}),1===s.length?s[0]:s}(e,t);return Array.isArray(n)?n.forEach(e=>{e.element&&this._instances.set(e.element,e)}):n&&n.element&&this._instances.set(n.element,n),n},badge(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=n.textContent,o=document.createElement("domma-badge");o.textContent=s;for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();o.addEventListener(t,e=>{n(e.detail.event||e,o)})}else"boolean"==typeof n?n&&o.setAttribute(St(e),""):null!=n&&o.setAttribute(St(e),String(n));return $t(n,o,"badge"),n.replaceWith(o),o._dommaComponent=o,{element:o,options:o._options,setOptions(e){return o.setOptions(e),this},setVariant(e){return o.setVariant(e),this},setSize(e){return o.setSize(e),this},setText(e){return o.setText(e),this},remove(){o.remove()},destroy(){o.destroy()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},numberBadge(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-number-badge");return void 0!==t.count&&s.setAttribute("count",String(t.count)),t.variant&&s.setAttribute("variant",t.variant),t.dot&&s.setAttribute("dot",""),t.pulse&&s.setAttribute("pulse",""),t.borderColor&&s.setAttribute("border-color",t.borderColor),n.parentNode.insertBefore(s,n),s.appendChild(n),s._dommaComponent=s,{element:s,options:s._options,setOptions(e){return s.setOptions(e),this},setCount(e){return s.setCount(e),this},increment(e=1){return s.increment(e),this},decrement(e=1){return s.decrement(e),this},setDot(e){return s.setDot(e),this},setVariant(e){return s.setVariant(e),this},setPulse(e){return s.setPulse(e),this},getCount:()=>s.getCount(),remove(){s.parentNode&&n.parentNode===s&&s.parentNode.insertBefore(n,s),s.remove()},destroy(){s.destroy()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},dropdown(e,t={}){const n=new Ht(e,t);return n.element&&this._instances.set(n.element,n),n},carousel(e,t={}){const n=new Pt(e,t);return n.element&&this._instances.set(n.element,n),n},cookieConsent(e={}){if(this._instances.has("cookieConsent"))return this._instances.get("cookieConsent");const t=new Vt(e);return this._instances.set("cookieConsent",t),t},backToTop(e,t={}){const n=function(e,t={}){const n=document.createElement("domma-back-to-top");for(const[e,s]of Object.entries(t))if("function"==typeof s){const t=e.replace(/^on/,"").toLowerCase();n.addEventListener(t,e=>{s(e.detail||n)})}else"boolean"==typeof s?s&&n.setAttribute(St(e),""):null!=s&&n.setAttribute(St(e),String(s));return document.body.appendChild(n),n._dommaComponent=n,{element:n,options:n._options,scroll(){return n.scroll(),this},show(){return n.show(),this},hide(){return n.hide(),this},toggle(){return n.toggle(),this},isVisible:()=>n.isVisible(),getButton:()=>n.getButton(),setShowAfter(e){return n.setShowAfter(e),this},setPosition(e){return n.setPosition(e),this},setOffset(e){return n.setOffset(e),this},destroy(){n.destroy()}}}(0,t);return n&&n.element&&this._instances.set("backToTop",n),n},buttonGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Rt(e,t);this._instances.set(e,n),s.push(n)}return 1===s.length?s[0]:s},loader(e,t={}){const n=zt(e,t);return n&&n.element&&this._instances.set(n.element,n),n},showLoader(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;let s=this._instances.get(n);return s?s.show():(s=zt(n,{...t,visible:!0}),this._instances.set(n,s)),s},hideLoader(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&n.hide&&n.hide()},fullscreenLoader(e="Loading...",t={}){let n=document.getElementById("dm-loader-fullscreen");n||(n=document.createElement("div"),n.id="dm-loader-fullscreen",n.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n ",document.body.appendChild(n));const s=zt(n,{type:t.type||"spinner",size:t.size||"large",color:t.color||"white",text:e,overlay:!1,centered:!1,visible:!0});return n.style.display="flex",this._instances.set(n,s),s},breadcrumbs(e,t={}){const n=new qt(e,t);return n.element&&this._instances.set(n.element,n),n},navbar(e,t={}){const n=new Ut(e,t);return n.element&&this._instances.set(n.element,n),n},sidebar(e,t={}){const n=new Kt(e,t);return n.element&&this._instances.set(n.element,n),n},footer(e,t={}){const n=new Yt(e,t);return n.element&&this._instances.set(n.element,n),n},notification:(e={})=>new Ot(e),notify:(e,t={})=>Ot.notify(e,t),timer(e,t={}){const n=new It(e,t);return n.element&&this._instances.set(n.element,n),n},alarm:(e={})=>new Nt(e),autocomplete(e,t={}){const n=new Gt(e,t);return n.element&&this._instances.set(n.element,n),n},pillbox(e,t={}){const n=new Jt(e,t);return n.element&&this._instances.set(n.element,n),n},datePicker(e,t={}){const n=new an(e,t);return n.element&&this._instances.set(n.element,n),n},chooser(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return console.warn("[Domma.elements.chooser] host not found:",e),null;const s={variant:"card",multiple:!1,density:"comfortable",columns:3,glow:!1,glowColour:null,shadow:"none",shadowColour:null,accent:"primary",accentStyle:"border",options:[],...t};let o=void 0!==s.value?s.value:s.multiple?[]:null;const i=document.createElement("div");i.className="domma-chooser",i.setAttribute("data-variant",s.variant),i.setAttribute("data-density",s.density),i.style.setProperty("--picker-cols",String(s.columns)),i.style.setProperty("--picker-cols-md",String(Math.min(s.columns,2))),i.style.setProperty("--picker-cols-sm","1");const r={primary:1,success:1,info:1,warning:1,danger:1},a=e=>"string"==typeof e&&r[e];if(s.glow&&i.setAttribute("data-glow","true"),s.glowColour&&(a(s.glowColour)?i.setAttribute("data-glow-colour",s.glowColour):i.style.setProperty("--picker-glow-colour",s.glowColour)),s.shadow&&"none"!==s.shadow&&i.setAttribute("data-shadow",s.shadow),s.shadowColour&&i.style.setProperty("--picker-shadow-colour",s.shadowColour),s.accent&&(a(s.accent)?i.setAttribute("data-accent",s.accent):i.style.setProperty("--picker-accent",s.accent)),s.accentStyle&&"border"!==s.accentStyle&&i.setAttribute("data-accent-style",s.accentStyle),s.label){const e=document.createElement("label");if(e.className="picker-label",e.textContent=s.label,s.required){const t=document.createElement("span");t.className="picker-required",t.textContent="*",e.appendChild(t)}i.appendChild(e)}const l=document.createElement("div");l.className="picker-options",l.setAttribute("role",s.multiple?"group":"radiogroup"),i.appendChild(l);const d=e=>{const t=String(e);return s.multiple?Array.isArray(o)&&o.map(String).includes(t):null!=o&&String(o)===t},c=()=>{l.replaceChildren(),s.options.forEach((e,t)=>l.appendChild(((e,t)=>{const n=document.createElement("div");if(n.className="picker-option",n.setAttribute("role",s.multiple?"checkbox":"radio"),n.setAttribute("tabindex",s.multiple||0===t?"0":"-1"),n.setAttribute("data-value",String(e.value)),n.setAttribute("aria-checked",d(e.value)?"true":"false"),d(e.value)&&n.classList.add("is-selected"),e.disabled&&(n.classList.add("is-disabled"),n.setAttribute("aria-disabled","true")),e.recommended&&n.classList.add("is-recommended"),e.icon){const t=document.createElement("span");t.className="picker-option-icon",t.setAttribute("data-icon",e.icon),n.appendChild(t)}const o=document.createElement("span");if(o.className="picker-option-label",o.textContent=e.label,n.appendChild(o),e.description&&"compact"!==s.density&&"card"===s.variant){const t=document.createElement("span");t.className="picker-option-desc",t.textContent=e.description,n.appendChild(t)}if("card"===s.variant){const e=document.createElement("span");e.className="picker-option-tick",e.setAttribute("aria-hidden","true");const t=document.createElement("span");t.setAttribute("data-icon","check"),t.setAttribute("data-icon-size","12"),e.appendChild(t),n.appendChild(e)}if(e.badge&&e.badge.text){const t=document.createElement("span");t.className="picker-option-badge";const s=document.createElement("span");s.className="badge badge-"+(e.badge.type||"primary"),s.textContent=e.badge.text,t.appendChild(s),n.appendChild(t)}if(e.tooltip&&n.setAttribute("data-tooltip",e.tooltip),s.name){const t=document.createElement("input");t.className="picker-native-input",t.type=s.multiple?"checkbox":"radio",t.name=s.multiple?s.name+"[]":s.name,t.value=String(e.value),t.checked=d(e.value),t.disabled=!!e.disabled,t.tabIndex=-1,n.appendChild(t)}return n})(e,t))),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(l)},h=(e,t=!0)=>{o=e,c(),t&&"function"==typeof s.onChange&&s.onChange(o)};return l.addEventListener("click",e=>{const t=e.target.closest(".picker-option");if(!t||t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value");if(s.multiple){const e=Array.isArray(o)?o.slice():[],t=e.indexOf(n);t>=0?e.splice(t,1):e.push(n),h(e)}else h(n)}),l.addEventListener("keydown",e=>{const t=e.target.closest(".picker-option");if(!t)return;const n=Array.from(l.querySelectorAll(".picker-option")).filter(e=>!e.classList.contains("is-disabled")),i=n.indexOf(t);if(s.multiple){if(" "===e.key||"Spacebar"===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value"),s=Array.isArray(o)?o.slice():[],i=s.indexOf(n);i>=0?s.splice(i,1):s.push(n),h(s)}return}if("Enter"===e.key||" "===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;return void h(t.getAttribute("data-value"))}let r=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)r=i+1;else{if("ArrowLeft"!==e.key&&"ArrowUp"!==e.key)return;r=i-1}e.preventDefault(),r<0&&(r=n.length-1),r>=n.length&&(r=0);const a=n[r];if(a){const e=a.getAttribute("data-value");h(e);const t=l.querySelector('.picker-option[data-value="'+e.replace(/"/g,'\\"')+'"]');t&&"function"==typeof t.focus&&t.focus()}}),n.appendChild(i),c(),{_root:i,getValue:()=>o,setValue(e){h(e,!1)},disable(){i.querySelectorAll(".picker-option").forEach(e=>e.classList.add("is-disabled"))},enable(){i.querySelectorAll(".picker-option").forEach(e=>e.classList.remove("is-disabled"))},destroy(){i.remove()}}},contextMenu(e,t={}){const n=new Z(e,t);return n.element&&this._instances.set(n.element,n),n},sortable(e,t={}){const n=new se(e,t);return n.element&&this._instances.set(n.element,n),n},skeleton:(e,t={})=>Ce(e,t),avatar:(e,t={})=>mt(e,t),avatarGroup:(e,t={})=>bt(e,t),inputGroup(e,t={}){const n=new ge(e,t);return n.element&&this._instances.set(n.element,n),n},popover(e,t={}){const n=new Ke(e,t);if(n.element){const e=n.element;this._instances.set(e,n),n._onDestroy=()=>{this._instances.get(e)===n&&this._instances.delete(e)}}return n},treeView(e,t={}){const n=new u(e,t);return n.element&&this._instances.set(n.element,n),n},slideover(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return e.schema,Xt.create(e);const n=new Xt(e,t);return n.element&&this._instances.set(n.element,n),n},progression(e,t={}){const n=new Zt(e,t);return n.element&&this._instances.set(n.element,n),n},listGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Wt(e,t);n.element&&this._instances.set(e,n),s.push(n)}return 1===s.length?s[0]:s},timeline(e,t={}){return"undefined"!=typeof Domma&&!1!==Domma.config?.deprecationWarnings&&"undefined"!=typeof console&&console.warn('Domma: timeline() is deprecated. Use progression({ mode: "timeline" }) instead.'),this.progression(e,{mode:"timeline",...t})},toast:Object.assign((e,t={})=>jt.show(e,t),{show:jt.show.bind(jt),success:jt.success.bind(jt),error:jt.error.bind(jt),warning:jt.warning.bind(jt),info:jt.info.bind(jt),closeAll:jt.closeAll.bind(jt)}),dialog:Ft,alert:Ft.alert.bind(Ft),confirm:Ft.confirm.bind(Ft),prompt:Ft.prompt.bind(Ft),createModal:Bt.createModal.bind(Bt),showModal:Bt.showModal.bind(Bt),signature(e,t={}){const n=new Qt(e,t);return n.element&&this._instances.set(n.element,n),n},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()},_registry:new Map,register(e,t){this._registry.set(e,t)},create(e,t,n={}){const s=this._registry.get(e);if(s)return new s(t,n);throw new Error(`Unknown component: ${e}`)}};function dn(e,{fallback:t,onWrite:n}={}){const s=t&&"object"==typeof t?Object.keys(t):[];return 0===s.length&&"function"!=typeof n?e:new Proxy({},{get:(n,s)=>"string"==typeof s&&!(s in e)&&s in t?t[s]:e[s],has:(n,o)=>o in e||"string"==typeof o&&s.length>0&&o in t,ownKeys:()=>[...new Set([...s,...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),set:(t,s,o)=>(e[s]=o,"string"==typeof s&&"function"==typeof n&&n(s,o),!0)})}
|
|
9
|
-
/*! domma-reactive v1.3.1 | MIT | https://github.com/pinpointzero73/domma-reactive */function cn(e,t){return un(e,t,null)}function hn(e){return e===Object.prototype||null===e}function un(e,t,n){if(Object.is(e,t))return!0;if(0===e&&0===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&Object.is(e.getTime(),t.getTime());const s=Array.isArray(e);if(s!==Array.isArray(t))return!1;if(!(s||hn(Object.getPrototypeOf(e))&&hn(Object.getPrototypeOf(t))))return!1;const o=n||new WeakMap,i=o.get(e);if(i){if(i.has(t))return!0;i.add(t)}else o.set(e,new Set([t]));if(s){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!un(e[n],t[n],o))return!1;return!0}const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!un(e[n],t[n],o))return!1}return!0}ln.contextMenu.closeAll=Z.closeAll,ln.contextMenu.active=Z.active,ln.contextMenu.registry=Z.registry,ln.skeleton.while=Ce.while,ln.skeleton.get=Ce.get,ln.skeleton.remove=Ce.remove,ln.skeleton.scan=Ce.scan,ln.skeleton.markup=Ce.markup,ln.avatar.scan=mt.scan,ln.avatar.get=mt.get,ln.avatar.initials=mt.initials,ln.avatar.tone=mt.tone,ln.avatarGroup.get=bt.get,ln.popover.scan=e=>Ke.scan(e,(e,t)=>ln.popover(e,t)),ln.popover.closeAll=Ke.closeAll,ln.popover.getInstance=Ke.getInstance,ln.popover.open=Ke.openPopovers;const pn=Symbol.for("domma-reactive.reactive");function mn(e){return Object.defineProperty(e,pn,{value:!0,enumerable:!1}),e}function fn(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&!0===e[pn]}function gn(e,{expr:t,where:n,handler:s}={}){if("function"!=typeof e||!1===s?.tracks||!0===s?.acceptsReactive)return e;let o=!1;return s=>{const i=e(s);if(!fn(i))return i;if(!o){o=!0;const e=n?` in ${n}`:"";console.warn(`[Domma Reactive] "${t}"${e} is an observable, not its value - use "${t}.value". The binding reads it as empty (hidden, off, no rows) until then.`)}}}let vn=null;const bn=[],_n=new Set;let yn=!1,kn=!1;class wn{constructor(e=null){this.subs=new Set,this.owner=e}track(){vn&&vn!==this.owner&&(this.subs.add(vn),vn.deps.add(this))}trigger(){if(0!==this.subs.size){for(const e of this.subs)e.invalidate(),_n.add(e);Mn()}}}class xn{constructor(e,t={}){this.fn=e,this.label=t.label||(t.effect?"effect":"computed"),this.isEffect=!0===t.effect,this.onNotify=t.onNotify||null,this._write="function"==typeof t.write?t.write:null,this.deps=new Set,this.dep=new wn(this),this._value=void 0,this.dirty=!0,this.disposed=!1}_run(){const e=new Set(this.deps);for(const e of this.deps)e.subs.delete(this);this.deps.clear(),bn.push(vn),vn=this;try{return this.fn()}catch(t){console.warn(`[Domma Reactive] "${this.label}" threw during evaluation:`,t);for(const t of e)this.deps.add(t),t.subs.add(this);return}finally{vn=bn.pop()}}get(){if(this.dirty&&!this.disposed){const e=this._value;this._value=this._run(),this.dirty=!1,this._evaluated&&!cn(e,this._value)&&(this._pulledChange=!0),this._evaluated=!0}return this.dep.track(),this._value}get value(){return this.get()}set value(e){this.write(e)}write(e){this._write?An(()=>this._write(e)):console.warn(`[Domma Reactive] "${this.label}" is a read-only computed - the assignment was ignored. Pass computed({read, write}) to say where a write should land.`)}set(e){this.write(e)}recompute(){if(this.disposed)return{changed:!1,value:this._value};const e=this._value;this._value=this._run(),this.dirty=!1;const t=this._pulledChange||!cn(e,this._value);return this._pulledChange=!1,this._evaluated=!0,{changed:t,value:this._value}}invalidate(){this.dirty=!0}dependents(){return this.dep.subs}notify(){!this.disposed&&this.onNotify&&this.onNotify(this._value,this)}dispose(){if(!this.disposed){for(const e of this.deps)e.subs.delete(this);this.deps.clear(),this.dep.subs.clear(),_n.delete(this),this.disposed=!0}}}function Mn(){yn||kn||(yn=!0,Promise.resolve().then(Ln))}function Ln(){if(yn=!1,!kn&&0!==_n.size){kn=!0;try{const e=new Set(_n);_n.clear(),function(e){const t=20,n=new Map,s=new Set,o=[...e];for(;o.length>0;){const e=o.shift();if(e.disposed)continue;const i=(n.get(e)||0)+1;if(n.set(e,i),i>t){console.warn(`[Domma Reactive] "${e.label}" re-entered the flush ${t} times - likely a dependency cycle. Skipping.`);continue}if(e.isEffect){s.add(e);continue}if(0===e.dependents().size&&!e.onNotify)continue;const{changed:r}=e.recompute();if(r)for(const t of e.dependents())t.invalidate(),o.push(t)}for(const e of s)e.disposed||e.recompute()}(e)}finally{kn=!1,_n.size>0&&Mn()}}}function Cn(e,t={}){if(null!==e&&"object"==typeof e){const{read:n,...s}=e;if("function"!=typeof n)throw new TypeError("[Domma Reactive] computed({read, write}): `read` must be a function");return new xn(n,{...s,...t,effect:!1})}return new xn(e,{...t,effect:!1})}function En(e,t={}){const n=new xn(e,{...t,effect:!0,onNotify:null});return n.recompute(),n}function An(e){bn.push(vn),vn=null;try{return e()}finally{vn=bn.pop()}}Object.defineProperty(xn.prototype,pn,{value:!0,enumerable:!1});const Sn="[Domma Reactive]",$n=new Map,zn=new Set(["notify","rateLimit","throttle"]);function jn(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Sn} registerExtender: the name must be a non-empty string`);if("function"!=typeof t)throw new TypeError(`${Sn} registerExtender: "${e}" was not given a function`);return $n.has(e)&&!zn.has(e)&&console.warn(`${Sn} registerExtender: "${e}" replaces an existing extender`),$n.set(e,t),t}jn("notify",(e,t)=>{"always"===t?e.setEquals(()=>!1):console.warn(`${Sn} extend: notify accepts only 'always' - got ${JSON.stringify(t)}`)});const Bn=new WeakMap;jn("rateLimit",(e,t)=>{const n=function(e){const t=e&&"object"==typeof e?e:{timeout:e},n=t.timeout;if("number"!=typeof n||!Number.isFinite(n)||n<0)return console.warn(`${Sn} extend: rateLimit needs a timeout in milliseconds - got ${JSON.stringify(n)}`),null;const s=t.method||"notifyWhenChangesStop";return"notifyWhenChangesStop"!==s&&"notifyAtFixedRate"!==s?(console.warn(`${Sn} extend: rateLimit method must be 'notifyWhenChangesStop' or 'notifyAtFixedRate' - got ${JSON.stringify(s)}`),null):{timeout:n,fixed:"notifyAtFixedRate"===s}}(t);if(!n)return;let s=Bn.get(e.observable);s||(s={timeout:n.timeout,fixed:n.fixed,timer:null,latest:void 0,armed:!1},Bn.set(e.observable,s),e.intercept(e=>t=>function(e,t,n){e.timeout<=0?t(n):(e.latest=n,e.fixed&&e.armed||(e.armed=!0,e.timer&&clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,e.armed=!1,t(e.latest)},e.timeout)))}(s,e,t))),s.timeout=n.timeout,s.fixed=n.fixed,0===n.timeout&&s.timer&&(clearTimeout(s.timer),s.timer=null,s.armed=!1)}),jn("throttle",(e,t)=>{$n.get("rateLimit")(e,t)});const Tn="[Domma Reactive]";function Dn(){const e=new Set;return{add(t){if("function"!=typeof t)throw new TypeError(`${Tn} subscribe: expected a function`);e.add(t);const n=()=>{e.delete(t)};return n.dispose=n,n},notify(t){if(0!==e.size)for(const n of[...e])try{n(t)}catch(e){console.warn(`${Tn} a subscriber threw:`,e)}},size:()=>e.size}}function Wn(e,t){let n=e.equals||cn,s=t;const o={observable:null,setEquals(e){if("function"!=typeof e)throw new TypeError(`${Tn} extend: setEquals expects a function`);n=e},intercept(e){if("function"!=typeof e)throw new TypeError(`${Tn} extend: intercept expects a function`);s=e(s)}};return{changed:(e,t)=>!n(e,t),announce:e=>s(e),attach:e=>{o.observable=e},extend:e=>function(e,t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){const t=$n.get(n);t?t(e,s):console.warn(`${Sn} extend: no extender named "${n}". Registered: ${[...$n.keys()].join(", ")}.`)}else console.warn(`${Sn} extend: expected an object of extenders`)}(o,e)}}function Hn(e,t={}){const n=new wn,s=Dn();let o=e;const i=Wn(t,e=>{n.trigger(),s.notify(e)}),r=e=>{const t=i.changed(o,e);o=e,t&&i.announce(o)},a={get value(){return n.track(),o},set value(e){r(e)},peek:()=>o,set:e=>r(e),subscribe:e=>s.add(e),extend:e=>(i.extend(e),a)};return i.attach(a),mn(a)}const On=["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"];const In=new Set(["$data","$root","$parent","$index","$length","$parents","$parentContext","$component"]),Nn=Object.freeze([]);function Pn(e){let t=null;return Object.defineProperty(e,"$parents",{enumerable:!0,get:()=>t??=function(e){const t=[];for(let n=e.$parentContext;null!==n;n=n.$parentContext)t.push(n.$data);return Object.freeze(t)}(e)}),Object.freeze(e)}function Vn(e,t,n=null,s=null){const o=Rn(e);return Pn({$data:t,$root:o.$root,$parent:o.$data,$index:void 0===n?null:n,$length:void 0===s?null:s,$parentContext:o,$component:o.$component??null})}function Fn(e,t){const n=Rn(e);return Pn({$data:t,$root:n.$root,$parent:n.$data,$index:null,$length:null,$parentContext:n,$component:t})}function Rn(e){return function(e){return null!==e&&"object"==typeof e&&"$data"in e}(e)?e:(t=e,Object.freeze({$data:t,$root:t,$parent:null,$index:null,$length:null,$parents:Nn,$parentContext:null,$component:null}));var t}const qn="[Domma Reactive]",Un=64,Kn=new Set(["__proto__","constructor","prototype"]),Yn=new Map([["new","the `new` operator is not supported"],["delete","`delete` is not supported"],["typeof","`typeof` is not supported"],["void","`void` is not supported"],["instanceof","`instanceof` is not supported"],["in","the `in` operator is not supported"],["function","function expressions are not supported"],["class","class expressions are not supported"],["this","`this` is not supported - use $data"],["await","`await` is not supported"],["yield","`yield` is not supported"]]);class Gn extends Error{}const Jn=new Map,Xn=function(e){const t=e=>fn(e)?e.value:e;function n(e){const n=t(e);return Array.isArray(n)?n:n instanceof Set?[...n]:[]}function s(n,s){if(null==s)return t(n);let o=t(n);for(const n of String(s).split("."))if(o=t(e(o,n)),null==o)return o;return o}function o(e){const[t,n]=e;return e.length>=2?e=>s(e,t)===n:e=>Boolean(s(e,t))}return new Map(Object.entries({len(e){const n=t(e);return"string"==typeof n||Array.isArray(n)?n.length:n instanceof Set||n instanceof Map?n.size:0},includes(e,s){const o=t(e);return"string"==typeof o?o.includes(String(s)):n(o).includes(s)},some:(e,...t)=>n(e).some(o(t)),every:(e,...t)=>n(e).every(o(t)),count(e,...t){const s=n(e);if(0===t.length)return s.length;const i=o(t);let r=0;for(const e of s)i(e)&&r++;return r},where:(e,...t)=>n(e).filter(o(t)),sum(e,t){let o=0;for(const i of n(e)){const e=Number(s(i,t));Number.isFinite(e)&&(o+=e)}return o},pluck:(e,t)=>n(e).map(e=>s(e,t)),sortBy(e,t,o="asc"){const i="desc"===o?-1:1;return n(e).map(e=>({item:e,by:s(e,t)})).sort((e,t)=>{const n=void 0===e.by||null===e.by,s=void 0===t.by||null===t.by;return n||s?n-s:"string"==typeof e.by&&"string"==typeof t.by?i*e.by.localeCompare(t.by):e.by<t.by?-i:e.by>t.by?i:0}).map(e=>e.item)},first:e=>n(e)[0],last(e){const t=n(e);return t[t.length-1]},join:(e,s=", ")=>n(e).map(e=>{const n=t(e);return null==n?"":String(n)}).join(String(s))}))}(fs),Zn=new Map,Qn=new Map,es=new WeakMap,ts=new Set,ns=/[0-9]/,ss=/[\p{ID_Start}$_]/u,os=/[\p{ID_Continue}$\u200C\u200D]/u,is=["===","!==","&&","||","<=",">=","??","==","!=","<",">","+","-","*","/","%","!","?",":",".",",","(",")","[","]","{","}","="],rs=new Map([["==","loose equality is not supported - use ==="],["!=","loose inequality is not supported - use !=="],["=","assignment is not supported"],["??","the ?? operator is not supported"]]),as={n:"\n",t:"\t",r:"\r",b:"\b",f:"\f",v:"\v",0:"\0"};function ls(e,t){const n=e[t];let s="",o=t+1;for(;o<e.length;){const t=e[o];if("\\"===t){const t=e[o+1];if(void 0===t)break;if("u"===t){const t=e.slice(o+2,o+6);if(!/^[0-9a-fA-F]{4}$/.test(t))throw new Gn(`bad \\u escape at position ${o}`);s+=String.fromCharCode(parseInt(t,16)),o+=6;continue}s+=Object.prototype.hasOwnProperty.call(as,t)?as[t]:t,o+=2;continue}if(t===n)return{value:s,end:o+1};s+=t,o++}throw new Gn(`unterminated string starting at position ${t}`)}const ds={"||":{bp:3,logical:!0},"&&":{bp:4,logical:!0},"===":{bp:5},"!==":{bp:5},"<":{bp:6},"<=":{bp:6},">":{bp:6},">=":{bp:6},"+":{bp:7},"-":{bp:7},"*":{bp:8},"/":{bp:8},"%":{bp:8}},cs=new Set(["-","+","!"]),hs=e=>Object.freeze(e);function us(e,t=!1){const n=function(e){const t=[];let n=0;for(;n<e.length;){const s=e[n];if(/\s/.test(s)){n++;continue}if(ns.test(s)){const s=n;for(;n<e.length&&ns.test(e[n]);)n++;if("."===e[n])for(n++;n<e.length&&ns.test(e[n]);)n++;if("e"===e[n]||"E"===e[n]){const t=n;if(n++,"+"!==e[n]&&"-"!==e[n]||n++,ns.test(e[n]??""))for(;n<e.length&&ns.test(e[n]);)n++;else n=t}t.push({type:"num",value:Number(e.slice(s,n)),pos:s});continue}if('"'===s||"'"===s){const s=ls(e,n);t.push({type:"str",value:s.value,pos:n}),n=s.end;continue}if("`"===s)throw new Gn(`template literals are not supported at position ${n}`);if(ss.test(s)){const s=n;for(n++;n<e.length&&os.test(e[n]);)n++;const o=e.slice(s,n);"true"===o?t.push({type:"num",value:!0,pos:s}):"false"===o?t.push({type:"num",value:!1,pos:s}):"null"===o?t.push({type:"num",value:null,pos:s}):t.push({type:"ident",value:o,pos:s});continue}const o=is.find(t=>e.startsWith(t,n));if(o){const e=rs.get(o);if(e)throw new Gn(`${e} (at position ${n})`);t.push({type:"punct",value:o,pos:n}),n+=o.length;continue}throw new Gn(`unexpected character "${s}" at position ${n}`)}return t.push({type:"eof",value:null,pos:e.length}),t}(e);let s=0,o=0;const i=()=>n[s],r=e=>"punct"===n[s].type&&n[s].value===e,a=(e,t=n[s])=>{throw new Gn(`${e} at position ${t.pos}`)},l=e=>!!r(e)&&(s++,!0),d=e=>{l(e)||a(`expected "${e}" but found ${ps(i())}`)};function c(e){if(++o>Un)throw new Gn("expression nests deeper than 64 levels");try{let t=function(){const e=i();if("num"===e.type||"str"===e.type)return s++,hs({type:"Literal",value:e.value});if("ident"===e.type){const t=Yn.get(e.value);return t&&a(t),s++,hs({type:"Identifier",name:e.value})}if("punct"===e.type){if(cs.has(e.value))return s++,hs({type:"Unary",operator:e.value,argument:c(9)});if("("===e.value){s++;const e=c(0);return d(")"),e}if("["===e.value)return s++,hs({type:"ArrayLiteral",elements:Object.freeze(h("]"))});if("{"===e.value)return s++,function(){const e=[];if(!r("}"))do{r("}")&&a('a trailing comma before "}" is not supported');const t=i();let n;"ident"===t.type||"str"===t.type?n=String(t.value):"punct"===t.type&&"["===t.value?a("computed keys are not supported in an object literal"):"punct"===t.type&&"."===t.value?a("spread is not supported in an object literal"):a(`expected a property name but found ${ps(t)}`),Kn.has(n)&&a(`the key "${n}" is not allowed`),s++,(r(",")||r("}"))&&a(`shorthand properties are not supported - write ${n}: ${n}`),r("(")&&a("methods are not supported in an object literal"),d(":"),e.push(Object.freeze({key:n,value:c(0)}))}while(l(","));return d("}"),hs({type:"ObjectLiteral",entries:Object.freeze(e)})}()}return a(`unexpected ${ps(e)}`)}();for(;;){const n=i();if("punct"!==n.type)break;if(10>e&&("."===n.value||"["===n.value||"("===n.value)){t=u(t);continue}if("?"===n.value&&2>e){s++;const e=c(0);d(":");const n=c(1);t=hs({type:"Conditional",test:t,consequent:e,alternate:n});continue}const o=Object.prototype.hasOwnProperty.call(ds,n.value)?ds[n.value]:void 0;if(!o||o.bp<=e)break;s++;const r=c(o.bp);t=hs({type:o.logical?"Logical":"Binary",operator:n.value,left:t,right:r})}return t}finally{o--}}function h(e){const t=[];if(!r(e))do{r(e)&&a(`a trailing comma before "${e}" is not supported`),t.push(c(0))}while(l(","));return d(e),t}function u(e){if(l(".")){const t=i();return"ident"!==t.type&&a(`expected a property name after "." but found ${ps(t)}`),s++,hs({type:"Member",object:e,property:t.value,computed:!1})}if(l("[")){const t=c(0);return d("]"),hs({type:"Member",object:e,property:t,computed:!0})}d("(");const n=t&&"Member"===e.type;"Identifier"===e.type||n||a("only registered helpers can be called - `x.foo()` is not supported");const o=[];if(!r(")"))do{o.push(c(0))}while(l(","));return d(")"),hs(n?{type:"MethodCall",object:e.object,property:e.property,computed:e.computed,args:Object.freeze(o)}:{type:"Call",callee:e.name,args:Object.freeze(o)})}if(1===n.length)throw new Gn("the expression is empty");const p=c(0);"eof"!==i().type&&a(`unexpected ${ps(i())}`);const m=function(e){let t=0;const n=[[e,1]];for(;n.length>0;){const[e,s]=n.pop();if(s>t&&(t=s),t>Un)return t;for(const t of ms(e))n.push([t,s+1])}return t}(p);if(m>Un)throw new Gn(`expression nests deeper than 64 levels (${m})`);return p}function ps(e){return"eof"===e.type?"end of expression":"str"===e.type?`string ${JSON.stringify(e.value)}`:"num"===e.type?`literal ${String(e.value)}`:`"${e.value}"`}function ms(e){switch(e?.type){case"Member":return e.computed?[e.object,e.property]:[e.object];case"Unary":return[e.argument];case"Binary":case"Logical":return[e.left,e.right];case"Conditional":return[e.test,e.consequent,e.alternate];case"Call":return e.args;case"ArrayLiteral":return e.elements;case"ObjectLiteral":return e.entries.map(e=>e.value);case"MethodCall":return e.computed?[e.object,e.property,...e.args]:[e.object,...e.args];default:return[]}}function fs(e,t){if(null==e)return;const n=String(t);if(!Kn.has(n))return e[n];console.warn(`${qn} blocked an expression from reading "${n}" - __proto__, constructor and prototype are not readable from an expression`)}const gs=new WeakSet;class vs extends Error{}function bs(e,t){if(!fn(e))return e;if(!gs.has(t)){gs.add(t);const e="Identifier"===t.type?t.name:"Member"!==t.type||t.computed?"an operand":`…${t.property}`;console.warn(`${qn} "${e}" is an observable used in an expression, not its value - use "${e}.value". The expression reads as undefined until then.`)}throw new vs(name)}function _s(e,t,n){if(n>Un)throw new Gn("evaluation nests deeper than 64 levels");switch(e.type){case"Literal":return e.value;case"Identifier":return function(e,t){return In.has(e)?t[e]:fs(t.$data,e)}(e.name,t);case"Member":return fs(_s(e.object,t,n+1),e.computed?_s(e.property,t,n+1):e.property);case"Unary":{const s=bs(_s(e.argument,t,n+1),e.argument);switch(e.operator){case"!":return!s;case"-":return-s;default:return+s}}case"Logical":{const s=bs(_s(e.left,t,n+1),e.left);return"&&"===e.operator?s?_s(e.right,t,n+1):s:s||_s(e.right,t,n+1)}case"Binary":{const s=bs(_s(e.left,t,n+1),e.left),o=bs(_s(e.right,t,n+1),e.right);switch(e.operator){case"+":return s+o;case"-":return s-o;case"*":return s*o;case"/":return s/o;case"%":return s%o;case"===":return s===o;case"!==":return s!==o;case"<":return s<o;case"<=":return s<=o;case">":return s>o;default:return s>=o}}case"Conditional":return bs(_s(e.test,t,n+1),e.test)?_s(e.consequent,t,n+1):_s(e.alternate,t,n+1);case"Call":return function(e,t){const n=Jn.get(e)??Xn.get(e);if("function"==typeof n)return n(...t);ts.has(e)||(ts.add(e),console.warn(`${qn} no helper named "${e}" is registered - expressions can only call helpers registered with registerHelper()`))}(e.callee,e.args.map(e=>_s(e,t,n+1)));case"ArrayLiteral":return e.elements.map(e=>_s(e,t,n+1));case"ObjectLiteral":{const s={};for(const{key:o,value:i}of e.entries)Object.defineProperty(s,o,{value:_s(i,t,n+1),enumerable:!0,writable:!0,configurable:!0});return s}case"MethodCall":throw new Gn("an expression cannot call a method - `x.foo()` is available to data-on-* handlers only, because a call during a render is a side effect");default:throw new Gn(`unknown node type "${e.type}"`)}}function ys(e,t={}){const n="string"==typeof e?e:String(e??""),s=!0===t.methodCalls,o=s?Qn:Zn;if(o.has(n))return o.get(n);let i=null;try{i=us(n,s),es.set(i,n)}catch(e){const s=t.template?` in template "${t.template}"`:"";console.warn(`${qn} could not parse expression "${n}"${s}: ${e.message}. The binding is skipped.`),i=null}return o.size>=1e3&&o.clear(),o.set(n,i),i}function ks(e,t){if(null!==e&&"object"==typeof e&&"string"==typeof e.type)try{return _s(e,Rn(t),0)}catch(t){if(t instanceof vs)return;const n=es.get(e);return void console.warn(`${qn} expression ${void 0===n?"(not from parseExpression) ":`"${n}" `}threw during evaluation:`,t)}}function ws(e,t={}){const n=ys(e,t);return null===n?null:e=>ks(n,e)}function xs(e,t={}){const n="string"==typeof e?ys(e,t):e,s=new Set;if(null===n||"object"!=typeof n)return s;const o=[n];for(;o.length>0;){const e=o.pop();if(null!==e&&"object"==typeof e)if("Identifier"!==e.type)if("Member"!==e.type||e.computed||"Identifier"!==e.object?.type||"$data"!==e.object.name&&"$root"!==e.object.name)for(const t of ms(e))o.push(t);else s.add(e.property);else In.has(e.name)||s.add(e.name)}return s}function Ms(e,t){if("string"!=typeof e||!function(e){if(0===e.length||!ss.test(e[0]))return!1;for(const t of e.slice(1))if(!os.test(t))return!1;return!Yn.has(e)}(e))throw new TypeError(`${qn} registerHelper: "${String(e)}" is not a valid helper name (it must be a plain identifier, so that an expression can spell it)`);if("function"!=typeof t)throw new TypeError(`${qn} registerHelper: "${e}" was given a ${typeof t}, not a function`);return Jn.set(e,t),ts.delete(e),t}const Ls=/&(?:lt|gt|quot|apos|nbsp|amp|#39|#x27|#47|#x2[Ff]|#96|#x60);/g,Cs={"<":"<",">":">",""":'"',"'":"'","'":"'","'":"'"," ":" ","&":"&","/":"/","/":"/","/":"/","`":"`","`":"`"};function Es(e){return e.includes("&")?e.replace(Ls,e=>Cs[e]):e}const As=/\{\{#(if|unless|each|with)\s+([^}]+?)\s*\}\}/,Ss=/\{\{([#/])(if|unless|each|with)(?:\s+[^}]*?)?\s*\}\}|\{\{else\}\}/g,$s=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,zs=/\{\{>\s*([^{}]+?)\s*\}\}/g,js=/\{\{!\s*[^{}]*?\s*\}\}/g,Bs=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,Ts=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,Ds=/[?:()[\]'"!<>=*/%]|&&|\|\||\s[-+]\s/,Ws={"&":"&","<":"<",">":">",'"':""","'":"'"},Hs=e=>null==e?"":String(e);function Os(e){return Array.isArray(e)?e.length>0:Boolean(e)}function Is(e){if(!Array.isArray(e))return[];for(let t=0;t<e.length;t++){const n=e[t];if(null!==n&&"object"==typeof n&&!0===n._destroy)return e.filter(e=>!(null!==e&&"object"==typeof e&&!0===e._destroy))}return e}function Ns(e,t,n){const s=function(e,t,n){const s=e.trim();if("."===s)return null!==t&&"object"==typeof t&&"."in t?t["."]:t;return s.startsWith("@")?t?.[s]:Ts.test(s)||!Ds.test(s)?function(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}(t,s):function(e,t,n={}){return ks(ys(e,n),t)}(s,t,n)}(e,t,n);if(!fn(s))return s;const o=e.trim();Ps.has(o)||(Ps.add(o),console.warn(`[Domma Reactive] "${o}" is an observable, not its value - use "${o}.value". It renders as empty until then.`))}const Ps=new Set;function Vs(e,t,n){return e.replace(js,"").replace(zs,(e,s)=>{const o=n.partials?.[s.trim()];return void 0===o?"":Fs(o,t,n)}).replace($s,(e,s)=>Hs(Ns(s,t,n))).replace(Bs,(e,s)=>Hs(Ns(s,t,n)).replace(/[&<>"']/g,e=>Ws[e]))}function Fs(e,t={},n={}){if("string"!=typeof e||0===e.length)return"";const s=e.match(As);if(!s)return Vs(e,t,n);const[o,i,r]=s,a=s.index+o.length,{close:l,alternate:d}=function(e,t,n){let s=0,o=-1;for(const i of e.slice(n).matchAll(Ss)){const e=n+i.index;if(void 0!==i[1])if("#"!==i[1]){if(0!==s)s--;else if(i[2]===t)return{close:e,alternate:o}}else s++;else 0===s&&-1===o&&(o=e)}return{close:-1,alternate:-1}}(e,i,a);if(-1===l)return Vs(e,t,n);const c="if"===i&&-1!==d&&d<l,h=e.slice(a,c?d:l),u=c?e.slice(d+8,l):"",p=Vs(e.slice(0,s.index),t,n),m=Fs(e.slice(l+`{{/${i}}}`.length),t,n),f=Ns(r,t,n);let g="";if("if"===i)g=Os(f)?Fs(h,t,n):Fs(u,t,n);else if("unless"===i)g=Os(f)?"":Fs(h,t,n);else if("each"===i){const e=Is(f);g=e.map((t,s)=>Fs(h,function(e,t,n){const s={"@index":t,"@first":0===t,"@last":t===n-1};return null!==e&&"object"==typeof e?{...e,...s}:{".":e,...s}}(t,s,e.length),n)).join("")}else g=null!==f&&"object"==typeof f?Fs(h,f,n):"";return p+g+m}const Rs="[Domma Reactive]",qs=new Map,Us=new Set;function Ks(e,t){Us.has(e)||(Us.add(e),console.warn(`${Rs} ${t}`))}function Ys(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Rs} registerBinding: the name must be a non-empty string`);if(null===t||"object"!=typeof t)throw new TypeError(`${Rs} registerBinding: "${e}" was not given a handler object`);if("function"!=typeof t.update)throw new TypeError(`${Rs} registerBinding: "${e}" has no update() function`);for(const n of["attach","detach"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`${Rs} registerBinding: "${e}".${n} is not a function`);return qs.has(e)&&console.warn(`${Rs} registerBinding: "${e}" replaces an existing binding handler`),qs.set(e,Object.freeze({...t})),t}function Gs(e){return qs.get(e)}function Js(e){let t=null;for(const[n,s]of qs){if(s.attribute===e)return{kind:n,handler:s,arg:null};"string"==typeof s.attributePrefix&&e.startsWith(s.attributePrefix)&&e.length>s.attributePrefix.length&&(null===t||s.attributePrefix.length>t.handler.attributePrefix.length)&&(t={kind:n,handler:s,arg:e.slice(s.attributePrefix.length)})}return t}const Xs=e=>null==e?"":String(e);function Zs(e,t){if(null===e||"object"!=typeof e)return null;if("Identifier"===e.type){if(In.has(e.name))return null;const n=t.$data;return null===n||"object"!=typeof n||(Object.isFrozen(n)||Kn.has(e.name))?null:{object:n,key:e.name}}if("Member"===e.type){const n=ks(e.object,t);if(null===n||"object"!=typeof n)return null;if(Object.isFrozen(n))return null;const s=Xs(e.computed?ks(e.property,t):e.property);return Kn.has(s)?null:{object:n,key:s}}return null}const Qs={tracks:!0,update({binding:e,nodes:t,context:n}){const s=Xs(e.evaluate(n));for(const e of t)e.textContent=s;return!0}},eo={tracks:!0,update({binding:e,nodes:t,context:n,render:s}){for(const o of t)for(const t of e.parts){const e=Es(s(t.tmpl,n.$data));o.setAttribute(t.name,e),"value"===t.name&&"value"in o&&(o.value=e)}return!0}},to={tracks:!0,capturesBody:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:o,reindex:i}){const r=s(e.body,n.$data);for(const e of t)o(e.open,e.close,r);return i(),!0}},no={tracks:!0,region:!0,capturesBody:!0,primes:!0,attribute:"data-if",expression:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:o,reindex:i}){const r=Os(e.evaluate(n))?s(e.body,n.$data):"";for(const e of t)o(e.open,e.close,r);return i(),!0}},so=new WeakMap,oo={attributePrefix:"data-on-",expression:!0,methodCalls:!0,tracks:!1,update:()=>!1,attach({binding:e,node:t,controller:n}){if(!e.arg)return;const s=t=>function(e,t,n){const s=e.ast;if(null===s)return;let o,i,r=n.$data;if("MethodCall"===s.type){r=ks(s.object,n);o=fs(r,s.computed?ks(s.property,n):s.property),i=s.args.map(e=>ks(e,n))}else"Call"===s.type?(o=ks({type:"Identifier",name:s.callee},n),i=s.args.map(e=>ks(e,n))):(o=ks(s,n),i=[]);if("function"!=typeof o)return void Ks(`event:${e.id}:${e.expr}`,`data-on-${e.arg}="${e.expr}" did not resolve to a function - an event binding names a handler on your data, or calls one`);!1===o.call(r,...i,t)&&t.preventDefault()}(e,t,n.context());t.addEventListener(e.arg,s);let o=so.get(t);o||so.set(t,o=new Map),o.set(e.id,{type:e.arg,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);n&&(t.removeEventListener(n.type,n.listener),so.get(t).delete(e.id))}};const io=new Set(["value","checked","selected","disabled","readonly","required","multiple","indeterminate","open","hidden"]),ro=new WeakMap,ao=new WeakMap,lo={attributePrefix:"data-bind-",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.arg;if("html"===s)return Ks("bind:html","data-bind-html is not supported - assigning innerHTML from data is an XSS hole. Use {{{triple-stache}}}, which says so where an author can see it."),!1;const o=e.evaluate(n);for(const n of t)"text"===s?n.textContent=Xs(o):"class"===s?co(e,n,o):"style"===s?po(e,n,o):s.startsWith("style-")?ho(n,s.slice(6),o):io.has(s)&&s in n?n[s]="value"===s?Xs(o):Boolean(o):null==o||!1===o?n.removeAttribute(s):n.setAttribute(s,!0===o?"":Xs(o));return!0}};function co(e,t,n){let s=ro.get(e);s||ro.set(e,s=new WeakMap);for(const e of s.get(t)||[])t.classList.remove(e);const o=n?Xs(n).split(/\s+/).filter(Boolean):[];for(const e of o)t.classList.add(e);s.set(t,o)}function ho(e,t,n){null!=n&&!1!==n&&""!==n?e.style.setProperty(t,Xs(n)):e.style.removeProperty(t)}function uo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function po(e,t,n){if(null!=n&&"object"!=typeof n)return void Ks(`bind:style:${e.id}`,`data-bind-style="${e.expr}" needs an object of CSS properties - got `+typeof n+". For a single property use data-bind-style-<property>.");let s=ao.get(e);s||ao.set(e,s=new WeakMap);const o=s.get(t)||[],i=[];for(const[e,s]of Object.entries(n||{})){const n=uo(e);ho(t,n,s),i.push(n)}for(const e of o)i.includes(e)||t.style.removeProperty(e);s.set(t,i)}const mo=Symbol("dm:option-value"),fo=Symbol("dm:pending-value"),go={attribute:"data-options",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Is(e.evaluate(n));for(const o of t)bo(e,o,s,n);return!0}};function vo(e,t){const n=e.getAttribute(t);return null===n||""===n.trim()?null:ws(n)}function bo(e,t,n,s){if("SELECT"!==t.tagName)return void Ks(`options:${e.id}`,`data-options="${e.expr}" is on <${t.tagName.toLowerCase()}>, which has no options. Put it on a <select>.`);const o=vo(t,"data-options-text"),i=vo(t,"data-options-value"),r=vo(t,"data-options-caption"),a=fo in t?[].concat(t[fo]):function(e){return[...e.options].filter(e=>e.selected).map(e=>mo in e?e[mo]:e.value)}(t);if(t.textContent="",r){const e=document.createElement("option");e.value="",e.textContent=Xs(r(s)),t.appendChild(e)}n.forEach((e,r)=>{const a=Vn(s,e,r,n.length),l=document.createElement("option");l.textContent=Xs(o?o(a):e);const d=i?i(a):e;null==d||"object"==typeof d?(l.value=`\0opt:${r}`,l[mo]=d):"string"!=typeof d?(l.value=Xs(d),l[mo]=d):l.value=d,t.appendChild(l)}),function(e,t){if(0===t.length)return;let n=!1;for(const s of e.options){const o=mo in s?s[mo]:s.value,i=t.some(e=>e===o);e.multiple?(s.selected=i,n=n||i):i&&!n&&(s.selected=!0,n=!0)}e.multiple||n||(e.selectedIndex=e.options.length>0?0:-1);n&&delete e[fo]}(t,a)}const _o={attribute:"data-model",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.evaluate(n);for(const e of t)xo(e,s);return!0},attach({binding:e,node:t,controller:n}){const s=()=>{const s=n.context(),o=Zs(e.ast,s);if(null===o)return void Ks(`model:${e.id}:${e.expr}`,`data-model="${e.expr}" is not a settable path, so nothing was written`);const i=function(e){switch(ko(e)){case"checkbox":return e.checked;case"radio":return e.checked?e.value:yo;case"select-multiple":return Array.from(e.options).filter(e=>e.selected).map(wo);case"select":return-1===e.selectedIndex?"":wo(e.options[e.selectedIndex]);case"number":return""===e.value?null:Number(e.value);default:return e.value}}(t);i!==yo&&(o.object[o.key]=i)},o=function(e){const t=ko(e);return"text"===t||"number"===t?["input","change"]:["change"]}(t);for(const e of o)t.addEventListener(e,s);let i=so.get(t);i||so.set(t,i=new Map),i.set(e.id,{type:o,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);so.get(t).delete(e.id)}}},yo=Symbol("no-write");function ko(e){const t=e.tagName;if("SELECT"===t)return e.multiple?"select-multiple":"select";if("INPUT"!==t)return"text";const n=String(e.type||"").toLowerCase();return"checkbox"===n||"radio"===n?n:"number"===n||"range"===n?"number":"text"}function wo(e){return mo in e?e[mo]:e.value}function xo(e,t){switch(ko(e)){case"checkbox":{const n=Boolean(t);return void(e.checked!==n&&(e.checked=n))}case"radio":{const n=Xs(t)===e.value;return void(e.checked!==n&&(e.checked=n))}case"select-multiple":{const n=Array.isArray(t)?t:[];if(0===e.options.length)return void(n.length>0&&(e[fo]=n));const s=new Set(n.map(Xs));for(const t of e.options){const e=wo(t),o=n.some(t=>t===e)||s.has(t.value);t.selected!==o&&(t.selected=o)}return}case"select":{const n=function(e,t){return[...e.options].find(e=>wo(e)===t)||null}(e,t);if(n)return n.selected||(n.selected=!0),void delete e[fo];const s=Xs(t);return e.value!==s&&(e.value=s),void(e.value!==s?e[fo]=t:delete e[fo])}default:{const n=Xs(t);e.value!==n&&(e.value=n)}}}const Mo=new WeakSet,Lo={attribute:"data-focus",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Os(e.evaluate(n));for(const e of t){if("function"!=typeof e.focus)continue;if(s!==(e.ownerDocument.activeElement===e)){Mo.add(e);try{s?e.focus():e.blur()}finally{Mo.delete(e)}}}return!0},attach({binding:e,node:t,controller:n}){const s=s=>{if(Mo.has(t))return;const o=n.context(),i=Zs(e.ast,o);null!==i?i.object[i.key]="focus"===s.type:Ks(`focus:${e.id}:${e.expr}`,`data-focus="${e.expr}" is not a settable path, so focus was not written back. Focus still follows the value.`)},o=["focus","blur"];for(const e of o)t.addEventListener(e,s);let i=so.get(t);i||so.set(t,i=new Map),i.set(e.id,{type:o,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);so.get(t).delete(e.id)}}};Ys("text",Qs),Ys("attr",eo),Ys("block",to),Ys("raw",to),Ys("if",no),Ys("event",oo),Ys("bind",lo),Ys("model",_o),Ys("options",go),Ys("focus",Lo);const Co=new WeakMap;let Eo=0;function Ao(e,t){if(null==e||"function"!=typeof t)return;let n=Co.get(e);n||Co.set(e,n=new Set),n.add(t),Eo++}function So(e){const t=Co.get(e);if(t){Co.delete(e),Eo-=t.size;for(const e of t)try{e()}catch(e){console.warn("[Domma Reactive] a disposer threw:",e)}}}function $o(e){if(0===Eo||null==e)return;if(So(e),1!==e.nodeType&&11!==e.nodeType)return;const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null),n=[];let s;for(;s=t.nextNode();)Co.has(s)&&n.push(s);for(const e of n)So(e)}const zo=["data-dm-t","data-dm-a","data-dm-b"];zo.map(e=>`[${e}]`).join(",");const jo=e=>`\x3c!--dm:${e}--\x3e`,Bo=e=>`\x3c!--/dm:${e}--\x3e`;function To(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function Do(e,t){const n=[];for(let s=e.nextSibling;s&&s!==t;s=s.nextSibling)n.push(s);return n}function Wo(e,t,n){const s=e.parentNode;if(!s)return;let o=e.nextSibling;for(;o&&o!==t;){const e=o.nextSibling;$o(o),s.removeChild(o),o=e}n&&s.insertBefore(To(n),t)}const Ho="[Domma Reactive]";function Oo(e){const{bindings:t,getRoots:n,render:s,reactive:o=!1,label:i="",repaint:r=null}=e,a=new Map(t.map(e=>[e.id,e]));for(const e of t)e.seen=new WeakSet;const l=new Map;let d=[],c=!1,h=!1,u=Rn(e.context);function p(){h||(function(e,t,n){for(const e of n)e.nodes=null;const s=(e,n)=>{const s=t.get(e);s&&(s.nodes||=[]).push(n)},o=e=>{for(const t of zo){const n=e.getAttribute(t);if(null!==n)for(const t of n.split(/\s+/))s(t,e)}},i=new Map,r=e=>{const t=e.data;if(t.startsWith("/dm:")){const n=t.slice(4),o=i.get(n);if(!o)return;s(n,{open:o,close:e}),i.delete(n)}else t.startsWith("dm:")&&i.set(t.slice(3),e)};for(const t of e){if(8===t.nodeType){r(t);continue}if(1!==t.nodeType&&11!==t.nodeType)continue;1===t.nodeType&&o(t);const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null);let n;for(;n=e.nextNode();)8===n.nodeType?r(n):o(n)}}(n(),a,t),function(){for(const e of t){if(null===e.nodes){f(e.id);continue}const t=Gs(e.kind);let n=!1;for(const s of e.nodes){const o=void 0===s.nodeType?s.open:s;e.seen.has(o)||(e.seen.add(o),n=!0,void 0!==s.nodeType&&t?.attach?.({binding:e,node:s,controller:g}))}n&&(o||!0===e.prime)&&d.push(e)}}(),function(){if(c)return;c=!0;try{let e=0;for(;d.length>0;){if(++e>20){console.warn(`${Ho} a binding kept revealing new nodes after 20 rounds; giving up so the page still renders. Kinds still pending: ${[...new Set(d.map(e=>e.kind))].join(", ")}`);break}const t=d;d=[];for(const e of[!0,!1])for(const n of t)!0===Gs(n.kind)?.region===e&&m(n)}}finally{c=!1,d=[]}}())}function m(e){if(!o)return void g.update(e.id);const t=l.get(e.id);!t||t.disposed?l.set(e.id,En(()=>g.update(e.id),{label:`${i||"binding"}:${e.id}`})):t.recompute()}function f(e){const t=l.get(e);t&&(l.delete(e),t.dispose())}const g={bindings:t,deps:e=>a.get(e)?.deps||new Set,context:()=>u,setContext(e){u=Rn(e)},refresh(e=null){for(const n of t)null!==n.nodes&&0!==n.nodes.length&&(null!==e&&!0!==e(n)||m(n))},index:p,update(e,t){if(void 0!==t&&(u=Rn(t)),h)return!1;const n=a.get(e);if(!n||!n.nodes||0===n.nodes.length)return!1;const o=Gs(n.kind);return void 0!==o&&!0===o.update({binding:n,nodes:n.nodes,context:u,render:s,replaceRegion:Wo,reindex:p,controller:g})},updateAll(e){void 0!==e&&(u=Rn(e));for(const e of t)g.update(e.id)},rerenderAll(e){void 0!==e&&(u=Rn(e)),r?.(u),p()},rerender(e){g.rerenderAll(e)},destroy(){h=!0;for(const e of t){const t=Gs(e.kind);if(void 0!==t?.detach&&null!==e.nodes)for(const n of e.nodes)void 0!==n.nodeType&&t.detach({binding:e,node:n,controller:g})}for(const e of l.values())e.dispose();l.clear();for(const e of n())$o(e)},effectCount:()=>l.size};return g}const Io=new WeakMap,No=new Set;function Po(e,t){No.has(e)||(No.add(e),console.warn(`[Domma Reactive] ${t}`))}function Vo(e,t,n,s,o,i={}){const r=document.createComment("dm:item"),a=document.createComment("/dm:item"),l=e.content.cloneNode(!0);l.insertBefore(r,l.firstChild),l.appendChild(a);const d=Oo({bindings:e.bindings.map(e=>({...e})),render:e.render,context:i.context??Vn(t,n,s,o),getRoots:()=>Do(r,a),reactive:!0,label:e.label}),c={key:null,item:n,index:s,length:o,parentContext:t,open:r,close:a,runtime:d,disposed:!1,allNodes:()=>[r,...Do(r,a),a],refresh(t,n,s,o){const i=t.$data!==c.parentContext.$data||t.$root!==c.parentContext.$root||!0===e.usesAncestors&&t!==c.parentContext||n!==c.item,r=s!==c.index||!0===e.usesLength&&o!==c.length;return c.item=n,c.index=s,c.length=o,c.parentContext=t,!(!i&&!r)&&(d.setContext(Vn(t,n,s,o)),d.refresh(i?null:e=>!0===e.positional),!0)},dispose(e=!0){if(c.disposed)return;c.disposed=!0,function(e,t){const n=Co.get(e);!n||!n.delete(t)||(Eo--,0===n.size&&Co.delete(e))}(r,h),d.destroy();for(const e of Do(r,a))$o(e);if(!e)return;const t=r.parentNode;if(t)for(const e of c.allNodes())t.removeChild(e)}},h=()=>c.dispose(!1);return Ao(r,h),d.index(),c}function Fo(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}function Ro(e,t,n,s,o,i){let r=Io.get(e.open);void 0===r&&(r={byKey:new Map},Io.set(e.open,r),Ao(e.open,()=>{for(const e of r.byKey.values())e.dispose(!1);r.byKey=new Map}));const a=r.byKey,l=new Map,d=[],c=Is(t);for(let e=0;e<c.length;e++){const t=c[e];let r=Fo(t,s);null==r?(Po(`key:missing:${i}:${s}`,`key=${s} is missing on an item of ${i} - falling back to position for that item, which reconciles no better than an unkeyed block. Give every item a stable identifier.`),r=`\0position:${e}`):l.has(r)&&(Po(`key:duplicate:${i}:${s}`,`two items of ${i} share key=${s} value "${String(r)}" - a key must identify exactly one item. The duplicate is being kept apart by position, so it will not reconcile across changes.`),r=`\0duplicate:${e}:${String(r)}`);let h=a.get(r);void 0===h?(h=Vo(n,o,t,e,c.length),h.key=r):(a.delete(r),h.refresh(o,t,e,c.length)),l.set(r,h),d.push(h)}for(const e of a.values())e.dispose();!function(e,t){const n=e.parentNode;if(!n)return;let s=e;for(const e of t)if(s.nextSibling!==e.open)for(const t of e.allNodes())n.insertBefore(t,s.nextSibling),s=t;else s=e.close}(e.open,d),r.byKey=l}function qo(e){return{tracks:!0,region:!0,primes:!0,acceptsReactive:!0,update({binding:t,nodes:n,context:s,render:o}){const i=e(t,o),r=(a=t.evaluate(s),Array.isArray(a)?a:null!==a&&"object"==typeof a&&Array.isArray(a.value)?a.value:[]);var a;for(const e of n)Ro(e,r,i,t.keyPath,s,i.label);return!0}}}const Uo="[Domma Reactive]",Ko=new Map,Yo=new Set;function Go(e,t){Yo.has(e)||(Yo.add(e),console.warn(`${Uo} ${t}`))}function Jo(e){return Ko.get(e)}const Xo="data-param-";function Zo(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Qo(e,t,n){const s={},o=e.getAttribute("data-params");if(null!==o&&""!==o.trim()){const e=ws(o),i=null===e?null:e(n);null===e?Go(`component:params:${t.id}`,`data-params="${o}" did not parse, in ${t.expr}`):null===i||"object"!=typeof i?Go(`component:params:${t.id}`,`data-params="${o}" needs an object of params - got ${null===i?"null":typeof i}, in ${t.expr}`):Object.assign(s,i)}for(const o of[...e.attributes]){if(!o.name.startsWith(Xo))continue;const e=Zo(o.name.slice(11));if(""===e)continue;const i=ws(o.value);null!==i?(e in s&&Go(`component:collide:${t.id}:${e}`,`"${e}" is given by both data-params and ${o.name}, in ${t.expr}. The attribute wins, but one of the two is redundant.`),s[e]=i(n)):Go(`component:param:${t.id}:${e}`,`${o.name}="${o.value}" did not parse, in ${t.expr}`)}return Object.freeze(s)}function ei(e){const t=new Map;for(const n of[...e.childNodes]){const e=1===n.nodeType?n.getAttribute("data-slot")??"":"";t.has(e)||t.set(e,[]),t.get(e).push(n),n.remove()}return t}function ti(e,t){const n=`dm:${t}`,s=`/dm:${t}`;let o=null,i=null;const r=e=>{if(8!==e.nodeType)for(const t of e.childNodes)r(t);else e.data===n?o=e:e.data===s&&(i=e)};for(const t of e)if(r(t),null!==o&&null!==i)return{open:o,close:i};return null}function ni(e,t){const n=[];for(let s=e.nextSibling;null!==s&&s!==t;s=s.nextSibling)n.push(s);return n}function si(e,t,n,s,o){const i=[],r=e.allNodes(),a=new Set;for(const e of t.slots??[]){if(a.has(e.name)){Go(`component:slot:duplicate:${s.id}:${o}:${e.name}`,`the component "${o}" declares more than one `+(""===e.name?"default slot":`slot named "${e.name}"`)+". The first is filled and the rest keep their fallback content.");continue}a.add(e.name);const t=n.get(e.name);if(void 0===t||0===t.length)continue;const l=ti(r,e.id);if(null!==l){for(const e of ni(l.open,l.close))e.remove();for(const e of t)l.close.parentNode.insertBefore(e,l.close);i.push({name:e.name,nodes:t})}}for(const[e,t]of n)a.has(e)||0===t.length||t.every(e=>3===e.nodeType&&""===e.data.trim())||Go(`component:slot:unmatched:${s.id}:${o}:${e}`,""===e?`the component "${o}" was given content but declares no {{#slot}}, so that content is not rendered. Add a slot to its template, or remove the content.`:`the component "${o}" has no slot named "${e}", so that content is not rendered. Check data-slot against the template's {{#slot}} blocks.`);return i}const oi=new WeakMap;function ii(e,t,n,s,o){if(void 0===e.create)return t;try{return e.create(t,{element:n})}catch(e){return Go(`component:create:${s.id}:${o}`,`the component "${o}" threw while being created, in ${s.expr}: ${e&&e.message}`),null}}function ri(e){if(null===e.instance)return;for(const{nodes:t}of e.placed)for(const e of t)e.remove();e.placed=[];const t=e.viewModel;if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose)try{t.dispose()}catch(e){console.warn(`${Uo} a component's dispose() threw:`,e)}e.instance.dispose(),e.instance=null,e.viewModel=null,e.name=null}const ai="[Domma Reactive]",li=/\{\{([#/])(if|unless|each|with|slot)(?:\s+([^}]+?))?\s*\}\}/g,di=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,ci=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,hi=/\{\{>\s*[^{}]+?\s*\}\}/,ui=/\sdata-each\s*=\s*(?:"([^"]*)"|'([^']*)')/,pi=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>/g,mi=/([\w:@.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,fi=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,gi=/^[@.]/,vi={".":e=>e.$data,"@index":e=>e.$index,"@first":e=>0===e.$index,"@last":e=>null!==e.$length&&e.$index===e.$length-1},bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),_i={text:"txt",attr:"attr",raw:"raw",block:"blk"};function yi(e,t){if(0===t.length)return e;const n=[...t].sort((e,t)=>e.index-t.index||(e.order??0)-(t.order??0));let s="",o=0;for(const t of n)t.index<o||(s+=e.slice(o,t.index)+t.text,o=t.index+(t.skip??0));return s+e.slice(o)}function ki(e,t){let n=null;for(const s of t)e>=s[0]&&e<s[1]&&(!n||s[0]>n[0])&&(n=s);return n}function wi(e,t){for(const[n,s]of t)if(e>=n&&e<s)return!0;return!1}function xi(e){return String(e).trim().split(".")[0]}function Mi(e,t){const n=String(t).trim().split(".");let s=e;for(const e of n){if(null==s)return;s=s[e]}return s}function Li(e){const t=new Set;for(const n of e.matchAll(ci)){const e=n[1].trim();fi.test(e)&&t.add(xi(e))}for(const n of e.matchAll(di)){const e=n[1].trim();fi.test(e)&&t.add(xi(e))}return t}function Ci(e){const t=[],n=[];for(const s of e.matchAll(li)){if("#"===s[1]){t.push({start:s.index,kind:s[2],expr:(s[3]||"").trim()});continue}let e=null;for(;t.length>0;){const n=t.pop();if(n.kind===s[2]){e=n;break}}e&&n.push({start:e.start,end:s.index+s[0].length,kind:e.kind,expr:e.expr})}return n}function Ei(e,t){const n=e.lastIndexOf("<",t);return-1!==n&&n>e.lastIndexOf(">",t)}function Ai(e,t){const n=t[1],s=t.index,o=s+t[0].length;if("/"===t[3]||bi.has(n.toLowerCase()))return[s,o];const i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<(/?)${i}(?=[\\s/>])`,"gi");let a=1;for(const t of e.slice(o).matchAll(r)){const n=o+t.index;if("/"===t[1]){if(a--,a>0)continue;const t=e.indexOf(">",n);return-1===t?null:[s,t+1]}const i=e.indexOf(">",n);-1!==i&&"/"===e[i-1]||a++}return null}function Si(e,t){const n=[];for(const s of t){if("each"!==s.kind&&"with"!==s.kind)continue;const t=e.indexOf(jo(s.id)),o=e.indexOf(Bo(s.id));-1!==t&&-1!==o&&n.push([t,o,s])}return n}const $i=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,zi=/\s+key\s*=\s*[A-Za-z_$][\w$]*(?:\.[\w$]+)*/,ji=new Set;function Bi(e){const t=$i.exec(String(e));return null===t||""===t[1].trim()?null:{collection:t[1].trim(),key:t[2]}}function Ti(e,t){const n=/^\{\{#(?:if|unless|each|with|slot)(?:\s+[^}]*?)?\s*\}\}/.exec(e.slice(t.start,t.end)),s=/\{\{\/(?:if|unless|each|with|slot)\s*\}\}$/.exec(e.slice(t.start,t.end));return null===n||null===s?[t.start,t.end]:[t.start+n[0].length,t.start+s.index]}function Di(e,t){const n=[];for(const s of t){if(!0!==Gs(s.kind)?.capturesBody)continue;const t=jo(s.id),o=e.indexOf(t),i=e.indexOf(Bo(s.id));-1!==o&&-1!==i&&n.push([o+t.length,i])}n.sort((e,t)=>e[0]-t[0]);let s="",o=0;for(const[t,i]of n)t<o||(s+=e.slice(o,t),o=i);return s+=e.slice(o),s.replace(/\{\{\{[^{}]*\}\}\}/g,"").replace(/\{\{[^{}]*\}\}/g,"")}const Wi=/\$index|\$length|@index|@first|@last/;function Hi(e){const t=(e.parts??[]).map(e=>e.tmpl).join(" ");return`${e.expr??""} ${e.body??""} ${t}`}let Oi=0;function Ii(e,t,n,s,o){const{annotated:i,bindings:r,slots:a}=Ri(e,{...s,itemForms:!0,template:t,idPrefix:o});for(const e of r)e.positional=Wi.test(Hi(e));return{content:To(Di(i,r)),bindings:r,slots:a,render:n,label:t,options:s,usesLength:/@last|\$length/.test(e),usesAncestors:/\$parentContext|\$parents/.test(e)}}function Ni(e,t,n=[]){if(!1===t.warnUnkeyed&&0===n.length)return;const s=`${t.template??""}|${e}`;if(ji.has(s))return;ji.add(s);const o=t.template?` in template "${t.template}"`:"",i=n.map(e=>`"${e}"`).join(", "),r=n.length?`, and its ${i} ${1===n.length?"binding is":"bindings are"} not attached`:"",a=n.length?` - ${1===n.length?"it binds":"they bind"} normally once the block has a key`:"";console.warn(`${ai} {{#each ${e}}}${o} has no key=, so it re-renders the whole block on every change - losing DOM node identity, focus and uncommitted input${r}. Write {{#each ${e} key=id}}, naming whichever property identifies an item, to reconcile instead${a}.`)}function Pi(e,t){const n=`demoted|${t.template??""}|${e}`;if(ji.has(n))return;ji.add(n);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ai} {{#each ${e}}}${s} sits inside an unkeyed {{#each}} or a {{#with}}, so it cannot reconcile: its collection would be resolved against the top-level data. It has been demoted to a plain re-rendered block. Add key= to the ENCLOSING block and both will reconcile.`)}function Vi(e,t){return null===e.factoryBox.value&&(e.factoryBox.value=function(e,t,n){const s=`${n.template?`${n.template} `:""}{{#each ${e.expr}}}`;return hi.test(e.body)&&console.warn(`${ai} {{> partial}} inside a keyed {{#each}} is not expanded - the block body is compiled once into a <template>, before any render pass exists to resolve a partial against. Inline it, in ${s}`),Ii(e.body,s,t,n,`i${++Oi}:`)}(e,t,e.factoryBox.options)),e.factoryBox.value}function Fi(e,t,n){const s={...n,methodCalls:!0===t.methodCalls},o=ys(e,s);return null===o?null:{ast:o,evaluate:gn(ws(e,s),{expr:e,where:n?.template?`template "${n.template}"`:"",handler:t}),deps:!1===t.tracks?new Set:xs(o)}}function Ri(e,t={}){const n=[],s=[],o=new Set,i=t.idPrefix??"",r=(e,n)=>{if(o.has(e))return;o.add(e);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ai} ${n}${s}`)},a=ui.exec(e);if(null!==a){const e=a[1]??a[2]??"";r("inert-each",`data-each="${e}" does nothing here. It is an applyBindings spelling, and this is compiled markup - write {{#each ${e}}} … {{/each}} instead. A data-each nested inside another list is compiled markup too, which is the usual way to meet this`)}for(const t of e.matchAll(pi)){const e=t[2]||"";if(!e.includes("data-param-"))continue;if(/\sdata-component\s*=/.test(e))continue;const n=/\s(data-param-[\w-]+)/.exec(e);r("orphan-param",`${null===n?"data-param-*":n[1]} does nothing on an element with no data-component. Check the component attribute is present and spelled correctly - and remember its value is an expression, so a literal name takes quotes: data-component="'my-thing'"`)}const l=Ci(e),d=function(e){const t=[];for(const n of e.matchAll(pi)){const s=n[2]||"";if(s.includes("data-"))for(const o of s.matchAll(mi)){const s=Js(o[1]);if(null===s||!s.handler.region)continue;const i=Ai(e,n);if(null===i)break;t.push({start:i[0],end:i[1],kind:s.kind,arg:s.arg,expr:Es(void 0!==o[2]?o[2]:o[3]||"").trim()});break}}return t}(e),c=[],h=new Set,u=l.filter(e=>"with"===e.kind||"each"===e.kind&&null===Bi(e.expr)).map(e=>[e.start,e.end]);for(const e of l)"each"===e.kind&&null!==Bi(e.expr)&&(u.some(([t,n])=>e.start>t&&e.end<=n)?(h.add(e.start),Pi(e.expr,t)):c.push([e.start,e.end]));const p=(e,t)=>c.some(([n,s])=>e>n&&t<=s),m=[...l.map((e,t)=>({...e,id:`${i}${t}_blk`,mustache:!0})).filter(e=>!p(e.start,e.end)),...d.map((e,t)=>({...e,id:`${i}${l.length+t}_${e.kind}`})).filter(e=>!p(e.start,e.end))],f=[];for(const t of m){if(t.mustache&&h.has(t.start)){const n=e.slice(t.start,t.end),s=zi.exec(n);null!==s&&f.push({index:t.start+s.index,text:"",order:1,skip:s[0].length}),t.expr=Bi(t.expr)?.collection??t.expr}if(t.mustache&&"slot"===t.kind){const[n,o]=Ti(e,t);f.push({index:t.start,text:jo(t.id),order:1,skip:n-t.start}),f.push({index:o,text:Bo(t.id),order:0,skip:t.end-o}),s.push({id:t.id,name:t.expr});continue}const n=t.mustache&&"each"===t.kind&&!h.has(t.start)&&Bi(t.expr);if(n){f.push({index:t.start,text:jo(t.id)+Bo(t.id),order:1,skip:t.end-t.start}),t.keyed=n;const[s,o]=Ti(e,t);t.rawBody=e.slice(s,o);continue}t.mustache&&"each"===t.kind&&(t.unkeyed=!0),f.push({index:t.start,text:jo(t.id),order:1}),f.push({index:t.end,text:Bo(t.id),order:0})}let g=yi(e,f),v=m.length;const b=e=>`${i}${v++}_${_i[e]??e}`;for(const e of m){if("slot"===e.kind)continue;if(-1===g.indexOf(jo(e.id)))continue;if(e.keyed){const s=Gs("each"),o=Fi(e.keyed.collection,s,t);if(null===o)continue;n.push({id:e.id,kind:"each",blockKind:"each",expr:e.keyed.collection,keyPath:e.keyed.key,body:e.rawBody,ast:o.ast,evaluate:o.evaluate,deps:o.deps,prime:!0===s.primes,factoryBox:{value:null,options:t},nodes:null});continue}if(e.mustache){n.push({id:e.id,kind:"block",blockKind:e.kind,expr:e.expr,body:"",deps:fi.test(e.expr)?new Set([xi(e.expr)]):Li(e.expr),nodes:null});continue}const s=Gs(e.kind),o=Fi(e.expr,s,t);null!==o&&n.push({id:e.id,kind:e.kind,arg:e.arg,expr:e.expr,body:"",ast:o.ast,evaluate:o.evaluate,deps:o.deps,prime:!0===s.primes,nodes:null})}const _=[];for(const e of[...g.matchAll(di)]){if(wi(e.index,Si(g,m)))continue;const t=e[1].trim();if(!fi.test(t))continue;const s=b("raw");_.push({index:e.index,text:jo(s),order:1}),_.push({index:e.index+e[0].length,text:Bo(s),order:0}),n.push({id:s,kind:"raw",expr:t,body:e[0],deps:new Set([xi(t)]),nodes:null})}g=yi(g,_);const y=n.filter(e=>"raw"===e.kind).map(e=>{const t=g.indexOf(jo(e.id)),n=g.indexOf(Bo(e.id));return-1!==t&&-1!==n?[t,n+Bo(e.id).length]:null}).filter(Boolean),k=Si(g,m),w=[];for(const e of[...g.matchAll(ci)]){if(wi(e.index,k))continue;if(wi(e.index,y))continue;if(Ei(g,e.index))continue;const s=qi(e[1].trim(),t,r);if(null===s)continue;const o=b("text");w.push({index:e.index,text:`<span data-dm-t="${o}">`,order:1}),w.push({index:e.index+e[0].length,text:"</span>",order:0}),n.push({id:o,...s,nodes:null})}g=yi(g,w);const x=Si(g,m),M=[],L=new Map;for(const e of[...g.matchAll(pi)]){const s=e[2]||"",o=wi(e.index,x),i=[],a=[];for(const l of s.matchAll(mi)){const s=l[1];if(s.startsWith("data-dm-"))continue;const d=void 0!==l[2]?l[2]:l[3]||"",c=Js(s);if(null!==c){if(c.handler.region)continue;if(o){const t=ki(e.index,x)?.[2];if(t?.unkeyed){const e=L.get(t)??[];e.includes(s)||e.push(s),L.set(t,e)}else r(`shifted:${s}`,`"${s}" inside a {{#with}} block is not bound: {{#with}} re-renders its body as a whole, so there is nothing to attach it to. Write the full path instead (data-model="obj.field" rather than data-model="field" inside {{#with obj}}) and it binds normally.`);continue}const i=c.handler,l=Es(d).trim(),h=!1===i.expression?{ast:null,evaluate:null,deps:new Set}:Fi(l,i,t);if(null===h)continue;const u=b(c.kind);a.push(u),n.push({id:u,kind:c.kind,arg:c.arg,expr:l,ast:h.ast,evaluate:h.evaluate,deps:h.deps,prime:!0===i.primes,nodes:null});continue}if(o)continue;if(!d.includes("{{"))continue;const h=Li(d);0!==h.size&&i.push({name:s,tmpl:d,deps:[...h]})}const l=e.index+e[0].length-(e[3]?2:1);if(i.length>0){const e=b("attr"),t=new Set;for(const e of i)for(const n of e.deps)t.add(n);M.push({index:l,text:` data-dm-a="${e}"`,order:1}),n.push({id:e,kind:"attr",parts:i,deps:t,nodes:null})}a.length>0&&M.push({index:l,text:` data-dm-b="${a.join(" ")}"`,order:1})}g=yi(g,M);for(const e of n){if(!0!==Gs(e.kind)?.capturesBody)continue;const t=jo(e.id),n=g.indexOf(t),s=g.indexOf(Bo(e.id));-1!==n&&-1!==s&&(e.body=g.slice(n+t.length,s))}for(const e of m)e.unkeyed&&Ni(e.expr,t,L.get(e)??[]);return{annotated:g,bindings:n,slots:s}}function qi(e,t,n){if(!0===t.itemForms&&void 0!==vi[e])return{kind:"text",expr:e,evaluate:vi[e],deps:new Set,prime:!0};if(fi.test(e)){if(e.startsWith("$")){const n=Fi(e,Gs("text"),t);return null===n?null:{kind:"text",expr:e,ast:n.ast,evaluate:n.evaluate,deps:n.deps,prime:!0}}return{kind:"text",expr:e,evaluate:t=>Mi(t.$data,e),deps:new Set([xi(e)]),prime:!1}}if(gi.test(e)||!Ds.test(e))return null;const s=Fi(e,Gs("text"),t);return null===s?(n(`expr:${e}`,`"{{${e}}}" is not bound`),null):{kind:"text",expr:e,ast:s.ast,evaluate:s.evaluate,deps:s.deps,prime:!0}}Ys("each",qo(Vi));const Ui=new WeakMap;!function(e){Ys("component",function(e){return{tracks:!0,primes:!0,attribute:"data-component",expression:!0,update({binding:t,nodes:n,context:s,render:o}){const i=t.evaluate(s);for(const r of n){let n=oi.get(r);if(void 0===n&&(n={name:null,instance:null,viewModel:null,slots:null,placed:[]},oi.set(r,n),Ao(r,()=>ri(n))),n.name===i&&null!==n.instance)continue;if(ri(n),null===n.slots&&(n.slots=ei(r)),r.replaceChildren(),"string"!=typeof i||""===i){Go(`component:name:${t.id}`,`data-component="${t.expr}" needs a component name - got `+(null===i?"null":typeof i)+". Remember that a literal name takes quotes, because every binding value is an expression: data-component=\"'my-thing'\"");continue}const a=Jo(i);if(void 0===a){Go(`component:missing:${t.id}:${i}`,`no component is registered as "${i}", in ${t.expr}`);continue}const l=ii(a,Qo(r,t,s),r,t,i);if(null===l)continue;const d=e(a,i,o,t.options??{});n.name=i,n.viewModel=l,n.instance=Vo(d,s,l,null,null,{context:Fn(s,l)}),n.placed=si(n.instance,d,n.slots,t,i),n.placed.length>0&&n.instance.runtime.index(),r.append(...n.instance.allNodes())}return!0},detach({node:e}){const t=oi.get(e);void 0!==t&&ri(t)}}}(e))}(function(e,t,n,s){let o=Ui.get(e);return void 0===o&&(o=function(e,t,n,s){return Ii(e,t,n,s,`c${++Oi}:`)}(e.template,`component ${t}`,n,s),Ui.set(e,o)),o});const Ki={annotate:Ri,compile:function(e,t,n,s,o={}){const i="function"==typeof s?s:Fs,{annotated:r,bindings:a}=Ri(e,o),l=e=>{n.replaceChildren(To(i(r,e.$data)))},d=Oo({bindings:a,render:i,context:Rn(t),getRoots:()=>[...n.childNodes],reactive:!0===o.reactive,label:o.template,repaint:l});return l(d.context()),d.index(),d},scanBlocks:Ci,resolvePath:Mi},Yi="[Domma Reactive]",Gi="data-each",Ji=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,Xi=/^\s*dm\s+([a-zA-Z][\w-]*)\s*:\s*([\s\S]+?)\s*$/,Zi=/^\s*\/dm\s*$/,Qi=/\{\{\s*[\w$][\w$.]*\s*\}\}/,er="data-dm-bound",tr=new WeakSet,nr=new Set;function sr(e,t){nr.has(e)||(nr.add(e),console.warn(`${Yi} ${t}`))}function or(e){if(!e||1!==e.nodeType)return String(e);const t=e.id?`#${e.id}`:"",n=e.classList?.length?`.${[...e.classList].join(".")}`:"";return`<${e.tagName.toLowerCase()}${t}${n}>`}function ir(e,t){if(null!=e&&1===e.nodeType&&!1!==t(e))for(const n of[...e.children])ir(n,t)}function rr(e,t,n={}){if(null==t||1!==t.nodeType)throw new TypeError(`${Yi} applyBindings: expected an element to activate, got ${String(t)}`);const s="function"==typeof n.render?n.render:Fs,o=n.template||or(t);let i=Rn(e);const r=[],a=[],l=[];let d=!1,c=0;const h={context:()=>i,update:()=>!1,bindings:[]},u=function(e,t){const n=[];let s=0;const o=e=>{const i=[];for(const t of[...e.childNodes]){if(8===t.nodeType){if(Zi.test(t.data)){const e=i.pop();void 0!==e&&n.push({...e,close:t});continue}const o=t.data.match(Xi);null!==o&&i.push({kind:o[1],expr:o[2],open:t,parent:e,seq:s++});continue}1===t.nodeType&&o(t)}for(const e of i)t(e)};return o(e),n.sort((e,t)=>e.seq-t.seq)}(t,e=>{sr(`virtual:unclosed:${o}:${e.kind}`,`\x3c!-- dm ${e.kind}: ${e.expr} --\x3e in ${o} has no matching \x3c!-- /dm --\x3e, so the block was skipped. Every virtual binding needs a closer.`)});for(const e of u)"each"===e.kind&&b(e,u);const p=[];ir(t,e=>{if(tr.has(e))return c++,!1;const t=e.getAttribute(Gi),n=function(e){const t=[];for(const n of[...e.attributes]){if(n.name===er||n.name===Gi)continue;const e=Js(n.name);null!==e&&t.push({name:n.name,value:n.value.trim(),kind:e.kind,arg:e.arg,handler:e.handler})}return t}(e);return null===t&&0===n.length||(p.push({el:e,each:t,claims:n}),null===t)}),c>0&&sr(`double:${o}`,`applyBindings ran again over ${o}, where ${c} element(s) were already bound. Those were skipped rather than bound twice; the handle returned owns only what this call created. Dispose the first handle before re-applying.`);for(const{el:e}of p)tr.add(e),e.setAttribute(er,""),l.push(e);!function(e,t){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let s;for(;s=n.nextNode();)if(Qi.test(s.data)&&!ar(s,e))return void sr(`interp:${t}`,`${t} contains "${s.data.trim().slice(0,40)}" - applyBindings does not interpolate {{ }} in already-rendered DOM, and leaves it as it found it. Use data-bind-text="expr", which the server can render alongside the text, or compile() if the markup should come from a template.`)}(t,o);let m=0;for(const e of p){null!==e.each&&v(e.el,e.each);for(const t of e.claims)g(e.el,t)}for(const e of u)_(e);function f(e,t,n){if(!1===t.expression)return{ast:null,evaluate:null,deps:new Set};const s={template:`${o} ${n}`,methodCalls:!0===t.methodCalls},i=ys(e,s);return null===i?null:{ast:i,evaluate:gn(ws(e,s),{expr:e,where:s.template,handler:t}),deps:!1===t.tracks?new Set:xs(i)}}function g(e,t){const{handler:n,kind:o,arg:r,value:l,name:d}=t,c=f(l,n,d);if(null===c)return;const u={id:`apply${m++}_${o}`,kind:o,arg:r,expr:l,ast:c.ast,evaluate:c.evaluate,deps:c.deps,nodes:[e]};h.bindings.push(u),"function"==typeof n.attach&&n.attach({binding:u,node:e,controller:h}),"function"==typeof n.detach&&a.push(()=>n.detach({binding:u,node:e,controller:h})),!0!==n.region?!1!==n.tracks&&y(()=>n.update({binding:u,nodes:[e],context:i,render:s,controller:h})):"if"===o?function(e,t){const n=document.createComment(`dm:if ${t.expr}`);e.parentNode?.insertBefore(n,e),y(()=>{const s=Os(t.evaluate(i));return s&&null===e.parentNode?n.parentNode?.insertBefore(e,n.nextSibling):s||null===e.parentNode||e.parentNode.removeChild(e),!0}),a.push(()=>{null===e.parentNode&&n.parentNode?.insertBefore(e,n.nextSibling),n.parentNode?.removeChild(n)})}(e,u):sr(`region:${o}`,`"${d}" is a region binding, which needs a compiled template body. applyBindings has none - the markup is the page. Use compile() for ${o}, or data-if / data-each, which are implemented here directly.`)}function v(e,t){const n=Ji.exec(t);if(null===n||""===n[1].trim())return void sr(`each:unkeyed:${o}`,`${Gi}="${t}" on ${or(e)} needs a key: write ${Gi}="${t.trim()} key=id", naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const r=n[1].trim(),l=n[2],d=f(r,{expression:!0,tracks:!0,acceptsReactive:!0},Gi);if(null===d)return;const c=e.innerHTML;e.replaceChildren();const u=document.createComment("dm:each"),p=document.createComment("/dm:each");e.append(u,p);const g={id:`apply${m++}_each`,kind:"each",expr:r,keyPath:l,body:c,ast:d.ast,evaluate:d.evaluate,deps:d.deps,factoryBox:{value:null,options:{template:o}},nodes:[{open:u,close:p}]};h.bindings.push(g);const v=Gs("each");y(()=>v.update({binding:g,nodes:g.nodes,context:i,render:s,controller:h})),a.push(()=>{Ro({open:u},[],Vi(g,s),l,i,o),e.replaceChildren()})}function b(e,t){const n=document.createElement("div");for(const t of Do(e.open,e.close))n.appendChild(t);for(const s of t){if(s===e||!n.contains(s.open))continue;s.consumed=!0;const t=[s.open,...Do(s.open,s.close),s.close];for(const e of t)e.parentNode?.removeChild(e);sr(`virtual:nested:${o}:${s.kind}`,`\x3c!-- dm ${s.kind}: ${s.expr} --\x3e is inside a virtual list's body, which is compiled as a template - virtual bindings are not read there, so its content is left out. Use {{#${s.kind}}} inside the body, or data-if on an element.`)}e.body=n.innerHTML}function _(e){!0!==e.consumed&&("if"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm if --\x3e");if(null===t)return;const n={id:`apply${m++}_if`,kind:"if",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[{open:e.open,close:e.close}]};h.bindings.push(n);let s=null;const o=()=>{null!==s&&(e.close.parentNode?.insertBefore(s,e.close),s=null)};y(()=>{if(Os(n.evaluate(i)))o();else if(null===s){s=document.createDocumentFragment();for(const t of Do(e.open,e.close))s.appendChild(t)}return!0}),a.push(o)}(e):"each"===e.kind?function(e){const t=e.expr.match(Ji);if(null===t||""===t[1].trim())return void sr(`virtual:each:unkeyed:${o}`,`\x3c!-- dm each: ${e.expr} --\x3e needs a key: write \x3c!-- dm each: ${e.expr.trim()} key=id --\x3e, naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const n=t[1].trim(),r=t[2],l=f(n,{expression:!0,tracks:!0,acceptsReactive:!0},"\x3c!-- dm each --\x3e");if(null===l)return;const d={id:`apply${m++}_each`,kind:"each",expr:n,keyPath:r,body:e.body,ast:l.ast,evaluate:l.evaluate,deps:l.deps,factoryBox:{value:null,options:{template:o}},nodes:[{open:e.open,close:e.close}]};h.bindings.push(d);const c=Gs("each");y(()=>c.update({binding:d,nodes:d.nodes,context:i,render:s,controller:h})),a.push(()=>{Ro({open:e.open,close:e.close},[],Vi(d,s),r,i,o)})}(e):"text"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm text --\x3e");if(null===t)return;for(const t of Do(e.open,e.close))t.parentNode?.removeChild(t);const n=document.createTextNode("");e.close.parentNode?.insertBefore(n,e.close);const s={id:`apply${m++}_text`,kind:"text",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[n]};h.bindings.push(s),y(()=>{const e=s.evaluate(i);return n.data=null==e?"":String(e),!0}),a.push(()=>n.parentNode?.removeChild(n))}(e):sr(`virtual:kind:${e.kind}`,`\x3c!-- dm ${e.kind}: … --\x3e is not a virtual binding. Supported: if, each, text. Anything else needs an element to bind to.`))}function y(e){r.push(En(e,{label:`${o}:${r.length}`}))}return{get bindings(){return h.bindings.length},context:()=>i,update(e){if(!d){void 0!==e&&(i=Rn(e));for(const e of r)e.recompute()}},dispose(){if(!d){d=!0;for(const e of r)e.dispose();r.length=0;for(const e of a)try{e()}catch(e){console.warn(`${Yi} applyBindings teardown threw:`,e)}a.length=0;for(const e of l)tr.delete(e),e.removeAttribute(er);l.length=0}}}}function ar(e,t){for(let n=e.parentNode;n;n=n.parentNode){if(1===n.nodeType&&n.hasAttribute(Gi))return!0;if(n===t)return!1}return!1}const lr=(e,t)=>c.isEqual(e,t);class dr{constructor(e,t={},n={}){this._schema=e,this._initialData={},this._bindings=new Map,this._changeCallbacks=new Set,this._fieldCallbacks=new Map,this._fields=new Map,this._trackedView=null,this._persistKey=n.persist||null,this._autoSave=!1!==n.autoSave;for(const n in e){const s=e[n],o=void 0!==s.default?s.default:null,i=void 0!==t[n]?t[n]:o;this._fields.set(n,Hn(i,{equals:lr})),this._initialData[n]=i}this._persistKey&&this._loadFromStorage()}get(e){if(e){const t=this._fields.get(e);return t?t.value:void 0}const t={};for(const[e,n]of this._fields)t[e]=n.value;return t}_field(e){let t=this._fields.get(e);return t||(t=Hn(null,{equals:lr}),this._fields.set(e,t)),t}_snapshot(){const e={};for(const[t,n]of this._fields)e[t]=n.peek();return e}tracked(){if(!this._trackedView){const e=this;this._trackedView=new Proxy({},{get(t,n){if("string"!=typeof n)return;const s=e._fields.get(n);return s?s.value:void 0},set:(t,n,s)=>("string"==typeof n&&e._setField(n,s),!0),has(t,n){if("string"!=typeof n)return!1;const s=e._fields.get(n);return!!s&&(s.value,!0)},ownKeys:()=>[...e._fields.keys()],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}return this._trackedView}set(e,t){if("object"==typeof e)for(const t in e)this._setField(t,e[t]);else this._setField(e,t);return this}_setField(e,t){const n=this._field(e),s=n.peek();if(this._schema[e]){const n=this._validateField(e,t);if(!n.valid)throw new Error(`Validation failed for ${e}: ${n.error}`)}const o=!lr(s,t);n.value=t,o&&(this._notifyChange(e,t,s),this._updateBindings(e,t),this._persistKey&&this._autoSave&&this._saveToStorage())}_validateField(e,t){const n=this._schema[e],s=null==t||""===t;if(n.required&&s)return{valid:!1,error:"Required field is empty"};if(!s&&n.type){const e=ur.types[n.type];if(e&&!e(t))return{valid:!1,error:`Expected type ${n.type}`}}if(void 0!==n.min&&"number"==typeof t&&t<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&"number"==typeof t&&t>n.max)return{valid:!1,error:`Value must be at most ${n.max}`};if(void 0!==n.minLength&&"string"==typeof t&&t.length<n.minLength)return{valid:!1,error:`Length must be at least ${n.minLength}`};if(void 0!==n.maxLength&&"string"==typeof t&&t.length>n.maxLength)return{valid:!1,error:`Length must be at most ${n.maxLength}`};if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:"Value does not match pattern"};if(n.validate&&"function"==typeof n.validate){const e=n.validate(t);if(!1===e)return{valid:!1,error:"Custom validation failed"};if("string"==typeof e)return{valid:!1,error:e}}return{valid:!0}}validate(){const e=[],t=this._snapshot();for(const n in this._schema){const s=this._validateField(n,t[n]);s.valid||e.push({field:n,error:s.error})}return{valid:0===e.length,errors:e}}toJSON(){return An(()=>this._snapshot())}onChange(e,t){if("string"==typeof e){if("function"!=typeof t)throw new TypeError(`Model.onChange('${e}', callback) requires a callback function`);const n=e,s=e=>{e.field===n&&t(e)};return this._changeCallbacks.add(s),()=>this._changeCallbacks.delete(s)}if("function"!=typeof e)throw new TypeError("Model.onChange expects a callback, or (field, callback)");return this._changeCallbacks.add(e),()=>this._changeCallbacks.delete(e)}onFieldChange(e,t){return this._fieldCallbacks.has(e)||this._fieldCallbacks.set(e,new Set),this._fieldCallbacks.get(e).add(t),()=>this._fieldCallbacks.get(e)?.delete(t)}_notifyChange(e,t,n){for(const s of this._changeCallbacks)s({field:e,newValue:t,oldValue:n,model:this});if(this._fieldCallbacks.has(e))for(const s of this._fieldCallbacks.get(e))s(t,n,this)}_updateBindings(e,t){if(this._bindings.has(e))for(const n of this._bindings.get(e))n.update(t)}_addBinding(e,t){this._bindings.has(e)||this._bindings.set(e,new Set),this._bindings.get(e).add(t)}_removeBinding(e,t){this._bindings.has(e)&&this._bindings.get(e).delete(t)}reset(e=!1){for(const e in this._initialData)this.set(e,c.cloneDeep(this._initialData[e]));return e&&this._persistKey&&this.clearStorage(),this}destroy(e=!1){e&&this._persistKey&&this.clearStorage(),this._changeCallbacks.clear(),this._fieldCallbacks.clear(),this._bindings.clear(),this._fields.clear(),this._trackedView=null}save(){return this._saveToStorage()}load(){return this._loadFromStorage()}clearStorage(){return!!this._persistKey&&Q.remove(`model:${this._persistKey}`)}getPersistKey(){return this._persistKey}isPersisted(){return null!==this._persistKey}_saveToStorage(){if(!this._persistKey)return!1;try{return Q.set(`model:${this._persistKey}`,this._snapshot())}catch(e){return console.warn("Domma Model: Failed to save to storage",e),!1}}_loadFromStorage(){if(!this._persistKey)return!1;try{const e=Q.get(`model:${this._persistKey}`);if(e&&"object"==typeof e){for(const t in e)void 0!==this._schema[t]&&(this._field(t).value=e[t]);return!0}return!1}catch(e){return console.warn("Domma Model: Failed to load from storage",e),!1}}}class cr{constructor(e,t,n,s={}){this.model=e,this.field=t,this.element=n,this.options=s,this.format=s.format||(e=>e),this.parse=s.parse||(e=>e),this.twoWay=s.twoWay||!1,this._eventHandler=null,this.update(e.get(t)),this.twoWay&&this._setupTwoWay()}update(e){const t=this.format(e),n=this.element;"INPUT"===n.tagName||"TEXTAREA"===n.tagName?"checkbox"===n.type?n.checked=Boolean(t):"radio"===n.type?n.checked=n.value===String(t):n.value=null!=t?t:"":"SELECT"===n.tagName?n.value=t:n.textContent=null!=t?t:""}_setupTwoWay(){const e=this.element,t=this._getEventType();this._eventHandler=t=>{let n;n="checkbox"===e.type?e.checked:"number"===e.type||"range"===e.type?""===e.value?null:Number(e.value):e.value;try{this.model.set(this.field,this.parse(n))}catch(e){console.warn("Binding validation error:",e.message)}},e.addEventListener(t,this._eventHandler)}_getEventType(){const e=this.element;return"SELECT"===e.tagName||"checkbox"===e.type||"radio"===e.type?"change":"input"}destroy(){if(this._eventHandler){const e=this._getEventType();this.element.removeEventListener(e,this._eventHandler)}this.model._removeBinding(this.field,this)}}const hr=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;const ur={_events:new Map,subscribe(e,t){return this._events.has(e)||this._events.set(e,new Set),this._events.get(e).add(t),()=>this.unsubscribe(e,t)},on(e,t){return this.subscribe(e,t)},unsubscribe(e,t){this._events.has(e)&&this._events.get(e).delete(t)},off(e,t){this.unsubscribe(e,t)},publish(e,t){if(this._events.has(e))for(const n of this._events.get(e))n(t)},emit(e,t){this.publish(e,t)},once(e,t){const n=s=>{this.unsubscribe(e,n),t(s)};return this.subscribe(e,n)},clear(e){e?this._events.delete(e):this._events.clear()},create:(e,t={},n={})=>new dr(e,t,n),extend(...e){const t={};for(const n of e)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]&&c.isPlainObject(t[e])?t[e]=c.merge(c.cloneDeep(t[e]),c.cloneDeep(n[e])):t[e]=c.cloneDeep(n[e]));return t},pick(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=c.cloneDeep(e[s]));return n},omit(e,t){const n=c.cloneDeep(e);for(const e of t)delete n[e];return n},observable:Hn,observableArray:function(e=[],t={}){const n=new wn,s=Dn();let o=Array.isArray(e)?e.slice():[];const i=Wn(t,e=>{n.trigger(),s.notify(e)}),r=()=>i.announce(o),a=e=>{const t=Array.isArray(e)?e.slice():[],n=i.changed(o,t);o=t,n&&r()},l={get value(){return n.track(),o},set value(e){a(e)},get length(){return n.track(),o.length},peek:()=>o,set:e=>a(e),remove:e=>{const t="function"==typeof e?e:t=>t===e;for(let e=o.length-1;e>=0;e--)t(o[e],e)&&o.splice(e,1);return r(),l},removeAll:()=>(o.length=0,r(),l),indexOf:e=>(n.track(),o.indexOf(e)),replace:(e,t)=>{const n=o.indexOf(e);return-1!==n&&(o[n]=t),r(),l},destroy:e=>{const t="function"==typeof e?e:t=>t===e;let n=0,s=0;for(let e=0;e<o.length;e++)t(o[e],e)&&(null!==o[e]&&"object"==typeof o[e]?(o[e]._destroy=!0,n++):s++);return s>0&&console.warn(`${Tn} destroy: ${s} matching item(s) are not objects and cannot carry a _destroy mark. Use remove() for an array of primitives.`),(n>0||0===s)&&r(),l},destroyAll:()=>l.destroy(()=>!0),subscribe:e=>s.add(e),extend:e=>(i.extend(e),l)};i.attach(l);for(const e of On)l[e]=(...t)=>{const n=Array.prototype[e].apply(o,t);return r(),n};return mn(l)},computed(e,t={}){const n=Cn(e,{label:t.label,onNotify:t.onChange||null});return{get value(){return n.get()},set value(e){n.write(e)},get:()=>n.get(),set:e=>n.write(e),peek:()=>An(()=>n.get()),dispose:()=>n.dispose(),_computation:n}},effect(e,t={}){const n=En(e,{label:t.label});return()=>n.dispose()},untracked:e=>An(e),flush(){yn=!1,Ln()},types:{string:e=>"string"==typeof e,number:e=>"number"==typeof e&&!Number.isNaN(e),boolean:e=>"boolean"==typeof e,array:e=>Array.isArray(e),object:e=>null!==e&&"object"==typeof e&&!Array.isArray(e),date:function(e){if(e instanceof Date)return!Number.isNaN(e.getTime());if("string"!=typeof e||!hr.test(e))return!1;const t=Date.parse(e);if(Number.isNaN(t))return!1;if(10===e.length){const n=new Date(t),[s,o,i]=e.split("-").map(Number);return n.getUTCFullYear()===s&&n.getUTCMonth()+1===o&&n.getUTCDate()===i}return!0},any:()=>!0},bind(e,t,n,s={}){const o="string"==typeof n?document.querySelectorAll(n):[n],i=[];for(const n of o){const o=new cr(e,t,n,s);e._addBinding(t,o),i.push(o)}return()=>{for(const e of i)e.destroy()}},applyBindings(e,t,n={}){const s=function(e){if("string"==typeof e)return document.querySelector(e);if(e&&1===e.nodeType)return e;if(e&&"object"==typeof e){const t=e[0]||(Array.isArray(e.elements)?e.elements[0]:null);if(t&&1===t.nodeType)return t}return null}(t);if(!s)throw new TypeError(`M.applyBindings: no element found for ${"string"==typeof t?`selector "${t}"`:String(t)}`);const{methods:o,...i}=n;return rr(function(e,t){return dn(e instanceof dr?e.tracked():e,{fallback:t})}(e,o),s,{render:(e,t)=>c.render(e,t),...i})},registerBinding:(e,t)=>Ys(e,t),unregisterBinding:e=>function(e){return qs.delete(e)}(e),registerExtender:(e,t)=>jn(e,t),unregisterExtender:e=>function(e){return!zn.has(e)&&$n.delete(e)}(e),registerHelper:(e,t)=>Ms(e,t),unregisterHelper:e=>function(e){return Jn.delete(e)}(e),_stores:new Map,store(e,t={}){if(!this._stores.has(e)){const n={state:{...t},listeners:new Set,getState(){return{...this.state}},setState(e){const t={...this.state};this.state={...this.state,...e};for(const e of this.listeners)e(this.state,t)},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},reset(e){this.state=e?{...e}:{...t};for(const e of this.listeners)e(this.state,{})}};this._stores.set(e,n)}return this._stores.get(e)},getStore(e){return this._stores.get(e)},removeStore(e){this._stores.delete(e)}};class pr{static defaults={layout:"stacked",columns:2,labelPosition:"top",showLabels:!0,showHelperText:!0,showHints:!0,validationMode:"blur",cssFramework:"domma",className:"domma-form",fieldClassName:"domma-form-field",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint",cardWrapper:!1};static inputTypes={string:"text",email:"email",password:"password",number:"number",integer:"number",float:"number",boolean:"checkbox",date:"date",datetime:"datetime-local",time:"time",url:"url",tel:"tel",color:"color",range:"range",file:"file",hidden:"hidden",signature:"signature"};constructor(e,t={},n={}){this.schema=e,this.data={...t},this.options={...pr.defaults,...n},this.model=null,this.errors={},this.touched=new Set,this.utils=window.Domma?.utils||c,this.models=window.Domma?.models||ur,e&&"object"==typeof e&&(this.model=this.models.create(e,t,{persist:n.persist,autoSave:n.autoSave}))}render(){if(!this.schema)throw new Error("Schema is required to render form");return this._buildForm()}renderTo(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`Form container not found: ${e}`);return t.innerHTML=this.render(),this.formElement=t.querySelector("form"),this._bindEvents(t),this._initTooltips(t),t}_buildForm(){const{className:e,layout:t,columns:n,cardWrapper:s}=this.options;let o=e;if("grid"===t){o+=` grid ${3===n?"grid-cols-3":"grid-cols-2"} gap-4`}else"inline"===t&&(o+=" domma-form-inline");let i="";if(s&&(i+='<div class="card"><div class="card-body">'),i+=`<form class="${o}" novalidate>`,this.options.sections&&Array.isArray(this.options.sections))for(const e of this.options.sections)i+=this._buildSection(e);else for(const e in this.schema)i+=this._buildField(e,this.schema[e]);if(!1!==this.options.showSubmitButton){const e=this.options.submitText||"Submit",t=this.options.resetText,n=this.options.buttonAlignment||"right";i+=`<div class="form-group form-buttons mt-4 ${"left"===n?"text-left":"center"===n?"text-center":"text-right"}">`,t&&(i+=`<button type="button" class="btn btn-secondary mr-2" data-action="reset">${this.utils.escapeHtml(t)}</button>`),i+=`<button type="submit" class="btn btn-primary">${this.utils.escapeHtml(e)}</button>`,i+="</div>"}return i+="</form>",s&&(i+="</div></div>"),i}_buildSection(e){let t="";e.title&&(t+='<fieldset class="domma-form-section">',t+=`<legend class="domma-form-section-title">${this.utils.escapeHtml(e.title)}</legend>`);t+=`<div class="${"grid"===e.layout?`grid grid-cols-${e.columns||2}`:"domma-form-section-content"}">`;for(const n of e.fields||[])this.schema[n]&&(t+=this._buildField(n,this.schema[n]));return t+="</div>",e.title&&(t+="</fieldset>"),t}_buildField(e,t){const{fieldClassName:n,showLabels:s,showHelperText:o,showHints:i,labelPosition:r}=this.options,a=t.formConfig||{},l=t.type||"string",d=t.label||this.utils.capitalize(e),c=this.data[e]||t.default||"",h=t.required||!1,u=a.disabled||t.readonly||!1,p=a.placeholder||"",m=a.hint||"",f=a.helperText||"",g=a.tooltip||"",v=a.span||1;let b="";if("grid"===this.options.layout&&v>1){const e=this.options.columns||2;2===v?b=" col-span-2":3===v&&3===e?b=" col-span-3":v>=e&&(b=3===e?" col-span-3":" col-span-2")}let _=`<div class="${n}${b}" data-field="${e}">`;if(s&&d&&"hidden"!==l&&"boolean"!==l&&"checkbox"!==l){const t=this.options.labelClassName,n=h?' <span class="text-danger">*</span>':"",s=g?` data-tooltip="${this.utils.escapeHtml(g)}"`:"",o=g?" has-tooltip":"";_+=`<label for="field-${this.utils.escapeHtml(e)}" class="${t}${o}"${s}>`,_+=`${this.utils.escapeHtml(d)}${n}`,g&&(_+=' <span class="tooltip-icon" data-icon="help-circle" style="display: inline-block; vertical-align: middle; opacity: 0.6; cursor: help;"></span>'),i&&m&&(_+=` <small class="${this.options.hintClassName}">${this.utils.escapeHtml(m)}</small>`),_+="</label>"}return _+=this._buildInput(e,t,{type:l,value:c,required:h,disabled:u,placeholder:p}),o&&f&&(_+=`<small class="${this.options.helperClassName}">${f}</small>`),_+=`<div class="${this.options.errorClassName}" data-error-for="${e}" style="display: none;"></div>`,_+="</div>",_}_buildInput(e,t,n){const{type:s,value:o,required:i,disabled:r,placeholder:a}=n,l=t.formConfig||{},d=`field-${e}`,c={id:d,name:e,class:this.options.inputClassName,...i&&{required:!0},...r&&{disabled:!0},...a&&{placeholder:a},...void 0!==t.min&&{min:t.min},...void 0!==t.max&&{max:t.max},...void 0!==(t.step??l.step)&&{step:t.step??l.step},...t.pattern&&{pattern:t.pattern},...l.autocomplete&&{autocomplete:l.autocomplete}},h=this._inputExtras(s,t);h&&(c["data-input-extras"]=this.utils.escapeHtml(JSON.stringify(h)));const u=Object.entries(c).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ");switch(s){case"select":return this._wrapAddons(this._buildSelect(e,t,c,o),l);case"multiselect":return c.multiple=!0,this._buildSelect(e,t,c,o);case"textarea":const n=l.rows||3;return this._wrapAddons(`<textarea ${u} rows="${n}">${this.utils.escapeHtml(o)}</textarea>`,l);case"radio":return this._buildRadioGroup(e,t,c,o);case"checkbox-group":return this._buildCheckboxGroup(e,t,c,o);case"chooser":return this._buildChooser(e,t,c,o);case"checkbox":case"boolean":const i=o?"checked":"",r=t.label||this.utils.capitalize(e),a=t.required?' <span class="text-danger">*</span>':"",h=l.hint?` <small class="form-text text-muted">${l.hint}</small>`:"";return`<div class="form-check">\n <input type="checkbox" class="form-check-input" ${u} ${i}>\n <label class="form-check-label" for="${c.id}">${r}${a}</label>\n ${h}\n </div>`;case"file":return`<input type="file" ${u} accept="${l.accept||""}" ${l.multiple?"multiple":""}>`;case"signature":return`<div class="domma-signature-field" id="${d}" data-signature-field="${e}"></div>`;default:const p=`<input type="${pr.inputTypes[s]||"text"}" ${u} value="${this.utils.escapeHtml(o)}">`;return this._wrapAddons(p,l)}}_inputExtras(e,t){const n=t.formConfig||{};if(/^(select|multiselect|radio|checkbox-group|chooser|checkbox|boolean|file|signature|hidden)$/.test(e))return null;const s="textarea"===e?"textarea":pr.inputTypes[e]||"text",o={};if(n.reveal&&"password"===s&&(o.reveal=!0),n.clear&&/^(text|email|url|tel|password|number|date|datetime-local|time|textarea)$/.test(s)&&(o.clear=!0),n.stepper&&"number"===s&&(o.stepper=!0),n.counter&&/^(text|email|url|tel|password|textarea)$/.test(s)){const e="number"==typeof n.counter?n.counter:t.maxLength;o.counter=!("number"==typeof e&&e>0)||e}n.labels&&"object"==typeof n.labels&&(o.labels=n.labels);return Object.keys(o).filter(e=>"labels"!==e).length?o:null}_wrapAddons(e,t={}){const n=this._buildAddon(t.prefix,"left"),s=this._buildAddon(t.suffix,"right");if(!n&&!s)return e;return`<div class="${["input-group-icon",n&&"has-addon-left",s&&"has-addon-right"].filter(Boolean).join(" ")}">${n}${e}${s}</div>`}_buildAddon(e,t){if("string"==typeof e&&e&&(e={text:e}),!e||"object"!=typeof e)return"";const n=`input-group-addon input-group-addon-${t}`;let s="";return e.icon&&/^[a-z0-9-]+$/i.test(e.icon)?s=`<span data-icon="${e.icon}"></span>`:void 0!==e.text&&null!==e.text?s=this.utils.escapeHtml(String(e.text)):"string"==typeof e.html&&(s=e.html),s?`<span class="${n}">${s}</span>`:""}_buildSelect(e,t,n,s){let o=`<select ${Object.entries(n).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ")}>`;t.required?n.multiple||null!=s&&""!==s||(o+='<option value="" disabled selected>-- Select --</option>'):o+='<option value="">-- Select --</option>';const i=t.options||[],r=Array.isArray(s)?s:[s];for(const e of i)if("string"==typeof e){o+=`<option value="${e}" ${r.includes(e)?"selected":""}>${this.utils.capitalize(e)}</option>`}else if("object"==typeof e){const t=r.includes(e.value)?"selected":"";o+=`<option value="${e.value}" ${t}>${e.label}</option>`}return o+="</select>",o}_buildRadioGroup(e,t,n,s){const o=t.options||[];let i='<div class="domma-radio-group" role="radiogroup">';for(const t of o){const o="string"==typeof t?t:t.value,r="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${o}`;i+=`\n <label class="domma-radio-option" for="${a}">\n <input type="radio" class="form-check-input" id="${a}" name="${e}" value="${o}" ${o===s?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${r}</span>\n </label>\n `}return i+="</div>",i}_buildCheckboxGroup(e,t,n,s){const o=t.options||[],i=Array.isArray(s)?s:[];let r='<div class="domma-checkbox-group">';for(const t of o){const s="string"==typeof t?t:t.value,o="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${s}`;r+=`\n <label class="domma-checkbox-option" for="${a}">\n <input type="checkbox" class="form-check-input" id="${a}" name="${e}[]" value="${s}" ${i.includes(s)?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${o}</span>\n </label>\n `}return r+="</div>",r}_buildChooser(e,t,n,s){const o={variant:t.variant||"card",multiple:!!t.multiple,density:t.density||"comfortable",columns:t.columns||3,accent:t.accent||"primary",accentStyle:t.accentStyle||"border",glow:!!t.glow,glowColour:t.glowColour||null,shadow:t.shadow||"none",shadowColour:t.shadowColour||null,options:t.options||[],value:void 0!==s?s:t.multiple?[]:null,name:e,required:!!t.required},i=JSON.stringify(o).replace(/"/g,""");return`<div class="domma-chooser-field" id="${n.id}" data-chooser-field="${e}" data-chooser-config="${i}"></div>`}_bindEvents(e){e.addEventListener("submit",e=>{e.preventDefault(),this.handleSubmit()}),e.addEventListener("blur",e=>{e.target.matches("input, select, textarea")&&(this.validateField(e.target.name),this.touched.add(e.target.name))},!0),e.addEventListener("change",e=>{if(e.target.matches("input, select, textarea")&&this.model){const t=this._getFieldValue(e.target);try{this.model.set(e.target.name,t)}catch(t){this.setFieldError(e.target.name,t.message)}}}),e.addEventListener("click",e=>{e.target.matches('[data-action="reset"]')&&(e.preventDefault(),this.reset())}),this._initSignatureFields(e),this._initChooserFields(e),this._initInputExtras(e)}_initInputExtras(e){this._destroyInputExtras(),e.querySelectorAll("[data-input-extras]").forEach(e=>{let t;try{t=JSON.parse(e.getAttribute("data-input-extras"))}catch(e){return}const n=new ge(e,t);n.input&&(this._inputGroups[e.name||e.id]=n)})}_destroyInputExtras(){Object.values(this._inputGroups||{}).forEach(e=>e.destroy()),this._inputGroups={}}destroy(){this._destroyInputExtras()}_initChooserFields(e){this._choosers||(this._choosers={});const t=e.querySelectorAll("[data-chooser-field]");if(!t.length)return;const n="function"==typeof ln?.chooser?ln.chooser.bind(ln):window.Domma?.elements?.chooser?.bind(window.Domma.elements);n&&t.forEach(e=>{const t=JSON.parse((e.getAttribute("data-chooser-config")||"{}").replace(/"/g,'"')),s=e.getAttribute("data-chooser-field"),o=n(e,{...t,onChange:e=>{if(this.model)try{this.model.set(s,e)}catch(e){this.setFieldError(s,e.message)}else this.data[s]=e}});o&&(this._choosers[s]=o)})}_initSignatureFields(e){const t=e.querySelectorAll("[data-signature-field]");t.length&&window.Domma&&"function"==typeof window.Domma.elements?.signature&&t.forEach(e=>{const t=e.dataset.signatureField;window.Domma.elements.signature(e,{name:t,onChange:e=>{this.model&&this.model.set({[t]:e})}})})}_initTooltips(e){if(window.Domma&&window.Domma.icons&&"function"==typeof window.Domma.icons.scan&&window.Domma.icons.scan(e),window.Domma&&window.Domma.elements&&"function"==typeof window.Domma.elements.tooltip){e.querySelectorAll("label[data-tooltip]").forEach(e=>{window.Domma.elements.tooltip(e,{position:"top",trigger:"hover",delay:{show:200,hide:0}})})}}getData(){return this.model?this.model.get():this.data}setData(e){this.data={...this.data,...e},this.model&&this.model.set(e)}validate(){this.errors={};let e=!0;for(const t in this.schema){this.validateField(t)||(e=!1)}return e}validateField(e){const t=this.schema[e];if(!t)return!0;const n=this._getFieldValueByName(e);try{const s=this._validateFieldValue(e,n,t);if(!s.valid)return this.setFieldError(e,s.error),!1;if(this.model&&this.model._validateField){const t=this.model._validateField(e,n);if(!t.valid)return this.setFieldError(e,t.error),!1}return this.clearFieldError(e),!0}catch(t){return this.setFieldError(e,t.message),!1}}setFieldError(e,t){this.errors[e]=t;const n=document.querySelector(`[data-error-for="${e}"]`);n&&(n.textContent=t,n.style.display="block",n.parentElement.classList.add("has-error"))}clearFieldError(e){delete this.errors[e];const t=document.querySelector(`[data-error-for="${e}"]`);t&&(t.textContent="",t.style.display="none",t.parentElement.classList.remove("has-error"))}handleSubmit(){const e=this.validate(),t=this.getData();return e&&this.options.onSubmit?this.options.onSubmit(t,this):!e&&this.options.onValidationError&&this.options.onValidationError(this.errors,this),{isValid:e,data:t,errors:this.errors}}_getFieldValue(e){const{type:t,name:n}=e;if("checkbox"===t){if(n.endsWith("[]")){const e=document.querySelectorAll(`input[name="${n}"]:checked`);return Array.from(e).map(e=>e.value)}return e.checked}if("radio"===t){const e=document.querySelector(`input[name="${n}"]:checked`);return e?e.value:null}return"number"===t||"range"===t?""===e.value?null:Number(e.value):e.value}_getFieldValueByName(e){if(this._choosers&&this._choosers[e])return this._choosers[e].getValue();if(this.formElement){const t=this.formElement.querySelector(`[name="${e}"]`);if(t)return this._getFieldValue(t)}return this.model?this.model.get(e):this.data[e]}_validateFieldValue(e,t,n){const s="chooser"===n.type?null==t||Array.isArray(t)&&0===t.length||""===t:null==t||""===t;if(n.required&&s)return{valid:!1,error:`${n.label||e} is required`};if(s)return{valid:!0};if("email"===n.type&&t){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return{valid:!1,error:"Please enter a valid email address"}}if("number"===n.type&&null!==t){const e=Number(t);if(isNaN(e))return{valid:!1,error:"Please enter a valid number"};if(void 0!==n.min&&e<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&e>n.max)return{valid:!1,error:`Value must be no more than ${n.max}`}}if("string"==typeof t){if(n.minLength&&t.length<n.minLength)return{valid:!1,error:`Must be at least ${n.minLength} characters`};if(n.maxLength&&t.length>n.maxLength)return{valid:!1,error:`Must be no more than ${n.maxLength} characters`}}if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:n.formConfig?.hint||"Invalid format"};if(n.validate&&"function"==typeof n.validate)try{const e=this.formElement?function(e){const t=new FormData(e),n={};for(const[e,s]of t.entries())n[e]?Array.isArray(n[e])?n[e].push(s):n[e]=[n[e],s]:n[e]=s;return e.querySelectorAll("input").forEach(e=>{"checkbox"!==e.type||e.checked?"checkbox"===e.type&&e.checked&&(n[e.name]="on"===e.value||e.value):n.hasOwnProperty(e.name)||(n[e.name]=!1)}),n}(this.formElement):this.data,s=n.validate(t,e);if(!0!==s)return{valid:!1,error:s||"Validation failed"}}catch(e){return{valid:!1,error:e.message||"Validation error"}}return{valid:!0}}}const mr={create:(e,t={},n={})=>new pr(e,t,n),render:(e,t,n={},s={})=>new pr(t,n,s).renderTo(e),wizard(e,t={}){if(!t.schema)throw new Error("Wizard options must include a schema with steps array");const{schema:{steps:n=[]},data:s={},...o}=t,i=`wizard-${Date.now()}`;let r=0,a={...s},l=null;const d="string"==typeof e?document.querySelector(e):e;if(!d)throw new Error(`Wizard target element not found: ${e}`);if(!Array.isArray(n)||0===n.length)throw new Error("Wizard schema must contain a non-empty steps array");function c(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const{name:n,type:s,value:o,checked:i}=e;if(n)if("checkbox"===s)if(n.endsWith("[]")){const e=n.slice(0,-2);t[e]||(t[e]=[]),i&&t[e].push(o)}else t[n]=i;else"radio"===s?i&&(t[n]=o):"number"===s||"range"===s?t[n]=""===o?null:Number(o):"SELECT"===e.tagName&&e.hasAttribute("multiple")?t[n]=Array.from(e.selectedOptions).map(e=>e.value).filter(e=>e):t[n]=o}),t}function h(){if(d.innerHTML=function(e){const t=n[e],s=new pr(t.fields,a,{...o,layout:t.layout||o.layout||"stacked",showSubmitButton:!1}),r=0===e,l=e===n.length-1;return`\n <div id="${i}" class="wizard">\n <div class="wizard-step active card" data-step="${e}">\n <div class="card-header wizard-header">\n <div class="wizard-progress mb-3">\n <div class="wizard-progress-bar" style="width: ${(e+1)/n.length*100}%"></div>\n </div>\n <div class="wizard-step-info">\n <h5 class="wizard-step-title card-title mb-2">${t.title}</h5>\n ${t.description?`<p class="wizard-step-description card-subtitle text-muted mb-2">${t.description}</p>`:""}\n <small class="text-muted">Step ${e+1} of ${n.length}</small>\n </div>\n </div>\n <div class="card-body wizard-content">\n ${s.render()}\n </div>\n <div class="card-footer wizard-nav d-flex justify-content-between">\n <button type="button" class="btn btn-secondary wizard-prev" ${r?'style="visibility: hidden;"':""}>\n ${o.prevText||"Previous"}\n </button>\n <button type="button" class="btn btn-primary wizard-${l?"submit":"next"}">\n ${l?o.finishText||"Finish":o.nextText||"Next"}\n </button>\n </div>\n </div>\n </div>\n `}(r),l=d.querySelector(`#${i}`),!l)return;const e=l.querySelector("form");if(e){new pr(n[r].fields,a,{...o,showSubmitButton:!1})._bindEvents(e)}const t=l.querySelector(".wizard-prev"),s=l.querySelector(".wizard-next"),u=l.querySelector(".wizard-submit");t&&t.addEventListener("click",e=>{e.preventDefault(),r>0&&(o.onStepChange&&o.onStepChange(r-1,a),r--,h())}),s&&s.addEventListener("click",t=>{t.preventDefault();const s=c(e);Object.assign(a,s);const i=new pr(n[r].fields,a,{...o,showSubmitButton:!1});i.formElement=e,i.setData(a);const l=i.validate();o.onValidation&&o.onValidation(l,i.errors||[],r),l&&r<n.length-1&&(o.onStepChange&&o.onStepChange(r+1,a),r++,h())}),u&&u.addEventListener("click",async t=>{t.preventDefault();const s=c(e);Object.assign(a,s);const i=new pr(n[r].fields,a,{...o,showSubmitButton:!1});i.formElement=e,i.setData(a);const l=i.validate();if(o.onValidation&&o.onValidation(l,i.errors||[],r),l&&o.onSubmit)try{await o.onSubmit(a,i)}catch(e){o.onError&&o.onError(e,a,i)}})}return n.forEach((e,t)=>{if(e.title||(e.title=`Step ${t+1}`),!e.fields)throw new Error(`Step ${t} is missing fields array`)}),h(),{nextStep:()=>{r<n.length-1&&(o.onStepChange&&o.onStepChange(r+1,a),r++,h())},prevStep:()=>{r>0&&(o.onStepChange&&o.onStepChange(r-1,a),r--,h())},goToStep:e=>{e>=0&&e<n.length&&(o.onStepChange&&o.onStepChange(e,a),r=e,h())},getCurrentStep:()=>r,getStepData:()=>({...a}),setStepData:e=>{Object.assign(a,e),h()},validate:()=>{const e=l?.querySelector("form");if(e){const t=new pr(n[r].fields,a,{...o,showSubmitButton:!1});return t.formElement=e,t.setData(a),t.validate()}return!0},getElement:()=>l}},modal(e,t={},n={}){const s=`form-${Date.now()}`;let o=null;const i=new pr(e,t,{...n,showSubmitButton:!1,onSubmit:async(e,t)=>{if(n.onSave)try{await n.onSave(e,t),!1!==n.closeOnSave&&o&&o.close()}catch(s){n.onError&&n.onError(s,e,t)}}}),r=`\n <div class="modal" id="modal-${s}" style="display: none;">\n <div class="modal-header">\n <h3 class="modal-title">${n.title||"Form"}</h3>\n <button type="button" class="modal-close" data-action="close">×</button>\n </div>\n <div class="modal-body">\n ${i.render()}\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-action="close">Cancel</button>\n <button type="button" class="btn btn-primary" data-action="save">${n.saveText||"Save"}</button>\n </div>\n </div>\n `,a=document.createElement("div");a.className="modal-backdrop",a.style.display="none";const l=document.createElement("div");l.innerHTML=r;const d=l.firstElementChild;return document.body.appendChild(a),document.body.appendChild(d),o={open(){a.style.display="block",d.style.display="block",setTimeout(()=>{a.classList.add("active"),d.classList.add("active")},10);const e=d.querySelector("form");e&&i._bindEvents(e),d.querySelectorAll('[data-action="close"]').forEach(e=>{e.addEventListener("click",()=>this.close())}),d.querySelector('[data-action="save"]').addEventListener("click",()=>{const e=d.querySelector("form");if(e){const t=new Event("submit",{cancelable:!0});e.dispatchEvent(t)}}),a.addEventListener("click",e=>{e.target===a&&this.close()})},close(){a.classList.remove("active"),d.classList.remove("active"),setTimeout(()=>{a.style.display="none",d.style.display="none",document.body.removeChild(a),document.body.removeChild(d)},300)},isOpen:()=>"none"!==d.style.display},o},crud(e){if(!e.schema)throw new Error("CRUD config must include a schema");if(!e.endpoint)throw new Error("CRUD config must include an API endpoint");const{schema:t,endpoint:n,tableSelector:s,title:o="Manage Items",primaryKey:i="id",displayField:r="name",headers:a={},onError:l=e=>console.error("CRUD Error:",e),onSuccess:d=e=>console.log("CRUD Success:",e)}=e;let h=null,u=[];return{async init(){await this.loadData(),this.createTable(),this.bindEvents()},async loadData(){try{window.Domma?.auth?.getApiUrl?.();const e=window.Domma?.auth?.token,t=e?{Authorization:`Bearer ${e}`}:{},s=await window.Domma.http.get(n,{headers:{...a,...t}});if(!s.success)throw new Error(s.message||"Failed to load data");u=s.data||[]}catch(e){throw l(e),e}},createTable(){if(!s)return;const e=Object.entries(t).map(([e,t])=>({key:e,title:t.label||(window.Domma?.utils||c).capitalize(e),sortable:!0,render:t.tableRender}));e.push({key:"actions",title:"Actions",sortable:!1,render:(e,t)=>{const n=window.Domma.icons.html("edit",{size:16,class:"inline-icon",colour:"var(--dm-info-light, #a5d8ff)",attrs:{style:"margin-right: 4px;"}}),s=window.Domma.icons.html("trash",{size:16,class:"inline-icon",colour:"var(--dm-danger-light, #ffacac)",attrs:{style:"margin-right: 4px;"}});return`\n <div class="btn-group btn-group-sm">\n <button class="btn btn-primary crud-edit-btn" data-id="${t[i]}">\n ${n}\n Edit\n </button>\n <button class="btn btn-danger crud-delete-btn" data-id="${t[i]}">\n ${s}\n Delete\n </button>\n </div>\n `}}),h=window.Domma.tables.create(s,{data:u,columns:e,pagination:!0,pageSize:25,striped:!0,selectable:!0,selectionMode:"multiple",exportPanel:!0,exportOptions:["text","csv","excel","json"],columnToggle:!0,regexSearch:!0,persistSettings:!0,storageKey:`domma-crud-${o.toLowerCase().replace(/\s+/g,"-")}`}),this.initializeTableIcons()},initializeTableIcons(){setTimeout(()=>{document.querySelectorAll("[data-icon]").forEach(e=>{const t=e.getAttribute("data-icon");if(window.Domma&&window.Domma.icons&&window.Domma.icons.render){const n=window.Domma.icons.render(t,{size:16,class:"inline-icon"});n&&(e.innerHTML="",e.appendChild(n))}})},100)},bindEvents(){const e=document.querySelector(".crud-add-btn");e&&e.addEventListener("click",()=>this.create()),document.addEventListener("click",e=>{if(e.target.matches(".crud-edit-btn")){const t=e.target.getAttribute("data-id");this.edit(t)}}),document.addEventListener("click",e=>{if(e.target.matches(".crud-delete-btn")){const t=e.target.getAttribute("data-id");this.delete(t)}});const t=document.querySelector(".crud-refresh-btn");t&&t.addEventListener("click",()=>this.refresh())},async create(){mr.modal(t,{},{title:`Create New ${o.slice(7)}`,size:"xl",saveText:"Create",showSubmitButton:!1,onSave:async e=>{try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},o=await window.Domma.http.post(n,e,{headers:{...a,...s}});if(!o.success)throw new Error(o.message||"Failed to create item");d("Item created successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async edit(e){const s=u.find(t=>t[i]==e);if(!s)return void l(new Error("Item not found"));mr.modal(t,s,{title:`Edit ${s[r]||"Item"}`,size:"xl",saveText:"Update",showSubmitButton:!1,onSave:async t=>{try{window.Domma?.auth?.getApiUrl?.();const s=window.Domma?.auth?.token,o=s?{Authorization:`Bearer ${s}`}:{},i=await window.Domma.http.put(`${n}/${e}`,t,{headers:{...a,...o}});if(!i.success)throw new Error(i.message||"Failed to update item");d("Item updated successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async delete(e){const t=u.find(t=>t[i]==e);if(!t)return void l(new Error("Item not found"));if(await window.Domma.elements.confirm(`Are you sure you want to delete "${t[r]||"this item"}"?\n\nThis action cannot be undone.`,{title:"Confirm Delete",confirmText:"Delete",cancelText:"Cancel",type:"warning"}))try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},o=await window.Domma.http.delete(`${n}/${e}`,{headers:{...a,...s}});if(!o.success)throw new Error(o.message||"Failed to delete item");d("Item deleted successfully"),await this.refresh()}catch(e){l(e)}},async refresh(){try{await this.loadData(),h&&(h.setData(u),this.initializeTableIcons())}catch(e){}},getData:()=>[...u],getTable:()=>h,addItem:e=>{u.push(e),h&&h.setData(u)},updateItem:(e,t)=>{const n=u.findIndex(t=>t[i]==e);-1!==n&&(u[n]={...u[n],...t},h&&h.setData(u))},removeItem:e=>{const t=u.findIndex(t=>t[i]==e);-1!==t&&(u.splice(t,1),h&&h.setData(u))}}}};function fr(e,t){if(![t.x,t.y,t.width,t.height].every(Number.isFinite)||t.width<=0||t.height<=0||t.alpha<=0)return;const n=Math.cos(t.flipPhase||0),s=t.width*(.12+.88*Math.abs(n)),o=Math.sin(t.curlPhase||0)*t.width*.32,i=-t.height/2,r=t.height/2;e.save(),e.globalAlpha*=t.alpha??1,e.translate(t.x,t.y),e.rotate(t.rotation||0),e.beginPath(),e.moveTo(-s/2,i),e.bezierCurveTo(-s/2+o,i+.3*t.height,-s/2-o,r-.3*t.height,-s/2,r),e.lineTo(s/2,r),e.bezierCurveTo(s/2-o,r-.3*t.height,s/2+o,i+.3*t.height,s/2,i),e.closePath(),e.fillStyle=t.colour,e.fill();const a=e.createLinearGradient(-s/2,i,s/2,r);a.addColorStop(0,n<0?"rgba(20,25,40,0.28)":"rgba(255,255,255,0.48)"),a.addColorStop(.42,"rgba(255,255,255,0.05)"),a.addColorStop(.7,"rgba(20,25,40,0.2)"),a.addColorStop(1,"rgba(255,255,255,0.3)"),e.fillStyle=a,e.fill(),e.beginPath(),e.moveTo(s/2,i),e.bezierCurveTo(s/2+o,i+.3*t.height,s/2-o,r-.3*t.height,s/2,r),e.strokeStyle="rgba(255,255,255,0.42)",e.lineWidth=.55,e.stroke(),e.restore()}function gr(e,t,n,s){const o=Math.cos(e.swayPhase);e.swayPhase+=e.swayFreq*s,e.x+=e.vx*s+(o-Math.cos(e.swayPhase))*n.sway,e.y+=e.vy*s,e.rotation+=e.rotationSpeed*s,e.flipPhase+=e.flipSpeed*s,e.curlPhase+=.025*s;const i=e.y/Math.max(1,t);e.alpha=i<n.fadeStart?1:Math.max(0,1-(i-n.fadeStart)/Math.max(.001,1-n.fadeStart)),(e.y-e.height>t||e.alpha<=.01)&&(e.alive=!1)}function vr(e,t){if(![t.x,t.y,t.size].every(Number.isFinite)||t.size<=0)return;const n=.12+.88*Math.abs(Math.sin(t.flapPhase||0));e.save(),e.translate(t.x,t.y),e.rotate((t.heading??-Math.PI/2)+Math.PI/2),e.scale(t.size/2.2,t.size/2.2),e.globalAlpha*=t.alpha??1,e.lineCap="round",e.lineJoin="round";const s=(t,n,s,o=.025)=>{e.beginPath();for(const[n,...s]of t)e[n](...s);n&&(e.fillStyle=n,e.fill()),s&&(e.strokeStyle=s,e.lineWidth=o,e.stroke())},o=(t,n,s,o,i)=>{e.beginPath(),e.ellipse(t,n,s,o,0,0,2*Math.PI),e.fillStyle=i,e.fill()};for(const i of[-1,1]){e.save(),e.scale(i*n,1);const r=e.createLinearGradient(0,0,1.1,-.8);r.addColorStop(0,"#504354"),r.addColorStop(.26,t.colourUpper||"#d891b4"),r.addColorStop(1,"#f5dabc");const a=e.createLinearGradient(0,0,.9,.7);a.addColorStop(0,"#63505d"),a.addColorStop(.35,t.colourLower||t.colourUpper||"#bd8fb3"),a.addColorStop(1,"#e8cbb6"),s([["moveTo",.045,-.04],["bezierCurveTo",.3,-.52,.73,-1.02,1.04,-.83],["bezierCurveTo",1.18,-.67,.91,-.13,.63,.03],["quadraticCurveTo",.32,.17,.045,-.04],["closePath"]],r,"#5b4a59",.035),s([["moveTo",.05,0],["bezierCurveTo",.52,-.05,.98,.2,.84,.54],["quadraticCurveTo",.74,.73,.52,.68],["quadraticCurveTo",.31,.87,.15,.54],["quadraticCurveTo",.03,.28,.05,0],["closePath"]],a,"#5b4a59",.035);for(const[e,t]of[[1.03,-.73],[.93,-.38],[.73,-.08],[.8,.37],[.61,.64],[.28,.67]])s([["moveTo",.08,0],["quadraticCurveTo",.53*e,.8*t,e,t]],null,"rgba(78,54,67,0.45)",.018);for(const[e,t,n]of[[.89,-.66,.04],[.87,-.47,.034],[.77,-.29,.03],[.69,.38,.035],[.55,.54,.03],[.35,.55,.028]])o(e,t,n,1.2*n,"#fff0d5");o(.48,-.33,.11,.14,"#69506c"),o(.48,-.33,.058,.075,"#e8c68f"),o(.45,.34,.085,.105,"rgba(90,65,86,0.65)"),e.restore()}o(0,.16,.052,.37,"#493f49"),o(0,-.12,.073,.15,"#5c4d56"),o(0,-.31,.072,.075,"#443a45");for(const e of[-1,1])s([["moveTo",.025*e,-.35],["quadraticCurveTo",.1*e,-.61,.2*e,-.56]],null,"#665362",.018),o(.2*e,-.56,.02,.025,"#d6b391");e.restore()}function br(e){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e)return 0;const t=parseFloat(e);return Number.isFinite(t)?e.endsWith("ms")?t:e.endsWith("s")?1e3*t:0:0}function _r(e,t){let n;if("string"==typeof e)n=Array.from(document.querySelectorAll(e));else if(e instanceof Element)n=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error(`[Domma.effects.${t}] Invalid selector`),null;n=Array.from(e)}return 0===n.length?(console.warn(`[Domma.effects.${t}] No elements found`),null):n}function yr(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const kr={club:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7},concert:{origins:["tl","tr"],motion:"sweep",sweepArc:120,speed:.8,beamWidth:18,flicker:!0,hz:6,colours:["#f43f5e","#fb923c","#facc15","#22c55e","#3b82f6"],intensity:.75},police:{origins:["tl","tr"],motion:"sweep",sweepArc:70,speed:2.2,beamWidth:22,flicker:!0,hz:8,colours:["#ef4444","#3b82f6"],intensity:.85},searchlight:{origins:["bl","br"],motion:"rotate",sweepArc:90,speed:.5,beamWidth:12,flicker:!1,hz:0,colours:["#fffbe6","#fde68a"],intensity:.6},scanner:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:60,speed:1.6,beamWidth:8,flicker:!1,hz:0,colours:["#22d3ee"],intensity:.7},mood:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:140,speed:.35,beamWidth:28,flicker:!1,hz:0,colours:["#a855f7","#6366f1","#ec4899","#38bdf8"],intensity:.45}};function wr(e,t){let n=String(e).replace("#","");3===n.length&&(n=n.split("").map(e=>e+e).join(""));return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}const xr={rainbow:["#ef4444","#f97316","#facc15","#22c55e","#0ea5e9","#6366f1","#a855f7","#ec4899"],festive:["#dc2626","#16a34a","#fbbf24","#3b82f6","#a855f7","#ec4899"],gold:["#fbbf24","#f59e0b","#fde68a","#fffbeb","#d97706","#fcd34d"],silver:["#e5e7eb","#cbd5e1","#94a3b8","#f8fafc","#9ca3af","#d1d5db"],pastel:["#fbcfe8","#bae6fd","#bbf7d0","#fef3c7","#ddd6fe","#fed7aa"],mono:["#1f2937","#4b5563","#9ca3af","#d1d5db","#f3f4f6"],sunset:["#f43f5e","#fb923c","#facc15","#f59e0b","#ec4899"],ocean:["#0ea5e9","#22d3ee","#06b6d4","#3b82f6","#6366f1"],forest:["#16a34a","#65a30d","#84cc16","#22c55e","#15803d"],bridal:["#ffffff","#fef3c7","#fce7f3","#fbcfe8","#f9a8d4"],meadow:["#84cc16","#a3e635","#bbf7d0","#bae6fd","#fef08a","#ddd6fe"],firefly:["#fde68a","#facc15","#f59e0b","#a3e635","#fef9c3"],aqua:["#a5f3fc","#67e8f9","#22d3ee","#bae6fd","#e0f2fe"],autumn:["#b45309","#d97706","#f59e0b","#ca8a04","#92400e","#dc2626"]};function Mr(e){if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e&&xr[e])return xr[e];if("theme"===e||!e){const e=document.documentElement,t=getComputedStyle(e),n=["--dm-primary","--dm-secondary","--dm-success","--dm-warning","--dm-danger","--dm-info"].map(e=>t.getPropertyValue(e).trim()).filter(e=>e&&"transparent"!==e);return n.length>0?n:xr.rainbow}return console.warn(`[Domma.effects] Unknown palette '${e}', using rainbow.`),xr.rainbow}const Lr=Mr;var Cr={breathe:function(e,t={}){const n={amplitude:6,duration:3e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,onStart:null,onComplete:null,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.breathe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.breathe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.breathe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-breathe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=`\n @keyframes ${o} {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-${n.amplitude}px);\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",o),r.textContent=i,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>{e.style.animationPlayState="paused"},n=()=>{e.style.animationPlayState="running"};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}if(n.onComplete&&"infinite"!==n.iterations){const t=()=>{n.onComplete(),e.removeEventListener("animationend",t)};e.addEventListener("animationend",t)}}),n.onStart&&n.onStart(),{pause(){s.forEach(e=>{e.style.animationPlayState="paused"})},resume(){s.forEach(e=>{e.style.animationPlayState="running"})},stop(){s.forEach(e=>{e.style.animation="none"})},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning(){if(0===s.length)return!1;const e=s[0];return"paused"!==e.style.animationPlayState&&"none"!==e.style.animation},isPaused:()=>0!==s.length&&"paused"===s[0].style.animationPlayState}},pulse:function(e,t={}){const n={scale:1.05,duration:2e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,respectMotionPreference:!0,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.pulse] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.pulse] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-pulse-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=`\n @keyframes ${o} {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(${n.scale});\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",o),r.textContent=i,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>e.style.animationPlayState="paused",n=()=>e.style.animationPlayState="running";e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>e.style.animation="none")},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning:()=>s.length>0&&"paused"!==s[0].style.animationPlayState&&"none"!==s[0].style.animation,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},scribe:function(e,t={}){const n={mode:"typewriter",speed:50,deleteSpeed:30,cursor:!0,cursorChar:"|",cursorBlink:!0,cursorType:"caret",loop:!1,loopDelay:1e3,pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,actions:[],onStart:null,onComplete:null,onCharacter:null,onRender:null,onUndoRender:null,onLoop:null,...t};let s;if("string"==typeof e)s=Array.from(document.querySelectorAll(e));else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.scribe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.scribe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){const e=n.actions.find(e=>void 0!==e.render);return e&&s.forEach(t=>{t.textContent=String(e.render)}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1}}const o="function"==typeof Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null,i=s.map(e=>({element:e,spans:[],cursor:null,action:0,task:null,frame:null,lastTime:null,elapsed:0,loops:0,lastRenderStart:0,started:!1,paused:!1,stopped:!1,destroyed:!1,hoverPaused:!1,hoverHandlers:null}));function r(e,t){e.cursor?.classList.toggle("dm-scribe-cursor-active",t)}function a(e){const t=e.parentElement;e.remove(),t?.classList.contains("dm-scribe-word-group")&&!t.childNodes.length&&t.remove()}function l(e){e.spans.forEach(a),e.spans=[],e.lastRenderStart=0}function d(e){null!==e.frame||!e.started||e.paused||e.stopped||e.destroyed||(e.frame=requestAnimationFrame(t=>function(e,t){if(e.frame=null,e.paused||e.stopped||e.destroyed)return;null!==e.lastTime&&(e.elapsed+=Math.min(t-e.lastTime,64));e.lastTime=t;let n=0;for(;n++<100&&!e.paused&&!e.stopped&&!e.destroyed&&(e.task||c(e),!(e.stopped||e.paused||e.destroyed));){const t=e.task;if("render"===t.type&&t.index>=t.units.length||"undo"===t.type&&t.deleted.length>=t.count)h(e);else{if(e.elapsed<t.duration)break;if(e.elapsed-=t.duration,"render"===t.type)u(e,t);else if("undo"===t.type){const n=e.spans.pop();t.deleted.push(n.textContent),a(n)}else h(e)}}d(e)}(e,t)))}function c(e){if(e.action>=n.actions.length)return r(e,!1),void(!0===n.loop||"number"==typeof n.loop&&e.loops<n.loop-1?e.task={type:"loop",duration:Math.max(0,n.loopDelay)}:(e.stopped=!0,r(e,!1),n.onComplete?.()));const t=n.actions[e.action];if(void 0!==t.render)e.lastRenderStart=e.spans.length,e.task={type:"render",text:String(t.render),units:(s=String(t.render),"word"===n.mode?s.match(/\s*\S+\s*|\s+/g)||[]:"sentence"===n.mode?s.match(/[^.!?]*[.!?]+\s*|[^.!?]+$/g)||[]:o?Array.from(o.segment(s),e=>e.segment):Array.from(s)),index:0,effect:t.effect||"none",duration:Math.max(0,n.speed)};else if(void 0!==t.undoRender){let s=0;!0===t.undoRender?s=e.spans.length-e.lastRenderStart:"all"===t.undoRender?s=e.spans.length:Number.isFinite(t.undoRender)&&(s=Math.floor(t.undoRender)),e.task={type:"undo",count:Math.max(0,Math.min(s,e.spans.length)),deleted:[],duration:Math.max(0,n.deleteSpeed)}}else e.task={type:"wait",duration:Math.max(0,br(t.wait))};var s;r(e,"render"===e.task.type||"undo"===e.task.type)}function h(e){const t=e.task;e.task=null,"loop"===t.type?(l(e),e.action=0,e.loops++,n.onLoop?.(e.loops)):(e.action++,"render"===t.type&&n.onRender?.(t.text),"undo"===t.type&&n.onUndoRender?.(t.deleted.reverse().join("")))}function u(e,t){const s=t.units[t.index++],o=document.createElement("span");if(o.className="word"===n.mode?"dm-scribe-word":"sentence"===n.mode?"dm-scribe-sentence":"dm-scribe-char",o.textContent=s,/^\s+$/.test(s)&&o.classList.add("dm-scribe-space"),["fade","bounce","glow"].includes(t.effect)){const e=`dm-scribe-${t.effect}`;o.classList.add(e),"sentence"===n.mode&&"bounce"===t.effect&&o.classList.add("dm-scribe-transform-unit"),o.addEventListener("animationend",()=>o.classList.remove(e),{once:!0})}if("typewriter"!==n.mode||/^\s+$/.test(s))e.element.insertBefore(o,e.cursor);else{const t=e.spans.at(-1);let n=t?.parentElement;n?.classList.contains("dm-scribe-word-group")||(n=document.createElement("span"),n.className="dm-scribe-word-group",e.element.insertBefore(n,e.cursor)),n.appendChild(o)}e.spans.push(o),n.onCharacter?.(s,e.spans.length-1)}function p(e){e.destroyed||e.stopped||(e.paused=!0,null!==e.frame&&cancelAnimationFrame(e.frame),e.frame=null,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState="paused"}),r(e,!1))}function m(e){if(e.destroyed||e.stopped||e.started&&!e.paused)return;const t=!e.started;e.started=!0,e.paused=!1,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState=""}),r(e,"render"===e.task?.type||"undo"===e.task?.type),t&&n.onStart?.(),d(e)}return i.forEach(e=>{if(n.cursor){const t=document.createElement("span"),s=["block","underline"].includes(n.cursorType)?n.cursorType:"caret";t.className=`dm-scribe-cursor dm-scribe-cursor-${s}`,n.cursorBlink||t.classList.add("dm-scribe-cursor-no-blink"),t.textContent="underline"===s?" ":n.cursorChar,t.setAttribute("aria-hidden","true"),e.cursor=t,e.element.appendChild(t)}n.pauseOnHover&&(e.hoverHandlers={enter:()=>{!e.started||e.paused||e.stopped||(e.hoverPaused=!0,p(e))},leave:()=>{e.hoverPaused&&(e.hoverPaused=!1,m(e))}},e.element.addEventListener("mouseenter",e.hoverHandlers.enter),e.element.addEventListener("mouseleave",e.hoverHandlers.leave)),n.autoStart&&m(e)}),{pause(){i.forEach(e=>{e.hoverPaused=!1,p(e)})},resume(){i.forEach(m)},stop(){i.forEach(e=>{p(e),e.paused=!1,e.stopped=!0,e.spans.forEach(e=>{e.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow"),e.style.animationPlayState=""}),r(e,!1)})},restart(){i.forEach(e=>{e.destroyed||(p(e),l(e),Object.assign(e,{action:0,task:null,elapsed:0,lastTime:null,loops:0,stopped:!1,started:!1}),m(e))})},destroy(){i.forEach(e=>{p(e),e.destroyed=!0,l(e),e.cursor?.remove(),e.hoverHandlers&&(e.element.removeEventListener("mouseenter",e.hoverHandlers.enter),e.element.removeEventListener("mouseleave",e.hoverHandlers.leave))})},isRunning:()=>i.some(e=>e.started&&!e.paused&&!e.stopped&&!e.destroyed),isPaused:()=>i.some(e=>e.paused&&!e.destroyed)}},reveal:function(e,t={}){const n={animation:"fade",duration:600,easing:"ease-out",delay:0,stagger:0,threshold:.1,rootMargin:"0px",once:!0,respectMotionPreference:!0,onReveal:null,...t},s=_r(e,"reveal");if(!s)return null;if(n.respectMotionPreference&&yr())return s.forEach(e=>{e.classList.add("dm-reveal-visible")}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};s.forEach((e,t)=>{e.classList.add("dm-reveal",`dm-reveal-${n.animation}`),e.style.transitionDuration=`${n.duration}ms`,e.style.transitionTimingFunction=n.easing;const s=n.delay+t*n.stagger;s>0&&(e.style.transitionDelay=`${s}ms`),n.respectMotionPreference||e.setAttribute("data-force-animation","true")});const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(e.target.classList.add("dm-reveal-visible"),n.onReveal&&n.onReveal(e.target),n.once&&o.unobserve(e.target)):n.once||e.target.classList.remove("dm-reveal-visible")})},{threshold:n.threshold,rootMargin:n.rootMargin});return s.forEach(e=>o.observe(e)),{pause(){},resume(){},stop(){o.disconnect()},restart(){s.forEach(e=>{e.classList.remove("dm-reveal-visible"),o.observe(e)})},destroy(){o.disconnect(),s.forEach(e=>{e.classList.remove("dm-reveal","dm-reveal-visible",`dm-reveal-${n.animation}`),e.style.transitionDuration="",e.style.transitionTimingFunction="",e.style.transitionDelay=""})},isRunning:()=>!0,isPaused:()=>!1}},scramble:function(e,t={}){const n={speed:50,scrambleSpeed:30,characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*",revealOrder:"left-to-right",scrambleDuration:800,stagger:0,loop:!1,loopDelay:2e3,respectMotionPreference:!0,onComplete:null,onCharacter:null,...t},s=_r(e,"scramble");if(!s)return null;if(n.respectMotionPreference&&yr())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=s.map((e,t)=>({element:e,originalText:e.textContent,rafId:null,timeoutId:null,paused:!1,loopCount:0}));function i(){return n.characters[Math.floor(Math.random()*n.characters.length)]}function r(e){if(e.paused)return;const t=e.originalText,s=t.length;if(0===s)return void(n.onComplete&&n.onComplete());const o=function(e,t){const n=Array.from({length:e},(e,t)=>t);switch(t){case"right-to-left":return n.reverse();case"random":for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n;case"center-out":{const t=Math.floor(e/2),n=[t];for(let s=1;s<=t;s++)t-s>=0&&n.push(t-s),t+s<e&&n.push(t+s);return n}default:return n}}(s,n.revealOrder),a=new Array(s).fill(!1),l=t.split("").map(e=>" "===e?" ":i()),d=performance.now(),c=n.speed;e.rafId=requestAnimationFrame(function h(u){if(e.paused)return;const p=u-d;o.forEach((e,s)=>{if(a[e])return;const o=n.scrambleDuration+s*c;p>=o&&(a[e]=!0,l[e]=t[e],n.onCharacter&&n.onCharacter(t[e],e))});for(let e=0;e<s;e++)a[e]||" "===t[e]||(l[e]=i());if(e.element.innerHTML=l.map((e,t)=>`<span class="dm-scramble-char${a[t]?" dm-scramble-resolved":""}">${e}</span>`).join(""),a.every(Boolean))return n.onComplete&&n.onComplete(),void function(e){if(!1===n.loop)return;if("number"==typeof n.loop&&e.loopCount>=n.loop-1)return;e.loopCount++,e.timeoutId=setTimeout(()=>{e.paused||r(e)},n.loopDelay)}(e);e.rafId=requestAnimationFrame(h)})}return o.forEach((e,t)=>{const s=t*n.stagger;s>0?e.timeoutId=setTimeout(()=>r(e),s):r(e)}),{pause(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){o.forEach(e=>{e.paused=!1,r(e)})},stop(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},restart(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.loopCount=0,r(e)})},destroy(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},isRunning:()=>o.length>0&&!o[0].paused,isPaused:()=>o.length>0&&o[0].paused}},counter:function(e,t={}){const n={from:0,to:null,duration:2e3,easing:"ease-out",decimals:0,separator:",",prefix:"",suffix:"",stagger:0,trigger:"immediate",threshold:.5,respectMotionPreference:!0,onUpdate:null,onComplete:null,...t},s=_r(e,"counter");if(!s)return null;if(n.respectMotionPreference&&yr())return s.forEach(e=>{const t=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;e.textContent=n.prefix+o(t,n.decimals,n.separator)+n.suffix}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};function o(e,t,n){const s=e.toFixed(t);if(!n)return s;const o=s.split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,n),o.join(".")}const i=s.map((e,t)=>{const s=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;return{element:e,from:n.from,to:s,rafId:null,timeoutId:null,startTime:null,paused:!1,complete:!1}});function r(e){e.paused||(e.startTime=performance.now(),e.complete=!1,e.rafId=requestAnimationFrame(function t(s){if(e.paused)return;const i=s-e.startTime,r=Math.min(i/n.duration,1),a=function(e){switch(n.easing){case"linear":return e;case"ease-in-out":return e<.5?2*e*e:(4-2*e)*e-1;default:return 1-Math.pow(1-e,3)}}(r),l=e.from+(e.to-e.from)*a;e.element.textContent=n.prefix+o(l,n.decimals,n.separator)+n.suffix,n.onUpdate&&n.onUpdate(l),r<1?e.rafId=requestAnimationFrame(t):(e.complete=!0,e.element.textContent=n.prefix+o(e.to,n.decimals,n.separator)+n.suffix,n.onComplete&&n.onComplete())}))}let a=null;function l(e,t){t>0?e.timeoutId=setTimeout(()=>r(e),t):r(e)}return"scroll"===n.trigger?(a=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const t=i.find(t=>t.element===e.target);if(t&&!t.complete){l(t,i.indexOf(t)*n.stagger)}a.unobserve(e.target)}})},{threshold:n.threshold}),s.forEach(e=>a.observe(e))):i.forEach((e,t)=>{l(e,t*n.stagger)}),{pause(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){i.forEach(e=>{e.paused&&!e.complete&&(e.paused=!1,r(e))})},stop(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},restart(){i.forEach((e,t)=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.complete=!1,l(e,t*n.stagger)})},destroy(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},isRunning:()=>i.length>0&&!i[0].paused&&!i[0].complete,isPaused:()=>i.length>0&&i[0].paused}},ripple:function(e,t={}){const n={colour:"rgba(255, 255, 255, 0.35)",duration:600,opacity:.35,unbounded:!1,centered:!1,trigger:"pointerdown",respectMotionPreference:!0,...t},s=_r(e,"ripple");if(!s)return null;if(n.respectMotionPreference&&yr())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o="domma-ripple-keyframes";if(!document.getElementById(o)){const e=document.createElement("style");e.id=o,e.textContent="\n @keyframes dm-ripple-expand {\n 0% {\n transform: scale(0);\n opacity: var(--dm-ripple-opacity, 0.35);\n }\n 100% {\n transform: scale(4);\n opacity: 0;\n }\n }\n ",document.head.appendChild(e)}const i=new Map;return s.forEach(e=>{e.classList.add("dm-ripple-container");"static"===getComputedStyle(e).position&&(e.style.position="relative"),n.unbounded||(e.style.overflow="hidden"),n.respectMotionPreference||e.setAttribute("data-force-animation","true");const t=t=>{const s=e.getBoundingClientRect(),o=2*Math.max(s.width,s.height);let i,r;n.centered?(i=s.width/2,r=s.height/2):(i=(t.clientX||t.touches?.[0]?.clientX||s.width/2)-s.left,r=(t.clientY||t.touches?.[0]?.clientY||s.height/2)-s.top);const a=document.createElement("span");a.className="dm-ripple",n.respectMotionPreference||a.setAttribute("data-force-animation","true"),a.style.cssText=`\n position: absolute;\n border-radius: 50%;\n pointer-events: none;\n width: ${o}px;\n height: ${o}px;\n left: ${i-o/2}px;\n top: ${r-o/2}px;\n background: ${n.colour};\n --dm-ripple-opacity: ${n.opacity};\n animation: dm-ripple-expand ${n.duration}ms ease-out forwards;\n `,e.appendChild(a),setTimeout(()=>{a.remove()},n.duration)};e.addEventListener(n.trigger,t),i.set(e,t)}),{pause(){},resume(){},stop(){},restart(){},destroy(){s.forEach(e=>{i.has(e)&&(e.removeEventListener(n.trigger,i.get(e)),i.delete(e)),e.classList.remove("dm-ripple-container"),e.querySelectorAll(".dm-ripple").forEach(e=>e.remove())})},isRunning:()=>!0,isPaused:()=>!1}},shake:function(e,t={}){const n={intensity:6,duration:500,direction:"horizontal",easing:"ease-in-out",iterations:1,stagger:0,respectMotionPreference:!0,onComplete:null,...t},s=_r(e,"shake");if(!s)return null;if(n.respectMotionPreference&&yr())return n.onComplete&&n.onComplete(),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-shake-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=n.intensity;let r;switch(n.direction){case"vertical":r=`\n 0%, 100% { transform: translateY(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateY(-${i}px); }\n 20%, 40%, 60%, 80% { transform: translateY(${i}px); }\n `;break;case"both":r=`\n 0%, 100% { transform: translate(0, 0); }\n 10% { transform: translate(-${i}px, -${i}px); }\n 20% { transform: translate(${i}px, ${i}px); }\n 30% { transform: translate(-${i}px, ${i}px); }\n 40% { transform: translate(${i}px, -${i}px); }\n 50% { transform: translate(-${i}px, 0); }\n 60% { transform: translate(${i}px, 0); }\n 70% { transform: translate(0, -${i}px); }\n 80% { transform: translate(0, ${i}px); }\n 90% { transform: translate(-${i}px, -${i}px); }\n `;break;default:r=`\n 0%, 100% { transform: translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateX(-${i}px); }\n 20%, 40%, 60%, 80% { transform: translateX(${i}px); }\n `}const a=document.createElement("style");a.setAttribute("data-domma-effect",o),a.textContent=`@keyframes ${o} { ${r} }`,document.head.appendChild(a);const l=new Map;return s.forEach((e,t)=>{const i=t*n.stagger,r=()=>{e.style.animation=`${o} ${n.duration}ms ${n.easing} ${n.iterations}`;const i=()=>{e.style.animation="",e.removeEventListener("animationend",i),l.delete(e),n.onComplete&&t===s.length-1&&n.onComplete()};e.addEventListener("animationend",i),l.set(e,i)};i>0?setTimeout(r,i):r()}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))})},restart(){s.forEach((e,t)=>{e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${n.iterations}`})},destroy(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))}),a.remove()},isRunning:()=>s.length>0&&""!==s[0].style.animation&&"paused"!==s[0].style.animationPlayState,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},twinkle:function(e,t={}){const n={count:100,minSize:1,maxSize:3,twinkleSpeed:.003,colour:"rgba(255, 240, 200, 1)",zIndex:1,shape:"star",respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.twinkle] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.twinkle] No elements found for selector:",e),null;let i=!1,r=!1,a=null;const l=`domma-twinkle-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,d=[];function c(e,t){const s=[];for(let o=0;o<n.count;o++)s.push({x:Math.random()*e,y:Math.random()*t,size:n.minSize+Math.random()*(n.maxSize-n.minSize),opacity:.3+.7*Math.random(),twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:n.twinkleSpeed+Math.random()*n.twinkleSpeed});return s}function h(e,t){const s=document.createElement("canvas");if(s.id=l+(d.length>0?`-${d.length}`:""),s.setAttribute("data-domma-effect","twinkle"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const o=s.getContext("2d");return{canvas:s,ctx:o,stars:c(s.width,s.height),container:e}}function u(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}e.stars=c(e.canvas.width,e.canvas.height)}if(s){const e=h(document.body,!0);e.isFixed=!0,d.push(e)}else o.forEach(e=>{const t=h(e,!1);t.isFixed=!1,d.push(t)});let p=null;if(s){const e=()=>d.forEach(e=>u(e));window.addEventListener("resize",e),d[0]._resizeHandler=e}else"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(()=>{d.forEach(e=>u(e))}),o.forEach(e=>p.observe(e)));function m(){i&&!r&&(d.forEach(({canvas:e,ctx:t,stars:s})=>{t.clearRect(0,0,e.width,e.height),s.forEach(e=>function(e,t){t.twinklePhase+=t.twinkleSpeed;const s=.3+.7*Math.sin(t.twinklePhase);if(e.save(),e.globalAlpha=t.opacity*s,e.fillStyle=n.colour,e.shadowColor=n.colour,"circle"===n.shape)e.shadowBlur=2*t.size,e.beginPath(),e.arc(t.x,t.y,.6*t.size,0,2*Math.PI),e.fill();else{e.shadowBlur=2*t.size,e.beginPath();for(let n=0;n<4;n++){const s=n*Math.PI/2,o=t.x+Math.cos(s)*t.size,i=t.y+Math.sin(s)*t.size,r=s+Math.PI/4,a=t.x+Math.cos(r)*(.3*t.size),l=t.y+Math.sin(r)*(.3*t.size);0===n?e.moveTo(o,i):e.lineTo(o,i),e.lineTo(a,l)}e.closePath(),e.fill(),e.shadowBlur=t.size,e.beginPath(),e.arc(t.x,t.y,.25*t.size,0,2*Math.PI),e.fill()}e.restore()}(t,e))}),a=requestAnimationFrame(m))}function f(){i||(i=!0,r=!1,m())}return f(),console.log(`[Domma.effects.twinkle] Initialised with ${n.count} stars (${s?"full-page":"container"} mode)`),{pause(){i&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){i&&r&&(r=!1,m())},stop(){i=!1,r=!1,a&&(cancelAnimationFrame(a),a=null)},restart(){this.stop(),d.forEach(e=>{e.stars=c(e.canvas.width,e.canvas.height)}),f()},destroy(){this.stop(),s&&d[0]?._resizeHandler&&window.removeEventListener("resize",d[0]._resizeHandler),p&&(p.disconnect(),p=null),d.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),d.length=0},isRunning:()=>i&&!r,isPaused:()=>i&&r}},tickerTape:function(e,t={}){const n={palette:"theme",density:50,speed:1,sway:60,rotationSpeed:6,minWidth:5,maxWidth:9,minHeight:12,maxHeight:22,fadeStart:.55,burst:!1,burstCount:150,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.tickerTape] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.tickerTape] No elements found for selector:",e),null;const i=Lr(n.palette);let r=!1,a=!1,l=null;const d=`domma-ticker-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null,u=null;function p(e,t,s){const o=n.minWidth+Math.random()*(n.maxWidth-n.minWidth),r=n.minHeight+Math.random()*(n.maxHeight-n.minHeight);return{x:Math.random()*e,y:s?-r-40*Math.random():Math.random()*-t,vy:(1+2.2*Math.random())*n.speed,vx:.4*(Math.random()-.5)*n.speed,swayPhase:Math.random()*Math.PI*2,swayFreq:.005+.01*Math.random(),width:o,height:r,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*n.rotationSpeed*Math.PI/180,flipPhase:Math.random()*Math.PI*2,flipSpeed:.018+.035*Math.random(),curlPhase:Math.random()*Math.PI*2,alpha:1,colour:i[Math.floor(Math.random()*i.length)],alive:!0}}function m(e,t){const s=document.createElement("canvas");if(s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","ticker-tape"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const o=s.getContext("2d"),i={canvas:s,ctx:o,particles:[],container:e,isFixed:t,burstFired:!1};return g(i),i}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++){const t=p(e.width,e.height,!1);t.y=-Math.random()*e.height*1.5,e.particles.push(t)}e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(p(e.width,e.height,!1))}}function g(e){const t=e.isFixed?{width:window.innerWidth,height:window.innerHeight}:e.container.getBoundingClientRect();e.width=t.width||e.container.offsetWidth||1,e.height=t.height||e.container.offsetHeight||1;const n=Math.min(window.devicePixelRatio||1,3);e.canvas.width=Math.round(e.width*n),e.canvas.height=Math.round(e.height*n),e.ctx.setTransform(n,0,0,n,0,0)}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),c.push(e);const t=()=>c.forEach(e=>g(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>{c.forEach(e=>g(e))}),o.forEach(e=>h.observe(e)));function v(e=performance.now()){if(!r||a)return;const t=null===u?1:Math.min(3,Math.max(0,(e-u)/(1e3/60)));u=e,c.forEach(e=>{const{canvas:s,ctx:o,particles:i}=e;o.clearRect(0,0,e.width,e.height);for(let s=i.length-1;s>=0;s--){const r=i[s];gr(r,e.height,n,t),r.alive?fr(o,r):i.splice(s,1)}if(!n.burst){const t=n.density;for(;i.length<t&&Math.random()<.6;)i.push(p(e.width,e.height,!0))}}),l=requestAnimationFrame(v)}function b(){r||(r=!0,a=!1,u=null,v())}return b(),console.log(`[Domma.effects.tickerTape] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,u=null,v())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),c.forEach(e=>f(e)),b()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},butterflies:function(e,t={}){const n={palette:"meadow",density:18,speed:1,wander:1,riseSpeed:.4,flapSpeed:1,minSize:14,maxSize:26,twoTone:!0,burst:!1,burstCount:40,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.butterflies] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.butterflies] No elements found for selector:",e),null;const i=Mr(n.palette);let r=!1,a=!1,l=null;const d=`domma-butterflies-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null;function u(e,t){const s=n.minSize+Math.random()*(n.maxSize-n.minSize),o=Math.random();let r,a;o<.6?(r=Math.random()*e,a=t+s):o<.8?(r=-s,a=t*(.4+.6*Math.random())):(r=e+s,a=t*(.4+.6*Math.random()));const l=-Math.PI/2+1.2*(Math.random()-.5),d=i[Math.floor(Math.random()*i.length)],c=n.twoTone?i[Math.floor(Math.random()*i.length)]:d;return{x:r,y:a,heading:l,targetHeading:l,speed:.6+.8*Math.random(),wanderTimer:60*Math.random(),flapPhase:Math.random()*Math.PI*2,flapSpeed:(.18+.12*Math.random())*n.flapSpeed,size:s,colourUpper:d,colourLower:c,alpha:1,alive:!0}}function p(e,t,s){e.wanderTimer-=1,e.wanderTimer<=0&&(e.targetHeading=-Math.PI/2+(Math.random()-.5)*(1.4*n.wander),e.wanderTimer=30+Math.random()*(60/Math.max(.2,n.wander)));let o=e.targetHeading-e.heading;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;e.heading+=.05*o*n.wander;const i=e.speed*n.speed;e.x+=Math.cos(e.heading)*i+.3*Math.sin(e.flapPhase),e.y+=Math.sin(e.heading)*i-n.riseSpeed*n.speed,e.flapPhase+=e.flapSpeed,(e.y+e.size<0||e.y-e.size>2*s||e.x<3*-e.size||e.x>t+3*e.size)&&(e.alive=!1)}function m(e,t){const s=document.createElement("canvas");s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","butterflies"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const o=s.getContext("2d");return{canvas:s,ctx:o,particles:[],container:e,burstFired:!1}}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++)e.particles.push(u(e.canvas.width,e.canvas.height));e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(u(e.canvas.width,e.canvas.height))}}function g(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),c.push(e);const t=()=>c.forEach(e=>g(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>c.forEach(e=>g(e))),o.forEach(e=>h.observe(e)));function v(){r&&!a&&(c.forEach(e=>{const{canvas:t,ctx:s,particles:o}=e;s.clearRect(0,0,t.width,t.height);for(let e=o.length-1;e>=0;e--){const n=o[e];p(n,t.width,t.height),n.alive?vr(s,n):o.splice(e,1)}if(!n.burst)for(;o.length<n.density&&Math.random()<.3;)o.push(u(t.width,t.height))}),l=requestAnimationFrame(v))}function b(){r||(r=!0,a=!1,v())}return b(),console.log(`[Domma.effects.butterflies] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,v())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),c.forEach(e=>f(e)),b()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},strobe:function(e,t={}){const n={preset:"club",origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7,duration:null,zIndex:9999,respectMotionPreference:!0,...function(e){return kr[e]?kr[e]:(console.warn(`[Domma.effects.strobe] Unknown preset '${e}', using 'club'.`),kr.club)}(t.preset||"club"),...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.strobe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};n.flicker&&n.hz>5&&console.warn(`[Domma.effects.strobe] flicker hz=${n.hz} exceeds 5Hz - rapid flashing can trigger photosensitive seizures.`);const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.strobe] No elements found for selector:",e),null;let i=!1,r=!1,a=null,l=null;const d=`domma-strobe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null;function u(){return n.origins.map((e,t)=>({corner:e,colour:n.colours[t%n.colours.length],phase:t/Math.max(1,n.origins.length)*Math.PI*2}))}const p=[{widthMul:1.9,alphaMul:.16},{widthMul:1,alphaMul:.5},{widthMul:.45,alphaMul:1}];function m(e,t){const s=document.createElement("canvas");s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","strobe"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const o=s.getContext("2d");return{canvas:s,ctx:o,container:e,beams:u()}}function f(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,c.push(e);const t=()=>c.forEach(e=>f(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>c.forEach(e=>f(e))),o.forEach(e=>h.observe(e)));function g(){if(!i||r)return;let e=1;if(n.flicker){const t=.5+.5*Math.sin(("undefined"!=typeof performance&&performance.now?performance.now():Date.now())/1e3*n.hz*Math.PI*2);e=.4+.6*t}c.forEach(t=>{const{canvas:s,ctx:o,beams:i}=t,r=s.width,a=s.height;o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, 0.14)",o.fillRect(0,0,r,a),o.globalCompositeOperation="lighter";const l=r/2,d=a/2;i.forEach(t=>{const{x:s,y:i}=function(e,t,n){switch(e){case"tr":return{x:t,y:0};case"bl":return{x:0,y:n};case"br":return{x:t,y:n};default:return{x:0,y:0}}}(t.corner,r,a);let c;if("rotate"===n.motion)c=t.phase,t.phase+=.01*n.speed;else{c=Math.atan2(d-i,l-s)+Math.sin(t.phase)*(n.sweepArc*Math.PI/180)/2,t.phase+=.02*n.speed}!function(e,t,s,o,i,r,a,l){const d=1.5*Math.hypot(r,a),c=n.beamWidth*Math.PI/180/2;for(let r=0;r<p.length;r++){const a=p[r],h=c*a.widthMul,u=n.intensity*a.alphaMul*l;if(u<=.003)continue;const m=t+Math.cos(o-h)*d,f=s+Math.sin(o-h)*d,g=t+Math.cos(o+h)*d,v=s+Math.sin(o+h)*d,b=e.createRadialGradient(t,s,0,t,s,d);b.addColorStop(0,wr(i,u)),b.addColorStop(.4,wr(i,.4*u)),b.addColorStop(1,wr(i,0)),e.fillStyle=b,e.beginPath(),e.moveTo(t,s),e.lineTo(m,f),e.lineTo(g,v),e.closePath(),e.fill()}}(o,s,i,c,t.colour,r,a,e)}),o.globalCompositeOperation="source-over"}),a=requestAnimationFrame(g)}function v(){i||(i=!0,r=!1,g(),n.duration&&(l=setTimeout(()=>b.stop(),n.duration)))}const b={pause(){i&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){i&&r&&(r=!1,g())},stop(){i=!1,r=!1,a&&(cancelAnimationFrame(a),a=null),l&&(clearTimeout(l),l=null),c.forEach(({canvas:e,ctx:t})=>t&&t.clearRect(0,0,e.width,e.height))},restart(){this.stop(),c.forEach(e=>{e.beams=u()}),v()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>i&&!r,isPaused:()=>i&&r};return v(),console.log(`[Domma.effects.strobe] Initialised (${s?"full-page":"container"} mode, preset: ${n.preset})`),b}};const Er={_configs:new Map,_components:new Map,_eventHandlers:new Map,_initCallbacks:[],_domReady:!1,_autoWrap:!0,process(e,t={}){if(!e||"object"!=typeof e)return;(void 0!==t.autoWrap?t.autoWrap:this._autoWrap)&&!this._domReady&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,this._processConfig(e)},{once:!0}):this._processConfig(e)},_processConfig(e){e.$init&&"function"==typeof e.$init&&(this._initCallbacks.push(e.$init),e.$init(),delete e.$init),Object.keys(e).forEach(t=>{const n=e[t];if(this._configs.set(t,c.cloneDeep(n)),n.init&&"function"==typeof n.init){const e=l(t);n.init.call(e,e)}const s=l(t);if(n.component){const e=this.initComponent(t,n.component,n.options||{});e&&this._components.set(t,e)}n.initial&&this.applyProperties(s,n.initial),n.events&&this.bindEvents(t,n.events,!0)})},update(e,t){const n=this._configs.get(e);if(!n)return this.process({[e]:t}),this._configs.get(e);const s=c.merge({},n,t);this._configs.set(e,s);const o=l(e);if(t.options&&this._components.has(e)){const n=this._components.get(e);n&&"function"==typeof n.setOptions&&n.setOptions(t.options)}return t.initial&&this.applyProperties(o,t.initial),t.events&&this.updateEvents(e,t.events),s},config(e){if(!e){const e={};return this._configs.forEach((t,n)=>{e[n]=t}),e}return this._configs.get(e)||null},getComponent(e){return e?this._components.get(e)||null:new Map(this._components)},reset(e){if(!e){return void Array.from(this._configs.keys()).forEach(e=>this.reset(e))}const t=this._components.get(e);t&&"function"==typeof t.destroy&&t.destroy(),this._components.delete(e),this.unbindEvents(e),this._configs.delete(e)},initComponent(e,t,n){const s={card:ln.card,modal:ln.modal,tabs:ln.tabs,accordion:ln.accordion,tooltip:ln.tooltip,carousel:ln.carousel,dropdown:ln.dropdown,contextMenu:ln.contextMenu,sortable:ln.sortable,skeleton:ln.skeleton,avatar:ln.avatar,avatarGroup:ln.avatarGroup,inputGroup:ln.inputGroup,popover:ln.popover,badge:ln.badge,numberBadge:ln.numberBadge,listGroup:ln.listGroup,cookieConsent:ln.cookieConsent,backToTop:ln.backToTop,buttonGroup:ln.buttonGroup,loader:ln.loader,breadcrumbs:ln.breadcrumbs,navbar:ln.navbar,sidebar:ln.sidebar,footer:ln.footer,notification:ln.notification,timer:ln.timer,alarm:ln.alarm,autocomplete:ln.autocomplete,pillbox:ln.pillbox,signature:ln.signature,form:mr.create,breathe:Cr.breathe,pulse:Cr.pulse,scribe:Cr.scribe}[t];if(s){if("form"===t){if(!n.schema)return console.error("Forms component requires a schema option"),null;const t=s(n.schema,n.data||{},n);return t.renderTo(e),t}return s.call(ln,e,n)}console.warn(`Unknown component type: ${t}`)},applyProperties(e,t){Object.keys(t).forEach(n=>{"css"===n?e.css(t[n]):"text"===n?e.text(t[n]):"html"===n?e.html(t[n]):"addClass"===n?e.addClass(t[n]):"removeClass"===n?e.removeClass(t[n]):"toggleClass"===n?e.toggleClass(t[n]):"attr"===n&&Object.keys(t[n]).forEach(s=>{e.attr(s,t[n][s])})})},bindEvents(e,t,n=!1){const s=l(e);n&&!this._eventHandlers.has(e)&&this._eventHandlers.set(e,new Map),Object.keys(t).forEach(o=>{const i=t[o],r=e=>this.executeActions(e,i);s.on(o,r),n&&this._eventHandlers.get(e).set(o,r)})},unbindEvents(e){const t=this._eventHandlers.get(e);if(!t)return;const n=l(e);t.forEach((e,t)=>{n.off(t,e)}),this._eventHandlers.delete(e)},updateEvents(e,t){const n=this._eventHandlers.get(e),s=l(e);n&&Object.keys(t).forEach(e=>{n.has(e)&&(s.off(e,n.get(e)),n.delete(e))}),this.bindEvents(e,t,!0)},executeActions(e,t){if("function"==typeof t)return void t.call(e.target,e,l(e.target));const n=Array.isArray(t)?t:[t],s=l(e.target);n.forEach(t=>{if("function"==typeof t)return void t.call(e.target,e,s);const n=t.target?l(t.target):s;t.css&&n.css(t.css),t.text&&n.text(t.text),t.html&&n.html(t.html),t.addClass&&n.addClass(t.addClass),t.removeClass&&n.removeClass(t.removeClass),t.toggleClass&&n.toggleClass(t.toggleClass),t.log&&console.log(t.log)})},ready(e){"function"==typeof e?this._domReady||"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,e()},{once:!0}):console.warn("ready() requires a function")}},Ar=1e3,Sr=6e4,$r=36e5,zr=864e5,jr=6048e5,Br=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Tr=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Dr=["January","February","March","April","May","June","July","August","September","October","November","December"],Wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];class Hr{constructor(e){e instanceof Hr?this._date=new Date(e._date):e instanceof Date?this._date=new Date(e):this._date="string"==typeof e||"number"==typeof e?new Date(e):null==e?new Date:new Date(e)}add(e,t){const n=this._normalizeUnit(t),s=this._date;return"years"===n?s.setFullYear(s.getFullYear()+e):"months"===n?s.setMonth(s.getMonth()+e):"weeks"===n?s.setDate(s.getDate()+7*e):"days"===n?s.setDate(s.getDate()+e):"hours"===n?s.setHours(s.getHours()+e):"minutes"===n?s.setMinutes(s.getMinutes()+e):"seconds"===n?s.setSeconds(s.getSeconds()+e):"milliseconds"===n&&s.setMilliseconds(s.getMilliseconds()+e),this}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(0,1),n.setHours(0,0,0,0)):"months"===t||"month"===t?(n.setDate(1),n.setHours(0,0,0,0)):"weeks"===t||"week"===t?(n.setDate(n.getDate()-n.getDay()),n.setHours(0,0,0,0)):"days"===t||"day"===t?n.setHours(0,0,0,0):"hours"===t||"hour"===t?n.setMinutes(0,0,0):"minutes"===t||"minute"===t?n.setSeconds(0,0):"seconds"!==t&&"second"!==t||n.setMilliseconds(0),this}endOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(11,31),n.setHours(23,59,59,999)):"months"===t||"month"===t?(n.setMonth(n.getMonth()+1,0),n.setHours(23,59,59,999)):"weeks"===t||"week"===t?(n.setDate(n.getDate()+(6-n.getDay())),n.setHours(23,59,59,999)):"days"===t||"day"===t?n.setHours(23,59,59,999):"hours"===t||"hour"===t?n.setMinutes(59,59,999):"minutes"===t||"minute"===t?n.setSeconds(59,999):"seconds"!==t&&"second"!==t||n.setMilliseconds(999),this}set(e,t){const n=this._normalizeUnit(e),s=this._date;return"years"===n||"year"===n?s.setFullYear(t):"months"===n||"month"===n?s.setMonth(t):"days"===n||"day"===n||"date"===n?s.setDate(t):"hours"===n||"hour"===n?s.setHours(t):"minutes"===n||"minute"===n?s.setMinutes(t):"seconds"===n||"second"===n?s.setSeconds(t):"milliseconds"!==n&&"millisecond"!==n||s.setMilliseconds(t),this}get(e){if(!e)return this._date;const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?n.getFullYear():"months"===t||"month"===t?n.getMonth():"days"===t||"day"===t?n.getDay():"date"===t?n.getDate():"hours"===t||"hour"===t?n.getHours():"minutes"===t||"minute"===t?n.getMinutes():"seconds"===t||"second"===t?n.getSeconds():"milliseconds"===t||"millisecond"===t?n.getMilliseconds():this._date}year(){return this._date.getFullYear()}month(){return this._date.getMonth()}date(){return this._date.getDate()}day(){return this._date.getDay()}hour(){return this._date.getHours()}minute(){return this._date.getMinutes()}second(){return this._date.getSeconds()}millisecond(){return this._date.getMilliseconds()}dayOfYear(){const e=new Date(this._date.getFullYear(),0,0),t=this._date-e;return Math.floor(t/864e5)}week(){const e=new Date(this._date.getFullYear(),0,1),t=this._date-e;return Math.ceil(t/6048e5+e.getDay()/7)}quarter(){return Math.floor(this._date.getMonth()/3)+1}unix(){return Math.floor(this._date.getTime()/1e3)}valueOf(){return this._date.getTime()}format(e="YYYY-MM-DD HH:mm:ss"){const t=this._date,n=t.getFullYear(),s=t.getMonth(),o=t.getDate(),i=t.getDay(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),d=t.getMilliseconds(),c=r%12||12,h=(e,t=2)=>String(e).padStart(t,"0"),u={YYYY:n,YY:String(n).slice(-2),MMMM:Dr[s],MMM:Wr[s],MM:h(s+1),M:s+1,dddd:Br[i],ddd:Tr[i],DD:h(o),D:o,HH:h(r),H:r,hh:h(c),h:c,mm:h(a),m:a,ss:h(l),s:l,SSS:h(d,3),A:r<12?"AM":"PM",a:r<12?"am":"pm"},p=Object.keys(u).sort((e,t)=>t.length-e.length),m=new RegExp(p.join("|"),"g");return e.replace(m,e=>u[e])}toISOString(){return this._date.toISOString()}toDate(){return new Date(this._date)}toString(){return this._date.toString()}fromNow(e){const t=e?new Hr(e)._date:new Date,n=this._date.getTime()-t.getTime(),s=Math.abs(n),o=n<0;let i,r;return s<Sr?"just now":(s<$r?(i=Math.floor(s/Sr),r=1===i?"minute":"minutes"):s<zr?(i=Math.floor(s/$r),r=1===i?"hour":"hours"):s<jr?(i=Math.floor(s/zr),r=1===i?"day":"days"):s<30*zr?(i=Math.floor(s/jr),r=1===i?"week":"weeks"):s<365*zr?(i=Math.floor(s/(30*zr)),r=1===i?"month":"months"):(i=Math.floor(s/(365*zr)),r=1===i?"year":"years"),o?`${i} ${r} ago`:`in ${i} ${r}`)}to(e){const t=new Hr(e)._date.getTime()-this._date.getTime(),n=Math.abs(t),s=t>0;let o,i;return n<Sr?"just now":(n<$r?(o=Math.floor(n/Sr),i=1===o?"minute":"minutes"):n<zr?(o=Math.floor(n/$r),i=1===o?"hour":"hours"):n<jr?(o=Math.floor(n/zr),i=1===o?"day":"days"):n<30*zr?(o=Math.floor(n/jr),i=1===o?"week":"weeks"):n<365*zr?(o=Math.floor(n/(30*zr)),i=1===o?"month":"months"):(o=Math.floor(n/(365*zr)),i=1===o?"year":"years"),s?`in ${o} ${i}`:`${o} ${i} ago`)}isBefore(e,t){const n=new Hr(e);return t?this.clone().endOf(t).valueOf()<n.clone().startOf(t).valueOf():this._date.getTime()<n._date.getTime()}isAfter(e,t){const n=new Hr(e);return t?this.clone().startOf(t).valueOf()>n.clone().endOf(t).valueOf():this._date.getTime()>n._date.getTime()}isSame(e,t){const n=new Hr(e);if(!t)return this._date.getTime()===n._date.getTime();const s=this.clone().startOf(t).valueOf(),o=this.clone().endOf(t).valueOf(),i=n.valueOf();return i>=s&&i<=o}isBetween(e,t,n,s="()"){const o=new Hr(e),i=new Hr(t);let r,a,l;n?(r=o.clone().startOf(n).valueOf(),a=i.clone().endOf(n).valueOf(),l=this.clone().startOf(n).valueOf()):(r=o.valueOf(),a=i.valueOf(),l=this.valueOf());const d="["===s[0],c="]"===s[1];return(d?l>=r:l>r)&&(c?l<=a:l<a)}diff(e,t="milliseconds",n=!1){const s=new Hr(e),o=this._date.getTime()-s._date.getTime(),i=this._normalizeUnit(t);let r;return r="milliseconds"===i?o:"seconds"===i?o/Ar:"minutes"===i?o/Sr:"hours"===i?o/$r:"days"===i?o/zr:"weeks"===i?o/jr:"months"===i?this._monthDiff(s):"years"===i?this._monthDiff(s)/12:o,n?r:Math.floor(r)}_monthDiff(e){const t=this._date,n=e._date;return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())}isValid(){return!isNaN(this._date.getTime())}isLeapYear(){const e=this._date.getFullYear();return e%4==0&&e%100!=0||e%400==0}daysInMonth(){return new Date(this._date.getFullYear(),this._date.getMonth()+1,0).getDate()}clone(){return new Hr(this._date)}_normalizeUnit(e){if(!e)return e;const t=String(e).toLowerCase().trim();return"year"===t?"years":"month"===t?"months":"week"===t?"weeks":"day"===t?"days":"hour"===t?"hours":"minute"===t?"minutes":"second"===t?"seconds":"millisecond"===t?"milliseconds":t}}const Or=function(e){return new Hr(e)};Object.assign(Or,{now:()=>Date.now(),parse(e,t){if(!t)return new Hr(e);const n={YYYY:{regex:"(\\d{4})",setter:"year"},YY:{regex:"(\\d{2})",setter:"year",transform:e=>2e3+parseInt(e)},MM:{regex:"(\\d{2})",setter:"month",transform:e=>parseInt(e)-1},M:{regex:"(\\d{1,2})",setter:"month",transform:e=>parseInt(e)-1},DD:{regex:"(\\d{2})",setter:"date"},D:{regex:"(\\d{1,2})",setter:"date"},HH:{regex:"(\\d{2})",setter:"hour"},H:{regex:"(\\d{1,2})",setter:"hour"},mm:{regex:"(\\d{2})",setter:"minute"},m:{regex:"(\\d{1,2})",setter:"minute"},ss:{regex:"(\\d{2})",setter:"second"},s:{regex:"(\\d{1,2})",setter:"second"}};let s=t;const o=[],i=Object.keys(n).sort((e,t)=>t.length-e.length);for(const e of i)if(t.includes(e)){-1!==s.indexOf(e)&&(s=s.replace(e,n[e].regex),o.push({token:e,...n[e]}))}s=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,e=>"("===e||")"===e?e:"\\"+e);try{const t=new RegExp("^"+s+"$"),n=e.match(t);if(!n)return new Hr(NaN);const i=new Hr;i.set("hour",0).set("minute",0).set("second",0).set("millisecond",0);for(let e=0;e<o.length;e++){let t=parseInt(n[e+1]);o[e].transform&&(t=o[e].transform(n[e+1])),i.set(o[e].setter,t)}return i}catch(e){return new Hr(NaN)}},isValid:e=>new Hr(e).isValid(),min(...e){const t=e.flat().map(e=>new Hr(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()<n.valueOf()&&(n=t[e]);return n},max(...e){const t=e.flat().map(e=>new Hr(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()>n.valueOf()&&(n=t[e]);return n},tokens:{YYYY:"Full year (2025)",YY:"Short year (25)",MM:"Month 01-12",M:"Month 1-12",DD:"Day 01-31",D:"Day 1-31",HH:"Hour 00-23",H:"Hour 0-23",hh:"Hour 01-12",h:"Hour 1-12",mm:"Minute 00-59",m:"Minute 0-59",ss:"Second 00-59",s:"Second 0-59",SSS:"Milliseconds",A:"AM/PM",a:"am/pm",ddd:"Day name short (Mon)",dddd:"Day name full (Monday)",MMM:"Month name short (Jan)",MMMM:"Month name full (January)"}});const Ir={"arrow-up":{viewBox:"0 0 24 24",path:"M12 19V5M5 12l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down":{viewBox:"0 0 24 24",path:"M12 5v14M19 12l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-left":{viewBox:"0 0 24 24",path:"M19 12H5M12 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-right":{viewBox:"0 0 24 24",path:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-left":{viewBox:"0 0 24 24",path:"M17 17L7 7M7 17V7h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-right":{viewBox:"0 0 24 24",path:"M7 17L17 7M7 7h10v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-left":{viewBox:"0 0 24 24",path:"M17 7L7 17M17 17H7V7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-right":{viewBox:"0 0 24 24",path:"M7 7l10 10M17 7v10H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},menu:{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h18","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"menu-alt":{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h12","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"dots-horizontal":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},"dots-vertical":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},grid:{viewBox:"0 0 24 24",path:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},list:{viewBox:"0 0 24 24",paths:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},columns:{viewBox:"0 0 24 24",path:"M12 3v18M3 3h18v18H3V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zM9 21V9m12-6H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},close:{viewBox:"0 0 24 24",path:"M18 6L6 18M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plus:{viewBox:"0 0 24 24",path:"M12 5v14M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minus:{viewBox:"0 0 24 24",path:"M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},search:{viewBox:"0 0 24 24",path:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},refresh:{viewBox:"0 0 24 24",path:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},edit:{viewBox:"0 0 24 24",path:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-2":{viewBox:"0 0 24 24",path:"M17 3a2.85 2.85 0 114 4L7.5 20.5 2 22l1.5-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-3":{viewBox:"0 0 24 24",path:"M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trash:{viewBox:"0 0 24 24",path:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filter:{viewBox:"0 0 24 24",path:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sort:{viewBox:"0 0 24 24",paths:["M3 6h7","M3 12h5","M3 18h3","M16 6l4 4-4 4","M20 10H10"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},user:{viewBox:"0 0 24 24",path:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},users:{viewBox:"0 0 24 24",path:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},settings:{viewBox:"0 0 24 24",path:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM15 12a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cog:{viewBox:"0 0 24 24",path:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tool:{viewBox:"0 0 24 24",path:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eye:{viewBox:"0 0 24 24",path:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-off":{viewBox:"0 0 24 24",path:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lock:{viewBox:"0 0 24 24",path:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlock:{viewBox:"0 0 24 24",path:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clock:{viewBox:"0 0 24 24",path:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calendar:{viewBox:"0 0 24 24",path:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},star:{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-filled":{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",fill:"currentColor"},sun:{viewBox:"0 0 24 24",path:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},globe:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},map:{viewBox:"0 0 24 24",path:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pin:{viewBox:"0 0 24 24",path:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},feather:{viewBox:"0 0 24 24",path:"M20.24 12.24a6 6 0 00-8.49-8.49L5 10.5V19h8.5zM16 8L2 22M17.5 15H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},palette:{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c.93 0 1.68-.75 1.68-1.68 0-.43-.16-.84-.44-1.13-.27-.29-.43-.7-.43-1.13 0-.93.76-1.69 1.69-1.69h1.98c3.03 0 5.52-2.49 5.52-5.52C22 6.48 17.52 2 12 2zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z",fill:"currentColor"},type:{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},square:{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mouse-pointer":{viewBox:"0 0 24 24",path:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z M13 13l6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"refresh-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sync:{viewBox:"0 0 24 24",path:"M1 4v6h6m16 10v-6h-6M2 20l6-6M22 4l-6 6M9 12l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gauge:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 0110 10c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z M8 12l4 4 4-4M12 16V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"map-pin":{viewBox:"0 0 24 24",path:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"help-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sliders:{viewBox:"0 0 24 24",path:"M4 21v-7m0-4V3m8 18v-9m0-4V3m8 18v-5m0-4V3M1 14h6m2-6h6m2 8h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-check":{viewBox:"0 0 24 24",path:"M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2m16-13l2 2 4-4M13 7a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},component:{viewBox:"0 0 24 24",path:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16zM3.27 6.96L12 12.01l8.73-5.05M12 22.08V12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 9.8a19.79 19.79 0 01-3.07-8.64A2 2 0 012 .18h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 14v2.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mail:{viewBox:"0 0 24 24",path:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z M22 6l-10 7L2 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2z M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},building:{viewBox:"0 0 24 24",path:"M3 21h18 M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16 M9 9h2 M9 13h2 M9 17h2 M13 9h2 M13 13h2 M13 17h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-2":{viewBox:"0 0 24 24",path:"M15 7h3a5 5 0 015 5 5 5 0 01-5 5h-3m-6 0H6a5 5 0 01-5-5 5 5 0 015-5h3 M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 11-8 0 4 4 0 018 0z M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cake:{viewBox:"0 0 24 24",path:"M20 21H4a2 2 0 01-2-2v-4a2 2 0 012-2h16a2 2 0 012 2v4a2 2 0 01-2 2z M8 13V9 M12 13V9 M16 13V9 M8 9a1 1 0 010-2 1 1 0 010 2z M12 9a1 1 0 010-2 1 1 0 010 2z M16 9a1 1 0 010-2 1 1 0 010 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sidebar:{viewBox:"0 0 24 24",path:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z M9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},window:{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2z M2 9h20 M5.5 6.5h.01 M8 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Nr={mail:{viewBox:"0 0 24 24",path:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mail-open":{viewBox:"0 0 24 24",path:"M3 19V9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2z M3 9l9 6 9-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},inbox:{viewBox:"0 0 24 24",path:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},send:{viewBox:"0 0 24 24",path:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-incoming":{viewBox:"0 0 24 24",path:"M14.5 2v6m0 0h6m-6 0l7-7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-outgoing":{viewBox:"0 0 24 24",path:"M21.5 2h-6m6 0v6m0-6l-7 7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M16.5 10.5l5.5-5.5M22 5l-5.5 5.5M10.68 13.31a16 16 0 003.41 2.6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7 2 2 0 011.72 2v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},chat:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chat-alt":{viewBox:"0 0 24 24",path:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-circle":{viewBox:"0 0 24 24",path:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-square":{viewBox:"0 0 24 24",path:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bell:{viewBox:"0 0 24 24",path:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bell-off":{viewBox:"0 0 24 24",path:"M13.73 21a2 2 0 01-3.46 0M18.63 13A17.89 17.89 0 0118 8M6.26 6.26A5.86 5.86 0 006 8c0 7-3 9-3 9h14M18 8a6 6 0 00-9.33-5M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},notification:{viewBox:"0 0 24 24",path:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z",fill:"currentColor"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},paperclip:{viewBox:"0 0 24 24",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rss:{viewBox:"0 0 24 24",path:"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0116 16M5 20a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wifi:{viewBox:"0 0 24 24",path:"M12 20h.01M2 8.82a15 15 0 0120 0M5 12.859a10 10 0 0114 0M8.5 16.429a5 5 0 017 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"wifi-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0119 12.55M5 12.55a10.94 10.94 0 015.17-2.39m3.64.46a10.88 10.88 0 012.69 1.92M8.5 16.429a5 5 0 013.5-1.43M12 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Pr={play:{viewBox:"0 0 24 24",path:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-filled":{viewBox:"0 0 24 24",path:"M5 3l14 9-14 9V3z",fill:"currentColor"},pause:{viewBox:"0 0 24 24",path:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pause-filled":{viewBox:"0 0 24 24",paths:["M6 4h4v16H6z","M14 4h4v16h-4z"],fill:"currentColor"},stop:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"stop-filled":{viewBox:"0 0 24 24",path:"M6 6h12v12H6z",fill:"currentColor"},"skip-back":{viewBox:"0 0 24 24",path:"M19 20L9 12l10-8v16zM5 19V5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"skip-forward":{viewBox:"0 0 24 24",path:"M5 4l10 8-10 8V4zM19 5v14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rewind:{viewBox:"0 0 24 24",path:"M11 19l-7-7 7-7m8 14l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"fast-forward":{viewBox:"0 0 24 24",path:"M13 5l7 7-7 7M5 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volume:{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-up":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-down":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-mute":{viewBox:"0 0 24 24",path:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-off":{viewBox:"0 0 24 24",path:"M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"camera-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M21 21H3a2 2 0 01-2-2V8a2 2 0 012-2h3m3-3h6l2 3h4a2 2 0 012 2v9.34m-7.72-2.06a4 4 0 11-5.56-5.56",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},video:{viewBox:"0 0 24 24",path:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"video-off":{viewBox:"0 0 24 24",path:"M16 16v1a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h2m5.66 0H14a2 2 0 012 2v3.34l1 1L23 7v10M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},image:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},images:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z M9 3h12a2 2 0 012 2v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},music:{viewBox:"0 0 24 24",path:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mic:{viewBox:"0 0 24 24",path:"M19 10v2a7 7 0 01-14 0v-2m7 9v4m-4 0h8m-4-13a3 3 0 00-3 3v4a3 3 0 006 0v-4a3 3 0 00-3-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mic-off":{viewBox:"0 0 24 24",path:"M1 1l22 22m-2-2a10 10 0 01-11 2.955M12 19v4m-4 0h8M9 9v3a3 3 0 005.12 2.12M15 9.34V4a3 3 0 00-5.94-.6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0118 0v6M21 19a2 2 0 01-2 2h-1a2 2 0 01-2-2v-3a2 2 0 012-2h3zM3 19a2 2 0 002 2h1a2 2 0 002-2v-3a2 2 0 00-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},radio:{viewBox:"0 0 24 24",path:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0 M16.24 7.76a6 6 0 010 8.49m-8.48-.01a6 6 0 010-8.49m11.31-2.82a10 10 0 010 14.14m-14.14 0a10 10 0 010-14.14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},film:{viewBox:"0 0 24 24",path:"M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM17 3l-5 4-5-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cast:{viewBox:"0 0 24 24",path:"M2 16.1A5 5 0 015.9 20M2 12.05A9 9 0 019.95 20M2 8V6a2 2 0 012-2h16a2 2 0 012 2v12a2 2 0 01-2 2h-6M2 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximise:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimise:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximize:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimize:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximise-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimise-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximize-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimize-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scissors:{viewBox:"0 0 24 24",path:"M6 9a3 3 0 100-6 3 3 0 000 6zM6 21a3 3 0 100-6 3 3 0 000 6zM20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M10 8l6 4-6 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Vr={document:{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-text":{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z M14 2v6h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-remove":{viewBox:"0 0 24 24",path:"M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m2 11H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},folder:{viewBox:"0 0 24 24",path:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-open":{viewBox:"0 0 24 24",path:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h6a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-remove":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},download:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},upload:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-download":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-upload":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M8 19c-3.314 0-6-2.462-6-5.5S4.686 8 8 8c.642-2.87 3.251-5 6.375-5C18.086 3 21 5.91 21 9.5a6.458 6.458 0 01-.705 2.945A4.5 4.5 0 0119 21H8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},attachment:{viewBox:"0 0 24 24",path:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},copy:{viewBox:"0 0 24 24",path:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clipboard:{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-check":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-list":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},save:{viewBox:"0 0 24 24",path:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},archive:{viewBox:"0 0 24 24",path:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-code":{viewBox:"0 0 24 24",path:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-zip":{viewBox:"0 0 24 24",path:"M17 21H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2zM10 3v4h1V3h-1zm1 4h-1v2h1V7zm-1 2v2h1V9h-1zm1 2h-1v2h1v-2zm-1 2v2h1v-2h-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},server:{viewBox:"0 0 24 24",path:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-text":{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zM14 2v6h6M16 13H8M16 17H8M10 9H8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},book:{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-open":{viewBox:"0 0 24 24",path:"M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2V3zM22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-closed":{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-plus":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-minus":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Fr={share:{viewBox:"0 0 24 24",path:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"share-alt":{viewBox:"0 0 24 24",path:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",fill:"currentColor"},bookmark:{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bookmark-filled":{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",fill:"currentColor"},"thumb-up":{viewBox:"0 0 24 24",path:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thumb-down":{viewBox:"0 0 24 24",path:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},comment:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-add":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-plus":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-remove":{viewBox:"0 0 24 24",path:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-group":{viewBox:"0 0 24 24",path:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-happy":{viewBox:"0 0 24 24",path:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-sad":{viewBox:"0 0 24 24",path:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},flag:{viewBox:"0 0 24 24",path:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M12 15V17M8 21H16M8 3H16V9C16 11.2091 14.2091 13 12 13C9.79086 13 8 11.2091 8 9V3ZM16 5H18C19.1046 5 20 5.89543 20 7V8C20 9.10457 19.1046 10 18 10H16M8 5H6C4.89543 5 4 5.89543 4 7V8C4 9.10457 4.89543 10 6 10H8M12 17V21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",path:"M12 8V21M12 8H8.464C7.103 8 6 6.897 6 5.536C6 4.175 7.103 3 8.464 3C10.059 3 11.162 4.162 12 5.536M12 8H15.536C16.897 8 18 6.897 18 5.536C18 4.175 16.897 3 15.536 3C13.941 3 12.838 4.162 12 5.536M20 12V21H4V12M3 8H21V12H3V8Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sparkles:{viewBox:"0 0 24 24",path:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fire:{viewBox:"0 0 24 24",path:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z M9.879 16.121A3 3 0 1012.015 11L11 14H9c0 .768.293 1.536.879 2.121z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},github:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"},twitter:{viewBox:"0 0 24 24",path:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",fill:"currentColor"},linkedin:{viewBox:"0 0 24 24",path:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",fill:"currentColor"},youtube:{viewBox:"0 0 24 24",path:"M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",fill:"currentColor"},"share-2":{viewBox:"0 0 24 24",path:"M18 8a3 3 0 100-6 3 3 0 000 6zM6 15a3 3 0 100-6 3 3 0 000 6zM18 22a3 3 0 100-6 3 3 0 000 6zM8.59 13.51l6.83 3.98M15.41 6.51l-6.82 3.98",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},facebook:{viewBox:"0 0 24 24",path:"M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},instagram:{viewBox:"0 0 24 24",path:"M2 7a5 5 0 015-5h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5zM16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zM17.5 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Rr={cart:{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cart-add":{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0zm6-8v-2m0 0V7m0 2h2m-2 0H11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-bag":{viewBox:"0 0 24 24",path:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M3 3h18v4H3V3zM3 7v12a2 2 0 002 2h14a2 2 0 002-2V7M3 11h18M12 7v14M8 11v10M16 11v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2m-5-3h9m0 0l-3-3m3 3l-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cash:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-dollar":{viewBox:"0 0 24 24",path:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-pound":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h6a3 3 0 003-3M9 12h6M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-euro":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h3a3 3 0 003-3M7 10h5m-5 4h5M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tag:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tags:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z M17 17l4.414-4.414a2 2 0 000-2.828L14 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M9 14l6 0M9 10l6 0M9 18l3 0M5 21l1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2V3l-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2v18z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barcode:{viewBox:"0 0 24 24",path:"M5 7v10M8 7v10M11 7v10M14 7v10M19 7v10M17 7v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},qrcode:{viewBox:"0 0 24 24",path:"M3 3h6v6H3V3zM15 3h6v6h-6V3zM3 15h6v6H3v-6zM15 15h2v2h-2v-2zM19 15h2v2h-2v-2zM15 19h2v2h-2v-2zM19 19h2v2h-2v-2zM5 5h2v2H5V5zM17 5h2v2h-2V5zM5 17h2v2H5v-2zM12 3h1v4h-1V3zM12 9h1v3h-1V9zM3 12h4v1H3v-1zM9 12h3v1H9v-1zM12 14h1v3h-1v-3zM12 19h1v2h-1v-2z",fill:"currentColor"},percent:{viewBox:"0 0 24 24",path:"M9 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM15 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM19 5L5 19",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},package:{viewBox:"0 0 24 24",path:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4M9 4l3 1.5L15 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},box:{viewBox:"0 0 24 24",path:"M12 3L2 8.5V15.5L12 21L22 15.5V8.5L12 3ZM12 12V21M12 12L2 7M12 12L22 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shipping:{viewBox:"0 0 24 24",path:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2M4 7V4h16v3M4 7h16M8 4v3M16 4v3M12 11v4m-2-2h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zM8 6h8v4H8V6zM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gem:{viewBox:"0 0 24 24",path:"M6 3h12l4 6-10 12L2 9l4-6z M11 3L8 9l4 12 4-12-3-6 M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-cart":{viewBox:"0 0 24 24",path:"M9 22a1 1 0 100-2 1 1 0 000 2z M20 22a1 1 0 100-2 1 1 0 000 2z M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},qr={check:{viewBox:"0 0 24 24",path:"M5 13l4 4L19 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"},"check-square":{viewBox:"0 0 24 24",path:"M9 11l3 3L22 4M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},x:{viewBox:"0 0 24 24",path:"M6 18L18 6M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",fill:"currentColor"},warning:{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"warning-filled":{viewBox:"0 0 24 24",path:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z",fill:"currentColor"},"alert-warning":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},info:{viewBox:"0 0 24 24",path:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"info-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z",fill:"currentColor"},question:{viewBox:"0 0 24 24",path:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},exclamation:{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-circle":{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ban:{viewBox:"0 0 24 24",path:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shield:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-x":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m5.618-6.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},spinner:{viewBox:"0 0 24 24",path:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-5.364l-2.828 2.828M9.464 14.536l-2.828 2.828m11.728 0l-2.828-2.828M9.464 9.464L6.636 6.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},loading:{viewBox:"0 0 24 24",path:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},loader:{viewBox:"0 0 24 24",path:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},circle:{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"circle-filled":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",fill:"currentColor"},dot:{viewBox:"0 0 24 24",path:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",fill:"currentColor"},badge:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zap:{viewBox:"0 0 24 24",path:"M13 10V3L4 14h7v7l9-11h-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18M17 6h6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6M17 18h6v-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},key:{viewBox:"0 0 24 24",path:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-alert":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-triangle":{viewBox:"0 0 24 24",path:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z M12 9v4 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ur={"chevron-up":{viewBox:"0 0 24 24",path:"M5 15l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-down":{viewBox:"0 0 24 24",path:"M19 9l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-left":{viewBox:"0 0 24 24",path:"M15 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-right":{viewBox:"0 0 24 24",path:"M9 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-up":{viewBox:"0 0 24 24",path:"M17 11l-5-5-5 5M17 18l-5-5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-down":{viewBox:"0 0 24 24",path:"M7 13l5 5 5-5M7 6l5 5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-left":{viewBox:"0 0 24 24",path:"M11 17l-5-5 5-5M18 17l-5-5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-right":{viewBox:"0 0 24 24",path:"M13 7l5 5-5 5M6 7l5 5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"external-link":{viewBox:"0 0 24 24",path:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},link:{viewBox:"0 0 24 24",path:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlink:{viewBox:"0 0 24 24",path:"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 00-.12-7.07 5.006 5.006 0 00-6.95 0l-1.72 1.71M5.17 11.75l-1.71 1.71a5.004 5.004 0 00.12 7.07 5.006 5.006 0 006.95 0l1.71-1.71M8 2v3M2 8h3M16 22v-3M22 16h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-left":{viewBox:"0 0 24 24",path:"M9 14L4 9l5-5M20 20v-7a4 4 0 00-4-4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-right":{viewBox:"0 0 24 24",path:"M15 14l5-5-5-5M4 20v-7a4 4 0 014-4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-left":{viewBox:"0 0 24 24",path:"M9 10L4 15l5 5M20 4v7a4 4 0 01-4 4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-right":{viewBox:"0 0 24 24",path:"M15 10l5 5-5 5M4 4v7a4 4 0 004 4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-ccw":{viewBox:"0 0 24 24",path:"M1 4v6h6M23 20v-6h-6M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M3 13l4.64-4.36A9 9 0 0121 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M21 13l-4.64-4.36A9 9 0 003 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},move:{viewBox:"0 0 24 24",path:"M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"grip-vertical":{viewBox:"0 0 24 24",paths:["M9 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},"grip-horizontal":{viewBox:"0 0 24 24",paths:["M5 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M5 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},expand:{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shrink:{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-in":{viewBox:"0 0 24 24",path:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-out":{viewBox:"0 0 24 24",path:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-left":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM9 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-right":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM15 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-left":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-right":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM15 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-top":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 9h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-bottom":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 15h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layers:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM2 9h20M9 20V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hash:{viewBox:"0 0 24 24",path:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"more-horizontal":{viewBox:"0 0 24 24",path:"M12 12h.01M8 12h.01M16 12h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"},"more-vertical":{viewBox:"0 0 24 24",path:"M12 12h.01M12 8h.01M12 16h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}},Kr={tree:{viewBox:"0 0 24 24",path:"M12 2l2 4h-1l2 4h-1.5l2.5 5h-2l3 6H7l3-6H8l2.5-5H9l2-4h-1l2-4zm-1 19h2v3h-2v-3z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"star-decoration":{viewBox:"0 0 24 24",path:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",paths:["M12 2v20M2 12h20","M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07","M12 6l-2 2 2 2 2-2-2-2zM12 14l-2 2 2 2 2-2-2-2z","M6 12l2-2-2-2-2 2 2 2zM14 12l2 2 2-2-2-2-2 2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",paths:["M20 12v10H4V12","M22 7H2v5h20V7z","M12 22V7","M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z","M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"candy-cane":{viewBox:"0 0 24 24",path:"M14.5 3a4.5 4.5 0 0 0-4.5 4.5v13a.5.5 0 0 0 1 0V7.5a3.5 3.5 0 1 1 7 0v1a2.5 2.5 0 0 1-5 0v-.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bauble:{viewBox:"0 0 24 24",paths:["M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M12 6V3","M9 3h6","M12 6a1 1 0 0 0 1-1V4a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},bells:{viewBox:"0 0 24 24",paths:["M9 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M15 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M7 8L5 4M17 8l2-4M9 8V5M15 8V5","M11 5h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},holly:{viewBox:"0 0 24 24",paths:["M8 4c-2 2-3 5-1 8 1 2 3 3 5 3s4-1 5-3c2-3 1-6-1-8","M16 4c2 2 3 5 1 8-1 2-3 3-5 3s-4-1-5-3c-2-3-1-6 1-8","M10 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M14 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M12 19a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowman:{viewBox:"0 0 24 24",paths:["M12 22a5 5 0 1 0 0-10 5 5 0 0 0 0 10z","M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M9 9h.01M15 9h.01","M10 10.5s.5 1 2 1 2-1 2-1","M7 2l3 3M17 2l-3 3M12 2v3","M5 15h2M17 15h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},reindeer:{viewBox:"0 0 24 24",paths:["M12 22c-3 0-5-2-5-5 0-2 1-4 3-5l2-1 2 1c2 1 3 3 3 5 0 3-2 5-5 5z","M7 12c-2-1-3-3-3-5 0-1 .5-2 1-2s1 .5 1.5 1c.5.5 1 1.5 1.5 2","M17 12c2-1 3-3 3-5 0-1-.5-2-1-2s-1 .5-1.5 1c-.5.5-1 1.5-1.5 2","M4 5l1 2M3 7l2 1M20 5l-1 2M21 7l-2 1","M10 17h.01M14 17h.01","M12 19a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},sleigh:{viewBox:"0 0 24 24",paths:["M4 15h14c1 0 2 1 2 2v1H4v-3z","M6 15V8c0-1 1-2 2-2h8c1 0 2 1 2 2v7","M2 20c0-1 2-2 4-2h12c2 0 4 1 4 2","M3 18h1M20 18h1"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},wreath:{viewBox:"0 0 24 24",paths:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 2v2M12 20v2M2 12h2M20 12h2","M10 3l1 2M13 3l-1 2","M10 3h4"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"party-popper":{viewBox:"0 0 24 24",paths:["M5.8 11.3 2 22l10.7-3.79","M4 3h.01","M22 8h.01","M15 2h.01","M22 20h.01","M22 2 19.79 7.3 16 8l3.79.79L22 14","M9.6 14.4 14 10","M22 13c-1.93 1.93-5.07 1.93-7 0","M11 8c1.93-1.93 1.93-5.07 0-7","M2 13c1.93 1.93 5.07 1.93 7 0"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}},Yr={sun:{viewBox:"0 0 24 24",path:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunrise:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 2v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M8 6l4-4 4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunset:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 9v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M16 5l-4 4-4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-sun":{viewBox:"0 0 24 24",path:"M12 2v2M4.93 4.93l1.41 1.41M2 12h2M19 12a4 4 0 0 0-4-4h-.35A5.5 5.5 0 0 0 4 11a5 5 0 0 0 0 10h11a4 4 0 0 0 4-5v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-off":{viewBox:"0 0 24 24",path:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rain:{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-rain":{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-drizzle":{viewBox:"0 0 24 24",path:"M8 19v2M8 13v2M16 19v2M16 13v2M12 21v2M12 15v2M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snow:{viewBox:"0 0 24 24",path:"M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25M8 16h.01M8 20h.01M12 18h.01M12 22h.01M16 16h.01M16 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",path:"M12 2v20M17.66 7l-11.32 10M20.54 12H3.46M17.66 17L6.34 7M12 2l3 3M12 2l-3 3M12 22l3-3M12 22l-3-3M2 12l3 3M2 12l3-3M22 12l-3 3M22 12l-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wind:{viewBox:"0 0 24 24",path:"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-lightning":{viewBox:"0 0 24 24",path:"M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9M13 11l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lightning:{viewBox:"0 0 24 24",path:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fog:{viewBox:"0 0 24 24",path:"M20 15h2M2 15h8M6 19h14M4 11h16M8 7h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},haze:{viewBox:"0 0 24 24",path:"M12 3v1M12 20v1M3 12h1M20 12h1M5.6 5.6l.7.7M17.7 17.7l.7.7M5.6 18.4l.7-.7M17.7 6.3l.7-.7M8 12a4 4 0 1 0 8 0 4 4 0 0 0-8 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thermometer:{viewBox:"0 0 24 24",path:"M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-sun":{viewBox:"0 0 24 24",path:"M12 9a4 4 0 0 0-2 7.5M12 3v2M5.6 5.6l1.4 1.4M3 12h2M5.6 18.4l1.4-1.4M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 10V3M16 14.76V8a2 2 0 0 0-4 0v6.76",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"moon-star":{viewBox:"0 0 24 24",path:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9zM19 3v4M17 5h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},umbrella:{viewBox:"0 0 24 24",path:"M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplet:{viewBox:"0 0 24 24",path:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplets:{viewBox:"0 0 24 24",path:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05zM12.56 14.94c1.47 0 2.67-1.25 2.67-2.77 0-.8-.38-1.55-1.14-2.18-.76-.64-1.17-1.32-1.38-2.29-.21.97-.62 1.65-1.38 2.29-.76.63-1.14 1.38-1.14 2.18 0 1.52 1.19 2.77 2.67 2.77zM19.5 17.35c1.1 0 2-.93 2-2.08 0-.6-.29-1.17-.86-1.64-.57-.48-.88-1-.57-1.73-.31.73-.62 1.25-1.19 1.73-.57.47-.86 1.04-.86 1.64 0 1.15.9 2.08 2 2.08z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rainbow:{viewBox:"0 0 24 24",path:"M22 17a10 10 0 0 0-20 0M18 17a6 6 0 0 0-12 0M14 17a2 2 0 0 0-4 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Gr={smartphone:{viewBox:"0 0 24 24",path:"M17 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-call":{viewBox:"0 0 24 24",path:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91M23 1L1 23",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tablet:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tablet-smartphone":{viewBox:"0 0 24 24",path:"M18 2H10a2 2 0 0 0-2 2v4M14 22h4a2 2 0 0 0 2-2V8M8 14H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM7 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laptop:{viewBox:"0 0 24 24",path:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0l1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monitor:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},desktop:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4M2 12h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM17 2l-5 5-5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tv-minimal":{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},watch:{viewBox:"0 0 24 24",path:"M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM12 9v3l1.5 1.5M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},smartwatch:{viewBox:"0 0 24 24",path:"M18 8a6 6 0 0 0-12 0v8a6 6 0 0 0 12 0V8zM12 11v3M18 6l1-3H5l1 3M18 18l1 3H5l1-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},speaker:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM12 6h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0 1 18 0v6M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airpods:{viewBox:"0 0 24 24",path:"M5.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 5.5 4zM18.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 18.5 4zM5.5 14v6M18.5 14v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},webcam:{viewBox:"0 0 24 24",path:"M12 14a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 14v8M8 22h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},keyboard:{viewBox:"0 0 24 24",path:"M20 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zM6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M8 17h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mouse:{viewBox:"0 0 24 24",path:"M6 3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3zM12 3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gamepad:{viewBox:"0 0 24 24",path:"M6 12h4M8 10v4M15 13h.01M18 11h.01M17.32 5H6.68a4 4 0 0 0-3.978 3.59l-.891 9a4 4 0 0 0 6.9 3.31l1.29-1.29 1.29 1.29a4 4 0 0 0 6.9-3.31l-.891-9A4 4 0 0 0 17.32 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joystick:{viewBox:"0 0 24 24",path:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2zM6 15v-2M12 15V5m0 0l4 4m-4-4L8 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 3.582 2 5.5v3C2 10.418 6.477 12 12 12s10-1.582 10-3.5v-3C22 3.582 17.523 2 12 2zM2 8.5v4C2 14.418 6.477 16 12 16s10-1.582 10-3.5v-4M2 12.5v4C2 18.418 6.477 20 12 20s10-1.582 10-3.5v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},usb:{viewBox:"0 0 24 24",path:"M16 4h2a2 2 0 0 1 2 2v1M6 4h2a2 2 0 0 1 2 2v1M10 16v-5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM20 16v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM12 12v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},router:{viewBox:"0 0 24 24",path:"M20 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM6 18h.01M12 7a5 5 0 0 0-5 5M19 7a5 5 0 0 0-5-5M12 7V2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},printer:{viewBox:"0 0 24 24",path:"M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 14h12v8H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cpu:{viewBox:"0 0 24 24",path:"M18 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},battery:{viewBox:"0 0 24 24",path:"M17 6H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM23 13v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"battery-charging":{viewBox:"0 0 24 24",path:"M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19M23 13v-2M11 6l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plug:{viewBox:"0 0 24 24",path:"M12 22v-5M9 8V2M15 8V2M18 8H6a2 2 0 0 0-2 2v1a8 8 0 0 0 16 0v-1a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Jr={"chart-line":{viewBox:"0 0 24 24",path:"M3 3v18h18M18 9l-5 5-4-4-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bar-chart":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar-horizontal":{viewBox:"0 0 24 24",path:"M4 12h10M4 6h4M4 18h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-pie":{viewBox:"0 0 24 24",path:"M21.21 15.89A10 10 0 1 1 8 2.83M22 12A10 10 0 0 0 12 2v10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-area":{viewBox:"0 0 24 24",path:"M3 3v18h18M7 12l5-5 4 4 5-5v12H7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-candlestick":{viewBox:"0 0 24 24",path:"M9 5v4M9 11v8M15 5v8M15 17v2M7 9h4v2H7zM13 13h4v4h-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-neutral":{viewBox:"0 0 24 24",path:"M22 12H2M18 8l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1M21 12H17a2 2 0 0 1 0-4h4M17 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M21 4H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM1 10h22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},banknote:{viewBox:"0 0 24 24",path:"M2 8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM6 10h.01M18 14h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},coins:{viewBox:"0 0 24 24",path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 12c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zM16 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM16 8c2.2 0 4 1.8 4 4s-1.8 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"dollar-sign":{viewBox:"0 0 24 24",path:"M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pound-sign":{viewBox:"0 0 24 24",path:"M18 5H9a4 4 0 0 0-4 4v3a4 4 0 0 0 4 4h3M5 12h10M18 19H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"euro-sign":{viewBox:"0 0 24 24",path:"M4 10h12M4 14h12M17 5a8 8 0 0 0-14 5.5 8 8 0 0 0 14 5.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bitcoin:{viewBox:"0 0 24 24",path:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bank:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V10M8 21V10M12 21V10M16 21V10M20 21V10M12 3L2 8h20z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vault:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zM12 12m-3 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0M7 12h2M15 12h2M12 9V7M12 17v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"piggy-bank":{viewBox:"0 0 24 24",path:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2zM2 9v1c0 1.1.9 2 2 2h1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},safe:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM12 12m-2 0a2 2 0 1 0 4 0 2 2 0 1 0-4 0M16 8h.01M16 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M4 2v20l3-2 3 2 3-2 3 2 3-2 3 2V2l-3 2-3-2-3 2-3-2-3 2-3-2zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},invoice:{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M8 13h8M8 17h8M8 9h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},percent:{viewBox:"0 0 24 24",path:"M19 5L5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},growth:{viewBox:"0 0 24 24",path:"M12 20V12M12 12l-4 4M12 12l4 4M8 20h8M3 8l4-4 4 4 5-5 5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},investment:{viewBox:"0 0 24 24",path:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6M2 12h4M18 12h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scale:{viewBox:"0 0 24 24",path:"M12 3v18M3 6l3 10a6 6 0 0 0 6 0L15 6M9 6l6 0M21 6l-3 10a6 6 0 0 1-6 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Xr={"heart-pulse":{viewBox:"0 0 24 24",path:"M19.5 12.572l-7.5 7.428-7.5-7.428A5 5 0 1 1 12 5.006a5 5 0 1 1 7.5 7.566zM3 12h4l2-4 4 8 2-4h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M3 12h4l2-7 4 14 2-7h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pill:{viewBox:"0 0 24 24",path:"M10.5 20.5l9-9a4.95 4.95 0 0 0-7-7l-9 9a4.95 4.95 0 0 0 7 7zM8.5 8.5l7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pill-bottle":{viewBox:"0 0 24 24",path:"M6 3h12v5H6zM5 8h14a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1zM10 14h4M12 12v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},capsule:{viewBox:"0 0 24 24",path:"M8 8a4 4 0 0 1 8 0v8a4 4 0 0 1-8 0V8zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},syringe:{viewBox:"0 0 24 24",path:"M18 2l4 4M15 5l6 6M8 6l10 10-4 4L4 10zM2 22l6-6M7 11l2 2M11 7l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vaccine:{viewBox:"0 0 24 24",path:"M14 2l4 4M8 8l8 8M3 17l4 4M6.5 6.5L20 20M12 12l2.5-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stethoscope:{viewBox:"0 0 24 24",path:"M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4M22 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-medical":{viewBox:"0 0 24 24",path:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0zM12 14v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bandage:{viewBox:"0 0 24 24",path:"M18 2l4 4-14 14-4-4zM10.5 7.5l6 6M8.5 9.5l1 1M14.5 15.5l1 1M12.5 11.5l1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hospital:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M10 9h4M12 7v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ambulance:{viewBox:"0 0 24 24",path:"M10 10H6M8 8v4M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM7 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM21 15V8a2 2 0 0 0-2-2h-3l-2-3H6a2 2 0 0 0-2 2v10M21 9h-4a2 2 0 0 0-2 2v4h6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"first-aid":{viewBox:"0 0 24 24",path:"M20 6H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM9 12h6M12 9v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"medical-cross":{viewBox:"0 0 24 24",path:"M8 3h8v6h5v6h-5v6H8v-6H3V9h5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dna:{viewBox:"0 0 24 24",path:"M2 15c6.667-6 13.333 0 20-6M9 22c1.798-1.998 2.518-3.995 2.807-5.993M15 2c-1.798 1.998-2.518 3.995-2.807 5.993M2 9c6.667 6 13.333 0 20 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},microscope:{viewBox:"0 0 24 24",path:"M6 18h8M3 22h18M14 22a7 7 0 1 0 0-14M9 14h.01M9 6v8M6 6h6l-3-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"test-tube":{viewBox:"0 0 24 24",path:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5s-2.5-1.1-2.5-2.5V2M7 2h10M8.5 14h7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},brain:{viewBox:"0 0 24 24",path:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18ZM12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18ZM12 5v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lungs:{viewBox:"0 0 24 24",path:"M6.081 20C2.477 20 2 15.5 2 12.5S4 6 4 6s2-1 2-3M17.92 20c3.603 0 4.08-4.5 4.08-7.5S20 6 20 6s-2-1-2-3M12 3v17M12 12c-4 0-7-2-7-2M12 12c4 0 7-2 7-2M12 16c-4 0-7-2-7-2M12 16c4 0 7-2 7-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bone:{viewBox:"0 0 24 24",path:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tooth:{viewBox:"0 0 24 24",path:"M12 2C7 2 4 5 4 8c0 5 1 8 2 10 .5 1 1 4 2.5 4s1.5-2 3.5-2 2 2 3.5 2 2-3 2.5-4c1-2 2-5 2-10 0-3-3-6-8-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-medical":{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 9v6M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wheelchair:{viewBox:"0 0 24 24",path:"M12 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM15 21a4 4 0 1 0-5-6M12 10v4h4l2 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crutch:{viewBox:"0 0 24 24",path:"M5 5l7 7M7 3l7 7M19 19l-7-7M21 17l-7-7M11 11l-6 6M13 13l-6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"scale-weight":{viewBox:"0 0 24 24",path:"M12 3a9 9 0 0 0-9 9 9 9 0 0 0 9 9 9 9 0 0 0 9-9 9 9 0 0 0-9-9zM12 7v5l3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"blood-drop":{viewBox:"0 0 24 24",path:"M12 2c-4 4-7 7-7 11a7 7 0 0 0 14 0c0-4-3-7-7-11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heartbeat:{viewBox:"0 0 24 24",path:"M3 12h4l3-9 4 18 3-9h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Zr={football:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6l4 4-4 4-4-4zM6 12l4-4v8zM18 12l-4 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},soccer:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 8l2.5 2-1 3h-3l-1-3zM12 2v3M22 12h-3M12 22v-3M2 12h3M4.93 4.93l2.12 2.12M19.07 4.93l-2.12 2.12M4.93 19.07l2.12-2.12M19.07 19.07l-2.12-2.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},basketball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2.05 11h19.9M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tennis:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM3.5 8.5c4-1 8 0 12 4M3.5 15.5c4 1 8 0 12-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},baseball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 5c1.5 2 2.5 4 2.5 7s-1 5-2.5 7M19 5c-1.5 2-2.5 4-2.5 7s1 5 2.5 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volleyball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 2v10M12 12l8.66 5M12 12l-8.66 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},golf:{viewBox:"0 0 24 24",path:"M12 18v4M8 22h8M12 2v16M12 6l6-2-6 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bowling:{viewBox:"0 0 24 24",path:"M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 6V2M10 9h.01M14 9h.01M12 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rugby:{viewBox:"0 0 24 24",path:"M5 5c8-2 16 6 14 14C11 21 3 13 5 5zM9 9l6 6M11 9l-1 1M13 11l-1 1M15 13l-1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cricket:{viewBox:"0 0 24 24",path:"M14 2l8 8-9 9-3-3 9-9M13 3l-9 9M7 17a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hockey:{viewBox:"0 0 24 24",path:"M7 2v11c0 3 2 5 5 5h3a3 3 0 0 0 0-6M19 18.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"table-tennis":{viewBox:"0 0 24 24",path:"M14.5 3.5a7 7 0 0 0-9.9 9.9l-2.3 4.3a1 1 0 0 0 1.3 1.3l4.3-2.3a7 7 0 0 0 6.6-13.2zM17 15.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"world-cup":{viewBox:"0 0 24 24",path:"M12 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM7 7h10M12 2v10M9 3.2c-1.4 2-1.4 5.6 0 7.6M15 3.2c1.4 2 1.4 5.6 0 7.6M10 12l-1 4h6l-1-4M8 16h8M11 16v4M13 16v4M8 20h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},jersey:{viewBox:"0 0 24 24",path:"M9 3L4 6l2.5 3.5L9 8M15 3l5 3-2.5 3.5L15 8M9 3a3 3 0 0 0 6 0M9 8v13h6V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"football-boot":{viewBox:"0 0 24 24",path:"M3 7v5a3 3 0 0 0 3 3h11a4 4 0 0 0 1-7.9L9 7c-1-1-2.2-2-4-2H3zM5 18h2M9 18h2M13 18h2M17 18h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},goal:{viewBox:"0 0 24 24",path:"M2 5h20v11H2zM2 5l3 3v8M22 5l-3 3v8M5 8h14v8M2 11h20M9 8v8M15 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-flag":{viewBox:"0 0 24 24",path:"M6 2v20M6 3h12l-3.5 4L18 11H6M3 22h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"referee-card":{viewBox:"0 0 24 24",path:"M8.5 2.5l9 3a2 2 0 0 1 1.3 2.5l-4.6 13a2 2 0 0 1-2.5 1.3l-9-3a2 2 0 0 1-1.3-2.5l4.6-13a2 2 0 0 1 2.5-1.3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 8c0-2.2 4.5-4 10-4s10 1.8 10 4-4.5 4-10 4-10-1.8-10-4zM2 8v6c0 2.2 4.5 4 10 4s10-1.8 10-4V8M8 12.5V18M16 12.5V18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scoreboard:{viewBox:"0 0 24 24",path:"M3 4h18v12H3zM3 16l3 4M21 16l-3 4M12 6v8M6 8h3v6H6zM15 8h3v6h-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dumbbell:{viewBox:"0 0 24 24",path:"M6.5 6.5h11M17.5 4v5M6.5 4v5M17.5 15v5M6.5 15v5M4 6v3a1 1 0 0 0 1 1h1.5M4 18v-3a1 1 0 0 1 1-1h1.5M20 6v3a1 1 0 0 1-1 1h-1.5M20 18v-3a1 1 0 0 0-1-1h-1.5M6.5 17.5h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barbell:{viewBox:"0 0 24 24",path:"M4 12h16M6 8v8M10 6v12M14 6v12M18 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},kettlebell:{viewBox:"0 0 24 24",path:"M12 6a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 22H7a5 5 0 0 1-1-9.9V10a6 6 0 0 1 12 0v2.1a5 5 0 0 1-1 9.9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},running:{viewBox:"0 0 24 24",path:"M13 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM5 22l3-9 3 3v6M10 6l5 3 4-1M4 13l5 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},swimming:{viewBox:"0 0 24 24",path:"M2 20c.9 0 1.6-.4 2.2-.9.8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 .6.5 1.3.9 2.2.9M8 16l-2-4 4-2 6 4 4-3M15 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cycling:{viewBox:"0 0 24 24",path:"M5 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM19 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 14l4-4 3 3 4-4M12 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},yoga:{viewBox:"0 0 24 24",path:"M12 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM4 17l4-4-2-4 6-3 6 3-2 4 4 4M8 22l4-5 4 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M6 9H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2M18 9h2a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M6 3v6a6 6 0 0 0 12 0V3M12 15v4M8 22h8M8 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},medal:{viewBox:"0 0 24 24",path:"M12 15a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM8 3l4 6 4-6M8 3h8M12 9v6M9 19.5l3 1.5 3-1.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M12 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM8.21 13.89L7 23l5-3 5 3-1.21-9.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crown:{viewBox:"0 0 24 24",path:"M2 17l3-10 5 6 2-8 2 8 5-6 3 10H2zM4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},podium:{viewBox:"0 0 24 24",path:"M5 10h4v12H5zM10 6h4v16h-4zM15 14h4v8h-4zM12 2v4M10 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stopwatch:{viewBox:"0 0 24 24",path:"M12 5a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 9v5l3 3M10 2h4M21 6l-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},whistle:{viewBox:"0 0 24 24",path:"M5 16a4 4 0 1 0 8 0 4 4 0 0 0-8 0zM2 12l7-4h8l3 4-3 4M18 8l4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},target:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"boxing-glove":{viewBox:"0 0 24 24",path:"M5 8c0-3 2-5 5-5h4c3 0 5 2 5 5v5c0 4-3 7-7 7s-7-3-7-7V8zM9 5v4M12 20v2M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},racket:{viewBox:"0 0 24 24",path:"M12 2a6 6 0 0 0-6 6v4a6 6 0 0 0 12 0V8a6 6 0 0 0-6-6zM12 18v4M8 8h8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skate:{viewBox:"0 0 24 24",path:"M4 16V6a2 2 0 0 1 2-2h8l4 4v8M2 16h18v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2zM6 20v2M16 20v2M10 10h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ski:{viewBox:"0 0 24 24",path:"M5 16l14-6M3 21l18-8M12 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 8l-4 8M14 10l2 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surfboard:{viewBox:"0 0 24 24",path:"M21 3L3 21M17 3c3 3 4 8 1 15L3 21c7-3 12-2 15 1M12 12l-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mountain:{viewBox:"0 0 24 24",path:"M8 21l4-10 3 6 2-4 4 8H3l5-10 4 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tent:{viewBox:"0 0 24 24",path:"M12 2L2 20h20L12 2zM12 2v18M7 14l5-6 5 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},compass:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM16.24 7.76l-2.12 6.36-6.36 2.12 2.12-6.36z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fishing:{viewBox:"0 0 24 24",path:"M18 2l-3 3v3l-4 4-5-2-4 4v5h5l4-4-2-5 4-4h3l3-3M12 22c-2 0-3-1-3-3M9 19c-2 0-3-1-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Qr={building:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-4h6v4M9 9h.01M15 9h.01M9 13h.01M15 13h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},house:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9zM9 22V12h6v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cabin:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10l8-8 8 8v10M10 20v-6h4v6M12 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},apartment:{viewBox:"0 0 24 24",path:"M4 21V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v17M8 6h2M14 6h2M8 10h2M14 10h2M8 14h2M14 14h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},office:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 21v-4h6v4M9 7h.01M15 7h.01M9 11h.01M15 11h.01M9 15h.01M15 15h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M4 3h16l1 6H3l1-6zM3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9M10 21v-6h4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},warehouse:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V8l8-5 8 5v13M9 17h6v4H9zM9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},factory:{viewBox:"0 0 24 24",path:"M2 21h20M5 21V11l6 4V9l6 4V5a2 2 0 0 1 2-2h0a2 2 0 0 1 2 2v16M8 21v-3M12 21v-3M16 21v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hotel:{viewBox:"0 0 24 24",path:"M4 21V3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v18M8 5h2M14 5h2M8 9h2M14 9h2M8 13h2M14 13h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},school:{viewBox:"0 0 24 24",path:"M2 22h20M12 2l10 6v14M2 8l10-6M12 8v14M4 10v12M20 10v12M8 14h.01M16 14h.01M10 22v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},university:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},library:{viewBox:"0 0 24 24",path:"M4 21h16M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 7h6M9 11h6M9 15h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},museum:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10M20 20V10M12 2L2 8h20L12 2zM8 20v-6h3v6M13 20v-6h3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},court:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8l8-6 8 6v12M10 20v-6h4v6M6 10h12M12 4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},church:{viewBox:"0 0 24 24",path:"M18 22H6a2 2 0 0 1-2-2V9l8-7 8 7v11a2 2 0 0 1-2 2zM12 2v4M10 4h4M10 22v-5a2 2 0 0 1 4 0v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mosque:{viewBox:"0 0 24 24",path:"M3 21h18M5 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M15 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M12 3a4 4 0 0 1 4 4v14M12 3a4 4 0 0 0-4 4v14M12 1v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},temple:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V12h4v10M16 22V12h4v10M8 22V8h8v14M12 2l6 6H6l6-6M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},castle:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V10h4V6H6V2h3v2h2V2h2v2h2V2h3v4h-2v4h4v12M10 22v-5h4v5M4 6h4M16 6h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fortress:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8h16v12M8 8V4h2v4M14 8V4h2v4M4 4h4M16 4h4M8 20v-4h3v4M13 20v-4h3v4M7 12h2M15 12h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tower:{viewBox:"0 0 24 24",path:"M8 22V4a4 4 0 0 1 8 0v18M8 8h8M8 14h8M10 22v-4h4v4M12 1v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lighthouse:{viewBox:"0 0 24 24",path:"M7 22l2-16h6l2 16M9 6V3a3 3 0 0 1 6 0v3M2 11h5M17 11h5M9 12h6M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bridge:{viewBox:"0 0 24 24",path:"M2 18h20M4 14c0-2 2-4 4-4s4 2 4 4c0-2 2-4 4-4s4 2 4 4M4 18v-4M20 18v-4M12 18v-4M8 10V6M16 10V6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 16c0-3 4.5-5 10-5s10 2 10 5v2c0 3-4.5 5-10 5s-10-2-10-5v-2zM2 12c0-3 4.5-5 10-5s10 2 10 5M12 3v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airport:{viewBox:"0 0 24 24",path:"M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"train-station":{viewBox:"0 0 24 24",path:"M4 21h16M6 17V7a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10M8 21v-4h3v4M13 21v-4h3v4M12 2v3M9 9h6M9 13h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monument:{viewBox:"0 0 24 24",path:"M8 22h8M10 22V10L12 2l2 8v12M6 18h12M8 14h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},obelisk:{viewBox:"0 0 24 24",path:"M7 22l2-18h6l2 18M12 2l-1 2h2l-1-2M9 8h6M9 14h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},arch:{viewBox:"0 0 24 24",path:"M4 22V10a8 8 0 0 1 16 0v12M4 8h16M4 14h16M8 22v-8M16 22v-8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},windmill:{viewBox:"0 0 24 24",path:"M7 22l3-10h4l3 10M12 12V3M12 6l6-3M12 6L6 3M12 6l6 3M12 6L6 9M10 16h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skyscraper:{viewBox:"0 0 24 24",path:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18M2 22h20M10 6h4M10 10h4M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pyramid:{viewBox:"0 0 24 24",path:"M12 2L2 22h20L12 2zM12 2v20M7 12h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dome:{viewBox:"0 0 24 24",path:"M2 22h20M4 22v-6a8 8 0 0 1 16 0v6M12 2v6M12 2a3 3 0 0 1 0 6M10 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barn:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V11l7-8 7 8v10M10 21v-5h4v5M9 11h6M12 3v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ea={smile:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},grin:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M6 13a6 6 0 0 0 12 0H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laugh:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9c0-.6.4-1 1-1s1 .4 1 1M15 9c0-.6.4-1 1-1s1 .4 1 1M7 13h10a5 5 0 0 1-10 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9l2 1M15 9l2 1M6 13h12a6 6 0 0 1-12 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wink:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M14 9h4M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},blush:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2M5 13h2M17 13h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M6.5 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1zM15 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M8 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1zM16 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sad:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2M8 11v2M16 11v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sob:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9l3 1M18 9l-3 1M16 17s-1.5-2-4-2-4 2-4 2M7 12l1 6M17 12l-1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},disappointed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},angry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rage:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 7l5 3M19 7l-5 3M9 16h6M9 16l1-2M15 16l-1-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},annoyed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M8 9h.01M16 9h.01M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surprised:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v1M16 8v1M12 13a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shocked:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 8l2 1M17 8l-2 1M12 13v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},astonished:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M12 12a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thinking:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M10 15h4c0 1-1 2-2 2s-2-1-2-2zM19 9c1 0 2-1 2-2s-1-2-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},confused:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M9 15c2-2 4 0 6-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},neutral:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},expressionless:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h3M14 9h3M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cool:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 10h5l1-2h2l1 2h5M5 10c0 1 1 2 2.5 2s2.5-1 2.5-2M14 10c0 1 1 2 2.5 2s2.5-1 2.5-2M8 16s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},nerd:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM14 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM10 9h4M8 15s1.5 1 4 1 4-1 4-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tongue:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 13h8M10 13v3c0 1 1 2 2 2s2-1 2-2v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},silly:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h2M17 9l-2-1M7 13c2 0 3 3 5 3s3-3 5-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zany:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v2M15 8l2 2M8 14h8c0 2-2 4-4 4s-4-2-4-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sick:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15c2 1 6-1 8 0M18 5c1.5 1.5 1.5 3.5 0 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sleepy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10c.5-.5 1.5-.5 2 0M15 10c.5-.5 1.5-.5 2 0M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM18 4l2 2M20 4h-2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dead:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 4M10 8l-4 4M14 8l4 4M18 8l-4 4M8 16h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mask:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M4 13h16M5 14c1 2 3 4 7 4s6-2 7-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ta={car:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M7.5 6.5l.5 1h8l.5-1a1 1 0 00-1-1H8.5a1 1 0 00-1 1z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M1 3h15v13H1zM16 8h4l3 3v5h-7V8z M5.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z M18.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},van:{viewBox:"0 0 24 24",path:"M3 6h13v11H3z M16 6h2l3 4v7h-5V6z M7 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M17 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M3 10h13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},motorcycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 4l-3 7h5.5L18 8m-4 3l3 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bicycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 11l2-5h3M12 19v-8m0 0L9 8M12 11l3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bus:{viewBox:"0 0 24 24",path:"M4 6a2 2 0 012-2h12a2 2 0 012 2v11a3 3 0 01-3 3H7a3 3 0 01-3-3V6z M4 10h16M8 20v-2M16 20v-2M8 14h.01M16 14h.01M4 6h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},taxi:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M9 4h6v2H9V4z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},parking:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z M9 8v8M9 8h3.5a2.5 2.5 0 010 5H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fuel:{viewBox:"0 0 24 24",path:"M3 4h10v12H3z M13 7h2a2 2 0 012 2v7a2 2 0 002 2M14 7V4M3 10h10M5 20v-4M11 20v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},garage:{viewBox:"0 0 24 24",path:"M2 9l10-7 10 7v11a2 2 0 01-2 2H4a2 2 0 01-2-2V9z M7 21V13h10v8M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},road:{viewBox:"0 0 24 24",path:"M6 4h2v16H6zM16 4h2v16h-2zM12 4v4M12 12v4M12 20v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rocket:{viewBox:"0 0 24 24",path:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11A22.35 22.35 0 0 1 15 15z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};var na={code:{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"git-branch":{viewBox:"0 0 24 24",path:"M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 9c-3 0-6 3-6 6v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},terminal:{viewBox:"0 0 24 24",path:"M4 17l6-6-6-6M12 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bold:{viewBox:"0 0 24 24",path:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6V4zm0 8h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6v-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},italic:{viewBox:"0 0 24 24",path:"M19 4h-9M14 20H5M15 4L9 20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},underline:{viewBox:"0 0 24 24",path:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3M4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},strikethrough:{viewBox:"0 0 24 24",path:"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7.1-5.3 1.1-6.6 3.1-.5.8-.7 1.7-.7 2.6 0 1.7.8 3.1 2 4M3 12h18M13 20c2 0 3.5-.5 4.5-1.5 1-.9 1.5-2.2 1.5-3.5 0-1.3-.5-2.5-1.4-3.4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-1":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 6h3m0 0V6m0 6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-2":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 10.5c0-2.5 4-2.5 4 0s-4 2.5-4 5m4 0h-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-3":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 4.5h3a1.5 1.5 0 0 1 0 3 1.5 1.5 0 0 1 0 3h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-bullet":{viewBox:"0 0 24 24",path:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-numbered":{viewBox:"0 0 24 24",path:"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},quote:{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-inline":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-block":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6M14 4l-4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-add":{viewBox:"0 0 24 24",path:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"image-add":{viewBox:"0 0 24 24",path:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M3 17a9 9 0 0 1 9-9 9 9 0 0 1 9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-left":{viewBox:"0 0 24 24",path:"M3 6h18M3 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-center":{viewBox:"0 0 24 24",path:"M3 6h18M6 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-right":{viewBox:"0 0 24 24",path:"M3 6h18M9 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},indent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M3 9l4 3-4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},outdent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M7 9l-4 3 4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},embed:{viewBox:"0 0 24 24",path:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clear-format":{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};const sa=e=>({viewBox:"0 0 24 24",path:e,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),oa={email:sa("M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9h4"),name:sa("M5 5h14a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z M9 9a2 2 0 110 4 2 2 0 010-4z M6 16.5c.6-1.4 1.7-2 3-2s2.4.6 3 2 M15 10h3 M15 14h3"),username:sa("M12 2a10 10 0 110 20 10 10 0 010-20z M12 7a3 3 0 110 6 3 3 0 010-6z M6.2 18.3c1.3-1.9 3.4-3 5.8-3s4.5 1.1 5.8 3"),password:sa("M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2z M7.5 12h.01 M12 12h.01 M16.5 12h.01"),signature:sa("M3 16c2.5-2.5 4.5-7 6.5-7 1.6 0-.6 6 1.2 6 1.4 0 2.6-3.5 4.3-3.5 1.4 0 .8 2.5 2.5 2.5 M3 20h18"),birthday:sa("M4 21h16 M5 21v-6a2 2 0 012-2h10a2 2 0 012 2v6 M5 17c1.2.9 2.3.9 3.5 0s2.3-.9 3.5 0 2.3.9 3.5 0 2.3-.9 3.5 0 M12 13V9 M12 7c-.9-.9-.9-2 0-3.5.9 1.5.9 2.6 0 3.5z"),company:sa("M4 21V5a2 2 0 012-2h8a2 2 0 012 2v16 M16 9h2a2 2 0 012 2v10 M3 21h18 M8 7h4 M8 11h4 M8 15h4"),telephone:sa("M22 16.9v3a2 2 0 01-2.2 2 19.8 19.8 0 01-8.6-3.1 19.5 19.5 0 01-6-6 19.8 19.8 0 01-3.1-8.7A2 2 0 014.1 2h3a2 2 0 012 1.7c.1.9.4 1.9.7 2.8a2 2 0 01-.5 2.1L8 9.9a16 16 0 006 6l1.3-1.3a2 2 0 012.1-.4c.9.3 1.8.6 2.8.7a2 2 0 011.7 2z"),mobile:sa("M8 2h8a2 2 0 012 2v16a2 2 0 01-2 2H8a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2"),address:sa("M3 10.5L12 3l9 7.5 M5 9v12h14V9 M10 21v-6h4v6"),postcode:sa("M4 5h16a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1z M10 9l-1 6 M14 9l-1 6 M7.5 11h8 M7 13h8"),website:sa("M5 4h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z M3 9h18 M6.5 6.5h.01 M9.5 6.5h.01"),pound:sa("M17 7.5a4 4 0 00-7.5-1.5c-.8 1.5-.4 3.3 0 5 .5 2.2.4 4.5-1.5 7H18 M6.5 12.5h8"),dollar:sa("M12 2v20 M17 6.5C16.1 5 14.3 4.3 12 4.3 9 4.3 7 5.8 7 8c0 5 10 2.5 10 8 0 2.2-2 3.7-5 3.7-2.4 0-4.3-.8-5.2-2.3"),euro:sa("M18.5 6.5a7 7 0 100 11 M4 10h9 M4 14h9"),weight:sa("M9 7a3 3 0 116 0 M6.5 9h11l2 12h-15l2-12z M10.5 14.5h3"),ruler:sa("M3 17L17 3l4 4L7 21l-4-4z M7 13l2 2 M10 10l2 2 M13 7l2 2"),quantity:sa("M4 6h16 M4 12h16 M4 18h10 M18 16v4 M16 18h4")},ia={...Ir,...Nr,...Pr,...Vr,...Fr,...Rr,...qr,...Ur,...Kr,...Yr,...Gr,...Jr,...Xr,...Zr,...Qr,...ea,...ta,...na,...oa},ra={ui:{name:"UI",description:"Core user interface icons",icons:Object.keys(Ir)},communication:{name:"Communication",description:"Messaging and notifications",icons:Object.keys(Nr)},media:{name:"Media",description:"Audio, video, and images",icons:Object.keys(Pr)},files:{name:"Files",description:"Documents and file operations",icons:Object.keys(Vr)},social:{name:"Social",description:"Social interactions and sharing",icons:Object.keys(Fr)},commerce:{name:"Commerce",description:"Shopping and payments",icons:Object.keys(Rr)},status:{name:"Status",description:"Indicators and alerts",icons:Object.keys(qr)},navigation:{name:"Navigation",description:"Directional and navigation",icons:Object.keys(Ur)},seasonal:{name:"Seasonal",description:"Festive and holiday icons",icons:Object.keys(Kr)},weather:{name:"Weather",description:"Weather conditions and meteorology",icons:Object.keys(Yr)},devices:{name:"Devices",description:"Electronic devices and hardware",icons:Object.keys(Gr)},finance:{name:"Finance",description:"Financial and charts",icons:Object.keys(Jr)},health:{name:"Health",description:"Medical and wellness",icons:Object.keys(Xr)},sport:{name:"Sport",description:"Sports and fitness",icons:Object.keys(Zr)},buildings:{name:"Buildings",description:"Architecture and structures",icons:Object.keys(Qr)},emojis:{name:"Emojis",description:"Emoji expressions and faces",icons:Object.keys(ea)},transport:{name:"Transport",description:"Vehicles and transportation",icons:Object.keys(ta)},code:{name:"Code & Editor",description:"Text editing, formatting, and code icons",icons:Object.keys(na)},forms:{name:"Forms",description:"Beside a form field - email, name, phone, address, money, measurements",icons:[...Object.keys(oa),"at-sign","mail","user","users","phone","smartphone","map-pin","home","calendar","clock","lock","key","globe","link","credit-card","hash","percent","briefcase","building","message-square","tag","search","cake","gift","scale"]}},aa="http://www.w3.org/2000/svg";const la=new class{constructor(){this._icons={...ia},this._categories={...ra}}render(e,t={}){const n=this._icons[e];if(!n)return console.warn(`Icon "${e}" not found`),null;const{size:s=24,class:o="",colour:i=null,color:r=null,attrs:a={}}=t,l=document.createElementNS(aa,"svg");l.setAttribute("viewBox",n.viewBox||"0 0 24 24"),l.setAttribute("width",s),l.setAttribute("height",s),l.setAttribute("fill",n.fill||"none"),l.setAttribute("aria-hidden","true");const d=["dm-icon"];if(o&&d.push(o),l.setAttribute("class",d.join(" ")),n.stroke&&l.setAttribute("stroke",i||r||n.stroke),n.strokeWidth&&l.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&l.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&l.setAttribute("stroke-linejoin",n.strokeLinejoin),(i||r)&&"currentColor"===n.fill&&l.setAttribute("fill",i||r),Object.entries(a).forEach(([e,t])=>{l.setAttribute(e,t)}),n.path){const e=document.createElementNS(aa,"path");e.setAttribute("d",n.path),"currentColor"===n.fill&&e.setAttribute("fill",i||r||"currentColor"),l.appendChild(e)}return n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(aa,"path");t.setAttribute("d",e),"currentColor"===n.fill&&t.setAttribute("fill",i||r||"currentColor"),l.appendChild(t)}),l}html(e,t={}){const n=this.render(e,t);if(!n)return"";const s=document.createElement("div");return s.appendChild(n),s.innerHTML}inject(e,t,n={}){const{position:s="prepend",...o}=n,i="string"==typeof e?document.querySelector(e):e;if(!i)return console.warn(`Target element not found: ${e}`),null;const r=this.render(t,o);if(!r)return null;switch(s){case"append":i.appendChild(r);break;case"replace":i.innerHTML="",i.appendChild(r);break;default:i.insertBefore(r,i.firstChild)}return r}scan(e=document){const t="string"==typeof e?document.querySelector(e):e;if(!t)return 0;const n=t.querySelectorAll("[data-icon]:not([data-icon-processed]):not([data-icon-processing])");let s=0;return n.forEach(e=>{if("svg"===e.tagName.toLowerCase()||e.hasAttribute("data-icon-processed")||e.querySelector("svg"))return;const t=e.dataset.icon,n=parseInt(e.dataset.iconSize,10)||24,o=e.dataset.iconColour||e.dataset.iconColor||null,i=e.dataset.iconClass||"",r=this.render(t,{size:n,colour:o,class:i});if(r){const n=e.className;n&&r.classList.add(...n.split(" ").filter(e=>e)),r.setAttribute("data-icon",t),r.setAttribute("data-icon-processed","true"),r.setAttribute("data-original-icon",t),r.setAttribute("data-icon-converted",Date.now().toString()),e.replaceWith(r),s++}else e.setAttribute("data-icon-processed","true")}),s}register(e,t){return e&&t?(t.viewBox||(t.viewBox="0 0 24 24"),t.path||t.paths?(this._icons[e]=t,this._categories.custom||(this._categories.custom={name:"Custom",description:"Custom registered icons",icons:[]}),this._categories.custom.icons.push(e),this):(console.warn(`Icon "${e}" must have a path or paths property`),this)):(console.warn("Invalid icon registration: name and definition required"),this)}unregister(e){if(this._icons[e]){if(delete this._icons[e],this._categories.custom){const t=this._categories.custom.icons.indexOf(e);t>-1&&this._categories.custom.icons.splice(t,1)}return!0}return!1}has(e){return!!this._icons[e]}get(e){return this._icons[e]||null}list(e=null){return e&&this._categories[e]?[...this._categories[e].icons]:Object.keys(this._icons)}listCategories(){return{...this._categories}}count(){return Object.keys(this._icons).length}search(e){const t=e.toLowerCase();return Object.keys(this._icons).filter(e=>e.toLowerCase().includes(t))}createSprite(){const e=document.createElementNS(aa,"svg");return e.setAttribute("xmlns",aa),e.style.display="none",Object.entries(this._icons).forEach(([t,n])=>{const s=document.createElementNS(aa,"symbol");if(s.setAttribute("id",`dm-icon-${t}`),s.setAttribute("viewBox",n.viewBox||"0 0 24 24"),n.path){const e=document.createElementNS(aa,"path");e.setAttribute("d",n.path),n.fill&&e.setAttribute("fill",n.fill),n.stroke&&(e.setAttribute("stroke",n.stroke),n.strokeWidth&&e.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&e.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&e.setAttribute("stroke-linejoin",n.strokeLinejoin)),s.appendChild(e)}n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(aa,"path");t.setAttribute("d",e),n.fill&&t.setAttribute("fill",n.fill),n.stroke&&t.setAttribute("stroke",n.stroke),s.appendChild(t)}),e.appendChild(s)}),e}use(e,t={}){if(!this._icons[e])return console.warn(`Icon "${e}" not found`),null;const{size:n=24,class:s=""}=t,o=document.createElementNS(aa,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("aria-hidden","true");const i=["dm-icon"];s&&i.push(s),o.setAttribute("class",i.join(" "));const r=document.createElementNS(aa,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#dm-icon-${e}`),o.appendChild(r),o}};class da{static stripeColors={none:"transparent",lighter:"var(--dm-gray-100, #f8f9fa)",light:"var(--dm-gray-200, #e9ecef)",medium:"var(--dm-gray-300, #dee2e6)",dark:"var(--dm-gray-400, #ced4da)","primary-tint":"rgba(100, 149, 237, 0.05)","success-tint":"rgba(40, 167, 69, 0.05)","warning-tint":"rgba(255, 193, 7, 0.05)","danger-tint":"rgba(220, 53, 69, 0.05)","info-tint":"rgba(23, 162, 184, 0.05)",default:"var(--dm-table-stripe-bg, #f9f9f9)"};static hoverColors={none:"transparent",lighter:"var(--dm-gray-200, #e9ecef)",light:"var(--dm-gray-300, #dee2e6)",medium:"var(--dm-gray-400, #ced4da)",dark:"var(--dm-gray-500, #adb5bd)",default:"var(--dm-hover-bg, #f0f0f0)"};constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={data:[],columns:[],rowKey:"id",sortable:!0,multiSort:!1,defaultSort:null,filterable:!0,searchable:!0,searchPlaceholder:"Search...",pagination:!0,pageSize:10,pageSizeOptions:[10,25,50,100],selectable:!1,selectionMode:"single",editable:!1,editMode:"cell",resizable:!0,loadingSkeleton:!1,loadingLabel:"Loading...",striped:!0,hover:!0,bordered:!0,responsive:!0,evenRowColor:null,oddRowColor:null,hoverColor:null,classes:{wrapper:"domma-table-wrapper",table:"domma-table",header:"domma-table-header",body:"domma-table-body",row:"domma-table-row",cell:"domma-table-cell",selected:"domma-table-selected",sorted:"domma-table-sorted",sortAsc:"domma-table-sort-asc",sortDesc:"domma-table-sort-desc",pagination:"domma-table-pagination",search:"domma-table-search"},exportPanel:!1,exportOptions:["copy","csv","excel","json"],columnToggle:!1,regexSearch:!1,persistSettings:!1,storageKey:null,onSort:null,onFilter:null,onPageChange:null,onSelect:null,onEdit:null,onRender:null,onExport:null,...t},this._originalData=[...this.options.data],this._data=[...this.options.data],this._filteredData=[...this._data],this._currentPage=1,this._pageSize=this.options.pageSize,this._sorts=[],this._filters=[],this._searchQuery="",this._selected=new Set,this._editingCell=null,this._eventListeners=new Map,this._columnDropdownOpen=!1,this._searchIsRegex=!1,this._loading=!(!this.options.loadingSkeleton||this.options.data&&this.options.data.length),this._columns=this.options.columns.map(e=>({key:e.key||e,title:e.title||e.key||e,sortable:!1!==e.sortable&&this.options.sortable,filterable:!1!==e.filterable,editable:e.editable||!1,width:e.width||null,render:e.render||null,filterOptions:e.filterOptions||null,visible:!1!==e.visible})),this.options.persistSettings&&this._loadSettings(),this._init()}_init(){this.element&&(this.options.defaultSort&&(this._sorts=[this.options.defaultSort]),this.render())}_resolveColor(e,t,n){return e?t[e]?t[e]:e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("var(")?e:n:n}_getRowColors(e){const t=this.options;if(!t.striped)return{background:"transparent",hover:t.hover?this._resolveColor(t.hoverColor,da.hoverColors,da.hoverColors.default):"transparent"};const n=e%2==1,s=this._resolveColor(t.evenRowColor,da.stripeColors,"transparent"),o=this._resolveColor(t.oddRowColor,da.stripeColors,da.stripeColors.default);return{background:n?o:s,hover:t.hover?this._resolveColor(t.hoverColor,da.hoverColors,da.hoverColors.default):null}}setData(e){return this._loading=!1,this._originalData=[...e],this._data=[...e],this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}getData(){return[...this._getPageData()]}setLoading(e=!0){return this._loading=!!e,this.render(),this}isLoading(){return this._loading}getFilteredData(){return[...this._filteredData]}getOriginalData(){return[...this._originalData]}addRow(e){return this._loading=!1,this._originalData.push(e),this._data.push(e),this._applyFiltersAndSort(),this.render(),this}updateRow(e,t){const n=this._findRowIndex(e);return-1!==n&&(this._originalData[n]={...this._originalData[n],...t},this._data[n]={...this._data[n],...t},this._applyFiltersAndSort(),this.render()),this}removeRow(e){const t=this._findRowIndex(e);return-1!==t&&(this._originalData.splice(t,1),this._data.splice(t,1),this._applyFiltersAndSort(),this.render()),this}_findRowIndex(e){const t=this.options.rowKey;return"number"==typeof e?e:this._originalData.findIndex(n=>n[t]===e)}sort(e,t="asc"){return this._sorts=[{column:e,direction:t}],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({column:e,direction:t,sorts:this._sorts}),this}sortMultiple(e){return this._sorts=e,this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({sorts:this._sorts}),this}clearSort(){return this._sorts=[],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this}_applySort(e){return 0===this._sorts.length?e:[...e].sort((e,t)=>{for(const n of this._sorts){const{column:s,direction:o}=n,i=e[s],r=t[s];let a=0;if(null==i?a=1:null==r||i<r?a=-1:i>r&&(a=1),0!==a)return"desc"===o?-a:a}return 0})}search(e){return this._searchQuery=this._searchIsRegex?e.trim():e.toLowerCase().trim(),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({query:e,type:"search",isRegex:this._searchIsRegex}),this}setSearchMode(e){return this._searchIsRegex=e,this._searchQuery&&(this._applyFiltersAndSort(),this.render()),this}toggleSearchMode(){return this.setSearchMode(!this._searchIsRegex)}filter(e,t,n="equals"){return this._filters=this._filters.filter(t=>t.column!==e),null!=t&&""!==t&&this._filters.push({column:e,value:t,operator:n}),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({column:e,value:t,operator:n,type:"column"}),this}filterBy(e){return this._customFilter=e,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}clearFilters(){return this._filters=[],this._searchQuery="",this._customFilter=null,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}_applyFilters(e){let t=e;if(this._searchQuery)if(this._searchIsRegex)try{const e=new RegExp(this._searchQuery,"i");t=t.filter(t=>this._columns.some(n=>{const s=t[n.key];return null!=s&&e.test(String(s))}))}catch(e){t=[]}else t=t.filter(e=>this._columns.some(t=>{const n=e[t.key];return null!=n&&String(n).toLowerCase().includes(this._searchQuery)}));for(const e of this._filters)t=t.filter(t=>{const n=t[e.column];return this._matchFilter(n,e.value,e.operator)});return this._customFilter&&(t=t.filter(this._customFilter)),t}_matchFilter(e,t,n){if(null==e)return!1;const s=String(e).toLowerCase(),o=String(t).toLowerCase();switch(n){case"equals":default:return s===o;case"contains":return s.includes(o);case"startsWith":return s.startsWith(o);case"endsWith":return s.endsWith(o);case"gt":return Number(e)>Number(t);case"lt":return Number(e)<Number(t);case"gte":return Number(e)>=Number(t);case"lte":return Number(e)<=Number(t);case"between":const[n,i]=t,r=Number(e);return r>=n&&r<=i;case"in":return t.includes(e)}}_applyFiltersAndSort(){this._filteredData=this._applyFilters(this._data),this._filteredData=this._applySort(this._filteredData)}page(e){const t=this._getTotalPages();return this._currentPage=Math.max(1,Math.min(e,t)),this.render(),this.options.onPageChange&&this.options.onPageChange(this.pageInfo()),this}pageSize(e){return this._pageSize=e,this._currentPage=1,this.render(),this._saveSettings(),this}nextPage(){return this.page(this._currentPage+1)}prevPage(){return this.page(this._currentPage-1)}firstPage(){return this.page(1)}lastPage(){return this.page(this._getTotalPages())}pageInfo(){const e=this._getTotalPages();return{page:this._currentPage,pageSize:this._pageSize,totalPages:e,totalRows:this._filteredData.length,startRow:(this._currentPage-1)*this._pageSize+1,endRow:Math.min(this._currentPage*this._pageSize,this._filteredData.length)}}_getTotalPages(){return this.options.pagination&&Math.ceil(this._filteredData.length/this._pageSize)||1}_getPageData(){if(!this.options.pagination)return this._filteredData;const e=(this._currentPage-1)*this._pageSize,t=e+this._pageSize;return this._filteredData.slice(e,t)}select(e){if(!this.options.selectable)return this;const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return"single"===this.options.selectionMode&&this._selected.clear(),this._selected.add(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.delete(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}toggleSelect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)?this.deselect(e):this.select(e),this}selectAll(){if(!this.options.selectable||"single"===this.options.selectionMode)return this;const e=this.options.rowKey;for(const t of this._filteredData)this._selected.add(t[e]);return this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselectAll(){return this._selected.clear(),this.render(),this.options.onSelect&&this.options.onSelect([]),this}getSelected(){const e=this.options.rowKey;return this._filteredData.filter(t=>this._selected.has(t[e]))}isSelected(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)}_getStorageKey(){return this.options.storageKey||(this.element.id?`domma-table-${this.element.id}`:"domma-table-default")}_loadSettings(){try{const e=this._getStorageKey(),t=Q.get(e);t&&t.columns&&t.columns.forEach(e=>{const t=this._columns.find(t=>t.key===e.key);t&&(t.visible=e.visible,e.width&&(t.width=e.width))}),t&&t.pageSize&&this.options.pagination&&(this._pageSize=t.pageSize,this.options.pageSize=t.pageSize),t&&t.sorts&&this.options.sortable&&(this._sorts=t.sorts)}catch(e){console.warn("Failed to load table settings:",e)}}_saveSettings(){if(this.options.persistSettings)try{const e=this._getStorageKey(),t={columns:this._columns.map(e=>({key:e.key,visible:e.visible,width:e.width})),pageSize:this._pageSize,sorts:this._sorts,timestamp:Date.now()};Q.set(e,t)}catch(e){console.warn("Failed to save table settings:",e)}}clearSettings(){if(this.options.persistSettings){const e=this._getStorageKey();Q.remove(e)}}showColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!0,this.render(),this._saveSettings()),this}hideColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!1,this.render(),this._saveSettings()),this}toggleColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!t.visible,this.render(),this._saveSettings()),this}getVisibleColumns(){return this._columns.filter(e=>e.visible)}getHiddenColumns(){return this._columns.filter(e=>!e.visible)}resizeColumn(e,t){const n=this._columns.find(t=>t.key===e);return n&&(n.width=t,this.render()),this}getColumns(){return[...this._columns]}editCell(e,t){return this.options.editable?(this._editingCell={rowIndex:e,column:t},this.render(),this):this}saveEdits(){return this._editingCell=null,this.render(),this}cancelEdits(){return this._editingCell=null,this.render(),this}toCSV(e={}){const{columns:t=this._columns.filter(e=>e.visible),includeHeaders:n=!0}=e,s=[],o=this._getExportData();n&&s.push(t.map(e=>`"${e.title}"`).join(","));for(const e of o){const n=t.map(t=>{const n=e[t.key];return null==n?'""':`"${String(n).replace(/"/g,'""')}"`});s.push(n.join(","))}return s.join("\n")}_getExportData(){const e=this.getSelected();return e.length>0?e:this._filteredData}toJSON(e={}){const{columns:t=this._columns.filter(e=>e.visible),pretty:n=!1}=e,s=t.map(e=>e.key),o=this._getExportData().map(e=>{const t={};for(const n of s)t[n]=e[n];return t});return n?JSON.stringify(o,null,2):JSON.stringify(o)}download(e,t){let n,s;switch(e){case"csv":n=this.toCSV(),s="text/csv",t=t||"data.csv";break;case"excel":n=this.toExcel(),s="application/vnd.ms-excel",t=t||"data.xls";break;default:n=this.toJSON({pretty:!0}),s="application/json",t=t||"data.json"}const o=new Blob([n],{type:s}),i=URL.createObjectURL(o),r=document.createElement("a");if(r.href=i,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(i),this.options.onExport){const n=this._getExportData(),s=this.getSelected();this.options.onExport({format:e,filename:t,rowCount:n.length,selectedOnly:s.length>0})}}toExcel(e={}){const{columns:t=this._columns.filter(e=>e.visible)}=e,n=this._getExportData();let s='\n <html xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <head>\n <meta charset="UTF-8">\n \x3c!--[if gte mso 9]>\n <xml>\n <x:ExcelWorkbook>\n <x:ExcelWorksheets>\n <x:ExcelWorksheet>\n <x:Name>Data</x:Name>\n <x:WorksheetOptions>\n <x:DisplayGridlines/>\n </x:WorksheetOptions>\n </x:ExcelWorksheet>\n </x:ExcelWorksheets>\n </x:ExcelWorkbook>\n </xml>\n <![endif]--\x3e\n <style>\n table { border-collapse: collapse; }\n th, td { border: 1px solid #000; padding: 8px; }\n th { background: #f0f0f0; font-weight: bold; }\n </style>\n </head>\n <body>\n <table>\n <thead>\n <tr>';for(const e of t)s+=`<th>${this._escapeHtml(e.title)}</th>`;s+="</tr></thead><tbody>";for(const e of n){s+="<tr>";for(const n of t){const t=e[n.key];s+=`<td>${null!=t?this._escapeHtml(String(t)):""}</td>`}s+="</tr>"}return s+="</tbody></table></body></html>",s}async copyToClipboard(e="text"){let t;const n=this._getExportData();if("json"===e)t=this.toJSON({pretty:!0});else if("csv"===e)t=this.toCSV();else{const e=this._columns.filter(e=>e.visible),s=[];s.push(e.map(e=>e.title).join("\t"));for(const t of n)s.push(e.map(e=>t[e.key]??"").join("\t"));t=s.join("\n")}return await c.copyToClipboard(t),this.options.onExport&&this.options.onExport({format:"clipboard",rowCount:this._filteredData.length}),this}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}render(){if(!this.element)return this;const e=this.options,t=e.classes,n=this._columns.filter(e=>e.visible),s=this._getPageData();this._restoreIconsBeforeRebuild(),this.element.innerHTML="",this._clearEventListeners();const o=document.createElement("div");o.className=t.wrapper;const i=document.createElement("div");if(i.className="domma-table-toolbar",e.searchable){const t=document.createElement("div");t.className="domma-table-search-wrapper";const n=document.createElement("input");if(n.type="text",n.className="domma-table-search-input"+(this._searchIsRegex?" regex-mode":""),n.placeholder=this._searchIsRegex?"Regex pattern...":e.searchPlaceholder,n.value=this._searchQuery,n.setAttribute("aria-label","Search table"),this._addEventHandler(n,"input",c.debounce(e=>{this.search(e.target.value)},300)),t.appendChild(n),e.regexSearch){const e=document.createElement("button");e.type="button",e.className="domma-table-regex-button"+(this._searchIsRegex?" active":""),e.title=this._searchIsRegex?"Regex mode (click for text)":"Text mode (click for regex)",e.setAttribute("aria-label",this._searchIsRegex?"Regex search mode enabled":"Regex search mode disabled"),e.setAttribute("aria-pressed",this._searchIsRegex?"true":"false"),e.innerHTML=".*",this._addEventHandler(e,"click",()=>{this._searchIsRegex=!this._searchIsRegex,this._searchQuery&&(this._searchQuery=this._searchIsRegex?n.value.trim():n.value.toLowerCase().trim(),this._applyFiltersAndSort()),this.render()}),t.appendChild(e)}i.appendChild(t)}if(e.columnToggle){const e=document.createElement("div");e.className="domma-table-column-toggle";const t=document.createElement("button");t.type="button",t.className="domma-table-column-button",t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this._columnDropdownOpen?"true":"false"),t.setAttribute("aria-label","Toggle column visibility"),t.innerHTML=`${la.html("columns",{size:16})} Columns`;const n=document.createElement("div");n.className="domma-column-dropdown"+(this._columnDropdownOpen?" show":"");for(const e of this._columns){const t=document.createElement("label");t.className="domma-column-toggle-item";const s=document.createElement("span");s.className="domma-column-toggle-label",s.textContent=e.title;const o=document.createElement("div");o.className="domma-toggle-switch";const i=document.createElement("input");i.type="checkbox",i.checked=e.visible,i.style.cssText="opacity: 0; width: 0; height: 0; position: absolute;";const r=document.createElement("span");r.className="domma-toggle-track"+(e.visible?" active":"");const a=document.createElement("span");a.className="domma-toggle-knob"+(e.visible?" active":""),r.appendChild(a),o.appendChild(i),o.appendChild(r),this._addEventHandler(t,"click",t=>{t.preventDefault(),t.stopPropagation(),e.visible=!e.visible,e.visible?(r.classList.add("active"),a.classList.add("active")):(r.classList.remove("active"),a.classList.remove("active")),i.checked=e.visible,this._columnDropdownOpen=!0,this.render(),this._saveSettings()}),t.appendChild(s),t.appendChild(o),n.appendChild(t)}this._addEventHandler(t,"click",e=>{e.stopPropagation(),this._columnDropdownOpen=!this._columnDropdownOpen,this._columnDropdownOpen?n.classList.add("show"):n.classList.remove("show")}),this._addEventHandler(document,"click",()=>{this._columnDropdownOpen&&(this._columnDropdownOpen=!1,n.classList.remove("show"))}),this._addEventHandler(n,"click",e=>{e.stopPropagation()}),e.appendChild(t),e.appendChild(n),i.appendChild(e)}if(e.exportPanel){const t=document.createElement("div");t.className="domma-table-export-wrapper";let n=!1;const s=document.createElement("div");s.className="domma-export-mode-toggle";const o=document.createElement("span");o.className="domma-export-mode-label active",o.textContent="Copy";const r=document.createElement("label");r.className="domma-export-toggle-switch";const a=document.createElement("input");a.type="checkbox",a.className="domma-export-toggle-input";const l=document.createElement("span");l.className="domma-export-toggle-slider";const d=document.createElement("span");d.className="domma-export-toggle-knob",l.appendChild(d),r.appendChild(a),r.appendChild(l);const c=document.createElement("span");c.className="domma-export-mode-label",c.textContent="Download";const h=()=>{n?(l.classList.add("active"),d.classList.add("active"),o.classList.remove("active"),c.classList.add("active")):(l.classList.remove("active"),d.classList.remove("active"),o.classList.add("active"),c.classList.remove("active"))};this._addEventHandler(a,"change",()=>{n=a.checked,h()}),h(),s.appendChild(o),s.appendChild(r),s.appendChild(c),t.appendChild(s);const u=document.createElement("span");u.className="domma-export-separator",t.appendChild(u);const p={text:{label:"Text",icon:la.html("clipboard",{size:16}),format:"text"},csv:{label:"CSV",icon:la.html("document",{size:16}),format:"csv"},excel:{label:"Excel",icon:la.html("grid",{size:16}),format:"excel"},json:{label:"JSON",icon:la.html("file-code",{size:16}),format:"json"}},m=e.exportOptions.map(e=>"copy"===e?"text":e);for(const e of m){const s=p[e];if(!s)continue;const o=document.createElement("button");o.type="button",o.className="domma-export-button",o.setAttribute("data-export",e),o.innerHTML=`${s.icon} ${s.label}`;const i=(e,t=!0)=>{const n=o.innerHTML;o.innerHTML=e,o.classList.add(t?"success":"error"),setTimeout(()=>{o.innerHTML=n,o.classList.remove("success","error")},1500)};this._addEventHandler(o,"click",()=>{const e=this.getSelected(),t=e.length>0?e.length:this._filteredData.length,o=e.length>0?` (${t} selected)`:` (${t} rows)`;if(n){const e="text"===s.format?"csv":s.format;this.download(e),i("✓ Downloaded!"+o)}else{const e="excel"===s.format?"text":s.format;this.copyToClipboard(e),i("✓ Copied!"+o)}}),t.appendChild(o)}i.appendChild(t)}(e.searchable||e.columnToggle||e.exportPanel)&&o.appendChild(i);const r=document.createElement("table");r.className=t.table,r.style.cssText="width: 100%; border-collapse: collapse;";const a=document.createElement("thead");a.className=t.header;const l=document.createElement("tr");if(e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("th");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); width: 40px;";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label","Select all rows"),t.checked=this._selected.size>0&&this._selected.size===s.length,t.disabled=this._loading,this._addEventHandler(t,"change",()=>{t.checked?this.selectAll():this.deselectAll()}),e.appendChild(t),l.appendChild(e)}for(const e of n){const n=document.createElement("th");n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); text-align: left;",e.width&&(n.style.width="number"==typeof e.width?e.width+"px":e.width);const s=this._sorts.find(t=>t.column===e.key);if(s&&(n.classList.add(t.sorted),n.classList.add("asc"===s.direction?t.sortAsc:t.sortDesc)),e.sortable){n.style.cursor="pointer",n.tabIndex=0,n.setAttribute("aria-sort",s?"asc"===s.direction?"ascending":"descending":"none"),n.innerHTML=`${e.title} <span style="opacity: 0.5" aria-hidden="true">${s?"asc"===s.direction?"▲":"▼":"⇅"}</span>`;const t=()=>{const t=this._sorts.find(t=>t.column===e.key),n="asc"===t?.direction?"desc":"asc";this.sort(e.key,n)};this._addEventHandler(n,"click",t),this._addEventHandler(n,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}else n.textContent=e.title;l.appendChild(n)}a.appendChild(l),r.appendChild(a);const d=document.createElement("tbody");d.className=t.body;const h=e.rowKey;if(this._loading){const s=parseInt(e.loadingSkeleton,10),i=s>0?s:Math.min(this._pageSize||5,5),a=n.length+(e.selectable&&"multiple"===e.selectionMode?1:0);for(let e=0;e<i;e++){const n=document.createElement("tr");n.className=`${t.row} domma-table-skeleton-row`,n.setAttribute("aria-hidden","true");for(let s=0;s<a;s++){const o=document.createElement("td");o.className=t.cell,o.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const i=document.createElement("span");i.className="skeleton skeleton-text",i.style.width=`${[80,60,70,50][(e+s)%4]}%`,o.appendChild(i),n.appendChild(o)}d.appendChild(n)}r.setAttribute("aria-busy","true");const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),o.appendChild(l),setTimeout(()=>{l.isConnected&&(l.textContent=e.loadingLabel)},100)}else e.loadingSkeleton&&r.setAttribute("aria-busy","false");if((this._loading?[]:s).forEach((s,o)=>{const i=document.createElement("tr");i.className=t.row;const r=this._getRowColors(o);if(i.style.background=r.background,e.hover&&r.hover){i.style.transition="background 0.2s";const e=r.background;this._addEventHandler(i,"mouseenter",()=>i.style.background=r.hover),this._addEventHandler(i,"mouseleave",()=>i.style.background=e)}if(this._selected.has(s[h])?(i.classList.add(t.selected),i.style.background="var(--dm-primary-light, #e3f2fd)",i.setAttribute("aria-selected","true")):e.selectable&&i.setAttribute("aria-selected","false"),e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("td");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label",`Select row ${o+1}`),t.checked=this._selected.has(s[h]),this._addEventHandler(t,"change",()=>{this.toggleSelect(s[h])}),e.appendChild(t),i.appendChild(e)}e.selectable&&"single"===e.selectionMode&&(i.style.cursor="pointer",this._addEventHandler(i,"click",()=>{this.toggleSelect(s[h])}));for(const r of n){const n=document.createElement("td");n.className=t.cell,n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";if(this._editingCell&&this._editingCell.rowIndex===o&&this._editingCell.column===r.key&&r.editable){const t=document.createElement("input");t.type="text",t.value=s[r.key]||"",t.style.cssText="width: 100%; padding: 4px; border: 1px solid var(--dm-primary, #007bff);",this._addEventHandler(t,"blur",()=>{this.updateRow(s[h],{[r.key]:t.value}),this.saveEdits(),e.onEdit&&e.onEdit({row:s,column:r.key,oldValue:s[r.key],newValue:t.value})}),this._addEventHandler(t,"keydown",e=>{"Enter"===e.key?t.blur():"Escape"===e.key&&this.cancelEdits()}),n.appendChild(t),setTimeout(()=>t.focus(),0)}else r.render?n.innerHTML=r.render(s[r.key],s,o):n.textContent=s[r.key]??"",r.editable&&e.editable&&(n.style.cursor="pointer",this._addEventHandler(n,"dblclick",()=>{this.editCell(o,r.key)}));i.appendChild(n)}d.appendChild(i)}),r.appendChild(d),o.appendChild(r),e.pagination&&!this._loading){const n=document.createElement("div");n.className=t.pagination,n.setAttribute("role","navigation"),n.setAttribute("aria-label","Table pagination"),n.style.cssText="display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 10px 0;";const s=this.pageInfo(),i=document.createElement("span");i.textContent=`Showing ${s.startRow}-${s.endRow} of ${s.totalRows}`;const r=document.createElement("span");r.innerHTML="Show ";const a=document.createElement("select");a.className="form-select",a.setAttribute("aria-label","Rows per page"),a.style.cssText="width: auto; display: inline-block; margin: 0 5px;";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=t,e.textContent=t,t===this._pageSize&&(e.selected=!0),a.appendChild(e)}this._addEventHandler(a,"change",()=>{this.pageSize(Number(a.value))}),r.appendChild(a),r.appendChild(document.createTextNode(" entries"));const l=document.createElement("span");l.setAttribute("role","group"),l.setAttribute("aria-label","Pagination controls");const d=(e,t,n=!1,s=!1,o="")=>{const i=document.createElement("button");return i.type="button",o&&i.setAttribute("aria-label",o),s?i.innerHTML=e:i.textContent=e,i.disabled=n,n&&i.setAttribute("aria-disabled","true"),i.style.cssText="padding: 6px 12px; margin: 0 2px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-surface, #fff); cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;",n&&(i.style.opacity="0.5"),this._addEventHandler(i,"click",t),i};l.appendChild(d(la.html("chevrons-left",{size:14}),()=>this.firstPage(),1===this._currentPage,!0,"First page")),l.appendChild(d(la.html("chevron-left",{size:14}),()=>this.prevPage(),1===this._currentPage,!0,"Previous page"));const c=5;let h=Math.max(1,this._currentPage-Math.floor(c/2)),u=Math.min(s.totalPages,h+c-1);h=Math.max(1,u-c+1);for(let e=h;e<=u;e++){const t=e===this._currentPage,n=d(e,()=>this.page(e),!1,!1,`Page ${e}`);t&&(n.setAttribute("aria-current","page"),n.style.background="var(--dm-primary, #007bff)",n.style.color="var(--dm-primary-text, #fff)",n.style.borderColor="var(--dm-primary, #007bff)"),l.appendChild(n)}l.appendChild(d(la.html("chevron-right",{size:14}),()=>this.nextPage(),this._currentPage===s.totalPages,!0,"Next page")),l.appendChild(d(la.html("chevrons-right",{size:14}),()=>this.lastPage(),this._currentPage===s.totalPages,!0,"Last page")),n.appendChild(r),n.appendChild(i),n.appendChild(l),o.appendChild(n)}return this.element.appendChild(o),this._reinitRenderedContent(),e.onRender&&e.onRender(this),this}_reinitRenderedContent(){try{la.scan(this.element)}catch{}const e="undefined"!=typeof window&&window.Domma&&window.Domma.elements&&window.Domma.elements.tooltip;"function"==typeof e&&this.element.querySelectorAll("[data-tooltip]").forEach(t=>{try{e(t,{position:"top",trigger:"hover",delay:{show:200,hide:0}})}catch{}})}_addEventHandler(e,t,n){e.addEventListener(t,n),this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push({event:t,handler:n})}_clearEventListeners(){for(const[e,t]of this._eventListeners)for(const{event:n,handler:s}of t)e.removeEventListener(n,s);this._eventListeners.clear()}_restoreIconsBeforeRebuild(){this.element.querySelectorAll('svg[data-icon-processed="true"][data-original-icon]').forEach(e=>{const t=e.getAttribute("data-original-icon");if(t){const n=document.createElement("span");n.setAttribute("data-icon",t);const s=e.getAttribute("data-icon-size"),o=e.getAttribute("data-icon-color")||e.getAttribute("data-icon-colour"),i=e.getAttribute("data-icon-class");s&&n.setAttribute("data-icon-size",s),o&&n.setAttribute("data-icon-colour",o),i&&n.setAttribute("data-icon-class",i),e.replaceWith(n)}})}on(e,t){if(["sort","filter","page","select","edit","render"].includes(e)){const n="on"+e.charAt(0).toUpperCase()+e.slice(1);this.options[n]=t}return this}off(e){const t="on"+e.charAt(0).toUpperCase()+e.slice(1);return this.options[t]=null,this}refresh(){return this._applyFiltersAndSort(),this.render(),this}destroy(){this._clearEventListeners(),this.element&&(this.element.innerHTML="")}}const ca={_instances:new Map,create(e,t={}){const n="string"==typeof e?document.querySelector(e):e,s=new da(n,t);return n&&this._instances.set(n,s),s},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()}},ha={apiUrl:null,token:null,user:null,config:{},eventHandlers:{},initialized:!1,init(e={}){this.config={apiUrl:e.apiUrl||(()=>{if("undefined"==typeof window)return"http://localhost:3000/api";const{hostname:e,origin:t}=window.location;return"localhost"===e||"127.0.0.1"===e?`http://${e}:3000/api`:`${t}/api`})(),storageKey:e.storageKey||"auth_token",userStorageKey:e.userStorageKey||"auth_user",autoCheck:!1!==e.autoCheck},this.apiUrl=this.config.apiUrl,this.token=Q.get(this.config.storageKey),this.user=Q.get(this.config.userStorageKey),this.config.autoCheck&&this.token&&this._verifyToken().catch(()=>{this._clearToken(),this.emit("tokenExpired",null)}),this.initialized=!0},async login(e,t){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const n=await d.post(`${this.apiUrl}/auth/login`,{email:e,password:t});if(!n.success||!n.token)throw new Error(n.message||"Login failed");return this.token=n.token,this.user=n.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("login",this.user),this.user}catch(e){throw this.emit("error",e.message||"Login failed"),e}},async register(e,t,n){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const s=await d.post(`${this.apiUrl}/auth/register`,{email:e,password:t,name:n});if(!s.success||!s.token)throw new Error(s.message||"Registration failed");return this.token=s.token,this.user=s.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("register",this.user),this.user}catch(e){throw this.emit("error",e.message||"Registration failed"),e}},logout(){this.token=null,this.user=null,this._clearToken(),this._clearUser(),this.emit("logout",null)},getUser(){return this.user},isAuthenticated(){return!!this.token&&!!this.user},getHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}},getApiUrl(){return this.apiUrl},getRole(){return this.user?.role||null},hasRole(e){return this.user?.role===e},hasAnyRole(e){return e.includes(this.user?.role)},isAdmin(){return"admin"===this.user?.role},isSubscriber(){return"subscriber"===this.user?.role},isGuest(){return"guest"===this.user?.role},async _verifyToken(){if(!this.token)throw new Error("No token to verify");try{const e=await d.get(`${this.apiUrl}/auth/me`,{headers:this.getHeaders(),silent:!0});if(!e.success||!e.user)throw new Error("Token verification failed");return this.user=e.user,this._storeUser(this.user),this.user}catch(e){throw this._clearToken(),this._clearUser(),e}},_storeToken(e){Q.set(this.config.storageKey,e)},_storeUser(e){Q.set(this.config.userStorageKey,e)},_clearToken(){Q.remove(this.config.storageKey),this.token=null},_clearUser(){Q.remove(this.config.userStorageKey),this.user=null},on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)},off(e,t){this.eventHandlers[e]&&(this.eventHandlers[e]=t?this.eventHandlers[e].filter(e=>e!==t):[])},emit(e,t){this.eventHandlers[e]&&this.eventHandlers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in auth event handler for '${e}':`,t)}})}};class ua extends h{static defaults={emailPlaceholder:"your@email.com",passwordPlaceholder:"Enter your password",buttonText:"Login",showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-login-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n required>\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="email"]').value,n=e.querySelector('[name="password"]').value;this.options.onSubmit&&this.options.onSubmit(t,n);try{await ha.login(t,n),this.options.onSuccess&&this.options.onSuccess(ha.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}}class pa extends h{static defaults={namePlaceholder:"Your name",emailPlaceholder:"your@email.com",passwordPlaceholder:"Create a password",buttonText:"Register",minPasswordLength:6,showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-register-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Name</label>':""}\n <input\n type="text"\n class="form-input"\n name="name"\n placeholder="${e.namePlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Confirm Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="confirmPassword"\n placeholder="Re-enter your password"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n \x3c!-- Honeypot field - hidden from users, bots will fill it --\x3e\n <div class="form-group" style="position: absolute; left: -9999px; opacity: 0; pointer-events: none;" aria-hidden="true">\n <label for="website">Website</label>\n <input\n type="text"\n class="form-input"\n name="website"\n id="website"\n tabindex="-1"\n autocomplete="off">\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="name"]').value,n=e.querySelector('[name="email"]').value,s=e.querySelector('[name="password"]').value,o=e.querySelector('[name="confirmPassword"]').value;if(e.querySelector('[name="website"]').value)return console.warn("[Auth] Honeypot triggered - possible bot detected"),void(this.options.onError&&this.options.onError(new Error("Registration failed. Please try again.")));if(s===o){this.options.onSubmit&&this.options.onSubmit(n,s,t);try{await ha.register(n,s,t),this.options.onSuccess&&this.options.onSuccess(ha.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}else this.options.onError&&this.options.onError(new Error("Passwords do not match. Please try again."))}}class ma extends h{static defaults={activeTab:"login",loginText:"Login",registerText:"Register",onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();this.element.querySelectorAll("[data-tab]").forEach(e=>{this._addEventListener(e,"click",()=>{this.switchTab(e.getAttribute("data-tab"))})})}render(){const e=this.options,t=`\n <div class="btn-group btn-group-block" style="margin-bottom: 1.5rem;">\n <button class="btn ${"login"===e.activeTab?"active":""}" data-tab="login">\n ${e.loginText}\n </button>\n <button class="btn ${"register"===e.activeTab?"active":""}" data-tab="register">\n ${e.registerText}\n </button>\n </div>\n `;this.element.innerHTML=t}switchTab(e){this.options.activeTab=e;this.element.querySelectorAll("[data-tab]").forEach(t=>{t.getAttribute("data-tab")===e?t.classList.add("active"):t.classList.remove("active")}),this.options.onChange&&this.options.onChange(e)}}class fa extends h{static defaults={showIcon:!0,showRole:!0,logoutText:"Logout",onLogout:null};_init(){if(!this.element)return;this.render();const e=this.element.querySelector(".auth-logout-btn");e&&this._addEventListener(e,"click",()=>{this.handleLogout()}),ha.on("login",()=>this.render()),ha.on("logout",()=>this.render())}render(){const e=this.options,t=ha.getUser();if(!t)return void(this.element.innerHTML="");this.element.innerHTML="";const n=document.createElement("div");n.className="auth-user-info";const s=document.createElement("span");if(s.className="auth-user-email",e.showIcon){const e=document.createElement("span");e.setAttribute("data-icon","user"),e.setAttribute("data-icon-size","18"),s.appendChild(e)}const o=document.createTextNode(t.email);if(s.appendChild(o),!1!==e.showRole&&t.role){const e={admin:"badge-danger",subscriber:"badge-primary",guest:"badge-secondary"}[t.role]||"badge-secondary",n=document.createElement("span");n.className=`badge ${e}`,n.textContent=t.role.charAt(0).toUpperCase()+t.role.slice(1),s.appendChild(n)}const i=document.createElement("button");i.className="auth-logout-btn",i.textContent=e.logoutText,n.appendChild(s),n.appendChild(i),this.element.appendChild(n)}handleLogout(){ha.logout(),this.options.onLogout&&this.options.onLogout()}}ha.LoginForm=ua,ha.RegisterForm=pa,ha.AuthTabs=ma,ha.UserInfo=fa,ha.createLoginForm=(e,t)=>new ua(e,t),ha.createRegisterForm=(e,t)=>new pa(e,t),ha.createAuthTabs=(e,t)=>new ma(e,t),ha.createUserInfo=(e,t)=>new fa(e,t);const ga={_routes:[],_views:{},_currentRoute:null,_container:null,_defaultRoute:"/",_notFoundView:null,_middleware:[],_transitioning:!1,_routing:!1,_missedChange:!1,_shownPath:null,_transitions:{},_initialised:!1,_templateCache:{},init(e={}){if(this._initialised)return console.warn("[Domma Router] Already initialised"),this;if(this._container=document.querySelector(e.container),!this._container)throw new Error(`[Domma Router] Container "${e.container}" not found`);return this._routes=e.routes||[],this._views=e.views||{},this._defaultRoute=e.default||"/",this._notFoundView=e.notFound||"404",this._transitions=e.transitions||{enter:"fadeIn",leave:"fadeOut",duration:200},window.addEventListener("hashchange",()=>this._handleRouteChange()),this._handleRouteChange(),this._initialised=!0,"undefined"!=typeof window&&window.M&&window.M.publish("router:ready",{router:this}),this},navigate(e,t={}){this._initialised?t.replace?window.location.replace(`#${e}`):window.location.hash=e:console.error("[Domma Router] Router not initialised. Call R.init() first.")},back(){window.history.back()},forward(){window.history.forward()},current(){return this._currentRoute},view(e,t){return this._views[e]=t,this},route(e){return this._routes.push(e),this},use(e){return this._middleware.push(e),this},destroy(){window.removeEventListener("hashchange",this._handleRouteChange),this._routes=[],this._views={},this._middleware=[],this._currentRoute=null,this._shownPath=null,this._routing=!1,this._missedChange=!1,this._initialised=!1},async _handleRouteChange(){if(this._routing||this._transitioning)this._missedChange=!0;else{this._routing=!0;try{await this._routeOnce();let e=0;for(;this._missedChange&&e<5;e++){this._missedChange=!1;const e=window.location.hash.slice(1)||this._defaultRoute;if(this._shownPath===e)break;await this._routeOnce()}this._missedChange&&e>=5&&setTimeout(()=>this._handleRouteChange(),0)}finally{this._routing=!1,this._missedChange=!1}}},async _routeOnce(){const e=window.location.hash.slice(1)||this._defaultRoute,{route:t,params:n}=this._matchRoute(e);if(!t){const t=await this._renderNotFound(e);return this._matchRoute(e).route||(this._shownPath=e),t}const s=this._currentRoute,o={...t,params:n,path:e};if(await this._runMiddleware(o,s)){if(s?.onLeave){if(!1===await s.onLeave())return}if("undefined"!=typeof window&&window.M&&window.M.publish("router:beforeChange",{from:s,to:o}),t.onEnter){if(!1===await t.onEnter(n))return}t.title&&(document.title=t.title),await this._renderView(t.view,n),this._currentRoute=o,this._shownPath=e,"undefined"!=typeof window&&window.M&&window.M.publish("router:afterChange",{from:s,to:o})}},_matchRoute(e){for(const t of this._routes){const n=this._extractParams(t.path,e);if(null!==n)return{route:t,params:n}}return{route:null,params:{}}},_extractParams(e,t){const n=e.split("/").filter(Boolean),s=t.split("/").filter(Boolean);if(n.length!==s.length)return null;const o={};for(let e=0;e<n.length;e++)if(n[e].startsWith(":"))o[n[e].slice(1)]=s[e];else if(n[e]!==s[e])return null;return o},async _runMiddleware(e,t){for(const n of this._middleware){let s=!1;const o=()=>{s=!0};if(await n(e,t,o),!s)return!1}return!0},async _renderView(e,t){this._transitioning=!0;const n=this._views[e];if(!n)return console.error(`[Domma Router] View "${e}" not found`),void(this._transitioning=!1);const s="undefined"!=typeof window&&window.$?window.$:null;if(!s)return console.error("[Domma Router] jQuery/Domma $ not found. Cannot animate transitions."),this._renderViewStatic(n,t),void(this._transitioning=!1);const o=s(this._container);await new Promise(e=>{o.fadeOut(this._transitions.duration,e)}),await this._renderContent(n,t,o),await new Promise(e=>{o.fadeIn(this._transitions.duration,e)}),this._transitioning=!1},async _loadTemplate(e){if(this._templateCache[e])return this._templateCache[e];try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template: ${e} (${t.status})`);const n=await t.text();return this._templateCache[e]=n,n}catch(e){throw console.error("[Domma Router] Template load error:",e),e}},async _renderContent(e,t,n){let s;if("object"==typeof e&&e.component&&!Array.isArray(e)){const s=e.component,o=n[0]||n,i="function"==typeof e.props?e.props(t):e.props||{},r=document.createElement(s);for(const[e,t]of Object.entries(i)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?r.setAttribute(n,""):!1!==t&&null!=t&&r.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;o.firstChild;)o.removeChild(o.firstChild);return o.appendChild(r),void("function"==typeof e.onMount&&e.onMount(n))}if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(s=await e(t),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container)):"string"==typeof e&&(s=this._renderTemplate(e,t),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container));else{let o=e.template;!o&&e.templateUrl&&(o=await this._loadTemplate(e.templateUrl));let i={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));i=Object.fromEntries(n)}"function"==typeof o?s=await o(t):"string"==typeof o&&(s=this._renderTemplate(o,t,i)),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container),e.onMount&&"function"==typeof e.onMount&&e.onMount(n)}},_renderTemplate:(e,t,n={})=>"undefined"!=typeof window&&window._&&"function"==typeof window._.render?window._.render(e,t||{},{partials:n}):e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]||""),async _renderViewStatic(e,t){if("object"==typeof e&&e.component&&!Array.isArray(e)){const n=e.component,s=this._container[0]||this._container,o="function"==typeof e.props?e.props(t):e.props||{},i=document.createElement(n);for(const[e,t]of Object.entries(o)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?i.setAttribute(n,""):!1!==t&&null!=t&&i.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;s.firstChild;)s.removeChild(s.firstChild);return s.appendChild(i),"function"==typeof e.onMount&&e.onMount(this._container),void("undefined"!=typeof window&&window.I&&window.I.scan(s))}let n;if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(n=await e(t),this._container.innerHTML=n):"string"==typeof e&&(n=this._renderTemplate(e,t),this._container.innerHTML=n);else{let s=e.template;!s&&e.templateUrl&&(s=await this._loadTemplate(e.templateUrl));let o={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));o=Object.fromEntries(n)}"function"==typeof s?n=await s(t):"string"==typeof s&&(n=this._renderTemplate(s,t,o)),this._container.innerHTML=n,e.onMount&&"function"==typeof e.onMount&&e.onMount(this._container)}"undefined"!=typeof window&&window.I&&window.I.scan(this._container)},async _renderNotFound(e){if(this._views[this._notFoundView])await this._renderView(this._notFoundView,{path:e});else{const t=this._container;t.textContent="";const n=document.createElement("div");n.style.cssText="text-align: center; padding: 4rem 1rem;";const s=document.createElement("h1");s.style.cssText="font-size: 4rem; margin-bottom: 1rem;",s.textContent="404";const o=document.createElement("p");o.style.cssText="font-size: 1.25rem; color: #666;",o.textContent=`Page not found: ${e}`;const i=document.createElement("a");i.href="#/",i.style.cssText="color: #3b82f6; text-decoration: underline; margin-top: 1rem; display: inline-block;",i.textContent="Go Home",n.appendChild(s),n.appendChild(o),n.appendChild(i),t.appendChild(n)}}},va=new Map,ba=new Map;function _a(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function ya(e,t={}){if(null==e)return void 0!==t.default?"function"==typeof t.default?t.default():t.default:null;const n=t.type;if(n===ur.types?.number||"number"===n){const t=Number(e);return isNaN(t)?null:t}if(n===ur.types?.boolean||"boolean"===n)return""===e||"true"===e||"false"!==e&&Boolean(e);if(n===ur.types?.array||"array"===n||n===ur.types?.object||"object"===n)try{return JSON.parse(e)}catch{return e}return e}function ka(e,t){if(ba.has(e))return void console.warn(`[Domma Component] "${e}" is already registered.`);const{template:n,templateUrl:s,props:o={},data:i,computed:r={},methods:a={},onBeforeMount:l,onMount:d,onUpdated:h,onBeforeUnmount:u,onUnmount:p,onPropsChanged:m,style:f=""}=t,g=Object.keys(o),v=g.map(_a);class b extends _t{static get observedAttributes(){return v}constructor(){super(),this._model=null,this._props={},this._bindings=null,this._template=null,this._contentRoot=null,this._context=null,this._unsubs=[],this._computeds=new Map,this._effects=[],this._updateQueued=!1,this._teardown=!1}connectedCallback(){if(this._initialised)return this._teardown=!1,void d?.call(this._ctx());this._initialised=!0,this._initProps(),this._initModel(),this._initComputeds(),this._injectStyles(),this._contentRoot=document.createElement("div"),this._contentRoot.className="dm-component-root",this.shadowRoot.appendChild(this._contentRoot),l?.call(this._ctx()),this._renderComponent().then(()=>{this._wireBindings(),d?.call(this._ctx())})}disconnectedCallback(){this._teardown=!0,u?.call(this._ctx()),this._cleanup();for(const e of this._unsubs)e();this._unsubs=[];for(const e of this._effects)e.dispose();this._effects=[];for(const e of this._computeds.values())e.dispose();this._computeds.clear(),this._model&&this._model.destroy(),p?.call(this._ctx())}attributeChangedCallback(e,t,n){if(t===n)return;const s=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(this._props[s]=ya(n,o[s]),m?.call(this._ctx(),s,t,n),this._initialised&&this._bindings){for(const e of this._computeds.values())e.invalidate();this._rerenderFull()}}_initProps(){for(const e of g){const t=_a(e),n=this.hasAttribute(t)?this.getAttribute(t):null;this._props[e]=ya(n,o[e])}}_initModel(){const e=i?i():{},t={};for(const n of Object.keys(e))t[n]={};this._model=ur.create(t,e)}_initComputeds(){for(const[e,t]of Object.entries(r))this._computeds.set(e,Cn(()=>t.call(this._ctx()),{label:e}))}async _renderComponent(){let e=n;!e&&s&&(e=await async function(e){if(va.has(e))return va.get(e);const t=await fetch(e);if(!t.ok)throw new Error(`[Domma Component] Failed to load template: ${e} (${t.status})`);const n=await t.text();return va.set(e,n),n}(s)),e?(this._template=e,this._bindings=Ki.compile(e,this._mergeData(),this._contentRoot,(e,t)=>c.render(e,t))):this._contentRoot.textContent=""}_rerenderFull(){this._bindings&&(this._bindings.rerenderAll(this._mergeData()),h?.call(this._ctx()))}_wireBindings(){if(this._bindings){for(const e of this._bindings.bindings){const t=[...e.deps].filter(e=>this._computeds.has(e)||!Object.prototype.hasOwnProperty.call(this._props,e));if(0===t.length)continue;let n=!1;const s=En(()=>{for(const e of t)this._readBound(e);n?An(()=>{this._bindings.update(e.id,this._mergeData()),this._scheduleUpdate()}):n=!0},{label:`${this.tagName.toLowerCase()}:${e.id}`});this._effects.push(s)}this._wireUpdateWatcher()}}_wireUpdateWatcher(){if(!h||!this._model)return;let e=!1;const t=En(()=>{this._model.get(),e?An(()=>this._scheduleUpdate()):e=!0},{label:`${this.tagName.toLowerCase()}:updated`});this._effects.push(t)}_readBound(e){return this._computeds.has(e)?this._computeds.get(e).get():Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._model?this._model.get(e):void 0}_scheduleUpdate(){this._updateQueued||(this._updateQueued=!0,Promise.resolve().then(()=>{this._updateQueued=!1,!this._teardown&&this._initialised&&this._bindings&&h?.call(this._ctx())}))}_getStyles(){return"\n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n "+(f||"")}_ctx(){if(this._context)return this._context;const e=this,t={get data(){return e._model?e._model.tracked():{}},get props(){return{...e._props}},get root(){return e.shadowRoot},get el(){return e},set(t){e._model&&e._model.set(t)}};for(const[n,s]of Object.entries(r))Object.defineProperty(t,n,{get(){const t=e._computeds.get(n);return t?t.get():s.call(e._ctx())},enumerable:!0,configurable:!0});for(const[e,n]of Object.entries(a))t[e]=n.bind(t);return this._context=t,t}_mergeData(){const e=this._model?this._model.toJSON():{},t={};for(const[e,n]of this._computeds.entries())t[e]=n.get();const n={},s=this._ctx();for(const e of Object.keys(a))n[e]=s[e];const o={...n,...e,...this._props,...t},i=this._model;return dn(o,{onWrite:i?(e,t)=>i.set({[e]:t}):void 0})}}const _=e.includes("-")?e:`domma-${e}`;return customElements.define(_,b),ba.set(e,t),b}const wa={define:(e,t)=>ka(e,t),has:e=>ba.has(e),registry:()=>new Map(ba),get templateCache(){return va}},xa={"domma-badge":kt,"domma-tooltip":xt,"domma-loader":Mt,"domma-back-to-top":Lt,"domma-toast":Ct,"domma-modal":Et,"domma-card":At};function Ma(){for(const[e,t]of Object.entries(xa))customElements.get(e)||customElements.define(e,t)}Ma(),Ma();let La=!0;"undefined"!=typeof document&&document.body?document.body.classList.add("dm-cloaked"):"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",()=>{La&&document.body.classList.add("dm-cloaked")});const Ca=(e,t)=>l(e,t);Ca.version="0.52.3",Ca.buildInfo={version:"0.52.3",built:"15/10/2026 16:36",commit:"e7ca3a1"},Ca.http=d,Ca.utils=c,Ca.setup=e=>(!1===e.cloak&&(La=!1,"undefined"!=typeof document&&document.body&&(document.body.classList.remove("dm-cloaked"),document.body.classList.add("dm-ready"))),e.noStyles?b.init({disabled:!0}):(e.theme||e.autoDetectTheme)&&b.init({theme:e.theme,autoDetect:e.autoDetectTheme,persist:!1!==e.persistTheme}),e.scanIcons&&la.scan(),Er.process(e)),Ca.update=(e,t)=>Er.update(e,t),Ca.config=e=>Er.config(e),Ca.getComponent=e=>Er.getComponent(e),Ca.reset=e=>Er.reset(e),Ca.ready=e=>Er.ready(e),Ca.models=ur,Ca.elements=ln,Ca.effects=Cr,Ca.dates=Or,Ca.tables=ca,Ca.forms=mr,Ca.theme=b,Ca.icons=la,Ca.storage=Q,Ca.auth=ha,Ca.router=ga,Ca.sanitize=r,Ca.components=wa,Ca.component=(e,t)=>ka(e,t),Ca.DesktopNotification=Ot;const Ea=Ca,Aa=c,Sa=ur,$a=Or,za=Q,ja=ha,Ba=mr,Ta=d,Da=ln,Wa=la,Ha=ca,Oa=ga,Ia={extend:ur.extend.bind(ur),pick:ur.pick.bind(ur),omit:ur.omit.bind(ur)};if(Ca.M=Sa,Ca.D=$a,Ca.S=za,Ca.A=ja,Ca.F=Ba,Ca.H=Ta,Ca.E=Da,Ca.I=Wa,Ca.T=Ha,Ca.R=Oa,Ca.B=Ia,"undefined"!=typeof window&&(window.Domma=Ca,window.$=Ea,window._=Aa,window.M=Sa,window.D=$a,window.S=za,window.A=ja,window.F=Ba,window.H=Ta,window.E=Da,window.I=Wa,window.T=Ha,window.R=Oa,window.B=Ia),"undefined"!=typeof document){const e=()=>{La&&document.body.classList.contains("dm-cloaked")&&document.body.classList.add("dm-ready")};"complete"===document.readyState?setTimeout(e,0):window.addEventListener("load",e)}e.$=Ea,e.A=ja,e.B=Ia,e.D=$a,e.Domma=Ca,e.E=Da,e.F=Ba,e.H=Ta,e.I=Wa,e.M=Sa,e.R=Oa,e.S=za,e.T=Ha,e._=Aa,e.components=wa,e.default=Ca,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
8
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Domma={})}(this,function(e){"use strict";function t(e){if(null==e)return"";const t=document.createElement("div");return t.textContent=String(e),t.innerHTML}function n(){return"undefined"!=typeof window&&void 0!==window.DOMPurify}const s={ALLOWED_TAGS:["b","i","em","strong","u","s","mark","small","del","ins","sub","sup","p","br","hr","div","span","blockquote","pre","code","ul","ol","li","dl","dt","dd","h1","h2","h3","h4","h5","h6","a","table","thead","tbody","tfoot","tr","th","td","caption","col","colgroup","img","figure","figcaption","article","section","nav","aside","header","footer","main","time","address"],ALLOWED_ATTR:["href","title","target","rel","class","id","alt","src","width","height","colspan","rowspan","aria-label","aria-describedby","aria-hidden","role"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i,ALLOW_DATA_ATTR:!1,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!0,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,FORCE_BODY:!0},o={default:s,strict:{ALLOWED_TAGS:["b","i","em","strong","p","br","a","ul","ol","li"],ALLOWED_ATTR:["href","title","target"],ALLOW_DATA_ATTR:!1},basic:{ALLOWED_TAGS:["b","i","em","strong","br"],ALLOWED_ATTR:[],ALLOW_DATA_ATTR:!1}};function i(e,i={}){if(null==e||""===e)return"";if(e=String(e),n()){const n=i.preset||"default",r={...o[n]||s,...i.allowedTags&&{ALLOWED_TAGS:i.allowedTags},...i.allowedAttrs&&{ALLOWED_ATTR:i.allowedAttrs},...void 0!==i.allowDataAttrs&&{ALLOW_DATA_ATTR:i.allowDataAttrs}};try{return window.DOMPurify.sanitize(e,r)}catch(n){return console.error("DOMPurify sanitisation failed:",n),t(e)}}return console.warn("DOMPurify not available. Using HTML escape fallback. For better XSS protection, include DOMPurify."),t(e)}"undefined"==typeof window||n()||console.warn("%c⚠️ Security Warning: DOMPurify not loaded","color: orange; font-weight: bold; font-size: 14px;","\nFor robust XSS protection, include DOMPurify before Domma:",'\n<script src="https://cdn.jsdelivr.net/npm/dompurify@3/dist/purify.min.js"><\/script>',"\nCurrently using HTML escape fallback.");var r={sanitise:i,sanitiseBasic:function(e){return i(e,{preset:"basic"})},sanitiseUserContent:function(e){return i(e,{preset:"strict"})},escape:function(e){return t(e)},hasDOMPurify:function(){return n()}};class a{constructor(e,t){if("string"==typeof e)if(e.trim().startsWith("<")){const t=document.createElement("div");t.innerHTML=e.trim(),this.elements=Array.from(t.children)}else{const n=t||document;this.elements=Array.from(n.querySelectorAll(e))}else e instanceof Node?this.elements=[e]:e instanceof NodeList||e instanceof HTMLCollection?this.elements=Array.from(e):Array.isArray(e)?this.elements=e.filter(e=>e instanceof HTMLElement):this.elements=e instanceof a?[...e.elements]:[];this.length=this.elements.length;for(let e=0;e<this.elements.length;e++)this[e]=this.elements[e]}find(e){const t=[];return this.elements.forEach(n=>{t.push(...n.querySelectorAll(e))}),new a(t)}children(e){const t=[];return this.elements.forEach(e=>{t.push(...e.children)}),new a(e?t.filter(t=>t.matches(e)):t)}parent(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&(e&&!n.parentElement.matches(e)||t.includes(n.parentElement)||t.push(n.parentElement))}),new a(t)}parents(e){const t=[];return this.elements.forEach(n=>{let s=n.parentElement;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.parentElement}),new a(t)}closest(e){const t=[];return this.elements.forEach(n=>{const s=n.closest(e);s&&!t.includes(s)&&t.push(s)}),new a(t)}siblings(e){const t=[];return this.elements.forEach(n=>{n.parentElement&&Array.from(n.parentElement.children).forEach(s=>{s===n||t.includes(s)||e&&!s.matches(e)||t.push(s)})}),new a(t)}next(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new a(t)}nextAll(e){const t=[];return this.elements.forEach(n=>{let s=n.nextElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.push(s),s=s.nextElementSibling}),new a(t)}prev(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;s&&(e&&!s.matches(e)||t.push(s))}),new a(t)}prevAll(e){const t=[];return this.elements.forEach(n=>{let s=n.previousElementSibling;for(;s;)e&&!s.matches(e)||t.includes(s)||t.unshift(s),s=s.previousElementSibling}),new a(t)}first(){return new a(this.elements[0]?[this.elements[0]]:[])}last(){return new a(this.elements.length?[this.elements[this.elements.length-1]]:[])}eq(e){const t=e<0?this.elements.length+e:e;return new a(this.elements[t]?[this.elements[t]]:[])}get(e){if(void 0===e)return this.elements;const t=e<0?this.elements.length+e:e;return this.elements[t]}filter(e){return new a("function"==typeof e?this.elements.filter((t,n)=>e.call(t,n,t)):this.elements.filter(t=>t.matches(e)))}not(e){return new a("function"==typeof e?this.elements.filter((t,n)=>!e.call(t,n,t)):this.elements.filter(t=>!t.matches(e)))}is(e){return this.elements.some(t=>t.matches(e))}has(e){return new a(this.elements.filter(t=>t.querySelector(e)))}add(e){const t=new a(e),n=[...this.elements];return t.elements.forEach(e=>{n.includes(e)||n.push(e)}),new a(n)}contents(){const e=[];return this.elements.forEach(t=>{e.push(...t.childNodes)}),new a(e)}toArray(){return[...this.elements]}index(e){if(void 0===e){const e=this.elements[0];return e&&e.parentElement?Array.from(e.parentElement.children).indexOf(e):-1}return"string"==typeof e?new a(e).elements.indexOf(this.elements[0]):this.elements.indexOf(e)}each(e){return this.elements.forEach((t,n)=>e.call(t,n,t)),this}html(e,t={}){if(void 0===e){const e=this.elements[0];return e?e.innerHTML:""}return!1!==t.safe&&(e=r.sanitise(e,t)),this.each((t,n)=>{n.innerHTML=e})}text(e){return void 0===e?this.elements.map(e=>e.textContent).join(""):this.each((t,n)=>{n.textContent=e})}val(e){if(void 0===e){const e=this.elements[0];if(!e)return;return"checkbox"===e.type||"radio"===e.type?e.checked?e.value:void 0:"SELECT"===e.tagName&&e.multiple?Array.from(e.selectedOptions).map(e=>e.value):e.value}return this.each((t,n)=>{"checkbox"===n.type||"radio"===n.type?n.checked=Array.isArray(e)?e.includes(n.value):n.value===e:"SELECT"===n.tagName&&n.multiple&&Array.isArray(e)?Array.from(n.options).forEach(t=>{t.selected=e.includes(t.value)}):n.value=e})}attr(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.setAttribute(e,t)})}):void 0===t?this.elements[0]?this.elements[0].getAttribute(e):void 0:this.each((n,s)=>{s.setAttribute(e,t)})}removeAttr(e){const t=e.split(/\s+/);return this.each((e,n)=>{t.forEach(e=>n.removeAttribute(e))})}prop(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n[e]=t})}):void 0===t?this.elements[0]?this.elements[0][e]:void 0:this.each((n,s)=>{s[e]=t})}removeProp(e){return this.each((t,n)=>{delete n[e]})}data(e,t){if(void 0===e){const e=this.elements[0];if(!e)return;const t={};return Object.keys(e.dataset).forEach(n=>{t[n]=e.dataset[n]}),t}return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.dataset[e]=t})}):void 0===t?this.elements[0]?this.elements[0].dataset[e]:void 0:this.each((n,s)=>{s.dataset[e]=t})}removeData(e){return this.each((t,n)=>{delete n.dataset[e]})}css(e,t){return"object"==typeof e?this.each((t,n)=>{Object.entries(e).forEach(([e,t])=>{n.style[e]=t})}):void 0===t?this.elements[0]?getComputedStyle(this.elements[0])[e]:"":this.each((n,s)=>{s.style[e]=t})}addClass(e){if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.add(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.add(...t)})}removeClass(e){if(void 0===e)return this.each((e,t)=>{t.className=""});if("function"==typeof e)return this.each((t,n)=>{const s=e.call(n,t,n.className);s&&n.classList.remove(...s.split(/\s+/).filter(Boolean))});const t=e.split(/\s+/).filter(Boolean);return this.each((e,n)=>{n.classList.remove(...t)})}toggleClass(e,t){if("function"==typeof e)return this.each((n,s)=>{const o=e.call(s,n,s.className,t);o&&o.split(/\s+/).filter(Boolean).forEach(e=>{s.classList.toggle(e,t)})});const n=e.split(/\s+/).filter(Boolean);return this.each((e,s)=>{n.forEach(e=>{s.classList.toggle(e,t)})})}hasClass(e){return this.elements.some(t=>t.classList.contains(e))}append(e){const t=this.elements.length-1;return this.each((n,s)=>{this._getNodes(e,n,s,n===t).forEach(e=>s.appendChild(e))})}prepend(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.firstChild;o.forEach(e=>s.insertBefore(e,i))})}after(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode,r=s.nextSibling;o.forEach(e=>i.insertBefore(e,r))})}before(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode;o.forEach(e=>i.insertBefore(e,s))})}appendTo(e){return new a(e).append(this),this}prependTo(e){return new a(e).prepend(this),this}insertAfter(e){return new a(e).after(this),this}insertBefore(e){return new a(e).before(this),this}wrap(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);n.parentNode&&(n.parentNode.insertBefore(s,n),s.appendChild(n))})}wrapAll(e){if(0===this.elements.length)return this;const t=this._getWrapper(e,0,this.elements[0]);return this.elements[0].parentNode.insertBefore(t,this.elements[0]),this.elements.forEach(e=>t.appendChild(e)),this}wrapInner(e){return this.each((t,n)=>{const s=this._getWrapper(e,t,n);for(;n.firstChild;)s.appendChild(n.firstChild);n.appendChild(s)})}unwrap(e){return this.parent(e).each((e,t)=>{const n=t.parentNode;for(;t.firstChild;)n.insertBefore(t.firstChild,t);n.removeChild(t)}),this}remove(e){return(e?this.filter(e):this).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this}detach(){return this.remove()}empty(){return this.each((e,t)=>{t.innerHTML=""})}clone(e=!0){return new a(this.elements.map(t=>t.cloneNode(e)))}replaceWith(e){const t=this.elements.length-1;return this.each((n,s)=>{const o=this._getNodes(e,n,s,n===t),i=s.parentNode;o.forEach((e,t)=>{0===t?i.replaceChild(e,s):i.insertBefore(e,o[t-1].nextSibling)})})}replaceAll(e){return new a(e).replaceWith(this),this}_getNodes(e,t,n,s=!0){if("function"==typeof e&&(e=e.call(n,t,n.innerHTML)),"string"==typeof e){if(e.trim().startsWith("<")){const t=document.createElement("div");return t.innerHTML=e,Array.from(t.childNodes)}return[document.createTextNode(e)]}return e instanceof HTMLElement?[s?e:e.cloneNode(!0)]:e instanceof a?e.elements.map(e=>s?e:e.cloneNode(!0)):[]}_getWrapper(e,t,n){let s;if("function"==typeof e&&(e=e.call(n,t)),"string"==typeof e){const t=document.createElement("div");t.innerHTML=e.trim(),s=t.firstElementChild}else s=e instanceof HTMLElement?e.cloneNode(!0):e instanceof a?e.elements[0].cloneNode(!0):document.createElement("div");return s}on(e,t,n){"function"==typeof t&&(n=t,t=null);const s=e.split(/\s+/);return this.each((e,o)=>{s.forEach(e=>{if(t){const s=e=>{const s=e.target.closest(t);s&&o.contains(s)&&n.call(s,e)};o.addEventListener(e,s),o._dommaHandlers=o._dommaHandlers||[],o._dommaHandlers.push({event:e,selector:t,handler:n,delegated:s})}else o.addEventListener(e,n)})})}off(e,t,n){return"function"==typeof t&&(n=t,t=null),this.each((s,o)=>{if(e){e.split(/\s+/).forEach(e=>{t&&o._dommaHandlers?o._dommaHandlers=o._dommaHandlers.filter(s=>!!(s.event!==e||s.selector!==t||n&&s.handler!==n)||(o.removeEventListener(e,s.delegated),!1)):n&&o.removeEventListener(e,n)})}})}one(e,t,n){"function"==typeof t&&(n=t,t=null);const s=this,o=function(i){n.call(this,i),s.off(e,t,o)};return this.on(e,t,o)}trigger(e,t){const n=new CustomEvent(e,{detail:t,bubbles:!0,cancelable:!0});return this.each((e,t)=>{t.dispatchEvent(n)})}triggerNative(e){return this.each((t,n)=>{const s=new Event(e,{bubbles:!0,cancelable:!0});n.dispatchEvent(s)})}click(e){return e?this.on("click",e):this.triggerNative("click")}dblclick(e){return e?this.on("dblclick",e):this.trigger("dblclick")}mousedown(e){return e?this.on("mousedown",e):this.trigger("mousedown")}mouseup(e){return e?this.on("mouseup",e):this.trigger("mouseup")}mousemove(e){return e?this.on("mousemove",e):this.trigger("mousemove")}mouseover(e){return e?this.on("mouseover",e):this.trigger("mouseover")}mouseout(e){return e?this.on("mouseout",e):this.trigger("mouseout")}mouseenter(e){return e?this.on("mouseenter",e):this.trigger("mouseenter")}mouseleave(e){return e?this.on("mouseleave",e):this.trigger("mouseleave")}keydown(e){return e?this.on("keydown",e):this.trigger("keydown")}keyup(e){return e?this.on("keyup",e):this.trigger("keyup")}keypress(e){return e?this.on("keypress",e):this.trigger("keypress")}focus(e){return e?this.on("focus",e):this.each((e,t)=>t.focus())}blur(e){return e?this.on("blur",e):this.each((e,t)=>t.blur())}change(e){return e?this.on("change",e):this.trigger("change")}select(e){return e?this.on("select",e):this.trigger("select")}submit(e){return e?this.on("submit",e):this.each((e,t)=>{t.submit&&t.submit()})}scroll(e){return e?this.on("scroll",e):this.trigger("scroll")}resize(e){return e?this.on("resize",e):this.trigger("resize")}hover(e,t){return this.on("mouseenter",e),t?this.on("mouseleave",t):this.on("mouseleave",e),this}show(e,t){return this.each((n,s)=>{e?(s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",t&&setTimeout(()=>t.call(s),this._getDuration(e))})):(s.style.display="",t&&t.call(s))})}hide(e,t){return this.each((n,s)=>{e?(s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))):(s.style.display="none",t&&t.call(s))})}toggle(e,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new a(s).show(e,t):new a(s).hide(e,t)})}fadeIn(e=400,t){return this.each((n,s)=>{s.style.display="",s.style.opacity="0",s.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.opacity="1",setTimeout(()=>{s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}fadeOut(e=400,t){return this.each((n,s)=>{s.style.transition=`opacity ${this._getDuration(e)}ms`,s.style.opacity="0",setTimeout(()=>{s.style.display="none",s.style.opacity="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})}fadeToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display||"0"===getComputedStyle(s).opacity?new a(s).fadeIn(e,t):new a(s).fadeOut(e,t)})}fadeTo(e,t,n){return this.each((s,o)=>{o.style.display="",o.style.transition=`opacity ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{o.style.opacity=String(t),setTimeout(()=>{o.style.transition="",n&&n.call(o)},this._getDuration(e))})})}slideUp(e=400,t){return this.each((n,s)=>{const o=s.offsetHeight;s.style.overflow="hidden",s.style.height=o+"px",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height="0",setTimeout(()=>{s.style.display="none",s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideDown(e=400,t){return this.each((n,s)=>{s.style.display="";const o=s.scrollHeight;s.style.overflow="hidden",s.style.height="0",s.style.transition=`height ${this._getDuration(e)}ms`,requestAnimationFrame(()=>{s.style.height=o+"px",setTimeout(()=>{s.style.height="",s.style.overflow="",s.style.transition="",t&&t.call(s)},this._getDuration(e))})})}slideToggle(e=400,t){return this.each((n,s)=>{"none"===getComputedStyle(s).display?new a(s).slideDown(e,t):new a(s).slideUp(e,t)})}animate(e,t=400,n="ease",s){"function"==typeof t?(s=t,t=400,n="ease"):"function"==typeof n&&(s=n,n="ease");const o=Object.keys(e).join(", "),i=this._getDuration(t);return this.each((t,r)=>{r.style.transition=`${o} ${i}ms ${n}`,requestAnimationFrame(()=>{Object.entries(e).forEach(([e,t])=>{r.style[e]="number"==typeof t?t+"px":t}),setTimeout(()=>{r.style.transition="",s&&s.call(r)},i)})})}stop(){return this.each((e,t)=>{const n=getComputedStyle(t);t.style.transition="none",["opacity","height","width"].forEach(e=>{t.style[e]&&(t.style[e]=n[e])})})}delay(e){return new Promise(t=>{setTimeout(()=>t(this),e)})}_getDuration(e){return"number"==typeof e?e:"fast"===e?200:"slow"===e?600:400}width(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().width}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new a(n).width()):e;n.style.width="number"==typeof s?s+"px":s})}height(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e.getBoundingClientRect().height}return this.each((t,n)=>{const s="function"==typeof e?e.call(n,t,new a(n).height()):e;n.style.height="number"==typeof s?s+"px":s})}innerWidth(){const e=this.elements[0];return e?e.clientWidth:void 0}innerHeight(){const e=this.elements[0];return e?e.clientHeight:void 0}outerWidth(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetWidth;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginLeft)+parseFloat(e.marginRight)}return n}outerHeight(e=!1){const t=this.elements[0];if(!t)return;let n=t.offsetHeight;if(e){const e=getComputedStyle(t);n+=parseFloat(e.marginTop)+parseFloat(e.marginBottom)}return n}offset(e){if(void 0===e){const e=this.elements[0];if(!e)return;const t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}return this.each((t,n)=>{"static"===getComputedStyle(n).position&&(n.style.position="relative");const s=new a(n).offset(),o=parseFloat(getComputedStyle(n).left)||0,i=parseFloat(getComputedStyle(n).top)||0;void 0!==e.left&&(n.style.left=o+e.left-s.left+"px"),void 0!==e.top&&(n.style.top=i+e.top-s.top+"px")})}position(){const e=this.elements[0];if(e)return{top:e.offsetTop,left:e.offsetLeft}}scrollTop(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageYOffset:e.scrollTop}return this.each((t,n)=>{n===window?window.scrollTo(window.pageXOffset,e):n.scrollTop=e})}scrollLeft(e){if(void 0===e){const e=this.elements[0];if(!e)return;return e===window?window.pageXOffset:e.scrollLeft}return this.each((t,n)=>{n===window?window.scrollTo(e,window.pageYOffset):n.scrollLeft=e})}offsetParent(){return new a(this.elements.map(e=>e.offsetParent||document.body))}}const l=(e,t)=>"function"==typeof e?("loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e(),new a([])):new a(e,t),d={async request(e,t,n=null,s={}){const o={method:e,headers:{...s.headers},credentials:s.credentials||"include",...s};n&&"GET"!==e&&"HEAD"!==e&&(o.headers["Content-Type"]="application/json",o.body=JSON.stringify(n));try{const e=await fetch(t,o);if(!e.ok){let t=`HTTP Error: ${e.status}`;try{const n=await e.json();n.message?t=n.message:n.error&&(t=n.error)}catch(n){t=`HTTP Error: ${e.status} ${e.statusText}`}throw new Error(t)}return await e.json()}catch(e){throw s.silent||console.error("Domma HTTP Error:",e),e}},get(e,t){return this.request("GET",e,null,t)},post(e,t,n){return this.request("POST",e,t,n)},put(e,t,n){return this.request("PUT",e,t,n)},patch(e,t,n){return this.request("PATCH",e,t,n)},delete(e,t){return this.request("DELETE",e,{delete:!0},t)},head(e,t){return this.request("HEAD",e,null,t)},options(e,t){return this.request("OPTIONS",e,null,t)}},c={chunk(e,t=1){if(!e||t<1)return[];const n=[];for(let s=0;s<e.length;s+=t)n.push(e.slice(s,s+t));return n},compact:e=>e?e.filter(Boolean):[],concat:(e,...t)=>e?e.concat(...t):[],difference(e,...t){if(!e)return[];const n=new Set(t.flat());return e.filter(e=>!n.has(e))},differenceBy(e,t,n){if(!e)return[];const s=new Set(t.map(n));return e.filter(e=>!s.has(n(e)))},differenceWith:(e,t,n)=>e?e.filter(e=>!t.some(t=>n(e,t))):[],drop:(e,t=1)=>e?e.slice(t):[],dropRight(e,t=1){if(!e)return[];const n=e.length-t;return n>0?e.slice(0,n):[]},dropRightWhile(e,t){if(!e)return[];let n=e.length;for(;n--&&t(e[n],n,e););return e.slice(0,n+1)},dropWhile(e,t){if(!e)return[];let n=0;for(;n<e.length&&t(e[n],n,e);)n++;return e.slice(n)},eq:(e,t)=>e===t||e!=e&&t!=t,fill:(e,t,n=0,s)=>e?e.fill(t,n,s):[],findIndex(e,t,n=0){if(!e)return-1;for(let s=n;s<e.length;s++)if(t(e[s],s,e))return s;return-1},findLastIndex(e,t,n){if(!e)return-1;for(let s=void 0!==n?n:e.length-1;s>=0;s--)if(t(e[s],s,e))return s;return-1},first:e=>e?e[0]:void 0,head(e){return this.first(e)},flatten:e=>e?e.flat(1):[],flattenDeep:e=>e?e.flat(1/0):[],flattenDepth:(e,t=1)=>e?e.flat(t):[],fromPairs:e=>e?Object.fromEntries(e):{},indexOf:(e,t,n=0)=>e?e.indexOf(t,n):-1,initial:e=>e?e.slice(0,-1):[],intersection(...e){if(!e.length)return[];return e[0].filter(t=>e.every(e=>e.includes(t)))},join:(e,t=",")=>e?e.join(t):"",last:e=>e?e[e.length-1]:void 0,lastIndexOf:(e,t,n)=>e?void 0!==n?e.lastIndexOf(t,n):e.lastIndexOf(t):-1,nth(e,t=0){if(e)return t<0?e[e.length+t]:e[t]},pull(e,...t){if(!e)return[];const n=new Set(t);for(let t=e.length-1;t>=0;t--)n.has(e[t])&&e.splice(t,1);return e},pullAt(e,...t){if(!e)return[];const n=t.flat().sort((e,t)=>t-e),s=[];return n.forEach(t=>{t>=0&&t<e.length&&s.unshift(e.splice(t,1)[0])}),s},reverse:e=>e?e.reverse():[],slice:(e,t=0,n)=>e?void 0!==n?e.slice(t,n):e.slice(t):[],tail:e=>e?e.slice(1):[],take:(e,t=1)=>e?e.slice(0,t):[],takeRight(e,t=1){if(!e)return[];const n=Math.max(0,e.length-t);return e.slice(n)},union:(...e)=>[...new Set(e.flat())],uniq:e=>e?[...new Set(e)]:[],uniqBy(e,t){if(!e)return[];const n=new Set;return e.filter(e=>{const s=t(e);return!n.has(s)&&(n.add(s),!0)})},without(e,...t){if(!e)return[];const n=new Set(t);return e.filter(e=>!n.has(e))},xor(...e){if(!e.length)return[];const t=new Map;return e.flat().forEach(e=>{t.set(e,(t.get(e)||0)+1)}),[...t.entries()].filter(([,e])=>1===e).map(([e])=>e)},zip(...e){if(!e.length)return[];const t=Math.max(...e.map(e=>e.length)),n=[];for(let s=0;s<t;s++)n.push(e.map(e=>e[s]));return n},zipObject(e,t){if(!e)return{};const n={};return e.forEach((e,s)=>{n[e]=t?t[s]:void 0}),n},times(e,t){if((e=Math.floor(e))<1)return[];const n=new Array(e);for(let s=0;s<e;s++)n[s]=t?t(s):s;return n},range(e,t,n){if(void 0===t&&(t=e,e=0),0===(n=void 0===n?e<t?1:-1:n))return[];const s=Math.max(Math.ceil((t-e)/(n||1)),0),o=new Array(s);for(let t=0;t<s;t++)o[t]=e+t*n;return o},uniqueId:(()=>{let e=0;return function(t=""){const n=++e;return t?`${t}${n}`:String(n)}})(),countBy(e,t){const n={};return this.each(e,e=>{const s=t(e);n[s]=(n[s]||0)+1}),n},each:(e,t)=>(Array.isArray(e)?e.forEach((n,s)=>t(n,s,e)):e&&"object"==typeof e&&Object.keys(e).forEach(n=>t(e[n],n,e)),e),forEach(e,t){return this.each(e,t)},eachRight(e,t){if(Array.isArray(e))for(let n=e.length-1;n>=0;n--)t(e[n],n,e);else if(e&&"object"==typeof e){Object.keys(e).reverse().forEach(n=>t(e[n],n,e))}return e},forEachRight(e,t){return this.eachRight(e,t)},every:(e,t)=>Array.isArray(e)?e.every(t):!e||"object"!=typeof e||Object.values(e).every(t),filter:(e,t)=>Array.isArray(e)?e.filter(t):e&&"object"==typeof e?Object.values(e).filter(t):[],find:(e,t)=>Array.isArray(e)?e.find(t):e&&"object"==typeof e?Object.values(e).find(t):void 0,findLast(e,t){if(Array.isArray(e)){for(let n=e.length-1;n>=0;n--)if(t(e[n],n,e))return e[n]}else if(e&&"object"==typeof e){return Object.values(e).reverse().find(t)}},flatMap(e,t){return this.map(e,t).flat(1)},flatMapDeep(e,t){return this.map(e,t).flat(1/0)},groupBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]||(n[s]=[]),n[s].push(e)}),n},includes:(e,t,n=0)=>"string"==typeof e||Array.isArray(e)?e.includes(t,n):!(!e||"object"!=typeof e)&&Object.values(e).includes(t),keyBy(e,t){const n={};return this.each(e,e=>{const s="function"==typeof t?t(e):e[t];n[s]=e}),n},map:(e,t)=>Array.isArray(e)?e.map(t):e&&"object"==typeof e?Object.entries(e).map(([n,s])=>t(s,n,e)):[],orderBy(e,t,n){const s=Array.isArray(e)?[...e]:Object.values(e),o=Array.isArray(t)?t:[t],i=Array.isArray(n)?n:[n||"asc"];return s.sort((e,t)=>{for(let n=0;n<o.length;n++){const s=o[n],r=i[n]||"asc",a="function"==typeof s?s(e):e[s],l="function"==typeof s?s(t):t[s];if(a<l)return"asc"===r?-1:1;if(a>l)return"asc"===r?1:-1}return 0})},partition(e,t){const n=[],s=[];return this.each(e,(o,i)=>{t(o,i,e)?n.push(o):s.push(o)}),[n,s]},reduce(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduce(t,n):e.reduce(t);if(e&&"object"==typeof e){const s=Object.entries(e);let o=n,i=0;void 0===o&&s.length>0&&(o=s[0][1],i=1);for(let n=i;n<s.length;n++){const[i,r]=s[n];o=t(o,r,i,e)}return o}return n},reduceRight(e,t,n){if(Array.isArray(e))return void 0!==n?e.reduceRight(t,n):e.reduceRight(t);if(e&&"object"==typeof e){const s=Object.entries(e).reverse();let o=n,i=0;void 0===o&&s.length>0&&(o=s[0][1],i=1);for(let n=i;n<s.length;n++){const[i,r]=s[n];o=t(o,r,i,e)}return o}return n},reject(e,t){return this.filter(e,(e,n,s)=>!t(e,n,s))},sample(e){const t=Array.isArray(e)?e:Object.values(e||{});return t[Math.floor(Math.random()*t.length)]},sampleSize(e,t=1){return this.shuffle(Array.isArray(e)?[...e]:Object.values(e||{})).slice(0,t)},shuffle(e){const t=Array.isArray(e)?[...e]:Object.values(e||{});for(let e=t.length-1;e>0;e--){const n=Math.floor(Math.random()*(e+1));[t[e],t[n]]=[t[n],t[e]]}return t},size:e=>null==e?0:"string"==typeof e||Array.isArray(e)?e.length:"object"==typeof e?Object.keys(e).length:0,some:(e,t)=>Array.isArray(e)?e.some(t):!(!e||"object"!=typeof e)&&Object.values(e).some(t),sortBy:(e,t)=>(Array.isArray(e)?[...e]:Object.values(e)).sort((e,n)=>{const s="function"==typeof t?t(e):e[t],o="function"==typeof t?t(n):n[t];return s<o?-1:s>o?1:0}),after(e,t){let n=0;return function(...s){if(++n>=e)return t.apply(this,s)}},ary:(e,t=e.length)=>function(...n){return e.apply(this,n.slice(0,t))},before(e,t){let n,s=0;return function(...o){return++s<e&&(n=t.apply(this,o)),n}},bind:(e,t,...n)=>function(...s){return e.apply(t,[...n,...s])},curry:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...s,...e])}},curryRight:(e,t=e.length)=>function n(...s){return s.length>=t?e.apply(this,s):function(...e){return n.apply(this,[...e,...s])}},debounce(e,t=0,n={}){let s,o,i,r,a,l=0;const d=n.leading||!1,c=!1!==n.trailing,h=n.maxWait;function u(t){const n=o,s=i;return o=i=void 0,l=t,r=e.apply(s,n),r}function p(e){const n=e-a;return void 0===a||n>=t||n<0||void 0!==h&&e-l>=h}function m(){const e=Date.now();if(p(e))return f(e);s=setTimeout(m,function(e){const n=e-a,s=e-l,o=t-n;return void 0!==h?Math.min(o,h-s):o}(e))}function f(e){return s=void 0,c&&o?u(e):(o=i=void 0,r)}function g(...e){const n=Date.now(),c=p(n);if(o=e,i=this,a=n,c){if(void 0===s)return function(e){return l=e,s=setTimeout(m,t),d?u(e):r}(a);if(void 0!==h)return s=setTimeout(m,t),u(a)}return void 0===s&&(s=setTimeout(m,t)),r}return g.cancel=function(){void 0!==s&&clearTimeout(s),l=0,o=a=i=s=void 0},g.flush=function(){return void 0===s?r:f(Date.now())},g},defer(e,...t){return setTimeout(()=>e.apply(this,t),1)},delay(e,t,...n){return setTimeout(()=>e.apply(this,n),t)},flip:e=>function(...t){return e.apply(this,t.reverse())},flow(...e){const t=e.length;return 0===t?function(e){return e}:1===t?e[0]:function(...n){let s=e[0].apply(this,n);for(let n=1;n<t;n++)s=e[n].call(this,s);return s}},compose(...e){return this.flow(...e.reverse())},memoize(e,t){const n=new Map,s=function(...s){const o=t?t.apply(this,s):s[0];if(n.has(o))return n.get(o);const i=e.apply(this,s);return n.set(o,i),i};return s.cache=n,s},negate:e=>function(...t){return!e.apply(this,t)},once(e){return this.before(2,e)},partial:(e,...t)=>function(...n){return e.apply(this,[...t,...n])},partialRight:(e,...t)=>function(...n){return e.apply(this,[...n,...t])},throttle(e,t=0,n={}){const s=!1!==n.leading,o=!1!==n.trailing;return this.debounce(e,t,{leading:s,trailing:o,maxWait:t})},unary(e){return this.ary(e,1)},wrap:(e,t)=>function(...n){return t.apply(this,[e,...n])},assign:(e,...t)=>Object.assign(e||{},...t),assignIn(e,...t){const n=e||{};return t.forEach(e=>{if(e)for(const t in e)n[t]=e[t]}),n},extend(e,...t){return this.assignIn(e,...t)},at(e,...t){return t.flat().map(t=>this.get(e,t))},clone:e=>null===e||"object"!=typeof e?e:Array.isArray(e)?[...e]:{...e},cloneDeep(e){if(null===e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(e=>this.cloneDeep(e));if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=this.cloneDeep(e[n]));return t},defaults(e,...t){const n=e||{};return t.forEach(e=>{e&&Object.keys(e).forEach(t=>{void 0===n[t]&&(n[t]=e[t])})}),n},defaultsDeep(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],o=e[t];void 0===s?n[t]=this.cloneDeep(o):s&&"object"==typeof s&&o&&"object"==typeof o&&!Array.isArray(s)&&!Array.isArray(o)&&this.defaultsDeep(s,o)})}),n},entries:e=>e?Object.entries(e):[],toPairs(e){return this.entries(e)},findKey(e,t){if(e)for(const n of Object.keys(e))if(t(e[n],n,e))return n},findLastKey(e,t){if(!e)return;const n=Object.keys(e).reverse();for(const s of n)if(t(e[s],s,e))return s},forIn(e,t){if(e)for(const n in e)if(!1===t(e[n],n,e))break;return e},forOwn(e,t){if(e)for(const n of Object.keys(e))if(!1===t(e[n],n,e))break;return e},get(e,t,n){if(!e)return n;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let o=e;for(const e of s){if(null==o)return n;o=o[e]}return void 0===o?n:o},has(e,t){if(!e)return!1;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(const e of n){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;s=s[e]}return!0},invert(e){const t={};return e&&Object.entries(e).forEach(([e,n])=>{t[n]=e}),t},invertBy(e,t=e=>e){const n={};return e&&Object.entries(e).forEach(([e,s])=>{const o=t(s);n[o]||(n[o]=[]),n[o].push(e)}),n},keys:e=>e?Object.keys(e):[],keysIn(e){const t=[];for(const n in e)t.push(n);return t},mapKeys(e,t){const n={};return e&&Object.entries(e).forEach(([s,o])=>{n[t(o,s,e)]=o}),n},mapValues(e,t){const n={};return e&&Object.entries(e).forEach(([s,o])=>{n[s]=t(o,s,e)}),n},merge(e,...t){const n=e||{};return t.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(t=>{const s=n[t],o=e[t];s&&"object"==typeof s&&o&&"object"==typeof o&&!Array.isArray(s)&&!Array.isArray(o)?this.merge(s,o):n[t]=o})}),n},omit(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return Object.keys(e).forEach(t=>{n.has(t)||(s[t]=e[t])}),s},omitBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)||(n[e]=s)}),n},pick(e,...t){if(!e)return{};const n=new Set(t.flat()),s={};return n.forEach(t=>{t in e&&(s[t]=e[t])}),s},pickBy(e,t){if(!e)return{};const n={};return Object.entries(e).forEach(([e,s])=>{t(s,e)&&(n[e]=s)}),n},set(e,t,n){if(!e)return e;const s=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let o=e;for(let e=0;e<s.length-1;e++){const t=s[e],n=s[e+1];t in o&&null!==o[t]&&"object"==typeof o[t]||(o[t]=/^\d+$/.test(n)?[]:{}),o=o[t]}return o[s[s.length-1]]=n,e},unset(e,t){if(!e)return!0;const n=Array.isArray(t)?t:t.replace(/\[(\d+)]/g,".$1").split(".");let s=e;for(let e=0;e<n.length-1;e++){const t=n[e];if(!(t in s))return!0;s=s[t]}return delete s[n[n.length-1]]},setIfUndefined(e,t,n){return void 0===this.get(e,t)&&this.set(e,t,n),e},values:e=>e?Object.values(e):[],valuesIn(e){const t=[];for(const n in e)t.push(e[n]);return t},isArray:e=>Array.isArray(e),isBoolean:e=>"boolean"==typeof e||e instanceof Boolean,isDate:e=>e instanceof Date,isEmpty:e=>null==e||(Array.isArray(e)||"string"==typeof e?0===e.length:e instanceof Map||e instanceof Set?0===e.size:"object"!=typeof e||0===Object.keys(e).length),isEqual(e,t){if(e===t)return!0;if(null===e||null===t)return e===t;if(typeof e!=typeof t)return!1;if("object"!=typeof e)return!1;if(Array.isArray(e)&&Array.isArray(t))return e.length===t.length&&e.every((e,n)=>this.isEqual(e,t[n]));if(Array.isArray(e)||Array.isArray(t))return!1;const n=Object.keys(e),s=Object.keys(t);return n.length===s.length&&n.every(n=>this.isEqual(e[n],t[n]))},isMatch(e,t){if(e===t)return!0;if(null==e||null==t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;const n=Object.keys(t);for(const s of n){const n=e[s],o=t[s];if("object"==typeof o&&null!==o){if(!this.isMatch(n,o))return!1}else if(n!==o)return!1}return!0},isFinite:e=>Number.isFinite(e),isFunction:e=>"function"==typeof e,isInteger:e=>Number.isInteger(e),isNaN:e=>Number.isNaN(e),isNil:e=>null==e,isNull:e=>null===e,isNumber:e=>"number"==typeof e||e instanceof Number,isObject:e=>null!==e&&"object"==typeof e,isPlainObject(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype},isRegExp:e=>e instanceof RegExp,isString:e=>"string"==typeof e||e instanceof String,isSymbol:e=>"symbol"==typeof e,isUndefined:e=>void 0===e,parseInt:(e,t)=>(void 0===t&&(t=/^0x/i.test(e)?16:10),null==e?NaN:"number"==typeof e?Math.trunc(e):(e=String(e).trim(),parseInt(e,t))),toNumber(e){if("number"==typeof e)return e;if("symbol"==typeof e)return NaN;if(this.isObject(e)){const t="function"==typeof e.valueOf?e.valueOf():e;e=this.isObject(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.trim();const t=/^0b[01]+$/i.test(e),n=/^0o[0-7]+$/i.test(e),s=/^[-+]0x[0-9a-f]+$/i.test(e);return t||n?parseInt(e.slice(2),t?2:8):s?NaN:+e},toInteger(e){const t=this.toNumber(e);return Number.isNaN(t)?0:0!==t&&Number.isFinite(t)?Math.trunc(t):t},toFinite(e){const t=17976931348623157e292;if(!e)return 0===e?e:0;const n=this.toNumber(e);return n===1/0?t:n===-1/0?-t:n==n?n:0},toSafeInteger(e){const t=9007199254740991,n=this.toInteger(e);return n<-9007199254740991?-9007199254740991:n>t?t:n},toString(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(e=>null==e?"":this.toString(e)).join(",");if("symbol"==typeof e)return e.toString();const t=String(e);return"0"===t&&1/e==-1/0?"-0":t},toArray(e){return e?this.isArray(e)?[...e]:"string"==typeof e?e.split(""):this.isObject(e)?"function"==typeof e[Symbol.iterator]?[...e]:Object.values(e):[]:[]},castArray(...e){if(!e.length)return[];const t=e[0];return this.isArray(t)?t:[t]},toLength(e){const t=4294967295,n=this.toInteger(e);return n<0?0:n>t?t:n},toPlainObject(e){const t={};for(const n in e)t[n]=e[n];return t},add:(e,t)=>e+t,ceil(e,t=0){const n=Math.pow(10,t);return Math.ceil(e*n)/n},divide:(e,t)=>e/t,floor(e,t=0){const n=Math.pow(10,t);return Math.floor(e*n)/n},max:e=>e&&e.length?Math.max(...e):void 0,maxBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])>("function"==typeof t?t(e):e[t])?n:e)},mean(e){return e&&e.length?this.sum(e)/e.length:NaN},meanBy(e,t){return e&&e.length?this.sumBy(e,t)/e.length:NaN},min:e=>e&&e.length?Math.min(...e):void 0,minBy(e,t){if(e&&e.length)return e.reduce((e,n)=>("function"==typeof t?t(n):n[t])<("function"==typeof t?t(e):e[t])?n:e)},multiply:(e,t)=>e*t,round(e,t=0){const n=Math.pow(10,t);return Math.round(e*n)/n},subtract:(e,t)=>e-t,sum:e=>e?e.reduce((e,t)=>e+t,0):0,sumBy:(e,t)=>e?e.reduce((e,n)=>e+("function"==typeof t?t(n):n[t]),0):0,clamp:(e,t,n)=>(void 0===n&&(n=t,t=void 0),void 0!==t&&e<t?t:void 0!==n&&e>n?n:e),inRange:(e,t,n)=>(void 0===n&&(n=t,t=0),t>n&&([t,n]=[n,t]),e>=t&&e<n),random:(e=0,t=1,n)=>("boolean"==typeof e?(n=e,e=0,t=1):"boolean"==typeof t&&(n=t,t=e,e=0),e>t&&([e,t]=[t,e]),n||e%1!=0||t%1!=0?e+Math.random()*(t-e):e+Math.floor(Math.random()*(t-e+1))),camelCase:e=>e?e.replace(/[^a-zA-Z0-9]+(.)/g,(e,t)=>t.toUpperCase()).replace(/^[A-Z]/,e=>e.toLowerCase()):"",capitalize:e=>e?e.charAt(0).toUpperCase()+e.slice(1).toLowerCase():"",endsWith:(e,t,n)=>!!e&&(void 0!==n?e.slice(0,n).endsWith(t):e.endsWith(t)),escape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",'"':""","'":"'"};return e.replace(/[&<>"']/g,e=>t[e])},kebabCase:e=>e?e.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase():"",lowerCase(e){return e?this.words(e).join(" ").toLowerCase():""},lowerFirst:e=>e?e.charAt(0).toLowerCase()+e.slice(1):"",pad(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s,i=Math.floor(o/2),r=o-i;return n.repeat(Math.ceil(i/n.length)).slice(0,i)+e+n.repeat(Math.ceil(r/n.length)).slice(0,r)},padEnd(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s;return e+n.repeat(Math.ceil(o/n.length)).slice(0,o)},padStart(e="",t=0,n=" "){const s=e.length;if(s>=t)return e;const o=t-s;return n.repeat(Math.ceil(o/n.length)).slice(0,o)+e},repeat:(e="",t=1)=>e.repeat(Math.max(0,Math.floor(t))),replace:(e="",t,n)=>e.replace(t,n),snakeCase(e){return e?this.words(e).join("_").toLowerCase():""},split:(e="",t,n)=>e.split(t,n),startCase(e){return e?this.words(e).map(e=>this.capitalize(e)).join(" "):""},startsWith:(e,t,n=0)=>!!e&&e.startsWith(t,n),toLower:e=>e?e.toLowerCase():"",toUpper:e=>e?e.toUpperCase():"",trim(e="",t){if(!t)return e.trim();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+|[${n}]+$`,"g"),"")},trimEnd(e="",t){if(!t)return e.trimEnd();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`[${n}]+$`,"g"),"")},trimStart(e="",t){if(!t)return e.trimStart();const n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return e.replace(new RegExp(`^[${n}]+`,"g"),"")},truncate(e="",t={}){const n=t.length||30,s=t.omission||"...",o=t.separator;if(e.length<=n)return e;let i=n-s.length;if(i<1)return s;let r=e.slice(0,i);if(o){const e="string"==typeof o?r.lastIndexOf(o):r.search(new RegExp(o.source+"(?!.*"+o.source+")"));e>-1&&(r=r.slice(0,e))}return r+s},unescape(e){if(!e)return"";const t={"&":"&","<":"<",">":">",""":'"',"'":"'"};return e.replace(/&(?:amp|lt|gt|quot|#39);/g,e=>t[e])},upperCase(e){return e?this.words(e).join(" ").toUpperCase():""},upperFirst:e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",words:(e="",t)=>t?e.match(t)||[]:(e=e.replace(/([a-z])([A-Z])/g,"$1 $2")).match(/[a-zA-Z0-9]+/g)||[],sprintf(e,...t){if(!e)return"";let n=0;return e.replace(/%(?:(\d+)\$)?([+-])?(\d+)?(?:\.(\d+))?([sdifojx%])/g,(e,s,o,i,r,a)=>{if("%"===a)return"%";const l=s?parseInt(s,10)-1:n++,d=t[l];if(void 0===d)return e;if(null===d)return"null";let c;switch(a){case"s":default:c=String(d);break;case"d":case"i":c=String(parseInt(d,10));break;case"f":const e=parseFloat(d);c=void 0!==r?e.toFixed(parseInt(r,10)):String(e);break;case"o":c=Object.prototype.toString.call(d);break;case"j":try{c=JSON.stringify(d)}catch(e){c="[Circular]"}break;case"x":c=parseInt(d,10).toString(16)}if(i){const e=parseInt(i,10),t="0"===o?"0":" ";c="-"===o?c.padEnd(e," "):c.padStart(e,t)}if("+"===o&&("d"===a||"i"===a||"f"===a)){parseFloat(c)>=0&&!c.startsWith("+")&&(c="+"+c)}return c})},format(e,...t){return this.sprintf(e,...t)},template(e,t={}){const{partials:n={},helpers:s={}}=t,o=e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),i=(e,t)=>"."===t?e:t.startsWith("@")?e[t]:t.split(".").reduce((e,t)=>e&&void 0!==e[t]?e[t]:"",e),r=(e,t,a=null)=>{let l=e;return l=l.replace(/\{\{#with\s+([^}]+)\}\}([\s\S]*?)\{\{\/with\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return o&&"object"==typeof o?r(s,o,t):""}),l=l.replace(/\{\{#each\s+([^}]+)\}\}([\s\S]*?)\{\{\/each\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return Array.isArray(o)?o.map((e,n)=>{const i="object"==typeof e?{...e,"@index":n,"@first":0===n,"@last":n===o.length-1}:{".":e,"@index":n,"@first":0===n,"@last":n===o.length-1};return r(s,i,t)}).join(""):""}),l=l.replace(/\{\{#if\s+([^}]+)\}\}([\s\S]*?)(?:\{\{else\}\}([\s\S]*?))?\{\{\/if\}\}/g,(e,n,s,o="")=>{const l=i(t,n.trim()),d=Array.isArray(l)?l.length>0:Boolean(l);return r(d?s:o,t,a)}),l=l.replace(/\{\{#unless\s+([^}]+)\}\}([\s\S]*?)\{\{\/unless\}\}/g,(e,n,s)=>{const o=i(t,n.trim());return(Array.isArray(o)?0===o.length:!o)?r(s,t,a):""}),l=l.replace(/\{\{>\s*([^}]+)\}\}/g,(e,s)=>{const o=n[s.trim()];return o?r(o,t,a):""}),l=l.replace(/\{\{\{([^}]+)\}\}\}/g,(e,n)=>{const s=i(t,n.trim());return null!=s?String(s):""}),l=l.replace(/\{\{([^#/>][^}]*)\}\}/g,(e,n)=>{const r=n.trim(),a=r.match(/^(\w+)\s+(.+)$/);if(a&&s[a[1]]){const e=a[2].split(/\s+/).map(e=>/^["'].*["']$/.test(e)?e.slice(1,-1):i(t,e));return o(s[a[1]](...e))}const l=i(t,r);return o(l)}),l};return(t={})=>r(e,t)},render(e,t,n={}){return this.template(e,n)(t)},async copyToClipboard(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch(e){}const t=document.createElement("textarea");t.value=e,t.style.cssText="position:fixed;opacity:0;pointer-events:none",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}catch(e){return!1}finally{document.body.removeChild(t)}},escapeHtml:e=>null==e?"":String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"),chain(e){const t={_value:e,value(){return this._value}};["chunk","compact","concat","difference","drop","dropRight","fill","findIndex","findLastIndex","flatten","flattenDeep","flattenDepth","fromPairs","head","indexOf","initial","intersection","join","last","lastIndexOf","nth","pull","pullAll","pullAt","remove","reverse","slice","sortedIndex","sortedUniq","tail","take","takeRight","union","uniq","uniqBy","unzip","without","xor","zip","countBy","each","every","filter","find","findLast","flatMap","groupBy","includes","invokeMap","keyBy","map","orderBy","partition","reduce","reduceRight","reject","sample","sampleSize","shuffle","size","some","sortBy","assign","assignIn","at","defaults","entries","extend","findKey","findLastKey","forIn","forOwn","functions","get","has","invert","invertBy","invoke","keys","mapKeys","mapValues","merge","omit","omitBy","pick","pickBy","result","set","toPairs","transform","unset","update","values","camelCase","capitalize","deburr","endsWith","escape","escapeRegExp","kebabCase","lowerCase","lowerFirst","pad","padEnd","padStart","parseInt","repeat","replace","snakeCase","split","startCase","startsWith","toLower","toUpper","trim","trimEnd","trimStart","truncate","unescape","upperCase","upperFirst","words"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return this._value=c[e](this._value,...t),this})});return["sum","mean","min","max","toArray","toJSON","toString"].forEach(e=>{"function"==typeof this[e]&&(t[e]=function(...t){return c[e](this._value,...t)})}),t}};class h{constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={...this.constructor.defaults,...t},this._eventHandlers=[],this.element&&(this.element._dommaComponent=this)}on(e,t){this.options[e]&&"function"==typeof this.options[e]&&this.options[e](t)}setOptions(e){return this.options={...this.options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}_addEventListener(e,t,n){e.addEventListener(t,n),this._eventHandlers.push({element:e,event:t,handler:n})}destroy(){for(const{element:e,event:t,handler:n}of this._eventHandlers)e.removeEventListener(t,n);this._eventHandlers=[],this.element&&delete this.element._dommaComponent}}class u extends h{static defaults={data:[],idKey:"id",parentKey:"parent_id",childrenKey:"children",labelKey:"name",iconKey:"icon",colorKey:"color",expandedByDefault:!0,expandedNodes:[],selectable:!0,multiSelect:!1,selectedNodes:[],renderNode:null,getBadge:null,getNodeIcon:null,getNodeClass:null,actions:[],indentSize:1.5,showIcons:!0,showToggleButtons:!0,toggleIcon:"chevron-down",onSelect:null,onDeselect:null,onExpand:null,onCollapse:null,onAction:null,onClick:null};constructor(e,t={}){super(e,t),this.element?(this._tree=[],this._flatMap={},this._expandedNodes=new Set,this._selectedNodes=new Set,this._init()):console.error("TreeView: Element not found",e)}_init(){this.element.classList.contains("dm-treeview")||this.element.classList.add("dm-treeview"),this.options.expandedNodes.length>0&&this.options.expandedNodes.forEach(e=>this._expandedNodes.add(e)),this.options.selectedNodes.length>0&&this.options.selectedNodes.forEach(e=>this._selectedNodes.add(e)),this.options.data&&this.options.data.length>0&&this.setData(this.options.data),this._setupEventListeners()}_setupEventListeners(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-node");if(!t||e.target.closest(".dm-treeview-toggle")||e.target.closest(".dm-treeview-action"))return;const n=this._parseNodeId(t.dataset.nodeId);this._handleSelect(n,e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-toggle");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId);this.toggle(n)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-treeview-action");if(t){e.stopPropagation();const n=this._parseNodeId(t.dataset.nodeId),s=t.dataset.action;this._handleAction(s,n,e)}})}_buildTree(e){const t={},n=[],s=this.options.idKey,o=this.options.parentKey,i=this.options.childrenKey;return e.forEach(e=>{t[e[s]]={...e,[i]:[]}}),e.forEach(e=>{const r=t[e[s]],a=e[o];null==a?n.push(r):t[a]?t[a][i].push(r):n.push(r)}),this._sortTree(n),{tree:n,nodeMap:t}}_sortTree(e){const t=this.options.childrenKey,n=this.options.labelKey;e.sort((e,t)=>{const s=(e[n]||"").toLowerCase(),o=(t[n]||"").toLowerCase();return s.localeCompare(o)}),e.forEach(e=>{e[t]&&e[t].length>0&&this._sortTree(e[t])})}_render(){const e=this._tree.map(e=>this._renderNode(e,0)).join("");this.element.innerHTML=e}_renderNode(e,t){const n=this.options.idKey,s=this.options.childrenKey,o=e[n],i=e[s]&&e[s].length>0,r=this._expandedNodes.has(o),a=this._selectedNodes.has(o),l={isExpanded:r,isSelected:a,hasChildren:i},d=this.options.renderNode?this.options.renderNode(e,t,l):this._defaultRenderNode(e,t,l),c=this.options.getBadge?this.options.getBadge(e):null;let h=`\n <div class="dm-treeview-node ${a?"dm-treeview-node-selected":""} ${this.options.getNodeClass?this.options.getNodeClass(e):""}"\n data-node-id="${o}"\n data-depth="${t}"\n style="padding-left: ${t*this.options.indentSize}rem;">\n <div class="dm-treeview-node-content">\n ${i&&this.options.showToggleButtons?this._renderToggle(o,r):'<span class="dm-treeview-spacer"></span>'}\n ${d}\n ${null!=c?`<span class="dm-treeview-badge">${c}</span>`:""}\n </div>\n ${this.options.actions.length>0?this._renderActions(e):""}\n </div>\n `;return i&&r&&(h+=`<div class="dm-treeview-children" data-parent-id="${o}">`,e[s].forEach(e=>{h+=this._renderNode(e,t+1)}),h+="</div>"),h}_defaultRenderNode(e,t,n){const s=this.options.labelKey,o=this.options.iconKey,i=this.options.colorKey,r=e[s]||"",a=this.options.getNodeIcon?this.options.getNodeIcon(e):e[o],l=e[i];let d="";return this.options.showIcons&&a&&(d+=`<span class="dm-treeview-icon" data-icon="${a}" ${l?`style="color: ${l};"`:""}></span>`),d+=`<span class="dm-treeview-label">${this._escapeHtml(r)}</span>`,d}_renderToggle(e,t){return`\n <button type="button"\n class="dm-treeview-toggle ${t?"dm-treeview-expanded":"dm-treeview-collapsed"}"\n data-node-id="${e}"\n aria-label="${t?"Collapse":"Expand"}">\n <span data-icon="${this.options.toggleIcon}"></span>\n </button>\n `}_renderActions(e){const t=e[this.options.idKey],n=this.options.actions.filter(t=>"function"!=typeof t.visible||t.visible(e));if(0===n.length)return"";let s='<div class="dm-treeview-actions">';return n.forEach(e=>{s+=`\n <button type="button"\n class="dm-treeview-action"\n data-node-id="${t}"\n data-action="${e.name}"\n title="${e.tooltip||e.name}"\n aria-label="${e.tooltip||e.name}">\n ${e.icon?`<span data-icon="${e.icon}"></span>`:e.name}\n </button>\n `}),s+="</div>",s}_handleSelect(e,t){if(!this.options.selectable)return;const n=this._flatMap[e];if(!n)return;"function"==typeof this.options.onClick&&this.options.onClick(e,n,t);const s=this._selectedNodes.has(e);this.options.multiSelect?s?this.deselect(e):this.select(e):s?this.deselect(e):(this.deselectAll(!0),this.select(e))}_handleAction(e,t,n){const s=this._flatMap[t];s&&"function"==typeof this.options.onAction&&this.options.onAction(e,t,s,n)}_parseNodeId(e){const t=Number(e);return isNaN(t)||e!==t.toString()?e:t}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}setData(e){const{tree:t,nodeMap:n}=this._buildTree(e);return this._tree=t,this._flatMap=n,this.options.expandedByDefault&&Object.keys(n).forEach(e=>{const t=n[e],s=this.options.childrenKey;t[s]&&t[s].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this._render(),this}getData(){return this._tree}getFlatData(){return Object.values(this._flatMap)}refresh(){return this._render(),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&window.Domma.icons.scan(this.element),this}getNode(e){return this._flatMap[e]||null}updateNode(e,t){const n=this._flatMap[e];return n&&(Object.assign(n,t),this.refresh()),this}select(e,t=!1){if(!this.options.selectable)return this;const n=this._flatMap[e];return n?(this._selectedNodes.add(e),this.refresh(),t||"function"!=typeof this.options.onSelect||this.options.onSelect(e,n,null),this):this}deselect(e,t=!1){const n=this._flatMap[e];return n?(this._selectedNodes.delete(e),this.refresh(),t||"function"!=typeof this.options.onDeselect||this.options.onDeselect(e,n,null),this):this}toggleSelect(e){return this._selectedNodes.has(e)?this.deselect(e):this.select(e),this}selectAll(){return this.options.multiSelect?(Object.keys(this._flatMap).forEach(e=>{this._selectedNodes.add(this._parseNodeId(e))}),this.refresh(),this):this}deselectAll(e=!1){const t=Array.from(this._selectedNodes);return this._selectedNodes.clear(),this.refresh(),e||"function"!=typeof this.options.onDeselect||t.forEach(e=>{const t=this._flatMap[e];t&&this.options.onDeselect(e,t,null)}),this}getSelected(){return Array.from(this._selectedNodes)}getSelectedNodes(){return this.getSelected().map(e=>this._flatMap[e]).filter(Boolean)}isSelected(e){return this._selectedNodes.has(e)}expand(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.add(e),this.refresh(),t||"function"!=typeof this.options.onExpand||this.options.onExpand(e,n,null),this):this}collapse(e,t=!1){const n=this._flatMap[e];return n?(this._expandedNodes.delete(e),this.refresh(),t||"function"!=typeof this.options.onCollapse||this.options.onCollapse(e,n,null),this):this}toggle(e){return this._expandedNodes.has(e)?this.collapse(e):this.expand(e),this}expandAll(){return Object.keys(this._flatMap).forEach(e=>{const t=this._flatMap[e],n=this.options.childrenKey;t[n]&&t[n].length>0&&this._expandedNodes.add(this._parseNodeId(e))}),this.refresh(),this}collapseAll(){return this._expandedNodes.clear(),this.refresh(),this}isExpanded(e){return this._expandedNodes.has(e)}getExpanded(){return Array.from(this._expandedNodes)}getParent(e){const t=this._flatMap[e];if(!t)return null;const n=t[this.options.parentKey];return null!=n&&this._flatMap[n]||null}getChildren(e){const t=this._flatMap[e];if(!t)return[];return t[this.options.childrenKey]||[]}getAncestors(e){const t=[];let n=this.getParent(e);for(;n;)t.unshift(n),n=this.getParent(n[this.options.idKey]);return t}getDescendants(e){const t=[];return this.getChildren(e).forEach(e=>{t.push(e);const n=e[this.options.idKey];t.push(...this.getDescendants(n))}),t}getSiblings(e){if(!this._flatMap[e])return[];const t=this.getParent(e);return t?this.getChildren(t[this.options.idKey]).filter(t=>t[this.options.idKey]!==e):this._tree.filter(t=>t[this.options.idKey]!==e)}getLevel(e){return this.getAncestors(e).length}find(e){for(const t in this._flatMap){const n=this._flatMap[t];if(e(n))return n}return null}filter(e){const t=[];for(const n in this._flatMap){const s=this._flatMap[n];e(s)&&t.push(s)}return t}forEach(e){for(const t in this._flatMap)e(this._flatMap[t],t);return this}scrollToNode(e,t={}){const n=this.element.querySelector(`[data-node-id="${e}"]`);return n&&n.scrollIntoView({behavior:t.behavior||"smooth",block:t.block||"center",inline:t.inline||"nearest"}),this}destroy(){this._tree=[],this._flatMap={},this._expandedNodes.clear(),this._selectedNodes.clear(),this.element.innerHTML="",super.destroy()}}const p="domma-theme",m="domma-theme-variant",f="dm-theme-",g=["ocean-light","ocean-dark","forest-light","forest-dark","sunset-light","sunset-dark","royal-light","royal-dark","lemon-light","lemon-dark","silver-light","silver-dark","charcoal-light","charcoal-dark","christmas-light","christmas-dark","unicorn-light","unicorn-dark","dreamy-light","dreamy-dark","grayve-light","grayve-dark","mint-light","mint-dark","wedding-light","wedding-dark","core-light","corporate-light","corporate-dark","admin-smooth-steel","admin-smooth-indigo","admin-smooth-teal","admin-sharp-steel","admin-sharp-indigo","admin-sharp-teal","admin-slate-steel","admin-slate-indigo","admin-slate-teal"],v="charcoal-dark";const b=new class{constructor(){this._theme=v,this._listeners=[],this._target=null,this._initialised=!1,this._systemMediaQuery=null,this._autoDetect=!1,this._disabled=!1}init(e={}){const{theme:t=null,autoDetect:n=!1,persist:s=!0,disabled:o=!1,target:i=document.body}=e;if(o)return this._disabled=!0,this._initialised=!0,this;this._target="string"==typeof i?document.querySelector(i):i,this._target||(this._target=document.body),this._persist=s,this._autoDetect=n;let r=t;if(s){const e=this._loadFromStorage();e&&!t&&(r=e)}if(n&&!r){r="dark"===this._getSystemPreference()?"charcoal-dark":"charcoal-light",this._setupSystemListener()}return r=r||v,g.includes(r)||(console.warn(`Invalid theme: ${r}. Using default: ${v}`),r=v),this._theme=r,this._applyTheme(),this._initialised=!0,this}get(){return this._theme}getBase(){return this._theme.split("-").slice(0,-1).join("-")}getMode(){return this._theme.split("-").pop()}isDark(){return"dark"===this.getMode()}isLight(){return"light"===this.getMode()}set(e){if(!g.includes(e))return console.warn(`Invalid theme: ${e}. Available themes: ${g.join(", ")}`),this;const t=this._theme;return t===e||(this._theme=e,this._applyTheme(),this._saveToStorage(),this._notifyListeners(t,e)),this}setVariant(){return console.warn('[ThemeEngine] setVariant() is deprecated. Use set() with full theme name (e.g., set("ocean-dark"))'),this}toggle(){return console.warn("[ThemeEngine] toggle() is deprecated. Use variant selector UI or set() method."),this}onChange(e){return"function"!=typeof e?(console.warn("onChange requires a function callback"),()=>{}):(this._listeners.push(e),()=>{const t=this._listeners.indexOf(e);t>-1&&this._listeners.splice(t,1)})}preview(e){if(!g.includes(e))return console.warn(`Invalid theme for preview: ${e}`),()=>{};const t=this._theme;return this._theme=e,this._applyTheme(!1),()=>{this._theme=t,this._applyTheme(!1)}}listThemes(){return[...g]}listBases(){return["ocean","forest","sunset","royal","lemon","silver","charcoal","christmas","unicorn","dreamy","grayve","mint","wedding","corporate","admin-smooth","admin-sharp","admin-slate"]}listVariants(){return console.warn("[ThemeEngine] listVariants() is deprecated. Use listThemes() instead."),this.listBases()}getConfig(){return{theme:this._theme,base:this.getBase(),mode:this.getMode(),autoDetect:this._autoDetect,persist:this._persist,disabled:this._disabled}}_updateMetaThemeColor(){const e={light:"#ffffff",dark:"#121212"};let t=document.querySelector('meta[name="theme-color"]');t||(t=document.createElement("meta"),t.name="theme-color",document.head.appendChild(t)),t.content=e[this.getMode()]||e.dark}isDisabled(){return this._disabled}enable(){return this._disabled=!1,this._target||(this._target=document.body),this._applyTheme(),this}disable(){if(this._disabled=!0,this._target){const e=this._target.className.split(" ").filter(e=>!e.startsWith(f));this._target.className=e.join(" ").trim(),this._target.removeAttribute("data-mode")}return this}_applyTheme(e=!0){if(this._disabled)return;const t=this._target||document.body;if(!t)return void console.error("[ThemeEngine] No target element available for theme application");const n=t.className.split(" ").filter(e=>!e.startsWith(f));n.push(`${f}${this._theme}`),t.className=n.join(" ").trim();const s=this.isDark()?"dark":"light";t.setAttribute("data-mode",s),e&&this._updateMetaThemeColor()}_saveToStorage(){if(this._persist&&"undefined"!=typeof localStorage)try{localStorage.setItem(p,this._theme),localStorage.removeItem(m)}catch(e){}}_loadFromStorage(){if("undefined"==typeof localStorage)return null;try{const e=localStorage.getItem(p);if(e&&g.includes(e))return e;const t=e,n=localStorage.getItem(m);if(t&&["light","dark"].includes(t)){const e=`${n||"charcoal"}-${t}`;if(console.log(`[ThemeEngine] Migrating theme: ${t} + ${n} → ${e}`),g.includes(e))return localStorage.setItem(p,e),localStorage.removeItem(m),e}return null}catch(e){return null}}_getSystemPreference(){return"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}_setupSystemListener(){if("undefined"==typeof window||!window.matchMedia)return;this._systemMediaQuery=window.matchMedia("(prefers-color-scheme: dark)");const e=e=>{if(!this._autoDetect)return;const t=e.matches?"dark":"light",n=`${this.getBase()}-${t}`;g.includes(n)&&this.set(n)};this._systemMediaQuery.addEventListener?this._systemMediaQuery.addEventListener("change",e):this._systemMediaQuery.addListener(e)}_notifyListeners(e,t){this._listeners.forEach(n=>{try{n(e,t)}catch(e){console.error("[ThemeEngine] Error in change listener:",e)}})}destroy(){this._systemMediaQuery&&this._systemMediaQuery.removeEventListener,this._listeners=[],this._target=null,this._initialised=!1}};"undefined"!=typeof document&&("loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{b._initialised||b.init({persist:!0,autoDetect:!1})}):b._initialised||b.init({persist:!0,autoDetect:!1}));const y="dm-context-cursor-rules",_={fill:"#111827",halo:"#ffffff"},k="M1,1 L1,17 L5.2,12.9 L8,19 L10.6,17.7 L7.9,11.8 L13.6,11.6 Z",w=[15.5,18.5,21.5];function x(e=("undefined"!=typeof document?document:null)){if(!e||!e.documentElement||"function"!=typeof getComputedStyle)return{..._};let t;try{t=getComputedStyle(e.documentElement)}catch{return{..._}}const n=(t.getPropertyValue("--dm-text")||"").trim(),s=(t.getPropertyValue("--dm-text-inverse")||"").trim();return{fill:n||_.fill,halo:s||_.halo}}function M(e={}){return`url('data:image/svg+xml,${t=function({size:e=26,fill:t,halo:n}={}){const s=t&&n?{fill:t,halo:n}:{...x(),...t?{fill:t}:{},...n?{halo:n}:{}},o=Math.max(12,Math.min(32,Number(e)||26)),i=(e,t,n)=>`<path d="M17.2 ${e}h5.4" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,r=(e,t,n)=>`<path d="M14.4 ${e}h.01" stroke="${t}" stroke-width="${n}" stroke-linecap="round"/>`,a=w.map(e=>r(e,s.halo,3.6)+i(e,s.halo,3.4)).join(""),l=w.map(e=>r(e,s.fill,1.9)+i(e,s.fill,1.7)).join("");return[`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${o}" viewBox="0 0 26 26">`,`<path d="${k}" fill="${s.halo}" stroke="${s.halo}" stroke-width="2.6" stroke-linejoin="round"/>`,`<path d="${k}" fill="${s.fill}"/>`,a,l,"</svg>"].join("")}(e),encodeURIComponent(t).replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A").replace(/!/g,"%21")}') 1 1, context-menu`;var t}const L=new Map,C=new Map;let E=null;function A(e,t){return`${e}{cursor:${t};}@media (forced-colors:active){${e}{cursor:context-menu;}}`}function S(){const e=function(){if("undefined"==typeof document)return null;let e=document.getElementById(y);return e||(e=document.createElement("style"),e.id=y,document.head.appendChild(e)),e}();if(!e)return;if(!L.size&&!C.size)return void(e.textContent="");const t=x(),n=[];C.forEach(({selector:e,value:t})=>n.push(A(e,t))),L.forEach(({selector:e,size:s})=>{n.push(A(e,M({size:s,...t})))}),e.textContent=n.join("\n")}function $(){L.size&&!E?E=b.onChange(()=>S()):!L.size&&E&&(E(),E=null)}function z(e,t,n){t&&(L.delete(e),C.delete(e),"glyph"===n.kind?L.set(e,{selector:t,size:n.size||26}):"keyword"===n.kind?C.set(e,{selector:t,value:"context-menu"}):"custom"===n.kind&&n.value&&C.set(e,{selector:t,value:n.value}),$(),S())}const T=new Set;let j=null,B=!1,D=0,W=0;const H=e=>"function"==typeof e,O={primary:"var(--dm-primary)",success:"var(--dm-success)",danger:"var(--dm-danger)",warning:"var(--dm-warning)",info:"var(--dm-info)"},I={none:"0",sm:"sm",md:"md",lg:"lg",xl:"xl"};const N=e=>H(e)&&H(e.subscribe);function P(e,...t){return N(e)?e():H(e)?e(...t):e}function V(e){const t=[];let n=e instanceof Element?e:null;for(;n;){const e=[];for(const t of T)t._enabledFlag&&t.matchesContainer(n)&&e.push(t);e.length>1&&e.sort((e,t)=>t.options.priority-e.options.priority);for(const s of e)t.push({instance:s,container:n});n=n.parentElement||(n.parentNode&&n.parentNode.host?n.parentNode.host:null)}return t}function F(e,t){const n=V(e),s=n.findIndex(e=>e.instance.options.exclusive);let o=0,i=null;if(s>-1){const r=n[s];i=r.instance._accept(r.container,e,t),i&&(o=s)}const r=[];for(let a=o;a<n.length;a++){if(a===s&&i){r.push(i);continue}const o=n[a],l=o.instance._accept(o.container,e,t);l&&r.push(l)}return r}let R=null,q=null,U=null,K=null,Y=null,G=null,X=null;function J(){B||"undefined"==typeof document||(B=!0,R=e=>{e.shiftKey&&function(e){for(const t of V(e))if(t.instance.options.nativeOnShift)return!0;return!1}(e.target)||(j&&j.close(),function(e,t,n){const s=F(e.target,e);if(!s.length)return!1;const o=s[0],i=o.instance._assembleItems(s,e);!i.length&&!o.instance.options.render||(e.preventDefault(),W=Date.now(),o.instance._openResolved(t,n,o,i,e,!1,s))}(e,e.clientX,e.clientY))},document.addEventListener("contextmenu",R),q=e=>{const t="ContextMenu"===e.key,n="F10"===e.key&&e.shiftKey;if(!t&&!n)return;if(j)return;const s=document.activeElement;if(!s||s===document.body)return;const o=F(s,e);if(!o.length)return;const i=o[0];if(!i.instance.options.keyboardTrigger)return;const r=i.instance._assembleItems(o,e);if(!r.length&&!i.instance.options.render)return;e.preventDefault();const a=s.getBoundingClientRect();W=Date.now(),i.instance._openResolved(a.left+a.width/2,a.top+a.height/2,i,r,e,!0,o)},document.addEventListener("keydown",q),U=e=>{if(j)return;if(!e.touches||1!==e.touches.length)return;const t=e.touches[0],n=F(e.target,e);if(!n.length)return;const s=n[0],o=s.instance.options.longPress;o&&(X={x:t.clientX,y:t.clientY,target:e.target},G=setTimeout(()=>{if(G=null,Date.now()-W<400)return;const t=s.instance._assembleItems(n,e);(t.length||s.instance.options.render)&&(W=Date.now(),s.instance._openResolved(X.x,X.y,s,t,e,!1,n))},o))},K=e=>{if(!(G&&X&&e.touches&&e.touches.length))return;const t=e.touches[0];(Math.abs(t.clientX-X.x)>10||Math.abs(t.clientY-X.y)>10)&&(clearTimeout(G),G=null)},Y=()=>{G&&(clearTimeout(G),G=null)},document.addEventListener("touchstart",U,{passive:!0}),document.addEventListener("touchmove",K,{passive:!0}),document.addEventListener("touchend",Y),document.addEventListener("touchcancel",Y))}class Z extends h{static defaults={items:[],match:null,exclude:null,enabled:!0,inherit:"append",priority:0,exclusive:!1,nativeOnShift:!0,closeOnSelect:!0,closeOnEscape:!0,closeOnClickOutside:!0,closeOnScroll:!0,longPress:500,cursor:"auto",cursorSize:26,className:"",minWidth:"200px",maxWidth:"320px",maxHeight:"60vh",offset:[2,2],flip:!0,animation:!0,animationDuration:120,transition:"scale",easing:"cubic-bezier(0.16, 1, 0.3, 1)",accent:null,surface:null,radius:null,shadow:null,opacity:null,density:"comfortable",itemTemplate:null,submenuDelay:150,render:null,keyboardTrigger:!0,typeahead:!0,ariaLabel:"Context menu",model:null,modelKey:null,onBeforeOpen:null,onOpen:null,onClose:null,onSelect:null};constructor(e,t={}){super(e,t),this.selector="string"==typeof e?e:null,this._node=this.selector?null:this.element,this._menu=null,this._submenus=[],this._isOpen=!1,this._enabledFlag=!0,this._focusIndex=-1,this._renderedItems=[],this._ctx=null,this._typeaheadBuffer="",this._typeaheadTimer=null,this._submenuTimer=null,this._observableDispose=null,this._restoreFocusTo=null,this._chain=null,this._cursorId=++D,T.add(this),J(),this._applyTouchCallout(),this._applyCursor()}_applyCursor(){const{cursor:e,cursorSize:t,match:n}=this.options;if(!1===e||null===e||"undefined"==typeof document)return;let s=this.selector;if(!s){if(!this._node)return;this._node.setAttribute("data-dm-ctx-cursor",String(this._cursorId)),s=`[data-dm-ctx-cursor="${this._cursorId}"]`}const o=n?`${s} ${n}`:s;"auto"===e?z(this._cursorId,o,{kind:"keyword"}):"glyph"===e?z(this._cursorId,o,{kind:"glyph",size:t}):"string"==typeof e&&z(this._cursorId,o,{kind:"custom",value:e})}_applyTouchCallout(){this.options.longPress&&this.selector&&"undefined"!=typeof document&&document.querySelectorAll(this.selector).forEach(e=>{e.style.webkitTouchCallout="none"})}matchesContainer(e){return this.selector?H(e.matches)&&e.matches(this.selector):e===this._node}_accept(e,t,n){const s=this.options;if(s.exclude&&t.closest(s.exclude)&&e.contains(t.closest(s.exclude)))return null;let o=e;if(s.match){const n=t.closest(s.match);if(!n||!e.contains(n))return null;o=n}const i={target:o,container:e,x:n&&void 0!==n.clientX?n.clientX:0,y:n&&void 0!==n.clientY?n.clientY:0,event:n,menu:null,instance:this};return P(s.enabled,o,i)?s.onBeforeOpen&&!1===s.onBeforeOpen(i)?null:{instance:this,container:e,target:o,ctx:i}:null}_ownItems(e){const t=this.options;let n;return n=t.model&&t.modelKey&&H(t.model.get)?t.model.get(t.modelKey):P(t.items,e.target,e.ctx),Array.isArray(n)?n:[]}_assembleItems(e,t){const n=e[0],s=this._ownItems(n),o=this.options.inherit;if(!o||e.length<2)return this._filterItems(s,n);let i=[];for(let t=1;t<e.length;t++){const n=e[t],s=n.instance._filterItems(n.instance._ownItems(n),n);s.length&&(i.length&&i.push({type:"divider"}),i=i.concat(s))}const r=this._filterItems(s,n);return i.length?r.length?"prepend"===o?i.concat([{type:"divider"}],r):r.concat([{type:"divider"}],i):i:r}_filterItems(e,t){const n=e.filter(e=>!!e&&(void 0===e.visible||!!P(e.visible,t.target,t.ctx))),s=[];for(const e of n){const t="divider"===e.type||e.divider;(!t||s.length&&!s[s.length-1]._isDivider)&&s.push(t?{type:"divider",_isDivider:!0}:e)}for(;s.length&&s[s.length-1]._isDivider;)s.pop();return s}open(e,t,n){const s=n||(this.selector?document.querySelector(this.selector):this._node);if(!s)return this;const o=F(s,{clientX:e,clientY:t,target:s}),i=o.find(e=>e.instance===this)||o[0];if(!i)return this;const r=[i,...o.filter(e=>e!==i)],a=i.instance._assembleItems(r,null);return a.length||i.instance.options.render?(j&&j.close(),i.instance._openResolved(e,t,i,a,null,!1,r),this):this}_openResolved(e,t,n,s,o,i=!1,r=null){j&&j!==this&&j.close(),this._isOpen&&this.close();const a=this.options;if(this._chain=r||[n],this._ctx=n.ctx,this._ctx.x=e,this._ctx.y=t,this._renderedItems=s,this._restoreFocusTo=i?document.activeElement:null,a.render){const n=a.render(this._ctx);return n?(this._menu=n,n.parentNode||document.body.appendChild(n),n.style.position="fixed",this._applyTheme(n),n.classList.add("is-open"),this._ctx.menu=n,this._positionAt(n,e,t),this._bindOpenListeners(),this._isOpen=!0,j=this,void(a.onOpen&&a.onOpen(this._ctx))):(this._chain=null,void(this._ctx=null))}this._menu=this._createMenu(),this._renderInto(this._menu,s,n),document.body.appendChild(this._menu),this._ctx.menu=this._menu,this._positionAt(this._menu,e,t),this._bindOpenListeners(),this._isOpen=!0,j=this,N(a.items)&&(this._observableDispose=a.items.subscribe(()=>{this._isOpen&&this.refresh()})),a.animation?requestAnimationFrame(()=>{this._menu&&this._menu.classList.add("is-open")}):this._menu.classList.add("is-open"),this._menu.focus({preventScroll:!0}),i&&this._moveFocus(1),a.onOpen&&a.onOpen(this._ctx)}close(){if(!this._isOpen)return this;this._closeSubmenus(0),this._unbindOpenListeners(),this._observableDispose&&(H(this._observableDispose)?this._observableDispose():H(this._observableDispose.dispose)&&this._observableDispose.dispose(),this._observableDispose=null);const e=this._menu,t=this.options;return this._menu=null,this._isOpen=!1,this._focusIndex=-1,j===this&&(j=null),e&&(t.animation?(e.classList.remove("is-open"),setTimeout(()=>e.remove(),t.animationDuration)):e.remove()),this._restoreFocusTo&&H(this._restoreFocusTo.focus)&&this._restoreFocusTo.focus({preventScroll:!0}),this._restoreFocusTo=null,t.onClose&&t.onClose(this._ctx),this._ctx=null,this}refresh(){if(!this._isOpen||!this._ctx)return this;const e=this._chain&&this._chain.length?this._chain[0]:{instance:this,container:this._ctx.container,target:this._ctx.target,ctx:this._ctx},t=this._assembleItems(this._chain&&this._chain.length?this._chain:[e],null);return this._renderedItems=t,this._closeSubmenus(0),this._renderInto(this._menu,t,e),this._positionAt(this._menu,this._ctx.x,this._ctx.y),this}isOpen(){return this._isOpen}setItems(e){return this.options.items=e,this._isOpen&&this.refresh(),this}enable(){return this._enabledFlag=!0,this}disable(){return this._isOpen&&this.close(),this._enabledFlag=!1,this}_createMenu(e=!1){const t=this.options,n=document.createElement("div");return n.className="dm-context-menu"+(e?" dm-context-menu-sub":"")+(t.className?" "+t.className:""),n.setAttribute("role","menu"),n.setAttribute("tabindex","-1"),e||n.setAttribute("aria-label",t.ariaLabel),n.style.minWidth=t.minWidth,n.style.maxWidth=t.maxWidth,n.style.maxHeight=t.maxHeight,this._applyTheme(n),n}_applyTheme(e){const t=this.options;e.dataset.transition=t.animation?t.transition||"scale":"none","compact"===t.density&&(e.dataset.density="compact");const n=(t,n)=>{null!=n&&""!==n&&e.style.setProperty(t,n)};var s;if(n("--dm-ctx-accent",(s=t.accent)?O[s]||s:null),n("--dm-ctx-surface",t.surface),n("--dm-ctx-radius",function(e){return e?"none"===e?"0":I[e]?`var(--dm-radius-${e})`:e:null}(t.radius)),n("--dm-ctx-shadow",function(e){return e?"none"===e?"none":I[e]?`var(--dm-shadow-${e})`:e:null}(t.shadow)),n("--dm-ctx-duration",`${t.animationDuration}ms`),n("--dm-ctx-easing",t.easing),null!==t.opacity&&void 0!==t.opacity){const e=Math.min(100,Math.max(20,Number(t.opacity)||100));e<100&&n("--dm-ctx-opacity",String(e/100))}}_renderInto(e,t,n){if(!e)return;e.innerHTML="";const s=this.options;t.forEach((t,o)=>{if("divider"===t.type||t.divider){const t=document.createElement("div");return t.className="dm-context-menu-divider",t.setAttribute("role","separator"),void e.appendChild(t)}if("header"===t.type||t.header){const n=document.createElement("div");return n.className="dm-context-menu-header",n.setAttribute("role","presentation"),n.textContent=t.header||t.label||"",void e.appendChild(n)}const i=!!P(t.disabled,n.target,n.ctx),r=document.createElement("button");r.type="button",r.className="dm-context-menu-item",r.setAttribute("role","checkbox"===t.type?"menuitemcheckbox":"radio"===t.type?"menuitemradio":"menuitem"),r.setAttribute("tabindex","-1"),r.dataset.index=String(o),t.danger&&r.classList.add("is-danger");for(const e of[].concat(t.className||[]).join(" ").split(/\s+/))e&&r.classList.add(e);if(i&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0),"checkbox"===t.type||"radio"===t.type){const e=!!P(t.checked,n.target,n.ctx);r.setAttribute("aria-checked",String(e)),e&&r.classList.add("is-checked")}if(s.itemTemplate)r.innerHTML=s.itemTemplate(t,o);else{const e=document.createElement("span");e.className="dm-context-menu-icon",t.icon&&(e.setAttribute("data-icon",t.icon),e.setAttribute("data-size","16")),r.appendChild(e);const n=document.createElement("span");if(n.className="dm-context-menu-label",n.textContent=t.label||t.text||t.name||"",r.appendChild(n),t.shortcut){const e=document.createElement("span");e.className="dm-context-menu-shortcut",e.textContent=t.shortcut,r.appendChild(e)}}const a=t.submenu;if(a){r.classList.add("has-submenu"),r.setAttribute("aria-haspopup","true"),r.setAttribute("aria-expanded","false");const e=document.createElement("span");e.className="dm-context-menu-chevron",e.setAttribute("data-icon","chevron-right"),e.setAttribute("data-size","14"),r.appendChild(e)}i||(r.addEventListener("click",s=>{s.preventDefault(),s.stopPropagation(),a?this._openSubmenu(r,t,n,this._depthOf(e)):this._activate(t,o)}),r.addEventListener("mouseenter",()=>{this._closeSubmenus(this._depthOf(e)),clearTimeout(this._submenuTimer),a&&(this._submenuTimer=setTimeout(()=>this._openSubmenu(r,t,n,this._depthOf(e)),s.submenuDelay))})),e.appendChild(r)}),"undefined"!=typeof window&&window.Domma&&window.Domma.icons&&H(window.Domma.icons.scan)&&window.Domma.icons.scan(e)}_depthOf(e){const t=this._submenus.indexOf(e);return-1===t?0:t+1}_openSubmenu(e,t,n,s){this._closeSubmenus(s);const o=this._filterItems(P(t.submenu,n.target,n.ctx)||[],n);if(!o.length)return;const i=this._createMenu(!0);this._renderInto(i,o,n),document.body.appendChild(i),this._submenus[s]=i;const r=e.getBoundingClientRect();this._positionAt(i,r.right,r.top,r),e.setAttribute("aria-expanded","true"),e.classList.add("is-open"),i.dataset.owner=e.dataset.index,this.options.animation?requestAnimationFrame(()=>i.classList.add("is-open")):i.classList.add("is-open")}_closeSubmenus(e){for(let t=this._submenus.length-1;t>=e;t--){const e=this._submenus[t];if(!e)continue;const n=this._menu&&void 0!==e.dataset.owner?this._menu.querySelector(`[data-index="${e.dataset.owner}"]`):null;n&&(n.setAttribute("aria-expanded","false"),n.classList.remove("is-open")),e.remove(),this._submenus.splice(t,1)}}_activate(e,t){const n=this._ctx,s=this.options;s.onSelect&&s.onSelect(e,n),H(e.action)&&e.action(n?n.target:null,n),s.closeOnSelect&&this.close()}_positionAt(e,t,n,s=null){const o=this.options,[i,r]=o.offset,a=e.offsetWidth,l=e.offsetHeight,d=document.documentElement.clientWidth,c=document.documentElement.clientHeight;let h=t+i,u=n+r;if(o.flip){if(h+a>d-8){const e=s?s.left-a:t-a-i;e>=8&&(h=e)}if(u+l>c-8){const e=s?n-l+s.height:n-l-r;e>=8&&(u=e)}}h=a<=d-16?Math.max(8,Math.min(h,d-a-8)):8,u=l<=c-16?Math.max(8,Math.min(u,c-l-8)):8,e.style.left=h+"px",e.style.top=u+"px"}_bindOpenListeners(){const e=this.options;this._outsideHandler=e=>{this._isOpen&&(this._menu&&this._menu.contains(e.target)||this._submenus.some(t=>t&&t.contains(e.target))||this.close())},e.closeOnClickOutside&&document.addEventListener("mousedown",this._outsideHandler,!0),this._contextHandler=e=>{this._menu&&this._menu.contains(e.target)&&e.preventDefault()},document.addEventListener("contextmenu",this._contextHandler),this._keyHandler=e=>this._onKeyDown(e),document.addEventListener("keydown",this._keyHandler,!0),e.closeOnScroll&&(this._scrollHandler=()=>this.close(),window.addEventListener("scroll",this._scrollHandler,!0)),this._resizeHandler=()=>this.close(),window.addEventListener("resize",this._resizeHandler)}_unbindOpenListeners(){this._outsideHandler&&(document.removeEventListener("mousedown",this._outsideHandler,!0),this._outsideHandler=null),this._contextHandler&&(document.removeEventListener("contextmenu",this._contextHandler),this._contextHandler=null),this._keyHandler&&(document.removeEventListener("keydown",this._keyHandler,!0),this._keyHandler=null),this._scrollHandler&&(window.removeEventListener("scroll",this._scrollHandler,!0),this._scrollHandler=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),clearTimeout(this._submenuTimer),clearTimeout(this._typeaheadTimer)}_focusableItems(){const e=this._submenus.length?this._submenus[this._submenus.length-1]:this._menu;return e?Array.from(e.querySelectorAll(".dm-context-menu-item:not(.is-disabled)")):[]}_moveFocus(e){const t=this._focusableItems();if(!t.length)return;let n=t.indexOf(document.activeElement)+e;n<0&&(n=t.length-1),n>=t.length&&(n=0),t[n].focus({preventScroll:!0})}_onKeyDown(e){if(!this._isOpen)return;const t=this.options;switch(e.key){case"Escape":if(!t.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void(this._submenus.length?this._closeSubmenus(this._submenus.length-1):this.close());case"ArrowDown":return e.preventDefault(),void this._moveFocus(1);case"ArrowUp":return e.preventDefault(),void this._moveFocus(-1);case"Home":{e.preventDefault();const t=this._focusableItems()[0];return void(t&&t.focus({preventScroll:!0}))}case"End":{e.preventDefault();const t=this._focusableItems();return void(t.length&&t[t.length-1].focus({preventScroll:!0}))}case"ArrowRight":{const t=document.activeElement;return void(t&&t.classList.contains("has-submenu")&&(e.preventDefault(),t.click(),requestAnimationFrame(()=>this._moveFocus(1))))}case"ArrowLeft":if(this._submenus.length){e.preventDefault(),this._closeSubmenus(this._submenus.length-1);const t=this._focusableItems();t.length&&t[0].focus({preventScroll:!0})}return;case"Enter":case" ":{const t=document.activeElement;return void(t&&t.classList.contains("dm-context-menu-item")&&(e.preventDefault(),t.click()))}}!t.typeahead||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey||this._typeahead(e.key)}_typeahead(e){clearTimeout(this._typeaheadTimer),this._typeaheadBuffer+=e.toLowerCase(),this._typeaheadTimer=setTimeout(()=>{this._typeaheadBuffer=""},600);const t=this._focusableItems().find(e=>{const t=e.querySelector(".dm-context-menu-label");return t&&t.textContent.toLowerCase().startsWith(this._typeaheadBuffer)});t&&t.focus({preventScroll:!0})}destroy(){var e;this.close(),T.delete(this),e=this._cursorId,(L.delete(e)||C.delete(e))&&($(),S()),this._node&&this._node.getAttribute("data-dm-ctx-cursor")===String(this._cursorId)&&this._node.removeAttribute("data-dm-ctx-cursor"),B&&!T.size&&(B=!1,document.removeEventListener("contextmenu",R),document.removeEventListener("keydown",q),document.removeEventListener("touchstart",U),document.removeEventListener("touchmove",K),document.removeEventListener("touchend",Y),document.removeEventListener("touchcancel",Y),R=q=U=K=Y=null),super.destroy()}}Z.closeAll=function(){j&&j.close()},Z.active=function(){return j},Z.registry=function(e=null){return e?V(e).map(e=>e.instance):Array.from(T)};const Q={_prefix:"domma:",_available:null,isAvailable(){if(null!==this._available)return this._available;try{const e=`${this._prefix}__test__`;localStorage.setItem(e,"test"),localStorage.removeItem(e),this._available=!0}catch(e){this._available=!1}return this._available},_prefixKey(e){return`${this._prefix}${e}`},_unprefixKey(e){return e.slice(this._prefix.length)},get(e,t=null){if(!this.isAvailable())return t;try{const n=this._prefixKey(e),s=localStorage.getItem(n);return null===s?t:JSON.parse(s)}catch(n){return console.warn(`Domma storage: Failed to parse key "${e}"`,n),t}},set(e,t){if(!this.isAvailable())return!1;try{const n=this._prefixKey(e),s=JSON.stringify(t);return localStorage.setItem(n,s),!0}catch(t){return console.warn(`Domma storage: Failed to set key "${e}"`,t),!1}},remove(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return localStorage.removeItem(t),!0}catch(t){return console.warn(`Domma storage: Failed to remove key "${e}"`,t),!1}},has(e){if(!this.isAvailable())return!1;try{const t=this._prefixKey(e);return null!==localStorage.getItem(t)}catch(e){return!1}},clear(){if(!this.isAvailable())return 0;try{const e=this.keys();return e.forEach(e=>this.remove(e)),e.length}catch(e){return console.warn("Domma storage: Failed to clear storage",e),0}},keys(){if(!this.isAvailable())return[];try{const e=[];for(let t=0;t<localStorage.length;t++){const n=localStorage.key(t);n&&n.startsWith(this._prefix)&&e.push(this._unprefixKey(n))}return e}catch(e){return[]}},size(e){if(!this.isAvailable())return 0;try{const t=this._prefixKey(e),n=localStorage.getItem(t);return n?new Blob([n]).size:0}catch(e){return 0}},totalSize(){if(!this.isAvailable())return 0;try{let e=0;return this.keys().forEach(t=>{e+=this.size(t)}),e}catch(e){return 0}},getAll(){if(!this.isAvailable())return{};const e={};return this.keys().forEach(t=>{e[t]=this.get(t)}),e},setAll(e){if(!this.isAvailable()||!e)return!1;let t=!0;return Object.keys(e).forEach(n=>{this.set(n,e[n])||(t=!1)}),t}},ee="sortable:",te='input, textarea, select, button, option, a[href], [contenteditable=""], [contenteditable="true"]',ne=e=>"function"==typeof e;class se extends h{static defaults={items:null,handle:null,nest:!1,live:null,axis:"y",key:"data-id",animation:200,easing:"cubic-bezier(0.2, 0.8, 0.2, 1)",threshold:4,touchDelay:220,nestZone:.5,accepts:null,disabled:!1,keyboard:!0,persist:!1,autoScroll:!0,ghostParent:null,onStart:null,onMove:null,onSort:null,onDrop:null,onCancel:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._drag=null,this._pending=null,this._animating=new WeakSet,this._flips=new WeakMap,this._docHandlers=[],this.element.classList.add("dm-sortable"),this._markHandles(),"undefined"!=typeof MutationObserver&&(this._observer=new MutationObserver(()=>this._markHandles()),this._observer.observe(this.element,{childList:!0,subtree:!0})),this._addEventListener(this.element,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(this.element,"keydown",e=>this._onKeyDown(e)),this._addEventListener(this.element,"dragstart",e=>{(this._pending||this._drag)&&e.preventDefault()}),this.options.persist&&this._isLive()&&this.restore())}toArray(){return this._items().map(e=>this._keyOf(e))}sort(e,{animate:t=!0}={}){const n=()=>{const t=this._items(),n=new Map(e.map((e,t)=>[String(e),t])),s=t.filter(e=>n.has(this._keyOf(e)));if(!s.length)return;const o=[...s].sort((e,t)=>n.get(this._keyOf(e))-n.get(this._keyOf(t)));s.map(e=>{const t=document.createComment("");return e.before(t),t}).forEach((e,t)=>{e.replaceWith(o[t])})};return t?this.animate(n):n(),this}restore(){const e=this._storageKey()?Q.get(this._storageKey()):null;return Array.isArray(e)&&e.length&&this.sort(e,{animate:!1}),this}forget(){const e=this._storageKey();return e&&Q.remove(e),this}animate(e){const t=this._snapshot(),n=e();return n&&ne(n.then)?n.then(e=>(this._playFlip(t),e)):(this._playFlip(t),n)}enable(){return this.options.disabled=!1,this.element?.classList.remove("dm-sortable-disabled"),this}disable(){return this._drag&&this._cancel(),this.options.disabled=!0,this.element?.classList.add("dm-sortable-disabled"),this}get dragging(){return!!this._drag}destroy(){this._drag&&this._finish(!1),this._clearPending(),this._observer?.disconnect(),this._liveRegion?.remove(),this.element&&(this.element.classList.remove("dm-sortable","dm-sortable-disabled","dm-sortable-active"),this.element.querySelectorAll(".dm-sortable-handle").forEach(e=>e.classList.remove("dm-sortable-handle"))),super.destroy()}_applyOptions(){this._markHandles(),this.element?.classList.toggle("dm-sortable-disabled",!!this.options.disabled)}_isLive(){return null==this.options.live?!this.options.nest:!!this.options.live}_items(){const e=this.element;if(!e)return[];return(this.options.items?Array.from(e.querySelectorAll(this.options.items)):Array.from(e.children)).filter(t=>!t.classList.contains("dm-sortable-ghost")&&!t.classList.contains("dm-sortable-indicator")&&!t.classList.contains("dm-sortable-live")&&this._ownerOf(t)===e)}_ownerOf(e){let t=e.parentElement;for(;t&&!t.classList.contains("dm-sortable");)t=t.parentElement;return t}_itemFrom(e){if(!(e instanceof Element))return null;const t=this._items();let n=e;for(;n&&n!==this.element;){if(t.includes(n))return n;n=n.parentElement}return null}_keyOf(e){const t=this.options.key,n=t?e.getAttribute(t):null;return null==n?null:String(n)}_byKey(e){return null==e?null:this._items().find(t=>this._keyOf(t)===e)||null}_markHandles(){this.element&&this.options.handle&&this.element.querySelectorAll(this.options.handle).forEach(e=>{e.classList.contains("dm-sortable-handle")||e.classList.add("dm-sortable-handle")})}_storageKey(){const e=this.options.persist;return e?!0===e?this.element?.id?ee+this.element.id:null:ee+e:null}_duration(){return function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animation)||0)}_onPointerDown(e){if(this.options.disabled||this._drag||this._pending||0!==e.button||e._dmSortable)return;const t=this._itemFrom(e.target);if(!t)return;e._dmSortable=!0;const{handle:n}=this.options;if(n){const s=e.target.closest(n);if(!s||!t.contains(s))return;e.preventDefault()}else if(e.target.closest(te)&&e.target.closest(te)!==t)return;const s="touch"===e.pointerType&&!n;this._pending={item:t,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY,ready:!s,timer:null},s&&(this._pending.timer=setTimeout(()=>{this._pending&&(this._pending.ready=!0,this._guard(()=>this._begin(this._pending.startX,this._pending.startY)))},this.options.touchDelay)),this._listenDoc("pointermove",e=>this._guard(()=>this._onPointerMove(e))),this._listenDoc("pointerup",e=>this._guard(()=>this._onPointerUp(e))),this._listenDoc("pointercancel",e=>this._guard(()=>this._onPointerCancel(e))),this._listenDoc("keydown",e=>{"Escape"===e.key&&this._drag&&(e.preventDefault(),e.stopPropagation(),this._guard(()=>this._cancel()))},!0),this._listenDoc("contextmenu",e=>{this._drag&&e.preventDefault()},!0),this._listenWin("blur",()=>this._guard(()=>{this._drag?this._cancel():this._clearPending()})),this._listenDoc("touchmove",e=>{this._drag&&e.preventDefault()},{passive:!1})}_onPointerMove(e){const t=this._pending;if(t&&e.pointerId===t.pointerId&&!this._drag){const n=Math.hypot(e.clientX-t.startX,e.clientY-t.startY);if(!t.ready)return void(n>8&&this._clearPending());if(n<this.options.threshold)return;this._begin(t.startX,t.startY)}if(this._drag&&e.pointerId===this._drag.pointerId){if("mouse"===e.pointerType&&0===e.buttons)return void this._onPointerUp(e);e.preventDefault(),this._moveTo(e.clientX,e.clientY)}}_guard(e){try{return e()}catch(e){if(this._drag){try{this._cancel()}catch{}this._drag&&this._finish(!1)}else this._clearPending();throw e}}_onPointerUp(e){if(this._drag&&e.pointerId===this._drag.pointerId)return this._moveTo(e.clientX,e.clientY),void this._drop();this._clearPending()}_onPointerCancel(e){this._drag&&e.pointerId===this._drag.pointerId?this._cancel():this._clearPending()}_listenDoc(e,t,n){document.addEventListener(e,t,n),this._docHandlers.push({target:document,event:e,handler:t,opts:n})}_listenWin(e,t,n){window.addEventListener(e,t,n),this._docHandlers.push({target:window,event:e,handler:t,opts:n})}_unlistenDoc(){for(const{target:e,event:t,handler:n,opts:s}of this._docHandlers)e.removeEventListener(t,n,s);this._docHandlers=[]}_clearPending(){this._pending?.timer&&clearTimeout(this._pending.timer),this._pending=null,this._drag||this._unlistenDoc()}_begin(e,t){const{item:n,pointerId:s}=this._pending;this._pending.timer&&clearTimeout(this._pending.timer),this._pending=null;const o=n.getBoundingClientRect(),i=this._items(),r=n.cloneNode(!0);r.removeAttribute("id"),this.options.key&&r.removeAttribute(this.options.key),r.querySelectorAll("[id]").forEach(e=>e.removeAttribute("id")),r.classList.add("dm-sortable-ghost"),r.setAttribute("aria-hidden","true"),Object.assign(r.style,{position:"fixed",left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`,margin:"0",boxSizing:"border-box",pointerEvents:"none",transform:"translate3d(0, 0, 0)"}),(this.options.ghostParent||this.element).appendChild(r),requestAnimationFrame(()=>r.classList.add("dm-sortable-ghost-lifted")),n.classList.add("dm-sortable-placeholder"),this.element.classList.add("dm-sortable-active"),document.documentElement.classList.add("dm-sortable-dragging");try{window.getSelection?.().removeAllRanges()}catch{}if(this._drag={item:n,pointerId:s,ghost:r,rect:o,offsetX:e-o.left,offsetY:t-o.top,x:e,y:t,from:i.indexOf(n),previous:i.map(e=>this._keyOf(e)),origin:{parent:n.parentNode,next:n.nextSibling},key:this._keyOf(n),target:null,zone:null,indicator:null,scrollRaf:null},!this._isLive()){const e=document.createElement("div");e.className="dm-sortable-indicator",e.setAttribute("aria-hidden","true"),this.element.appendChild(e),this._drag.indicator=e}this._emit("start",{item:n,from:this._drag.from}),this.options.autoScroll&&this._scrollLoop()}_moveTo(e,t){const n=this._drag;if(!n||n.settling)return;n.x=e,n.y=t,n.ghost.style.transform=`translate3d(${e-n.offsetX-n.rect.left}px, ${t-n.offsetY-n.rect.top}px, 0)`;const s=document.elementFromPoint(e,t),o=s?this._itemFrom(s):null;this._isLive()?o&&o!==n.item&&!this._animating.has(o)&&this._liveSwap(o,e,t):this._indicate(o,e,t),this._emit("move",{item:n.item,target:n.target||o,zone:n.zone,x:e,y:t})}_liveSwap(e,t,n){const s=this._drag,o=this._items(),i=o.indexOf(s.item),r=o.indexOf(e);if(i<0||r<0)return;const a=s.item.getBoundingClientRect(),l=e.getBoundingClientRect(),d="x"===this.options.axis,c=d?t:n,h=d?a.width:a.height,u=d?l.left:l.top,p=d?l.right:l.bottom,m=i<r;(m?c>p-h:c<u+h)&&(this.options.accepts&&!this.options.accepts(s.item,e,m?"after":"before")||this._flipItems(()=>{m?e.after(s.item):e.before(s.item)}))}_zoneFor(e,t,n){const s=e.getBoundingClientRect(),o="x"===this.options.axis,i=o?s.width:s.height,r=i?(o?t-s.left:n-s.top)/i:.5;if(this.options.nest){const e=(1-Math.min(Math.max(this.options.nestZone,0),1))/2;return r<e?"before":r>1-e?"after":"into"}return r<.5?"before":"after"}_indicate(e,t,n){const s=this._drag;let o=null;if(e&&e!==s.item&&(o=this._zoneFor(e,t,n),this.options.accepts&&!this.options.accepts(s.item,e,o)))if("into"===o){const i=e.getBoundingClientRect(),r="x"===this.options.axis?i.left+i.width/2:i.top+i.height/2;o=("x"===this.options.axis?t:n)<r?"before":"after",this.options.accepts(s.item,e,o)||(o=null)}else o=null;o||(e=null),s.target===e&&s.zone===o||(s.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),e&&e.classList.add("dm-sortable-over",`dm-sortable-over-${o}`),s.target=e,s.zone=o),this._placeIndicator()}_placeIndicator(){const e=this._drag,t=e?.indicator;if(!t)return;if(!e.target)return void t.classList.remove("is-visible");const n=e.target.getBoundingClientRect(),s="x"===this.options.axis;let o;o="into"===e.zone?{left:n.left,top:n.top,width:n.width,height:n.height}:s?{left:("before"===e.zone?n.left:n.right)-1.5,top:n.top,width:3,height:n.height}:{left:n.left,top:("before"===e.zone?n.top:n.bottom)-1.5,width:n.width,height:3};const i=!t.classList.contains("is-visible");i&&(t.style.transition="none"),Object.assign(t.style,{left:`${o.left}px`,top:`${o.top}px`,width:`${o.width}px`,height:`${o.height}px`}),t.classList.toggle("is-into","into"===e.zone),t.classList.add("is-visible"),i&&(t.offsetWidth,t.style.transition="")}_drop(){const e=this._drag;if(!e)return;if(this._suppressClick(),this._isLive()){const t=this.toArray(),n=this._items().indexOf(e.item),s=n!==e.from;return this._finish(!0),s&&(this._save(t),this._emit("sort",{item:e.item,from:e.from,to:n,order:t,previous:e.previous})),void this._emit("end",{item:e.item,changed:s})}const{target:t,zone:n}=e;if(!t||!n)return void this._cancel();const s={item:e.item,target:t,zone:n,key:e.key,targetKey:this._keyOf(t)};this._unlistenDoc(),e.scrollRaf&&cancelAnimationFrame(e.scrollRaf),e.settling=!0;let o=!0;const i=this.animate(()=>{if(ne(this.options.onDrop)){const e=this.options.onDrop(s);return!1===e&&(o=!1),e}"before"===n?t.before(e.item):"after"===n&&t.after(e.item)});this._dispatch("drop",s);const r=()=>{this._drag===e&&(o?(this._finish(!0),this._emit("end",{item:e.item,changed:!0})):this._cancel())};i&&ne(i.then)?i.then(r,()=>{this._drag===e&&this._cancel()}):r()}_cancel(){const e=this._drag;e&&(this._isLive()&&this._flipItems(()=>{e.origin.parent&&e.origin.parent.insertBefore(e.item,e.origin.next?.parentNode===e.origin.parent?e.origin.next:null)}),this._finish(!1),this._emit("cancel",{item:e.item}),this._emit("end",{item:e.item,changed:!1}))}_finish(e){const t=this._drag;if(!t)return;this._drag=null,this._unlistenDoc(),t.scrollRaf&&cancelAnimationFrame(t.scrollRaf),t.target?.classList.remove("dm-sortable-over","dm-sortable-over-before","dm-sortable-over-after","dm-sortable-over-into"),t.indicator?.remove(),this.element?.classList.remove("dm-sortable-active"),document.documentElement.classList.remove("dm-sortable-dragging");const n=(e&&null!=t.key?this._byKey(t.key):null)||(t.item.isConnected?t.item:null);t.item!==n&&t.item.classList.remove("dm-sortable-placeholder");const s=t.ghost,o=this._duration();if(!n||!o)return s.remove(),n?.classList.remove("dm-sortable-placeholder"),void(n&&this._announce(n));s.isConnected||(this.options.ghostParent||this.element).appendChild(s),n.classList.add("dm-sortable-placeholder","dm-sortable-landing");const i=n.getBoundingClientRect();s.style.transition=`transform ${o}ms ${this.options.easing}, width ${o}ms ${this.options.easing}, height ${o}ms ${this.options.easing}, scale ${o}ms ${this.options.easing}, box-shadow ${o}ms ${this.options.easing}`,s.classList.remove("dm-sortable-ghost-lifted"),s.style.transform=`translate3d(${i.left-t.rect.left}px, ${i.top-t.rect.top}px, 0)`,s.style.width=`${i.width}px`,s.style.height=`${i.height}px`;let r=!1;const a=()=>{r||(r=!0,s.remove(),n.classList.remove("dm-sortable-placeholder","dm-sortable-landing"),this._announce(n))};s.addEventListener("transitionend",e=>{"transform"===e.propertyName&&a()}),setTimeout(a,o+80)}_suppressClick(){const e=e=>{e.stopPropagation(),e.preventDefault()};document.addEventListener("click",e,!0),setTimeout(()=>document.removeEventListener("click",e,!0),0)}_scrollLoop(){const e=this._drag;if(!e)return;const t="x"===this.options.axis?"x":"y",n=function(e,t){let n=e;for(;n&&n!==document.body&&n!==document.documentElement;){const e=getComputedStyle(n),s="x"===t?e.overflowX:e.overflowY;if(("x"===t?n.scrollWidth>n.clientWidth:n.scrollHeight>n.clientHeight)&&/(auto|scroll|overlay)/.test(s))return n;n=n.parentElement}return null}(this.element,t),s=()=>{if(this._drag!==e||e.settling)return;const o=n?n.getBoundingClientRect():{top:0,left:0,bottom:window.innerHeight,right:window.innerWidth},i="x"===t?e.x:e.y,r="x"===t?o.left:o.top,a="x"===t?o.right:o.bottom;let l=0;if(i<r+48?l=-Math.ceil(18*(1-Math.max(i-r,0)/48)):i>a-48&&(l=Math.ceil(18*(1-Math.max(a-i,0)/48))),l){const s=n||window;"x"===t?s.scrollBy(l,0):s.scrollBy(0,l),this._moveTo(e.x,e.y)}e.scrollRaf=requestAnimationFrame(s)};e.scrollRaf=requestAnimationFrame(s)}_onKeyDown(e){if(!this.options.keyboard||this.options.disabled||this._drag||!this._isLive()||!e.altKey)return;const t="x"===this.options.axis,n=t?"ArrowLeft":"ArrowUp",s=t?"ArrowRight":"ArrowDown";if(e.key!==n&&e.key!==s)return;const o=this._itemFrom(e.target);if(!o||e.target!==o&&(!this.options.handle||!e.target.closest(this.options.handle)))return;const i=this._items(),r=i.indexOf(o),a=e.key===n?r-1:r+1;if(a<0||a>=i.length)return;const l=i[a];if(this.options.accepts&&!this.options.accepts(o,l,e.key===n?"before":"after"))return;e.preventDefault();const d=i.map(e=>this._keyOf(e));this._flipItems(()=>{e.key===n?l.before(o):l.after(o)}),e.target.focus();const c=this.toArray();this._save(c),this._emit("sort",{item:o,from:r,to:a,order:c,previous:d}),this._emit("end",{item:o,changed:!0}),this._announce(o)}_announce(e){const t=this._items(),n=t.indexOf(e);if(!(n<0)){if(!this._liveRegion){const e=document.createElement("div");e.className="dm-sortable-live",e.setAttribute("role","status"),e.setAttribute("aria-live","polite"),document.body.appendChild(e),this._liveRegion=e}this._liveRegion.textContent=`Moved to position ${n+1} of ${t.length}`}}_snapshot({withDragged:e=!1}={}){const t=new Map,n=this._drag;for(const s of this._items()){if(n&&s===n.item&&!e)continue;const o=s.getBoundingClientRect();t.set(s,o);const i=this._keyOf(s);null!=i&&t.set(`key:${i}`,o)}return t}_playFlip(e){const t=this._duration();if(t)for(const n of this._items()){const s=this._keyOf(n),o=e.get(n)||(null!=s?e.get(`key:${s}`):null);if(!o||!ne(n.animate))continue;const i=n.getBoundingClientRect(),r=o.left-i.left,a=o.top-i.top;if(Math.abs(r)<.5&&Math.abs(a)<.5)continue;this._flips.get(n)?.cancel(),this._animating.add(n);const l=n.animate([{transform:`translate(${r}px, ${a}px)`},{transform:"translate(0, 0)"}],{duration:t,easing:this.options.easing});this._flips.set(n,l);const d=()=>{this._flips.get(n)===l&&(this._flips.delete(n),this._animating.delete(n))};l.onfinish=d,l.oncancel=d}}_flipItems(e){const t=this._snapshot({withDragged:!0});e(),this._playFlip(t)}_save(e){const t=this._storageKey();t&&this._isLive()&&Q.set(t,e.filter(e=>null!=e))}_emit(e,t){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];ne(n)&&n(t),this._dispatch(e,t)}_dispatch(e,t){this.element?.dispatchEvent(new CustomEvent(`sortable:${e}`,{detail:t,bubbles:!0}))}}const oe="input-group-icon",ie=/^[a-z0-9-]+$/i,re=/^(text|search|email|url|tel|password|number|date|datetime-local|time|month|week)$/,ae=/^(text|search|email|url|tel|password)$/;let le=0;function de(e){return null==e||!1===e||""===e?null:"string"==typeof e||"number"==typeof e?{text:String(e)}:"object"!=typeof e?null:e.icon&&ie.test(e.icon)?{icon:e.icon}:null!=e.text&&""!==e.text?{text:String(e.text)}:null}function ce(){return"undefined"!=typeof window&&(window.Domma?.icons||window.I)||null}function he(e,t){e.textContent="";const n=document.createElement("span");n.setAttribute("data-icon",t),n.setAttribute("aria-hidden","true"),e.appendChild(n),ce()?.scan?.(e)}function ue(e,t){const n=document.createElement("span");if(n.className=`input-group-addon input-group-addon-${t}`,n.setAttribute("aria-hidden","true"),e.icon){const t=document.createElement("span");t.setAttribute("data-icon",e.icon),n.appendChild(t)}else n.textContent=e.text;return n}function pe(e,t,n,s){const o=document.createElement("button");return o.type="button",o.className=`input-group-btn input-group-btn-${t} input-group-${e}`,o.setAttribute("aria-label",n),he(o,s),o}function me(e){const t=String(e),n=t.match(/e-(\d+)$/i);if(n)return Number(n[1]);const s=t.indexOf(".");return-1===s?0:t.length-s-1}function fe(e,t){const n=e.getAttribute(t);if(null==n||""===n||"any"===n)return null;const s=Number(n);return Number.isFinite(s)?s:null}class ge extends h{static defaults={prefix:null,suffix:null,reveal:!1,clear:!1,stepper:!1,counter:!1,labels:{reveal:"Show password",clear:"Clear",decrease:"Decrease",increase:"Increase"}};constructor(e,t={}){if(super(e,t),this.options.labels={...ge.defaults.labels,...t.labels||{}},this.input=this.element,this._extraHandlers=[],this._timers={},this.extras={},!this.input)return;const n=this.input.parentElement;this._ownsWrapper=!(n&&n.classList.contains(oe)),this._ownsWrapper?(this.wrapper=document.createElement("div"),this.wrapper.className=oe,this.input.before(this.wrapper),this.wrapper.appendChild(this.input)):this.wrapper=n,this._manageAddons=this._ownsWrapper||"prefix"in t||"suffix"in t,this._render(),this._buildExtras()}update(e={}){const{prefix:t,suffix:n}=e;let s=!1;void 0!==t&&(this.options.prefix=t,s=!0),void 0!==n&&(this.options.suffix=n,s=!0),s&&(this._manageAddons=!0,this._render());const o=["reveal","clear","stepper","counter"].filter(t=>void 0!==e[t]);return o.length||e.labels?(o.forEach(t=>{this.options[t]=e[t]}),e.labels&&(this.options.labels={...this.options.labels,...e.labels}),this._teardownExtras(),this._buildExtras()):this._syncEdges(),this}refresh(){const e=this.extras;if(!e||!this.input)return this;const t=this.input,n=t.disabled||t.readOnly;if(e.clear&&(e.clear.hidden=n||""===t.value),e.reveal&&(e.reveal.disabled=t.disabled),e.decrease){const{min:s,max:o}=this._limits(),i=""===t.value?null:Number(t.value),r=null!=i&&Number.isFinite(i);e.decrease.disabled=n||r&&null!=s&&i<=s,e.increase.disabled=n||r&&null!=o&&i>=o,[e.decrease,e.increase].forEach(e=>{e.disabled&&document.activeElement===e&&t.focus()}),e.decrease.disabled&&e.increase.disabled&&this._stopRepeat()}if(e.counter){const n=this._counterLimit(),s=t.value.length;e.counter.textContent=n?`${s} / ${n}`:String(s),e.counter.classList.toggle("is-warning",!!n&&s>=Math.ceil(.9*n)&&s<=n),e.counter.classList.toggle("is-over",!!n&&s>n)}return this._syncEdges(),this}_applyOptions(){this.options.labels={...ge.defaults.labels,...this.options.labels||{}},this._render(),this._teardownExtras(),this._buildExtras()}_render(){const e=this.wrapper;if(e){if(this._manageAddons){e.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove());const t=de(this.options.prefix),n=de(this.options.suffix);t&&e.prepend(ue(t,"left")),n&&e.append(ue(n,"right")),(t&&t.icon||n&&n.icon)&&ce()?.scan?.(e)}this._syncEdges()}}_syncEdges(){const e=this.wrapper;if(!e||!this.input)return;const t=e=>e&&!e.hidden;let n=!1,s=!1;for(let e=this.input.previousElementSibling;e;e=e.previousElementSibling)if(t(e)){n=!0;break}for(let e=this.input.nextElementSibling;e;e=e.nextElementSibling)if(t(e)){s=!0;break}e.classList.toggle("has-addon-left",n),e.classList.toggle("has-addon-right",s)}_listen(e,t,n,s){e.addEventListener(t,n,s),this._extraHandlers.push({el:e,event:t,handler:n,opts:s})}_limits(){return{min:fe(this.input,"min"),max:fe(this.input,"max"),step:fe(this.input,"step")}}_counterLimit(){const e=this.options.counter;if("number"==typeof e&&e>0)return e;const t=this.input.maxLength;return t>0?t:null}_buildExtras(){const e=this.input,t=this.wrapper;if(!e||!t)return;const n=this.options,s=n.labels,o=e.tagName.toLowerCase(),i="textarea"===o?"textarea":(e.getAttribute("type")||"text").toLowerCase(),r="password"===i,a={},l=[];if(n.stepper&&"number"===i&&(a.decrease=pe("decrease","left",s.decrease,"minus"),a.increase=pe("increase","right",s.increase,"plus"),e.before(a.decrease),this._bindStep(a.decrease,-1),this._bindStep(a.increase,1)),n.clear&&("textarea"===o||re.test(i))&&(a.clear=pe("clear","right",s.clear,"x"),l.push(a.clear),this._listen(a.clear,"mousedown",e=>e.preventDefault()),this._listen(a.clear,"click",()=>{e.value="",this._emit(),e.focus(),this.refresh()})),n.reveal&&r&&(a.reveal=pe("reveal","right",s.reveal,"eye"),a.reveal.setAttribute("aria-pressed","false"),l.push(a.reveal),this._listen(a.reveal,"mousedown",e=>e.preventDefault()),this._listen(a.reveal,"click",()=>this._setRevealed("true"!==a.reveal.getAttribute("aria-pressed")))),a.increase&&l.push(a.increase),l.length&&e.after(...l),e.id&&Object.values(a).forEach(t=>t.setAttribute("aria-controls",e.id)),n.counter&&("textarea"===o||ae.test(i))){a.counter=document.createElement("div"),a.counter.className="form-counter",a.counter.id=`${e.id||"input"}-counter-${++le}`,a.counter.setAttribute("aria-live","polite"),t.after(a.counter);const n=(e.getAttribute("aria-describedby")||"").split(/\s+/).filter(Boolean);this._describedBy=e.getAttribute("aria-describedby"),e.setAttribute("aria-describedby",[...n,a.counter.id].join(" "))}this.extras=a,Object.keys(a).length&&(this._listen(e,"input",()=>this.refresh()),this._listen(e,"change",()=>this.refresh()),e.form&&this._listen(e.form,"reset",()=>{a.reveal&&this._setRevealed(!1),this._timers.reset=setTimeout(()=>this.refresh(),0)})),this.refresh()}_setRevealed(e){const t=this.extras?.reveal;t&&(this.input.type=e?"text":"password",t.setAttribute("aria-pressed",e?"true":"false"),he(t,e?"eye-off":"eye"))}_emit(){this.input.dispatchEvent(new Event("input",{bubbles:!0})),this.input.dispatchEvent(new Event("change",{bubbles:!0}))}step(e){const t=this.input;if(!t||t.disabled||t.readOnly)return this;const{min:n,max:s,step:o}=this._limits(),i=o&&o>0?o:1,r=null!=n?n:0,a=Math.max(me(i),me(r)),l=""!==t.value&&Number.isFinite(Number(t.value))?Number(t.value):null,d=((l??0)-r)/i;let c=r+(e>0?Math.floor(d+1e-9)+1:Math.ceil(d-1e-9)-1)*i;return null!=n&&c<n&&(c=n),null!=s&&c>s&&(c=s),c=Number(c.toFixed(a)),l!==c&&(t.value=String(c),this._emit()),this.refresh(),this}_bindStep(e,t){this._listen(e,"pointerdown",n=>{0!==n.button||e.disabled||(n.preventDefault(),this._pointerStepped=!0,this.step(t),this._stopRepeat(),this._timers.delay=setTimeout(()=>{this._timers.repeat=setInterval(()=>{e.disabled?this._stopRepeat():this.step(t)},70)},400))}),["pointerup","pointerleave","pointercancel","blur"].forEach(t=>{this._listen(e,t,()=>this._stopRepeat())}),this._listen(e,"click",e=>{e.detail>0&&this._pointerStepped?this._pointerStepped=!1:this.step(t)})}_stopRepeat(){clearTimeout(this._timers.delay),clearInterval(this._timers.repeat),this._timers.delay=this._timers.repeat=null}_teardownExtras(){this._stopRepeat(),clearTimeout(this._timers.reset);for(const{el:e,event:t,handler:n,opts:s}of this._extraHandlers)e.removeEventListener(t,n,s);this._extraHandlers=[];const e=this.extras||{};e.reveal&&this.input&&(this.input.type="password"),e.counter&&this.input&&(this._describedBy?this.input.setAttribute("aria-describedby",this._describedBy):this.input.removeAttribute("aria-describedby")),Object.values(e).forEach(e=>e.remove()),this.extras={},this._syncEdges()}destroy(){this._teardownExtras(),this.wrapper&&(this._manageAddons&&this.wrapper.querySelectorAll(":scope > .input-group-addon").forEach(e=>e.remove()),this._syncEdges(),this._ownsWrapper&&this.wrapper.parentNode&&(this.wrapper.before(this.input),this.wrapper.remove())),this.wrapper=null,super.destroy()}}const ve=new Set(["text","card","list","table","custom"]),be={type:"text",lines:null,count:null,rows:5,columns:4,header:!0,avatar:!0,image:!0,animate:!0,template:null,label:"Loading..."},ye=new WeakMap;function _e(e){return e?"string"==typeof e?document.querySelector(e):1===e.nodeType?e:"number"==typeof e.length&&e[0]&&1===e[0].nodeType?e[0]:null:null}function ke(e,t){const n=parseInt(e,10);return Number.isFinite(n)&&n>0?Math.min(n,100):t}function we(e,t){let n="";for(let s=0;s<e;s++)n+=t(s);return n}function xe(e,t=""){const n=t?` ${t}`:"";return`<div class="skeleton-lines">${we(e,()=>`<div class="skeleton skeleton-text${n}"></div>`)}</div>`}function Me(e={}){const t={...be,...e};switch(ve.has(t.type)?t.type:"text"){case"card":{const e=ke(t.lines,3);return we(ke(t.count,1),()=>'<div class="skeleton-card">'+(t.image?'<div class="skeleton skeleton-image"></div>':"")+'<div class="skeleton-card-body"><div class="skeleton skeleton-heading"></div>'+xe(e)+"</div></div>")}case"list":{const e=ke(t.lines,2);return'<div class="skeleton-list">'+we(ke(t.count,3),()=>'<div class="skeleton-list-item">'+(t.avatar?'<div class="skeleton skeleton-circle"></div>':"")+'<div class="skeleton-list-item-content"><div class="skeleton skeleton-text skeleton-w-50"></div>'+we(e-1,()=>'<div class="skeleton skeleton-text skeleton-text-sm skeleton-w-75"></div>')+"</div></div>")+"</div>"}case"table":{const e=ke(t.columns,4),n=t=>we(e,()=>`<div class="skeleton skeleton-text${t}"></div>`);return`<div class="skeleton-table" style="--dm-skeleton-columns: ${e}">`+(t.header?`<div class="skeleton-table-row skeleton-table-head">${n(" skeleton-w-50")}</div>`:"")+we(ke(t.rows,5),()=>`<div class="skeleton-table-row">${n("")}</div>`)+"</div>"}case"custom":{const e="function"==typeof t.template?t.template(t):t.template;return null==e?"":String(e)}default:return we(ke(t.count,1),()=>xe(ke(t.lines,3)))}}function Le(e){const t=e.dataset||{},n={};t.skeleton&&ve.has(t.skeleton)&&(n.type=t.skeleton);for(const e of["lines","count","rows","columns"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["avatar","image","animate","header"]){const s=t[`skeleton${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return t.skeletonLabel&&(n.label=t.skeletonLabel),n}function Ce(e,t={}){const n=_e(e);if(!n)return null;const s=ye.get(n);s&&s.remove();const o={...be,...Le(n),...t},i=document.createDocumentFragment();for(;n.firstChild;)i.appendChild(n.firstChild);const r=document.createElement("template");r.innerHTML=Me(o);const a=Array.from(r.content.childNodes);for(const e of a)1===e.nodeType&&(e.setAttribute("aria-hidden","true"),o.animate||e.classList.add("skeleton-static"));const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),n.appendChild(r.content),n.appendChild(l),setTimeout(()=>{l.parentNode===n&&(l.textContent=o.label)},100),n.setAttribute("aria-busy","true"),n.classList.add("is-skeleton-loading");let d=!0;const c=()=>{for(const e of a)e.parentNode===n&&n.removeChild(e);l.parentNode===n&&n.removeChild(l),n.setAttribute("aria-busy","false"),n.classList.remove("is-skeleton-loading"),n.hasAttribute("data-skeleton")&&n.setAttribute("data-skeleton-done",""),ye.get(n)===h&&ye.delete(n),d=!1},h={element:n,options:o,get active(){return d},remove:()=>d?(c(),n.appendChild(i),n):n,replace(e){const t=ye.get(n);return!d&&t&&t!==h?n:(d&&c(),n.textContent="",null==e||("string"==typeof e?n.innerHTML=e:e.nodeType?n.appendChild(e):"number"==typeof e.length&&Array.from(e).forEach(e=>e&&e.nodeType&&n.appendChild(e))),n)},destroy:()=>h.remove()};return ye.set(n,h),h}Ce.while=async function(e,t,n={}){const s=Ce(e,n);try{const e=await("function"==typeof t?t():t);return s&&s.remove(),e}catch(e){throw s&&s.remove(),e}},Ce.get=function(e){const t=_e(e);return t&&ye.get(t)||null},Ce.remove=function(e){const t=Ce.get(e);return t?t.remove():null},Ce.scan=function(e=document){const t=_e(e)||document;return Array.from(t.querySelectorAll("[data-skeleton]")).filter(e=>!ye.has(e)&&!e.hasAttribute("data-skeleton-done")).map(e=>Ce(e))},Ce.markup=Me;const Ee=["top","bottom","left","right"],Ae={top:"bottom",bottom:"top",left:"right",right:"left"},Se={top:["right","left"],bottom:["right","left"],left:["bottom","top"],right:["bottom","top"]},$e=["bottom","top","right","left"],ze=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","summary",'[contenteditable=""]','[contenteditable="true"]',"[tabindex]"].join(","),Te="a[href], button, input, select, textarea, summary",je=e=>"function"==typeof e,Be=e=>"undefined"!=typeof Node&&e instanceof Node,De=[],We=new WeakMap;let He=0,Oe=!1;function Ie(e){return e?"string"==typeof e?document.querySelector(e):Be(e)?e:"function"==typeof e.get&&Be(e.get(0))?e.get(0):Be(e[0])?e[0]:null:null}function Ne(e){return e?Array.from(e.querySelectorAll(ze)).filter(e=>!(e.tabIndex<0)&&(!e.closest("[hidden], [inert]")&&("function"!=typeof e.checkVisibility||e.checkVisibility({visibilityProperty:!0})))):[]}function Pe(e){if(e&&"object"==typeof e)return{show:Number(e.show)||0,hide:Number(e.hide)||0};const t=Number(e)||0;return{show:t,hide:t}}const Ve=".dm-context-menu";function Fe(e){const t=e.target;if(!(t instanceof Element&&t.closest(Ve)))for(const e of De.slice().reverse())e._open&&e.options.closeOnOutside&&(e._contains(t)||e.hide({returnFocus:!1}))}function Re(e){if("Escape"!==e.key&&"Esc"!==e.key)return;const t=De[De.length-1];if(!t||!t.options.closeOnEscape)return;const n=e.target;if(t._panel&&n instanceof Node&&t._panel.contains(n))return;if(n instanceof Element&&n.closest(Ve))return;const s=t._contains(document.activeElement);e.preventDefault(),e.stopPropagation(),t.hide({returnFocus:s})}function qe(e){const t=e.target;if(!(t instanceof Element&&t.closest(Ve)))for(const e of De.slice().reverse())e._open&&e._closesOnFocusLeave()&&(e._contains(t)||e.hide({returnFocus:!1}))}function Ue(){Oe&&!De.length&&(Oe=!1,document.removeEventListener("pointerdown",Fe,!0),document.removeEventListener("keydown",Re,!0),document.removeEventListener("focusin",qe,!0))}class Ke extends h{static defaults={content:"",title:"",html:!1,trigger:"click",placement:"bottom",flip:!0,offset:10,arrow:!0,dismissible:!1,closeOnOutside:!0,closeOnEscape:!0,group:"default",width:null,maxWidth:null,className:"",id:null,role:null,ariaLabel:null,autoFocus:null,trapFocus:!1,delay:{show:80,hide:120},animation:!0,animationDuration:150,container:null,zIndex:null,onShow:null,onShown:null,onHide:null,onHidden:null};constructor(e,t={}){if(super(Ie(e),t),this._open=!1,this._panel=null,this._parent=null,this._timers={show:null,hide:null,remove:null,shown:null},this._triggerHandlers=[],this._openHandlers=[],this._savedAttrs=null,this._frame=null,this._resizeObserver=null,this._destroyed=!1,!this.element)return;const n=We.get(this.element);n&&n!==this&&(n.destroy(),this.element._dommaComponent=this),We.set(this.element,this),this.id=this.options.id||"dm-popover-"+ ++He,this._saveAttrs(),this._applyTriggerAria(),this._bindTrigger()}get panel(){return this._panel}get trigger(){return this.element}isOpen(){return this._open}show(e={}){if(!this.element||this._destroyed||!this.element.isConnected)return this;if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open)return this;if(!this._emit("show",!0))return this;this._openedBy=e.via||"api";const t=this._ensurePanel();this._render(),this._parent=De.slice().reverse().find(e=>e!==this&&e._panel&&e._panel.contains(this.element))||null;const n=this.options.group;if(null!=n&&!1!==n)for(const e of De.slice())e!==this&&e.options.group===n&&(e._isAncestorOf(this)||e.hide({returnFocus:!1}));clearTimeout(this._timers.remove),clearTimeout(this._timers.shown);const s=Ie(this.options.container)||document.body;if(t.parentNode!==s&&s.appendChild(t),this._open=!0,De.push(this),Oe||"undefined"==typeof document||(Oe=!0,document.addEventListener("pointerdown",Fe,!0),document.addEventListener("keydown",Re,!0),document.addEventListener("focusin",qe,!0)),this._bindOpen(),this._setExpanded(!0),t.classList.remove("is-open"),this.update(),!this._open)return this;t.offsetHeight,t.classList.add("is-open");(void 0!==e.focus?e.focus:null!==this.options.autoFocus?this.options.autoFocus:"click"===this._openedBy||"api"===this._openedBy&&this._triggers().includes("click"))&&this._focusInside();const o=this._duration();return o?this._timers.shown=setTimeout(()=>{this._open&&this._emit("shown")},o):this._emit("shown"),this}hide(e={}){if(clearTimeout(this._timers.show),clearTimeout(this._timers.hide),!this._open)return this;if(!this._emit("hide",!e._force)&&!e._force)return this;for(const e of De.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});const t=this._panel,n=t&&t.contains(document.activeElement),s=void 0!==e.returnFocus?e.returnFocus:n;this._open=!1,this._parent=null;const o=De.indexOf(this);if(o>-1&&De.splice(o,1),this._unbindOpen(),Ue(),this._setExpanded(!1),clearTimeout(this._timers.shown),s&&this.element&&je(this.element.focus)){this._returningFocus=!0;try{this.element.focus({preventScroll:!0})}finally{this._returningFocus=!1}}if(t){t.classList.remove("is-open");const e=()=>{this._open||(t.remove(),this._emit("hidden"))},n=this._duration();n?this._timers.remove=setTimeout(e,n):e()}return this}toggle(e={}){return this._open?this.hide(e):this.show(e)}setContent(e){return this.options.content=e,this._panel&&(this._renderBody(),this._open&&this.update()),this}setTitle(e){return this.options.title=e,this._panel&&(this._renderTitle(),this._open&&this.update()),this}update(){return this._open&&this._panel&&this.element?this.element.isConnected?(this._position(),this):(this.hide({returnFocus:!1}),this):this}destroy(){if(this._destroyed)return;this._destroyed=!0;if(De.indexOf(this)>-1){for(const e of De.slice())e!==this&&e._parent===this&&e.hide({returnFocus:!1,_force:!0});De.splice(De.indexOf(this),1)}const e=this._panel&&this._panel.contains(document.activeElement);this._open=!1,this._unbindOpen(),Ue(),Object.values(this._timers).forEach(e=>clearTimeout(e)),this._panel&&(this._panel.remove(),this._panel=null),this._unbindTrigger(),this._restoreAttrs(),e&&this.element&&je(this.element.focus)&&this.element.focus({preventScroll:!0}),this.element&&We.get(this.element)===this&&We.delete(this.element),je(this._onDestroy)&&this._onDestroy(this),super.destroy()}setOptions(e={}){return this._changedKeys=Object.keys(e||{}),super.setOptions(e)}_applyOptions(){if(this.element&&!this._destroyed){if(this._unbindTrigger(),this._applyTriggerAria(),this._bindTrigger(),this._panel){this._styleNode();const e=this._changedKeys||[];(e.includes("content")||e.includes("html"))&&this._renderBody(),e.includes("title")||e.includes("html")?this._renderTitle():this._label(),this._open&&this.update()}this._changedKeys=null}}_triggers(){return String(this.options.trigger||"click").split(/[\s,]+/).filter(Boolean)}_role(){if(this.options.role)return this.options.role;const e=this._triggers();return e.length&&e.every(e=>"hover"===e||"focus"===e)?"tooltip":"dialog"}_closesOnFocusLeave(){const e=this._triggers();return this.options.closeOnOutside||e.includes("focus")||e.includes("hover")}_on(e,t,n,s){e.addEventListener(t,n),s.push({el:e,event:t,handler:n})}_bindTrigger(){const e=this.element,t=this._triggerHandlers,n=this._triggers(),s=()=>Pe(this.options.delay);n.includes("click")&&(this._on(e,"click",t=>{if(e.matches?.("a[href]")&&t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void(!1!==this.options.autoFocus&&this._focusInside());this.toggle({via:"click"})},t),e.matches?.(Te)||this._on(e,"keydown",t=>{if(t.target===e&&!t.repeat&&("Enter"===t.key||" "===t.key)){if(t.preventDefault(),this._open&&"click"!==this._openedBy)return this._openedBy="click",void this._focusInside();this.toggle({focus:!0,via:"click"})}},t)),n.includes("hover")&&(this._on(e,"mouseenter",()=>this._scheduleShow(s().show),t),this._on(e,"mouseleave",()=>this._scheduleHide(s().hide,"hover"),t)),(n.includes("focus")||n.includes("hover"))&&(this._on(e,"focusin",()=>{this._returningFocus||this.show({focus:!1,via:"focus"})},t),this._on(e,"focusout",e=>{this._contains(e.relatedTarget)||this._scheduleHide(0,"focus")},t)),this._on(e,"keydown",e=>{if("Tab"!==e.key||e.shiftKey||!this._open||!this._panel)return;const t=Ne(this._panel);t.length&&(e.preventDefault(),t[0].focus())},t)}_unbindTrigger(){for(const{el:e,event:t,handler:n}of this._triggerHandlers)e.removeEventListener(t,n);this._triggerHandlers=[]}_scheduleShow(e){clearTimeout(this._timers.hide),clearTimeout(this._timers.show),this._open||(e>0?this._timers.show=setTimeout(()=>this.show({focus:!1,via:"hover"}),e):this.show({focus:!1,via:"hover"}))}_scheduleHide(e,t=null){clearTimeout(this._timers.show),clearTimeout(this._timers.hide),this._open&&(t&&"click"===this._openedBy||(e>0?this._timers.hide=setTimeout(()=>this.hide(),e):this.hide()))}_saveAttrs(){const e=this.element,t=["aria-haspopup","aria-expanded","aria-controls","aria-describedby","tabindex","role"];this._savedAttrs={};for(const n of t)this._savedAttrs[n]=e.hasAttribute(n)?e.getAttribute(n):null}_restoreAttrs(){const e=this.element;if(e&&this._savedAttrs){for(const[t,n]of Object.entries(this._savedAttrs))null===n?e.removeAttribute(t):e.setAttribute(t,n);e.classList.remove("dm-popover-trigger","is-popover-open")}}_applyTriggerAria(){const e=this.element;this._restoreAttrs(),e.classList.add("dm-popover-trigger"),"dialog"===this._role()&&(e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded",this._open?"true":"false"));const t=this._triggers();!(t.includes("click")||t.includes("focus")||t.includes("hover"))||e.matches?.(Te)||e.hasAttribute("tabindex")||e.setAttribute("tabindex","0"),!t.includes("click")||e.matches?.(Te)||e.hasAttribute("role")||e.setAttribute("role","button"),this._open&&this._setExpanded(!0)}_setExpanded(e){const t=this.element;if(t)if(t.classList.toggle("is-popover-open",e),"dialog"===this._role())t.setAttribute("aria-expanded",e?"true":"false"),e?t.setAttribute("aria-controls",this.id):null!=this._savedAttrs?.["aria-controls"]?t.setAttribute("aria-controls",this._savedAttrs["aria-controls"]):t.removeAttribute("aria-controls");else{const n=(t.getAttribute("aria-describedby")||"").split(/\s+/).filter(e=>e&&e!==this.id);e&&n.push(this.id),n.length?t.setAttribute("aria-describedby",n.join(" ")):t.removeAttribute("aria-describedby")}}_ensurePanel(){if(this._panel)return this._panel;const e=document.createElement("div");e.id=this.id,e.setAttribute("tabindex","-1");const t=document.createElement("div");t.className="dm-popover-arrow",t.setAttribute("aria-hidden","true");const n=document.createElement("div");n.className="dm-popover-header";const s=document.createElement("div");s.className="dm-popover-title",s.id=`${this.id}-title`,n.appendChild(s);const o=document.createElement("div");o.className="dm-popover-body";const i=document.createElement("button");i.type="button",i.className="dm-popover-close",i.setAttribute("aria-label","Close");const r=document.createElement("span");return r.setAttribute("data-icon","x"),r.setAttribute("data-icon-size","16"),r.setAttribute("aria-hidden","true"),i.appendChild(r),e.append(t,n,o,i),this._panel=e,this._parts={arrow:t,header:n,title:s,body:o,close:i},i.addEventListener("click",()=>this.hide({returnFocus:!0})),e.addEventListener("keydown",e=>this._onPanelKeyDown(e)),e.addEventListener("mouseenter",()=>{this._triggers().includes("hover")&&clearTimeout(this._timers.hide)}),e.addEventListener("mouseleave",()=>{this._triggers().includes("hover")&&this._scheduleHide(Pe(this.options.delay).hide,"hover")}),e.addEventListener("focusout",e=>{const t=this._triggers();(t.includes("focus")||t.includes("hover"))&&(this._contains(e.relatedTarget)||this._scheduleHide(0,"focus"))}),this._styleNode(),e}_styleNode(){const e=this._panel,t=this.options,n=this._role(),s=["dm-popover"];t.dismissible&&s.push("is-dismissible"),t.arrow||s.push("no-arrow"),this._open&&s.push("is-open"),e.classList.contains("has-title")&&s.push("has-title"),e.classList.contains("is-detached")&&s.push("is-detached"),t.className&&s.push(...String(t.className).split(/\s+/).filter(Boolean)),e.className=s.join(" "),e.setAttribute("role",n),e.dataset.animation=t.animation?"on":"off",e.style.setProperty("--dm-popover-duration",`${this._duration()}ms`);const o=(t,n)=>{null==n||""===n?e.style.removeProperty(t):e.style.setProperty(t,"number"==typeof n?`${n}px`:String(n))};o("--dm-popover-width",t.width),o("--dm-popover-max-width",t.maxWidth),null!==t.zIndex&&void 0!==t.zIndex?e.style.zIndex=String(t.zIndex):e.style.removeProperty("z-index"),this._parts.arrow.hidden=!t.arrow,this._parts.close.hidden=!t.dismissible}_render(){this._renderTitle(),this._renderBody()}_renderTitle(){const{title:e,header:t}=this._parts,n=this._fill(e,this.options.title);t.hidden=!n,this._panel.classList.toggle("has-title",n),this._label()}_renderBody(){this._fill(this._parts.body,this.options.content),"undefined"!=typeof window&&window.Domma?.icons&&je(window.Domma.icons.scan)&&window.Domma.icons.scan(this._panel)}_label(){const e=this._panel;!this._parts.header.hidden?(e.setAttribute("aria-labelledby",this._parts.title.id),e.removeAttribute("aria-label")):(e.removeAttribute("aria-labelledby"),this.options.ariaLabel?e.setAttribute("aria-label",this.options.ariaLabel):e.removeAttribute("aria-label"))}_fill(e,t){e.textContent="";let n=t;if(je(n)&&(n=n.call(this,this)),null==n||!1===n||""===n)return!1;if(Be(n))return e.appendChild(n),!0;if("object"==typeof n&&"number"==typeof n.length&&Be(n[0]))return Array.from(n).forEach(t=>Be(t)&&e.appendChild(t)),!0;const s=String(n);return this.options.html?e.innerHTML=r.sanitise(s):e.textContent=s,!0}_duration(){return!this.options.animation||function(){try{return!!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches}catch{return!1}}()?0:Math.max(0,Number(this.options.animationDuration)||0)}_focusInside(){const e=this._panel;if(!e)return;(Ne(e).filter(e=>!e.closest(".dm-popover-close"))[0]||e).focus({preventScroll:!0})}_onPanelKeyDown(e){if(!this._open)return;if("Escape"===e.key||"Esc"===e.key){if(e.defaultPrevented||!this.options.closeOnEscape)return;return e.preventDefault(),e.stopPropagation(),void this.hide({returnFocus:!0})}if("Tab"!==e.key)return;const t=Ne(this._panel),n=t[0],s=t[t.length-1],o=document.activeElement;if(this.options.trapFocus)return t.length?void(!e.shiftKey||o!==n&&o!==this._panel?e.shiftKey||o!==s||(e.preventDefault(),n.focus()):(e.preventDefault(),s.focus())):void e.preventDefault();if(e.shiftKey&&(!t.length||o===n||o===this._panel))return e.preventDefault(),void this.element.focus();if(!(e.shiftKey||t.length&&o!==s)){const t=this._nextTabbableAfterTrigger();e.preventDefault(),this.hide({returnFocus:!t}),t&&(t.focus(),document.activeElement!==t&&this.element.focus({preventScroll:!0}))}}_nextTabbableAfterTrigger(){const e=this.element,t=e.closest(".dm-popover");return Ne(t||document.body).filter(n=>n.closest(".dm-popover")===t&&!e.contains(n)).find(t=>e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING)||null}_bindOpen(){const e=this._openHandlers,t=()=>{if(this._frame)return;const e="function"==typeof requestAnimationFrame;this._frameIsTimeout=!e;const t=e?requestAnimationFrame:e=>setTimeout(e,16);this._frame=t(()=>{this._frame=null,this.update()})},n=()=>t();window.addEventListener("scroll",n,{capture:!0,passive:!0}),e.push({el:window,event:"scroll",handler:n,capture:!0}),window.addEventListener("resize",t),e.push({el:window,event:"resize",handler:t}),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(t),this._resizeObserver.observe(this._panel),this._resizeObserver.observe(this.element))}_unbindOpen(){for(const{el:e,event:t,handler:n,capture:s}of this._openHandlers)e.removeEventListener(t,n,s?{capture:!0}:void 0);this._openHandlers=[],this._resizeObserver?.disconnect(),this._resizeObserver=null,this._frame&&(this._frameIsTimeout?clearTimeout(this._frame):"function"==typeof cancelAnimationFrame&&cancelAnimationFrame(this._frame),this._frame=null)}_contains(e){return!(!e||!Be(e))&&(!(!this.element||!this.element.contains(e))||(!(!this._panel||!this._panel.contains(e))||De.some(t=>t!==this&&t._parent===this&&t._contains(e))))}_isAncestorOf(e){let t=e._parent;for(;t;){if(t===this)return!0;t=t._parent}return!1}_position(){const e=this._panel,t=this.options,n=this.element.getBoundingClientRect(),{width:s,height:o}=function(){const e=document.documentElement;return{width:e.clientWidth||window.innerWidth||0,height:e.clientHeight||window.innerHeight||0}}(),i=n.bottom<0||n.top>o||n.right<0||n.left>s;e.classList.toggle("is-detached",i),e.style.left="0px",e.style.top="0px";const r=e.offsetWidth,a=e.offsetHeight,[l,d]=function(e){if(Array.isArray(e))return[Number(e[0])||0,Number(e[1])||0];const t=Number(e);return[0,Number.isFinite(t)?t:10]}(t.offset);let[c,h]=function(e){const[t,n]=String(e||"bottom").split("-");return["auto"===t||Ee.includes(t)?t:"bottom","start"===n||"end"===n?n:"center"]}(t.placement);const u={top:n.top-8,bottom:o-n.bottom-8,left:n.left-8,right:s-n.right-8},p=e=>u[e]>=(e=>("top"===e||"bottom"===e?a:r)+d)(e);if("auto"===c)c=$e.find(p)||$e.reduce((e,t)=>u[t]>u[e]?t:e);else if(t.flip&&!p(c)){const e=[Ae[c],...Se[c]].find(p);e?c=e:u[Ae[c]]>u[c]&&(c=Ae[c])}let m,f;const g="top"===c||"bottom"===c;g?(f="top"===c?n.top-d-a:n.bottom+d,m="start"===h?n.left+l:"end"===h?n.right-r-l:n.left+n.width/2-r/2+l):(m="left"===c?n.left-d-r:n.right+d,f="start"===h?n.top+l:"end"===h?n.bottom-a-l:n.top+n.height/2-a/2+l);const v=(e,t,n)=>t+16>n?8:Math.min(Math.max(e,8),n-t-8);m=v(m,r,s),f=v(f,a,o),e.style.left=`${Math.round(m)}px`,e.style.top=`${Math.round(f)}px`,e.dataset.side=c,e.dataset.placement="center"===h?c:`${c}-${h}`;const b=this._parts.arrow;if(t.arrow)if(g){const t=n.left+n.width/2-m-(e.clientLeft||0);b.style.left=`${Math.round(Math.min(Math.max(t,12),r-12))}px`,b.style.top=""}else{const t=n.top+n.height/2-f-(e.clientTop||0);b.style.top=`${Math.round(Math.min(Math.max(t,12),a-12))}px`,b.style.left=""}}_emit(e,t=!1){const n=this.options[`on${e[0].toUpperCase()}${e.slice(1)}`];let s=!0;if(je(n)&&!1===n.call(this,this)&&t&&(s=!1),!this.element)return s;const o=new CustomEvent(`popover:${e}`,{detail:{popover:this},bubbles:!0,cancelable:t}),i=this.element.dispatchEvent(o);return s&&(i||!t)}static scan(e=document,t=null){const n="string"==typeof e?document.querySelector(e):Ie(e)||e;if(!n||!je(n.querySelectorAll))return[];const s=[],o="[data-popover], [data-popover-content]",i=Array.from(n.querySelectorAll(o));je(n.matches)&&n.matches(o)&&i.unshift(n);for(const e of i){if(We.has(e))continue;const n=Ke.optionsFromAttributes(e);s.push(t?t(e,n):new Ke(e,n))}return s}static optionsFromAttributes(e){const t=e.dataset||{},n={},s=e=>void 0!==e&&"false"!==e&&"0"!==e;if(t.popover&&(n.content=t.popover),t.popoverContent){const e=document.querySelector(t.popoverContent);e&&(n.content=()=>{if("TEMPLATE"===e.tagName)return e.content.cloneNode(!0);const t=e.cloneNode(!0);return t.removeAttribute("id"),t.removeAttribute("hidden"),t})}return t.popoverTitle&&(n.title=t.popoverTitle),t.popoverTrigger&&(n.trigger=t.popoverTrigger),t.popoverPlacement&&(n.placement=t.popoverPlacement),void 0!==t.popoverGroup&&(n.group=""===t.popoverGroup||"none"===t.popoverGroup?null:t.popoverGroup),void 0!==t.popoverDismissible&&(n.dismissible=s(t.popoverDismissible)),void 0!==t.popoverArrow&&(n.arrow=s(t.popoverArrow)),t.popoverWidth&&(n.width=t.popoverWidth),t.popoverMaxWidth&&(n.maxWidth=t.popoverMaxWidth),t.popoverClass&&(n.className=t.popoverClass),n}static closeAll(e){for(const t of De.slice().reverse())void 0!==e&&t.options.group!==e||t.hide({returnFocus:!1})}static getInstance(e){const t=Ie(e);return t&&We.get(t)||null}static openPopovers(){return De.slice()}}const Ye=["xs","sm","md","lg","xl"],Ge=["circle","rounded","square"],Xe=["online","away","busy","offline"],Je={none:0,sm:.15,md:.25,lg:.4},Ze=/^[a-z0-9-]+$/i,Qe={name:null,src:null,alt:null,size:"md",shape:"circle",status:null,statusLabels:null,icon:null,title:null,ring:!1,tone:null,decorative:!1},et={online:"online",away:"away",busy:"busy",offline:"offline"},tt=new WeakMap,nt=new WeakMap;function st(e){return!!e&&"object"==typeof e&&1===e.nodeType}function ot(e){return e?"string"==typeof e?document.querySelector(e):st(e)?e:"function"==typeof e.get&&st(e.get(0))?e.get(0):"number"==typeof e.length&&st(e[0])?e[0]:null:null}function it(e){const t=e.match(/^\P{M}\p{M}*/u);return t?t[0]:""}function rt(e){if(null==e)return"";let t=String(e).trim();if(!t)return"";const n=t.indexOf("@");n>0&&!/\s/.test(t)&&(t=t.slice(0,n)),t=t.replace(/\([^)]*\)|\[[^\]]*\]/g," ");const s=t.split(/[\s._+\-]+/u).map(e=>e.replace(/^[^\p{L}\p{N}]+/u,"")).filter(Boolean);if(!s.length)return"";return(it(s[0])+(s.length>1?it(s[s.length-1]):"")).toUpperCase()}function at(e){const t=String(e??"").trim().toLowerCase().replace(/\s+/g," ");let n=2166136261;for(const e of t)n^=e.codePointAt(0),n=Math.imul(n,16777619);return(n>>>0)%8}function lt(e,t,n){return e.includes(t)?t:n}function dt(e,t){if(t&&!e.icon){const e=document.createElement("span");return e.className="avatar-initials",e.setAttribute("aria-hidden","true"),e.textContent=t,e}const n=document.createElement("span");return n.className="avatar-icon",n.setAttribute("aria-hidden","true"),n.setAttribute("data-icon",e.icon&&Ze.test(e.icon)?e.icon:"user"),n}function ct(e){e.querySelector(".avatar-icon[data-icon]")&&("undefined"!=typeof window&&(window.Domma?.icons||window.I)||null)?.scan?.(e)}function ht(e,t,n=null){const s=lt(Ye,t.size,"md"),o=lt(Ge,t.shape,"circle"),i=rt(t.name||(t.alt&&!t.src?t.alt:"")),r=function(e){const t=parseInt(e.tone,10);if(Number.isFinite(t))return(t%8+8)%8;const n=e.name||e.alt||e.src;return n?at(n):null}(t);if(e.classList.remove(...function(e){return Array.from(e.classList).filter(e=>"avatar"===e||/^avatar-(xs|sm|md|lg|xl|rounded|square|ring|tone-\d+)$/.test(e))}(e)),e.classList.add("avatar",`avatar-${s}`),"circle"!==o&&e.classList.add(`avatar-${o}`),null!=r&&e.classList.add(`avatar-tone-${r}`),t.ring&&e.classList.add("avatar-ring"),e.textContent="",t.src){const n=document.createElement("img");n.className="avatar-img",n.alt="",n.decoding="async",n.addEventListener("error",()=>{n.parentNode===e&&(e.replaceChild(dt(t,i),n),e.classList.add("avatar-img-failed"),ct(e))},{once:!0}),n.src=String(t.src),e.appendChild(n)}else e.appendChild(dt(t,i));e.classList.remove("avatar-img-failed");const a=lt(Xe,t.status,null);if(a){const t=document.createElement("span");t.className=`avatar-status avatar-status-${a}`,t.setAttribute("aria-hidden","true"),e.appendChild(t)}const l=function(e){const t=String(e.alt??e.name??"").trim(),n=lt(Xe,e.status,null);if(!n)return t;const s=e.statusLabels&&e.statusLabels[n]||et[n];return t?`${t} (${s})`:s}(t),d=/^(A|BUTTON)$/.test(e.tagName);e.removeAttribute("role"),e.removeAttribute("aria-label"),e.removeAttribute("aria-hidden"),t.decorative&&!d?e.setAttribute("aria-hidden","true"):l?(d||e.setAttribute("role","img"),e.setAttribute("aria-label",l)):d||e.setAttribute("aria-hidden","true");const c=!0===t.title?l:t.title;return c?e.setAttribute("title",String(c)):null!=n?e.setAttribute("title",n):e.removeAttribute("title"),ct(e),{initials:i,tone:r,label:l,size:s,shape:o}}function ut(e){const t=e.dataset||{},n={},s=e.classList,o=Ye.find(e=>s.contains(`avatar-${e}`));o&&(n.size=o),s.contains("avatar-rounded")&&(n.shape="rounded"),s.contains("avatar-square")&&(n.shape="square"),s.contains("avatar-ring")&&(n.ring=!0);const i=Array.from(s).find(e=>/^avatar-tone-\d+$/.test(e));i&&(n.tone=Number(i.slice(12))),t.avatar&&(n.name=t.avatar);const r=["src","alt","size","shape","status","icon","title","tone"];for(const e of r){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&""!==s&&(n[e]=s)}for(const e of["ring","decorative"]){const s=t[`avatar${e[0].toUpperCase()}${e.slice(1)}`];null!=s&&(n[e]="false"!==s)}return n}const pt=["role","aria-label","aria-hidden","title"];function mt(e,t={}){let n;if(e&&"object"==typeof e&&!st(e)&&"number"!=typeof e.length&&"function"!=typeof e.get&&(t=e,e=null),null==e)n=document.createElement("span");else if(n=ot(e),!n)return null;const s=tt.get(n);s&&s.destroy();const o={children:document.createDocumentFragment(),classes:new Set(n.classList),attrs:Object.fromEntries(pt.map(e=>[e,n.getAttribute(e)]))};for(;n.firstChild;)o.children.appendChild(n.firstChild);let i={...Qe,...ut(n),...t},r=ht(n,i,o.attrs.title);const a={element:n,get options(){return i},get initials(){return r.initials},get tone(){return r.tone},get label(){return r.label},update:(e={})=>(i={...i,...e},r=ht(n,i,o.attrs.title),a),destroy(){if(tt.get(n)!==a)return n;tt.delete(n),n.textContent="",n.appendChild(o.children),n.className=[...o.classes].join(" "),n.className||n.removeAttribute("class");for(const[e,t]of Object.entries(o.attrs))null==t?n.removeAttribute(e):n.setAttribute(e,t);return n.hasAttribute("data-avatar")&&n.setAttribute("data-avatar-done",""),n}};return tt.set(n,a),a}mt.initials=rt,mt.tone=at,mt.get=function(e){const t=ot(e);return t&&tt.get(t)||null},mt.scan=function(e=document){const t=ot(e)||document;if("function"!=typeof t.querySelectorAll)return[];const n=Array.from(t.querySelectorAll("[data-avatar]"));return"function"==typeof t.matches&&t.matches("[data-avatar]")&&n.unshift(t),n.filter(e=>!tt.has(e)&&!e.hasAttribute("data-avatar-done")).map(e=>mt(e))};const ft={people:[],max:null,size:"md",shape:"circle",overlap:null,label:null,statusLabels:null,onMore:null,popover:!0,moreLabel:null};function gt(e){return null==e?null:"string"==typeof e?{name:e}:"object"==typeof e?e:null}function vt(e,t,n={}){const s=e.href&&(e.name||e.alt)?e.href:null,o=document.createElement(s?"a":"span");s&&o.setAttribute("href",String(s));return mt(o,{name:e.name,src:e.src,alt:e.alt,status:e.status,icon:e.icon,tone:e.tone,title:e.title??!0,size:t.size,shape:t.shape,statusLabels:t.statusLabels,...n}).element}function bt(e,t={}){const n=ot(e);if(!n)return null;const s=nt.get(n);s&&s.destroy();const o=/^(UL|OL)$/.test(n.tagName),i=document.createDocumentFragment(),r=new Set(n.classList),a=n.getAttribute("aria-label"),l=n.style.getPropertyValue("--dm-avatar-overlap");for(;n.firstChild;)i.appendChild(n.firstChild);const d=o?n:document.createElement("ul");o||n.appendChild(d);let c={...ft,...t};const h={people:[],shown:[],hidden:[],more:null,popover:null},u=()=>{h.popover&&h.popover.destroy(),h.popover=null,h.more=null},p=()=>{const e=document.activeElement,t=!!e&&(h.more&&h.more===e||h.popover&&h.popover.panel&&h.popover.panel.contains(e));u();const n=(Array.isArray(c.people)?c.people:[]).map(gt).filter(Boolean),s=lt(Ye,c.size,"md"),i=parseInt(c.max,10),r=Number.isFinite(i)&&i>=0&&i<n.length?i:n.length;h.people=n,h.shown=n.slice(0,r),h.hidden=n.slice(r),d.textContent="";for(const e of Array.from(d.classList))/^avatar-group-(xs|sm|md|lg|xl)$/.test(e)&&d.classList.remove(e);d.classList.add("avatar-group",`avatar-group-${s}`),c.label?d.setAttribute("aria-label",String(c.label)):o&&null!=a?d.setAttribute("aria-label",a):d.removeAttribute("aria-label");const l=null==(p=c.overlap)||""===p?null:"number"==typeof p&&Number.isFinite(p)?`${p}px`:Object.prototype.hasOwnProperty.call(Je,p)?`calc(var(--dm-avatar-size, 2.5rem) * ${Je[p]})`:String(p);var p;null!=l?d.style.setProperty("--dm-avatar-overlap",l):d.style.removeProperty("--dm-avatar-overlap");let m=h.shown.length+1;for(const e of h.shown){const t=document.createElement("li");t.className="avatar-group-item",t.style.setProperty("--dm-avatar-z",String(m--)),t.appendChild(vt(e,{...c,size:s})),d.appendChild(t)}if(h.hidden.length){const e=h.hidden.length,t=h.hidden.map(e=>e.name||e.alt||"").filter(Boolean),n=document.createElement("li");n.className="avatar-group-item",n.style.setProperty("--dm-avatar-z",String(m));const o=document.createElement("button");o.type="button",o.className=`avatar avatar-more avatar-${s}`,"rounded"!==c.shape&&"square"!==c.shape||o.classList.add(`avatar-${c.shape}`),o.textContent=`+${e}`;const i="function"==typeof c.moreLabel?c.moreLabel(e,t):`${e} more${t.length?`: ${function(e){return e.length<=1?e.join(""):`${e.slice(0,-1).join(", ")} and ${e[e.length-1]}`}(t)}`:""}`;o.setAttribute("aria-label",String(i)),n.appendChild(o),d.appendChild(n),h.more=o;const r=h.hidden;"function"==typeof c.onMore?o.addEventListener("click",e=>c.onMore(r.slice(),e)):!1!==c.popover?h.popover=new Ke(o,{title:`${e} more`,content:()=>function(e,t){const n=document.createElement("ul");n.className="avatar-more-list";for(const s of e){const e=document.createElement("li"),o=document.createElement(s.href?"a":"span");o.className="avatar-more-person",s.href&&o.setAttribute("href",String(s.href));const i=document.createElement("span");mt(i,{name:s.name,alt:s.alt,src:s.src,icon:s.icon,tone:s.tone,size:"xs",shape:t.shape,decorative:!0});const r=document.createElement("span");r.className="avatar-more-name",r.textContent=s.name||s.alt||"",o.append(i,r),e.appendChild(o),n.appendChild(e)}return n}(r,c),placement:"bottom",className:"avatar-more-popover",maxWidth:"18rem"}):t.length&&(o.title=t.join(", "))}t&&(h.more?h.more.focus():(d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus()))};p();const m={element:d,get options(){return c},get people(){return h.people},get shown(){return h.shown},get hidden(){return h.hidden},get more(){return h.more},get popover(){return h.popover},update:(e={})=>(c={...c,...e},p(),m),setPeople:e=>m.update({people:e}),destroy:()=>(nt.get(n)!==m||(nt.delete(n),u(),o?(d.textContent="",d.className=[...r].join(" "),d.className||d.removeAttribute("class"),null==a?d.removeAttribute("aria-label"):d.setAttribute("aria-label",a),l?d.style.setProperty("--dm-avatar-overlap",l):d.style.removeProperty("--dm-avatar-overlap")):n.textContent="",n.appendChild(i)),n)};return nt.set(n,m),m}bt.get=function(e){const t=ot(e);return t&&nt.get(t)||null};class yt extends HTMLElement{static defaults={};static get observedAttributes(){return[]}constructor(){super(),this._eventHandlers=[],this._options={},this._initialised=!1,this.attachShadow({mode:"open"})}connectedCallback(){this._initialised||(this._options={...this._mergeOptions(),...this._options},this._onBeforeMount?.(),this._injectStyles(),this._render(),this._bindEvents(),this._initialised=!0),this._onConnect?.()}disconnectedCallback(){this._onBeforeUnmount?.(),this._cleanup(),this._onDisconnect?.()}attributeChangedCallback(e,t,n){t!==n&&this._initialised&&(this._options[this._attrToOption(e)]=this._parseAttrValue(n),this._onAttributeChange?.(e,t,n))}_onBeforeMount(){}_onUpdated(){}_onBeforeUnmount(){}_mergeOptions(){const e={...this.constructor.defaults};for(const t of this.attributes){e[this._attrToOption(t.name)]=this._parseAttrValue(t.value)}return e}_attrToOption(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_parseAttrValue(e){if(""===e||"true"===e)return!0;if("false"===e)return!1;if(!isNaN(e)&&""!==e)return Number(e);try{return JSON.parse(e)}catch{return e}}_injectStyles(){const e=document.createElement("style");e.textContent=this._getStyles(),this.shadowRoot.appendChild(e)}_getStyles(){return this.constructor.styles||""}_render(){}_bindEvents(){}_addEventListener(e,t,n,s){e.addEventListener(t,n,s),this._eventHandlers.push({element:e,event:t,handler:n,options:s})}_cleanup(){for(const{element:e,event:t,handler:n,options:s}of this._eventHandlers)e.removeEventListener(t,n,s);this._eventHandlers=[]}_emit(e,t={}){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}setOptions(e){return this._options={...this._options,...e},"function"==typeof this._applyOptions&&this._applyOptions(),this}destroy(){this._cleanup(),this.remove()}}const _t="\n * {\n box-sizing: border-box;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n";class kt extends yt{static defaults={variant:"primary",size:"medium",pill:!1,outline:!1,removable:!1};static get observedAttributes(){return["variant","size","pill","outline","removable"]}static variants={primary:{bg:"var(--dm-primary, #4f46e5)",color:"#fff"},secondary:{bg:"var(--dm-secondary, #6b7280)",color:"#fff"},success:{bg:"var(--dm-success, #10b981)",color:"#fff"},danger:{bg:"var(--dm-danger, #ef4444)",color:"#fff"},warning:{bg:"var(--dm-warning, #f59e0b)",color:"#000"},info:{bg:"var(--dm-info, #3b82f6)",color:"#fff"},light:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},dark:{bg:"var(--dm-surface-overlay, #1f2937)",color:"var(--dm-white, #fff)"}};static sizes={small:{padding:"2px 6px",fontSize:"10px"},medium:{padding:"4px 10px",fontSize:"12px"},large:{padding:"6px 14px",fontSize:"14px"}};_getStyles(){return`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n ${_t}\n \n button {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n margin: 0;\n border: none;\n background: transparent;\n color: inherit;\n font: inherit;\n cursor: pointer;\n transition: opacity var(--dm-transition-fast);\n }\n\n button:hover {\n opacity: 0.8;\n }\n\n button:focus {\n outline: 2px solid var(--dm-primary);\n outline-offset: 2px;\n }\n\n button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n\n :host {\n display: inline-flex;\n }\n\n .badge {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n font-weight: 500;\n line-height: 1;\n transition: all 150ms ease;\n }\n\n .badge-clickable {\n cursor: pointer;\n }\n\n .remove-btn {\n margin-left: 2px;\n width: 14px;\n height: 14px;\n font-size: 16px;\n line-height: 1;\n opacity: 0.7;\n }\n\n .remove-btn:hover {\n opacity: 1;\n }\n `}_render(){const{variant:e,size:t,pill:n,outline:s,removable:o}=this._options,i=kt.variants[e]||kt.variants.primary,r=kt.sizes[t]||kt.sizes.medium,a=document.createElement("span");a.className="badge",a.setAttribute("part","badge");const l=n?"9999px":"4px",d=s?"transparent":i.bg,c=s?i.bg:i.color,h=s?`1px solid ${i.bg}`:"none";a.style.cssText=`\n background: ${d};\n color: ${c};\n border: ${h};\n border-radius: ${l};\n padding: ${r.padding};\n font-size: ${r.fontSize};\n `;const u=document.createElement("slot");if(a.appendChild(u),o){const e=document.createElement("button");e.className="remove-btn",e.setAttribute("part","remove-btn"),e.setAttribute("aria-label","Remove"),e.textContent="×",this._addEventListener(e,"click",e=>{e.stopPropagation(),this._emit("remove",{badge:this}),this.remove()}),a.appendChild(e)}this._badge=a,this.shadowRoot.appendChild(a)}_bindEvents(){this._addEventListener(this._badge,"click",e=>{e.target.classList.contains("remove-btn")||this._emit("click",{badge:this,event:e})})}_onAttributeChange(e,t,n){this.shadowRoot.textContent="",this._injectStyles(),this._render(),this._bindEvents()}_applyOptions(){this.shadowRoot.textContent="",this._injectStyles(),this._render(),this._bindEvents()}setVariant(e){return this.setAttribute("variant",e),this}setSize(e){return this.setAttribute("size",e),this}setText(e){return this.textContent=e,this}}customElements.get("domma-badge")||customElements.define("domma-badge",kt);class wt extends yt{static defaults={count:0,variant:"danger",dot:!1,pulse:!1,borderColor:null};static get observedAttributes(){return["count","variant","dot","pulse","border-color"]}static variants={primary:{bg:"var(--dm-primary, #4f46e5)",color:"#fff"},secondary:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},success:{bg:"var(--dm-success, #10b981)",color:"#fff"},danger:{bg:"var(--dm-danger, #ef4444)",color:"#fff"},warning:{bg:"var(--dm-warning, #f59e0b)",color:"#000"},info:{bg:"var(--dm-info, #3b82f6)",color:"#fff"},light:{bg:"var(--dm-background-alt, #f3f4f6)",color:"var(--dm-text, #111)"},dark:{bg:"var(--dm-surface-overlay, #1f2937)",color:"#fff"}};_getStyles(){return`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n ${_t}\n\n :host {\n position: relative;\n display: inline-flex;\n }\n\n .counter {\n position: absolute;\n top: -6px;\n right: -8px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-width: 1.25rem;\n height: 1.25rem;\n padding: 0 0.3em;\n font-size: 0.65rem;\n font-weight: 700;\n font-variant-numeric: tabular-nums;\n line-height: 1;\n border-radius: 9999px;\n border: 2px solid var(--dm-background, #fff);\n z-index: 1;\n transition: transform 150ms ease;\n }\n\n .counter.dot {\n top: -2px;\n right: -2px;\n min-width: 0.5rem;\n height: 0.5rem;\n padding: 0;\n }\n\n .counter.hidden {\n display: none;\n }\n\n @keyframes badge-pulse {\n 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }\n 50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }\n }\n\n .counter.pulse {\n animation: badge-pulse 2s ease-in-out infinite;\n }\n `}_render(){const{count:e,variant:t,dot:n,pulse:s,borderColor:o}=this._options,i=wt.variants[t]||wt.variants.danger,r=document.createElement("slot"),a=document.createElement("span");a.className="counter",a.setAttribute("part","counter"),a.setAttribute("aria-live","polite"),a.setAttribute("role","status"),a.style.backgroundColor=i.bg,a.style.color=i.color,o&&(a.style.borderColor=o),n?(a.classList.add("dot"),a.textContent=""):a.textContent=String(e),s&&a.classList.add("pulse"),n||0!==Number(e)||a.classList.add("hidden"),this._counter=a,this.shadowRoot.appendChild(r),this.shadowRoot.appendChild(a)}_onAttributeChange(e,t,n){this.shadowRoot.textContent="",this._injectStyles(),this._render()}_applyOptions(){this.shadowRoot.textContent="",this._injectStyles(),this._render()}setCount(e){return this._options.count=Number(e),this.setAttribute("count",String(e)),this}increment(e=1){const t=(Number(this._options.count)||0)+e;return this.setCount(t),this}decrement(e=1){const t=Math.max(0,(Number(this._options.count)||0)-e);return this.setCount(t),this}setDot(e){return this._options.dot=e,e?this.setAttribute("dot",""):this.removeAttribute("dot"),this}setVariant(e){return this.setAttribute("variant",e),this}setPulse(e){return this._options.pulse=e,e?this.setAttribute("pulse",""):this.removeAttribute("pulse"),this}getCount(){return Number(this._options.count)||0}}customElements.get("domma-number-badge")||customElements.define("domma-number-badge",wt);class xt extends yt{static defaults={content:"",position:"top",trigger:"hover",delay:0,hideDelay:0,animation:!0,offset:8,html:!1,visible:!1};static get observedAttributes(){return["content","position","trigger","delay","hide-delay","animation","offset","html","visible"]}constructor(){super(),this._tooltip=null,this._isVisible=!1,this._showTimeout=null,this._hideTimeout=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: contents;\n }\n\n .tooltip-wrapper {\n position: relative;\n display: inline-block;\n }\n\n .tooltip {\n position: fixed;\n z-index: 1000;\n padding: 0.5rem 0.75rem;\n background: var(--dm-text, #212529);\n color: var(--dm-surface, #fff);\n border-radius: 4px;\n font-size: 0.875rem;\n line-height: 1.4;\n max-width: 250px;\n pointer-events: none;\n opacity: 0;\n transition: opacity 0.15s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n }\n\n .tooltip.show {\n opacity: 1;\n }\n\n /* Arrow */\n .tooltip::before {\n content: \'\';\n position: absolute;\n width: 0;\n height: 0;\n border: 5px solid transparent;\n }\n\n .tooltip[data-position="top"]::before {\n bottom: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="bottom"]::before {\n top: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="left"]::before {\n right: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--dm-text, #212529);\n }\n\n .tooltip[data-position="right"]::before {\n left: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--dm-text, #212529);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const e=document.createElement("div");e.className="tooltip-wrapper",e.setAttribute("part","wrapper");const t=document.createElement("slot");e.appendChild(t),this.shadowRoot.appendChild(e),this._wrapper=e}_bindEvents(){const{trigger:e}=this._options;"hover"===e?(this._addEventListener(this._wrapper,"mouseenter",()=>this.show()),this._addEventListener(this._wrapper,"mouseleave",()=>this.hide())):"click"===e?this._addEventListener(this._wrapper,"click",()=>this.toggle()):"focus"===e&&(this._addEventListener(this._wrapper,"focusin",()=>this.show()),this._addEventListener(this._wrapper,"focusout",()=>this.hide()))}_onAttributeChange(e,t,n){switch(e){case"content":this._tooltip&&this._isVisible&&this._updateTooltipContent();break;case"position":this._tooltip&&this._isVisible&&this._positionTooltip();break;case"trigger":this._cleanup(),this._bindEvents();break;case"visible":""===n||"true"===n?this.show():this.hide()}}_onConnect(){this._options.visible&&this.show()}_onDisconnect(){clearTimeout(this._showTimeout),clearTimeout(this._hideTimeout),this._tooltip&&(this._tooltip.remove(),this._tooltip=null)}show(){if(clearTimeout(this._hideTimeout),this._isVisible)return this;const{delay:e}=this._options;return this._showTimeout=setTimeout(()=>{this._createTooltip(),this._positionTooltip(),this._emit("show")},e),this}hide(){if(clearTimeout(this._showTimeout),!this._isVisible)return this;const{hideDelay:e}=this._options;return this._hideTimeout=setTimeout(()=>{this._tooltip&&(this._tooltip.classList.remove("show"),this._tooltip.style.opacity="0",setTimeout(()=>{this._tooltip&&(this._tooltip.remove(),this._tooltip=null),this._isVisible=!1,this._emit("hide")},150))},e),this}toggle(){return this._isVisible?this.hide():this.show()}isVisible(){return this._isVisible}setContent(e){return this.setAttribute("content",e),this}setPosition(e){return this.setAttribute("position",e),this}_createTooltip(){const{content:e,position:t,html:n}=this._options;if(this._tooltip=document.createElement("div"),this._tooltip.className="domma-tooltip",this._tooltip.setAttribute("data-position",t),this._applyTooltipStyles(),n){const t="undefined"!=typeof DOMPurify?DOMPurify.sanitize(e):e;this._tooltip.innerHTML=t}else this._tooltip.textContent=e;document.body.appendChild(this._tooltip),this._tooltip.offsetHeight,this._tooltip.classList.add("show"),this._tooltip.style.opacity="1",this._isVisible=!0}_applyTooltipStyles(){Object.assign(this._tooltip.style,{position:"fixed",zIndex:"1000",padding:"0.5rem 0.75rem",background:"var(--dm-text, #212529)",color:"var(--dm-surface, #fff)",borderRadius:"4px",fontSize:"0.875rem",lineHeight:"1.4",maxWidth:"250px",pointerEvents:"none",transition:"opacity 0.15s ease",boxShadow:"0 2px 8px rgba(0,0,0,0.15)"}),this._tooltip.style.opacity="0",this._injectGlobalTooltipStyles()}_injectGlobalTooltipStyles(){if(document.getElementById("domma-tooltip-styles"))return;const e=document.createElement("style");e.id="domma-tooltip-styles",e.textContent='\n .domma-tooltip.show {\n opacity: 1 !important;\n }\n\n /* Arrow */\n .domma-tooltip::before {\n content: \'\';\n position: absolute;\n width: 0;\n height: 0;\n border: 5px solid transparent;\n }\n\n .domma-tooltip[data-position="top"]::before {\n bottom: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="bottom"]::before {\n top: -10px;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="left"]::before {\n right: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--dm-text, #212529);\n }\n\n .domma-tooltip[data-position="right"]::before {\n left: -10px;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--dm-text, #212529);\n }\n ',document.head.appendChild(e)}_updateTooltipContent(){const{content:e,html:t}=this._options;if(t){const t="undefined"!=typeof DOMPurify?DOMPurify.sanitize(e):e;this._tooltip.innerHTML=t}else this._tooltip.textContent=e;this._positionTooltip()}_positionTooltip(){if(!this._tooltip||!this._wrapper)return;const{position:e,offset:t}=this._options,n=this._wrapper.getBoundingClientRect(),s=this._tooltip.getBoundingClientRect();let o,i;switch(e){case"top":default:o=n.top-s.height-t,i=n.left+(n.width-s.width)/2;break;case"bottom":o=n.bottom+t,i=n.left+(n.width-s.width)/2;break;case"left":o=n.top+(n.height-s.height)/2,i=n.left-s.width-t;break;case"right":o=n.top+(n.height-s.height)/2,i=n.right+t}const r=window.innerWidth,a=window.innerHeight;i<0&&(i=8),i+s.width>r&&(i=r-s.width-8),o<0&&(o=8),o+s.height>a&&(o=a-s.height-8),this._tooltip.style.top=o+"px",this._tooltip.style.left=i+"px"}}customElements.get("domma-tooltip")||customElements.define("domma-tooltip",xt);class Mt extends yt{static defaults={type:"spinner",size:"medium",color:"primary",overlay:!1,text:"",centered:!0,visible:!0};static sizes={small:24,medium:40,large:64};static colors={primary:"var(--dm-primary, #6495ED)",secondary:"var(--dm-secondary, #6c757d)",success:"var(--dm-success, #28a745)",danger:"var(--dm-danger, #dc3545)",warning:"var(--dm-warning, #ffc107)",info:"var(--dm-info, #17a2b8)",white:"#ffffff",dark:"var(--dm-surface-overlay, #343a40)"};static get observedAttributes(){return["type","size","color","overlay","text","centered","visible"]}constructor(){super(),this._visible=!1}_getSize(){const{size:e}=this._options;return"number"==typeof e?e:isNaN(e)?Mt.sizes[e]||Mt.sizes.medium:parseInt(e,10)}_getColor(){const{color:e}=this._options;return Mt.colors[e]||e}_injectStyles(){const e=document.createElement("style");e.textContent="\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .loader-wrapper {\n display: inline-flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 0.75rem;\n }\n\n .loader-wrapper.hidden {\n display: none !important;\n }\n\n .loader-wrapper.overlay {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: 1000;\n }\n\n .loader-wrapper.centered {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n }\n\n .loader-text {\n color: var(--loader-text-color, var(--dm-text, #212529));\n font-size: var(--dm-text-sm, 0.875rem);\n }\n\n .loader-wrapper.overlay .loader-text {\n color: #ffffff;\n }\n\n /* Spinner */\n .loader-spinner {\n border-radius: 50%;\n animation: spin 0.8s linear infinite;\n }\n\n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n /* Dots */\n .loader-dots {\n display: flex;\n gap: var(--dot-gap);\n }\n\n .loader-dots span {\n border-radius: 50%;\n animation: bounce 1.4s ease-in-out infinite both;\n }\n\n .loader-dots span:nth-child(1) { animation-delay: 0s; }\n .loader-dots span:nth-child(2) { animation-delay: 0.16s; }\n .loader-dots span:nth-child(3) { animation-delay: 0.32s; }\n\n @keyframes bounce {\n 0%, 80%, 100% { transform: scale(0); }\n 40% { transform: scale(1); }\n }\n\n /* Pulse */\n .loader-pulse {\n border-radius: 50%;\n animation: pulse 1.2s ease-in-out infinite;\n }\n\n @keyframes pulse {\n 0% { transform: scale(0); opacity: 1; }\n 100% { transform: scale(1); opacity: 0; }\n }\n\n /* Bars */\n .loader-bars {\n display: flex;\n align-items: center;\n gap: var(--bar-gap);\n }\n\n .loader-bars span {\n border-radius: 2px;\n animation: bars 1s ease-in-out infinite;\n }\n\n .loader-bars span:nth-child(1) { animation-delay: 0s; }\n .loader-bars span:nth-child(2) { animation-delay: 0.1s; }\n .loader-bars span:nth-child(3) { animation-delay: 0.2s; }\n .loader-bars span:nth-child(4) { animation-delay: 0.3s; }\n\n @keyframes bars {\n 0%, 40%, 100% { transform: scaleY(0.4); }\n 20% { transform: scaleY(1); }\n }\n ",this.shadowRoot.appendChild(e)}_render(){const e=this._getSize(),t=this._getColor(),{type:n,overlay:s,text:o,centered:i,visible:r}=this._options;switch(this._wrapper=document.createElement("div"),this._wrapper.className="loader-wrapper",this._wrapper.setAttribute("part","wrapper"),this._wrapper.setAttribute("role","status"),this._wrapper.setAttribute("aria-live","polite"),s&&this._wrapper.classList.add("overlay"),i&&!s&&this._wrapper.classList.add("centered"),r||this._wrapper.classList.add("hidden"),this._loaderEl=document.createElement("div"),this._loaderEl.className=`loader-${n}`,this._loaderEl.setAttribute("part","loader"),n){case"dots":this._renderDots(e,t);break;case"pulse":this._renderPulse(e,t);break;case"bars":this._renderBars(e,t);break;default:this._renderSpinner(e,t)}this._wrapper.appendChild(this._loaderEl),o&&(this._textEl=document.createElement("span"),this._textEl.className="loader-text",this._textEl.setAttribute("part","text"),this._textEl.textContent=o,this._wrapper.appendChild(this._textEl)),this.shadowRoot.appendChild(this._wrapper),this._visible=r}_renderSpinner(e,t){const n=Math.max(2,e/10);this._loaderEl.style.cssText=`\n width: ${e}px;\n height: ${e}px;\n border: ${n}px solid ${t};\n border-top-color: transparent;\n `}_renderDots(e,t){const n=e/4,s=n/2;this._loaderEl.style.setProperty("--dot-gap",`${s}px`);for(let e=0;e<3;e++){const e=document.createElement("span");e.style.cssText=`\n width: ${n}px;\n height: ${n}px;\n background: ${t};\n `,this._loaderEl.appendChild(e)}}_renderPulse(e,t){this._loaderEl.style.cssText=`\n width: ${e}px;\n height: ${e}px;\n background: ${t};\n `}_renderBars(e,t){const n=e/6,s=e,o=n/2;this._loaderEl.style.cssText=`\n height: ${s}px;\n `,this._loaderEl.style.setProperty("--bar-gap",`${o}px`);for(let e=0;e<4;e++){const e=document.createElement("span");e.style.cssText=`\n width: ${n}px;\n height: 100%;\n background: ${t};\n `,this._loaderEl.appendChild(e)}}_onAttributeChange(e,t,n){if(this._wrapper)switch(e){case"type":case"size":case"color":this._loaderEl.remove(),this._textEl&&this._textEl.remove(),this._loaderEl=document.createElement("div"),this._loaderEl.className=`loader-${this._options.type}`,this._loaderEl.setAttribute("part","loader");const e=this._getSize(),t=this._getColor();switch(this._options.type){case"dots":this._renderDots(e,t);break;case"pulse":this._renderPulse(e,t);break;case"bars":this._renderBars(e,t);break;default:this._renderSpinner(e,t)}this._wrapper.insertBefore(this._loaderEl,this._wrapper.firstChild);break;case"text":n?(this._textEl||(this._textEl=document.createElement("span"),this._textEl.className="loader-text",this._textEl.setAttribute("part","text"),this._wrapper.appendChild(this._textEl)),this._textEl.textContent=n):this._textEl&&(this._textEl.remove(),this._textEl=null);break;case"overlay":this._wrapper.classList.toggle("overlay",""===n||"true"===n);break;case"centered":this._wrapper.classList.toggle("centered",""===n||"true"===n);break;case"visible":const s=""===n||"true"===n;this._visible=s,this._wrapper.classList.toggle("hidden",!s)}}show(){return this._visible=!0,this._wrapper.classList.remove("hidden"),this.setAttribute("visible",""),this._emit("show"),this}hide(){return this._visible=!1,this._wrapper.classList.add("hidden"),this.removeAttribute("visible"),this._emit("hide"),this}toggle(){return this._visible?this.hide():this.show()}isVisible(){return this._visible}setText(e){return this.setAttribute("text",e),this}setType(e){return this.setAttribute("type",e),this}setSize(e){return this.setAttribute("size",String(e)),this}setColor(e){return this.setAttribute("color",e),this}}customElements.get("domma-loader")||customElements.define("domma-loader",Mt);class Lt extends yt{static defaults={showAfter:null,duration:300,position:"bottom-right",offset:16,target:null,zIndex:1e3,visible:!1};static get observedAttributes(){return["show-after","duration","position","offset","target","z-index","visible"]}constructor(){super(),this._isVisible=!1,this._isScrolling=!1,this._scrollContainer=null,this._scrollHandler=null}_injectStyles(){const e=document.createElement("style");e.textContent="\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n position: fixed;\n z-index: var(--z-index, 1000);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n .back-to-top-button {\n padding: 0.5rem;\n background: var(--dm-surface, #fff);\n border: 1px solid var(--dm-border, #dee2e6);\n border-radius: 9999px;\n cursor: pointer;\n width: 40px;\n height: 40px;\n display: flex;\n align-items: center;\n justify-content: center;\n opacity: 0;\n visibility: hidden;\n transform: translateY(10px);\n transition: opacity 0.2s ease, transform 0.15s ease, visibility 0.2s, background 0.2s ease, box-shadow 0.15s ease;\n }\n\n .back-to-top-button.visible {\n opacity: 1;\n visibility: visible;\n transform: translateY(0);\n }\n\n .back-to-top-button:hover {\n background: var(--dm-hover-bg, rgba(0,0,0,0.04));\n transform: translateY(0) scale(1.1);\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n }\n\n svg {\n color: var(--dm-text, #212529);\n }\n ",this.shadowRoot.appendChild(e)}_render(){const{position:e,offset:t,zIndex:n}=this._options,s="bottom-left"===e;this.style.position="fixed",this.style.bottom=`${t}px`,this.style[s?"left":"right"]=`${t}px`,this.style.zIndex=n,this._button=document.createElement("button"),this._button.className="back-to-top-button",this._button.setAttribute("part","button"),this._button.setAttribute("title","Back to top"),this._button.setAttribute("aria-label","Scroll back to top");const o=document.createElementNS("http://www.w3.org/2000/svg","svg");o.setAttribute("width","20"),o.setAttribute("height","20"),o.setAttribute("viewBox","0 0 24 24"),o.setAttribute("fill","none"),o.setAttribute("stroke","currentColor"),o.setAttribute("stroke-width","2"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round");const i=document.createElementNS("http://www.w3.org/2000/svg","path");i.setAttribute("d","M18 15l-6-6-6 6"),o.appendChild(i),this._button.appendChild(o),this.shadowRoot.appendChild(this._button)}_bindEvents(){this._addEventListener(this._button,"click",e=>{e.preventDefault(),this.scroll()}),this._setupScrollMonitoring()}_setupScrollMonitoring(){if(this._scrollHandler){(this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler)}this._options.target?this._scrollContainer="string"==typeof this._options.target?document.querySelector(this._options.target):this._options.target:this._scrollContainer=null;const e=this._scrollContainer||window;this._scrollHandler=()=>this._checkVisibility(),e.addEventListener("scroll",this._scrollHandler,{passive:!0}),this._checkVisibility()}_checkVisibility(){const e=this._options.showAfter??(this._scrollContainer?this._scrollContainer.clientHeight:window.innerHeight),t=(this._scrollContainer?this._scrollContainer.scrollTop:window.scrollY)>e;t&&!this._isVisible?this.show():!t&&this._isVisible&&this.hide()}_onAttributeChange(e,t,n){switch(e){case"position":case"offset":case"z-index":const{position:e,offset:t,zIndex:s}=this._options,o="bottom-left"===e;this.style.bottom=`${t}px`,this.style.left=o?`${t}px`:"",this.style.right=o?"":`${t}px`,this.style.zIndex=s;break;case"target":case"show-after":this._setupScrollMonitoring();break;case"visible":""===n||"true"===n?this.show():this.hide()}}_onConnect(){this._setupScrollMonitoring()}_onDisconnect(){if(this._scrollHandler){(this._scrollContainer||window).removeEventListener("scroll",this._scrollHandler)}}scroll(){if(this._isScrolling)return this;this._isScrolling=!0;const e=this._scrollContainer?this._scrollContainer.scrollTop:window.scrollY,t=performance.now(),n=this._options.duration,s=o=>{const i=o-t,r=Math.min(i/n,1),a=(l=r)*(2-l);var l;this._scrollContainer?this._scrollContainer.scrollTop=e*(1-a):window.scrollTo(0,e*(1-a)),r<1?requestAnimationFrame(s):this._isScrolling=!1};return requestAnimationFrame(s),this}show(){return this._isVisible||(this._isVisible=!0,this._button.classList.add("visible"),this._emit("show")),this}hide(){return this._isVisible?(this._isVisible=!1,this._button.classList.remove("visible"),this._emit("hide"),this):this}toggle(){return this._isVisible?this.hide():this.show()}isVisible(){return this._isVisible}getButton(){return this._button}setShowAfter(e){return this.setAttribute("show-after",String(e)),this}setPosition(e){return this.setAttribute("position",e),this}setOffset(e){return this.setAttribute("offset",String(e)),this}}customElements.get("domma-back-to-top")||customElements.define("domma-back-to-top",Lt);class Ct extends yt{static defaults={message:"",title:"",type:"default",position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,html:!1,icon:"",actions:[],visible:!1};static get observedAttributes(){return["message","title","type","position","duration","pause-on-hover","show-progress","animation","animation-duration","closable","html","icon","visible"]}constructor(){super(),this._progressBar=null,this._timeout=null,this._isPaused=!1,this._remainingTime=0,this._startTime=null,this._isVisible=!1}_injectStyles(){const e=document.createElement("style");e.textContent=`\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n min-width: 300px;\n max-width: 500px;\n margin-bottom: 12px;\n opacity: 0;\n transform: translateX(100%);\n transition: opacity ${this._options.animationDuration}ms ease,\n transform ${this._options.animationDuration}ms ease;\n }\n\n :host([hidden]) { display: none; }\n :host(.show) { opacity: 1; transform: translateX(0); }\n :host(.hiding) { opacity: 0; transform: translateX(100%); }\n\n .toast {\n position: relative;\n display: flex;\n align-items: flex-start;\n padding: 16px;\n background: var(--toast-bg);\n color: var(--toast-color);\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n overflow: hidden;\n }\n\n :host([type="default"]) { --toast-bg: #1f2937; --toast-color: #fff; --toast-accent: #6b7280; }\n :host([type="success"]) { --toast-bg: #065f46; --toast-color: #fff; --toast-accent: #10b981; }\n :host([type="error"]) { --toast-bg: #991b1b; --toast-color: #fff; --toast-accent: #ef4444; }\n :host([type="warning"]) { --toast-bg: #92400e; --toast-color: #fff; --toast-accent: #f59e0b; }\n :host([type="info"]) { --toast-bg: #1e40af; --toast-color: #fff; --toast-accent: #3b82f6; }\n\n .toast-icon { flex-shrink: 0; margin-right: 12px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }\n .toast-icon svg { width: 20px; height: 20px; }\n .toast-content { flex: 1; min-width: 0; }\n .toast-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }\n .toast-message { font-size: 14px; line-height: 1.4; }\n .toast-actions { display: flex; gap: 8px; margin-top: 8px; }\n .toast-close { flex-shrink: 0; margin-left: 12px; padding: 0; background: none; border: none; color: currentColor; cursor: pointer; opacity: 0.7; transition: opacity 0.15s ease; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }\n .toast-close:hover { opacity: 1; }\n .toast-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }\n .toast-progress-bar { height: 100%; background: var(--toast-accent); transition: width linear; }\n `,this.shadowRoot.appendChild(e)}_render(){const{message:e,title:t,closable:n,icon:s,showProgress:o}=this._options,i=document.createElement("div");i.className="toast";const r="error"===this._options.type;if(i.setAttribute("role",r?"alert":"status"),i.setAttribute("aria-live",r?"assertive":"polite"),i.setAttribute("aria-atomic","true"),s){const e=document.createElement("div");e.className="toast-icon",e.innerHTML=s,i.appendChild(e)}const a=document.createElement("div");if(a.className="toast-content",t){const e=document.createElement("div");e.className="toast-title",e.textContent=t,a.appendChild(e)}const l=document.createElement("div");if(l.className="toast-message",this._options.html?l.innerHTML=e:l.textContent=e,a.appendChild(l),this._options.actions&&this._options.actions.length&&this._renderActions(a),i.appendChild(a),n){const e=document.createElement("button");e.className="toast-close",e.setAttribute("aria-label","Close"),e.innerHTML="×",this._addEventListener(e,"click",()=>this.close()),i.appendChild(e)}if(o&&this._options.duration>0){const e=document.createElement("div");e.className="toast-progress",this._progressBar=document.createElement("div"),this._progressBar.className="toast-progress-bar",this._progressBar.style.width="100%",e.appendChild(this._progressBar),i.appendChild(e)}this.shadowRoot.appendChild(i),this._toast=i}_renderActions(e){const t=document.createElement("div");t.className="toast-actions",this._options.actions.forEach((e,n)=>{const s=document.createElement("button");s.textContent=e.label,s.style.cssText=`padding: 6px 12px; border: none; border-radius: 4px; font-size: 12px; font-weight: 500; cursor: pointer; background: ${e.primary?"var(--toast-accent)":"rgba(255,255,255,0.2)"}; color: #fff;`,this._addEventListener(s,"click",()=>{this._emit("action",{action:e,index:n}),!1!==e.closeOnClick&&this.close()}),t.appendChild(s)}),e.appendChild(t)}_bindEvents(){this._options.pauseOnHover&&(this._addEventListener(this._toast,"mouseenter",()=>this._pause()),this._addEventListener(this._toast,"mouseleave",()=>this._resume()))}_onAttributeChange(e,t,n){if(this._toast)switch(e){case"message":case"title":case"icon":this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents();break;case"visible":""===n||"true"===n?this.show():this.close();break;case"duration":this._options.duration=parseInt(n,10),this._isVisible&&this._options.duration>0&&this._startTimer()}}_onConnect(){this._options.visible&&this.show()}_onDisconnect(){this._clearTimer()}show(){return this._isVisible||(this._isVisible=!0,this._remainingTime=this._options.duration,requestAnimationFrame(()=>{this.classList.add("show"),this.classList.remove("hiding")}),this._options.duration>0&&this._startTimer(),this._emit("show")),this}close(){return this._isVisible?(this._clearTimer(),this._isVisible=!1,this.classList.add("hiding"),this.classList.remove("show"),setTimeout(()=>{this._emit("close"),this.remove()},this._options.animationDuration),this):this}_startTimer(){this._clearTimer(),this._options.duration<=0||(this._startTime=Date.now(),this._timeout=setTimeout(()=>this.close(),this._remainingTime),this._progressBar&&(this._progressBar.style.transition=`width ${this._remainingTime}ms linear`,requestAnimationFrame(()=>this._progressBar.style.width="0%")))}_clearTimer(){this._timeout&&(clearTimeout(this._timeout),this._timeout=null)}_pause(){if(this._isPaused||!this._timeout)return;this._isPaused=!0,this._clearTimer();const e=Date.now()-this._startTime;if(this._remainingTime=Math.max(0,this._remainingTime-e),this._progressBar){this._progressBar.style.transition="none";const e=parseFloat(getComputedStyle(this._progressBar).width);this._progressBar.style.width=e+"px"}this._emit("pause")}_resume(){this._isPaused&&(this._isPaused=!1,this._startTimer(),this._emit("resume"))}setMessage(e){return this.setAttribute("message",e),this}setTitle(e){return this.setAttribute("title",e),this}setType(e){return this.setAttribute("type",e),this}setActions(e){this._options.actions=e;const t=this._toast.querySelector(".toast-content"),n=t.querySelector(".toast-actions");return n&&n.remove(),e&&e.length&&this._renderActions(t),this}isVisible(){return this._isVisible}}customElements.get("domma-toast")||customElements.define("domma-toast",Ct);class Et extends yt{static defaults={backdrop:!0,backdropClose:!0,keyboard:!0,animation:"fade",animationDuration:300,closeButton:!0,size:"medium",centered:!0,scrollable:!1,title:"",content:"",footer:"",buttons:[],className:"",headerClass:"",bodyClass:"",footerClass:"",visible:!1};static get observedAttributes(){return["visible","backdrop","backdrop-close","keyboard","animation","animation-duration","close-button","size","centered","scrollable","title","content","footer","class-name"]}constructor(){super(),this._backdrop=null,this._isOpen=!1,this._keyHandler=null,this._dialog=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: none;\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1050;\n align-items: center;\n justify-content: center;\n }\n\n :host([visible]) {\n display: flex;\n }\n\n .modal-dialog {\n background: var(--dm-surface, #fff);\n border-radius: 8px;\n box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);\n max-width: 90%;\n max-height: 90vh;\n overflow: hidden;\n position: relative;\n opacity: 0;\n transform: scale(0.95) translateY(-10px);\n transition: opacity var(--animation-duration, 300ms) ease,\n transform var(--animation-duration, 300ms) ease;\n }\n\n :host(.show) .modal-dialog {\n opacity: 1;\n transform: scale(1) translateY(0);\n }\n\n :host([size="small"]) .modal-dialog { max-width: 400px; }\n :host([size="medium"]) .modal-dialog { max-width: 600px; }\n :host([size="large"]) .modal-dialog { max-width: 800px; }\n :host([size="xl"]) .modal-dialog { max-width: 1000px; }\n\n :host([animation="zoom"]) .modal-dialog {\n transform: scale(0.7);\n }\n\n :host([animation="zoom"].show) .modal-dialog {\n transform: scale(1);\n }\n\n :host([animation="slide"]) .modal-dialog {\n transform: translateY(-50px);\n }\n\n :host([animation="slide"].show) .modal-dialog {\n transform: translateY(0);\n }\n\n .modal-content {\n display: flex;\n flex-direction: column;\n }\n\n .modal-header {\n position: relative;\n padding: 1.5rem 1.5rem 1rem;\n border-bottom: 1px solid var(--dm-border, #e5e7eb);\n }\n\n .modal-title {\n margin: 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--dm-text, #212529);\n }\n\n .modal-close {\n position: absolute;\n right: 1rem;\n top: 1rem;\n background: none;\n border: none;\n font-size: 1.5rem;\n cursor: pointer;\n color: var(--dm-text-muted, #6b7280);\n line-height: 1;\n padding: 0;\n width: 2rem;\n height: 2rem;\n transition: color 0.15s ease;\n }\n\n .modal-close:hover {\n color: var(--dm-text, #212529);\n }\n\n .modal-body {\n padding: 1.5rem;\n color: var(--dm-text, #212529);\n }\n\n .modal-body-scrollable {\n max-height: 60vh;\n overflow-y: auto;\n }\n\n .modal-footer {\n display: flex;\n justify-content: flex-end;\n gap: 0.5rem;\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n background: var(--dm-surface-secondary, var(--dm-surface, #f9fafb)); /* --dm-surface-subtle is in no theme: dark themes got a white footer */\n }\n\n .modal-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n z-index: -1;\n opacity: 0;\n transition: opacity var(--animation-duration, 300ms) ease;\n }\n\n :host(.show) .modal-backdrop {\n opacity: 1;\n }\n\n /* Button styles */\n button:not(.modal-close) {\n padding: 0.5rem 1rem;\n border: none;\n border-radius: 4px;\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: background 0.15s ease;\n }\n\n .btn-primary {\n background: var(--dm-primary, #6495ED);\n color: white;\n }\n\n .btn-primary:hover {\n background: var(--dm-primary-dark, #4169E1);\n }\n\n .btn-secondary {\n background: var(--dm-secondary, #6c757d);\n color: white;\n }\n\n .btn-secondary:hover {\n background: var(--dm-secondary-dark, #5a6268);\n }\n\n .btn-success {\n background: var(--dm-success, #28a745);\n color: white;\n }\n\n .btn-success:hover {\n background: var(--dm-success-dark, #218838);\n }\n\n .btn-danger {\n background: var(--dm-danger, #dc3545);\n color: white;\n }\n\n .btn-danger:hover {\n background: var(--dm-danger-dark, #c82333);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const{title:e,content:t,footer:n,closeButton:s,buttons:o,headerClass:i,bodyClass:r,footerClass:a,scrollable:l,backdrop:d}=this._options;d&&(this._backdrop=document.createElement("div"),this._backdrop.className="modal-backdrop",this.shadowRoot.appendChild(this._backdrop)),this._dialog=document.createElement("div"),this._dialog.className="modal-dialog",this._dialog.setAttribute("part","dialog"),this._dialog.setAttribute("role","dialog"),this._dialog.setAttribute("aria-modal","true");const c=document.createElement("div");if(c.className="modal-content",e||s){const t=document.createElement("div");if(t.className="modal-header"+(i?" "+i:""),t.setAttribute("part","header"),e){const n=document.createElement("h3");n.className="modal-title",n.textContent=e,t.appendChild(n)}if(s){const e=document.createElement("button");e.className="modal-close",e.setAttribute("part","close"),e.setAttribute("aria-label","Close"),e.innerHTML="×",this._addEventListener(e,"click",()=>this.close()),t.appendChild(e)}c.appendChild(t)}const h=document.createElement("div");h.className=`modal-body${r?" "+r:""}${l?" modal-body-scrollable":""}`,h.setAttribute("part","body");const u=document.createElement("slot");if(t?h.textContent=t:h.appendChild(u),c.appendChild(h),o&&o.length>0)this._renderFooter(c,o,a);else if(n){const e=document.createElement("div");e.className="modal-footer"+(a?" "+a:""),e.setAttribute("part","footer"),e.textContent=n,c.appendChild(e)}this._dialog.appendChild(c),this.shadowRoot.appendChild(this._dialog)}_renderFooter(e,t,n){const s=document.createElement("div");s.className="modal-footer"+(n?" "+n:""),s.setAttribute("part","footer"),t.forEach((e,t)=>{const n=document.createElement("button");n.className=`btn btn-${e.variant||"secondary"}`,n.textContent=e.text||"Button",n.setAttribute("data-button-id",e.id||`btn-${t}`),this._addEventListener(n,"click",()=>{this._emit("buttonclick",{buttonId:e.id||`btn-${t}`,button:e}),!1!==e.close&&this.close()}),s.appendChild(n)}),e.appendChild(s)}_bindEvents(){this._options.keyboard&&(this._keyHandler=e=>{"Escape"===e.key&&this._isOpen&&this.close()},document.addEventListener("keydown",this._keyHandler)),this._backdrop&&this._options.backdropClose&&this._addEventListener(this,"click",e=>{e.target===this&&this.close()})}_onAttributeChange(e,t,n){if(this._dialog)switch(e){case"visible":""===n||"true"===n?this.open():this.close();break;case"title":case"content":case"footer":case"close-button":this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents()}}_onConnect(){this._options.visible&&this.open()}_onDisconnect(){this._keyHandler&&document.removeEventListener("keydown",this._keyHandler)}open(){return this._isOpen||(this._isOpen=!0,this.setAttribute("visible",""),this._emit("open"),requestAnimationFrame(()=>{this.classList.add("show")}),setTimeout(()=>{this._emit("opened")},this._options.animationDuration)),this}close(){return this._isOpen?(this._emit("close"),this.classList.remove("show"),setTimeout(()=>{this._isOpen=!1,this.removeAttribute("visible"),this._emit("closed")},this._options.animationDuration),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setTitle(e){return this.setAttribute("title",e),this}setContent(e){const t=this._dialog.querySelector(".modal-body");return t&&(t.textContent=e),this}setButtons(e){this._options.buttons=e;const t=this._dialog.querySelector(".modal-content"),n=t.querySelector(".modal-footer");return n&&n.remove(),e&&e.length>0&&this._renderFooter(t,e,this._options.footerClass),this}}customElements.get("domma-modal")||customElements.define("domma-modal",Et);class At extends yt{static defaults={hoverable:!0,shadow:"medium",rounded:!0,animation:!0,animationDuration:200,collapsible:!1,collapsed:!1,persistKey:null,collapseIcon:"chevron-down",visible:!0};static get observedAttributes(){return["hoverable","shadow","rounded","animation","animation-duration","collapsible","collapsed","persist-key","collapse-icon","visible"]}constructor(){super(),this._header=null,this._body=null,this._collapseIcon=null}_injectStyles(){const e=document.createElement("style");e.textContent='\n \n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n \n\n :host {\n display: block;\n background: var(--dm-surface, #fff);\n border: 1px solid var(--dm-border, #e5e7eb);\n border-radius: 8px;\n overflow: hidden;\n margin-bottom: 1.5rem;\n transition: transform var(--animation-duration, 200ms) ease,\n box-shadow var(--animation-duration, 200ms) ease;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host([shadow="none"]) {\n box-shadow: none;\n }\n\n :host([shadow="small"]) {\n box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n }\n\n :host([shadow="medium"]) {\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n }\n\n :host([shadow="large"]) {\n box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);\n }\n\n :host([rounded="false"]) {\n border-radius: 0;\n }\n\n :host([hoverable]:hover) {\n transform: scale(1.02);\n box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);\n }\n\n :host([animation="false"]) {\n transition: none;\n }\n\n /* Collapsible styles */\n :host([collapsible]) ::slotted(.card-header),\n .card-header-wrapper[data-collapsible="true"] {\n cursor: pointer;\n user-select: none;\n }\n\n .card-header-wrapper {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 0;\n border-bottom: 1px solid var(--dm-card-border, var(--dm-border, #e5e7eb));\n background: var(--dm-card-header-bg, var(--dm-surface-secondary, #f8fafc));\n }\n\n .card-header-content {\n flex: 1;\n background: transparent;\n }\n\n /* Strip the slotted header\'s own background/border so the wrapper provides\n a single uniform background across the full header row (text + icon).\n Without this, the text area gets double-tinted and looks darker\n than the transparent arrow area. */\n :host([collapsible]) ::slotted(.card-header) {\n background: transparent !important;\n border-bottom: none !important;\n }\n\n .card-collapse-icon {\n margin-left: 1rem;\n display: flex;\n align-items: center;\n transition: transform 200ms ease;\n color: var(--dm-text-secondary);\n background: transparent;\n padding: 1rem 1.5rem;\n }\n\n :host([collapsed]) .card-collapse-icon {\n transform: rotate(-90deg);\n }\n\n .card-body-wrapper {\n overflow: hidden;\n transition: height 200ms ease;\n }\n\n :host([collapsed]) .card-body-wrapper {\n height: 0 !important;\n }\n\n ::slotted(.card-header) {\n margin: 0;\n padding: 1rem 1.5rem;\n border-bottom: 1px solid var(--dm-card-border, var(--dm-border, #e5e7eb));\n background: var(--dm-card-header-bg, var(--dm-surface-secondary, #f8fafc));\n }\n\n ::slotted(.card-body) {\n padding: 1.5rem;\n }\n\n ::slotted(.card-footer) {\n padding: 1rem 1.5rem;\n border-top: 1px solid var(--dm-border, #e5e7eb);\n background: var(--dm-background-alt, #f8fafc);\n }\n ',this.shadowRoot.appendChild(e)}_render(){const{collapsible:e,collapsed:t}=this._options,n=document.createElement("slot");n.name="header";const s=document.createElement("slot");s.name="body";const o=document.createElement("slot");o.name="footer";const i=document.createElement("slot");if(this._bodyWrapper=document.createElement("div"),this._bodyWrapper.className="card-body-wrapper",e){this._headerWrapper=document.createElement("div"),this._headerWrapper.className="card-header-wrapper",this._headerWrapper.setAttribute("data-collapsible","true");const e=document.createElement("div");e.className="card-header-content",e.appendChild(n),this._collapseIcon=document.createElement("span"),this._collapseIcon.className="card-collapse-icon",this._collapseIcon.innerHTML=this._getCollapseIconSVG(),this._headerWrapper.appendChild(e),this._headerWrapper.appendChild(this._collapseIcon),this.shadowRoot.appendChild(this._headerWrapper)}else this.shadowRoot.appendChild(n);this._bodyWrapper.appendChild(s),this._bodyWrapper.appendChild(i),this.shadowRoot.appendChild(this._bodyWrapper),this.shadowRoot.appendChild(o)}_getCollapseIconSVG(){return'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <polyline points="6 9 12 15 18 9"></polyline>\n </svg>'}_bindEvents(){this._options.collapsible&&this._headerWrapper&&this._addEventListener(this._headerWrapper,"click",()=>this.toggle())}_onAttributeChange(e,t,n){switch(e){case"collapsed":{const e=""===n||"true"===n;this.isCollapsed()!==e&&this._setCollapsed(e,!1);break}case"collapsible":(this._headerWrapper||this._collapseIcon)&&(this.shadowRoot.innerHTML="",this._injectStyles(),this._render(),this._bindEvents())}}_onConnect(){this._options.collapsible&&this._headerWrapper&&0===this._eventHandlers.length&&this._addEventListener(this._headerWrapper,"click",()=>this.toggle()),this._options.collapsible&&this._restoreState()}_onDisconnect(){this._options.collapsible&&this.isCollapsed()&&this._saveState()}_getStorageKey(){return this._options.persistKey||(this.id?`domma-card-${this.id}`:null)}_restoreState(){if(!this._options.collapsible)return;const e=this._getStorageKey();if(e&&"undefined"!=typeof Domma&&Domma.storage){const t=Domma.storage.get(e);if(t?.collapsed)return void this._setCollapsed(!0,!1)}this._options.collapsed&&this._setCollapsed(!0,!1)}_saveState(){const e=this._getStorageKey();e&&"undefined"!=typeof Domma&&Domma.storage&&Domma.storage.set(e,{collapsed:this.isCollapsed()})}_setCollapsed(e,t=!0){if(this._bodyWrapper){if(e){const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px",this._bodyWrapper.offsetHeight,this._bodyWrapper.style.height="0px",this.setAttribute("collapsed",""),this._emit("collapse")}else{this.removeAttribute("collapsed");const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px",setTimeout(()=>{this._bodyWrapper&&!this.hasAttribute("collapsed")&&(this._bodyWrapper.style.height="auto")},this._options.animationDuration),this._emit("expand")}t&&this._saveState()}}collapse(){return this._setCollapsed(!0),this}expand(){return this._setCollapsed(!1),this}toggle(){return this._setCollapsed(!this.isCollapsed()),this}isCollapsed(){return this.hasAttribute("collapsed")}setShadow(e){return this.setAttribute("shadow",e),this}setHoverable(e){return e?this.setAttribute("hoverable",""):this.removeAttribute("hoverable"),this}setContent(e){let t=this.querySelector('[slot="body"]');t||(t=document.createElement("div"),t.setAttribute("slot","body"),t.className="card-body",this.appendChild(t));const n="undefined"!=typeof Domma&&Domma.sanitize&&"function"==typeof Domma.sanitize.sanitize?Domma.sanitize.sanitize(e):e;return t.innerHTML=n,"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(t),this}getBody(){let e=this.querySelector('[slot="body"]');return e||(e=document.createElement("div"),e.setAttribute("slot","body"),e.className="card-body",this.appendChild(e)),e}updateHeight(){if(this._options.collapsible&&!this.isCollapsed()&&this._bodyWrapper){this._bodyWrapper.style.height="auto";const e=this._bodyWrapper.scrollHeight;this._bodyWrapper.style.height=e+"px"}return this}}function St(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function $t(e,t,n){if(e&&t)for(const s of Array.from(e.attributes)){const o=s.name;if("class"!==o)t.hasAttribute(o)||t.setAttribute(o,s.value);else for(const s of e.classList)s!==n&&t.classList.add(s)}}function zt(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-loader");for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,e=>{n(s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):null!=n&&s.setAttribute(St(e),String(n));return n.appendChild(s),s._dommaComponent=s,{element:s,options:s._options,show(){return s.show(),this},hide(){return s.hide(),this},toggle(){return s.toggle(),this},isVisible:()=>s.isVisible(),setText(e){return s.setText(e),this},setType(e){return s.setType(e),this},setSize(e){return s.setSize(e),this},setColor(e){return s.setColor(e),this},destroy(){s.destroy()}}}customElements.get("domma-card")||customElements.define("domma-card",At);class Tt{static defaults={position:"top-right",duration:3e3,pauseOnHover:!0,showProgress:!0,animation:"slide",animationDuration:300,closable:!0,maxToasts:5};static _containers={};static _toasts=[];static _getContainer(e){if(!Tt._containers[e]){const t=document.createElement("div");t.className=`domma-toast-container domma-toast-${e}`,t.setAttribute("aria-live","polite"),t.setAttribute("aria-atomic","true"),t.style.cssText=`\n position: fixed;\n z-index: 9999;\n pointer-events: none;\n ${e.includes("top")?"top: 16px;":"bottom: 16px;"}\n ${e.includes("right")?"right: 16px;":"left: 16px;"}\n display: flex;\n flex-direction: column;\n gap: 12px;\n `,document.body.appendChild(t),Tt._containers[e]=t}return Tt._containers[e]}static show(e,t={}){const n={...Tt.defaults,...t},s=Tt._getContainer(n.position);for(;Tt._toasts.length>=n.maxToasts;){const e=Tt._toasts.shift();e&&e.close()}const o=document.createElement("domma-toast");o.style.pointerEvents="auto",o.setAttribute("role","error"===n.type?"alert":"status"),o.setAttribute("aria-live","error"===n.type?"assertive":"polite"),o.setAttribute("aria-atomic","true"),o.setAttribute("message",e),n.title&&o.setAttribute("title",n.title),n.type&&o.setAttribute("type",n.type),n.position&&o.setAttribute("position",n.position),void 0!==n.duration&&o.setAttribute("duration",String(n.duration)),void 0!==n.pauseOnHover&&o.setAttribute("pause-on-hover",String(n.pauseOnHover)),void 0!==n.showProgress&&o.setAttribute("show-progress",String(n.showProgress)),n.animation&&o.setAttribute("animation",n.animation),void 0!==n.animationDuration&&o.setAttribute("animation-duration",String(n.animationDuration)),void 0!==n.closable&&o.setAttribute("closable",String(n.closable)),void 0!==n.html&&o.setAttribute("html",String(n.html)),n.icon&&o.setAttribute("icon",n.icon),n.actions&&n.actions.length>0&&(o._options=o._options||{},o._options.actions=n.actions);for(const[e,t]of Object.entries(n))if("function"==typeof t){const n=e.replace(/^on/,"").toLowerCase(),s=e=>t(e.detail||o);o.addEventListener(n,s)}s.appendChild(o),o.show();const i={element:o,close(){o.close();const e=Tt._toasts.indexOf(i);return e>-1&&Tt._toasts.splice(e,1),this},setMessage(e){return o.setMessage(e),this},setTitle(e){return o.setTitle(e),this},setType(e){return o.setType(e),this},setActions(e){return o.setActions(e),this},isVisible:()=>o.isVisible()};return Tt._toasts.push(i),i}static success(e,t={}){return Tt.show(e,{...t,type:"success",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"/></svg>'})}static error(e,t={}){return Tt.show(e,{...t,type:"error",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clip-rule="evenodd"/></svg>'})}static warning(e,t={}){return Tt.show(e,{...t,type:"warning",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z" clip-rule="evenodd"/></svg>'})}static info(e,t={}){return Tt.show(e,{...t,type:"info",icon:'<svg width="20" height="20" viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z" clip-rule="evenodd"/></svg>'})}static closeAll(){Tt._toasts.forEach(e=>e.close()),Tt._toasts=[]}}class jt{static _container=null;static _zIndexBase=1050;static _activeModals=[];static _defaults={size:"large",title:"",content:"",buttons:[{id:"close",text:"Close",variant:"secondary"}],backdrop:!0,backdropClose:!0,keyboard:!0,animation:"fade",animationDuration:300,className:"",headerClass:"",bodyClass:"",footerClass:"",scrollable:!1,onButtonClick:null,onOpen:null,onClose:null};static _ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",this._container.style.cssText="position: fixed; top: 0; left: 0; right: 0; bottom: 0; pointer-events: none; z-index: 1040;",document.body.appendChild(this._container)),this._container}static _getNextZIndex(){return this._zIndexBase+10*this._activeModals.length}static createModal(e={}){const t={...this._defaults,...e},n=this._ensureContainer(),s=document.createElement("domma-modal");if(s.style.zIndex=this._getNextZIndex(),s.style.pointerEvents="auto",t.size&&s.setAttribute("size",t.size),t.title&&s.setAttribute("title",t.title),t.content){const e="undefined"!=typeof window?window.DOMPurify:null;s.innerHTML=e?.sanitize?e.sanitize(t.content):t.content}void 0!==t.backdrop&&s.setAttribute("backdrop",String(t.backdrop)),void 0!==t.backdropClose&&s.setAttribute("backdrop-close",String(t.backdropClose)),void 0!==t.keyboard&&s.setAttribute("keyboard",String(t.keyboard)),t.animation&&s.setAttribute("animation",t.animation),void 0!==t.animationDuration&&s.setAttribute("animation-duration",String(t.animationDuration)),void 0!==t.scrollable&&s.setAttribute("scrollable",String(t.scrollable)),t.className&&s.setAttribute("class-name",t.className),void 0!==t.closeButton&&s.setAttribute("close-button",String(t.closeButton)),t.onOpen&&s.addEventListener("open",()=>t.onOpen(o)),t.onClose&&s.addEventListener("close",()=>t.onClose(o)),t.onButtonClick&&s.addEventListener("buttonclick",e=>{t.onButtonClick(e.detail.buttonId,o)}),t.buttons&&t.buttons.length>0&&(s._options=s._options||{},s._options.buttons=t.buttons,s._options.footerClass=t.footerClass),n.appendChild(s);const o={element:s,_factoryCreated:!0,open(){return s.open(),jt._activeModals.push(this),this},close(){s.close();const e=jt._activeModals.indexOf(this);return e>-1&&jt._activeModals.splice(e,1),this},toggle(){return s.toggle(),this},isOpen:()=>s.isOpen(),setTitle(e){return s.setTitle(e),this},setContent(e){return s.setContent(e),this},setButtons(e){return s.setButtons(e),this},remove(){return this.close(),setTimeout(()=>{s.remove();const e=jt._activeModals.indexOf(this);e>-1&&jt._activeModals.splice(e,1)},t.animationDuration),this},destroy(){this.remove()}};return o}static showModal(e={}){return new Promise(t=>{this.createModal({...e,onButtonClick:(n,s)=>{e.onButtonClick&&e.onButtonClick(n,s),t(n)}}).open()})}}class Bt extends h{static defaults={active:0,animation:"fade",animationDuration:200,tabSelector:".tab-item, [data-tab]",panelSelector:".tab-panel, [data-panel]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._activeIndex=this.options.active,this._init()}_init(){if(!this.element)return;const e=this.options;this._tabs=this.element.querySelectorAll(e.tabSelector),this._panels=this.element.querySelectorAll(e.panelSelector);const t=this.element.querySelector(".tabs-list, .tab-list, .nav-tabs, [data-tab-list]")||this.element;t.hasAttribute("role")||t.setAttribute("role","tablist"),this._tabs.forEach((e,t)=>{e.hasAttribute("role")||e.setAttribute("role","tab");const n=this._panels[t];n&&(n.hasAttribute("role")||n.setAttribute("role","tabpanel"),e.id||(e.id="dm-tab-"+Math.random().toString(36).substring(2,9)),n.id||(n.id="dm-panel-"+Math.random().toString(36).substring(2,9)),e.hasAttribute("aria-controls")||e.setAttribute("aria-controls",n.id),n.hasAttribute("aria-labelledby")||n.setAttribute("aria-labelledby",e.id)),this._addEventListener(e,"click",e=>{e.preventDefault(),this.activate(t)})}),this._updateState()}activate(e){if("string"==typeof e){const t=Array.from(this._tabs).findIndex(t=>t.dataset?.tab===e||t.getAttribute("data-tab")===e||t.getAttribute("href")===e||t.getAttribute("href")===`#${e}`);e=-1!==t?t:Number(e)}if(e===this._activeIndex)return this;if(e<0||e>=this._tabs.length)return this;const t=this.options,n=this._activeIndex;return this._activeIndex=e,this._updateState(),t.onChange&&t.onChange({index:e,oldIndex:n,tab:this._tabs[e],panel:this._panels[e]}),this}_updateState(){const e=this.options;this._tabs.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-selected",s?"true":"false"),t.setAttribute("tabindex",s?"0":"-1"),s?t.classList.add(e.activeClass):t.classList.remove(e.activeClass)}),this._panels.forEach((t,n)=>{const s=n===this._activeIndex;t.setAttribute("aria-hidden",s?"false":"true"),s?(t.style.display="block","fade"===e.animation&&(t.style.opacity="0",t.style.transition=`opacity ${e.animationDuration}ms ease`,t.offsetHeight,t.style.opacity="1")):t.style.display="none"})}getActive(){return this._activeIndex}show(e){return this.activate(e)}next(){const e=(this._activeIndex+1)%this._tabs.length;return this.activate(e)}prev(){const e=(this._activeIndex-1+this._tabs.length)%this._tabs.length;return this.activate(e)}}class Dt extends h{static defaults={allowMultiple:!1,multiExpand:null,activeIndex:null,animation:!0,animationDuration:300,headerSelector:".accordion-header, [data-accordion-header]",contentSelector:".accordion-body, .accordion-content, [data-accordion-content]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),null!==this.options.multiExpand&&(this.options.allowMultiple=this.options.multiExpand),this._init()}_init(){if(!this.element)return;const e=this.options;this._headers=this.element.querySelectorAll(e.headerSelector);const t=[...this.element.querySelectorAll(e.contentSelector)];this._contents=t.filter(e=>!t.some(t=>t!==e&&t.contains(e))),this._contents.forEach((t,n)=>{const s=this._headers[n];s&&(s.hasAttribute("role")||"BUTTON"===s.tagName||s.setAttribute("role","button"),s.hasAttribute("tabindex")||s.setAttribute("tabindex","0"),s.id||(s.id="dm-accordion-hdr-"+Math.random().toString(36).substring(2,9)),t.id||(t.id="dm-accordion-body-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-controls")||s.setAttribute("aria-controls",t.id),t.hasAttribute("aria-labelledby")||t.setAttribute("aria-labelledby",s.id),t.hasAttribute("role")||t.setAttribute("role","region")),t.style.overflow="hidden",t.style.transition=e.animation?`height ${e.animationDuration}ms ease`:"none";const o=s?.parentElement;let i=o?.classList.contains(e.activeClass);null!==e.activeIndex&&(i=Array.isArray(e.activeIndex)?e.activeIndex.includes(n):e.activeIndex===n,i?o?.classList.add(e.activeClass):o?.classList.remove(e.activeClass)),s&&s.setAttribute("aria-expanded",i?"true":"false"),t.setAttribute("aria-hidden",i?"false":"true"),t.style.height=i?"auto":"0"}),this._headers.forEach((e,t)=>{this._addEventListener(e,"click",()=>{this.toggle(t)}),this._addEventListener(e,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.toggle(t))})})}toggle(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement,i=o?.classList.contains(t.activeClass);return t.allowMultiple||this._headers.forEach((t,n)=>{n!==e&&this._close(n)}),i?this._close(e):this._open(e),t.onChange&&t.onChange({index:e,isOpen:!i,header:n,content:s}),this}_open(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement;n&&n.setAttribute("aria-expanded","true"),s&&s.setAttribute("aria-hidden","false"),o?.classList.add(t.activeClass),s.style.height=s.scrollHeight+"px",setTimeout(()=>{s.style.height="auto"},t.animationDuration)}_close(e){const t=this.options,n=this._headers[e],s=this._contents[e],o=n?.parentElement;n&&n.setAttribute("aria-expanded","false"),s&&s.setAttribute("aria-hidden","true"),o?.classList.remove(t.activeClass),s.style.height=s.scrollHeight+"px",s.offsetHeight,s.style.height="0"}open(e){return e>=0&&e<this._headers.length&&this._open(e),this}close(e){return e>=0&&e<this._headers.length&&this._close(e),this}openAll(){return this._headers.forEach((e,t)=>this._open(t)),this}closeAll(){return this._headers.forEach((e,t)=>this._close(t)),this}}class Wt extends h{static defaults={selectable:!1,multiSelect:!1,activeClass:"active",disabledClass:"disabled",itemSelector:".list-group-item",keyboard:!0,loop:!0,focusOnInit:!1,onChange:null,onSelect:null,onDeselect:null};constructor(e,t={}){super(e,t),this._items=[],this._focusedIndex=-1,this._init()}_init(){if(this.element&&(this.refresh(),this.options.selectable&&(this.element.setAttribute("role","listbox"),this.options.multiSelect&&this.element.setAttribute("aria-multiselectable","true")),this._addEventListener(this.element,"click",e=>{if(!this.options.selectable)return;const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;if(t.classList.contains(this.options.disabledClass))return;const n=this._items.indexOf(t);-1!==n&&this._handleItemClick(n,e)}),this._addEventListener(this.element,"focusin",e=>{const t=e.target.closest(this.options.itemSelector);if(!t||!this.element.contains(t))return;const n=this._items.indexOf(t);-1!==n&&(this._focusedIndex=n)}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)&&e.setAttribute("aria-disabled","true")}),this.options.keyboard&&this._setupKeyboard(),this._initTabindex(),this.options.focusOnInit&&this._items.length>0)){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));-1!==e&&this._moveFocus(e)}}_initTabindex(){const e=this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass));this._items.forEach((t,n)=>{t.setAttribute("tabindex",n===e?"0":"-1")}),-1!==e&&(this._focusedIndex=e)}_setupKeyboard(){this._addEventListener(this.element,"keydown",e=>{switch(e.key){case"ArrowDown":case"ArrowRight":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,1));break;case"ArrowUp":case"ArrowLeft":e.preventDefault(),this._moveFocus(this._nextEnabledIndex(this._focusedIndex,-1));break;case"Home":e.preventDefault(),this._moveFocus(this._firstEnabledIndex());break;case"End":e.preventDefault(),this._moveFocus(this._lastEnabledIndex());break;case"Enter":case" ":if(e.preventDefault(),this.options.selectable&&-1!==this._focusedIndex){const t=this._items[this._focusedIndex];t&&!t.classList.contains(this.options.disabledClass)&&this._handleItemClick(this._focusedIndex,e)}}})}_nextEnabledIndex(e,t){const n=this._items.length;if(0===n)return-1;let s=e,o=0;do{if(s+=t,this.options.loop)s=(s%n+n)%n;else{if(s<0)return this._firstEnabledIndex();if(s>=n)return this._lastEnabledIndex()}if(o++,o>n)return-1}while(this._items[s].classList.contains(this.options.disabledClass));return s}_firstEnabledIndex(){return this._items.findIndex(e=>!e.classList.contains(this.options.disabledClass))}_lastEnabledIndex(){for(let e=this._items.length-1;e>=0;e--)if(!this._items[e].classList.contains(this.options.disabledClass))return e;return-1}_moveFocus(e){-1===e||e>=this._items.length||(-1!==this._focusedIndex&&this._items[this._focusedIndex]&&this._items[this._focusedIndex].setAttribute("tabindex","-1"),this._items[e].setAttribute("tabindex","0"),this._items[e].focus({preventScroll:!0}),this._focusedIndex=e)}_handleItemClick(e,t){const n=this._items[e],s=n.classList.contains(this.options.activeClass);if(this.options.multiSelect)s?(n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(n,e,t)):(n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(n,e,t));else{if(this._items.filter((t,n)=>n!==e&&t.classList.contains(this.options.activeClass)).forEach(e=>{e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false");const n=this._items.indexOf(e);this.options.onDeselect&&this.options.onDeselect(e,n,t)}),s)return n.classList.remove(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(n,e,t),void(this.options.onChange&&this.options.onChange(this.getSelected(),t));n.classList.add(this.options.activeClass),this.options.selectable&&n.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(n,e,t)}this.options.onChange&&this.options.onChange(this.getSelected(),t)}_updateAriaSelected(){this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",String(e.classList.contains(this.options.activeClass)))})}select(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.contains(this.options.disabledClass)||(this.options.multiSelect||this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(e,t,null))}),t.classList.add(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(t,e,null),this.options.onChange&&this.options.onChange(this.getSelected(),null)),this}deselect(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.activeClass),this.options.selectable&&t.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(t,e,null),this.options.onChange&&this.options.onChange(this.getSelected(),null),this}toggle(e){if(e<0||e>=this._items.length)return this;return this._items[e].classList.contains(this.options.activeClass)?this.deselect(e):this.select(e)}selectAll(){return this.options.multiSelect?(this._items.forEach((e,t)=>{e.classList.contains(this.options.disabledClass)||(e.classList.add(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","true"),this.options.onSelect&&this.options.onSelect(e,t,null))}),this.options.onChange&&this.options.onChange(this.getSelected(),null),this):this}deselectAll(){return this._items.forEach((e,t)=>{e.classList.contains(this.options.activeClass)&&(e.classList.remove(this.options.activeClass),this.options.selectable&&e.setAttribute("aria-selected","false"),this.options.onDeselect&&this.options.onDeselect(e,t,null))}),this.options.onChange&&this.options.onChange(this.getSelected(),null),this}getSelected(){return this._items.filter(e=>e.classList.contains(this.options.activeClass))}isSelected(e){return!(e<0||e>=this._items.length)&&this._items[e].classList.contains(this.options.activeClass)}enable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.remove(this.options.disabledClass),t.removeAttribute("aria-disabled"),this}disable(e){if(e<0||e>=this._items.length)return this;const t=this._items[e];return t.classList.add(this.options.disabledClass),t.setAttribute("aria-disabled","true"),this}getItems(){return[...this._items]}getItem(e){return this._items[e]||null}refresh(){return this.element?(this._items=Array.from(this.element.querySelectorAll(this.options.itemSelector)),this.options.selectable&&this._items.forEach(e=>{e.setAttribute("aria-selected",e.classList.contains(this.options.activeClass)?"true":"false")}),this._items.forEach(e=>{e.classList.contains(this.options.disabledClass)?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled")}),this._initTabindex(),this):this}destroy(){this._items.forEach(e=>{e.removeAttribute("tabindex"),e.removeAttribute("aria-disabled")}),this.options.selectable&&(this.element.removeAttribute("role"),this.element.removeAttribute("aria-multiselectable"),this._items.forEach(e=>{e.removeAttribute("aria-selected")})),super.destroy()}}class Ht extends h{static defaults={trigger:"click",position:"bottom-start",offset:[0,4],animation:!0,animationDuration:150,hoverOpenDelay:0,hoverCloseDelay:300,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,closeOthers:!0,flip:!0,items:[],model:null,modelKey:null,itemTemplate:null,onOpen:null,onClose:null,onSelect:null};static _open=new Set;constructor(e,t={}){super(e,t),this._menu=null,this._isOpen=!1,this._items=[...this.options.items],this._selectedValue=null,this._modelUnsubscribe=null,this._hoverOpenTimer=null,this._hoverCloseTimer=null,this._removeTimer=null,this._init()}_init(){if(!this.element)return;const e=this.options;this.element.setAttribute("aria-haspopup","true"),this.element.setAttribute("aria-expanded","false"),this._addEventListener(this.element,"click",()=>{"hover"===e.trigger?this.open():this.toggle()}),"hover"===e.trigger&&(this._addEventListener(this.element,"mouseenter",()=>this._hoverIn()),this._addEventListener(this.element,"mouseleave",()=>this._hoverOut())),e.closeOnClickOutside&&(this._outsideClickHandler=e=>{this._isOpen&&(this.element.contains(e.target)||this._menu&&this._menu.contains(e.target)||this.close())},document.addEventListener("click",this._outsideClickHandler)),e.closeOnEscape&&(this._keydownHandler=e=>{"Escape"===e.key&&this._isOpen&&(this.close(),"function"==typeof this.element.focus&&this.element.focus())},document.addEventListener("keydown",this._keydownHandler)),e.model&&e.modelKey&&this._bindToModel(e.model,e.modelKey)}_bindToModel(e,t){if(e&&"function"==typeof e.get){const n=e.get(t);Array.isArray(n)&&(this._items=[...n]);const s=e=>{Array.isArray(e)&&(this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()))};"function"==typeof e.onFieldChange?this._modelUnsubscribe=e.onFieldChange(t,s):"function"==typeof e.onChange&&(this._modelUnsubscribe=e.onChange(({field:e,newValue:n})=>{e===t&&s(n)}))}}open(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,this._removeTimer&&(clearTimeout(this._removeTimer),this._removeTimer=null),this._isOpen)return this;const e=this.options;return e.closeOthers&&Ht._open.forEach(e=>{e!==this&&e.close()}),e.onOpen&&e.onOpen(this),this._menu?(this._renderMenu(),this._menu.style.pointerEvents="",this._menu.classList.add("show")):this._createMenu(),this._isOpen=!0,Ht._open.add(this),this.element.setAttribute("aria-expanded","true"),this._positionMenu(),this._bindOpenListeners(),this}close(){if(clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),this._hoverOpenTimer=this._hoverCloseTimer=null,!this._isOpen)return this;const e=this.options,t=e.animation?e.animationDuration:0;this._isOpen=!1,Ht._open.delete(this),this.element.setAttribute("aria-expanded","false"),this._unbindOpenListeners();const n=this._menu;return n&&(n.classList.remove("show"),n.style.pointerEvents="none",this._removeTimer=setTimeout(()=>{this._removeTimer=null,this._menu=null,n.remove()},t)),e.onClose&&e.onClose(this),this}toggle(){return this._isOpen?this.close():this.open()}_hoverIn(){if(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null,this._isOpen)return;const e=this.options.hoverOpenDelay;e?(clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=setTimeout(()=>this.open(),e)):this.open()}_hoverOut(){clearTimeout(this._hoverOpenTimer),this._hoverOpenTimer=null,this._scheduleHoverClose()}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{this._hoverCloseTimer=null,this.close()},this.options.hoverCloseDelay)}_pointerInSafeZone(e,t){if(!this.element)return!1;const n=this.element.getBoundingClientRect(),s=this._menu?this._menu.getBoundingClientRect():null,o=n=>!!n&&e>=n.left-2&&e<=n.right+2&&t>=n.top-2&&t<=n.bottom+2;if(o(n))return!0;if(!s)return!1;if(o(s))return!0;if(e<Math.min(n.left,s.left)-2)return!1;if(e>Math.max(n.right,s.right)+2)return!1;if(t<Math.min(n.top,s.top)-2)return!1;if(t>Math.max(n.bottom,s.bottom)+2)return!1;if(s.top>=n.bottom){if(t>=n.bottom-2&&t<=s.top+2)return!0}else if(n.top>=s.bottom&&t>=s.bottom-2&&t<=n.top+2)return!0;if(s.left>=n.right){if(e>=n.right-2&&e<=s.left+2)return!0}else if(n.left>=s.right&&e>=s.right-2&&e<=n.left+2)return!0;return!1}_bindOpenListeners(){this._openListenersBound||(this._openListenersBound=!0,this._repositionHandler=()=>this._positionMenu(),window.addEventListener("resize",this._repositionHandler),window.addEventListener("scroll",this._repositionHandler,!0),"hover"===this.options.trigger&&(this._pointerMoveHandler=e=>{this._isOpen&&(this._pointerInSafeZone(e.clientX,e.clientY)?(clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null):this._hoverCloseTimer||this._scheduleHoverClose())},document.addEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerLeaveHandler=()=>this._scheduleHoverClose(),document.documentElement.addEventListener("mouseleave",this._pointerLeaveHandler)))}_unbindOpenListeners(){this._openListenersBound&&(this._openListenersBound=!1,this._repositionHandler&&(window.removeEventListener("resize",this._repositionHandler),window.removeEventListener("scroll",this._repositionHandler,!0),this._repositionHandler=null),this._pointerMoveHandler&&(document.removeEventListener("mousemove",this._pointerMoveHandler,!0),this._pointerMoveHandler=null),this._pointerLeaveHandler&&(document.documentElement.removeEventListener("mouseleave",this._pointerLeaveHandler),this._pointerLeaveHandler=null))}_createMenu(){const e=this.options;this._menu=document.createElement("div"),this._menu.className="domma-dropdown-menu",this._menu.setAttribute("role","menu"),this._renderMenu(),document.body.appendChild(this._menu),this._addEventListener(this._menu,"click",e=>{const t=e.target.closest(".domma-dropdown-item");if(!t||!this._menu||!this._menu.contains(t))return;if(t.classList.contains("disabled"))return;const n=Number(t.dataset.index);this._selectItem(this._items[n],n,t.dataset.value)}),"hover"===e.trigger&&(this._addEventListener(this._menu,"mouseenter",()=>{clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=null}),this._addEventListener(this._menu,"mouseleave",()=>this._scheduleHoverClose())),this._menu.offsetHeight,this._menu.classList.add("show")}_renderMenu(){if(!this._menu)return;const e=this.options;this._menu.innerHTML="",this._items.forEach((t,n)=>{const s=document.createElement("div");if(s.className="domma-dropdown-item",s.setAttribute("role","menuitem"),s.dataset.index=n,"string"==typeof t)s.textContent=t,s.dataset.value=t;else{if(t.divider)return s.className="domma-dropdown-divider",s.setAttribute("role","separator"),void this._menu.appendChild(s);if(t.header)return s.className="domma-dropdown-header",s.setAttribute("role","presentation"),s.textContent=t.header,void this._menu.appendChild(s);if(e.itemTemplate?s.innerHTML=e.itemTemplate(t,n):s.textContent=t.label||t.text||t.name||"",s.dataset.value=void 0!==t.value?t.value:n,t.disabled&&(s.classList.add("disabled"),s.setAttribute("aria-disabled","true")),t.icon){const e=document.createElement("span");e.className="domma-dropdown-icon",e.innerHTML=t.icon,s.insertBefore(e,s.firstChild)}}this._menu.appendChild(s)})}_selectItem(e,t,n){const s=this.options;if(this._selectedValue=n,s.onSelect&&s.onSelect({item:e,index:t,value:n},this),s.model&&s.modelKey&&"function"==typeof s.model.set){const e=s.selectedKey||s.modelKey+"_selected";s.model.set(e,n)}s.closeOnSelect&&this.close()}_positionMenu(){if(!this._menu||!this.element)return;const e=this.options,t=this.element.getBoundingClientRect(),[n,s]=e.offset,o=this._menu.offsetWidth,i=this._menu.offsetHeight,r=document.documentElement.clientWidth,a=document.documentElement.clientHeight,l=e=>{switch(e){case"bottom-end":return[t.bottom+s,t.right-o+n];case"top-start":return[t.top-i-s,t.left+n];case"top-end":return[t.top-i-s,t.right-o+n];case"left-start":return[t.top+s,t.left-o-n];case"left-end":return[t.bottom-i+s,t.left-o-n];case"right-start":return[t.top+s,t.right+n];case"right-end":return[t.bottom-i+s,t.right+n];default:return[t.bottom+s,t.left+n]}},d=String(e.position||"bottom-start").split("-"),c=["bottom","top","left","right"].includes(d[0])?d[0]:"bottom",h="end"===d[1]?"end":"start";let[u,p]=l(`${c}-${h}`);if(e.flip){const e={bottom:"top",top:"bottom",left:"right",right:"left"},d=a-8-(t.bottom+s),m=t.top-s-8,f=r-8-(t.right+n),g=t.left-n-8;("bottom"===c&&i>d&&m>=i||"top"===c&&i>m&&d>=i||"right"===c&&o>f&&g>=o||"left"===c&&o>g&&f>=o)&&([u,p]=l(`${e[c]}-${h}`)),o<=r-16&&(p=Math.max(8,Math.min(p,r-o-8))),i<=a-16&&(u=Math.max(8,Math.min(u,a-i-8)))}u+=window.scrollY,p+=window.scrollX,this._menu.style.top=u+"px",this._menu.style.left=p+"px"}setItems(e){return this._items=[...e],this._isOpen&&(this._renderMenu(),this._positionMenu()),this}addItem(e){return this._items.push(e),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}removeItem(e){return this._items.splice(e,1),this._isOpen&&(this._renderMenu(),this._positionMenu()),this}getSelected(){return this._selectedValue}isOpen(){return this._isOpen}destroy(){super.destroy(),clearTimeout(this._hoverOpenTimer),clearTimeout(this._hoverCloseTimer),clearTimeout(this._removeTimer),this._unbindOpenListeners(),Ht._open.delete(this),this._outsideClickHandler&&(document.removeEventListener("click",this._outsideClickHandler),this._outsideClickHandler=null),this._keydownHandler&&(document.removeEventListener("keydown",this._keydownHandler),this._keydownHandler=null),this._modelUnsubscribe&&"function"==typeof this._modelUnsubscribe&&this._modelUnsubscribe(),this._menu&&(this._menu.remove(),this._menu=null),this._isOpen=!1}}class Ot{static permission="undefined"!=typeof Notification?Notification.permission:"denied";static isSupported="undefined"!=typeof Notification;static _instances=[];static defaults={title:"Notification",body:"",icon:null,badge:null,tag:null,requireInteraction:!1,silent:!1,data:null,onClick:null,onClose:null,onError:null,onShow:null};static async requestPermission(){if(!Ot.isSupported)return console.warn("Notifications are not supported in this browser"),"denied";try{const e=await Notification.requestPermission();return Ot.permission=e,e}catch(e){return console.error("Error requesting notification permission:",e),"denied"}}static notify(e,t={}){const n=new Ot({title:e,...t});return n.show(),n}static closeAll(){Ot._instances.forEach(e=>{e.isShown()&&e.close()}),Ot._instances=[]}constructor(e={}){this.options={...Ot.defaults,...e},this.notification=null,this._shown=!1}async show(){if(!Ot.isSupported)return console.warn("Notifications are not supported in this browser"),this.options.onError&&this.options.onError(new Error("Notifications not supported")),this;if("granted"!==Ot.permission){if("default"!==Ot.permission)return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this;if("granted"!==await Ot.requestPermission())return console.warn("Notification permission denied"),this.options.onError&&this.options.onError(new Error("Permission denied")),this}try{const e={};this.options.body&&(e.body=this.options.body),this.options.icon&&(e.icon=this.options.icon),this.options.badge&&(e.badge=this.options.badge),this.options.tag&&(e.tag=this.options.tag),void 0!==this.options.requireInteraction&&(e.requireInteraction=this.options.requireInteraction),void 0!==this.options.silent&&(e.silent=this.options.silent),this.options.data&&(e.data=this.options.data),this.notification=new Notification(this.options.title,e),this._shown=!0,Ot._instances.push(this),this.options.onClick&&(this.notification.onclick=e=>{this.options.onClick(e,this)}),this.options.onClose?this.notification.onclose=e=>{this._shown=!1;const t=Ot._instances.indexOf(this);t>-1&&Ot._instances.splice(t,1),this.options.onClose(e,this)}:this.notification.onclose=()=>{this._shown=!1;const e=Ot._instances.indexOf(this);e>-1&&Ot._instances.splice(e,1)},this.options.onError&&(this.notification.onerror=e=>{this._shown=!1,this.options.onError(e,this)}),this.options.onShow&&(this.notification.onshow=e=>{this.options.onShow(e,this)})}catch(e){console.error("Error showing notification:",e),this.options.onError&&this.options.onError(e)}return this}close(){return this.notification&&this._shown&&(this.notification.close(),this._shown=!1),this}isShown(){return this._shown}}class It extends h{static defaults={duration:6e4,autoStart:!1,format:"mm:ss",showControls:!1,updateInterval:100,notification:!1,notificationOptions:{},sound:!1,soundUrl:null,onTick:null,onComplete:null,onStart:null,onPause:null,onReset:null};constructor(e,t={}){super(e,t),e||(this.element=null,this.options={...It.defaults,...t}),this._running=!1,this._remaining=this.options.duration,this._intervalId=null,this._startTime=null,this._pausedTime=null,this._display=null,this._controls=null,this._audio=null,this._init()}_init(){this.element&&(this._createDisplay(),this.options.showControls&&this._createControls()),this.options.sound&&this.options.soundUrl&&(this._audio=new Audio(this.options.soundUrl)),this.options.autoStart&&this.start()}_createDisplay(){if(!this.element)return;const e=document.createElement("div");e.className="dm-timer",this._display=document.createElement("div"),this._display.className="dm-timer-display";const t=document.createElement("span");t.className="dm-timer-time",t.textContent=this._formatTime(this._remaining),this._display.appendChild(t),e.appendChild(this._display),this.element.innerHTML="",this.element.appendChild(e),this._container=e}_createControls(){if(!this.element||!this._container)return;const e=document.createElement("div");e.className="dm-timer-controls",this._startBtn=document.createElement("button"),this._startBtn.className="dm-timer-button dm-timer-start",this._startBtn.textContent="Start",this._startBtn.addEventListener("click",()=>this.start()),this._pauseBtn=document.createElement("button"),this._pauseBtn.className="dm-timer-button dm-timer-pause",this._pauseBtn.textContent="Pause",this._pauseBtn.style.display="none",this._pauseBtn.addEventListener("click",()=>this.pause()),this._resetBtn=document.createElement("button"),this._resetBtn.className="dm-timer-button dm-timer-reset",this._resetBtn.textContent="Reset",this._resetBtn.addEventListener("click",()=>this.reset()),e.appendChild(this._startBtn),e.appendChild(this._pauseBtn),e.appendChild(this._resetBtn),this._container.appendChild(e),this._controls=e}_updateDisplay(){if(!this._display)return;const e=this._display.querySelector(".dm-timer-time");e&&(e.textContent=this._formatTime(this._remaining))}_formatTime(e){const t=Math.max(0,Math.floor(e/1e3)),n=Math.floor(t/3600),s=Math.floor(t%3600/60),o=t%60,i=this.options.format.toLowerCase();if("hh:mm:ss"===i)return`${String(n).padStart(2,"0")}:${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`;if("mm:ss"===i){const e=Math.floor(t/60);return`${String(e).padStart(2,"0")}:${String(o).padStart(2,"0")}`}return"ss"===i?String(t).padStart(2,"0"):`${String(s).padStart(2,"0")}:${String(o).padStart(2,"0")}`}_tick(){if(!this._running)return;const e=Date.now()-this._startTime;this._remaining=Math.max(0,this.options.duration-e),this._updateDisplay(),this.options.onTick&&this.options.onTick(this._remaining),0===this._remaining&&this._complete()}_complete(){if(this.stop(),this.options.sound&&this._audio&&this._audio.play().catch(e=>{console.warn("Failed to play timer sound:",e)}),this.options.notification&&Ot.isSupported){const e={title:"Timer Complete",body:"Your countdown has finished",...this.options.notificationOptions};Ot.notify(e.title,e)}this.options.onComplete&&this.options.onComplete()}start(){return this._running||(this._running=!0,this._startTime=Date.now()-(this.options.duration-this._remaining),this._intervalId=setInterval(()=>this._tick(),this.options.updateInterval),this._startBtn&&(this._startBtn.style.display="none"),this._pauseBtn&&(this._pauseBtn.style.display="inline-block"),this.options.onStart&&this.options.onStart()),this}pause(){return this._running?(this._running=!1,this._pausedTime=Date.now(),this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this.options.onPause&&this.options.onPause(),this):this}reset(){return this.stop(),this._remaining=this.options.duration,this._updateDisplay(),this._startBtn&&(this._startBtn.style.display="inline-block"),this._pauseBtn&&(this._pauseBtn.style.display="none"),this.options.onReset&&this.options.onReset(),this}stop(){return this._running=!1,this._intervalId&&(clearInterval(this._intervalId),this._intervalId=null),this}add(e){return this._remaining=Math.min(this._remaining+e,864e5),this._updateDisplay(),this}subtract(e){return this._remaining=Math.max(0,this._remaining-e),this._updateDisplay(),0===this._remaining&&this._running&&this._complete(),this}setDuration(e){return this.options.duration=e,this._running||(this._remaining=e,this._updateDisplay()),this}isRunning(){return this._running}getRemaining(){return this._remaining}getElapsed(){return this.options.duration-this._remaining}destroy(){this.stop(),this._startBtn&&this._startBtn.removeEventListener("click",this.start),this._pauseBtn&&this._pauseBtn.removeEventListener("click",this.pause),this._resetBtn&&this._resetBtn.removeEventListener("click",this.reset),this.element&&this._container&&this.element.removeChild(this._container),this._display=null,this._controls=null,this._audio=null,this._container=null,super.destroy&&super.destroy()}}class Nt{static defaults={alarms:[],timezone:"local",checkInterval:3e4,storageKey:"domma-alarms",onTrigger:null,onSnooze:null,onDismiss:null,onAlarmAdd:null,onAlarmRemove:null};static _instance=null;static _checkInterval=null;static _nextAlarmId=1;constructor(e={}){if(Nt._instance)return Nt._instance;this.options={...Nt.defaults,...e},this._alarms=[],this._init(),Nt._instance=this}_init(){this._loadAlarms(),this._startChecking()}_loadAlarms(){try{const e=localStorage.getItem(this.options.storageKey);if(e){const t=JSON.parse(e);if(this._alarms=Array.isArray(t)?t:[],this._alarms.length>0){const e=Math.max(...this._alarms.map(e=>{const t=String(e.id).match(/\d+$/);return t?parseInt(t[0]):0}));Nt._nextAlarmId=e+1}}else this.options.alarms&&this.options.alarms.length>0&&(this._alarms=this.options.alarms.map(e=>({id:"alarm-"+Nt._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e})),this._saveAlarms())}catch(e){console.error("Failed to load alarms from localStorage:",e),this._alarms=[]}}_saveAlarms(){try{localStorage.setItem(this.options.storageKey,JSON.stringify(this._alarms))}catch(e){console.error("Failed to save alarms to localStorage:",e)}}_startChecking(){Nt._checkInterval||(Nt._checkInterval=setInterval(()=>{this._checkAlarms()},this.options.checkInterval),this._checkAlarms())}_stopChecking(){Nt._checkInterval&&(clearInterval(Nt._checkInterval),Nt._checkInterval=null)}_checkAlarms(){const e=new Date;this._alarms.forEach(t=>{t.enabled&&(t.snoozedUntil&&e<new Date(t.snoozedUntil)||(t.snoozedUntil&&e>=new Date(t.snoozedUntil)&&(t.snoozedUntil=null,this._saveAlarms()),this._shouldTrigger(t,e)&&this._triggerAlarm(t)))})}_shouldTrigger(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),o=t.getHours(),i=t.getMinutes();if(o!==n||i!==s)return!1;if(e.lastTriggered){if(t-new Date(e.lastTriggered)<5e4)return!1}return!!this._matchesRepeatPattern(e,t)}_parseTime(e){const[t,n]=e.split(":").map(e=>parseInt(e,10));return{hours:t,minutes:n}}_matchesRepeatPattern(e,t){if(!e.repeat)return!0;const n=t.getDay();if("daily"===e.repeat)return!0;if("weekdays"===e.repeat)return n>=1&&n<=5;if("weekends"===e.repeat)return 0===n||6===n;if(Array.isArray(e.repeat)){const t=["sun","mon","tue","wed","thu","fri","sat"][n];return e.repeat.includes(t)}return!1}_triggerAlarm(e){if(e.lastTriggered=Date.now(),this._saveAlarms(),e.sound&&e.soundUrl){new Audio(e.soundUrl).play().catch(e=>{console.warn("Failed to play alarm sound:",e)})}if(e.notification&&Ot.isSupported){const t={title:"Alarm",body:e.label||`Alarm at ${e.time}`,requireInteraction:!0,...e.notificationOptions};Ot.notify(t.title,t)}this.options.onTrigger&&this.options.onTrigger(e),e.repeat||(e.enabled=!1,this._saveAlarms())}add(e){const t={id:"alarm-"+Nt._nextAlarmId++,enabled:!0,notification:!0,notificationOptions:{},sound:!1,soundUrl:null,repeat:null,lastTriggered:null,snoozedUntil:null,...e};return this._alarms.push(t),this._saveAlarms(),this.options.onAlarmAdd&&this.options.onAlarmAdd(t),t}remove(e){const t=this._alarms.findIndex(t=>t.id===e);if(-1===t)return!1;const n=this._alarms.splice(t,1)[0];return this._saveAlarms(),this.options.onAlarmRemove&&this.options.onAlarmRemove(n),!0}update(e,t){const n=this._alarms.find(t=>t.id===e);return n?(Object.assign(n,t),this._saveAlarms(),n):null}enable(e){return null!==this.update(e,{enabled:!0})}disable(e){return null!==this.update(e,{enabled:!1})}toggle(e){const t=this._alarms.find(t=>t.id===e);return t?(t.enabled=!t.enabled,this._saveAlarms(),t.enabled):null}snooze(e,t=3e5){const n=this._alarms.find(t=>t.id===e);return!!n&&(n.snoozedUntil=Date.now()+t,this._saveAlarms(),this.options.onSnooze&&this.options.onSnooze(n,t),!0)}getAlarms(){return[...this._alarms]}getAlarm(e){return this._alarms.find(t=>t.id===e)||null}getNextAlarm(){const e=new Date;let t=null,n=null;return this._alarms.forEach(s=>{if(!s.enabled)return;const o=this._getNextOccurrence(s,e);o&&(!n||o<n)&&(n=o,t={...s,nextTrigger:o})}),t}_getNextOccurrence(e,t){const{hours:n,minutes:s}=this._parseTime(e.time),o=new Date(t),i=new Date(o);i.setHours(n,s,0,0),i<=o&&i.setDate(i.getDate()+1);for(let t=0;t<7;t++){if(this._matchesRepeatPattern(e,i))return i;i.setDate(i.getDate()+1)}return null}clearAll(){return this._alarms=[],this._saveAlarms(),this}destroy(){this._stopChecking(),this._alarms=[],Nt._instance=null}}class Pt extends h{static defaults={autoplay:!1,interval:5e3,pauseOnHover:!0,loop:!0,animation:"slide",animationDuration:500,animationEasing:"ease",heightMode:"crop",height:null,showArrows:!0,showIndicators:!0,slideSelector:".carousel-slide, [data-slide]",activeClass:"active",onChange:null};constructor(e,t={}){super(e,t),this._currentIndex=0,this._autoplayTimer=null,this._isAnimating=!1,this._init()}_init(){if(!this.element)return;const e=this.options;if(this._slides=this.element.querySelectorAll(e.slideSelector),this._track=this.element.querySelector(".carousel-track"),0===this._slides.length)return;this.element.style.position="relative",this.element.style.overflow="hidden";const t="fade"===e.animation||"crossfade"===e.animation;this._slides.forEach((n,s)=>{t?(n.style.position=0===s?"relative":"absolute",n.style.top="0",n.style.left="0",n.style.width="100%",n.style.opacity=0===s?"1":"0",n.style.zIndex=0===s?"1":"0",n.style.transition=`opacity ${e.animationDuration}ms ${e.animationEasing}`):(n.style.position="relative",n.style.width="100%",n.style.flexShrink="0")}),"slide"===e.animation&&this._track&&(this._track.style.display="flex",this._track.style.transition=`transform ${e.animationDuration}ms ${e.animationEasing}`),this._initHeight(),e.showArrows&&this._createArrows(),e.showIndicators&&this._createIndicators(),e.autoplay&&(this._startAutoplay(),e.pauseOnHover&&(this._addEventListener(this.element,"mouseenter",()=>this._stopAutoplay()),this._addEventListener(this.element,"mouseleave",()=>this._startAutoplay()))),this._addEventListener(this.element,"keydown",e=>{"ArrowLeft"===e.key&&this.prev(),"ArrowRight"===e.key&&this.next()}),this.element.tabIndex=0,this._updateState()}_initHeight(){this._images=Array.from(this._slides,e=>e.querySelector(":scope > img")).filter(Boolean),this._originalHeight=this.element.style.getPropertyValue("--dm-carousel-height"),this._originalHeightPriority=this.element.style.getPropertyPriority("--dm-carousel-height"),this._wasSized=this.element.classList.contains("carousel-sized");const e=()=>this._sizeSlides();for(const t of this._images)this._addEventListener(t,"load",e),this._addEventListener(t,"error",e);"undefined"!=typeof ResizeObserver?(this._heightObserver=new ResizeObserver(e),this._heightObserver.observe(this.element)):this._addEventListener(window,"resize",e),e()}_sizeSlides(){const e=this.element.clientWidth,t=Number(this.options.height);let n=t>0&&Number.isFinite(t)?t:0;if(!n){const t=this._images.filter(e=>e.naturalWidth>0&&e.naturalHeight>0).map(t=>e*t.naturalHeight/t.naturalWidth);if(!t.length||!e)return;const s=Math.min(...t);n="average"===this.options.heightMode?(s+Math.max(...t))/2:s;for(const e of this._slides)if(!e.querySelector(":scope > img")){const t=e.style.height;e.style.height="auto",n=Math.max(n,e.scrollHeight),e.style.height=t}}const s=`${n}px`;this.element.style.getPropertyValue("--dm-carousel-height")!==s&&this.element.style.setProperty("--dm-carousel-height",s),this.element.classList.add("carousel-sized")}_applyOptions(){this._images&&this._sizeSlides()}_createArrows(){const e=document.createElement("button");e.className="carousel-arrow carousel-prev",e.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 18l-6-6 6-6"/></svg>',e.style.cssText="\n position: absolute;\n top: 50%;\n left: 1rem;\n transform: translateY(-50%);\n z-index: 10;\n background: rgba(255,255,255,0.9);\n border: none;\n border-radius: 50%;\n width: 40px;\n height: 40px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s ease;\n box-shadow: 0 2px 8px rgba(0,0,0,0.15);\n ",this._addEventListener(e,"click",()=>this.prev()),this._addEventListener(e,"mouseenter",()=>e.style.background="#fff"),this._addEventListener(e,"mouseleave",()=>e.style.background="rgba(255,255,255,0.9)");const t=document.createElement("button");t.className="carousel-arrow carousel-next",t.innerHTML='<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>',t.style.cssText=e.style.cssText.replace("left: 1rem","right: 1rem"),this._addEventListener(t,"click",()=>this.next()),this._addEventListener(t,"mouseenter",()=>t.style.background="#fff"),this._addEventListener(t,"mouseleave",()=>t.style.background="rgba(255,255,255,0.9)"),this.element.appendChild(e),this.element.appendChild(t),this._prevBtn=e,this._nextBtn=t}_createIndicators(){const e=document.createElement("div");e.className="carousel-indicators",e.style.cssText="\n position: absolute;\n bottom: 1rem;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n gap: 0.5rem;\n z-index: 10;\n ",this._slides.forEach((t,n)=>{const s=document.createElement("button");s.className="carousel-indicator",s.style.cssText="\n width: 10px;\n height: 10px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.5);\n cursor: pointer;\n padding: 0;\n transition: all 0.2s ease;\n ",this._addEventListener(s,"click",()=>this.goTo(n)),e.appendChild(s)}),this.element.appendChild(e),this._indicators=e}_updateState(e=null){const t=this.options;if("fade"===t.animation?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):"crossfade"===t.animation?null===e||e===this._currentIndex?this._slides.forEach((e,t)=>{const n=t===this._currentIndex;e.style.position=n?"relative":"absolute",e.style.opacity=n?"1":"0",e.style.zIndex=n?"1":"0"}):this._applyCrossfade(e,this._currentIndex):this._track&&(this._track.style.transform=`translateX(-${100*this._currentIndex}%)`),this._indicators){this._indicators.querySelectorAll(".carousel-indicator").forEach((e,t)=>{e.style.background=t===this._currentIndex?"rgba(255,255,255,1)":"rgba(255,255,255,0.5)",e.style.transform=t===this._currentIndex?"scale(1.2)":"scale(1)"})}!t.loop&&this._prevBtn&&this._nextBtn&&(this._prevBtn.style.opacity=0===this._currentIndex?"0.3":"1",this._prevBtn.style.pointerEvents=0===this._currentIndex?"none":"auto",this._nextBtn.style.opacity=this._currentIndex===this._slides.length-1?"0.3":"1",this._nextBtn.style.pointerEvents=this._currentIndex===this._slides.length-1?"none":"auto")}_applyCrossfade(e,t){const n=this._slides[e],s=this._slides[t];s.style.position="absolute",s.style.opacity="0",s.style.zIndex="2",n.style.position="relative",n.style.opacity="1",n.style.zIndex="1",this._slides.forEach((n,s)=>{s!==e&&s!==t&&(n.style.position="absolute",n.style.opacity="0",n.style.zIndex="0")}),s.offsetWidth,requestAnimationFrame(()=>{s.style.opacity="1",n.style.opacity="0"}),this._crossfadeSwapTimer&&clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=setTimeout(()=>{s.style.position="relative",s.style.zIndex="1",n.style.position="absolute",n.style.zIndex="0",this._crossfadeSwapTimer=null},this.options.animationDuration)}_startAutoplay(){this._autoplayTimer||(this._autoplayTimer=setInterval(()=>{this.next()},this.options.interval))}_stopAutoplay(){this._autoplayTimer&&(clearInterval(this._autoplayTimer),this._autoplayTimer=null)}goTo(e){if(this._isAnimating)return this;const t=this.options,n=this._currentIndex,s=this._slides.length-1;if(t.loop)e<0&&(e=s),e>s&&(e=0);else if(e<0||e>s)return this;return e===this._currentIndex||(this._isAnimating=!0,this._currentIndex=e,this._updateState(n),setTimeout(()=>{this._isAnimating=!1},t.animationDuration),t.onChange&&t.onChange({index:e,oldIndex:n,slide:this._slides[e]})),this}next(){return this.goTo(this._currentIndex+1)}prev(){return this.goTo(this._currentIndex-1)}play(){return this._startAutoplay(),this}pause(){return this._stopAutoplay(),this}getIndex(){return this._currentIndex}getSlide(e=this._currentIndex){return this._slides[e]}destroy(){super.destroy(),this._stopAutoplay(),this._heightObserver?.disconnect(),this.element&&this._images&&(this._wasSized||this.element.classList.remove("carousel-sized"),this._originalHeight?this.element.style.setProperty("--dm-carousel-height",this._originalHeight,this._originalHeightPriority):this.element.style.removeProperty("--dm-carousel-height")),this._crossfadeSwapTimer&&(clearTimeout(this._crossfadeSwapTimer),this._crossfadeSwapTimer=null)}}class Vt extends h{static defaults={message:'We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies.',acceptAllText:"Accept All",rejectAllText:"Reject All",customizeText:"Customize",savePreferencesText:"Save Preferences",privacyPolicyText:"Privacy Policy",privacyPolicyUrl:"/privacy-policy",cookiePolicyText:"Cookie Policy",cookiePolicyUrl:null,categories:{necessary:{label:"Necessary Cookies",description:"These cookies are essential for the website to function properly.",required:!0},functional:{label:"Functional Cookies",description:"These cookies enable personalized features and functionality.",required:!1},analytics:{label:"Analytics Cookies",description:"These cookies help us understand how visitors interact with our website.",required:!1},marketing:{label:"Marketing Cookies",description:"These cookies are used to deliver relevant ads and marketing campaigns.",required:!1}},position:"bottom",theme:"light",layout:"bar",animation:!0,backdrop:!1,autoShow:!0,hideAfterAction:!0,reopenSelector:"[data-cookie-consent-open]",storageKey:"domma-cookie-consent",storageDuration:365,defaultState:"undecided",requireExplicitConsent:!0,consentVersion:"1.0",onVersionMismatch:null,onAccept:null,onReject:null,onCustomize:null,onChange:null,onShow:null,onHide:null};constructor(e={}){super(null,e),this._state=null,this._preferences={},this._customizeModal=null,this._isVisible=!1,this._init()}_init(){this._loadPreferences(),this._createUI(),this._setupEventHandlers(),this.options.autoShow&&!this._hasConsented()&&this.show(),this._setupReopenTriggers()}_loadPreferences(){const e=Domma.storage.get(this.options.storageKey);if(e&&e.timestamp){if((Date.now()-e.timestamp)/864e5<=this.options.storageDuration)return e.version&&e.version!==this.options.consentVersion?(this._state="undecided",this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),void(this.options.onVersionMismatch&&this.options.onVersionMismatch(e.version,this.options.consentVersion))):(this._state=e.state,void(this._preferences=e.preferences||{}))}this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent})}_savePreferences(){Domma.storage.set(this.options.storageKey,{state:this._state,preferences:this._preferences,timestamp:Date.now(),version:this.options.consentVersion})}_hasConsented(){return"accepted"===this._state||"rejected"===this._state||"customized"===this._state}_createUI(){this.element=document.createElement("div"),this.element.className=`dm-cookie-consent dm-cookie-consent-${this.options.position} dm-cookie-consent-${this.options.layout} dm-cookie-consent-${this.options.theme}`,this.element.setAttribute("role","dialog"),this.element.setAttribute("aria-label","Cookie consent"),this.element.style.display="none",this.options.animation&&this.element.classList.add("dm-cookie-consent-animated");let e='<div class="dm-cookie-consent-content">';e+=`<div class="dm-cookie-consent-message">${this.options.message}`;const t=[];this.options.privacyPolicyUrl&&t.push(`<a href="${this.options.privacyPolicyUrl}" target="_blank" rel="noopener">${this.options.privacyPolicyText}</a>`),this.options.cookiePolicyUrl&&t.push(`<a href="${this.options.cookiePolicyUrl}" target="_blank" rel="noopener">${this.options.cookiePolicyText}</a>`),t.length>0&&(e+=` ${t.join(" | ")}`),e+="</div>",e+='<div class="dm-cookie-consent-buttons">',Object.keys(this.options.categories).length>1&&(e+=`<button type="button" class="btn btn-outline dm-cookie-consent-customize">${this.options.customizeText}</button>`),e+=`<button type="button" class="btn btn-outline dm-cookie-consent-reject">${this.options.rejectAllText}</button>`,e+=`<button type="button" class="btn btn-primary dm-cookie-consent-accept">${this.options.acceptAllText}</button>`,e+="</div></div>",this.options.backdrop&&"modal"===this.options.layout&&(e=`<div class="dm-cookie-consent-backdrop"></div>${e}`),this.element.innerHTML=e,document.body.appendChild(this.element)}_createCustomizeModal(){if(this._customizeModal)return;this._customizeModal=document.createElement("div"),this._customizeModal.className="dm-cookie-consent-modal",this._customizeModal.setAttribute("role","dialog"),this._customizeModal.setAttribute("aria-label","Customize cookie preferences");let e='<div class="dm-cookie-consent-modal-content">';e+='<div class="dm-cookie-consent-modal-header">',e+="<h3>Cookie Preferences</h3>",e+='<button type="button" class="dm-cookie-consent-modal-close" aria-label="Close">×</button>',e+="</div>",e+='<div class="dm-cookie-consent-modal-body">',Object.entries(this.options.categories).forEach(([t,n])=>{const s=this._preferences[t]?"checked":"",o=n.required?"disabled":"";e+='<div class="dm-cookie-consent-category">',e+='<label class="dm-cookie-consent-category-label">',e+=`<input type="checkbox" class="dm-cookie-consent-category-toggle" data-category="${t}" ${s} ${o}>`,e+='<div class="dm-cookie-consent-category-info">',e+=`<div class="dm-cookie-consent-category-name">${n.label}`,n.required&&(e+=' <span class="dm-cookie-consent-required">(Required)</span>'),e+="</div>",e+=`<div class="dm-cookie-consent-category-description">${n.description}</div>`,e+="</div></label></div>"}),e+="</div>",e+='<div class="dm-cookie-consent-modal-footer">',e+='<button type="button" class="btn btn-outline dm-cookie-consent-modal-cancel">Cancel</button>',e+=`<button type="button" class="btn btn-primary dm-cookie-consent-modal-save">${this.options.savePreferencesText}</button>`,e+="</div></div>",e=`<div class="dm-cookie-consent-modal-backdrop"></div>${e}`,this._customizeModal.innerHTML=e,document.body.appendChild(this._customizeModal),this._setupModalHandlers()}_setupEventHandlers(){const e=this.element.querySelector(".dm-cookie-consent-accept");e&&e.addEventListener("click",()=>this.accept());const t=this.element.querySelector(".dm-cookie-consent-reject");t&&t.addEventListener("click",()=>this.reject());const n=this.element.querySelector(".dm-cookie-consent-customize");if(n&&n.addEventListener("click",()=>this.showCustomize()),this.options.backdrop&&"modal"===this.options.layout){const e=this.element.querySelector(".dm-cookie-consent-backdrop");e&&e.addEventListener("click",()=>{this.options.requireExplicitConsent||this.hide()})}}_setupModalHandlers(){if(!this._customizeModal)return;const e=this._customizeModal.querySelector(".dm-cookie-consent-modal-close");e&&e.addEventListener("click",()=>this.hideCustomize());const t=this._customizeModal.querySelector(".dm-cookie-consent-modal-cancel");t&&t.addEventListener("click",()=>this.hideCustomize());const n=this._customizeModal.querySelector(".dm-cookie-consent-modal-save");n&&n.addEventListener("click",()=>this.saveCustomPreferences());const s=this._customizeModal.querySelector(".dm-cookie-consent-modal-backdrop");s&&s.addEventListener("click",()=>this.hideCustomize())}_setupReopenTriggers(){this.options.reopenSelector&&document.addEventListener("click",e=>{e.target.closest(this.options.reopenSelector)&&(e.preventDefault(),this.show())})}show(){this._isVisible||(this.element.style.display="",this.options.animation?requestAnimationFrame(()=>{this.element.classList.add("dm-cookie-consent-visible")}):this.element.classList.add("dm-cookie-consent-visible"),this._isVisible=!0,this.options.onShow&&this.options.onShow.call(this))}hide(){if(!this._isVisible)return;const e=()=>{this.element.style.display="none",this._isVisible=!1,this.options.onHide&&this.options.onHide.call(this)};this.options.animation?(this.element.classList.remove("dm-cookie-consent-visible"),setTimeout(e,300)):(this.element.classList.remove("dm-cookie-consent-visible"),e())}accept(){Object.keys(this.options.categories).forEach(e=>{this._preferences[e]=!0}),this._state="accepted",this._savePreferences(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}reject(){Object.entries(this.options.categories).forEach(([e,t])=>{this._preferences[e]=t.required}),this._state="rejected",this._savePreferences(),this.options.onReject&&this.options.onReject.call(this),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}showCustomize(){this._createCustomizeModal(),this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;e.checked=this._preferences[t]||!1}),this._customizeModal.style.display="flex",this.options.animation?requestAnimationFrame(()=>{this._customizeModal.classList.add("dm-cookie-consent-modal-visible")}):this._customizeModal.classList.add("dm-cookie-consent-modal-visible"),this.options.onCustomize&&this.options.onCustomize.call(this,this._preferences)}hideCustomize(){if(!this._customizeModal)return;const e=()=>{this._customizeModal.style.display="none"};this.options.animation?(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),setTimeout(e,300)):(this._customizeModal.classList.remove("dm-cookie-consent-modal-visible"),e())}saveCustomPreferences(){this._customizeModal.querySelectorAll(".dm-cookie-consent-category-toggle").forEach(e=>{const t=e.dataset.category;this._preferences[t]=e.checked}),this._state="customized",this._savePreferences(),this.hideCustomize(),this.options.onAccept&&this.options.onAccept.call(this,this._preferences),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences),this.options.hideAfterAction&&this.hide()}getState(){return this._state}getPreferences(){return{...this._preferences}}isAccepted(e=null){return e?!0===this._preferences[e]:"accepted"===this._state||"customized"===this._state}reset(){this._state=this.options.defaultState,this._preferences={},Object.keys(this.options.categories).forEach(e=>{const t=this.options.categories[e];this._preferences[e]=t.required||!this.options.requireExplicitConsent}),Domma.storage.remove(this.options.storageKey),this.options.onChange&&this.options.onChange.call(this,this._state,this._preferences)}destroy(){this.hide(),this.hideCustomize(),this.element&&(this.element.remove(),this.element=null),this._customizeModal&&(this._customizeModal.remove(),this._customizeModal=null)}}const Ft={_container:null,_stack:[],_topHandler(){for(let e=this._stack.length-1;e>=0;e--)if(this._stack[e].overlay.isConnected)return this._stack[e].handler;return null},_defaults:{title:"",message:"",confirmText:"OK",cancelText:"Cancel",inputPlaceholder:"",inputValue:"",inputType:"text",animation:!0,backdrop:!0,backdropClose:!1,keyboard:!0,danger:!1,className:""},_ensureContainer(){return this._container&&this._container.isConnected||(this._container=document.createElement("div"),this._container.className="dm-dialog-container",document.body.appendChild(this._container)),this._container},_createDialog(e,t){const n={...this._defaults,...t},s=this._ensureContainer();return new Promise(t=>{const o=document.createElement("div");o.className="dm-dialog-overlay"+(n.animation?" dm-dialog-animate":"");const i=document.createElement("div");i.className=`dm-dialog dm-dialog-${e}${n.className?" "+n.className:""}`,i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true");let a='<div class="dm-dialog-content">';if(n.title){a+=`<div class="dm-dialog-header"><h3 class="dm-dialog-title">${r.sanitise(String(n.title),{preset:"basic"})}</h3></div>`}if(a+='<div class="dm-dialog-body">',n.message){a+=`<p class="dm-dialog-message">${r.sanitise(String(n.message),{preset:"basic"})}</p>`}if("prompt"===e){const e=r.sanitise(String(n.inputPlaceholder||""),{preset:"basic"}),t=r.sanitise(String(n.inputValue||""),{preset:"basic"});a+=`<input type="${n.inputType}" class="dm-dialog-input form-input" placeholder="${e}" value="${t}">`}a+="</div>",a+='<div class="dm-dialog-footer">',"confirm"!==e&&"prompt"!==e||(a+=`<button type="button" class="btn btn-outline dm-dialog-cancel">${n.cancelText}</button>`);a+=`<button type="button" class="btn ${n.danger?"btn-danger":"btn-primary"} dm-dialog-confirm">${n.confirmText}</button>`,a+="</div></div>",i.innerHTML=a,o.appendChild(i),s.appendChild(o);const l=i.querySelector(".dm-dialog-confirm"),d=i.querySelector(".dm-dialog-cancel"),c=i.querySelector(".dm-dialog-input"),h=c||n.danger&&d||l;setTimeout(()=>h?.focus(),50),c&&c.select();let u=!1,p=()=>{};const m=e=>{u||(u=!0,p(),n.animation?(o.classList.add("dm-dialog-closing"),setTimeout(()=>{o.remove(),t(e)},200)):(o.remove(),t(e)))},f=()=>{m("prompt"===e?c.value:"confirm"===e||void 0)},g=()=>{m("prompt"===e&&null)};l.addEventListener("click",f),d?.addEventListener("click",g),n.backdropClose&&o.addEventListener("click",e=>{e.target===o&&g()});const v=new Set;i.addEventListener("keydown",e=>{e.repeat||v.add(e.key),"Enter"!==e.key&&" "!==e.key||!e.repeat||v.has(e.key)||e.preventDefault()});const b=e=>{e.preventDefault(),e.stopImmediatePropagation()},y=t=>{if(Ft._topHandler()===y)if(t.repeat||v.add(t.key),"Escape"===t.key)b(t),n.keyboard&&g();else if("Enter"===t.key&&n.keyboard){if(t.repeat&&!v.has("Enter"))return;if("function"==typeof t.target?.closest&&t.target.closest("button")&&i.contains(t.target))return;if(n.danger&&"confirm"===e)return void b(t);"prompt"===e&&t.target!==c||(b(t),f())}};Ft._stack.push({overlay:o,handler:y});let _=!1;const k=setTimeout(()=>{u||(_=!0,window.addEventListener("keydown",y,!0))},0);p=()=>{clearTimeout(k);const e=Ft._stack.findIndex(e=>e.handler===y);-1!==e&&Ft._stack.splice(e,1),_&&window.removeEventListener("keydown",y,!0)}})},alert(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("alert",{...t,message:e})},confirm(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("confirm",{...t,message:e})},prompt(e,t={}){return"object"==typeof e&&(e=(t=e).message||""),this._createDialog("prompt",{...t,message:e})}};class Rt extends h{static defaults={mode:"single",activeClass:"active",allowEmpty:!1,onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.buttons=Array.from(this.element.querySelectorAll(".btn")),this.buttons.forEach((e,t)=>{e.dataset.index=t,this._addEventListener(e,"click",n=>{n.preventDefault(),this._handleClick(e,t)})}))}_handleClick(e,t){const n=e.classList.contains(this.options.activeClass);"single"===this.options.mode?n&&this.options.allowEmpty?this.options.allowEmpty&&e.classList.remove(this.options.activeClass):(this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),e.classList.add(this.options.activeClass)):e.classList.toggle(this.options.activeClass),this.options.onChange&&this.options.onChange(this.getValue(),t,e)}getValue(){const e=this.buttons.map((e,t)=>e.classList.contains(this.options.activeClass)?t:-1).filter(e=>-1!==e);return"single"===this.options.mode?e.length>0?e[0]:null:e}getActive(){const e=this.buttons.filter(e=>e.classList.contains(this.options.activeClass));return"single"===this.options.mode?e.length>0?e[0]:null:e}setValue(e){const t=Array.isArray(e)?e:[e];return this.buttons.forEach((e,n)=>{t.includes(n)?e.classList.add(this.options.activeClass):e.classList.remove(this.options.activeClass)}),this}toggle(e){return e>=0&&e<this.buttons.length&&this._handleClick(this.buttons[e],e),this}selectAll(){return"multiple"===this.options.mode&&(this.buttons.forEach(e=>e.classList.add(this.options.activeClass)),this.options.onChange&&this.options.onChange(this.getValue(),-1,null)),this}deselectAll(){return this.buttons.forEach(e=>e.classList.remove(this.options.activeClass)),this.options.onChange&&this.options.onChange(this.getValue(),-1,null),this}}class qt extends h{static defaults={items:[],separator:"/",homeIcon:!1,responsive:!0,onChange:null};static separators={"/":"/",">":"›","→":"→",chevron:'<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18l6-6-6-6"/></svg>'};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_getSeparatorHTML(){const{separator:e}=this.options;return qt.separators[e]||e}_render(){const{items:e,homeIcon:t,responsive:n}=this.options,s=this._getSeparatorHTML();this.element.className="dm-breadcrumbs",n&&this.element.classList.add("dm-breadcrumbs-responsive"),this.element.setAttribute("aria-label","Breadcrumb");let o="";e.forEach((n,i)=>{const r=i===e.length-1,a=0===i;i>0&&(o+=`<span class="dm-breadcrumbs-separator" aria-hidden="true">${s}</span>`);let l=n.text||n;a&&t&&(l=`<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="vertical-align: middle; margin-right: 4px;"><path d="M3 9l9-7 9 7v11a2 2 0 01-2 2H5a2 2 0 01-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/></svg>${l}`),r||n.active?o+=`<span class="dm-breadcrumbs-item active" aria-current="page">${l}</span>`:o+=`<a href="${n.url||"#"}" class="dm-breadcrumbs-item dm-breadcrumbs-link" data-index="${i}">${l}</a>`}),this.element.innerHTML=o,this._injectStyles()}_injectStyles(){}_bindEvents(){this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-breadcrumbs-link");if(t){const n=parseInt(t.dataset.index,10);this.options.onChange&&(e.preventDefault(),this.options.onChange(this.options.items[n],n,e))}})}setItems(e){return this.options.items=e,this._render(),this}addItem(e){if(this.options.items.length>0){const e=this.options.items[this.options.items.length-1];"object"==typeof e&&(e.active=!1)}return this.options.items.push(e),this._render(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render()),this}getItems(){return[...this.options.items]}}class Ut extends h{static defaults={brand:null,items:[],position:"static",variant:"light",collapsible:!0,collapseAt:993,appearOnHover:!1,hoverCloseDelay:250,actions:[],onItemClick:null};constructor(e,t={}){super(e,t),this._isCollapsed=!0,this._pinned=null,this._hoverSuppressed=null,this._navCloseTimer=null,this._init()}_init(){this.element&&(this._render(),this._bindEvents())}_render(){const{brand:e,items:t,position:n,variant:s,collapsible:o,actions:i}=this.options;this.element.className="navbar",this.element.classList.add(`navbar-${s}`),"static"!==n&&this.element.classList.add(`navbar-${n}`),this.element.setAttribute("role","navigation");let r='<div class="navbar-container">';e&&(r+='<div class="navbar-brand">',e.url&&(r+=`<a href="${e.url}" class="navbar-brand-link">`),e.html?r+=e.html:(e.logo&&(r+=`<img src="${e.logo}" alt="${e.text||""}" class="navbar-logo">`),e.text&&(r+=`<span class="navbar-brand-text">${e.text}</span>`)),e.url&&(r+="</a>"),r+="</div>"),o&&(r+='\n <button class="navbar-toggle" aria-label="Toggle navigation" aria-expanded="false">\n <span class="navbar-toggle-icon"></span>\n </button>\n '),r+='<div class="navbar-collapse">',r+='<ul class="navbar-nav">',r+=this._renderItems(t,0,""),r+="</ul>",i&&i.length>0&&(r+='<div class="navbar-actions">',i.forEach((e,t)=>{const n=e.variant||"primary",s=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";r+=`<a href="${e.url||"#"}" class="navbar-action dm-btn dm-btn-${n}" data-action="${t}">${s}${e.text}</a>`}),r+="</div>"),r+="</div>",r+="</div>",this.element.innerHTML=r,this._toggle=this.element.querySelector(".navbar-toggle"),this._collapse=this.element.querySelector(".navbar-collapse"),this._scanIcons()}_renderItems(e,t,n){let s="";return(e||[]).forEach((e,o)=>{const i=""===n?`${o}`:`${n}.${o}`;if(e.divider)return void(s+='<li class="navbar-dropdown-divider"></li>');const r=e.items&&e.items.length>0,a=0===t?18:16,l=e.icon?`<span data-icon="${e.icon}" data-size="${a}" style="margin-right: 6px; vertical-align: middle;"></span>`:"",d='<svg class="navbar-caret" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9l6 6 6-6"/></svg>';if(r)0===t?(s+='<li class="navbar-item navbar-dropdown">',s+=`<button class="navbar-link navbar-dropdown-toggle" data-index="${o}" data-path="${i}">${l}${e.text}${d}</button>`,s+='<ul class="navbar-dropdown-menu">'):(s+='<li class="navbar-item navbar-dropdown navbar-dropdown-sub">',s+=`<button class="navbar-dropdown-toggle navbar-submenu-toggle" data-path="${i}">${l}${e.text}${d}</button>`,s+='<ul class="navbar-dropdown-menu navbar-dropdown-submenu">'),s+=this._renderItems(e.items,t+1,i),s+="</ul></li>";else{const r=e.url||"#",a=e.external||r.startsWith("http://")||r.startsWith("https://")?' target="_blank" rel="noopener noreferrer"':"";if(0===t)s+=`<li class="navbar-item"><a href="${r}" class="navbar-link${e.active?" active":""}" data-index="${o}" data-path="${i}"${a}>${l}${e.text}</a></li>`;else{s+=`<li><a href="${r}" class="navbar-dropdown-item" data-path="${i}"${1===t?` data-index="${n}" data-subindex="${o}"`:""}${a}>${l}${e.text}</a></li>`}}}),s}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",()=>{this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-link:not(.navbar-dropdown-toggle)");if(t){const n=parseInt(t.dataset.index,10);this.options.onItemClick&&(e.preventDefault(),this.options.onItemClick(this.options.items[n],n,e)),window.innerWidth<this.options.collapseAt&&this.collapse()}const n=e.target.closest(".navbar-dropdown-item");if(n&&this.options.onItemClick){e.preventDefault();const t=n.dataset.path,s=t?t.split(".").map(e=>parseInt(e,10)):[parseInt(n.dataset.index,10),parseInt(n.dataset.subindex,10)];let o={items:this.options.items};for(let e=0;e<s.length-1;e++)o=o.items[s[e]];const i=s[s.length-1],r=o.items[i],a=o.items===this.options.items?null:o;this.options.onItemClick(r,i,e,a)}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".navbar-dropdown-toggle");if(!t)return;const n=t.closest(".navbar-dropdown");if(this._pinned===n)return this._pinned=null,this._hoverSuppressed=n,void this._reconcileDropdowns(null,!0);this._pinned=n,this._hoverSuppressed=null,this._reconcileDropdowns(n)}),this._addEventListener(document,"click",e=>{e.target.closest(".navbar-dropdown")||(this._pinned=null,this._hoverSuppressed=null,this._reconcileDropdowns(null,!0))}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&(this._collapse?.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false"))}),this.options.appearOnHover&&(this._addEventListener(this.element,"mouseover",e=>{window.innerWidth<this.options.collapseAt||e.target.closest(".navbar-dropdown")&&(this._hoverSuppressed&&this._hoverSuppressed.contains(e.target)||(this._hoverSuppressed=null,clearTimeout(this._navCloseTimer),this._reconcileDropdowns(e.target)))}),this._addEventListener(this.element,"mouseout",e=>{window.innerWidth<this.options.collapseAt||e.relatedTarget&&this.element.contains(e.relatedTarget)||(clearTimeout(this._navCloseTimer),this._navCloseTimer=setTimeout(()=>{this._reconcileDropdowns(null)},this.options.hoverCloseDelay))}))}_reconcileDropdowns(e,t=!1){const n=new Set,s=e=>{for(let t=e;t&&t!==this.element;t=t.parentElement)t.classList&&t.classList.contains("navbar-dropdown")&&n.add(t)};s(e),!t&&this._pinned&&s(this._pinned),this.element.querySelectorAll(".navbar-dropdown").forEach(e=>{n.has(e)?e.classList.contains("open")||(e.classList.add("open"),this._positionMenu(e)):e.classList.remove("open")})}_positionMenu(e){if(window.innerWidth<this.options.collapseAt)return;const t=e.querySelector(":scope > .navbar-dropdown-menu");if(!t)return;const n=t.classList.contains("navbar-dropdown-submenu");t.classList.remove("navbar-dropdown-flip-x","navbar-dropdown-flip-end"),t.style.top="",t.style.maxHeight="",t.style.overflowY="",requestAnimationFrame(()=>{let e=t.getBoundingClientRect();if(!e.width&&!e.height)return;e.right>window.innerWidth-8&&(t.classList.add(n?"navbar-dropdown-flip-x":"navbar-dropdown-flip-end"),e=t.getBoundingClientRect());const s=e.bottom-(window.innerHeight-8);s>0&&(n?t.style.top=-Math.min(Math.ceil(s),Math.floor(e.top-8))+"px":t.querySelector(".navbar-dropdown-sub")||(t.style.maxHeight=Math.max(120,Math.floor(window.innerHeight-e.top-8))+"px",t.style.overflowY="auto"))})}setActive(e){return this.options.items.forEach((t,n)=>{t.active=n===e}),this._render(),this}setItems(e){return this.options.items=e,this._render(),this}expand(){return this._collapse&&(this._collapse.classList.add("show"),this._isCollapsed=!1,this._toggle&&this._toggle.setAttribute("aria-expanded","true")),this}collapse(){return this._collapse&&(this._collapse.classList.remove("show"),this._isCollapsed=!0,this._toggle&&this._toggle.setAttribute("aria-expanded","false")),this}toggle(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}destroy(){clearTimeout(this._navCloseTimer),this._pinned=null,this._hoverSuppressed=null,super.destroy()}}class Kt extends h{static defaults={position:"left",fixed:!0,width:"250px",top:"0",header:null,items:[],footer:null,variant:"dark",collapsible:!0,collapseAt:768,activeSection:null,expandedSections:[],persistExpanded:!1,persistKey:null,animationDuration:200,push:!0,contentSelector:".main-content",scrollSpy:!1,scrollSpyOffset:"-100px 0px -50% 0px",scrollSpyThreshold:.5,floating:!1,customContent:null,collapsibleDesktop:!1,collapsedWidth:"60px",persistCollapsed:!1,persistCollapseKey:null,onItemClick:null,onToggle:null,onExpand:null,onCollapse:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._isCollapsed=!1,this._expandedItems=new Set(this.options.expandedSections||[]),this._init()}_init(){this.element&&(this._loadExpandedState(),this._loadCollapsedState(),this._findContentElement(),this._render(),this._bindEvents(),this._scanIcons(),this._handleInitialPushState(),this.options.scrollSpy&&this._initScrollSpy(),this._isCollapsed&&this.options.collapsibleDesktop&&setTimeout(()=>{this._createFloatingToggle()},0))}_findContentElement(){this.options.push&&this.options.contentSelector&&(this._contentElement=document.querySelector(this.options.contentSelector),this._contentElement||console.warn(`[Sidebar] Push mode enabled but content element "${this.options.contentSelector}" not found`))}_handleInitialPushState(){if(this.options.push&&this._contentElement){const e=window.innerWidth>=this.options.collapseAt;(!this.options.collapsible||e)&&this._applyPush()}}_render(){const{position:e,fixed:t,width:n,top:s,header:o,items:i,footer:r,variant:a,collapsible:l,collapsibleDesktop:d,collapsedWidth:c}=this.options;this.element.className="sidebar",this.element.classList.add(`sidebar-${a}`),this.element.classList.add(`sidebar-${e}`),t&&this.element.classList.add("sidebar-fixed"),d&&this.element.classList.add("sidebar-desktop-collapsible"),this._isCollapsed&&d&&this.element.classList.add("sidebar-collapsed"),n&&(this.element.style.setProperty("--sidebar-width",n),this.element.style.width=n),c&&this.element.style.setProperty("--sidebar-collapsed-width",c),s&&t&&(this.element.style.top=s,this.element.style.height=`calc(100vh - ${s})`),this.element.setAttribute("role","navigation"),this.element.setAttribute("aria-label","Sidebar navigation");let h="";if(o){if(h+='<div class="sidebar-header">',o.icon&&(h+=`<span class="sidebar-header-icon" data-icon="${o.icon}" data-size="24"></span>`),o.title&&(h+=`<h3 class="sidebar-header-title">${o.title}</h3>`),l&&!1!==o.toggle){const e="right"===this.options.position?"chevron-right":"chevron-left",t=this._isCollapsed&&d?"chevron-right":e;h+=`\n <button class="sidebar-toggle-btn" aria-label="Toggle sidebar" aria-expanded="${this._isOpen}">\n <span class="sidebar-toggle-icon" data-icon="${t}" data-size="20"></span>\n </button>\n `}h+="</div>"}h+='<nav class="sidebar-nav">',h+=this._renderItems(i),h+="</nav>",r&&(h+='<div class="sidebar-footer">',r.html?h+=r.html:r.text&&(h+=`<p class="sidebar-footer-text">${r.text}</p>`),h+="</div>"),this.element.innerHTML=h,this._toggle=this.element.querySelector(".sidebar-toggle-btn"),this._nav=this.element.querySelector(".sidebar-nav"),this._overlay=null,this._floatingToggle=null}_renderItems(e,t=0,n=""){if(!e||0===e.length)return"";let s=`<ul class="sidebar-menu" data-depth="${t}">`;return e.forEach((e,o)=>{const i=n?`${n}.${o}`:`${o}`;if(e.divider)return void(s+='<li class="sidebar-divider"></li>');if(e.heading)return void(s+=`<li class="sidebar-heading">${e.heading}</li>`);const r=e.items&&e.items.length>0,a=this._expandedItems.has(i),l=e.section===this.options.activeSection;s+=`<li class="sidebar-item ${r?"has-children":""} ${a?"open":""}" data-path="${i}" data-depth="${t}">`,s+=r?`\n <button class="sidebar-link sidebar-link-toggle ${l?"active":""}" data-path="${i}">\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n <svg class="sidebar-chevron" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">\n <path d="M9 18l6-6-6-6"/>\n </svg>\n </button>\n `:`\n <a href="${e.url||"#"}" class="sidebar-link ${l?"active":""}" data-path="${i}" ${e.section?`data-section="${e.section}"`:""}>\n ${e.icon?`<span class="sidebar-icon" data-icon="${e.icon}" data-size="18"></span>`:""}\n <span class="sidebar-text">${e.text}</span>\n ${e.badge?`<span class="sidebar-badge">${e.badge}</span>`:""}\n </a>\n `,r&&(s+=`<div class="sidebar-submenu" ${a?'style="display: block;"':""}>`,s+=this._renderItems(e.items,t+1,i),s+="</div>"),s+="</li>"}),s+="</ul>",s}_bindEvents(){this._toggle&&this._addEventListener(this._toggle,"click",e=>{e.stopPropagation();window.innerWidth>=this.options.collapseAt&&this.options.collapsibleDesktop?this.toggleCollapse():this.toggle()}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link:not(.sidebar-link-toggle)");if(t){const n=t.dataset.path,s=this._getItemByPath(n);s&&s.section&&this.setActive(s.section),this.options.onItemClick&&this.options.onItemClick(s,n,e),window.innerWidth<this.options.collapseAt&&this.close()}}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".sidebar-link-toggle");if(t){e.preventDefault();const n=t.dataset.path,s=t.closest(".sidebar-item");this._toggleSubmenu(s,n)}}),this._addEventListener(window,"resize",()=>{window.innerWidth>=this.options.collapseAt&&this.close()}),this._addEventListener(document,"click",e=>{this._isOpen&&!this.element.contains(e.target)&&window.innerWidth<this.options.collapseAt&&this.close()})}_toggleSubmenu(e,t){const n=e.querySelector(":scope > .sidebar-submenu");if(!n)return;const s=e.classList.contains("open"),o=this._getItemByPath(t),i=parseInt(e.dataset.depth,10);s?(this._collapseSubmenu(e,n),this._expandedItems.delete(t),this.options.onCollapse&&this.options.onCollapse(o,i)):(this._expandSubmenu(e,n),this._expandedItems.add(t),this.options.onExpand&&this.options.onExpand(o,i)),this._saveExpandedState()}_expandSubmenu(e,t){e.classList.add("open"),t.style.display="block";const n=t.scrollHeight;t.style.height="0",t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height=`${n}px`,setTimeout(()=>{t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_collapseSubmenu(e,t){const n=t.scrollHeight;t.style.height=`${n}px`,t.style.overflow="hidden",requestAnimationFrame(()=>{t.style.transition=`height ${this.options.animationDuration}ms ease`,t.style.height="0",setTimeout(()=>{e.classList.remove("open"),t.style.display="",t.style.height="",t.style.overflow="",t.style.transition=""},this.options.animationDuration)})}_getItemByPath(e){if(!e)return null;const t=e.split(".").map(e=>parseInt(e,10));let n=this.options.items;for(const e of t){if(!n||!n[e])return null;n=n[e],n.items&&t.indexOf(e)<t.length-1&&(n=n.items)}return n}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}_loadExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=localStorage.getItem(e);if(t){const e=JSON.parse(t);this._expandedItems=new Set(e)}}catch(e){console.warn("Failed to load sidebar expanded state:",e)}}_saveExpandedState(){if(this.options.persistExpanded&&this.options.persistKey)try{const e=`domma:sidebar:expanded:${this.options.persistKey}`,t=Array.from(this._expandedItems);localStorage.setItem(e,JSON.stringify(t))}catch(e){console.warn("Failed to save sidebar expanded state:",e)}}_loadCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`,t=localStorage.getItem(e);null!==t&&(this._isCollapsed="true"===t)}catch(e){console.warn("Failed to load sidebar collapsed state:",e)}}_saveCollapsedState(){if(this.options.persistCollapsed&&this.options.persistCollapseKey)try{const e=`domma:sidebar:collapsed:${this.options.persistCollapseKey}`;localStorage.setItem(e,this._isCollapsed.toString())}catch(e){console.warn("Failed to save sidebar collapsed state:",e)}}_initScrollSpy(){const e=[];this.element.querySelectorAll(".sidebar-link[data-section]").forEach(t=>{const n=t.dataset.section,s=document.getElementById(n);s&&e.push({element:s,id:n,link:t})}),0!==e.length&&(this._scrollSpyObserver=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=e.find(e=>e.element===t.target);n&&this.setActive(n.id)}})},{threshold:this.options.scrollSpyThreshold,rootMargin:this.options.scrollSpyOffset}),e.forEach(({element:e})=>{this._scrollSpyObserver.observe(e)}))}_createOverlay(){this._overlay||(this._overlay=document.createElement("div"),this._overlay.className="sidebar-overlay",document.body.appendChild(this._overlay),this._addEventListener(this._overlay,"click",()=>{this.close()}))}_removeOverlay(){this._overlay&&(this._overlay.remove(),this._overlay=null)}_applyPush(){if(!this.options.push||!this._contentElement)return;const e="right"===this.options.position?"sidebar-push-active-right":"sidebar-push-active";this._contentElement.classList.add(e),this._contentElement.style.setProperty("--sidebar-push-width",this.options.width)}_removePush(){this.options.push&&this._contentElement&&this._contentElement.classList.remove("sidebar-push-active","sidebar-push-active-right")}open(){return this._isOpen||(this._isOpen=!0,this.element.classList.add("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","true"),window.innerWidth<this.options.collapseAt&&this._createOverlay(),this._applyPush(),this.options.onToggle&&this.options.onToggle(!0)),this}close(){return this._isOpen?(this._isOpen=!1,this.element.classList.remove("open"),this._toggle&&this._toggle.setAttribute("aria-expanded","false"),this._removeOverlay(),this._removePush(),this.options.onToggle&&this.options.onToggle(!1),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}collapse(){return!this.options.collapsibleDesktop||this._isCollapsed||(this._isCollapsed=!0,this.element.classList.add("sidebar-collapsed"),this._saveCollapsedState(),this._createFloatingToggle(),this._removePush(),this.options.onCollapse&&this.options.onCollapse()),this}expand(){if(!this.options.collapsibleDesktop||!this._isCollapsed)return this;this._isCollapsed=!1,this.element.classList.remove("sidebar-collapsed"),this._saveCollapsedState(),this._removeFloatingToggle(),this._applyPush();const e="right"===this.options.position?"chevron-right":"chevron-left";return this._updateToggleIcon(e),this.options.onExpand&&this.options.onExpand(),this}_createFloatingToggle(){if(this._floatingToggle)return;this._floatingToggle=document.createElement("button"),this._floatingToggle.className="sidebar-floating-toggle show","right"===this.options.position&&this._floatingToggle.classList.add("right");const e="right"===this.options.position?"chevron-left":"chevron-right";this._floatingToggle.innerHTML=`<span data-icon="${e}" data-size="20"></span>`,this._floatingToggle.addEventListener("click",()=>{this.expand()}),document.body.appendChild(this._floatingToggle),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._floatingToggle)}_removeFloatingToggle(){this._floatingToggle&&(this._floatingToggle.remove(),this._floatingToggle=null)}_updateToggleIcon(e){if(!this._toggle)return;const t=this._toggle.querySelector(".sidebar-toggle-icon");t&&(t.setAttribute("data-icon",e),void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this._toggle))}destroy(){this._removeFloatingToggle(),super.destroy()}toggleCollapse(){return this._isCollapsed?this.expand():this.collapse()}isCollapsed(){return this._isCollapsed}setActive(e){return this.options.activeSection=e,this.element.querySelectorAll(".sidebar-link").forEach(t=>{t.dataset.section===e?t.classList.add("active"):t.classList.remove("active")}),this}setItems(e){return this.options.items=e,this._expandedItems.clear(),this._render(),this._bindEvents(),this._scanIcons(),this}addItem(e,t=null){return null===t||t>=this.options.items.length?this.options.items.push(e):this.options.items.splice(t,0,e),this._render(),this._bindEvents(),this._scanIcons(),this}removeItem(e){return e>=0&&e<this.options.items.length&&(this.options.items.splice(e,1),this._render(),this._bindEvents(),this._scanIcons()),this}expandAll(){return this.element.querySelectorAll(".sidebar-item.has-children").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&!e.classList.contains("open")&&(this._expandSubmenu(e,n),this._expandedItems.add(t))}),this._saveExpandedState(),this}collapseAll(){return this.element.querySelectorAll(".sidebar-item.has-children.open").forEach(e=>{const t=e.dataset.path,n=e.querySelector(":scope > .sidebar-submenu");n&&(this._collapseSubmenu(e,n),this._expandedItems.delete(t))}),this._saveExpandedState(),this}destroy(){this._scrollSpyObserver&&(this._scrollSpyObserver.disconnect(),this._scrollSpyObserver=null),this._removeOverlay(),super.destroy()}}class Yt extends h{static defaults={variant:"light",layout:"simple",brand:null,columns:[],links:[],social:[],copyright:null,className:"",position:"static"};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this._render(),this._scanIcons())}_render(){const{variant:e,layout:t,brand:n,columns:s,links:o,social:i,copyright:r,className:a,position:l}=this.options;this.element.className="footer",this.element.classList.add(`footer-${e}`),this.element.classList.add(`footer-${t}`),"static"!==l&&this.element.classList.add(`footer-${l}`),a&&this.element.classList.add(a),this.element.setAttribute("role","contentinfo");let d='<div class="footer-container">';"columns"===t&&s&&s.length>0?d+=this._renderColumnsLayout(n,s,i,r):d+="minimal"===t?this._renderMinimalLayout(r,i):this._renderSimpleLayout(n,o,i,r),d+="</div>",this.element.innerHTML=d}_renderSimpleLayout(e,t,n,s){let o='<div class="footer-simple-content">';return e&&(o+='<div class="footer-brand">',e.url&&(o+=`<a href="${e.url}" class="footer-brand-link">`),e.logo&&(o+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(o+=`<span class="footer-brand-text">${e.text}</span>`),e.url&&(o+="</a>"),o+="</div>"),t&&t.length>0&&(o+='<nav class="footer-nav">',t.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";o+=`<a href="${e.url||"#"}" class="footer-link">${t}${e.text}</a>`}),o+="</nav>"),n&&n.length>0&&(o+=this._renderSocial(n)),o+="</div>",s&&(o+=this._renderCopyright(s)),o}_renderColumnsLayout(e,t,n,s){let o="";return o+='<div class="footer-columns-content">',e&&(o+='<div class="footer-column footer-column-brand">',e.logo&&(o+=`<img src="${e.logo}" alt="${e.text||""}" class="footer-logo">`),e.text&&(o+=`<p class="footer-brand-text">${e.text}</p>`),e.description&&(o+=`<p class="footer-brand-description">${e.description}</p>`),o+="</div>"),t.forEach(e=>{o+='<div class="footer-column">',e.title&&(o+=`<h4 class="footer-column-title">${e.title}</h4>`),e.links&&e.links.length>0&&(o+='<ul class="footer-column-links">',e.links.forEach(e=>{const t=e.icon?`<span data-icon="${e.icon}" data-size="16" style="margin-right: 6px; vertical-align: middle;"></span>`:"";o+=`<li><a href="${e.url||"#"}" class="footer-column-link">${t}${e.text}</a></li>`}),o+="</ul>"),o+="</div>"}),o+="</div>",o+='<div class="footer-bottom">',n&&n.length>0&&(o+=this._renderSocial(n)),s&&(o+=this._renderCopyright(s)),o+="</div>",o}_renderMinimalLayout(e,t){let n='<div class="footer-minimal-content">';return e&&(n+=this._renderCopyright(e)),t&&t.length>0&&(n+=this._renderSocial(t)),n+="</div>",n}_renderSocial(e){let t='<div class="footer-social">';return e.forEach(e=>{t+=`\n <a href="${e.url||"#"}" class="footer-social-link" aria-label="${e.label||e.icon}" target="_blank" rel="noopener noreferrer">\n <span data-icon="${e.icon}" data-size="20"></span>\n </a>\n `}),t+="</div>",t}_renderCopyright(e){return`<div class="footer-copyright">${"string"==typeof e?e:e.text||`© ${e.year||(new Date).getFullYear()} All rights reserved`}</div>`}_scanIcons(){void 0!==window.Domma&&window.Domma.icons&&window.Domma.icons.scan&&window.Domma.icons.scan(this.element)}setBrand(e){return this.options.brand=e,this._render(),this._scanIcons(),this}setLinks(e){return this.options.links=e,this._render(),this._scanIcons(),this}setColumns(e){return this.options.columns=e,this._render(),this._scanIcons(),this}setSocial(e){return this.options.social=e,this._render(),this._scanIcons(),this}setCopyright(e){return this.options.copyright=e,this._render(),this}}class Gt extends h{static defaults={data:[],dataSource:null,minChars:1,maxResults:10,debounce:300,filterFn:null,renderItem:null,highlightMatches:!0,position:"auto",placeholder:"",emptyMessage:"No results found",loadingMessage:"Loading...",caseSensitive:!1,selectOnEnter:!0,clearOnSelect:!1,onSelect:null,onChange:null,onOpen:null,onClose:null,onFilter:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._isOpen=!1,this._activeIndex=-1,this._filteredData=[],this._loading=!1,this._debounceTimer=null,this._dropdown=null,this._list=null,this._loadingEl=null,this._emptyEl=null,this._init();const n=e=>{e!==this.getValue()&&this.setValue(e)};this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)}))}_init(){this.element&&("INPUT"===this.element.tagName?(this.options.placeholder&&this.element.setAttribute("placeholder",this.options.placeholder),this._createDropdown(),this._bindEvents(),this.element.setAttribute("role","combobox"),this.element.setAttribute("aria-autocomplete","list"),this.element.setAttribute("aria-expanded","false"),this.element.setAttribute("aria-controls",this._dropdown.id)):console.error("Autocomplete requires an input element"))}_createDropdown(){let e=this.element.parentElement;e&&e.classList.contains("dm-autocomplete")||(e=document.createElement("div"),e.className="dm-autocomplete",this.element.parentNode.insertBefore(e,this.element),e.appendChild(this.element)),this._dropdown=document.createElement("div"),this._dropdown.className="dm-autocomplete-dropdown",this._dropdown.id=`autocomplete-${Math.random().toString(36).substr(2,9)}`,this._dropdown.setAttribute("role","listbox"),this._dropdown.style.display="none",this._loadingEl=document.createElement("div"),this._loadingEl.className="dm-autocomplete-loading",this._loadingEl.textContent=this.options.loadingMessage,this._loadingEl.style.display="none",this._dropdown.appendChild(this._loadingEl),this._emptyEl=document.createElement("div"),this._emptyEl.className="dm-autocomplete-empty",this._emptyEl.textContent=this.options.emptyMessage,this._emptyEl.style.display="none",this._dropdown.appendChild(this._emptyEl),this._list=document.createElement("ul"),this._list.className="dm-autocomplete-list",this._dropdown.appendChild(this._list),e.appendChild(this._dropdown)}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this.element,"input",e),this._addEventListener(this.element,"keydown",t),this._addEventListener(this.element,"focus",()=>{this.element.value.length>=this.options.minChars&&this._filterData(this.element.value)}),this._addEventListener(this.element,"blur",e=>{setTimeout(()=>{this._dropdown.contains(document.activeElement)||this.close()},200)})}_handleInput(e){const t=e.target.value;this._debounceTimer&&clearTimeout(this._debounceTimer),this.model&&this.modelKey&&this.model.set(this.modelKey,t),this.options.onChange&&this.options.onChange(t,e),t.length<this.options.minChars?this.close():this._debounceTimer=setTimeout(()=>{this._filterData(t)},this.options.debounce)}_handleKeydown(e){if(!this._isOpen)return void("ArrowDown"===e.key&&this.element.value.length>=this.options.minChars&&(e.preventDefault(),this._filterData(this.element.value)));const t=this._list.querySelectorAll(".dm-autocomplete-item");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Enter":e.preventDefault(),this._activeIndex>=0&&this.options.selectOnEnter&&this._selectItem(this._activeIndex);break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this._activeIndex>=0&&(e.preventDefault(),this._selectItem(this._activeIndex)),this.close()}}async _filterData(e){let t=[];if(this.options.dataSource){this._setLoading(!0);try{t=await this.options.dataSource(e)}catch(e){console.error("Autocomplete dataSource error:",e),t=[]}this._setLoading(!1)}else{const n=this.options.filterFn||this._defaultFilter.bind(this);t=this.options.data.filter(t=>n(t,e))}this.options.maxResults&&(t=t.slice(0,this.options.maxResults)),this.options.onFilter&&(t=this.options.onFilter(t,e)||t),this._filteredData=t,this._renderResults(e)}_defaultFilter(e,t){const n="string"==typeof e?e:e.label||e.value||String(e),s=this.options.caseSensitive?t:t.toLowerCase();return(this.options.caseSensitive?n:n.toLowerCase()).includes(s)}_renderResults(e){if(this._list.innerHTML="",this._activeIndex=-1,0===this._filteredData.length)return this._emptyEl.style.display="block",this._list.style.display="none",void this.open();this._emptyEl.style.display="none",this._list.style.display="block",this._filteredData.forEach((t,n)=>{const s=document.createElement("li");if(s.className="dm-autocomplete-item",s.setAttribute("role","option"),s.setAttribute("data-index",n),this.options.renderItem){const n=this.options.renderItem(t,e);s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const n="string"==typeof t?t:t.label||t.value||String(t);this.options.highlightMatches?s.innerHTML=this._highlightMatch(n,e):s.textContent=n}s.addEventListener("click",()=>{this._selectItem(n)}),s.addEventListener("mouseenter",()=>{this._activeIndex=n,this._updateActive()}),this._list.appendChild(s)}),this.open()}_highlightMatch(e,t){if(!t)return e;const n=new RegExp(`(${this._escapeRegex(t)})`,this.options.caseSensitive?"g":"gi");return e.replace(n,'<span class="dm-autocomplete-match">$1</span>')}_escapeRegex(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}_updateActive(){const e=this._list.querySelectorAll(".dm-autocomplete-item");if(e.forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.setAttribute("aria-selected","true"),e.scrollIntoView({block:"nearest"})):(e.classList.remove("active"),e.setAttribute("aria-selected","false"))}),this._activeIndex>=0){const t=e[this._activeIndex];if(t){const e=t.id||`autocomplete-item-${this._activeIndex}`;t.id=e,this.element.setAttribute("aria-activedescendant",e)}}else this.element.removeAttribute("aria-activedescendant")}_selectItem(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value||t.label||String(t);this.element.value=n,this.options.onSelect&&this.options.onSelect(t,{target:this.element}),this.options.clearOnSelect&&setTimeout(()=>{this.element.value=""},100),this.close(),this.element.focus()}_setLoading(e){this._loading=e,e?(this._loadingEl.style.display="block",this._list.style.display="none",this._emptyEl.style.display="none",this.open()):this._loadingEl.style.display="none"}_updatePosition(){if(!this._isOpen||!this._dropdown)return;const e=this.element.getBoundingClientRect(),t=this._dropdown.offsetHeight,n=window.innerHeight;let s=this.options.position;if("auto"===s){const o=n-e.bottom,i=e.top;s=o>=t||o>=i?"below":"above"}"above"===s?(this._dropdown.style.top="auto",this._dropdown.style.bottom="100%",this._dropdown.style.marginBottom="4px",this._dropdown.style.marginTop="0"):(this._dropdown.style.top="100%",this._dropdown.style.bottom="auto",this._dropdown.style.marginTop="4px",this._dropdown.style.marginBottom="0")}open(){return this._isOpen||(this._isOpen=!0,this._dropdown.style.display="block",this.element.setAttribute("aria-expanded","true"),this._updatePosition(),this.options.onOpen&&this.options.onOpen()),this}close(){return this._isOpen?(this._isOpen=!1,this._dropdown.style.display="none",this.element.setAttribute("aria-expanded","false"),this._activeIndex=-1,this.options.onClose&&this.options.onClose(),this):this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setValue(e){return this.element.value=e,this}getValue(){return this.element.value}setData(e){return this.options.data=e,this}refresh(){const e=this.element.value;return e.length>=this.options.minChars&&this._filterData(e),this}focus(){return this.element.focus(),this}clearValue(){return this.element.value="",this.close(),this}destroy(){this.close(),this._dropdown&&this._dropdown.parentNode&&this._dropdown.parentNode.removeChild(this._dropdown),this._debounceTimer&&clearTimeout(this._debounceTimer),this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Xt extends h{static defaults={data:[],value:[],placeholder:"Add items...",searchable:!0,creatable:!1,maxItems:null,duplicates:!1,clearable:!0,size:"medium",renderPill:null,renderOption:null,pillTemplate:"<span>{label}</span>",validatePill:null,maxItemsMessage:"Maximum {max} items allowed",duplicateMessage:"Item already exists",noResultsMessage:"No results found",onAdd:null,onRemove:null,onChange:null,onCreate:null,onMaxReached:null,onValidationError:null};constructor(e,t={}){super(e,t),this.model=t.model||null,this.modelKey=t.modelKey||null,this._pills=[],this._isOpen=!1,this._activeIndex=-1,this._container=null,this._input=null,this._clearBtn=null,this._dropdown=null,this._optionsList=null,this._filteredData=[],this._init();const n=e=>{if(!Array.isArray(e))return;const t=this.getValue();JSON.stringify(t)!==JSON.stringify(e)&&this.setValue(e)};this._container&&(this.model&&"function"==typeof this.model.onFieldChange?this._modelUnsubscribe=this.model.onFieldChange(this.modelKey,n):this.model&&"function"==typeof this.model.onChange&&(this._modelUnsubscribe=this.model.onChange(({field:e,newValue:t})=>{e===this.modelKey&&n(t)})))}_init(){this.element&&("INPUT"===this.element.tagName?(this.element.style.display="none",this._createStructure(),this.options.value&&this.options.value.length>0&&this.options.value.forEach(e=>{const t=this._findItemByValue(e);t?this._addPill(t.value,t.label):"string"==typeof e&&this._addPill(e,e)}),this._bindEvents(),this._input.setAttribute("role","combobox"),this._input.setAttribute("aria-autocomplete","list"),this._input.setAttribute("aria-expanded","false")):console.error("Pillbox requires an input element"))}_createStructure(){const e=document.createElement("div");if(e.className=`dm-pillbox dm-pillbox-${this.options.size}`,this._container=document.createElement("div"),this._container.className="dm-pillbox-container",this._input=document.createElement("input"),this._input.type="text",this._input.className="dm-pillbox-input",this._input.placeholder=this.options.placeholder,this._container.appendChild(this._input),e.appendChild(this._container),this.options.clearable&&(this._clearBtn=document.createElement("button"),this._clearBtn.type="button",this._clearBtn.className="dm-pillbox-clear",this._clearBtn.innerHTML="×",this._clearBtn.title="Clear all",this._clearBtn.style.display="none",e.appendChild(this._clearBtn)),this.options.searchable){this._dropdown=document.createElement("div"),this._dropdown.className="dm-pillbox-dropdown",this._dropdown.style.display="none",this._optionsList=document.createElement("ul"),this._optionsList.className="dm-pillbox-options",this._dropdown.appendChild(this._optionsList);const t=document.createElement("div");t.className="dm-pillbox-empty",t.textContent=this.options.noResultsMessage,t.style.display="none",this._dropdown.appendChild(t),e.appendChild(this._dropdown)}this.element.parentNode.insertBefore(e,this.element.nextSibling),this._wrapper=e}_bindEvents(){const e=this._handleInput.bind(this),t=this._handleKeydown.bind(this);this._addEventListener(this._input,"input",e),this._addEventListener(this._input,"keydown",t),this._addEventListener(this._input,"focus",()=>{this.options.searchable&&this._input.value&&this._filterOptions(this._input.value)}),this._addEventListener(this._input,"blur",()=>{setTimeout(()=>{this._dropdown?.contains(document.activeElement)||this.close()},200)}),this._clearBtn&&this._addEventListener(this._clearBtn,"click",()=>{this.clear(),this._input.focus()}),this._addEventListener(this._container,"click",e=>{e.target===this._container&&this._input.focus()})}_handleInput(e){const t=e.target.value;this.options.searchable&&t?this._filterOptions(t):this.close()}_handleKeydown(e){const t=this._input.value;if("Backspace"===e.key&&!t&&this._pills.length>0){e.preventDefault();const t=this._container.querySelectorAll(".dm-pill")[this._pills.length-1];return void this._removePill(t)}if("Enter"===e.key&&t)return e.preventDefault(),void(this._isOpen&&this._activeIndex>=0?this._selectOption(this._activeIndex):this.options.creatable&&this._createPill(t));if(this._isOpen){const t=this._optionsList.querySelectorAll(".dm-pillbox-option");switch(e.key){case"ArrowDown":e.preventDefault(),this._activeIndex=Math.min(this._activeIndex+1,t.length-1),this._updateActive();break;case"ArrowUp":e.preventDefault(),this._activeIndex=Math.max(this._activeIndex-1,-1),this._updateActive();break;case"Escape":e.preventDefault(),this.close();break;case"Tab":this.close()}}}_filterOptions(e){const t=e.toLowerCase(),n=this._pills.map(e=>e.value);this._filteredData=this.options.data.filter(e=>{const s="string"==typeof e?e:e.value,o="string"==typeof e?e:e.label||e.value;return!n.includes(s)&&(!e.disabled&&o.toLowerCase().includes(t))}),this._renderOptions()}_renderOptions(){this._optionsList.innerHTML="",this._activeIndex=-1;const e=this._dropdown.querySelector(".dm-pillbox-empty");if(0===this._filteredData.length)return e.style.display="block",this._optionsList.style.display="none",void this.open();e.style.display="none",this._optionsList.style.display="block",this._filteredData.forEach((e,t)=>{const n=document.createElement("li");if(n.className="dm-pillbox-option",n.setAttribute("data-index",t),this.options.renderOption){const t=this.options.renderOption(e);n.innerHTML="string"==typeof t?t:"","string"!=typeof t&&n.appendChild(t)}else{const t="string"==typeof e?e:e.label||e.value;n.textContent=t}n.addEventListener("click",()=>{this._selectOption(t)}),n.addEventListener("mouseenter",()=>{this._activeIndex=t,this._updateActive()}),this._optionsList.appendChild(n)}),this.open()}_updateActive(){this._optionsList.querySelectorAll(".dm-pillbox-option").forEach((e,t)=>{t===this._activeIndex?(e.classList.add("active"),e.scrollIntoView({block:"nearest"})):e.classList.remove("active")})}_selectOption(e){const t=this._filteredData[e];if(!t)return;const n="string"==typeof t?t:t.value,s="string"==typeof t?t:t.label||t.value;this._addPill(n,s),this._input.value="",this.close(),this._input.focus()}_createPill(e){if(!e.trim())return;const t=this._validate(e);t?this.options.onValidationError&&this.options.onValidationError(t,e):(this._addPill(e,e),this._input.value="",this.options.onCreate&&this.options.onCreate(e))}_addPill(e,t){const n=this._validate(e);if(n)return void(this.options.onValidationError&&this.options.onValidationError(n,e));const s=document.createElement("div");if(s.className="dm-pill",s.setAttribute("data-value",e),this.options.renderPill){const n=this.options.renderPill({value:e,label:t});s.innerHTML="string"==typeof n?n:"","string"!=typeof n&&s.appendChild(n)}else{const e=this.options.pillTemplate.replace("{label}",t);s.innerHTML=e}const o=document.createElement("button");o.type="button",o.className="dm-pill-remove",o.innerHTML="×",o.title=`Remove ${t}`,o.addEventListener("click",e=>{e.stopPropagation(),this._removePill(s)}),s.appendChild(o),this._container.insertBefore(s,this._input),this._pills.push({value:e,label:t,element:s}),this._updateHiddenInput(),this._clearBtn&&(this._clearBtn.style.display="block"),this.options.onAdd&&this.options.onAdd(e,s),this._triggerChange()}_removePill(e){const t=e.getAttribute("data-value"),n=this._pills.findIndex(e=>e.value===t);-1!==n&&(this._pills[n],e.remove(),this._pills.splice(n,1),this._updateHiddenInput(),0===this._pills.length&&this._clearBtn&&(this._clearBtn.style.display="none"),this.options.onRemove&&this.options.onRemove(t,e),this._triggerChange())}_validate(e){if(this.options.maxItems&&this._pills.length>=this.options.maxItems)return this.options.onMaxReached&&this.options.onMaxReached(),this.options.maxItemsMessage.replace("{max}",this.options.maxItems);if(!this.options.duplicates&&this._pills.some(t=>t.value===e))return this.options.duplicateMessage;if(this.options.validatePill){const t=this.options.validatePill(e);if(!0!==t&&void 0!==t)return"string"==typeof t?t:"Invalid value"}return null}_findItemByValue(e){return this.options.data.find(t=>("string"==typeof t?t:t.value)===e)}_updateHiddenInput(){const e=this._pills.map(e=>e.value);this.element.value=JSON.stringify(e)}_triggerChange(){const e=this.getValue();this.model&&this.modelKey&&this.model.set(this.modelKey,e),this.options.onChange&&this.options.onChange(e)}open(){return!this._dropdown||this._isOpen||(this._isOpen=!0,this._dropdown.style.display="block",this._input.setAttribute("aria-expanded","true")),this}close(){return this._dropdown&&this._isOpen?(this._isOpen=!1,this._dropdown.style.display="none",this._input.setAttribute("aria-expanded","false"),this._activeIndex=-1,this):this}isOpen(){return this._isOpen}getValue(){return this._pills.map(e=>e.value)}setValue(e){return this.clear(),Array.isArray(e)&&e.forEach(e=>{const t=this._findItemByValue(e);if(t){const n="string"==typeof t?t:t.label||t.value;this._addPill(e,n)}else"string"==typeof e&&this._addPill(e,e)}),this}addPill(e,t){return t=t||e,this._addPill(e,t),this}removePill(e){const t=this._container.querySelector(`.dm-pill[data-value="${e}"]`);return t&&this._removePill(t),this}removePillAt(e){return e>=0&&e<this._pills.length&&this._removePill(this._pills[e].element),this}clear(){return[...this._pills].forEach(e=>{this._removePill(e.element)}),this}getCount(){return this._pills.length}setData(e){return this.options.data=e,this}focus(){return this._input.focus(),this}enable(){return this._input.disabled=!1,this._wrapper.classList.remove("disabled"),this}disable(){return this._input.disabled=!0,this._wrapper.classList.add("disabled"),this.close(),this}destroy(){this.close(),this._wrapper&&this._wrapper.parentNode&&this._wrapper.parentNode.removeChild(this._wrapper),this.element.style.display="",this._modelUnsubscribe&&this._modelUnsubscribe(),super.destroy()}}class Jt extends h{static _stack=[];static _top(){return Jt._prune(),Jt._stack[Jt._stack.length-1]||null}static _prune(){Jt._stack=Jt._stack.filter(e=>e._isOpen&&e.element&&e.element.isConnected)}static _removeFromStack(e){Jt._prune();const t=Jt._stack.lastIndexOf(e);-1!==t&&Jt._stack.splice(t,1)}static defaults={position:"right",size:"lg",backdrop:!0,backdropClose:!0,keyboard:!0,animation:!0,animationDuration:300,closeOnEscape:!0,title:"",content:"",closable:!0,closeIcon:"x",headerClass:"",bodyClass:"",footerClass:"",customSizes:{},onOpen:null,onClose:null,onClosed:null};constructor(e,t={}){super(e,t),this._isOpen=!1,this._backdrop=null,this._originalBodyOverflow=null,this._keydownHandler=null,this._init()}_init(){this.element&&(this._setupElement(),this._bindEvents())}_setupElement(){const e=this.element;this.options,e.classList.add("dm-slideover"),e.style.position="fixed",e.style.top="0",e.style.height="100vh",e.style.backgroundColor="var(--dm-surface, #fff)",e.style.boxShadow=this._getBoxShadow(),e.style.zIndex="9999",e.style.display="none",e.style.flexDirection="column",e.style.overflow="hidden",this._applyPosition(),this._applySize(),this._applyAnimation()}_applyPosition(){const e=this.element,t=this.options.position;switch(e.classList.remove("dm-slideover-left","dm-slideover-right","dm-slideover-top","dm-slideover-bottom"),e.classList.add(`dm-slideover-${t}`),t){case"left":e.style.left="-100%",e.style.right="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"right":e.style.right="-100%",e.style.left="auto",e.style.top="0",e.style.bottom="0",e.style.width=this._getSizeValue(),e.style.height="100vh";break;case"top":e.style.top="-100%",e.style.bottom="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue();break;case"bottom":e.style.bottom="-100%",e.style.top="auto",e.style.left="0",e.style.right="0",e.style.width="100vw",e.style.height=this._getSizeValue()}}_applySize(){const e=this._getSizeValue(),t=this.options.position;["left","right"].includes(t)?this.element.style.width=e:this.element.style.height=e}_getSizeValue(){const{size:e,customSizes:t}=this.options;if(t&&t[e])return t[e];const n={sm:"25%",md:"50%",lg:"75%",xl:"90%",full:"100%"};return"string"==typeof e&&(e.includes("px")||e.includes("%")||e.includes("rem")||e.includes("em"))?e:n[e]||n.lg}_applyAnimation(){this.options.animation?this.element.style.transition=`all ${this.options.animationDuration}ms ease`:this.element.style.transition="none"}_getBoxShadow(){switch(this.options.position){case"left":return"2px 0 8px rgba(0,0,0,0.15)";case"right":default:return"-2px 0 8px rgba(0,0,0,0.15)";case"top":return"0 2px 8px rgba(0,0,0,0.15)";case"bottom":return"0 -2px 8px rgba(0,0,0,0.15)"}}_bindEvents(){if(this.options.closable){const e=this.element.querySelector('[data-dismiss="slideover"], .dm-slideover-close');e&&this._addEventListener(e,"click",()=>this.close())}this._keydownHandler=e=>{if(this._isOpen&&this.options.keyboard&&"Escape"===e.key){if(Jt._top()!==this)return;this.options.closeOnEscape&&this.close()}}}_createBackdrop(){this.options.backdrop&&(this._backdrop=document.createElement("div"),this._backdrop.className="dm-slideover-backdrop",this._backdrop.style.cssText=`\n position: fixed;\n top: 0;\n left: 0;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 9998;\n display: none;\n transition: opacity ${this.options.animationDuration}ms ease;\n opacity: 0;\n `,this.options.backdropClose&&this._backdrop.addEventListener("click",()=>this.close()),document.body.appendChild(this._backdrop))}_showBackdrop(){this._backdrop&&(this._backdrop.style.display="block",requestAnimationFrame(()=>{this._backdrop.style.opacity="1"}))}_hideBackdrop(){this._backdrop&&(this._backdrop.style.opacity="0",setTimeout(()=>{this._backdrop&&(this._backdrop.style.display="none")},this.options.animationDuration))}_getOpenPosition(){switch(this.options.position){case"left":return{left:"0",right:"auto"};case"right":return{right:"0",left:"auto"};case"top":return{top:"0",bottom:"auto"};case"bottom":return{bottom:"0",top:"auto"}}}open(){if(this._isOpen)return this;const e=this.element;if(!e)return this;this.options.backdrop&&!this._backdrop&&this._createBackdrop(),this._originalBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden",this._showBackdrop(),e.style.display="flex";const t=this._getOpenPosition();return requestAnimationFrame(()=>{Object.assign(e.style,t)}),this.options.keyboard&&document.addEventListener("keydown",this._keydownHandler),this._isOpen=!0,Jt._removeFromStack(this),Jt._stack.push(this),setTimeout(()=>{this.options.onOpen&&this.options.onOpen(this),this._createForm()},this.options.animationDuration),this}_createForm(){if(this._schema&&!this._formaForm&&window.Domma&&window.Domma.forms&&window.Domma.forms.create)try{console.log("📝 Creating Forma form with schema:",this._schema);let e=this._schema;if(this._schema.fields&&Array.isArray(this._schema.fields)){e={};for(const t of this._schema.fields)t.name&&(e[t.name]={type:t.type||"string",label:t.label,required:t.required||!1,default:t.defaultValue,min:t.validation?.minLength,max:t.validation?.maxLength,pattern:t.validation?.pattern?new RegExp(t.validation.pattern):void 0,options:t.options,formConfig:{placeholder:t.placeholder,hint:t.help,rows:t.rows,accept:t.accept,multiple:t.multiple}});console.log("📝 Converted schema:",e)}const t={onSubmit:(e,t)=>(console.log("📝 Schema form submitted:",e),this._onSave&&this._onSave(e,t,this),!1),onCancel:()=>{console.log("📝 Schema form cancelled"),this.close()},layout:"stacked",showLabels:!0,showHelperText:!0,showHints:!0,cssFramework:"domma",className:"domma-form",fieldClassName:"col-6 mb-3",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint"};this._formaForm=window.Domma.forms.create(e,this._data||{},t),this._formaForm.renderTo("#schema-form-container"),console.log("📝 Forma form created and rendered successfully")}catch(e){console.error("📝 Failed to create Forma form:",e);const t=this.element.querySelector(".dm-slideover-body");t&&(t.innerHTML="<p>Form creation failed. Please try again.</p>")}}close(){if(!this._isOpen)return this;const e=this.element;if(!e)return this;if(this.options.onClose&&this.options.onClose(this),this._applyPosition(),this._hideBackdrop(),null!==this._originalBodyOverflow&&(document.body.style.overflow=this._originalBodyOverflow),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Jt._removeFromStack(this),this._formaForm)try{this._formaForm.destroy&&this._formaForm.destroy(),this._formaForm=null;const t=e.querySelector("#schema-form-container");t&&(t.innerHTML="")}catch(e){console.warn("Error cleaning up form:",e)}return setTimeout(()=>{e.style.display="none",this._isOpen=!1,this.options.onClosed&&this.options.onClosed(this)},this.options.animationDuration),this}toggle(){return this._isOpen?this.close():this.open()}isOpen(){return this._isOpen}setTitle(e){const t=this.element.querySelector(".dm-slideover-header .dm-slideover-title");return t&&(t.textContent=e),this}setContent(e){const t=this.element.querySelector(".dm-slideover-body");return t&&("string"==typeof e?t.innerHTML=r.sanitise(String(e)):e instanceof Element&&(t.innerHTML="",t.appendChild(e))),this}setSize(e){return this.options.size=e,this._applySize(),this}setPosition(e){return this.options.position=e,this.element.style.boxShadow=this._getBoxShadow(),this._applyPosition(),this}destroy(){this.close(),this._backdrop&&(this._backdrop.remove(),this._backdrop=null),this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),Jt._removeFromStack(this),super.destroy()}static create(e={}){const t=document.createElement("div");t.className="dm-slideover";const{title:n,content:s,schema:o,data:i={},closable:r=!0,closeIcon:a="x",onSave:l}=e;let d="";if((n||r)&&(d+='<div class="dm-slideover-header">',n&&(d+=`<h5 class="dm-slideover-title">${n}</h5>`),r&&(d+='<button type="button" class="btn btn-ghost-secondary dm-slideover-close" data-dismiss="slideover" aria-label="Close">',window.Domma&&window.Domma.icons?d+=Domma.icons.render(a,{size:20}).outerHTML:d+="×",d+="</button>"),d+="</div>"),d+='<div class="dm-slideover-body">',o?(d+='<div class="container-fluid p-4">',d+='<div class="card">',d+='<div class="card-body p-4">',d+='<div class="row g-3" id="schema-form-container"></div>',d+="</div>",d+="</div>",d+="</div>"):s&&(d+="string"==typeof s?s:""),d+="</div>",t.innerHTML=d,document.body.appendChild(t),s instanceof Element&&!o){const e=t.querySelector(".dm-slideover-body");e.innerHTML="",e.appendChild(s)}const c=new Jt(t,e);return c._schema=o,c._data=i,c._onSave=l,c}}class Zt extends h{static defaults={mode:"timeline",items:[],layout:"vertical",animation:!0,animationDelay:100,responsive:!0,theme:"default",clickable:!1,onItemClick:null,allowHtml:!1,yearWidth:"80px",contentMaxWidth:"600px",dateFormat:"YYYY",showConnector:!0,showProgress:!0,progressPosition:"top",statusIcons:!0,allowStatusChange:!1,onStatusChange:null,currentItem:null,completedAnimation:!0,icons:{planned:"circle","in-progress":"clock",completed:"check-circle",blocked:"alert-circle",cancelled:"x-circle"},colors:{planned:"var(--dm-gray-400)","in-progress":"var(--dm-primary)",completed:"var(--dm-success)",blocked:"var(--dm-danger)",cancelled:"var(--dm-gray-500)"}};constructor(e,t={}){super(e,t),this._init()}_init(){this.element&&(this.element.classList.add("dm-progression",`dm-progression-${this.options.mode}`,`dm-progression-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this._attachEvents(),this.options.animation&&this._animateItems())}_renderItems(){const e=this.options.items;Array.isArray(e)&&0!==e.length&&(this.element.innerHTML="","roadmap"===this.options.mode&&this.options.showProgress&&"top"===this.options.progressPosition&&this._renderProgressBar(),e.forEach((e,t)=>{const n="roadmap"===this.options.mode?this._renderRoadmapItem(e,t):this._renderTimelineItem(e,t);this.element.appendChild(n)}),"roadmap"===this.options.mode&&this.options.showProgress&&"bottom"===this.options.progressPosition&&this._renderProgressBar())}_renderTimelineItem(e,t){const n=document.createElement("div");return n.className="dm-progression-item dm-timeline-item",n.setAttribute("data-index",t),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease"),n.innerHTML=`\n <div class="dm-progression-marker dm-timeline-year">${this._escapeHtml(e.year||e.date||"")}</div>\n <div class="dm-progression-content dm-timeline-content">\n <h4 class="dm-progression-title dm-timeline-title">${this._escapeHtml(e.title||"")}</h4>\n <p class="dm-progression-description dm-timeline-description">${this._renderContent(e.description||"")}</p>\n </div>\n `,n}_renderRoadmapItem(e,t){const n=document.createElement("div"),s=e.status||"planned",o=this.options.currentItem===e.id||this.options.currentItem===t;n.className=`dm-progression-item dm-progression-status-${s}${o?" dm-progression-current":""}`,n.setAttribute("data-index",t),n.setAttribute("data-id",e.id||t),n.setAttribute("data-status",s),this.options.animation&&(n.style.opacity="0",n.style.transform="translateY(20px)",n.style.transition="opacity 0.6s ease, transform 0.6s ease");let i='<div class="dm-progression-marker dm-progression-status-marker">';this.options.statusIcons&&this.options.icons[s]?i+=`<span class="dm-progression-status-icon" data-icon="${this.options.icons[s]}"></span>`:i+='<span class="dm-progression-status-dot"></span>',i+="</div>";let r='<div class="dm-progression-content">';return e.date&&(r+=`<div class="dm-progression-date">${this._escapeHtml(e.date)}</div>`),r+=`<h4 class="dm-progression-title">${this._escapeHtml(e.title||"")}</h4>`,e.description&&(r+=`<p class="dm-progression-description">${this._renderContent(e.description)}</p>`),"in-progress"===s&&"number"==typeof e.progress&&(r+=`\n <div class="dm-progression-item-progress">\n <div class="dm-progression-item-progress-bar" style="width: ${Math.min(100,Math.max(0,e.progress))}%"></div>\n </div>\n <div class="dm-progression-item-progress-text">${e.progress}%</div>\n `),e.priority&&(r+=`<span class="dm-progression-priority dm-progression-priority-${e.priority}">${this._escapeHtml(e.priority)}</span>`),e.tags&&Array.isArray(e.tags)&&e.tags.length>0&&(r+='<div class="dm-progression-tags">',e.tags.forEach(e=>{r+=`<span class="dm-progression-tag">${this._escapeHtml(e)}</span>`}),r+="</div>"),e.assignee&&(r+=`<div class="dm-progression-assignee">${this._escapeHtml(e.assignee)}</div>`),r+="</div>",n.innerHTML=i+r,n}_renderProgressBar(){const e=this.getProgress(),t=document.createElement("div");t.className="dm-progression-progress",t.innerHTML=`\n <div class="dm-progression-progress-bar" style="width: ${e}%"></div>\n <div class="dm-progression-progress-text">${Math.round(e)}% Complete</div>\n `,this.element.appendChild(t)}_attachEvents(){this.options.clickable&&(this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-item");if(t){const e=parseInt(t.getAttribute("data-index"),10),n=this.options.items[e];n&&this.options.onItemClick&&this.options.onItemClick(n,e,t)}}),"roadmap"===this.options.mode&&this.options.allowStatusChange&&this._addEventListener(this.element,"click",e=>{const t=e.target.closest(".dm-progression-marker");if(t){const e=t.closest(".dm-progression-item"),n=parseInt(e.getAttribute("data-index"),10),s=this.options.items[n];s&&"completed"!==s.status&&this._cycleStatus(s,n)}}))}_cycleStatus(e,t){const n=["planned","in-progress","completed"],s=n.indexOf(e.status||"planned"),o=n[(s+1)%n.length];this.setStatus(t,o)}_animateItems(){this.element.querySelectorAll(".dm-progression-item").forEach((e,t)=>{setTimeout(()=>{e.style.opacity="1",e.style.transform="translateY(0)"},t*this.options.animationDelay)})}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}_sanitizeHtml(e){return"undefined"!=typeof DOMPurify?DOMPurify.sanitize(e,{ALLOWED_TAGS:["p","strong","em","u","br","ul","ol","li","code","pre","a","h1","h2","h3","h4","h5","h6","blockquote","span","div"],ALLOWED_ATTR:["href","target","class","id"]}):(console.warn("DOMPurify not available, falling back to HTML escaping"),this._escapeHtml(e))}_renderContent(e){return this.options.allowHtml?this._sanitizeHtml(e):this._escapeHtml(e)}_findItemIndex(e){return"number"==typeof e?e:this.options.items.findIndex(t=>t.id===e)}setItems(e){return this.options.items=e,this._renderItems(),this.options.animation&&this._animateItems(),this}addItem(e){return this.options.items.push(e),this._renderItems(),this.options.animation&&this._animateItems(),this}getItems(){return[...this.options.items]}getItem(e){const t=this._findItemIndex(e);return t>=0?{...this.options.items[t]}:null}updateItem(e,t){const n=this._findItemIndex(e);return n>=0&&(this.options.items[n]={...this.options.items[n],...t},this._renderItems(),this.options.animation&&this._animateItems()),this}removeItem(e){const t=this._findItemIndex(e);return t>=0&&(this.options.items.splice(t,1),this._renderItems(),this.options.animation&&this._animateItems()),this}setLayout(e){return this.element.classList.remove(`dm-progression-${this.options.layout}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.layout}`),this.options.layout=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`),this}setTheme(e){return"default"!==this.options.theme&&(this.element.classList.remove(`dm-progression-${this.options.theme}`),"timeline"===this.options.mode&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.theme=e,"default"!==e&&(this.element.classList.add(`dm-progression-${e}`),"timeline"===this.options.mode&&this.element.classList.add(`dm-timeline-${e}`)),this}setMode(e){return this.element.classList.remove(`dm-progression-${this.options.mode}`),"timeline"===this.options.mode&&(this.element.classList.remove("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.remove(`dm-timeline-${this.options.theme}`)),this.options.mode=e,this.element.classList.add(`dm-progression-${e}`),"timeline"===e&&(this.element.classList.add("dm-timeline",`dm-timeline-${this.options.layout}`),"default"!==this.options.theme&&this.element.classList.add(`dm-timeline-${this.options.theme}`)),this._renderItems(),this.options.animation&&this._animateItems(),this}getMode(){return this.options.mode}refresh(){return this._renderItems(),this.options.animation&&this._animateItems(),this}setStatus(e,t){const n=this._findItemIndex(e);if(n>=0){const e=this.options.items[n].status;this.options.items[n].status=t,this.options.onStatusChange&&this.options.onStatusChange(this.options.items[n],e,t),this._renderItems(),this.options.animation&&this._animateItems()}return this}getStatus(e){const t=this.getItem(e);return t?t.status:null}getItemsByStatus(e){return this.options.items.filter(t=>t.status===e)}setCurrent(e){const t=this._findItemIndex(e);return t>=0&&(this.options.currentItem=this.options.items[t].id||t,this._renderItems(),this.options.animation&&this._animateItems()),this}getCurrent(){return null===this.options.currentItem?null:this.getItem(this.options.currentItem)}getProgress(){if("roadmap"!==this.options.mode||0===this.options.items.length)return 0;const e=this.options.items.filter(e=>"completed"===e.status).length;return Math.round(e/this.options.items.length*100)}markComplete(e){return this.setStatus(e,"completed")}markInProgress(e){return this.setStatus(e,"in-progress")}markBlocked(e){return this.setStatus(e,"blocked")}}class Qt extends h{static defaults={width:null,height:180,penColour:"#000000",penWidth:2,format:"png",label:"Signature",guideLine:!0,placeholder:"Sign here",colours:["#000000","#1e40af","#15803d","#b91c1c"],widths:[1,2,4],toolbar:!0,name:"signature",disabled:!1,typeFallback:!1,minStrokeLength:3,respectMotionPreference:!0,onChange:null,onClear:null,onBegin:null,onEnd:null};constructor(e,t={}){super(e,t),this.element&&(this._strokes=[],this._undoneStrokes=[],this._currentStroke=null,this._mode="draw",this._isDrawing=!1,this._currentColour=this.options.penColour,this._currentWidth=this.options.penWidth,this._resizeObserver=null,this._canvas=null,this._ctx=null,this._canvasW=0,this._canvasH=0,this._dpr=1,this._render(),this._initCanvas(),this._initEvents(),this.options.disabled&&this.disable())}_esc(e){return String(e).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}_render(){const e=this.options,t=this._esc.bind(this),n=e.colours.map(e=>{const n=t(e),s=e===this._currentColour;return`<button class="signature-colour-swatch${s?" active":""}" data-colour="${n}" style="background:${n}" aria-label="Pen colour ${n}" aria-pressed="${s}" title="${n}"></button>`}).join(""),s=e.widths.map(e=>{const t=parseFloat(e)||2,n=t===this._currentWidth,s=Math.max(2,Math.min(2.5*t,12));return`<button class="signature-width-btn${n?" active":""}" data-width="${t}" aria-label="Pen width ${t}px" aria-pressed="${n}">\n <span class="signature-width-dot" style="width:${s}px;height:${s}px;"></span>\n </button>`}).join(""),o=e.typeFallback?'\n <div class="signature-mode-toggle" role="group" aria-label="Input mode">\n <button class="signature-mode-btn active" data-mode="draw" aria-pressed="true">Draw</button>\n <button class="signature-mode-btn" data-mode="type" aria-pressed="false">Type</button>\n </div>':"",i=e.toolbar?`\n <div class="signature-toolbar">\n <span class="signature-label">${t(e.label)}</span>\n <div class="signature-colours" role="group" aria-label="Pen colour">${n}</div>\n <div class="signature-widths" role="group" aria-label="Pen width">${s}</div>\n <div class="signature-actions">\n <button class="signature-btn" data-action="undo" aria-label="Undo" disabled>\n <span data-icon="undo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn" data-action="redo" aria-label="Redo" disabled>\n <span data-icon="redo" style="font-size:0.875rem;"></span>\n </button>\n <button class="signature-btn signature-btn-clear" data-action="clear" aria-label="Clear signature">Clear</button>\n </div>\n ${o}\n </div>`:"",r=parseInt(e.height,10)||180,a=t(e.format.toUpperCase()),l=t(e.name),d=t(e.placeholder),c=`\n ${i}\n <div class="signature-canvas-wrapper" style="height:${r}px;">\n <canvas class="signature-canvas" tabindex="0" aria-label="Draw your signature here"></canvas>\n ${e.guideLine?'<div class="signature-guide-line" aria-hidden="true"></div>':""}\n <div class="signature-placeholder" aria-hidden="true">${d}</div>\n <input class="signature-type-input" type="text" placeholder="${d}" style="display:none;" aria-label="Type your signature">\n </div>\n <div class="signature-footer">\n <span class="signature-status" aria-live="polite">Draw your signature above</span>\n <span class="signature-format-badge">${a}</span>\n </div>\n <input type="hidden" name="${l}" value="">\n `;this.element.classList.add("signature"),this.element.setAttribute("role","application"),this.element.setAttribute("aria-label",t(e.label)),this.element.textContent="",this.element.insertAdjacentHTML("afterbegin",c),this._canvas=this.element.querySelector(".signature-canvas"),this._wrapper=this.element.querySelector(".signature-canvas-wrapper"),this._placeholder=this.element.querySelector(".signature-placeholder"),this._statusEl=this.element.querySelector(".signature-status"),this._hiddenInput=this.element.querySelector('input[type="hidden"]'),this._typeInput=this.element.querySelector(".signature-type-input"),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(this.element)}_initCanvas(){this._canvas&&(this._ctx=this._canvas.getContext("2d"),this._scaleCanvas(),"undefined"!=typeof ResizeObserver&&(this._resizeObserver=new ResizeObserver(()=>{this._scaleCanvas(),this._redraw()}),this._resizeObserver.observe(this._wrapper)))}_scaleCanvas(){const e=window.devicePixelRatio||1,t=this._wrapper.clientWidth,n=this._wrapper.clientHeight;this._canvas.width=t*e,this._canvas.height=n*e,this._ctx.setTransform(e,0,0,e,0,0),this._dpr=e,this._canvasW=t,this._canvasH=n}_initEvents(){const e=this._canvas;e&&(this._addEventListener(e,"pointerdown",e=>this._onPointerDown(e)),this._addEventListener(e,"pointermove",e=>this._onPointerMove(e)),this._addEventListener(e,"pointerup",e=>this._onPointerUp(e)),this._addEventListener(e,"pointercancel",e=>this._onPointerUp(e)),this._addEventListener(e,"pointerleave",e=>{this._isDrawing&&this._onPointerUp(e)}),this._addEventListener(this.element,"click",e=>{const t=e.target.closest("[data-action]");if(t){const e=t.dataset.action;return void("undo"===e?this.undo():"redo"===e?this.redo():"clear"===e&&this.clear())}const n=e.target.closest(".signature-colour-swatch");if(n)return void this._setColour(n.dataset.colour);const s=e.target.closest(".signature-width-btn");if(s)return void this._setPenWidth(parseFloat(s.dataset.width));const o=e.target.closest(".signature-mode-btn");o&&this._setMode(o.dataset.mode)}),this._typeInput&&this._addEventListener(this._typeInput,"input",()=>this._renderTypeToCanvas()))}_onPointerDown(e){if(this.options.disabled||"draw"!==this._mode)return;e.preventDefault(),this._canvas.setPointerCapture(e.pointerId),this._isDrawing=!0,this.element.classList.add("signature-signing");const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke={points:[{x:t,y:n,pressure:s}],colour:this._currentColour,width:this._currentWidth},this._undoneStrokes=[],this._updateState(),"function"==typeof this.options.onBegin&&this.options.onBegin(this._currentStroke)}_onPointerMove(e){if(!this._isDrawing||!this._currentStroke)return;e.preventDefault();const{x:t,y:n}=this._getPoint(e),s=e.pressure||.5;this._currentStroke.points.push({x:t,y:n,pressure:s}),this._redrawCurrentStroke()}_onPointerUp(e){if(!this._isDrawing)return;this._isDrawing=!1,this.element.classList.remove("signature-signing"),this._currentStroke&&this._currentStroke.points.length>=this.options.minStrokeLength&&this._strokes.push(this._currentStroke);const t=this._currentStroke;this._currentStroke=null,this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onEnd&&t&&this.options.onEnd(t),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value)}_getPoint(e){const t=this._canvas.getBoundingClientRect();return{x:(e.clientX-t.left)/this._canvasW,y:(e.clientY-t.top)/this._canvasH}}_redraw(){if(!this._ctx)return;const e=this._canvasW,t=this._canvasH;this._ctx.clearRect(0,0,e,t);for(const n of this._strokes)this._drawStroke(this._ctx,n,e,t);this._placeholder&&(this._placeholder.style.display=this._strokes.length>0?"none":"")}_redrawCurrentStroke(){this._redraw(),this._currentStroke&&this._drawStroke(this._ctx,this._currentStroke,this._canvasW,this._canvasH)}_drawStroke(e,t,n,s){const o=t.points;if(0!==o.length){if(e.save(),e.strokeStyle=t.colour,e.fillStyle=t.colour,e.lineCap="round",e.lineJoin="round",1===o.length){const i=t.width*(.4+.6*o[0].pressure);e.beginPath(),e.arc(o[0].x*n,o[0].y*s,i/2,0,2*Math.PI),e.fill()}else{e.beginPath(),e.moveTo(o[0].x*n,o[0].y*s);for(let i=1;i<o.length-1;i++){const r=(o[i].x+o[i+1].x)/2*n,a=(o[i].y+o[i+1].y)/2*s;e.lineWidth=t.width*(.4+.6*o[i].pressure),e.quadraticCurveTo(o[i].x*n,o[i].y*s,r,a),e.stroke(),e.beginPath(),e.moveTo(r,a)}const i=o[o.length-1];e.lineWidth=t.width*(.4+.6*i.pressure),e.lineTo(i.x*n,i.y*s),e.stroke()}e.restore()}}_updateState(){const e=this.element.querySelector('[data-action="undo"]'),t=this.element.querySelector('[data-action="redo"]');e&&(e.disabled=0===this._strokes.length),t&&(t.disabled=0===this._undoneStrokes.length),this._statusEl&&(this._isDrawing?this._statusEl.textContent="Signing…":this._strokes.length>0?this._statusEl.textContent="Signature captured":this._statusEl.textContent="Draw your signature above")}_setColour(e){this._currentColour=e,this.element.querySelectorAll(".signature-colour-swatch").forEach(t=>{const n=t.dataset.colour===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setPenWidth(e){this._currentWidth=e,this.element.querySelectorAll(".signature-width-btn").forEach(t=>{const n=parseFloat(t.dataset.width)===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")})}_setMode(e){if(this._mode===e)return;this._mode=e,this.element.querySelectorAll(".signature-mode-btn").forEach(t=>{const n=t.dataset.mode===e;t.classList.toggle("active",n),t.setAttribute("aria-pressed",n?"true":"false")});this.element.querySelectorAll('.signature-colours, .signature-widths, [data-action="undo"], [data-action="redo"]').forEach(t=>{t.style.display="type"===e?"none":""}),"type"===e?(this._canvas.style.display="none",this._typeInput&&(this._typeInput.style.display="",this._typeInput.focus())):(this._canvas.style.display="",this._typeInput&&(this._typeInput.style.display="none")),this.clear(!0)}_renderTypeToCanvas(){const e=this._typeInput?this._typeInput.value.trim():"";this._strokes=[],this._undoneStrokes=[];const t=this._ctx,n=this._canvasW,s=this._canvasH;t.clearRect(0,0,n,s),e&&(t.save(),t.fillStyle=this._currentColour,t.font=`${Math.min(.55*s,72)}px 'Brush Script MT', 'Segoe Script', cursive`,t.textAlign="center",t.textBaseline="middle",t.fillText(e,n/2,s/2),t.restore()),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value)}_updateHiddenInput(){if(!this._hiddenInput)return;const e=this.isEmpty()&&"type"!==this._mode;this._hiddenInput.value=e?"":this.toBase64()}toBase64(e){return"svg"===(e||this.options.format)?this._toSVGBase64():this._canvas.toDataURL("image/png")}_toSVGBase64(){const e=this._canvasW,t=this._canvasH;let n="";for(const s of this._strokes){const o=s.points;if(0===o.length)continue;let i=`M ${(o[0].x*e).toFixed(2)} ${(o[0].y*t).toFixed(2)}`;for(let n=1;n<o.length-1;n++){const s=((o[n].x+o[n+1].x)/2*e).toFixed(2),r=((o[n].y+o[n+1].y)/2*t).toFixed(2);i+=` Q ${(o[n].x*e).toFixed(2)} ${(o[n].y*t).toFixed(2)} ${s} ${r}`}if(o.length>1){const n=o[o.length-1];i+=` L ${(n.x*e).toFixed(2)} ${(n.y*t).toFixed(2)}`}const r=o.reduce((e,t)=>e+t.pressure,0)/o.length,a=(s.width*(.4+.6*r)).toFixed(2);n+=`<path d="${i}" stroke="${s.colour}" stroke-width="${a}" fill="none" stroke-linecap="round" stroke-linejoin="round"/>\n`}return"data:image/svg+xml;base64,"+btoa(`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${t}" viewBox="0 0 ${e} ${t}">\n${n}</svg>`)}isEmpty(){return"type"===this._mode?!this._typeInput||""===this._typeInput.value.trim():0===this._strokes.length}clear(e=!1){!e&&this._strokes.length>0&&(this._undoneStrokes=[...this._strokes,...this._undoneStrokes]),this._strokes=[],this._currentStroke=null,this._redraw(),this._updateState(),this._hiddenInput&&(this._hiddenInput.value=""),e||(this._statusEl&&(this._statusEl.textContent="Signature cleared"),"function"==typeof this.options.onClear&&this.options.onClear(),"function"==typeof this.options.onChange&&this.options.onChange(""))}undo(){0!==this._strokes.length&&(this._undoneStrokes.unshift(this._strokes.pop()),this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value))}redo(){0!==this._undoneStrokes.length&&(this._strokes.push(this._undoneStrokes.shift()),this._redraw(),this._updateState(),this._updateHiddenInput(),"function"==typeof this.options.onChange&&this.options.onChange(this._hiddenInput.value))}disable(){this.options.disabled=!0,this.element.classList.add("signature-disabled"),this._canvas&&this._canvas.setAttribute("aria-disabled","true"),this._typeInput&&(this._typeInput.disabled=!0),this.element.querySelectorAll("[data-action]").forEach(e=>{e.disabled=!0})}enable(){this.options.disabled=!1,this.element.classList.remove("signature-disabled"),this._canvas&&this._canvas.removeAttribute("aria-disabled"),this._typeInput&&(this._typeInput.disabled=!1),this._updateState();const e=this.element.querySelector('[data-action="clear"]');e&&(e.disabled=!1)}destroy(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),super.destroy()}}const en=["January","February","March","April","May","June","July","August","September","October","November","December"],tn=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function nn(e){if(!(e instanceof Date)||Number.isNaN(e.getTime()))return"";const t=e=>String(e).padStart(2,"0");return`${e.getFullYear()}-${t(e.getMonth()+1)}-${t(e.getDate())}`}function sn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:new Date(e.getFullYear(),e.getMonth(),e.getDate());if("number"==typeof e)return sn(new Date(e));const t=String(e??"").trim();if(!t)return null;const n=/^(\d{4})-(\d{2})-(\d{2})/.exec(t);if(n){const e=new Date(Number(n[1]),Number(n[2])-1,Number(n[3]));return e.getMonth()===Number(n[2])-1?e:null}const s=new Date(t);return Number.isNaN(s.getTime())?null:new Date(s.getFullYear(),s.getMonth(),s.getDate())}function on(e,t){if(!e)return"";const n=e=>String(e).padStart(2,"0"),s={YYYY:String(e.getFullYear()),YY:String(e.getFullYear()).slice(-2),MMMM:en[e.getMonth()],MMM:en[e.getMonth()].slice(0,3),MM:n(e.getMonth()+1),M:String(e.getMonth()+1),DDDD:tn[e.getDay()],DDD:tn[e.getDay()].slice(0,3),DD:n(e.getDate()),D:String(e.getDate())};return t.replace(/YYYY|YY|MMMM|MMM|MM|M|DDDD|DDD|DD|D/g,e=>s[e])}function rn(e,t){return Boolean(e)&&Boolean(t)&&e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate()}class an extends h{static defaults={value:null,format:"YYYY-MM-DD",min:null,max:null,firstDay:1,disabledDates:null,openOnFocus:!0,closeOnSelect:!0,closeOnClickOutside:!0,closeOnEscape:!0,clearable:!0,todayButton:!0,readonlyInput:!1,inline:!1,position:"bottom-start",offset:[0,4],weekNumbers:!1,placeholder:null,onChange:null,onOpen:null,onClose:null};static _open=null;constructor(e,t={}){super(e,t),this.element&&(this._panel=null,this._isOpen=!1,this._value=null,this._view=null,this._focused=null,this._init())}_init(){const e=this.element,t=this.options;"INPUT"===e.tagName&&"date"===e.type&&(e.type="text"),e.setAttribute("autocomplete","off"),e.setAttribute("aria-haspopup","dialog"),e.setAttribute("aria-expanded","false"),t.readonlyInput&&(e.readOnly=!0),null!==t.placeholder?e.placeholder=t.placeholder:e.placeholder||(e.placeholder=t.format);const n=null!==t.value&&void 0!==t.value&&""!==t.value?t.value:e.value;if(this._value=this._clamp(sn(n)),this._view=this._value?new Date(this._value):this._clamp(new Date)||new Date,this._renderInput(),t.inline)return this._buildPanel(),e.insertAdjacentElement("afterend",this._panel),this._panel.classList.add("dm-datepicker--inline"),this._paint(),void(this._isOpen=!0);this._addEventListener(e,"click",()=>this.open()),t.openOnFocus&&this._addEventListener(e,"focus",()=>this.open()),this._addEventListener(e,"keydown",e=>this._onInputKey(e)),this._addEventListener(e,"change",()=>{if(this._suppress)return;const t=sn(e.value);this.setValue(t?nn(t):"",{silent:!1,fromInput:!0})})}getValue(){return this._value?nn(this._value):""}getDate(){return this._value?new Date(this._value):null}setValue(e,{silent:t=!1,fromInput:n=!1}={}){const s=this._clamp(sn(e)),o=!rn(s,this._value)||!s!=!this._value;return this._value=s,s&&(this._view=new Date(s)),this._renderInput(),this._panel&&this._paint(),o&&!t&&(n||(this._suppress=!0,this.element.dispatchEvent(new Event("input",{bubbles:!0})),this.element.dispatchEvent(new Event("change",{bubbles:!0})),this._suppress=!1),"function"==typeof this.options.onChange&&this.options.onChange(this.getValue(),this.getDate(),this)),this}clear(){return this.setValue("")}_renderInput(){const e=this.getValue();this._suppress=!0,this.element.value=this._value?on(this._value,this.options.format):"",this._suppress=!1,"YYYY-MM-DD"===this.options.format?delete this.element.dataset.date:this.element.dataset.date=e}_min(){return sn(this.options.min)}_max(){return sn(this.options.max)}_clamp(e){if(!e)return null;const t=this._min(),n=this._max();return t&&e<t?new Date(t):n&&e>n?new Date(n):e}_disabled(e){const t=this._min(),n=this._max();if(t&&e<t)return!0;if(n&&e>n)return!0;if("function"==typeof this.options.disabledDates)try{return Boolean(this.options.disabledDates(new Date(e)))}catch{return!1}return!1}_buildPanel(){const e=document.createElement("div");e.className="dm-datepicker",this.options.weekNumbers&&e.setAttribute("data-week-numbers",""),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","false"),e.setAttribute("aria-label","Choose a date");const t=document.createElement("div");t.className="dm-datepicker-head";const n=document.createElement("button");n.type="button",n.className="dm-datepicker-nav",n.setAttribute("aria-label","Previous month"),n.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M15 18l-6-6 6-6"/></svg>',this._addEventListener(n,"click",()=>this._shiftMonth(-1));const s=document.createElement("button");s.type="button",s.className="dm-datepicker-nav",s.setAttribute("aria-label","Next month"),s.innerHTML='<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 18l6-6-6-6"/></svg>',this._addEventListener(s,"click",()=>this._shiftMonth(1));const o=document.createElement("select");o.className="dm-datepicker-select",o.setAttribute("aria-label","Month"),en.forEach((e,t)=>{const n=document.createElement("option");n.value=String(t),n.textContent=e,o.appendChild(n)}),this._addEventListener(o,"change",()=>{this._view=new Date(this._view.getFullYear(),Number(o.value),1),this._paint()});const i=document.createElement("select");i.className="dm-datepicker-select",i.setAttribute("aria-label","Year"),this._addEventListener(i,"change",()=>{this._view=new Date(Number(i.value),this._view.getMonth(),1),this._paint()}),t.appendChild(n);const r=document.createElement("div");r.className="dm-datepicker-pickers",r.appendChild(o),r.appendChild(i),t.appendChild(r),t.appendChild(s),e.appendChild(t);const a=document.createElement("div");a.className="dm-datepicker-grid",a.setAttribute("role","grid"),e.appendChild(a);const l=document.createElement("div");l.className="dm-datepicker-foot",e.appendChild(l),this._addEventListener(a,"click",e=>{const t=e.target.closest("[data-dm-date]");t&&!t.hasAttribute("aria-disabled")&&(this.setValue(t.dataset.dmDate),this.options.closeOnSelect&&!this.options.inline&&this.close({focus:!0}))}),this._addEventListener(e,"keydown",e=>this._onPanelKey(e)),this._panel=e,this._grid=a,this._foot=l,this._monthSelect=o,this._yearSelect=i}_shiftMonth(e){this._view=new Date(this._view.getFullYear(),this._view.getMonth()+e,1),this._paint()}_paint(){const e=this.options,t=this._view,n=new Date,s=this._min(),o=this._max(),i=s?s.getFullYear():n.getFullYear()-100,r=o?o.getFullYear():n.getFullYear()+10;if(this._yearSelect.dataset.from!==String(i)||this._yearSelect.dataset.to!==String(r)){this._yearSelect.textContent="";for(let e=r;e>=i;e--){const t=document.createElement("option");t.value=String(e),t.textContent=String(e),this._yearSelect.appendChild(t)}this._yearSelect.dataset.from=String(i),this._yearSelect.dataset.to=String(r)}this._monthSelect.value=String(t.getMonth()),this._yearSelect.value=String(t.getFullYear());const a=this._grid;a.textContent="";const l=document.createElement("div");if(l.className="dm-datepicker-row dm-datepicker-weekdays",l.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week",l.appendChild(e)}for(let t=0;t<7;t++){const n=tn[(e.firstDay+t)%7],s=document.createElement("span");s.className="dm-datepicker-weekday",s.setAttribute("role","columnheader"),s.setAttribute("aria-label",n),s.textContent=n.slice(0,2),l.appendChild(s)}a.appendChild(l);const d=new Date(t.getFullYear(),t.getMonth(),1),c=(d.getDay()-e.firstDay+7)%7,h=new Date(d.getFullYear(),d.getMonth(),1-c);for(let s=0;s<6;s++){const o=document.createElement("div");if(o.className="dm-datepicker-row",o.setAttribute("role","row"),e.weekNumbers){const e=document.createElement("span");e.className="dm-datepicker-week";const t=new Date(h);t.setDate(h.getDate()+7*s),e.textContent=String(this._weekNumber(t)),o.appendChild(e)}for(let e=0;e<7;e++){const i=new Date(h.getFullYear(),h.getMonth(),h.getDate()+7*s+e),r=document.createElement("button");r.type="button",r.className="dm-datepicker-day",r.dataset.dmDate=nn(i),r.setAttribute("role","gridcell"),r.textContent=String(i.getDate()),r.setAttribute("aria-label",on(i,"DDDD D MMMM YYYY")),i.getMonth()!==t.getMonth()&&r.classList.add("is-outside"),rn(i,n)&&r.classList.add("is-today"),rn(i,this._value)&&(r.classList.add("is-selected"),r.setAttribute("aria-selected","true")),this._disabled(i)&&(r.classList.add("is-disabled"),r.setAttribute("aria-disabled","true"),r.disabled=!0);const a=this._focused||this._value||n;r.tabIndex=rn(i,a)?0:-1,o.appendChild(r)}a.appendChild(o)}this._paintFoot()}_paintFoot(){const e=this._foot;e.textContent="";const t=this.options;if(t.todayButton){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Today",n.addEventListener("click",()=>{const e=new Date;if(this._disabled(e))return this._view=new Date(e.getFullYear(),e.getMonth(),1),void this._paint();this.setValue(nn(e)),t.closeOnSelect&&!t.inline&&this.close({focus:!0})}),e.appendChild(n)}if(t.clearable){const n=document.createElement("button");n.type="button",n.className="dm-datepicker-action",n.textContent="Clear",n.disabled=!this._value,n.addEventListener("click",()=>{this.clear(),t.inline||this.close({focus:!0})}),e.appendChild(n)}e.childNodes.length?e.parentNode||this._panel.appendChild(e):e.remove()}_weekNumber(e){const t=new Date(e.getFullYear(),e.getMonth(),e.getDate());t.setDate(t.getDate()+3-(t.getDay()+6)%7);const n=new Date(t.getFullYear(),0,4);return n.setDate(n.getDate()+3-(n.getDay()+6)%7),1+Math.round((t-n)/6048e5)}open(){return this._isOpen||this.options.inline||this.element.disabled||(an._open&&an._open!==this&&an._open.close(),this._panel||this._buildPanel(),document.body.appendChild(this._panel),this._focused=this._value?new Date(this._value):null,this._paint(),this._position(),this._isOpen=!0,an._open=this,this.element.setAttribute("aria-expanded","true"),this._onOutside=e=>{this._panel.contains(e.target)||e.target===this.element||this.close()},this._onReposition=()=>this._position(),this.options.closeOnClickOutside&&setTimeout(()=>document.addEventListener("mousedown",this._onOutside,!0),0),window.addEventListener("resize",this._onReposition),window.addEventListener("scroll",this._onReposition,!0),"function"==typeof this.options.onOpen&&this.options.onOpen(this)),this}close({focus:e=!1}={}){return!this._isOpen||this.options.inline||(document.removeEventListener("mousedown",this._onOutside,!0),window.removeEventListener("resize",this._onReposition),window.removeEventListener("scroll",this._onReposition,!0),this._panel?.remove(),this._isOpen=!1,an._open===this&&(an._open=null),this.element.setAttribute("aria-expanded","false"),e&&this.element.focus(),"function"==typeof this.options.onClose&&this.options.onClose(this)),this}toggle(){return this._isOpen?this.close():this.open()}_position(){const e=this._panel;if(!e)return;const t=this.element.getBoundingClientRect(),[n,s]=this.options.offset;e.style.position="absolute",e.style.visibility="hidden",e.style.top="0",e.style.left="0";const o=e.getBoundingClientRect();let i=t.bottom+s,r=t.left+n;i+o.height>window.innerHeight&&t.top-o.height-s>0&&(i=t.top-o.height-s),this.options.position.endsWith("-end")&&(r=t.right-o.width),r=Math.max(8,Math.min(r,window.innerWidth-o.width-8)),e.style.top=`${i+window.scrollY}px`,e.style.left=`${r+window.scrollX}px`,e.style.visibility=""}_onInputKey(e){"ArrowDown"!==e.key&&"Enter"!==e.key?"Escape"===e.key&&this._isOpen&&(e.preventDefault(),this.close()):this._isOpen||(e.preventDefault(),this.open(),this._panel?.querySelector('[tabindex="0"]')?.focus())}_onPanelKey(e){const t={ArrowLeft:-1,ArrowRight:1,ArrowUp:-7,ArrowDown:7}[e.key],n=this._focused||this._value||new Date;if(void 0!==t)return e.preventDefault(),void this._moveFocus(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t));if("PageUp"===e.key||"PageDown"===e.key){e.preventDefault();const t="PageUp"===e.key?-1:1;return void this._moveFocus(new Date(n.getFullYear(),n.getMonth()+t,n.getDate()))}if("Home"===e.key||"End"===e.key){e.preventDefault();const t="Home"===e.key?new Date(n.getFullYear(),n.getMonth(),1):new Date(n.getFullYear(),n.getMonth()+1,0);return void this._moveFocus(t)}"Escape"===e.key&&this.options.closeOnEscape&&(e.preventDefault(),this.close({focus:!0}))}_moveFocus(e){this._focused=e,e.getMonth()===this._view.getMonth()&&e.getFullYear()===this._view.getFullYear()||(this._view=new Date(e.getFullYear(),e.getMonth(),1)),this._paint(),this._panel?.querySelector(`[data-dm-date="${nn(e)}"]`)?.focus()}destroy(){this.close(),this._panel?.remove(),this._panel=null,super.destroy()}}const ln={_instances:new Map,card(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-card");let o=null;for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,()=>{n(o||s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):null!=n&&s.setAttribute(St(e),String(n));if(t.title){const e=document.createElement("div");e.setAttribute("slot","header"),e.className="card-header";const n=document.createElement("h4");if(n.className="card-title",t.icon){const e=document.createElement("span");e.setAttribute("data-icon",t.icon),e.className="card-title-icon",n.appendChild(e)}n.appendChild(document.createTextNode(t.title)),e.appendChild(n),s.appendChild(e)}if(t.content){const e=document.createElement("div");e.setAttribute("slot","body"),e.className="card-body";const n="undefined"!=typeof Domma&&Domma.sanitize&&"function"==typeof Domma.sanitize.sanitize?Domma.sanitize.sanitize(t.content):t.content;e.innerHTML=n,s.appendChild(e)}return Array.from(n.children).forEach(e=>{e.classList.contains("card-header")?e.setAttribute("slot","header"):e.classList.contains("card-body")?e.setAttribute("slot","body"):e.classList.contains("card-footer")&&e.setAttribute("slot","footer"),s.appendChild(e)}),$t(n,s,"card"),n.replaceWith(s),o={element:s,options:s._options,collapse(){return s.collapse(),this},expand(){return s.expand(),this},toggle(){return s.toggle(),this},isCollapsed:()=>s.isCollapsed(),setShadow(e){return s.setShadow(e),this},setHoverable(e){return s.setHoverable(e),this},setContent(e){return s.setContent(e),this},getBody:()=>s.getBody(),updateHeight(){return s.updateHeight(),this},destroy(){s.destroy()}},o}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},modal(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return jt.createModal(e);const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-modal");for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();s.addEventListener(t,e=>{n(e.detail||s)})}else"boolean"==typeof n?n&&s.setAttribute(St(e),""):"buttons"===e&&Array.isArray(n)?(s._options=s._options||{},s._options.buttons=n):null!=n&&s.setAttribute(St(e),String(n));for(;n.firstChild;)s.appendChild(n.firstChild);$t(n,s,"modal"),s.hasAttribute("role")||s.setAttribute("role","dialog"),s.hasAttribute("aria-modal")||s.setAttribute("aria-modal","true");const o=s.querySelector(".modal-title");o?(o.id||(o.id="dm-modal-title-"+Math.random().toString(36).substring(2,9)),s.hasAttribute("aria-labelledby")||s.setAttribute("aria-labelledby",o.id)):t.title&&!s.hasAttribute("aria-label")&&s.setAttribute("aria-label",t.title);const i=s.querySelector("[data-close], .modal-close, .btn-close, .close");return i&&!i.hasAttribute("aria-label")&&i.setAttribute("aria-label","Close"),n.replaceWith(s),{element:s,options:s._options,open(){return s.open(),this},close(){return s.close(),this},toggle(){return s.toggle(),this},isOpen:()=>s.isOpen(),setTitle(e){return s.setTitle(e),this},setContent(e){return s.setContent(e),this},setButtons(e){return s.setButtons(e),this},destroy(){s.destroy()},remove(){s.remove()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},tabs(e,t={}){const n=new Bt(e,t);return n.element&&this._instances.set(n.element,n),n},accordion(e,t={}){const n=new Dt(e,t);return n.element&&this._instances.set(n.element,n),n},tooltip(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e];if(0===n.length)return null;const s=[];return n.forEach(e=>{if(!e)return;const n=void 0===t.content||null===t.content||""===t.content?{...t,content:e.dataset.tooltip||e.title||""}:t,o=e=>{for(const[t,s]of Object.entries(n))if("function"==typeof s){const n=t.replace(/^on/,"").toLowerCase();e.addEventListener(n,()=>s(e))}else"delay"===t&&"object"==typeof s?(void 0!==s.show&&e.setAttribute("delay",String(s.show)),void 0!==s.hide&&e.setAttribute("hide-delay",String(s.hide))):"boolean"==typeof s?s&&e.setAttribute(St(t),""):null!=s&&e.setAttribute(St(t),String(s))};let i;e.parentNode&&"DOMMA-TOOLTIP"===e.parentNode.tagName?(i=e.parentNode,o(i)):(i=document.createElement("domma-tooltip"),o(i),e.parentNode.insertBefore(i,e),i.appendChild(e),i._dommaComponent=i),s.push({element:i,options:i._options,show(){return i.show(),this},hide(){return i.hide(),this},toggle(){return i.toggle(),this},setContent(e){return i.setContent(e),this},setPosition(e){return i.setPosition(e),this},isVisible:()=>i.isVisible(),destroy(){const e=i.querySelector("*");e&&i.parentNode&&i.parentNode.insertBefore(e,i),i.remove()}})}),1===s.length?s[0]:s}(e,t);return Array.isArray(n)?n.forEach(e=>{e.element&&this._instances.set(e.element,e)}):n&&n.element&&this._instances.set(n.element,n),n},badge(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=n.textContent,o=document.createElement("domma-badge");o.textContent=s;for(const[e,n]of Object.entries(t))if("function"==typeof n){const t=e.replace(/^on/,"").toLowerCase();o.addEventListener(t,e=>{n(e.detail.event||e,o)})}else"boolean"==typeof n?n&&o.setAttribute(St(e),""):null!=n&&o.setAttribute(St(e),String(n));return $t(n,o,"badge"),n.replaceWith(o),o._dommaComponent=o,{element:o,options:o._options,setOptions(e){return o.setOptions(e),this},setVariant(e){return o.setVariant(e),this},setSize(e){return o.setSize(e),this},setText(e){return o.setText(e),this},remove(){o.remove()},destroy(){o.destroy()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},numberBadge(e,t={}){const n=function(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;const s=document.createElement("domma-number-badge");return void 0!==t.count&&s.setAttribute("count",String(t.count)),t.variant&&s.setAttribute("variant",t.variant),t.dot&&s.setAttribute("dot",""),t.pulse&&s.setAttribute("pulse",""),t.borderColor&&s.setAttribute("border-color",t.borderColor),n.parentNode.insertBefore(s,n),s.appendChild(n),s._dommaComponent=s,{element:s,options:s._options,setOptions(e){return s.setOptions(e),this},setCount(e){return s.setCount(e),this},increment(e=1){return s.increment(e),this},decrement(e=1){return s.decrement(e),this},setDot(e){return s.setDot(e),this},setVariant(e){return s.setVariant(e),this},setPulse(e){return s.setPulse(e),this},getCount:()=>s.getCount(),remove(){s.parentNode&&n.parentNode===s&&s.parentNode.insertBefore(n,s),s.remove()},destroy(){s.destroy()}}}(e,t);return n&&n.element&&this._instances.set(n.element,n),n},dropdown(e,t={}){const n=new Ht(e,t);return n.element&&this._instances.set(n.element,n),n},carousel(e,t={}){const n=new Pt(e,t);return n.element&&this._instances.set(n.element,n),n},cookieConsent(e={}){if(this._instances.has("cookieConsent"))return this._instances.get("cookieConsent");const t=new Vt(e);return this._instances.set("cookieConsent",t),t},backToTop(e,t={}){const n=function(e,t={}){const n=document.createElement("domma-back-to-top");for(const[e,s]of Object.entries(t))if("function"==typeof s){const t=e.replace(/^on/,"").toLowerCase();n.addEventListener(t,e=>{s(e.detail||n)})}else"boolean"==typeof s?s&&n.setAttribute(St(e),""):null!=s&&n.setAttribute(St(e),String(s));return document.body.appendChild(n),n._dommaComponent=n,{element:n,options:n._options,scroll(){return n.scroll(),this},show(){return n.show(),this},hide(){return n.hide(),this},toggle(){return n.toggle(),this},isVisible:()=>n.isVisible(),getButton:()=>n.getButton(),setShowAfter(e){return n.setShowAfter(e),this},setPosition(e){return n.setPosition(e),this},setOffset(e){return n.setOffset(e),this},destroy(){n.destroy()}}}(0,t);return n&&n.element&&this._instances.set("backToTop",n),n},buttonGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Rt(e,t);this._instances.set(e,n),s.push(n)}return 1===s.length?s[0]:s},loader(e,t={}){const n=zt(e,t);return n&&n.element&&this._instances.set(n.element,n),n},showLoader(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return null;let s=this._instances.get(n);return s?s.show():(s=zt(n,{...t,visible:!0}),this._instances.set(n,s)),s},hideLoader(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&n.hide&&n.hide()},fullscreenLoader(e="Loading...",t={}){let n=document.getElementById("dm-loader-fullscreen");n||(n=document.createElement("div"),n.id="dm-loader-fullscreen",n.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.7);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n ",document.body.appendChild(n));const s=zt(n,{type:t.type||"spinner",size:t.size||"large",color:t.color||"white",text:e,overlay:!1,centered:!1,visible:!0});return n.style.display="flex",this._instances.set(n,s),s},breadcrumbs(e,t={}){const n=new qt(e,t);return n.element&&this._instances.set(n.element,n),n},navbar(e,t={}){const n=new Ut(e,t);return n.element&&this._instances.set(n.element,n),n},sidebar(e,t={}){const n=new Kt(e,t);return n.element&&this._instances.set(n.element,n),n},footer(e,t={}){const n=new Yt(e,t);return n.element&&this._instances.set(n.element,n),n},notification:(e={})=>new Ot(e),notify:(e,t={})=>Ot.notify(e,t),timer(e,t={}){const n=new It(e,t);return n.element&&this._instances.set(n.element,n),n},alarm:(e={})=>new Nt(e),autocomplete(e,t={}){const n=new Gt(e,t);return n.element&&this._instances.set(n.element,n),n},pillbox(e,t={}){const n=new Xt(e,t);return n.element&&this._instances.set(n.element,n),n},datePicker(e,t={}){const n=new an(e,t);return n.element&&this._instances.set(n.element,n),n},chooser(e,t={}){const n="string"==typeof e?document.querySelector(e):e;if(!n)return console.warn("[Domma.elements.chooser] host not found:",e),null;const s={variant:"card",multiple:!1,density:"comfortable",columns:3,glow:!1,glowColour:null,shadow:"none",shadowColour:null,accent:"primary",accentStyle:"border",options:[],...t};let o=void 0!==s.value?s.value:s.multiple?[]:null;const i=document.createElement("div");i.className="domma-chooser",i.setAttribute("data-variant",s.variant),i.setAttribute("data-density",s.density),i.style.setProperty("--picker-cols",String(s.columns)),i.style.setProperty("--picker-cols-md",String(Math.min(s.columns,2))),i.style.setProperty("--picker-cols-sm","1");const r={primary:1,success:1,info:1,warning:1,danger:1},a=e=>"string"==typeof e&&r[e];if(s.glow&&i.setAttribute("data-glow","true"),s.glowColour&&(a(s.glowColour)?i.setAttribute("data-glow-colour",s.glowColour):i.style.setProperty("--picker-glow-colour",s.glowColour)),s.shadow&&"none"!==s.shadow&&i.setAttribute("data-shadow",s.shadow),s.shadowColour&&i.style.setProperty("--picker-shadow-colour",s.shadowColour),s.accent&&(a(s.accent)?i.setAttribute("data-accent",s.accent):i.style.setProperty("--picker-accent",s.accent)),s.accentStyle&&"border"!==s.accentStyle&&i.setAttribute("data-accent-style",s.accentStyle),s.label){const e=document.createElement("label");if(e.className="picker-label",e.textContent=s.label,s.required){const t=document.createElement("span");t.className="picker-required",t.textContent="*",e.appendChild(t)}i.appendChild(e)}const l=document.createElement("div");l.className="picker-options",l.setAttribute("role",s.multiple?"group":"radiogroup"),i.appendChild(l);const d=e=>{const t=String(e);return s.multiple?Array.isArray(o)&&o.map(String).includes(t):null!=o&&String(o)===t},c=()=>{l.replaceChildren(),s.options.forEach((e,t)=>l.appendChild(((e,t)=>{const n=document.createElement("div");if(n.className="picker-option",n.setAttribute("role",s.multiple?"checkbox":"radio"),n.setAttribute("tabindex",s.multiple||0===t?"0":"-1"),n.setAttribute("data-value",String(e.value)),n.setAttribute("aria-checked",d(e.value)?"true":"false"),d(e.value)&&n.classList.add("is-selected"),e.disabled&&(n.classList.add("is-disabled"),n.setAttribute("aria-disabled","true")),e.recommended&&n.classList.add("is-recommended"),e.icon){const t=document.createElement("span");t.className="picker-option-icon",t.setAttribute("data-icon",e.icon),n.appendChild(t)}const o=document.createElement("span");if(o.className="picker-option-label",o.textContent=e.label,n.appendChild(o),e.description&&"compact"!==s.density&&"card"===s.variant){const t=document.createElement("span");t.className="picker-option-desc",t.textContent=e.description,n.appendChild(t)}if("card"===s.variant){const e=document.createElement("span");e.className="picker-option-tick",e.setAttribute("aria-hidden","true");const t=document.createElement("span");t.setAttribute("data-icon","check"),t.setAttribute("data-icon-size","12"),e.appendChild(t),n.appendChild(e)}if(e.badge&&e.badge.text){const t=document.createElement("span");t.className="picker-option-badge";const s=document.createElement("span");s.className="badge badge-"+(e.badge.type||"primary"),s.textContent=e.badge.text,t.appendChild(s),n.appendChild(t)}if(e.tooltip&&n.setAttribute("data-tooltip",e.tooltip),s.name){const t=document.createElement("input");t.className="picker-native-input",t.type=s.multiple?"checkbox":"radio",t.name=s.multiple?s.name+"[]":s.name,t.value=String(e.value),t.checked=d(e.value),t.disabled=!!e.disabled,t.tabIndex=-1,n.appendChild(t)}return n})(e,t))),"undefined"!=typeof Domma&&Domma.icons&&"function"==typeof Domma.icons.scan&&Domma.icons.scan(l)},h=(e,t=!0)=>{o=e,c(),t&&"function"==typeof s.onChange&&s.onChange(o)};return l.addEventListener("click",e=>{const t=e.target.closest(".picker-option");if(!t||t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value");if(s.multiple){const e=Array.isArray(o)?o.slice():[],t=e.indexOf(n);t>=0?e.splice(t,1):e.push(n),h(e)}else h(n)}),l.addEventListener("keydown",e=>{const t=e.target.closest(".picker-option");if(!t)return;const n=Array.from(l.querySelectorAll(".picker-option")).filter(e=>!e.classList.contains("is-disabled")),i=n.indexOf(t);if(s.multiple){if(" "===e.key||"Spacebar"===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;const n=t.getAttribute("data-value"),s=Array.isArray(o)?o.slice():[],i=s.indexOf(n);i>=0?s.splice(i,1):s.push(n),h(s)}return}if("Enter"===e.key||" "===e.key){if(e.preventDefault(),t.classList.contains("is-disabled"))return;return void h(t.getAttribute("data-value"))}let r=null;if("ArrowRight"===e.key||"ArrowDown"===e.key)r=i+1;else{if("ArrowLeft"!==e.key&&"ArrowUp"!==e.key)return;r=i-1}e.preventDefault(),r<0&&(r=n.length-1),r>=n.length&&(r=0);const a=n[r];if(a){const e=a.getAttribute("data-value");h(e);const t=l.querySelector('.picker-option[data-value="'+e.replace(/"/g,'\\"')+'"]');t&&"function"==typeof t.focus&&t.focus()}}),n.appendChild(i),c(),{_root:i,getValue:()=>o,setValue(e){h(e,!1)},disable(){i.querySelectorAll(".picker-option").forEach(e=>e.classList.add("is-disabled"))},enable(){i.querySelectorAll(".picker-option").forEach(e=>e.classList.remove("is-disabled"))},destroy(){i.remove()}}},contextMenu(e,t={}){const n=new Z(e,t);return n.element&&this._instances.set(n.element,n),n},sortable(e,t={}){const n=new se(e,t);return n.element&&this._instances.set(n.element,n),n},skeleton:(e,t={})=>Ce(e,t),avatar:(e,t={})=>mt(e,t),avatarGroup:(e,t={})=>bt(e,t),inputGroup(e,t={}){const n=new ge(e,t);return n.element&&this._instances.set(n.element,n),n},popover(e,t={}){const n=new Ke(e,t);if(n.element){const e=n.element;this._instances.set(e,n),n._onDestroy=()=>{this._instances.get(e)===n&&this._instances.delete(e)}}return n},treeView(e,t={}){const n=new u(e,t);return n.element&&this._instances.set(n.element,n),n},slideover(e,t={}){if("object"==typeof e&&!e.nodeType&&"string"!=typeof e)return e.schema,Jt.create(e);const n=new Jt(e,t);return n.element&&this._instances.set(n.element,n),n},progression(e,t={}){const n=new Zt(e,t);return n.element&&this._instances.set(n.element,n),n},listGroup(e,t={}){const n="string"==typeof e?document.querySelectorAll(e):[e],s=[];for(const e of n){const n=new Wt(e,t);n.element&&this._instances.set(e,n),s.push(n)}return 1===s.length?s[0]:s},timeline(e,t={}){return"undefined"!=typeof Domma&&!1!==Domma.config?.deprecationWarnings&&"undefined"!=typeof console&&console.warn('Domma: timeline() is deprecated. Use progression({ mode: "timeline" }) instead.'),this.progression(e,{mode:"timeline",...t})},toast:Object.assign((e,t={})=>Tt.show(e,t),{show:Tt.show.bind(Tt),success:Tt.success.bind(Tt),error:Tt.error.bind(Tt),warning:Tt.warning.bind(Tt),info:Tt.info.bind(Tt),closeAll:Tt.closeAll.bind(Tt)}),dialog:Ft,alert:Ft.alert.bind(Ft),confirm:Ft.confirm.bind(Ft),prompt:Ft.prompt.bind(Ft),createModal:jt.createModal.bind(jt),showModal:jt.showModal.bind(jt),signature(e,t={}){const n=new Qt(e,t);return n.element&&this._instances.set(n.element,n),n},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()},_registry:new Map,register(e,t){this._registry.set(e,t)},create(e,t,n={}){const s=this._registry.get(e);if(s)return new s(t,n);throw new Error(`Unknown component: ${e}`)}};function dn(e,{fallback:t,onWrite:n}={}){const s=t&&"object"==typeof t?Object.keys(t):[];return 0===s.length&&"function"!=typeof n?e:new Proxy({},{get:(n,s)=>"string"==typeof s&&!(s in e)&&s in t?t[s]:e[s],has:(n,o)=>o in e||"string"==typeof o&&s.length>0&&o in t,ownKeys:()=>[...new Set([...s,...Reflect.ownKeys(e)])],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),set:(t,s,o)=>(e[s]=o,"string"==typeof s&&"function"==typeof n&&n(s,o),!0)})}
|
|
9
|
+
/*! domma-reactive v1.3.1 | MIT | https://github.com/pinpointzero73/domma-reactive */function cn(e,t){return un(e,t,null)}function hn(e){return e===Object.prototype||null===e}function un(e,t,n){if(Object.is(e,t))return!0;if(0===e&&0===t)return!0;if(null===e||null===t)return!1;if("object"!=typeof e||"object"!=typeof t)return!1;if(e instanceof Date||t instanceof Date)return e instanceof Date&&t instanceof Date&&Object.is(e.getTime(),t.getTime());const s=Array.isArray(e);if(s!==Array.isArray(t))return!1;if(!(s||hn(Object.getPrototypeOf(e))&&hn(Object.getPrototypeOf(t))))return!1;const o=n||new WeakMap,i=o.get(e);if(i){if(i.has(t))return!0;i.add(t)}else o.set(e,new Set([t]));if(s){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!un(e[n],t[n],o))return!1;return!0}const r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(const n of r){if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!un(e[n],t[n],o))return!1}return!0}ln.contextMenu.closeAll=Z.closeAll,ln.contextMenu.active=Z.active,ln.contextMenu.registry=Z.registry,ln.skeleton.while=Ce.while,ln.skeleton.get=Ce.get,ln.skeleton.remove=Ce.remove,ln.skeleton.scan=Ce.scan,ln.skeleton.markup=Ce.markup,ln.avatar.scan=mt.scan,ln.avatar.get=mt.get,ln.avatar.initials=mt.initials,ln.avatar.tone=mt.tone,ln.avatarGroup.get=bt.get,ln.popover.scan=e=>Ke.scan(e,(e,t)=>ln.popover(e,t)),ln.popover.closeAll=Ke.closeAll,ln.popover.getInstance=Ke.getInstance,ln.popover.open=Ke.openPopovers;const pn=Symbol.for("domma-reactive.reactive");function mn(e){return Object.defineProperty(e,pn,{value:!0,enumerable:!1}),e}function fn(e){return null!==e&&("object"==typeof e||"function"==typeof e)&&!0===e[pn]}function gn(e,{expr:t,where:n,handler:s}={}){if("function"!=typeof e||!1===s?.tracks||!0===s?.acceptsReactive)return e;let o=!1;return s=>{const i=e(s);if(!fn(i))return i;if(!o){o=!0;const e=n?` in ${n}`:"";console.warn(`[Domma Reactive] "${t}"${e} is an observable, not its value - use "${t}.value". The binding reads it as empty (hidden, off, no rows) until then.`)}}}let vn=null;const bn=[],yn=new Set;let _n=!1,kn=!1;class wn{constructor(e=null){this.subs=new Set,this.owner=e}track(){vn&&vn!==this.owner&&(this.subs.add(vn),vn.deps.add(this))}trigger(){if(0!==this.subs.size){for(const e of this.subs)e.invalidate(),yn.add(e);Mn()}}}class xn{constructor(e,t={}){this.fn=e,this.label=t.label||(t.effect?"effect":"computed"),this.isEffect=!0===t.effect,this.onNotify=t.onNotify||null,this._write="function"==typeof t.write?t.write:null,this.deps=new Set,this.dep=new wn(this),this._value=void 0,this.dirty=!0,this.disposed=!1}_run(){const e=new Set(this.deps);for(const e of this.deps)e.subs.delete(this);this.deps.clear(),bn.push(vn),vn=this;try{return this.fn()}catch(t){console.warn(`[Domma Reactive] "${this.label}" threw during evaluation:`,t);for(const t of e)this.deps.add(t),t.subs.add(this);return}finally{vn=bn.pop()}}get(){if(this.dirty&&!this.disposed){const e=this._value;this._value=this._run(),this.dirty=!1,this._evaluated&&!cn(e,this._value)&&(this._pulledChange=!0),this._evaluated=!0}return this.dep.track(),this._value}get value(){return this.get()}set value(e){this.write(e)}write(e){this._write?An(()=>this._write(e)):console.warn(`[Domma Reactive] "${this.label}" is a read-only computed - the assignment was ignored. Pass computed({read, write}) to say where a write should land.`)}set(e){this.write(e)}recompute(){if(this.disposed)return{changed:!1,value:this._value};const e=this._value;this._value=this._run(),this.dirty=!1;const t=this._pulledChange||!cn(e,this._value);return this._pulledChange=!1,this._evaluated=!0,{changed:t,value:this._value}}invalidate(){this.dirty=!0}dependents(){return this.dep.subs}notify(){!this.disposed&&this.onNotify&&this.onNotify(this._value,this)}dispose(){if(!this.disposed){for(const e of this.deps)e.subs.delete(this);this.deps.clear(),this.dep.subs.clear(),yn.delete(this),this.disposed=!0}}}function Mn(){_n||kn||(_n=!0,Promise.resolve().then(Ln))}function Ln(){if(_n=!1,!kn&&0!==yn.size){kn=!0;try{const e=new Set(yn);yn.clear(),function(e){const t=20,n=new Map,s=new Set,o=[...e];for(;o.length>0;){const e=o.shift();if(e.disposed)continue;const i=(n.get(e)||0)+1;if(n.set(e,i),i>t){console.warn(`[Domma Reactive] "${e.label}" re-entered the flush ${t} times - likely a dependency cycle. Skipping.`);continue}if(e.isEffect){s.add(e);continue}if(0===e.dependents().size&&!e.onNotify)continue;const{changed:r}=e.recompute();if(r)for(const t of e.dependents())t.invalidate(),o.push(t)}for(const e of s)e.disposed||e.recompute()}(e)}finally{kn=!1,yn.size>0&&Mn()}}}function Cn(e,t={}){if(null!==e&&"object"==typeof e){const{read:n,...s}=e;if("function"!=typeof n)throw new TypeError("[Domma Reactive] computed({read, write}): `read` must be a function");return new xn(n,{...s,...t,effect:!1})}return new xn(e,{...t,effect:!1})}function En(e,t={}){const n=new xn(e,{...t,effect:!0,onNotify:null});return n.recompute(),n}function An(e){bn.push(vn),vn=null;try{return e()}finally{vn=bn.pop()}}Object.defineProperty(xn.prototype,pn,{value:!0,enumerable:!1});const Sn="[Domma Reactive]",$n=new Map,zn=new Set(["notify","rateLimit","throttle"]);function Tn(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Sn} registerExtender: the name must be a non-empty string`);if("function"!=typeof t)throw new TypeError(`${Sn} registerExtender: "${e}" was not given a function`);return $n.has(e)&&!zn.has(e)&&console.warn(`${Sn} registerExtender: "${e}" replaces an existing extender`),$n.set(e,t),t}Tn("notify",(e,t)=>{"always"===t?e.setEquals(()=>!1):console.warn(`${Sn} extend: notify accepts only 'always' - got ${JSON.stringify(t)}`)});const jn=new WeakMap;Tn("rateLimit",(e,t)=>{const n=function(e){const t=e&&"object"==typeof e?e:{timeout:e},n=t.timeout;if("number"!=typeof n||!Number.isFinite(n)||n<0)return console.warn(`${Sn} extend: rateLimit needs a timeout in milliseconds - got ${JSON.stringify(n)}`),null;const s=t.method||"notifyWhenChangesStop";return"notifyWhenChangesStop"!==s&&"notifyAtFixedRate"!==s?(console.warn(`${Sn} extend: rateLimit method must be 'notifyWhenChangesStop' or 'notifyAtFixedRate' - got ${JSON.stringify(s)}`),null):{timeout:n,fixed:"notifyAtFixedRate"===s}}(t);if(!n)return;let s=jn.get(e.observable);s||(s={timeout:n.timeout,fixed:n.fixed,timer:null,latest:void 0,armed:!1},jn.set(e.observable,s),e.intercept(e=>t=>function(e,t,n){e.timeout<=0?t(n):(e.latest=n,e.fixed&&e.armed||(e.armed=!0,e.timer&&clearTimeout(e.timer),e.timer=setTimeout(()=>{e.timer=null,e.armed=!1,t(e.latest)},e.timeout)))}(s,e,t))),s.timeout=n.timeout,s.fixed=n.fixed,0===n.timeout&&s.timer&&(clearTimeout(s.timer),s.timer=null,s.armed=!1)}),Tn("throttle",(e,t)=>{$n.get("rateLimit")(e,t)});const Bn="[Domma Reactive]";function Dn(){const e=new Set;return{add(t){if("function"!=typeof t)throw new TypeError(`${Bn} subscribe: expected a function`);e.add(t);const n=()=>{e.delete(t)};return n.dispose=n,n},notify(t){if(0!==e.size)for(const n of[...e])try{n(t)}catch(e){console.warn(`${Bn} a subscriber threw:`,e)}},size:()=>e.size}}function Wn(e,t){let n=e.equals||cn,s=t;const o={observable:null,setEquals(e){if("function"!=typeof e)throw new TypeError(`${Bn} extend: setEquals expects a function`);n=e},intercept(e){if("function"!=typeof e)throw new TypeError(`${Bn} extend: intercept expects a function`);s=e(s)}};return{changed:(e,t)=>!n(e,t),announce:e=>s(e),attach:e=>{o.observable=e},extend:e=>function(e,t){if(t&&"object"==typeof t)for(const[n,s]of Object.entries(t)){const t=$n.get(n);t?t(e,s):console.warn(`${Sn} extend: no extender named "${n}". Registered: ${[...$n.keys()].join(", ")}.`)}else console.warn(`${Sn} extend: expected an object of extenders`)}(o,e)}}function Hn(e,t={}){const n=new wn,s=Dn();let o=e;const i=Wn(t,e=>{n.trigger(),s.notify(e)}),r=e=>{const t=i.changed(o,e);o=e,t&&i.announce(o)},a={get value(){return n.track(),o},set value(e){r(e)},peek:()=>o,set:e=>r(e),subscribe:e=>s.add(e),extend:e=>(i.extend(e),a)};return i.attach(a),mn(a)}const On=["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"];const In=new Set(["$data","$root","$parent","$index","$length","$parents","$parentContext","$component"]),Nn=Object.freeze([]);function Pn(e){let t=null;return Object.defineProperty(e,"$parents",{enumerable:!0,get:()=>t??=function(e){const t=[];for(let n=e.$parentContext;null!==n;n=n.$parentContext)t.push(n.$data);return Object.freeze(t)}(e)}),Object.freeze(e)}function Vn(e,t,n=null,s=null){const o=Rn(e);return Pn({$data:t,$root:o.$root,$parent:o.$data,$index:void 0===n?null:n,$length:void 0===s?null:s,$parentContext:o,$component:o.$component??null})}function Fn(e,t){const n=Rn(e);return Pn({$data:t,$root:n.$root,$parent:n.$data,$index:null,$length:null,$parentContext:n,$component:t})}function Rn(e){return function(e){return null!==e&&"object"==typeof e&&"$data"in e}(e)?e:(t=e,Object.freeze({$data:t,$root:t,$parent:null,$index:null,$length:null,$parents:Nn,$parentContext:null,$component:null}));var t}const qn="[Domma Reactive]",Un=64,Kn=new Set(["__proto__","constructor","prototype"]),Yn=new Map([["new","the `new` operator is not supported"],["delete","`delete` is not supported"],["typeof","`typeof` is not supported"],["void","`void` is not supported"],["instanceof","`instanceof` is not supported"],["in","the `in` operator is not supported"],["function","function expressions are not supported"],["class","class expressions are not supported"],["this","`this` is not supported - use $data"],["await","`await` is not supported"],["yield","`yield` is not supported"]]);class Gn extends Error{}const Xn=new Map,Jn=function(e){const t=e=>fn(e)?e.value:e;function n(e){const n=t(e);return Array.isArray(n)?n:n instanceof Set?[...n]:[]}function s(n,s){if(null==s)return t(n);let o=t(n);for(const n of String(s).split("."))if(o=t(e(o,n)),null==o)return o;return o}function o(e){const[t,n]=e;return e.length>=2?e=>s(e,t)===n:e=>Boolean(s(e,t))}return new Map(Object.entries({len(e){const n=t(e);return"string"==typeof n||Array.isArray(n)?n.length:n instanceof Set||n instanceof Map?n.size:0},includes(e,s){const o=t(e);return"string"==typeof o?o.includes(String(s)):n(o).includes(s)},some:(e,...t)=>n(e).some(o(t)),every:(e,...t)=>n(e).every(o(t)),count(e,...t){const s=n(e);if(0===t.length)return s.length;const i=o(t);let r=0;for(const e of s)i(e)&&r++;return r},where:(e,...t)=>n(e).filter(o(t)),sum(e,t){let o=0;for(const i of n(e)){const e=Number(s(i,t));Number.isFinite(e)&&(o+=e)}return o},pluck:(e,t)=>n(e).map(e=>s(e,t)),sortBy(e,t,o="asc"){const i="desc"===o?-1:1;return n(e).map(e=>({item:e,by:s(e,t)})).sort((e,t)=>{const n=void 0===e.by||null===e.by,s=void 0===t.by||null===t.by;return n||s?n-s:"string"==typeof e.by&&"string"==typeof t.by?i*e.by.localeCompare(t.by):e.by<t.by?-i:e.by>t.by?i:0}).map(e=>e.item)},first:e=>n(e)[0],last(e){const t=n(e);return t[t.length-1]},join:(e,s=", ")=>n(e).map(e=>{const n=t(e);return null==n?"":String(n)}).join(String(s))}))}(fs),Zn=new Map,Qn=new Map,es=new WeakMap,ts=new Set,ns=/[0-9]/,ss=/[\p{ID_Start}$_]/u,os=/[\p{ID_Continue}$\u200C\u200D]/u,is=["===","!==","&&","||","<=",">=","??","==","!=","<",">","+","-","*","/","%","!","?",":",".",",","(",")","[","]","{","}","="],rs=new Map([["==","loose equality is not supported - use ==="],["!=","loose inequality is not supported - use !=="],["=","assignment is not supported"],["??","the ?? operator is not supported"]]),as={n:"\n",t:"\t",r:"\r",b:"\b",f:"\f",v:"\v",0:"\0"};function ls(e,t){const n=e[t];let s="",o=t+1;for(;o<e.length;){const t=e[o];if("\\"===t){const t=e[o+1];if(void 0===t)break;if("u"===t){const t=e.slice(o+2,o+6);if(!/^[0-9a-fA-F]{4}$/.test(t))throw new Gn(`bad \\u escape at position ${o}`);s+=String.fromCharCode(parseInt(t,16)),o+=6;continue}s+=Object.prototype.hasOwnProperty.call(as,t)?as[t]:t,o+=2;continue}if(t===n)return{value:s,end:o+1};s+=t,o++}throw new Gn(`unterminated string starting at position ${t}`)}const ds={"||":{bp:3,logical:!0},"&&":{bp:4,logical:!0},"===":{bp:5},"!==":{bp:5},"<":{bp:6},"<=":{bp:6},">":{bp:6},">=":{bp:6},"+":{bp:7},"-":{bp:7},"*":{bp:8},"/":{bp:8},"%":{bp:8}},cs=new Set(["-","+","!"]),hs=e=>Object.freeze(e);function us(e,t=!1){const n=function(e){const t=[];let n=0;for(;n<e.length;){const s=e[n];if(/\s/.test(s)){n++;continue}if(ns.test(s)){const s=n;for(;n<e.length&&ns.test(e[n]);)n++;if("."===e[n])for(n++;n<e.length&&ns.test(e[n]);)n++;if("e"===e[n]||"E"===e[n]){const t=n;if(n++,"+"!==e[n]&&"-"!==e[n]||n++,ns.test(e[n]??""))for(;n<e.length&&ns.test(e[n]);)n++;else n=t}t.push({type:"num",value:Number(e.slice(s,n)),pos:s});continue}if('"'===s||"'"===s){const s=ls(e,n);t.push({type:"str",value:s.value,pos:n}),n=s.end;continue}if("`"===s)throw new Gn(`template literals are not supported at position ${n}`);if(ss.test(s)){const s=n;for(n++;n<e.length&&os.test(e[n]);)n++;const o=e.slice(s,n);"true"===o?t.push({type:"num",value:!0,pos:s}):"false"===o?t.push({type:"num",value:!1,pos:s}):"null"===o?t.push({type:"num",value:null,pos:s}):t.push({type:"ident",value:o,pos:s});continue}const o=is.find(t=>e.startsWith(t,n));if(o){const e=rs.get(o);if(e)throw new Gn(`${e} (at position ${n})`);t.push({type:"punct",value:o,pos:n}),n+=o.length;continue}throw new Gn(`unexpected character "${s}" at position ${n}`)}return t.push({type:"eof",value:null,pos:e.length}),t}(e);let s=0,o=0;const i=()=>n[s],r=e=>"punct"===n[s].type&&n[s].value===e,a=(e,t=n[s])=>{throw new Gn(`${e} at position ${t.pos}`)},l=e=>!!r(e)&&(s++,!0),d=e=>{l(e)||a(`expected "${e}" but found ${ps(i())}`)};function c(e){if(++o>Un)throw new Gn("expression nests deeper than 64 levels");try{let t=function(){const e=i();if("num"===e.type||"str"===e.type)return s++,hs({type:"Literal",value:e.value});if("ident"===e.type){const t=Yn.get(e.value);return t&&a(t),s++,hs({type:"Identifier",name:e.value})}if("punct"===e.type){if(cs.has(e.value))return s++,hs({type:"Unary",operator:e.value,argument:c(9)});if("("===e.value){s++;const e=c(0);return d(")"),e}if("["===e.value)return s++,hs({type:"ArrayLiteral",elements:Object.freeze(h("]"))});if("{"===e.value)return s++,function(){const e=[];if(!r("}"))do{r("}")&&a('a trailing comma before "}" is not supported');const t=i();let n;"ident"===t.type||"str"===t.type?n=String(t.value):"punct"===t.type&&"["===t.value?a("computed keys are not supported in an object literal"):"punct"===t.type&&"."===t.value?a("spread is not supported in an object literal"):a(`expected a property name but found ${ps(t)}`),Kn.has(n)&&a(`the key "${n}" is not allowed`),s++,(r(",")||r("}"))&&a(`shorthand properties are not supported - write ${n}: ${n}`),r("(")&&a("methods are not supported in an object literal"),d(":"),e.push(Object.freeze({key:n,value:c(0)}))}while(l(","));return d("}"),hs({type:"ObjectLiteral",entries:Object.freeze(e)})}()}return a(`unexpected ${ps(e)}`)}();for(;;){const n=i();if("punct"!==n.type)break;if(10>e&&("."===n.value||"["===n.value||"("===n.value)){t=u(t);continue}if("?"===n.value&&2>e){s++;const e=c(0);d(":");const n=c(1);t=hs({type:"Conditional",test:t,consequent:e,alternate:n});continue}const o=Object.prototype.hasOwnProperty.call(ds,n.value)?ds[n.value]:void 0;if(!o||o.bp<=e)break;s++;const r=c(o.bp);t=hs({type:o.logical?"Logical":"Binary",operator:n.value,left:t,right:r})}return t}finally{o--}}function h(e){const t=[];if(!r(e))do{r(e)&&a(`a trailing comma before "${e}" is not supported`),t.push(c(0))}while(l(","));return d(e),t}function u(e){if(l(".")){const t=i();return"ident"!==t.type&&a(`expected a property name after "." but found ${ps(t)}`),s++,hs({type:"Member",object:e,property:t.value,computed:!1})}if(l("[")){const t=c(0);return d("]"),hs({type:"Member",object:e,property:t,computed:!0})}d("(");const n=t&&"Member"===e.type;"Identifier"===e.type||n||a("only registered helpers can be called - `x.foo()` is not supported");const o=[];if(!r(")"))do{o.push(c(0))}while(l(","));return d(")"),hs(n?{type:"MethodCall",object:e.object,property:e.property,computed:e.computed,args:Object.freeze(o)}:{type:"Call",callee:e.name,args:Object.freeze(o)})}if(1===n.length)throw new Gn("the expression is empty");const p=c(0);"eof"!==i().type&&a(`unexpected ${ps(i())}`);const m=function(e){let t=0;const n=[[e,1]];for(;n.length>0;){const[e,s]=n.pop();if(s>t&&(t=s),t>Un)return t;for(const t of ms(e))n.push([t,s+1])}return t}(p);if(m>Un)throw new Gn(`expression nests deeper than 64 levels (${m})`);return p}function ps(e){return"eof"===e.type?"end of expression":"str"===e.type?`string ${JSON.stringify(e.value)}`:"num"===e.type?`literal ${String(e.value)}`:`"${e.value}"`}function ms(e){switch(e?.type){case"Member":return e.computed?[e.object,e.property]:[e.object];case"Unary":return[e.argument];case"Binary":case"Logical":return[e.left,e.right];case"Conditional":return[e.test,e.consequent,e.alternate];case"Call":return e.args;case"ArrayLiteral":return e.elements;case"ObjectLiteral":return e.entries.map(e=>e.value);case"MethodCall":return e.computed?[e.object,e.property,...e.args]:[e.object,...e.args];default:return[]}}function fs(e,t){if(null==e)return;const n=String(t);if(!Kn.has(n))return e[n];console.warn(`${qn} blocked an expression from reading "${n}" - __proto__, constructor and prototype are not readable from an expression`)}const gs=new WeakSet;class vs extends Error{}function bs(e,t){if(!fn(e))return e;if(!gs.has(t)){gs.add(t);const e="Identifier"===t.type?t.name:"Member"!==t.type||t.computed?"an operand":`…${t.property}`;console.warn(`${qn} "${e}" is an observable used in an expression, not its value - use "${e}.value". The expression reads as undefined until then.`)}throw new vs(name)}function ys(e,t,n){if(n>Un)throw new Gn("evaluation nests deeper than 64 levels");switch(e.type){case"Literal":return e.value;case"Identifier":return function(e,t){return In.has(e)?t[e]:fs(t.$data,e)}(e.name,t);case"Member":return fs(ys(e.object,t,n+1),e.computed?ys(e.property,t,n+1):e.property);case"Unary":{const s=bs(ys(e.argument,t,n+1),e.argument);switch(e.operator){case"!":return!s;case"-":return-s;default:return+s}}case"Logical":{const s=bs(ys(e.left,t,n+1),e.left);return"&&"===e.operator?s?ys(e.right,t,n+1):s:s||ys(e.right,t,n+1)}case"Binary":{const s=bs(ys(e.left,t,n+1),e.left),o=bs(ys(e.right,t,n+1),e.right);switch(e.operator){case"+":return s+o;case"-":return s-o;case"*":return s*o;case"/":return s/o;case"%":return s%o;case"===":return s===o;case"!==":return s!==o;case"<":return s<o;case"<=":return s<=o;case">":return s>o;default:return s>=o}}case"Conditional":return bs(ys(e.test,t,n+1),e.test)?ys(e.consequent,t,n+1):ys(e.alternate,t,n+1);case"Call":return function(e,t){const n=Xn.get(e)??Jn.get(e);if("function"==typeof n)return n(...t);ts.has(e)||(ts.add(e),console.warn(`${qn} no helper named "${e}" is registered - expressions can only call helpers registered with registerHelper()`))}(e.callee,e.args.map(e=>ys(e,t,n+1)));case"ArrayLiteral":return e.elements.map(e=>ys(e,t,n+1));case"ObjectLiteral":{const s={};for(const{key:o,value:i}of e.entries)Object.defineProperty(s,o,{value:ys(i,t,n+1),enumerable:!0,writable:!0,configurable:!0});return s}case"MethodCall":throw new Gn("an expression cannot call a method - `x.foo()` is available to data-on-* handlers only, because a call during a render is a side effect");default:throw new Gn(`unknown node type "${e.type}"`)}}function _s(e,t={}){const n="string"==typeof e?e:String(e??""),s=!0===t.methodCalls,o=s?Qn:Zn;if(o.has(n))return o.get(n);let i=null;try{i=us(n,s),es.set(i,n)}catch(e){const s=t.template?` in template "${t.template}"`:"";console.warn(`${qn} could not parse expression "${n}"${s}: ${e.message}. The binding is skipped.`),i=null}return o.size>=1e3&&o.clear(),o.set(n,i),i}function ks(e,t){if(null!==e&&"object"==typeof e&&"string"==typeof e.type)try{return ys(e,Rn(t),0)}catch(t){if(t instanceof vs)return;const n=es.get(e);return void console.warn(`${qn} expression ${void 0===n?"(not from parseExpression) ":`"${n}" `}threw during evaluation:`,t)}}function ws(e,t={}){const n=_s(e,t);return null===n?null:e=>ks(n,e)}function xs(e,t={}){const n="string"==typeof e?_s(e,t):e,s=new Set;if(null===n||"object"!=typeof n)return s;const o=[n];for(;o.length>0;){const e=o.pop();if(null!==e&&"object"==typeof e)if("Identifier"!==e.type)if("Member"!==e.type||e.computed||"Identifier"!==e.object?.type||"$data"!==e.object.name&&"$root"!==e.object.name)for(const t of ms(e))o.push(t);else s.add(e.property);else In.has(e.name)||s.add(e.name)}return s}function Ms(e,t){if("string"!=typeof e||!function(e){if(0===e.length||!ss.test(e[0]))return!1;for(const t of e.slice(1))if(!os.test(t))return!1;return!Yn.has(e)}(e))throw new TypeError(`${qn} registerHelper: "${String(e)}" is not a valid helper name (it must be a plain identifier, so that an expression can spell it)`);if("function"!=typeof t)throw new TypeError(`${qn} registerHelper: "${e}" was given a ${typeof t}, not a function`);return Xn.set(e,t),ts.delete(e),t}const Ls=/&(?:lt|gt|quot|apos|nbsp|amp|#39|#x27|#47|#x2[Ff]|#96|#x60);/g,Cs={"<":"<",">":">",""":'"',"'":"'","'":"'","'":"'"," ":" ","&":"&","/":"/","/":"/","/":"/","`":"`","`":"`"};function Es(e){return e.includes("&")?e.replace(Ls,e=>Cs[e]):e}const As=/\{\{#(if|unless|each|with)\s+([^}]+?)\s*\}\}/,Ss=/\{\{([#/])(if|unless|each|with)(?:\s+[^}]*?)?\s*\}\}|\{\{else\}\}/g,$s=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,zs=/\{\{>\s*([^{}]+?)\s*\}\}/g,Ts=/\{\{!\s*[^{}]*?\s*\}\}/g,js=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,Bs=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,Ds=/[?:()[\]'"!<>=*/%]|&&|\|\||\s[-+]\s/,Ws={"&":"&","<":"<",">":">",'"':""","'":"'"},Hs=e=>null==e?"":String(e);function Os(e){return Array.isArray(e)?e.length>0:Boolean(e)}function Is(e){if(!Array.isArray(e))return[];for(let t=0;t<e.length;t++){const n=e[t];if(null!==n&&"object"==typeof n&&!0===n._destroy)return e.filter(e=>!(null!==e&&"object"==typeof e&&!0===e._destroy))}return e}function Ns(e,t,n){const s=function(e,t,n){const s=e.trim();if("."===s)return null!==t&&"object"==typeof t&&"."in t?t["."]:t;return s.startsWith("@")?t?.[s]:Bs.test(s)||!Ds.test(s)?function(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}(t,s):function(e,t,n={}){return ks(_s(e,n),t)}(s,t,n)}(e,t,n);if(!fn(s))return s;const o=e.trim();Ps.has(o)||(Ps.add(o),console.warn(`[Domma Reactive] "${o}" is an observable, not its value - use "${o}.value". It renders as empty until then.`))}const Ps=new Set;function Vs(e,t,n){return e.replace(Ts,"").replace(zs,(e,s)=>{const o=n.partials?.[s.trim()];return void 0===o?"":Fs(o,t,n)}).replace($s,(e,s)=>Hs(Ns(s,t,n))).replace(js,(e,s)=>Hs(Ns(s,t,n)).replace(/[&<>"']/g,e=>Ws[e]))}function Fs(e,t={},n={}){if("string"!=typeof e||0===e.length)return"";const s=e.match(As);if(!s)return Vs(e,t,n);const[o,i,r]=s,a=s.index+o.length,{close:l,alternate:d}=function(e,t,n){let s=0,o=-1;for(const i of e.slice(n).matchAll(Ss)){const e=n+i.index;if(void 0!==i[1])if("#"!==i[1]){if(0!==s)s--;else if(i[2]===t)return{close:e,alternate:o}}else s++;else 0===s&&-1===o&&(o=e)}return{close:-1,alternate:-1}}(e,i,a);if(-1===l)return Vs(e,t,n);const c="if"===i&&-1!==d&&d<l,h=e.slice(a,c?d:l),u=c?e.slice(d+8,l):"",p=Vs(e.slice(0,s.index),t,n),m=Fs(e.slice(l+`{{/${i}}}`.length),t,n),f=Ns(r,t,n);let g="";if("if"===i)g=Os(f)?Fs(h,t,n):Fs(u,t,n);else if("unless"===i)g=Os(f)?"":Fs(h,t,n);else if("each"===i){const e=Is(f);g=e.map((t,s)=>Fs(h,function(e,t,n){const s={"@index":t,"@first":0===t,"@last":t===n-1};return null!==e&&"object"==typeof e?{...e,...s}:{".":e,...s}}(t,s,e.length),n)).join("")}else g=null!==f&&"object"==typeof f?Fs(h,f,n):"";return p+g+m}const Rs="[Domma Reactive]",qs=new Map,Us=new Set;function Ks(e,t){Us.has(e)||(Us.add(e),console.warn(`${Rs} ${t}`))}function Ys(e,t){if("string"!=typeof e||0===e.length)throw new TypeError(`${Rs} registerBinding: the name must be a non-empty string`);if(null===t||"object"!=typeof t)throw new TypeError(`${Rs} registerBinding: "${e}" was not given a handler object`);if("function"!=typeof t.update)throw new TypeError(`${Rs} registerBinding: "${e}" has no update() function`);for(const n of["attach","detach"])if(void 0!==t[n]&&"function"!=typeof t[n])throw new TypeError(`${Rs} registerBinding: "${e}".${n} is not a function`);return qs.has(e)&&console.warn(`${Rs} registerBinding: "${e}" replaces an existing binding handler`),qs.set(e,Object.freeze({...t})),t}function Gs(e){return qs.get(e)}function Xs(e){let t=null;for(const[n,s]of qs){if(s.attribute===e)return{kind:n,handler:s,arg:null};"string"==typeof s.attributePrefix&&e.startsWith(s.attributePrefix)&&e.length>s.attributePrefix.length&&(null===t||s.attributePrefix.length>t.handler.attributePrefix.length)&&(t={kind:n,handler:s,arg:e.slice(s.attributePrefix.length)})}return t}const Js=e=>null==e?"":String(e);function Zs(e,t){if(null===e||"object"!=typeof e)return null;if("Identifier"===e.type){if(In.has(e.name))return null;const n=t.$data;return null===n||"object"!=typeof n||(Object.isFrozen(n)||Kn.has(e.name))?null:{object:n,key:e.name}}if("Member"===e.type){const n=ks(e.object,t);if(null===n||"object"!=typeof n)return null;if(Object.isFrozen(n))return null;const s=Js(e.computed?ks(e.property,t):e.property);return Kn.has(s)?null:{object:n,key:s}}return null}const Qs={tracks:!0,update({binding:e,nodes:t,context:n}){const s=Js(e.evaluate(n));for(const e of t)e.textContent=s;return!0}},eo={tracks:!0,update({binding:e,nodes:t,context:n,render:s}){for(const o of t)for(const t of e.parts){const e=Es(s(t.tmpl,n.$data));o.setAttribute(t.name,e),"value"===t.name&&"value"in o&&(o.value=e)}return!0}},to={tracks:!0,capturesBody:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:o,reindex:i}){const r=s(e.body,n.$data);for(const e of t)o(e.open,e.close,r);return i(),!0}},no={tracks:!0,region:!0,capturesBody:!0,primes:!0,attribute:"data-if",expression:!0,update({binding:e,nodes:t,context:n,render:s,replaceRegion:o,reindex:i}){const r=Os(e.evaluate(n))?s(e.body,n.$data):"";for(const e of t)o(e.open,e.close,r);return i(),!0}},so=new WeakMap,oo={attributePrefix:"data-on-",expression:!0,methodCalls:!0,tracks:!1,update:()=>!1,attach({binding:e,node:t,controller:n}){if(!e.arg)return;const s=t=>function(e,t,n){const s=e.ast;if(null===s)return;let o,i,r=n.$data;if("MethodCall"===s.type){r=ks(s.object,n);o=fs(r,s.computed?ks(s.property,n):s.property),i=s.args.map(e=>ks(e,n))}else"Call"===s.type?(o=ks({type:"Identifier",name:s.callee},n),i=s.args.map(e=>ks(e,n))):(o=ks(s,n),i=[]);if("function"!=typeof o)return void Ks(`event:${e.id}:${e.expr}`,`data-on-${e.arg}="${e.expr}" did not resolve to a function - an event binding names a handler on your data, or calls one`);!1===o.call(r,...i,t)&&t.preventDefault()}(e,t,n.context());t.addEventListener(e.arg,s);let o=so.get(t);o||so.set(t,o=new Map),o.set(e.id,{type:e.arg,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);n&&(t.removeEventListener(n.type,n.listener),so.get(t).delete(e.id))}};const io=new Set(["value","checked","selected","disabled","readonly","required","multiple","indeterminate","open","hidden"]),ro=new WeakMap,ao=new WeakMap,lo={attributePrefix:"data-bind-",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.arg;if("html"===s)return Ks("bind:html","data-bind-html is not supported - assigning innerHTML from data is an XSS hole. Use {{{triple-stache}}}, which says so where an author can see it."),!1;const o=e.evaluate(n);for(const n of t)"text"===s?n.textContent=Js(o):"class"===s?co(e,n,o):"style"===s?po(e,n,o):s.startsWith("style-")?ho(n,s.slice(6),o):io.has(s)&&s in n?n[s]="value"===s?Js(o):Boolean(o):null==o||!1===o?n.removeAttribute(s):n.setAttribute(s,!0===o?"":Js(o));return!0}};function co(e,t,n){let s=ro.get(e);s||ro.set(e,s=new WeakMap);for(const e of s.get(t)||[])t.classList.remove(e);const o=n?Js(n).split(/\s+/).filter(Boolean):[];for(const e of o)t.classList.add(e);s.set(t,o)}function ho(e,t,n){null!=n&&!1!==n&&""!==n?e.style.setProperty(t,Js(n)):e.style.removeProperty(t)}function uo(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function po(e,t,n){if(null!=n&&"object"!=typeof n)return void Ks(`bind:style:${e.id}`,`data-bind-style="${e.expr}" needs an object of CSS properties - got `+typeof n+". For a single property use data-bind-style-<property>.");let s=ao.get(e);s||ao.set(e,s=new WeakMap);const o=s.get(t)||[],i=[];for(const[e,s]of Object.entries(n||{})){const n=uo(e);ho(t,n,s),i.push(n)}for(const e of o)i.includes(e)||t.style.removeProperty(e);s.set(t,i)}const mo=Symbol("dm:option-value"),fo=Symbol("dm:pending-value"),go={attribute:"data-options",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Is(e.evaluate(n));for(const o of t)bo(e,o,s,n);return!0}};function vo(e,t){const n=e.getAttribute(t);return null===n||""===n.trim()?null:ws(n)}function bo(e,t,n,s){if("SELECT"!==t.tagName)return void Ks(`options:${e.id}`,`data-options="${e.expr}" is on <${t.tagName.toLowerCase()}>, which has no options. Put it on a <select>.`);const o=vo(t,"data-options-text"),i=vo(t,"data-options-value"),r=vo(t,"data-options-caption"),a=fo in t?[].concat(t[fo]):function(e){return[...e.options].filter(e=>e.selected).map(e=>mo in e?e[mo]:e.value)}(t);if(t.textContent="",r){const e=document.createElement("option");e.value="",e.textContent=Js(r(s)),t.appendChild(e)}n.forEach((e,r)=>{const a=Vn(s,e,r,n.length),l=document.createElement("option");l.textContent=Js(o?o(a):e);const d=i?i(a):e;null==d||"object"==typeof d?(l.value=`\0opt:${r}`,l[mo]=d):"string"!=typeof d?(l.value=Js(d),l[mo]=d):l.value=d,t.appendChild(l)}),function(e,t){if(0===t.length)return;let n=!1;for(const s of e.options){const o=mo in s?s[mo]:s.value,i=t.some(e=>e===o);e.multiple?(s.selected=i,n=n||i):i&&!n&&(s.selected=!0,n=!0)}e.multiple||n||(e.selectedIndex=e.options.length>0?0:-1);n&&delete e[fo]}(t,a)}const yo={attribute:"data-model",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=e.evaluate(n);for(const e of t)xo(e,s);return!0},attach({binding:e,node:t,controller:n}){const s=()=>{const s=n.context(),o=Zs(e.ast,s);if(null===o)return void Ks(`model:${e.id}:${e.expr}`,`data-model="${e.expr}" is not a settable path, so nothing was written`);const i=function(e){switch(ko(e)){case"checkbox":return e.checked;case"radio":return e.checked?e.value:_o;case"select-multiple":return Array.from(e.options).filter(e=>e.selected).map(wo);case"select":return-1===e.selectedIndex?"":wo(e.options[e.selectedIndex]);case"number":return""===e.value?null:Number(e.value);default:return e.value}}(t);i!==_o&&(o.object[o.key]=i)},o=function(e){const t=ko(e);return"text"===t||"number"===t?["input","change"]:["change"]}(t);for(const e of o)t.addEventListener(e,s);let i=so.get(t);i||so.set(t,i=new Map),i.set(e.id,{type:o,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);so.get(t).delete(e.id)}}},_o=Symbol("no-write");function ko(e){const t=e.tagName;if("SELECT"===t)return e.multiple?"select-multiple":"select";if("INPUT"!==t)return"text";const n=String(e.type||"").toLowerCase();return"checkbox"===n||"radio"===n?n:"number"===n||"range"===n?"number":"text"}function wo(e){return mo in e?e[mo]:e.value}function xo(e,t){switch(ko(e)){case"checkbox":{const n=Boolean(t);return void(e.checked!==n&&(e.checked=n))}case"radio":{const n=Js(t)===e.value;return void(e.checked!==n&&(e.checked=n))}case"select-multiple":{const n=Array.isArray(t)?t:[];if(0===e.options.length)return void(n.length>0&&(e[fo]=n));const s=new Set(n.map(Js));for(const t of e.options){const e=wo(t),o=n.some(t=>t===e)||s.has(t.value);t.selected!==o&&(t.selected=o)}return}case"select":{const n=function(e,t){return[...e.options].find(e=>wo(e)===t)||null}(e,t);if(n)return n.selected||(n.selected=!0),void delete e[fo];const s=Js(t);return e.value!==s&&(e.value=s),void(e.value!==s?e[fo]=t:delete e[fo])}default:{const n=Js(t);e.value!==n&&(e.value=n)}}}const Mo=new WeakSet,Lo={attribute:"data-focus",expression:!0,tracks:!0,primes:!0,update({binding:e,nodes:t,context:n}){const s=Os(e.evaluate(n));for(const e of t){if("function"!=typeof e.focus)continue;if(s!==(e.ownerDocument.activeElement===e)){Mo.add(e);try{s?e.focus():e.blur()}finally{Mo.delete(e)}}}return!0},attach({binding:e,node:t,controller:n}){const s=s=>{if(Mo.has(t))return;const o=n.context(),i=Zs(e.ast,o);null!==i?i.object[i.key]="focus"===s.type:Ks(`focus:${e.id}:${e.expr}`,`data-focus="${e.expr}" is not a settable path, so focus was not written back. Focus still follows the value.`)},o=["focus","blur"];for(const e of o)t.addEventListener(e,s);let i=so.get(t);i||so.set(t,i=new Map),i.set(e.id,{type:o,listener:s})},detach({binding:e,node:t}){const n=so.get(t)?.get(e.id);if(n){for(const e of n.type)t.removeEventListener(e,n.listener);so.get(t).delete(e.id)}}};Ys("text",Qs),Ys("attr",eo),Ys("block",to),Ys("raw",to),Ys("if",no),Ys("event",oo),Ys("bind",lo),Ys("model",yo),Ys("options",go),Ys("focus",Lo);const Co=new WeakMap;let Eo=0;function Ao(e,t){if(null==e||"function"!=typeof t)return;let n=Co.get(e);n||Co.set(e,n=new Set),n.add(t),Eo++}function So(e){const t=Co.get(e);if(t){Co.delete(e),Eo-=t.size;for(const e of t)try{e()}catch(e){console.warn("[Domma Reactive] a disposer threw:",e)}}}function $o(e){if(0===Eo||null==e)return;if(So(e),1!==e.nodeType&&11!==e.nodeType)return;const t=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null),n=[];let s;for(;s=t.nextNode();)Co.has(s)&&n.push(s);for(const e of n)So(e)}const zo=["data-dm-t","data-dm-a","data-dm-b"];zo.map(e=>`[${e}]`).join(",");const To=e=>`\x3c!--dm:${e}--\x3e`,jo=e=>`\x3c!--/dm:${e}--\x3e`;function Bo(e){const t=document.createElement("template");return t.innerHTML=e,t.content}function Do(e,t){const n=[];for(let s=e.nextSibling;s&&s!==t;s=s.nextSibling)n.push(s);return n}function Wo(e,t,n){const s=e.parentNode;if(!s)return;let o=e.nextSibling;for(;o&&o!==t;){const e=o.nextSibling;$o(o),s.removeChild(o),o=e}n&&s.insertBefore(Bo(n),t)}const Ho="[Domma Reactive]";function Oo(e){const{bindings:t,getRoots:n,render:s,reactive:o=!1,label:i="",repaint:r=null}=e,a=new Map(t.map(e=>[e.id,e]));for(const e of t)e.seen=new WeakSet;const l=new Map;let d=[],c=!1,h=!1,u=Rn(e.context);function p(){h||(function(e,t,n){for(const e of n)e.nodes=null;const s=(e,n)=>{const s=t.get(e);s&&(s.nodes||=[]).push(n)},o=e=>{for(const t of zo){const n=e.getAttribute(t);if(null!==n)for(const t of n.split(/\s+/))s(t,e)}},i=new Map,r=e=>{const t=e.data;if(t.startsWith("/dm:")){const n=t.slice(4),o=i.get(n);if(!o)return;s(n,{open:o,close:e}),i.delete(n)}else t.startsWith("dm:")&&i.set(t.slice(3),e)};for(const t of e){if(8===t.nodeType){r(t);continue}if(1!==t.nodeType&&11!==t.nodeType)continue;1===t.nodeType&&o(t);const e=t.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_COMMENT,null);let n;for(;n=e.nextNode();)8===n.nodeType?r(n):o(n)}}(n(),a,t),function(){for(const e of t){if(null===e.nodes){f(e.id);continue}const t=Gs(e.kind);let n=!1;for(const s of e.nodes){const o=void 0===s.nodeType?s.open:s;e.seen.has(o)||(e.seen.add(o),n=!0,void 0!==s.nodeType&&t?.attach?.({binding:e,node:s,controller:g}))}n&&(o||!0===e.prime)&&d.push(e)}}(),function(){if(c)return;c=!0;try{let e=0;for(;d.length>0;){if(++e>20){console.warn(`${Ho} a binding kept revealing new nodes after 20 rounds; giving up so the page still renders. Kinds still pending: ${[...new Set(d.map(e=>e.kind))].join(", ")}`);break}const t=d;d=[];for(const e of[!0,!1])for(const n of t)!0===Gs(n.kind)?.region===e&&m(n)}}finally{c=!1,d=[]}}())}function m(e){if(!o)return void g.update(e.id);const t=l.get(e.id);!t||t.disposed?l.set(e.id,En(()=>g.update(e.id),{label:`${i||"binding"}:${e.id}`})):t.recompute()}function f(e){const t=l.get(e);t&&(l.delete(e),t.dispose())}const g={bindings:t,deps:e=>a.get(e)?.deps||new Set,context:()=>u,setContext(e){u=Rn(e)},refresh(e=null){for(const n of t)null!==n.nodes&&0!==n.nodes.length&&(null!==e&&!0!==e(n)||m(n))},index:p,update(e,t){if(void 0!==t&&(u=Rn(t)),h)return!1;const n=a.get(e);if(!n||!n.nodes||0===n.nodes.length)return!1;const o=Gs(n.kind);return void 0!==o&&!0===o.update({binding:n,nodes:n.nodes,context:u,render:s,replaceRegion:Wo,reindex:p,controller:g})},updateAll(e){void 0!==e&&(u=Rn(e));for(const e of t)g.update(e.id)},rerenderAll(e){void 0!==e&&(u=Rn(e)),r?.(u),p()},rerender(e){g.rerenderAll(e)},destroy(){h=!0;for(const e of t){const t=Gs(e.kind);if(void 0!==t?.detach&&null!==e.nodes)for(const n of e.nodes)void 0!==n.nodeType&&t.detach({binding:e,node:n,controller:g})}for(const e of l.values())e.dispose();l.clear();for(const e of n())$o(e)},effectCount:()=>l.size};return g}const Io=new WeakMap,No=new Set;function Po(e,t){No.has(e)||(No.add(e),console.warn(`[Domma Reactive] ${t}`))}function Vo(e,t,n,s,o,i={}){const r=document.createComment("dm:item"),a=document.createComment("/dm:item"),l=e.content.cloneNode(!0);l.insertBefore(r,l.firstChild),l.appendChild(a);const d=Oo({bindings:e.bindings.map(e=>({...e})),render:e.render,context:i.context??Vn(t,n,s,o),getRoots:()=>Do(r,a),reactive:!0,label:e.label}),c={key:null,item:n,index:s,length:o,parentContext:t,open:r,close:a,runtime:d,disposed:!1,allNodes:()=>[r,...Do(r,a),a],refresh(t,n,s,o){const i=t.$data!==c.parentContext.$data||t.$root!==c.parentContext.$root||!0===e.usesAncestors&&t!==c.parentContext||n!==c.item,r=s!==c.index||!0===e.usesLength&&o!==c.length;return c.item=n,c.index=s,c.length=o,c.parentContext=t,!(!i&&!r)&&(d.setContext(Vn(t,n,s,o)),d.refresh(i?null:e=>!0===e.positional),!0)},dispose(e=!0){if(c.disposed)return;c.disposed=!0,function(e,t){const n=Co.get(e);!n||!n.delete(t)||(Eo--,0===n.size&&Co.delete(e))}(r,h),d.destroy();for(const e of Do(r,a))$o(e);if(!e)return;const t=r.parentNode;if(t)for(const e of c.allNodes())t.removeChild(e)}},h=()=>c.dispose(!1);return Ao(r,h),d.index(),c}function Fo(e,t){let n=e;for(const e of t.split(".")){if(null==n)return;n=n[e]}return n}function Ro(e,t,n,s,o,i){let r=Io.get(e.open);void 0===r&&(r={byKey:new Map},Io.set(e.open,r),Ao(e.open,()=>{for(const e of r.byKey.values())e.dispose(!1);r.byKey=new Map}));const a=r.byKey,l=new Map,d=[],c=Is(t);for(let e=0;e<c.length;e++){const t=c[e];let r=Fo(t,s);null==r?(Po(`key:missing:${i}:${s}`,`key=${s} is missing on an item of ${i} - falling back to position for that item, which reconciles no better than an unkeyed block. Give every item a stable identifier.`),r=`\0position:${e}`):l.has(r)&&(Po(`key:duplicate:${i}:${s}`,`two items of ${i} share key=${s} value "${String(r)}" - a key must identify exactly one item. The duplicate is being kept apart by position, so it will not reconcile across changes.`),r=`\0duplicate:${e}:${String(r)}`);let h=a.get(r);void 0===h?(h=Vo(n,o,t,e,c.length),h.key=r):(a.delete(r),h.refresh(o,t,e,c.length)),l.set(r,h),d.push(h)}for(const e of a.values())e.dispose();!function(e,t){const n=e.parentNode;if(!n)return;let s=e;for(const e of t)if(s.nextSibling!==e.open)for(const t of e.allNodes())n.insertBefore(t,s.nextSibling),s=t;else s=e.close}(e.open,d),r.byKey=l}function qo(e){return{tracks:!0,region:!0,primes:!0,acceptsReactive:!0,update({binding:t,nodes:n,context:s,render:o}){const i=e(t,o),r=(a=t.evaluate(s),Array.isArray(a)?a:null!==a&&"object"==typeof a&&Array.isArray(a.value)?a.value:[]);var a;for(const e of n)Ro(e,r,i,t.keyPath,s,i.label);return!0}}}const Uo="[Domma Reactive]",Ko=new Map,Yo=new Set;function Go(e,t){Yo.has(e)||(Yo.add(e),console.warn(`${Uo} ${t}`))}function Xo(e){return Ko.get(e)}const Jo="data-param-";function Zo(e){return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}function Qo(e,t,n){const s={},o=e.getAttribute("data-params");if(null!==o&&""!==o.trim()){const e=ws(o),i=null===e?null:e(n);null===e?Go(`component:params:${t.id}`,`data-params="${o}" did not parse, in ${t.expr}`):null===i||"object"!=typeof i?Go(`component:params:${t.id}`,`data-params="${o}" needs an object of params - got ${null===i?"null":typeof i}, in ${t.expr}`):Object.assign(s,i)}for(const o of[...e.attributes]){if(!o.name.startsWith(Jo))continue;const e=Zo(o.name.slice(11));if(""===e)continue;const i=ws(o.value);null!==i?(e in s&&Go(`component:collide:${t.id}:${e}`,`"${e}" is given by both data-params and ${o.name}, in ${t.expr}. The attribute wins, but one of the two is redundant.`),s[e]=i(n)):Go(`component:param:${t.id}:${e}`,`${o.name}="${o.value}" did not parse, in ${t.expr}`)}return Object.freeze(s)}function ei(e){const t=new Map;for(const n of[...e.childNodes]){const e=1===n.nodeType?n.getAttribute("data-slot")??"":"";t.has(e)||t.set(e,[]),t.get(e).push(n),n.remove()}return t}function ti(e,t){const n=`dm:${t}`,s=`/dm:${t}`;let o=null,i=null;const r=e=>{if(8!==e.nodeType)for(const t of e.childNodes)r(t);else e.data===n?o=e:e.data===s&&(i=e)};for(const t of e)if(r(t),null!==o&&null!==i)return{open:o,close:i};return null}function ni(e,t){const n=[];for(let s=e.nextSibling;null!==s&&s!==t;s=s.nextSibling)n.push(s);return n}function si(e,t,n,s,o){const i=[],r=e.allNodes(),a=new Set;for(const e of t.slots??[]){if(a.has(e.name)){Go(`component:slot:duplicate:${s.id}:${o}:${e.name}`,`the component "${o}" declares more than one `+(""===e.name?"default slot":`slot named "${e.name}"`)+". The first is filled and the rest keep their fallback content.");continue}a.add(e.name);const t=n.get(e.name);if(void 0===t||0===t.length)continue;const l=ti(r,e.id);if(null!==l){for(const e of ni(l.open,l.close))e.remove();for(const e of t)l.close.parentNode.insertBefore(e,l.close);i.push({name:e.name,nodes:t})}}for(const[e,t]of n)a.has(e)||0===t.length||t.every(e=>3===e.nodeType&&""===e.data.trim())||Go(`component:slot:unmatched:${s.id}:${o}:${e}`,""===e?`the component "${o}" was given content but declares no {{#slot}}, so that content is not rendered. Add a slot to its template, or remove the content.`:`the component "${o}" has no slot named "${e}", so that content is not rendered. Check data-slot against the template's {{#slot}} blocks.`);return i}const oi=new WeakMap;function ii(e,t,n,s,o){if(void 0===e.create)return t;try{return e.create(t,{element:n})}catch(e){return Go(`component:create:${s.id}:${o}`,`the component "${o}" threw while being created, in ${s.expr}: ${e&&e.message}`),null}}function ri(e){if(null===e.instance)return;for(const{nodes:t}of e.placed)for(const e of t)e.remove();e.placed=[];const t=e.viewModel;if(null!==t&&"object"==typeof t&&"function"==typeof t.dispose)try{t.dispose()}catch(e){console.warn(`${Uo} a component's dispose() threw:`,e)}e.instance.dispose(),e.instance=null,e.viewModel=null,e.name=null}const ai="[Domma Reactive]",li=/\{\{([#/])(if|unless|each|with|slot)(?:\s+([^}]+?))?\s*\}\}/g,di=/\{\{\{\s*([^{}]+?)\s*\}\}\}/g,ci=/\{\{(?!\{)\s*([^#/>!{}][^{}]*?)\s*\}\}/g,hi=/\{\{>\s*[^{}]+?\s*\}\}/,ui=/\sdata-each\s*=\s*(?:"([^"]*)"|'([^']*)')/,pi=/<([a-zA-Z][\w:-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)(\/?)>/g,mi=/([\w:@.-]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g,fi=/^[A-Za-z_$][\w$]*(?:\.[\w$]+)*$/,gi=/^[@.]/,vi={".":e=>e.$data,"@index":e=>e.$index,"@first":e=>0===e.$index,"@last":e=>null!==e.$length&&e.$index===e.$length-1},bi=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),yi={text:"txt",attr:"attr",raw:"raw",block:"blk"};function _i(e,t){if(0===t.length)return e;const n=[...t].sort((e,t)=>e.index-t.index||(e.order??0)-(t.order??0));let s="",o=0;for(const t of n)t.index<o||(s+=e.slice(o,t.index)+t.text,o=t.index+(t.skip??0));return s+e.slice(o)}function ki(e,t){let n=null;for(const s of t)e>=s[0]&&e<s[1]&&(!n||s[0]>n[0])&&(n=s);return n}function wi(e,t){for(const[n,s]of t)if(e>=n&&e<s)return!0;return!1}function xi(e){return String(e).trim().split(".")[0]}function Mi(e,t){const n=String(t).trim().split(".");let s=e;for(const e of n){if(null==s)return;s=s[e]}return s}function Li(e){const t=new Set;for(const n of e.matchAll(ci)){const e=n[1].trim();fi.test(e)&&t.add(xi(e))}for(const n of e.matchAll(di)){const e=n[1].trim();fi.test(e)&&t.add(xi(e))}return t}function Ci(e){const t=[],n=[];for(const s of e.matchAll(li)){if("#"===s[1]){t.push({start:s.index,kind:s[2],expr:(s[3]||"").trim()});continue}let e=null;for(;t.length>0;){const n=t.pop();if(n.kind===s[2]){e=n;break}}e&&n.push({start:e.start,end:s.index+s[0].length,kind:e.kind,expr:e.expr})}return n}function Ei(e,t){const n=e.lastIndexOf("<",t);return-1!==n&&n>e.lastIndexOf(">",t)}function Ai(e,t){const n=t[1],s=t.index,o=s+t[0].length;if("/"===t[3]||bi.has(n.toLowerCase()))return[s,o];const i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`<(/?)${i}(?=[\\s/>])`,"gi");let a=1;for(const t of e.slice(o).matchAll(r)){const n=o+t.index;if("/"===t[1]){if(a--,a>0)continue;const t=e.indexOf(">",n);return-1===t?null:[s,t+1]}const i=e.indexOf(">",n);-1!==i&&"/"===e[i-1]||a++}return null}function Si(e,t){const n=[];for(const s of t){if("each"!==s.kind&&"with"!==s.kind)continue;const t=e.indexOf(To(s.id)),o=e.indexOf(jo(s.id));-1!==t&&-1!==o&&n.push([t,o,s])}return n}const $i=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,zi=/\s+key\s*=\s*[A-Za-z_$][\w$]*(?:\.[\w$]+)*/,Ti=new Set;function ji(e){const t=$i.exec(String(e));return null===t||""===t[1].trim()?null:{collection:t[1].trim(),key:t[2]}}function Bi(e,t){const n=/^\{\{#(?:if|unless|each|with|slot)(?:\s+[^}]*?)?\s*\}\}/.exec(e.slice(t.start,t.end)),s=/\{\{\/(?:if|unless|each|with|slot)\s*\}\}$/.exec(e.slice(t.start,t.end));return null===n||null===s?[t.start,t.end]:[t.start+n[0].length,t.start+s.index]}function Di(e,t){const n=[];for(const s of t){if(!0!==Gs(s.kind)?.capturesBody)continue;const t=To(s.id),o=e.indexOf(t),i=e.indexOf(jo(s.id));-1!==o&&-1!==i&&n.push([o+t.length,i])}n.sort((e,t)=>e[0]-t[0]);let s="",o=0;for(const[t,i]of n)t<o||(s+=e.slice(o,t),o=i);return s+=e.slice(o),s.replace(/\{\{\{[^{}]*\}\}\}/g,"").replace(/\{\{[^{}]*\}\}/g,"")}const Wi=/\$index|\$length|@index|@first|@last/;function Hi(e){const t=(e.parts??[]).map(e=>e.tmpl).join(" ");return`${e.expr??""} ${e.body??""} ${t}`}let Oi=0;function Ii(e,t,n,s,o){const{annotated:i,bindings:r,slots:a}=Ri(e,{...s,itemForms:!0,template:t,idPrefix:o});for(const e of r)e.positional=Wi.test(Hi(e));return{content:Bo(Di(i,r)),bindings:r,slots:a,render:n,label:t,options:s,usesLength:/@last|\$length/.test(e),usesAncestors:/\$parentContext|\$parents/.test(e)}}function Ni(e,t,n=[]){if(!1===t.warnUnkeyed&&0===n.length)return;const s=`${t.template??""}|${e}`;if(Ti.has(s))return;Ti.add(s);const o=t.template?` in template "${t.template}"`:"",i=n.map(e=>`"${e}"`).join(", "),r=n.length?`, and its ${i} ${1===n.length?"binding is":"bindings are"} not attached`:"",a=n.length?` - ${1===n.length?"it binds":"they bind"} normally once the block has a key`:"";console.warn(`${ai} {{#each ${e}}}${o} has no key=, so it re-renders the whole block on every change - losing DOM node identity, focus and uncommitted input${r}. Write {{#each ${e} key=id}}, naming whichever property identifies an item, to reconcile instead${a}.`)}function Pi(e,t){const n=`demoted|${t.template??""}|${e}`;if(Ti.has(n))return;Ti.add(n);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ai} {{#each ${e}}}${s} sits inside an unkeyed {{#each}} or a {{#with}}, so it cannot reconcile: its collection would be resolved against the top-level data. It has been demoted to a plain re-rendered block. Add key= to the ENCLOSING block and both will reconcile.`)}function Vi(e,t){return null===e.factoryBox.value&&(e.factoryBox.value=function(e,t,n){const s=`${n.template?`${n.template} `:""}{{#each ${e.expr}}}`;return hi.test(e.body)&&console.warn(`${ai} {{> partial}} inside a keyed {{#each}} is not expanded - the block body is compiled once into a <template>, before any render pass exists to resolve a partial against. Inline it, in ${s}`),Ii(e.body,s,t,n,`i${++Oi}:`)}(e,t,e.factoryBox.options)),e.factoryBox.value}function Fi(e,t,n){const s={...n,methodCalls:!0===t.methodCalls},o=_s(e,s);return null===o?null:{ast:o,evaluate:gn(ws(e,s),{expr:e,where:n?.template?`template "${n.template}"`:"",handler:t}),deps:!1===t.tracks?new Set:xs(o)}}function Ri(e,t={}){const n=[],s=[],o=new Set,i=t.idPrefix??"",r=(e,n)=>{if(o.has(e))return;o.add(e);const s=t.template?` in template "${t.template}"`:"";console.warn(`${ai} ${n}${s}`)},a=ui.exec(e);if(null!==a){const e=a[1]??a[2]??"";r("inert-each",`data-each="${e}" does nothing here. It is an applyBindings spelling, and this is compiled markup - write {{#each ${e}}} … {{/each}} instead. A data-each nested inside another list is compiled markup too, which is the usual way to meet this`)}for(const t of e.matchAll(pi)){const e=t[2]||"";if(!e.includes("data-param-"))continue;if(/\sdata-component\s*=/.test(e))continue;const n=/\s(data-param-[\w-]+)/.exec(e);r("orphan-param",`${null===n?"data-param-*":n[1]} does nothing on an element with no data-component. Check the component attribute is present and spelled correctly - and remember its value is an expression, so a literal name takes quotes: data-component="'my-thing'"`)}const l=Ci(e),d=function(e){const t=[];for(const n of e.matchAll(pi)){const s=n[2]||"";if(s.includes("data-"))for(const o of s.matchAll(mi)){const s=Xs(o[1]);if(null===s||!s.handler.region)continue;const i=Ai(e,n);if(null===i)break;t.push({start:i[0],end:i[1],kind:s.kind,arg:s.arg,expr:Es(void 0!==o[2]?o[2]:o[3]||"").trim()});break}}return t}(e),c=[],h=new Set,u=l.filter(e=>"with"===e.kind||"each"===e.kind&&null===ji(e.expr)).map(e=>[e.start,e.end]);for(const e of l)"each"===e.kind&&null!==ji(e.expr)&&(u.some(([t,n])=>e.start>t&&e.end<=n)?(h.add(e.start),Pi(e.expr,t)):c.push([e.start,e.end]));const p=(e,t)=>c.some(([n,s])=>e>n&&t<=s),m=[...l.map((e,t)=>({...e,id:`${i}${t}_blk`,mustache:!0})).filter(e=>!p(e.start,e.end)),...d.map((e,t)=>({...e,id:`${i}${l.length+t}_${e.kind}`})).filter(e=>!p(e.start,e.end))],f=[];for(const t of m){if(t.mustache&&h.has(t.start)){const n=e.slice(t.start,t.end),s=zi.exec(n);null!==s&&f.push({index:t.start+s.index,text:"",order:1,skip:s[0].length}),t.expr=ji(t.expr)?.collection??t.expr}if(t.mustache&&"slot"===t.kind){const[n,o]=Bi(e,t);f.push({index:t.start,text:To(t.id),order:1,skip:n-t.start}),f.push({index:o,text:jo(t.id),order:0,skip:t.end-o}),s.push({id:t.id,name:t.expr});continue}const n=t.mustache&&"each"===t.kind&&!h.has(t.start)&&ji(t.expr);if(n){f.push({index:t.start,text:To(t.id)+jo(t.id),order:1,skip:t.end-t.start}),t.keyed=n;const[s,o]=Bi(e,t);t.rawBody=e.slice(s,o);continue}t.mustache&&"each"===t.kind&&(t.unkeyed=!0),f.push({index:t.start,text:To(t.id),order:1}),f.push({index:t.end,text:jo(t.id),order:0})}let g=_i(e,f),v=m.length;const b=e=>`${i}${v++}_${yi[e]??e}`;for(const e of m){if("slot"===e.kind)continue;if(-1===g.indexOf(To(e.id)))continue;if(e.keyed){const s=Gs("each"),o=Fi(e.keyed.collection,s,t);if(null===o)continue;n.push({id:e.id,kind:"each",blockKind:"each",expr:e.keyed.collection,keyPath:e.keyed.key,body:e.rawBody,ast:o.ast,evaluate:o.evaluate,deps:o.deps,prime:!0===s.primes,factoryBox:{value:null,options:t},nodes:null});continue}if(e.mustache){n.push({id:e.id,kind:"block",blockKind:e.kind,expr:e.expr,body:"",deps:fi.test(e.expr)?new Set([xi(e.expr)]):Li(e.expr),nodes:null});continue}const s=Gs(e.kind),o=Fi(e.expr,s,t);null!==o&&n.push({id:e.id,kind:e.kind,arg:e.arg,expr:e.expr,body:"",ast:o.ast,evaluate:o.evaluate,deps:o.deps,prime:!0===s.primes,nodes:null})}const y=[];for(const e of[...g.matchAll(di)]){if(wi(e.index,Si(g,m)))continue;const t=e[1].trim();if(!fi.test(t))continue;const s=b("raw");y.push({index:e.index,text:To(s),order:1}),y.push({index:e.index+e[0].length,text:jo(s),order:0}),n.push({id:s,kind:"raw",expr:t,body:e[0],deps:new Set([xi(t)]),nodes:null})}g=_i(g,y);const _=n.filter(e=>"raw"===e.kind).map(e=>{const t=g.indexOf(To(e.id)),n=g.indexOf(jo(e.id));return-1!==t&&-1!==n?[t,n+jo(e.id).length]:null}).filter(Boolean),k=Si(g,m),w=[];for(const e of[...g.matchAll(ci)]){if(wi(e.index,k))continue;if(wi(e.index,_))continue;if(Ei(g,e.index))continue;const s=qi(e[1].trim(),t,r);if(null===s)continue;const o=b("text");w.push({index:e.index,text:`<span data-dm-t="${o}">`,order:1}),w.push({index:e.index+e[0].length,text:"</span>",order:0}),n.push({id:o,...s,nodes:null})}g=_i(g,w);const x=Si(g,m),M=[],L=new Map;for(const e of[...g.matchAll(pi)]){const s=e[2]||"",o=wi(e.index,x),i=[],a=[];for(const l of s.matchAll(mi)){const s=l[1];if(s.startsWith("data-dm-"))continue;const d=void 0!==l[2]?l[2]:l[3]||"",c=Xs(s);if(null!==c){if(c.handler.region)continue;if(o){const t=ki(e.index,x)?.[2];if(t?.unkeyed){const e=L.get(t)??[];e.includes(s)||e.push(s),L.set(t,e)}else r(`shifted:${s}`,`"${s}" inside a {{#with}} block is not bound: {{#with}} re-renders its body as a whole, so there is nothing to attach it to. Write the full path instead (data-model="obj.field" rather than data-model="field" inside {{#with obj}}) and it binds normally.`);continue}const i=c.handler,l=Es(d).trim(),h=!1===i.expression?{ast:null,evaluate:null,deps:new Set}:Fi(l,i,t);if(null===h)continue;const u=b(c.kind);a.push(u),n.push({id:u,kind:c.kind,arg:c.arg,expr:l,ast:h.ast,evaluate:h.evaluate,deps:h.deps,prime:!0===i.primes,nodes:null});continue}if(o)continue;if(!d.includes("{{"))continue;const h=Li(d);0!==h.size&&i.push({name:s,tmpl:d,deps:[...h]})}const l=e.index+e[0].length-(e[3]?2:1);if(i.length>0){const e=b("attr"),t=new Set;for(const e of i)for(const n of e.deps)t.add(n);M.push({index:l,text:` data-dm-a="${e}"`,order:1}),n.push({id:e,kind:"attr",parts:i,deps:t,nodes:null})}a.length>0&&M.push({index:l,text:` data-dm-b="${a.join(" ")}"`,order:1})}g=_i(g,M);for(const e of n){if(!0!==Gs(e.kind)?.capturesBody)continue;const t=To(e.id),n=g.indexOf(t),s=g.indexOf(jo(e.id));-1!==n&&-1!==s&&(e.body=g.slice(n+t.length,s))}for(const e of m)e.unkeyed&&Ni(e.expr,t,L.get(e)??[]);return{annotated:g,bindings:n,slots:s}}function qi(e,t,n){if(!0===t.itemForms&&void 0!==vi[e])return{kind:"text",expr:e,evaluate:vi[e],deps:new Set,prime:!0};if(fi.test(e)){if(e.startsWith("$")){const n=Fi(e,Gs("text"),t);return null===n?null:{kind:"text",expr:e,ast:n.ast,evaluate:n.evaluate,deps:n.deps,prime:!0}}return{kind:"text",expr:e,evaluate:t=>Mi(t.$data,e),deps:new Set([xi(e)]),prime:!1}}if(gi.test(e)||!Ds.test(e))return null;const s=Fi(e,Gs("text"),t);return null===s?(n(`expr:${e}`,`"{{${e}}}" is not bound`),null):{kind:"text",expr:e,ast:s.ast,evaluate:s.evaluate,deps:s.deps,prime:!0}}Ys("each",qo(Vi));const Ui=new WeakMap;!function(e){Ys("component",function(e){return{tracks:!0,primes:!0,attribute:"data-component",expression:!0,update({binding:t,nodes:n,context:s,render:o}){const i=t.evaluate(s);for(const r of n){let n=oi.get(r);if(void 0===n&&(n={name:null,instance:null,viewModel:null,slots:null,placed:[]},oi.set(r,n),Ao(r,()=>ri(n))),n.name===i&&null!==n.instance)continue;if(ri(n),null===n.slots&&(n.slots=ei(r)),r.replaceChildren(),"string"!=typeof i||""===i){Go(`component:name:${t.id}`,`data-component="${t.expr}" needs a component name - got `+(null===i?"null":typeof i)+". Remember that a literal name takes quotes, because every binding value is an expression: data-component=\"'my-thing'\"");continue}const a=Xo(i);if(void 0===a){Go(`component:missing:${t.id}:${i}`,`no component is registered as "${i}", in ${t.expr}`);continue}const l=ii(a,Qo(r,t,s),r,t,i);if(null===l)continue;const d=e(a,i,o,t.options??{});n.name=i,n.viewModel=l,n.instance=Vo(d,s,l,null,null,{context:Fn(s,l)}),n.placed=si(n.instance,d,n.slots,t,i),n.placed.length>0&&n.instance.runtime.index(),r.append(...n.instance.allNodes())}return!0},detach({node:e}){const t=oi.get(e);void 0!==t&&ri(t)}}}(e))}(function(e,t,n,s){let o=Ui.get(e);return void 0===o&&(o=function(e,t,n,s){return Ii(e,t,n,s,`c${++Oi}:`)}(e.template,`component ${t}`,n,s),Ui.set(e,o)),o});const Ki={annotate:Ri,compile:function(e,t,n,s,o={}){const i="function"==typeof s?s:Fs,{annotated:r,bindings:a}=Ri(e,o),l=e=>{n.replaceChildren(Bo(i(r,e.$data)))},d=Oo({bindings:a,render:i,context:Rn(t),getRoots:()=>[...n.childNodes],reactive:!0===o.reactive,label:o.template,repaint:l});return l(d.context()),d.index(),d},scanBlocks:Ci,resolvePath:Mi},Yi="[Domma Reactive]",Gi="data-each",Xi=/^([\s\S]*?)\s+key\s*=\s*([A-Za-z_$][\w$]*(?:\.[\w$]+)*)\s*$/,Ji=/^\s*dm\s+([a-zA-Z][\w-]*)\s*:\s*([\s\S]+?)\s*$/,Zi=/^\s*\/dm\s*$/,Qi=/\{\{\s*[\w$][\w$.]*\s*\}\}/,er="data-dm-bound",tr=new WeakSet,nr=new Set;function sr(e,t){nr.has(e)||(nr.add(e),console.warn(`${Yi} ${t}`))}function or(e){if(!e||1!==e.nodeType)return String(e);const t=e.id?`#${e.id}`:"",n=e.classList?.length?`.${[...e.classList].join(".")}`:"";return`<${e.tagName.toLowerCase()}${t}${n}>`}function ir(e,t){if(null!=e&&1===e.nodeType&&!1!==t(e))for(const n of[...e.children])ir(n,t)}function rr(e,t,n={}){if(null==t||1!==t.nodeType)throw new TypeError(`${Yi} applyBindings: expected an element to activate, got ${String(t)}`);const s="function"==typeof n.render?n.render:Fs,o=n.template||or(t);let i=Rn(e);const r=[],a=[],l=[];let d=!1,c=0;const h={context:()=>i,update:()=>!1,bindings:[]},u=function(e,t){const n=[];let s=0;const o=e=>{const i=[];for(const t of[...e.childNodes]){if(8===t.nodeType){if(Zi.test(t.data)){const e=i.pop();void 0!==e&&n.push({...e,close:t});continue}const o=t.data.match(Ji);null!==o&&i.push({kind:o[1],expr:o[2],open:t,parent:e,seq:s++});continue}1===t.nodeType&&o(t)}for(const e of i)t(e)};return o(e),n.sort((e,t)=>e.seq-t.seq)}(t,e=>{sr(`virtual:unclosed:${o}:${e.kind}`,`\x3c!-- dm ${e.kind}: ${e.expr} --\x3e in ${o} has no matching \x3c!-- /dm --\x3e, so the block was skipped. Every virtual binding needs a closer.`)});for(const e of u)"each"===e.kind&&b(e,u);const p=[];ir(t,e=>{if(tr.has(e))return c++,!1;const t=e.getAttribute(Gi),n=function(e){const t=[];for(const n of[...e.attributes]){if(n.name===er||n.name===Gi)continue;const e=Xs(n.name);null!==e&&t.push({name:n.name,value:n.value.trim(),kind:e.kind,arg:e.arg,handler:e.handler})}return t}(e);return null===t&&0===n.length||(p.push({el:e,each:t,claims:n}),null===t)}),c>0&&sr(`double:${o}`,`applyBindings ran again over ${o}, where ${c} element(s) were already bound. Those were skipped rather than bound twice; the handle returned owns only what this call created. Dispose the first handle before re-applying.`);for(const{el:e}of p)tr.add(e),e.setAttribute(er,""),l.push(e);!function(e,t){const n=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT,null);let s;for(;s=n.nextNode();)if(Qi.test(s.data)&&!ar(s,e))return void sr(`interp:${t}`,`${t} contains "${s.data.trim().slice(0,40)}" - applyBindings does not interpolate {{ }} in already-rendered DOM, and leaves it as it found it. Use data-bind-text="expr", which the server can render alongside the text, or compile() if the markup should come from a template.`)}(t,o);let m=0;for(const e of p){null!==e.each&&v(e.el,e.each);for(const t of e.claims)g(e.el,t)}for(const e of u)y(e);function f(e,t,n){if(!1===t.expression)return{ast:null,evaluate:null,deps:new Set};const s={template:`${o} ${n}`,methodCalls:!0===t.methodCalls},i=_s(e,s);return null===i?null:{ast:i,evaluate:gn(ws(e,s),{expr:e,where:s.template,handler:t}),deps:!1===t.tracks?new Set:xs(i)}}function g(e,t){const{handler:n,kind:o,arg:r,value:l,name:d}=t,c=f(l,n,d);if(null===c)return;const u={id:`apply${m++}_${o}`,kind:o,arg:r,expr:l,ast:c.ast,evaluate:c.evaluate,deps:c.deps,nodes:[e]};h.bindings.push(u),"function"==typeof n.attach&&n.attach({binding:u,node:e,controller:h}),"function"==typeof n.detach&&a.push(()=>n.detach({binding:u,node:e,controller:h})),!0!==n.region?!1!==n.tracks&&_(()=>n.update({binding:u,nodes:[e],context:i,render:s,controller:h})):"if"===o?function(e,t){const n=document.createComment(`dm:if ${t.expr}`);e.parentNode?.insertBefore(n,e),_(()=>{const s=Os(t.evaluate(i));return s&&null===e.parentNode?n.parentNode?.insertBefore(e,n.nextSibling):s||null===e.parentNode||e.parentNode.removeChild(e),!0}),a.push(()=>{null===e.parentNode&&n.parentNode?.insertBefore(e,n.nextSibling),n.parentNode?.removeChild(n)})}(e,u):sr(`region:${o}`,`"${d}" is a region binding, which needs a compiled template body. applyBindings has none - the markup is the page. Use compile() for ${o}, or data-if / data-each, which are implemented here directly.`)}function v(e,t){const n=Xi.exec(t);if(null===n||""===n[1].trim())return void sr(`each:unkeyed:${o}`,`${Gi}="${t}" on ${or(e)} needs a key: write ${Gi}="${t.trim()} key=id", naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const r=n[1].trim(),l=n[2],d=f(r,{expression:!0,tracks:!0,acceptsReactive:!0},Gi);if(null===d)return;const c=e.innerHTML;e.replaceChildren();const u=document.createComment("dm:each"),p=document.createComment("/dm:each");e.append(u,p);const g={id:`apply${m++}_each`,kind:"each",expr:r,keyPath:l,body:c,ast:d.ast,evaluate:d.evaluate,deps:d.deps,factoryBox:{value:null,options:{template:o}},nodes:[{open:u,close:p}]};h.bindings.push(g);const v=Gs("each");_(()=>v.update({binding:g,nodes:g.nodes,context:i,render:s,controller:h})),a.push(()=>{Ro({open:u},[],Vi(g,s),l,i,o),e.replaceChildren()})}function b(e,t){const n=document.createElement("div");for(const t of Do(e.open,e.close))n.appendChild(t);for(const s of t){if(s===e||!n.contains(s.open))continue;s.consumed=!0;const t=[s.open,...Do(s.open,s.close),s.close];for(const e of t)e.parentNode?.removeChild(e);sr(`virtual:nested:${o}:${s.kind}`,`\x3c!-- dm ${s.kind}: ${s.expr} --\x3e is inside a virtual list's body, which is compiled as a template - virtual bindings are not read there, so its content is left out. Use {{#${s.kind}}} inside the body, or data-if on an element.`)}e.body=n.innerHTML}function y(e){!0!==e.consumed&&("if"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm if --\x3e");if(null===t)return;const n={id:`apply${m++}_if`,kind:"if",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[{open:e.open,close:e.close}]};h.bindings.push(n);let s=null;const o=()=>{null!==s&&(e.close.parentNode?.insertBefore(s,e.close),s=null)};_(()=>{if(Os(n.evaluate(i)))o();else if(null===s){s=document.createDocumentFragment();for(const t of Do(e.open,e.close))s.appendChild(t)}return!0}),a.push(o)}(e):"each"===e.kind?function(e){const t=e.expr.match(Xi);if(null===t||""===t[1].trim())return void sr(`virtual:each:unkeyed:${o}`,`\x3c!-- dm each: ${e.expr} --\x3e needs a key: write \x3c!-- dm each: ${e.expr.trim()} key=id --\x3e, naming whichever property identifies an item. Without one there is nothing to reconcile against.`);const n=t[1].trim(),r=t[2],l=f(n,{expression:!0,tracks:!0,acceptsReactive:!0},"\x3c!-- dm each --\x3e");if(null===l)return;const d={id:`apply${m++}_each`,kind:"each",expr:n,keyPath:r,body:e.body,ast:l.ast,evaluate:l.evaluate,deps:l.deps,factoryBox:{value:null,options:{template:o}},nodes:[{open:e.open,close:e.close}]};h.bindings.push(d);const c=Gs("each");_(()=>c.update({binding:d,nodes:d.nodes,context:i,render:s,controller:h})),a.push(()=>{Ro({open:e.open,close:e.close},[],Vi(d,s),r,i,o)})}(e):"text"===e.kind?function(e){const t=f(e.expr,{expression:!0,tracks:!0},"\x3c!-- dm text --\x3e");if(null===t)return;for(const t of Do(e.open,e.close))t.parentNode?.removeChild(t);const n=document.createTextNode("");e.close.parentNode?.insertBefore(n,e.close);const s={id:`apply${m++}_text`,kind:"text",expr:e.expr,ast:t.ast,evaluate:t.evaluate,deps:t.deps,nodes:[n]};h.bindings.push(s),_(()=>{const e=s.evaluate(i);return n.data=null==e?"":String(e),!0}),a.push(()=>n.parentNode?.removeChild(n))}(e):sr(`virtual:kind:${e.kind}`,`\x3c!-- dm ${e.kind}: … --\x3e is not a virtual binding. Supported: if, each, text. Anything else needs an element to bind to.`))}function _(e){r.push(En(e,{label:`${o}:${r.length}`}))}return{get bindings(){return h.bindings.length},context:()=>i,update(e){if(!d){void 0!==e&&(i=Rn(e));for(const e of r)e.recompute()}},dispose(){if(!d){d=!0;for(const e of r)e.dispose();r.length=0;for(const e of a)try{e()}catch(e){console.warn(`${Yi} applyBindings teardown threw:`,e)}a.length=0;for(const e of l)tr.delete(e),e.removeAttribute(er);l.length=0}}}}function ar(e,t){for(let n=e.parentNode;n;n=n.parentNode){if(1===n.nodeType&&n.hasAttribute(Gi))return!0;if(n===t)return!1}return!1}const lr=(e,t)=>c.isEqual(e,t);class dr{constructor(e,t={},n={}){this._schema=e,this._initialData={},this._bindings=new Map,this._changeCallbacks=new Set,this._fieldCallbacks=new Map,this._fields=new Map,this._trackedView=null,this._persistKey=n.persist||null,this._autoSave=!1!==n.autoSave;for(const n in e){const s=e[n],o=void 0!==s.default?s.default:null,i=void 0!==t[n]?t[n]:o;this._fields.set(n,Hn(i,{equals:lr})),this._initialData[n]=i}this._persistKey&&this._loadFromStorage()}get(e){if(e){const t=this._fields.get(e);return t?t.value:void 0}const t={};for(const[e,n]of this._fields)t[e]=n.value;return t}_field(e){let t=this._fields.get(e);return t||(t=Hn(null,{equals:lr}),this._fields.set(e,t)),t}_snapshot(){const e={};for(const[t,n]of this._fields)e[t]=n.peek();return e}tracked(){if(!this._trackedView){const e=this;this._trackedView=new Proxy({},{get(t,n){if("string"!=typeof n)return;const s=e._fields.get(n);return s?s.value:void 0},set:(t,n,s)=>("string"==typeof n&&e._setField(n,s),!0),has(t,n){if("string"!=typeof n)return!1;const s=e._fields.get(n);return!!s&&(s.value,!0)},ownKeys:()=>[...e._fields.keys()],getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0})})}return this._trackedView}set(e,t){if("object"==typeof e)for(const t in e)this._setField(t,e[t]);else this._setField(e,t);return this}_setField(e,t){const n=this._field(e),s=n.peek();if(this._schema[e]){const n=this._validateField(e,t);if(!n.valid)throw new Error(`Validation failed for ${e}: ${n.error}`)}const o=!lr(s,t);n.value=t,o&&(this._notifyChange(e,t,s),this._updateBindings(e,t),this._persistKey&&this._autoSave&&this._saveToStorage())}_validateField(e,t){const n=this._schema[e],s=null==t||""===t;if(n.required&&s)return{valid:!1,error:"Required field is empty"};if(!s&&n.type){const e=ur.types[n.type];if(e&&!e(t))return{valid:!1,error:`Expected type ${n.type}`}}if(void 0!==n.min&&"number"==typeof t&&t<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&"number"==typeof t&&t>n.max)return{valid:!1,error:`Value must be at most ${n.max}`};if(void 0!==n.minLength&&"string"==typeof t&&t.length<n.minLength)return{valid:!1,error:`Length must be at least ${n.minLength}`};if(void 0!==n.maxLength&&"string"==typeof t&&t.length>n.maxLength)return{valid:!1,error:`Length must be at most ${n.maxLength}`};if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:"Value does not match pattern"};if(n.validate&&"function"==typeof n.validate){const e=n.validate(t);if(!1===e)return{valid:!1,error:"Custom validation failed"};if("string"==typeof e)return{valid:!1,error:e}}return{valid:!0}}validate(){const e=[],t=this._snapshot();for(const n in this._schema){const s=this._validateField(n,t[n]);s.valid||e.push({field:n,error:s.error})}return{valid:0===e.length,errors:e}}toJSON(){return An(()=>this._snapshot())}onChange(e,t){if("string"==typeof e){if("function"!=typeof t)throw new TypeError(`Model.onChange('${e}', callback) requires a callback function`);const n=e,s=e=>{e.field===n&&t(e)};return this._changeCallbacks.add(s),()=>this._changeCallbacks.delete(s)}if("function"!=typeof e)throw new TypeError("Model.onChange expects a callback, or (field, callback)");return this._changeCallbacks.add(e),()=>this._changeCallbacks.delete(e)}onFieldChange(e,t){return this._fieldCallbacks.has(e)||this._fieldCallbacks.set(e,new Set),this._fieldCallbacks.get(e).add(t),()=>this._fieldCallbacks.get(e)?.delete(t)}_notifyChange(e,t,n){for(const s of this._changeCallbacks)s({field:e,newValue:t,oldValue:n,model:this});if(this._fieldCallbacks.has(e))for(const s of this._fieldCallbacks.get(e))s(t,n,this)}_updateBindings(e,t){if(this._bindings.has(e))for(const n of this._bindings.get(e))n.update(t)}_addBinding(e,t){this._bindings.has(e)||this._bindings.set(e,new Set),this._bindings.get(e).add(t)}_removeBinding(e,t){this._bindings.has(e)&&this._bindings.get(e).delete(t)}reset(e=!1){for(const e in this._initialData)this.set(e,c.cloneDeep(this._initialData[e]));return e&&this._persistKey&&this.clearStorage(),this}destroy(e=!1){e&&this._persistKey&&this.clearStorage(),this._changeCallbacks.clear(),this._fieldCallbacks.clear(),this._bindings.clear(),this._fields.clear(),this._trackedView=null}save(){return this._saveToStorage()}load(){return this._loadFromStorage()}clearStorage(){return!!this._persistKey&&Q.remove(`model:${this._persistKey}`)}getPersistKey(){return this._persistKey}isPersisted(){return null!==this._persistKey}_saveToStorage(){if(!this._persistKey)return!1;try{return Q.set(`model:${this._persistKey}`,this._snapshot())}catch(e){return console.warn("Domma Model: Failed to save to storage",e),!1}}_loadFromStorage(){if(!this._persistKey)return!1;try{const e=Q.get(`model:${this._persistKey}`);if(e&&"object"==typeof e){for(const t in e)void 0!==this._schema[t]&&(this._field(t).value=e[t]);return!0}return!1}catch(e){return console.warn("Domma Model: Failed to load from storage",e),!1}}}class cr{constructor(e,t,n,s={}){this.model=e,this.field=t,this.element=n,this.options=s,this.format=s.format||(e=>e),this.parse=s.parse||(e=>e),this.twoWay=s.twoWay||!1,this._eventHandler=null,this.update(e.get(t)),this.twoWay&&this._setupTwoWay()}update(e){const t=this.format(e),n=this.element;"INPUT"===n.tagName||"TEXTAREA"===n.tagName?"checkbox"===n.type?n.checked=Boolean(t):"radio"===n.type?n.checked=n.value===String(t):n.value=null!=t?t:"":"SELECT"===n.tagName?n.value=t:n.textContent=null!=t?t:""}_setupTwoWay(){const e=this.element,t=this._getEventType();this._eventHandler=t=>{let n;n="checkbox"===e.type?e.checked:"number"===e.type||"range"===e.type?""===e.value?null:Number(e.value):e.value;try{this.model.set(this.field,this.parse(n))}catch(e){console.warn("Binding validation error:",e.message)}},e.addEventListener(t,this._eventHandler)}_getEventType(){const e=this.element;return"SELECT"===e.tagName||"checkbox"===e.type||"radio"===e.type?"change":"input"}destroy(){if(this._eventHandler){const e=this._getEventType();this.element.removeEventListener(e,this._eventHandler)}this.model._removeBinding(this.field,this)}}const hr=/^\d{4}-\d{2}-\d{2}([T ]\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})?)?$/;const ur={_events:new Map,subscribe(e,t){return this._events.has(e)||this._events.set(e,new Set),this._events.get(e).add(t),()=>this.unsubscribe(e,t)},on(e,t){return this.subscribe(e,t)},unsubscribe(e,t){this._events.has(e)&&this._events.get(e).delete(t)},off(e,t){this.unsubscribe(e,t)},publish(e,t){if(this._events.has(e))for(const n of this._events.get(e))n(t)},emit(e,t){this.publish(e,t)},once(e,t){const n=s=>{this.unsubscribe(e,n),t(s)};return this.subscribe(e,n)},clear(e){e?this._events.delete(e):this._events.clear()},create:(e,t={},n={})=>new dr(e,t,n),extend(...e){const t={};for(const n of e)for(const e in n)Object.prototype.hasOwnProperty.call(n,e)&&(t[e]&&c.isPlainObject(t[e])?t[e]=c.merge(c.cloneDeep(t[e]),c.cloneDeep(n[e])):t[e]=c.cloneDeep(n[e]));return t},pick(e,t){const n={};for(const s of t)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=c.cloneDeep(e[s]));return n},omit(e,t){const n=c.cloneDeep(e);for(const e of t)delete n[e];return n},observable:Hn,observableArray:function(e=[],t={}){const n=new wn,s=Dn();let o=Array.isArray(e)?e.slice():[];const i=Wn(t,e=>{n.trigger(),s.notify(e)}),r=()=>i.announce(o),a=e=>{const t=Array.isArray(e)?e.slice():[],n=i.changed(o,t);o=t,n&&r()},l={get value(){return n.track(),o},set value(e){a(e)},get length(){return n.track(),o.length},peek:()=>o,set:e=>a(e),remove:e=>{const t="function"==typeof e?e:t=>t===e;for(let e=o.length-1;e>=0;e--)t(o[e],e)&&o.splice(e,1);return r(),l},removeAll:()=>(o.length=0,r(),l),indexOf:e=>(n.track(),o.indexOf(e)),replace:(e,t)=>{const n=o.indexOf(e);return-1!==n&&(o[n]=t),r(),l},destroy:e=>{const t="function"==typeof e?e:t=>t===e;let n=0,s=0;for(let e=0;e<o.length;e++)t(o[e],e)&&(null!==o[e]&&"object"==typeof o[e]?(o[e]._destroy=!0,n++):s++);return s>0&&console.warn(`${Bn} destroy: ${s} matching item(s) are not objects and cannot carry a _destroy mark. Use remove() for an array of primitives.`),(n>0||0===s)&&r(),l},destroyAll:()=>l.destroy(()=>!0),subscribe:e=>s.add(e),extend:e=>(i.extend(e),l)};i.attach(l);for(const e of On)l[e]=(...t)=>{const n=Array.prototype[e].apply(o,t);return r(),n};return mn(l)},computed(e,t={}){const n=Cn(e,{label:t.label,onNotify:t.onChange||null});return{get value(){return n.get()},set value(e){n.write(e)},get:()=>n.get(),set:e=>n.write(e),peek:()=>An(()=>n.get()),dispose:()=>n.dispose(),_computation:n}},effect(e,t={}){const n=En(e,{label:t.label});return()=>n.dispose()},untracked:e=>An(e),flush(){_n=!1,Ln()},types:{string:e=>"string"==typeof e,number:e=>"number"==typeof e&&!Number.isNaN(e),boolean:e=>"boolean"==typeof e,array:e=>Array.isArray(e),object:e=>null!==e&&"object"==typeof e&&!Array.isArray(e),date:function(e){if(e instanceof Date)return!Number.isNaN(e.getTime());if("string"!=typeof e||!hr.test(e))return!1;const t=Date.parse(e);if(Number.isNaN(t))return!1;if(10===e.length){const n=new Date(t),[s,o,i]=e.split("-").map(Number);return n.getUTCFullYear()===s&&n.getUTCMonth()+1===o&&n.getUTCDate()===i}return!0},any:()=>!0},bind(e,t,n,s={}){const o="string"==typeof n?document.querySelectorAll(n):[n],i=[];for(const n of o){const o=new cr(e,t,n,s);e._addBinding(t,o),i.push(o)}return()=>{for(const e of i)e.destroy()}},applyBindings(e,t,n={}){const s=function(e){if("string"==typeof e)return document.querySelector(e);if(e&&1===e.nodeType)return e;if(e&&"object"==typeof e){const t=e[0]||(Array.isArray(e.elements)?e.elements[0]:null);if(t&&1===t.nodeType)return t}return null}(t);if(!s)throw new TypeError(`M.applyBindings: no element found for ${"string"==typeof t?`selector "${t}"`:String(t)}`);const{methods:o,...i}=n;return rr(function(e,t){return dn(e instanceof dr?e.tracked():e,{fallback:t})}(e,o),s,{render:(e,t)=>c.render(e,t),...i})},registerBinding:(e,t)=>Ys(e,t),unregisterBinding:e=>function(e){return qs.delete(e)}(e),registerExtender:(e,t)=>Tn(e,t),unregisterExtender:e=>function(e){return!zn.has(e)&&$n.delete(e)}(e),registerHelper:(e,t)=>Ms(e,t),unregisterHelper:e=>function(e){return Xn.delete(e)}(e),_stores:new Map,store(e,t={}){if(!this._stores.has(e)){const n={state:{...t},listeners:new Set,getState(){return{...this.state}},setState(e){const t={...this.state};this.state={...this.state,...e};for(const e of this.listeners)e(this.state,t)},subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)},reset(e){this.state=e?{...e}:{...t};for(const e of this.listeners)e(this.state,{})}};this._stores.set(e,n)}return this._stores.get(e)},getStore(e){return this._stores.get(e)},removeStore(e){this._stores.delete(e)}};class pr{static defaults={layout:"stacked",columns:2,labelPosition:"top",showLabels:!0,showHelperText:!0,showHints:!0,validationMode:"blur",cssFramework:"domma",className:"domma-form",fieldClassName:"domma-form-field",labelClassName:"form-label",inputClassName:"form-input",errorClassName:"form-error",helperClassName:"form-helper-text",hintClassName:"form-hint",cardWrapper:!1};static inputTypes={string:"text",email:"email",password:"password",number:"number",integer:"number",float:"number",boolean:"checkbox",date:"date",datetime:"datetime-local",time:"time",url:"url",tel:"tel",color:"color",range:"range",file:"file",hidden:"hidden",signature:"signature"};constructor(e,t={},n={}){this.schema=e,this.data={...t},this.options={...pr.defaults,...n},this.model=null,this.errors={},this.touched=new Set,this.utils=window.Domma?.utils||c,this.models=window.Domma?.models||ur,e&&"object"==typeof e&&(this.model=this.models.create(e,t,{persist:n.persist,autoSave:n.autoSave}))}render(){if(!this.schema)throw new Error("Schema is required to render form");return this._buildForm()}renderTo(e){const t="string"==typeof e?document.querySelector(e):e;if(!t)throw new Error(`Form container not found: ${e}`);return t.innerHTML=this.render(),this.formElement=t.querySelector("form"),this._bindEvents(t),this._initTooltips(t),t}_buildForm(){const{className:e,layout:t,columns:n,cardWrapper:s}=this.options;let o=e;if("grid"===t){o+=` grid ${3===n?"grid-cols-3":"grid-cols-2"} gap-4`}else"inline"===t&&(o+=" domma-form-inline");let i="";if(s&&(i+='<div class="card"><div class="card-body">'),i+=`<form class="${o}" novalidate>`,this.options.sections&&Array.isArray(this.options.sections))for(const e of this.options.sections)i+=this._buildSection(e);else for(const e in this.schema)i+=this._buildField(e,this.schema[e]);if(!1!==this.options.showSubmitButton){const e=this.options.submitText||"Submit",t=this.options.resetText,n=this.options.buttonAlignment||"right";i+=`<div class="form-group form-buttons mt-4 ${"left"===n?"text-left":"center"===n?"text-center":"text-right"}">`,t&&(i+=`<button type="button" class="btn btn-secondary mr-2" data-action="reset">${this.utils.escapeHtml(t)}</button>`),i+=`<button type="submit" class="btn btn-primary">${this.utils.escapeHtml(e)}</button>`,i+="</div>"}return i+="</form>",s&&(i+="</div></div>"),i}_buildSection(e){let t="";e.title&&(t+='<fieldset class="domma-form-section">',t+=`<legend class="domma-form-section-title">${this.utils.escapeHtml(e.title)}</legend>`);t+=`<div class="${"grid"===e.layout?`grid grid-cols-${e.columns||2}`:"domma-form-section-content"}">`;for(const n of e.fields||[])this.schema[n]&&(t+=this._buildField(n,this.schema[n]));return t+="</div>",e.title&&(t+="</fieldset>"),t}_buildField(e,t){const{fieldClassName:n,showLabels:s,showHelperText:o,showHints:i,labelPosition:r}=this.options,a=t.formConfig||{},l=t.type||"string",d=t.label||this.utils.capitalize(e),c=this.data[e]||t.default||"",h=t.required||!1,u=a.disabled||t.readonly||!1,p=a.placeholder||"",m=a.hint||"",f=a.helperText||"",g=a.tooltip||"",v=a.span||1;let b="";if("grid"===this.options.layout&&v>1){const e=this.options.columns||2;2===v?b=" col-span-2":3===v&&3===e?b=" col-span-3":v>=e&&(b=3===e?" col-span-3":" col-span-2")}let y=`<div class="${n}${b}" data-field="${e}">`;if(s&&d&&"hidden"!==l&&"boolean"!==l&&"checkbox"!==l){const t=this.options.labelClassName,n=h?' <span class="text-danger">*</span>':"",s=g?` data-tooltip="${this.utils.escapeHtml(g)}"`:"",o=g?" has-tooltip":"";y+=`<label for="field-${this.utils.escapeHtml(e)}" class="${t}${o}"${s}>`,y+=`${this.utils.escapeHtml(d)}${n}`,g&&(y+=' <span class="tooltip-icon" data-icon="help-circle" style="display: inline-block; vertical-align: middle; opacity: 0.6; cursor: help;"></span>'),i&&m&&(y+=` <small class="${this.options.hintClassName}">${this.utils.escapeHtml(m)}</small>`),y+="</label>"}return y+=this._buildInput(e,t,{type:l,value:c,required:h,disabled:u,placeholder:p}),o&&f&&(y+=`<small class="${this.options.helperClassName}">${f}</small>`),y+=`<div class="${this.options.errorClassName}" data-error-for="${e}" style="display: none;"></div>`,y+="</div>",y}_buildInput(e,t,n){const{type:s,value:o,required:i,disabled:r,placeholder:a}=n,l=t.formConfig||{},d=`field-${e}`,c={id:d,name:e,class:this.options.inputClassName,...i&&{required:!0},...r&&{disabled:!0},...a&&{placeholder:a},...void 0!==t.min&&{min:t.min},...void 0!==t.max&&{max:t.max},...void 0!==(t.step??l.step)&&{step:t.step??l.step},...t.pattern&&{pattern:t.pattern},...l.autocomplete&&{autocomplete:l.autocomplete}},h=this._inputExtras(s,t);h&&(c["data-input-extras"]=this.utils.escapeHtml(JSON.stringify(h)));const u=Object.entries(c).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ");switch(s){case"select":return this._wrapAddons(this._buildSelect(e,t,c,o),l);case"multiselect":return c.multiple=!0,this._buildSelect(e,t,c,o);case"textarea":const n=l.rows||3;return this._wrapAddons(`<textarea ${u} rows="${n}">${this.utils.escapeHtml(o)}</textarea>`,l);case"radio":return this._buildRadioGroup(e,t,c,o);case"checkbox-group":return this._buildCheckboxGroup(e,t,c,o);case"chooser":return this._buildChooser(e,t,c,o);case"checkbox":case"boolean":const i=o?"checked":"",r=t.label||this.utils.capitalize(e),a=t.required?' <span class="text-danger">*</span>':"",h=l.hint?` <small class="form-text text-muted">${l.hint}</small>`:"";return`<div class="form-check">\n <input type="checkbox" class="form-check-input" ${u} ${i}>\n <label class="form-check-label" for="${c.id}">${r}${a}</label>\n ${h}\n </div>`;case"file":return`<input type="file" ${u} accept="${l.accept||""}" ${l.multiple?"multiple":""}>`;case"signature":return`<div class="domma-signature-field" id="${d}" data-signature-field="${e}"></div>`;default:const p=`<input type="${pr.inputTypes[s]||"text"}" ${u} value="${this.utils.escapeHtml(o)}">`;return this._wrapAddons(p,l)}}_inputExtras(e,t){const n=t.formConfig||{};if(/^(select|multiselect|radio|checkbox-group|chooser|checkbox|boolean|file|signature|hidden)$/.test(e))return null;const s="textarea"===e?"textarea":pr.inputTypes[e]||"text",o={};if(n.reveal&&"password"===s&&(o.reveal=!0),n.clear&&/^(text|email|url|tel|password|number|date|datetime-local|time|textarea)$/.test(s)&&(o.clear=!0),n.stepper&&"number"===s&&(o.stepper=!0),n.counter&&/^(text|email|url|tel|password|textarea)$/.test(s)){const e="number"==typeof n.counter?n.counter:t.maxLength;o.counter=!("number"==typeof e&&e>0)||e}n.labels&&"object"==typeof n.labels&&(o.labels=n.labels);return Object.keys(o).filter(e=>"labels"!==e).length?o:null}_wrapAddons(e,t={}){const n=this._buildAddon(t.prefix,"left"),s=this._buildAddon(t.suffix,"right");if(!n&&!s)return e;return`<div class="${["input-group-icon",n&&"has-addon-left",s&&"has-addon-right"].filter(Boolean).join(" ")}">${n}${e}${s}</div>`}_buildAddon(e,t){if("string"==typeof e&&e&&(e={text:e}),!e||"object"!=typeof e)return"";const n=`input-group-addon input-group-addon-${t}`;let s="";return e.icon&&/^[a-z0-9-]+$/i.test(e.icon)?s=`<span data-icon="${e.icon}"></span>`:void 0!==e.text&&null!==e.text?s=this.utils.escapeHtml(String(e.text)):"string"==typeof e.html&&(s=e.html),s?`<span class="${n}">${s}</span>`:""}_buildSelect(e,t,n,s){let o=`<select ${Object.entries(n).map(([e,t])=>!0===t?e:`${e}="${t}"`).join(" ")}>`;t.required?n.multiple||null!=s&&""!==s||(o+='<option value="" disabled selected>-- Select --</option>'):o+='<option value="">-- Select --</option>';const i=t.options||[],r=Array.isArray(s)?s:[s];for(const e of i)if("string"==typeof e){o+=`<option value="${e}" ${r.includes(e)?"selected":""}>${this.utils.capitalize(e)}</option>`}else if("object"==typeof e){const t=r.includes(e.value)?"selected":"";o+=`<option value="${e.value}" ${t}>${e.label}</option>`}return o+="</select>",o}_buildRadioGroup(e,t,n,s){const o=t.options||[];let i='<div class="domma-radio-group" role="radiogroup">';for(const t of o){const o="string"==typeof t?t:t.value,r="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${o}`;i+=`\n <label class="domma-radio-option" for="${a}">\n <input type="radio" class="form-check-input" id="${a}" name="${e}" value="${o}" ${o===s?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${r}</span>\n </label>\n `}return i+="</div>",i}_buildCheckboxGroup(e,t,n,s){const o=t.options||[],i=Array.isArray(s)?s:[];let r='<div class="domma-checkbox-group">';for(const t of o){const s="string"==typeof t?t:t.value,o="string"==typeof t?this.utils.capitalize(t):t.label,a=`${n.id}-${s}`;r+=`\n <label class="domma-checkbox-option" for="${a}">\n <input type="checkbox" class="form-check-input" id="${a}" name="${e}[]" value="${s}" ${i.includes(s)?"checked":""} ${n.disabled?"disabled":""}>\n <span class="form-check-label">${o}</span>\n </label>\n `}return r+="</div>",r}_buildChooser(e,t,n,s){const o={variant:t.variant||"card",multiple:!!t.multiple,density:t.density||"comfortable",columns:t.columns||3,accent:t.accent||"primary",accentStyle:t.accentStyle||"border",glow:!!t.glow,glowColour:t.glowColour||null,shadow:t.shadow||"none",shadowColour:t.shadowColour||null,options:t.options||[],value:void 0!==s?s:t.multiple?[]:null,name:e,required:!!t.required},i=JSON.stringify(o).replace(/"/g,""");return`<div class="domma-chooser-field" id="${n.id}" data-chooser-field="${e}" data-chooser-config="${i}"></div>`}_bindEvents(e){e.addEventListener("submit",e=>{e.preventDefault(),this.handleSubmit()}),e.addEventListener("blur",e=>{e.target.matches("input, select, textarea")&&(this.validateField(e.target.name),this.touched.add(e.target.name))},!0),e.addEventListener("change",e=>{if(e.target.matches("input, select, textarea")&&this.model){const t=this._getFieldValue(e.target);try{this.model.set(e.target.name,t)}catch(t){this.setFieldError(e.target.name,t.message)}}}),e.addEventListener("click",e=>{e.target.matches('[data-action="reset"]')&&(e.preventDefault(),this.reset())}),this._initSignatureFields(e),this._initChooserFields(e),this._initInputExtras(e)}_initInputExtras(e){this._destroyInputExtras(),e.querySelectorAll("[data-input-extras]").forEach(e=>{let t;try{t=JSON.parse(e.getAttribute("data-input-extras"))}catch(e){return}const n=new ge(e,t);n.input&&(this._inputGroups[e.name||e.id]=n)})}_destroyInputExtras(){Object.values(this._inputGroups||{}).forEach(e=>e.destroy()),this._inputGroups={}}destroy(){this._destroyInputExtras()}_initChooserFields(e){this._choosers||(this._choosers={});const t=e.querySelectorAll("[data-chooser-field]");if(!t.length)return;const n="function"==typeof ln?.chooser?ln.chooser.bind(ln):window.Domma?.elements?.chooser?.bind(window.Domma.elements);n&&t.forEach(e=>{const t=JSON.parse((e.getAttribute("data-chooser-config")||"{}").replace(/"/g,'"')),s=e.getAttribute("data-chooser-field"),o=n(e,{...t,onChange:e=>{if(this.model)try{this.model.set(s,e)}catch(e){this.setFieldError(s,e.message)}else this.data[s]=e}});o&&(this._choosers[s]=o)})}_initSignatureFields(e){const t=e.querySelectorAll("[data-signature-field]");t.length&&window.Domma&&"function"==typeof window.Domma.elements?.signature&&t.forEach(e=>{const t=e.dataset.signatureField;window.Domma.elements.signature(e,{name:t,onChange:e=>{this.model&&this.model.set({[t]:e})}})})}_initTooltips(e){if(window.Domma&&window.Domma.icons&&"function"==typeof window.Domma.icons.scan&&window.Domma.icons.scan(e),window.Domma&&window.Domma.elements&&"function"==typeof window.Domma.elements.tooltip){e.querySelectorAll("label[data-tooltip]").forEach(e=>{window.Domma.elements.tooltip(e,{position:"top",trigger:"hover",delay:{show:200,hide:0}})})}}getData(){return this.model?this.model.get():this.data}setData(e){this.data={...this.data,...e},this.model&&this.model.set(e)}validate(){this.errors={};let e=!0;for(const t in this.schema){this.validateField(t)||(e=!1)}return e}validateField(e){const t=this.schema[e];if(!t)return!0;const n=this._getFieldValueByName(e);try{const s=this._validateFieldValue(e,n,t);if(!s.valid)return this.setFieldError(e,s.error),!1;if(this.model&&this.model._validateField){const t=this.model._validateField(e,n);if(!t.valid)return this.setFieldError(e,t.error),!1}return this.clearFieldError(e),!0}catch(t){return this.setFieldError(e,t.message),!1}}setFieldError(e,t){this.errors[e]=t;const n=document.querySelector(`[data-error-for="${e}"]`);n&&(n.textContent=t,n.style.display="block",n.parentElement.classList.add("has-error"))}clearFieldError(e){delete this.errors[e];const t=document.querySelector(`[data-error-for="${e}"]`);t&&(t.textContent="",t.style.display="none",t.parentElement.classList.remove("has-error"))}handleSubmit(){const e=this.validate(),t=this.getData();return e&&this.options.onSubmit?this.options.onSubmit(t,this):!e&&this.options.onValidationError&&this.options.onValidationError(this.errors,this),{isValid:e,data:t,errors:this.errors}}_getFieldValue(e){const{type:t,name:n}=e;if("checkbox"===t){if(n.endsWith("[]")){const e=document.querySelectorAll(`input[name="${n}"]:checked`);return Array.from(e).map(e=>e.value)}return e.checked}if("radio"===t){const e=document.querySelector(`input[name="${n}"]:checked`);return e?e.value:null}return"number"===t||"range"===t?""===e.value?null:Number(e.value):e.value}_getFieldValueByName(e){if(this._choosers&&this._choosers[e])return this._choosers[e].getValue();if(this.formElement){const t=this.formElement.querySelector(`[name="${e}"]`);if(t)return this._getFieldValue(t)}return this.model?this.model.get(e):this.data[e]}_validateFieldValue(e,t,n){const s="chooser"===n.type?null==t||Array.isArray(t)&&0===t.length||""===t:null==t||""===t;if(n.required&&s)return{valid:!1,error:`${n.label||e} is required`};if(s)return{valid:!0};if("email"===n.type&&t){if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(t))return{valid:!1,error:"Please enter a valid email address"}}if("number"===n.type&&null!==t){const e=Number(t);if(isNaN(e))return{valid:!1,error:"Please enter a valid number"};if(void 0!==n.min&&e<n.min)return{valid:!1,error:`Value must be at least ${n.min}`};if(void 0!==n.max&&e>n.max)return{valid:!1,error:`Value must be no more than ${n.max}`}}if("string"==typeof t){if(n.minLength&&t.length<n.minLength)return{valid:!1,error:`Must be at least ${n.minLength} characters`};if(n.maxLength&&t.length>n.maxLength)return{valid:!1,error:`Must be no more than ${n.maxLength} characters`}}if(n.pattern&&"string"==typeof t&&!n.pattern.test(t))return{valid:!1,error:n.formConfig?.hint||"Invalid format"};if(n.validate&&"function"==typeof n.validate)try{const e=this.formElement?function(e){const t=new FormData(e),n={};for(const[e,s]of t.entries())n[e]?Array.isArray(n[e])?n[e].push(s):n[e]=[n[e],s]:n[e]=s;return e.querySelectorAll("input").forEach(e=>{"checkbox"!==e.type||e.checked?"checkbox"===e.type&&e.checked&&(n[e.name]="on"===e.value||e.value):n.hasOwnProperty(e.name)||(n[e.name]=!1)}),n}(this.formElement):this.data,s=n.validate(t,e);if(!0!==s)return{valid:!1,error:s||"Validation failed"}}catch(e){return{valid:!1,error:e.message||"Validation error"}}return{valid:!0}}}const mr={create:(e,t={},n={})=>new pr(e,t,n),render:(e,t,n={},s={})=>new pr(t,n,s).renderTo(e),wizard(e,t={}){if(!t.schema)throw new Error("Wizard options must include a schema with steps array");const{schema:{steps:n=[]},data:s={},...o}=t,i=`wizard-${Date.now()}`;let r=0,a={...s},l=null;const d="string"==typeof e?document.querySelector(e):e;if(!d)throw new Error(`Wizard target element not found: ${e}`);if(!Array.isArray(n)||0===n.length)throw new Error("Wizard schema must contain a non-empty steps array");function c(e){const t={};return e.querySelectorAll("input, select, textarea").forEach(e=>{const{name:n,type:s,value:o,checked:i}=e;if(n)if("checkbox"===s)if(n.endsWith("[]")){const e=n.slice(0,-2);t[e]||(t[e]=[]),i&&t[e].push(o)}else t[n]=i;else"radio"===s?i&&(t[n]=o):"number"===s||"range"===s?t[n]=""===o?null:Number(o):"SELECT"===e.tagName&&e.hasAttribute("multiple")?t[n]=Array.from(e.selectedOptions).map(e=>e.value).filter(e=>e):t[n]=o}),t}function h(){if(d.innerHTML=function(e){const t=n[e],s=new pr(t.fields,a,{...o,layout:t.layout||o.layout||"stacked",showSubmitButton:!1}),r=0===e,l=e===n.length-1;return`\n <div id="${i}" class="wizard">\n <div class="wizard-step active card" data-step="${e}">\n <div class="card-header wizard-header">\n <div class="wizard-progress mb-3">\n <div class="wizard-progress-bar" style="width: ${(e+1)/n.length*100}%"></div>\n </div>\n <div class="wizard-step-info">\n <h5 class="wizard-step-title card-title mb-2">${t.title}</h5>\n ${t.description?`<p class="wizard-step-description card-subtitle text-muted mb-2">${t.description}</p>`:""}\n <small class="text-muted">Step ${e+1} of ${n.length}</small>\n </div>\n </div>\n <div class="card-body wizard-content">\n ${s.render()}\n </div>\n <div class="card-footer wizard-nav d-flex justify-content-between">\n <button type="button" class="btn btn-secondary wizard-prev" ${r?'style="visibility: hidden;"':""}>\n ${o.prevText||"Previous"}\n </button>\n <button type="button" class="btn btn-primary wizard-${l?"submit":"next"}">\n ${l?o.finishText||"Finish":o.nextText||"Next"}\n </button>\n </div>\n </div>\n </div>\n `}(r),l=d.querySelector(`#${i}`),!l)return;const e=l.querySelector("form");if(e){new pr(n[r].fields,a,{...o,showSubmitButton:!1})._bindEvents(e)}const t=l.querySelector(".wizard-prev"),s=l.querySelector(".wizard-next"),u=l.querySelector(".wizard-submit");t&&t.addEventListener("click",e=>{e.preventDefault(),r>0&&(o.onStepChange&&o.onStepChange(r-1,a),r--,h())}),s&&s.addEventListener("click",t=>{t.preventDefault();const s=c(e);Object.assign(a,s);const i=new pr(n[r].fields,a,{...o,showSubmitButton:!1});i.formElement=e,i.setData(a);const l=i.validate();o.onValidation&&o.onValidation(l,i.errors||[],r),l&&r<n.length-1&&(o.onStepChange&&o.onStepChange(r+1,a),r++,h())}),u&&u.addEventListener("click",async t=>{t.preventDefault();const s=c(e);Object.assign(a,s);const i=new pr(n[r].fields,a,{...o,showSubmitButton:!1});i.formElement=e,i.setData(a);const l=i.validate();if(o.onValidation&&o.onValidation(l,i.errors||[],r),l&&o.onSubmit)try{await o.onSubmit(a,i)}catch(e){o.onError&&o.onError(e,a,i)}})}return n.forEach((e,t)=>{if(e.title||(e.title=`Step ${t+1}`),!e.fields)throw new Error(`Step ${t} is missing fields array`)}),h(),{nextStep:()=>{r<n.length-1&&(o.onStepChange&&o.onStepChange(r+1,a),r++,h())},prevStep:()=>{r>0&&(o.onStepChange&&o.onStepChange(r-1,a),r--,h())},goToStep:e=>{e>=0&&e<n.length&&(o.onStepChange&&o.onStepChange(e,a),r=e,h())},getCurrentStep:()=>r,getStepData:()=>({...a}),setStepData:e=>{Object.assign(a,e),h()},validate:()=>{const e=l?.querySelector("form");if(e){const t=new pr(n[r].fields,a,{...o,showSubmitButton:!1});return t.formElement=e,t.setData(a),t.validate()}return!0},getElement:()=>l}},modal(e,t={},n={}){const s=`form-${Date.now()}`;let o=null;const i=new pr(e,t,{...n,showSubmitButton:!1,onSubmit:async(e,t)=>{if(n.onSave)try{await n.onSave(e,t),!1!==n.closeOnSave&&o&&o.close()}catch(s){n.onError&&n.onError(s,e,t)}}}),r=`\n <div class="modal" id="modal-${s}" style="display: none;">\n <div class="modal-header">\n <h3 class="modal-title">${n.title||"Form"}</h3>\n <button type="button" class="modal-close" data-action="close">×</button>\n </div>\n <div class="modal-body">\n ${i.render()}\n </div>\n <div class="modal-footer">\n <button type="button" class="btn btn-secondary" data-action="close">Cancel</button>\n <button type="button" class="btn btn-primary" data-action="save">${n.saveText||"Save"}</button>\n </div>\n </div>\n `,a=document.createElement("div");a.className="modal-backdrop",a.style.display="none";const l=document.createElement("div");l.innerHTML=r;const d=l.firstElementChild;return document.body.appendChild(a),document.body.appendChild(d),o={open(){a.style.display="block",d.style.display="block",setTimeout(()=>{a.classList.add("active"),d.classList.add("active")},10);const e=d.querySelector("form");e&&i._bindEvents(e),d.querySelectorAll('[data-action="close"]').forEach(e=>{e.addEventListener("click",()=>this.close())}),d.querySelector('[data-action="save"]').addEventListener("click",()=>{const e=d.querySelector("form");if(e){const t=new Event("submit",{cancelable:!0});e.dispatchEvent(t)}}),a.addEventListener("click",e=>{e.target===a&&this.close()})},close(){a.classList.remove("active"),d.classList.remove("active"),setTimeout(()=>{a.style.display="none",d.style.display="none",document.body.removeChild(a),document.body.removeChild(d)},300)},isOpen:()=>"none"!==d.style.display},o},crud(e){if(!e.schema)throw new Error("CRUD config must include a schema");if(!e.endpoint)throw new Error("CRUD config must include an API endpoint");const{schema:t,endpoint:n,tableSelector:s,title:o="Manage Items",primaryKey:i="id",displayField:r="name",headers:a={},onError:l=e=>console.error("CRUD Error:",e),onSuccess:d=e=>console.log("CRUD Success:",e)}=e;let h=null,u=[];return{async init(){await this.loadData(),this.createTable(),this.bindEvents()},async loadData(){try{window.Domma?.auth?.getApiUrl?.();const e=window.Domma?.auth?.token,t=e?{Authorization:`Bearer ${e}`}:{},s=await window.Domma.http.get(n,{headers:{...a,...t}});if(!s.success)throw new Error(s.message||"Failed to load data");u=s.data||[]}catch(e){throw l(e),e}},createTable(){if(!s)return;const e=Object.entries(t).map(([e,t])=>({key:e,title:t.label||(window.Domma?.utils||c).capitalize(e),sortable:!0,render:t.tableRender}));e.push({key:"actions",title:"Actions",sortable:!1,render:(e,t)=>{const n=window.Domma.icons.html("edit",{size:16,class:"inline-icon",colour:"var(--dm-info-light, #a5d8ff)",attrs:{style:"margin-right: 4px;"}}),s=window.Domma.icons.html("trash",{size:16,class:"inline-icon",colour:"var(--dm-danger-light, #ffacac)",attrs:{style:"margin-right: 4px;"}});return`\n <div class="btn-group btn-group-sm">\n <button class="btn btn-primary crud-edit-btn" data-id="${t[i]}">\n ${n}\n Edit\n </button>\n <button class="btn btn-danger crud-delete-btn" data-id="${t[i]}">\n ${s}\n Delete\n </button>\n </div>\n `}}),h=window.Domma.tables.create(s,{data:u,columns:e,pagination:!0,pageSize:25,striped:!0,selectable:!0,selectionMode:"multiple",exportPanel:!0,exportOptions:["text","csv","excel","json"],columnToggle:!0,regexSearch:!0,persistSettings:!0,storageKey:`domma-crud-${o.toLowerCase().replace(/\s+/g,"-")}`}),this.initializeTableIcons()},initializeTableIcons(){setTimeout(()=>{document.querySelectorAll("[data-icon]").forEach(e=>{const t=e.getAttribute("data-icon");if(window.Domma&&window.Domma.icons&&window.Domma.icons.render){const n=window.Domma.icons.render(t,{size:16,class:"inline-icon"});n&&(e.innerHTML="",e.appendChild(n))}})},100)},bindEvents(){const e=document.querySelector(".crud-add-btn");e&&e.addEventListener("click",()=>this.create()),document.addEventListener("click",e=>{if(e.target.matches(".crud-edit-btn")){const t=e.target.getAttribute("data-id");this.edit(t)}}),document.addEventListener("click",e=>{if(e.target.matches(".crud-delete-btn")){const t=e.target.getAttribute("data-id");this.delete(t)}});const t=document.querySelector(".crud-refresh-btn");t&&t.addEventListener("click",()=>this.refresh())},async create(){mr.modal(t,{},{title:`Create New ${o.slice(7)}`,size:"xl",saveText:"Create",showSubmitButton:!1,onSave:async e=>{try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},o=await window.Domma.http.post(n,e,{headers:{...a,...s}});if(!o.success)throw new Error(o.message||"Failed to create item");d("Item created successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async edit(e){const s=u.find(t=>t[i]==e);if(!s)return void l(new Error("Item not found"));mr.modal(t,s,{title:`Edit ${s[r]||"Item"}`,size:"xl",saveText:"Update",showSubmitButton:!1,onSave:async t=>{try{window.Domma?.auth?.getApiUrl?.();const s=window.Domma?.auth?.token,o=s?{Authorization:`Bearer ${s}`}:{},i=await window.Domma.http.put(`${n}/${e}`,t,{headers:{...a,...o}});if(!i.success)throw new Error(i.message||"Failed to update item");d("Item updated successfully"),await this.refresh()}catch(e){throw l(e),e}}}).open()},async delete(e){const t=u.find(t=>t[i]==e);if(!t)return void l(new Error("Item not found"));if(await window.Domma.elements.confirm(`Are you sure you want to delete "${t[r]||"this item"}"?\n\nThis action cannot be undone.`,{title:"Confirm Delete",confirmText:"Delete",cancelText:"Cancel",type:"warning"}))try{window.Domma?.auth?.getApiUrl?.();const t=window.Domma?.auth?.token,s=t?{Authorization:`Bearer ${t}`}:{},o=await window.Domma.http.delete(`${n}/${e}`,{headers:{...a,...s}});if(!o.success)throw new Error(o.message||"Failed to delete item");d("Item deleted successfully"),await this.refresh()}catch(e){l(e)}},async refresh(){try{await this.loadData(),h&&(h.setData(u),this.initializeTableIcons())}catch(e){}},getData:()=>[...u],getTable:()=>h,addItem:e=>{u.push(e),h&&h.setData(u)},updateItem:(e,t)=>{const n=u.findIndex(t=>t[i]==e);-1!==n&&(u[n]={...u[n],...t},h&&h.setData(u))},removeItem:e=>{const t=u.findIndex(t=>t[i]==e);-1!==t&&(u.splice(t,1),h&&h.setData(u))}}}};function fr(e,t){if(![t.x,t.y,t.width,t.height].every(Number.isFinite)||t.width<=0||t.height<=0||t.alpha<=0)return;const n=Math.cos(t.flipPhase||0),s=t.width*(.12+.88*Math.abs(n)),o=Math.sin(t.curlPhase||0)*t.width*.32,i=-t.height/2,r=t.height/2;e.save(),e.globalAlpha*=t.alpha??1,e.translate(t.x,t.y),e.rotate(t.rotation||0),e.beginPath(),e.moveTo(-s/2,i),e.bezierCurveTo(-s/2+o,i+.3*t.height,-s/2-o,r-.3*t.height,-s/2,r),e.lineTo(s/2,r),e.bezierCurveTo(s/2-o,r-.3*t.height,s/2+o,i+.3*t.height,s/2,i),e.closePath(),e.fillStyle=t.colour,e.fill();const a=e.createLinearGradient(-s/2,i,s/2,r);a.addColorStop(0,n<0?"rgba(20,25,40,0.28)":"rgba(255,255,255,0.48)"),a.addColorStop(.42,"rgba(255,255,255,0.05)"),a.addColorStop(.7,"rgba(20,25,40,0.2)"),a.addColorStop(1,"rgba(255,255,255,0.3)"),e.fillStyle=a,e.fill(),e.beginPath(),e.moveTo(s/2,i),e.bezierCurveTo(s/2+o,i+.3*t.height,s/2-o,r-.3*t.height,s/2,r),e.strokeStyle="rgba(255,255,255,0.42)",e.lineWidth=.55,e.stroke(),e.restore()}function gr(e,t,n,s){const o=Math.cos(e.swayPhase);e.swayPhase+=e.swayFreq*s,e.x+=e.vx*s+(o-Math.cos(e.swayPhase))*n.sway,e.y+=e.vy*s,e.rotation+=e.rotationSpeed*s,e.flipPhase+=e.flipSpeed*s,e.curlPhase+=.025*s;const i=e.y/Math.max(1,t);e.alpha=i<n.fadeStart?1:Math.max(0,1-(i-n.fadeStart)/Math.max(.001,1-n.fadeStart)),(e.y-e.height>t||e.alpha<=.01)&&(e.alive=!1)}function vr(e,t){if(![t.x,t.y,t.size].every(Number.isFinite)||t.size<=0)return;const n=.12+.88*Math.abs(Math.sin(t.flapPhase||0));e.save(),e.translate(t.x,t.y),e.rotate((t.heading??-Math.PI/2)+Math.PI/2),e.scale(t.size/2.2,t.size/2.2),e.globalAlpha*=t.alpha??1,e.lineCap="round",e.lineJoin="round";const s=(t,n,s,o=.025)=>{e.beginPath();for(const[n,...s]of t)e[n](...s);n&&(e.fillStyle=n,e.fill()),s&&(e.strokeStyle=s,e.lineWidth=o,e.stroke())},o=(t,n,s,o,i)=>{e.beginPath(),e.ellipse(t,n,s,o,0,0,2*Math.PI),e.fillStyle=i,e.fill()};for(const i of[-1,1]){e.save(),e.scale(i*n,1);const r=e.createLinearGradient(0,0,1.1,-.8);r.addColorStop(0,"#504354"),r.addColorStop(.26,t.colourUpper||"#d891b4"),r.addColorStop(1,"#f5dabc");const a=e.createLinearGradient(0,0,.9,.7);a.addColorStop(0,"#63505d"),a.addColorStop(.35,t.colourLower||t.colourUpper||"#bd8fb3"),a.addColorStop(1,"#e8cbb6"),s([["moveTo",.045,-.04],["bezierCurveTo",.3,-.52,.73,-1.02,1.04,-.83],["bezierCurveTo",1.18,-.67,.91,-.13,.63,.03],["quadraticCurveTo",.32,.17,.045,-.04],["closePath"]],r,"#5b4a59",.035),s([["moveTo",.05,0],["bezierCurveTo",.52,-.05,.98,.2,.84,.54],["quadraticCurveTo",.74,.73,.52,.68],["quadraticCurveTo",.31,.87,.15,.54],["quadraticCurveTo",.03,.28,.05,0],["closePath"]],a,"#5b4a59",.035);for(const[e,t]of[[1.03,-.73],[.93,-.38],[.73,-.08],[.8,.37],[.61,.64],[.28,.67]])s([["moveTo",.08,0],["quadraticCurveTo",.53*e,.8*t,e,t]],null,"rgba(78,54,67,0.45)",.018);for(const[e,t,n]of[[.89,-.66,.04],[.87,-.47,.034],[.77,-.29,.03],[.69,.38,.035],[.55,.54,.03],[.35,.55,.028]])o(e,t,n,1.2*n,"#fff0d5");o(.48,-.33,.11,.14,"#69506c"),o(.48,-.33,.058,.075,"#e8c68f"),o(.45,.34,.085,.105,"rgba(90,65,86,0.65)"),e.restore()}o(0,.16,.052,.37,"#493f49"),o(0,-.12,.073,.15,"#5c4d56"),o(0,-.31,.072,.075,"#443a45");for(const e of[-1,1])s([["moveTo",.025*e,-.35],["quadraticCurveTo",.1*e,-.61,.2*e,-.56]],null,"#665362",.018),o(.2*e,-.56,.02,.025,"#d6b391");e.restore()}function br(e){if("number"==typeof e)return Number.isFinite(e)?e:0;if("string"!=typeof e)return 0;const t=parseFloat(e);return Number.isFinite(t)?e.endsWith("ms")?t:e.endsWith("s")?1e3*t:0:0}function yr(e,t){let n;if("string"==typeof e)n=Array.from(document.querySelectorAll(e));else if(e instanceof Element)n=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error(`[Domma.effects.${t}] Invalid selector`),null;n=Array.from(e)}return 0===n.length?(console.warn(`[Domma.effects.${t}] No elements found`),null):n}function _r(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}const kr={club:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7},concert:{origins:["tl","tr"],motion:"sweep",sweepArc:120,speed:.8,beamWidth:18,flicker:!0,hz:6,colours:["#f43f5e","#fb923c","#facc15","#22c55e","#3b82f6"],intensity:.75},police:{origins:["tl","tr"],motion:"sweep",sweepArc:70,speed:2.2,beamWidth:22,flicker:!0,hz:8,colours:["#ef4444","#3b82f6"],intensity:.85},searchlight:{origins:["bl","br"],motion:"rotate",sweepArc:90,speed:.5,beamWidth:12,flicker:!1,hz:0,colours:["#fffbe6","#fde68a"],intensity:.6},scanner:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:60,speed:1.6,beamWidth:8,flicker:!1,hz:0,colours:["#22d3ee"],intensity:.7},mood:{origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:140,speed:.35,beamWidth:28,flicker:!1,hz:0,colours:["#a855f7","#6366f1","#ec4899","#38bdf8"],intensity:.45}};function wr(e,t){let n=String(e).replace("#","");3===n.length&&(n=n.split("").map(e=>e+e).join(""));return`rgba(${parseInt(n.slice(0,2),16)}, ${parseInt(n.slice(2,4),16)}, ${parseInt(n.slice(4,6),16)}, ${t})`}const xr={rainbow:["#ef4444","#f97316","#facc15","#22c55e","#0ea5e9","#6366f1","#a855f7","#ec4899"],festive:["#dc2626","#16a34a","#fbbf24","#3b82f6","#a855f7","#ec4899"],gold:["#fbbf24","#f59e0b","#fde68a","#fffbeb","#d97706","#fcd34d"],silver:["#e5e7eb","#cbd5e1","#94a3b8","#f8fafc","#9ca3af","#d1d5db"],pastel:["#fbcfe8","#bae6fd","#bbf7d0","#fef3c7","#ddd6fe","#fed7aa"],mono:["#1f2937","#4b5563","#9ca3af","#d1d5db","#f3f4f6"],sunset:["#f43f5e","#fb923c","#facc15","#f59e0b","#ec4899"],ocean:["#0ea5e9","#22d3ee","#06b6d4","#3b82f6","#6366f1"],forest:["#16a34a","#65a30d","#84cc16","#22c55e","#15803d"],bridal:["#ffffff","#fef3c7","#fce7f3","#fbcfe8","#f9a8d4"],meadow:["#84cc16","#a3e635","#bbf7d0","#bae6fd","#fef08a","#ddd6fe"],firefly:["#fde68a","#facc15","#f59e0b","#a3e635","#fef9c3"],aqua:["#a5f3fc","#67e8f9","#22d3ee","#bae6fd","#e0f2fe"],autumn:["#b45309","#d97706","#f59e0b","#ca8a04","#92400e","#dc2626"]};function Mr(e){if(Array.isArray(e)&&e.length>0)return e;if("string"==typeof e&&xr[e])return xr[e];if("theme"===e||!e){const e=document.documentElement,t=getComputedStyle(e),n=["--dm-primary","--dm-secondary","--dm-success","--dm-warning","--dm-danger","--dm-info"].map(e=>t.getPropertyValue(e).trim()).filter(e=>e&&"transparent"!==e);return n.length>0?n:xr.rainbow}return console.warn(`[Domma.effects] Unknown palette '${e}', using rainbow.`),xr.rainbow}const Lr=Mr;var Cr={breathe:function(e,t={}){const n={amplitude:6,duration:3e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,onStart:null,onComplete:null,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.breathe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.breathe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.breathe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-breathe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=`\n @keyframes ${o} {\n 0%, 100% {\n transform: translateY(0);\n }\n 50% {\n transform: translateY(-${n.amplitude}px);\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",o),r.textContent=i,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>{e.style.animationPlayState="paused"},n=()=>{e.style.animationPlayState="running"};e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}if(n.onComplete&&"infinite"!==n.iterations){const t=()=>{n.onComplete(),e.removeEventListener("animationend",t)};e.addEventListener("animationend",t)}}),n.onStart&&n.onStart(),{pause(){s.forEach(e=>{e.style.animationPlayState="paused"})},resume(){s.forEach(e=>{e.style.animationPlayState="running"})},stop(){s.forEach(e=>{e.style.animation="none"})},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning(){if(0===s.length)return!1;const e=s[0];return"paused"!==e.style.animationPlayState&&"none"!==e.style.animation},isPaused:()=>0!==s.length&&"paused"===s[0].style.animationPlayState}},pulse:function(e,t={}){const n={scale:1.05,duration:2e3,easing:"ease-in-out",delay:0,stagger:0,iterations:"infinite",pauseOnHover:!1,respectMotionPreference:!0,...t};let s;if("string"==typeof e)s=document.querySelectorAll(e);else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.pulse] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.pulse] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-pulse-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=`\n @keyframes ${o} {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(${n.scale});\n }\n }\n `,r=document.createElement("style");r.setAttribute("data-domma-effect",o),r.textContent=i,document.head.appendChild(r);const a=new Map;return s.forEach((e,t)=>{const s=n.delay+t*n.stagger;if(e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`,n.pauseOnHover){const t=()=>e.style.animationPlayState="paused",n=()=>e.style.animationPlayState="running";e.addEventListener("mouseenter",t),e.addEventListener("mouseleave",n),a.set(e,{mouseEnterHandler:t,mouseLeaveHandler:n})}}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>e.style.animation="none")},restart(){s.forEach((e,t)=>{const s=n.delay+t*n.stagger;e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${s}ms ${n.iterations}`})},destroy(){s.forEach(e=>{if(e.style.animation="none",a.has(e)){const t=a.get(e);e.removeEventListener("mouseenter",t.mouseEnterHandler),e.removeEventListener("mouseleave",t.mouseLeaveHandler),a.delete(e)}}),r.remove()},isRunning:()=>s.length>0&&"paused"!==s[0].style.animationPlayState&&"none"!==s[0].style.animation,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},scribe:function(e,t={}){const n={mode:"typewriter",speed:50,deleteSpeed:30,cursor:!0,cursorChar:"|",cursorBlink:!0,cursorType:"caret",loop:!1,loopDelay:1e3,pauseOnHover:!1,autoStart:!0,respectMotionPreference:!0,actions:[],onStart:null,onComplete:null,onCharacter:null,onRender:null,onUndoRender:null,onLoop:null,...t};let s;if("string"==typeof e)s=Array.from(document.querySelectorAll(e));else if(e instanceof Element)s=[e];else{if(!(e instanceof NodeList||Array.isArray(e)))return console.error("[Domma.effects.scribe] Invalid selector"),null;s=Array.from(e)}if(0===s.length)return console.warn("[Domma.effects.scribe] No elements found"),null;if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches){const e=n.actions.find(e=>void 0!==e.render);return e&&s.forEach(t=>{t.textContent=String(e.render)}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1}}const o="function"==typeof Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"grapheme"}):null,i=s.map(e=>({element:e,spans:[],cursor:null,action:0,task:null,frame:null,lastTime:null,elapsed:0,loops:0,lastRenderStart:0,started:!1,paused:!1,stopped:!1,destroyed:!1,hoverPaused:!1,hoverHandlers:null}));function r(e,t){e.cursor?.classList.toggle("dm-scribe-cursor-active",t)}function a(e){const t=e.parentElement;e.remove(),t?.classList.contains("dm-scribe-word-group")&&!t.childNodes.length&&t.remove()}function l(e){e.spans.forEach(a),e.spans=[],e.lastRenderStart=0}function d(e){null!==e.frame||!e.started||e.paused||e.stopped||e.destroyed||(e.frame=requestAnimationFrame(t=>function(e,t){if(e.frame=null,e.paused||e.stopped||e.destroyed)return;null!==e.lastTime&&(e.elapsed+=Math.min(t-e.lastTime,64));e.lastTime=t;let n=0;for(;n++<100&&!e.paused&&!e.stopped&&!e.destroyed&&(e.task||c(e),!(e.stopped||e.paused||e.destroyed));){const t=e.task;if("render"===t.type&&t.index>=t.units.length||"undo"===t.type&&t.deleted.length>=t.count)h(e);else{if(e.elapsed<t.duration)break;if(e.elapsed-=t.duration,"render"===t.type)u(e,t);else if("undo"===t.type){const n=e.spans.pop();t.deleted.push(n.textContent),a(n)}else h(e)}}d(e)}(e,t)))}function c(e){if(e.action>=n.actions.length)return r(e,!1),void(!0===n.loop||"number"==typeof n.loop&&e.loops<n.loop-1?e.task={type:"loop",duration:Math.max(0,n.loopDelay)}:(e.stopped=!0,r(e,!1),n.onComplete?.()));const t=n.actions[e.action];if(void 0!==t.render)e.lastRenderStart=e.spans.length,e.task={type:"render",text:String(t.render),units:(s=String(t.render),"word"===n.mode?s.match(/\s*\S+\s*|\s+/g)||[]:"sentence"===n.mode?s.match(/[^.!?]*[.!?]+\s*|[^.!?]+$/g)||[]:o?Array.from(o.segment(s),e=>e.segment):Array.from(s)),index:0,effect:t.effect||"none",duration:Math.max(0,n.speed)};else if(void 0!==t.undoRender){let s=0;!0===t.undoRender?s=e.spans.length-e.lastRenderStart:"all"===t.undoRender?s=e.spans.length:Number.isFinite(t.undoRender)&&(s=Math.floor(t.undoRender)),e.task={type:"undo",count:Math.max(0,Math.min(s,e.spans.length)),deleted:[],duration:Math.max(0,n.deleteSpeed)}}else e.task={type:"wait",duration:Math.max(0,br(t.wait))};var s;r(e,"render"===e.task.type||"undo"===e.task.type)}function h(e){const t=e.task;e.task=null,"loop"===t.type?(l(e),e.action=0,e.loops++,n.onLoop?.(e.loops)):(e.action++,"render"===t.type&&n.onRender?.(t.text),"undo"===t.type&&n.onUndoRender?.(t.deleted.reverse().join("")))}function u(e,t){const s=t.units[t.index++],o=document.createElement("span");if(o.className="word"===n.mode?"dm-scribe-word":"sentence"===n.mode?"dm-scribe-sentence":"dm-scribe-char",o.textContent=s,/^\s+$/.test(s)&&o.classList.add("dm-scribe-space"),["fade","bounce","glow"].includes(t.effect)){const e=`dm-scribe-${t.effect}`;o.classList.add(e),"sentence"===n.mode&&"bounce"===t.effect&&o.classList.add("dm-scribe-transform-unit"),o.addEventListener("animationend",()=>o.classList.remove(e),{once:!0})}if("typewriter"!==n.mode||/^\s+$/.test(s))e.element.insertBefore(o,e.cursor);else{const t=e.spans.at(-1);let n=t?.parentElement;n?.classList.contains("dm-scribe-word-group")||(n=document.createElement("span"),n.className="dm-scribe-word-group",e.element.insertBefore(n,e.cursor)),n.appendChild(o)}e.spans.push(o),n.onCharacter?.(s,e.spans.length-1)}function p(e){e.destroyed||e.stopped||(e.paused=!0,null!==e.frame&&cancelAnimationFrame(e.frame),e.frame=null,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState="paused"}),r(e,!1))}function m(e){if(e.destroyed||e.stopped||e.started&&!e.paused)return;const t=!e.started;e.started=!0,e.paused=!1,e.lastTime=null,e.spans.forEach(e=>{e.style.animationPlayState=""}),r(e,"render"===e.task?.type||"undo"===e.task?.type),t&&n.onStart?.(),d(e)}return i.forEach(e=>{if(n.cursor){const t=document.createElement("span"),s=["block","underline"].includes(n.cursorType)?n.cursorType:"caret";t.className=`dm-scribe-cursor dm-scribe-cursor-${s}`,n.cursorBlink||t.classList.add("dm-scribe-cursor-no-blink"),t.textContent="underline"===s?" ":n.cursorChar,t.setAttribute("aria-hidden","true"),e.cursor=t,e.element.appendChild(t)}n.pauseOnHover&&(e.hoverHandlers={enter:()=>{!e.started||e.paused||e.stopped||(e.hoverPaused=!0,p(e))},leave:()=>{e.hoverPaused&&(e.hoverPaused=!1,m(e))}},e.element.addEventListener("mouseenter",e.hoverHandlers.enter),e.element.addEventListener("mouseleave",e.hoverHandlers.leave)),n.autoStart&&m(e)}),{pause(){i.forEach(e=>{e.hoverPaused=!1,p(e)})},resume(){i.forEach(m)},stop(){i.forEach(e=>{p(e),e.paused=!1,e.stopped=!0,e.spans.forEach(e=>{e.classList.remove("dm-scribe-fade","dm-scribe-bounce","dm-scribe-glow"),e.style.animationPlayState=""}),r(e,!1)})},restart(){i.forEach(e=>{e.destroyed||(p(e),l(e),Object.assign(e,{action:0,task:null,elapsed:0,lastTime:null,loops:0,stopped:!1,started:!1}),m(e))})},destroy(){i.forEach(e=>{p(e),e.destroyed=!0,l(e),e.cursor?.remove(),e.hoverHandlers&&(e.element.removeEventListener("mouseenter",e.hoverHandlers.enter),e.element.removeEventListener("mouseleave",e.hoverHandlers.leave))})},isRunning:()=>i.some(e=>e.started&&!e.paused&&!e.stopped&&!e.destroyed),isPaused:()=>i.some(e=>e.paused&&!e.destroyed)}},reveal:function(e,t={}){const n={animation:"fade",duration:600,easing:"ease-out",delay:0,stagger:0,threshold:.1,rootMargin:"0px",once:!0,respectMotionPreference:!0,onReveal:null,...t},s=yr(e,"reveal");if(!s)return null;if(n.respectMotionPreference&&_r())return s.forEach(e=>{e.classList.add("dm-reveal-visible")}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};s.forEach((e,t)=>{e.classList.add("dm-reveal",`dm-reveal-${n.animation}`),e.style.transitionDuration=`${n.duration}ms`,e.style.transitionTimingFunction=n.easing;const s=n.delay+t*n.stagger;s>0&&(e.style.transitionDelay=`${s}ms`),n.respectMotionPreference||e.setAttribute("data-force-animation","true")});const o=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?(e.target.classList.add("dm-reveal-visible"),n.onReveal&&n.onReveal(e.target),n.once&&o.unobserve(e.target)):n.once||e.target.classList.remove("dm-reveal-visible")})},{threshold:n.threshold,rootMargin:n.rootMargin});return s.forEach(e=>o.observe(e)),{pause(){},resume(){},stop(){o.disconnect()},restart(){s.forEach(e=>{e.classList.remove("dm-reveal-visible"),o.observe(e)})},destroy(){o.disconnect(),s.forEach(e=>{e.classList.remove("dm-reveal","dm-reveal-visible",`dm-reveal-${n.animation}`),e.style.transitionDuration="",e.style.transitionTimingFunction="",e.style.transitionDelay=""})},isRunning:()=>!0,isPaused:()=>!1}},scramble:function(e,t={}){const n={speed:50,scrambleSpeed:30,characters:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%&*",revealOrder:"left-to-right",scrambleDuration:800,stagger:0,loop:!1,loopDelay:2e3,respectMotionPreference:!0,onComplete:null,onCharacter:null,...t},s=yr(e,"scramble");if(!s)return null;if(n.respectMotionPreference&&_r())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=s.map((e,t)=>({element:e,originalText:e.textContent,rafId:null,timeoutId:null,paused:!1,loopCount:0}));function i(){return n.characters[Math.floor(Math.random()*n.characters.length)]}function r(e){if(e.paused)return;const t=e.originalText,s=t.length;if(0===s)return void(n.onComplete&&n.onComplete());const o=function(e,t){const n=Array.from({length:e},(e,t)=>t);switch(t){case"right-to-left":return n.reverse();case"random":for(let e=n.length-1;e>0;e--){const t=Math.floor(Math.random()*(e+1));[n[e],n[t]]=[n[t],n[e]]}return n;case"center-out":{const t=Math.floor(e/2),n=[t];for(let s=1;s<=t;s++)t-s>=0&&n.push(t-s),t+s<e&&n.push(t+s);return n}default:return n}}(s,n.revealOrder),a=new Array(s).fill(!1),l=t.split("").map(e=>" "===e?" ":i()),d=performance.now(),c=n.speed;e.rafId=requestAnimationFrame(function h(u){if(e.paused)return;const p=u-d;o.forEach((e,s)=>{if(a[e])return;const o=n.scrambleDuration+s*c;p>=o&&(a[e]=!0,l[e]=t[e],n.onCharacter&&n.onCharacter(t[e],e))});for(let e=0;e<s;e++)a[e]||" "===t[e]||(l[e]=i());if(e.element.innerHTML=l.map((e,t)=>`<span class="dm-scramble-char${a[t]?" dm-scramble-resolved":""}">${e}</span>`).join(""),a.every(Boolean))return n.onComplete&&n.onComplete(),void function(e){if(!1===n.loop)return;if("number"==typeof n.loop&&e.loopCount>=n.loop-1)return;e.loopCount++,e.timeoutId=setTimeout(()=>{e.paused||r(e)},n.loopDelay)}(e);e.rafId=requestAnimationFrame(h)})}return o.forEach((e,t)=>{const s=t*n.stagger;s>0?e.timeoutId=setTimeout(()=>r(e),s):r(e)}),{pause(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){o.forEach(e=>{e.paused=!1,r(e)})},stop(){o.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},restart(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.loopCount=0,r(e)})},destroy(){o.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.element.textContent=e.originalText})},isRunning:()=>o.length>0&&!o[0].paused,isPaused:()=>o.length>0&&o[0].paused}},counter:function(e,t={}){const n={from:0,to:null,duration:2e3,easing:"ease-out",decimals:0,separator:",",prefix:"",suffix:"",stagger:0,trigger:"immediate",threshold:.5,respectMotionPreference:!0,onUpdate:null,onComplete:null,...t},s=yr(e,"counter");if(!s)return null;if(n.respectMotionPreference&&_r())return s.forEach(e=>{const t=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;e.textContent=n.prefix+o(t,n.decimals,n.separator)+n.suffix}),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};function o(e,t,n){const s=e.toFixed(t);if(!n)return s;const o=s.split(".");return o[0]=o[0].replace(/\B(?=(\d{3})+(?!\d))/g,n),o.join(".")}const i=s.map((e,t)=>{const s=null!==n.to?n.to:parseFloat(e.textContent.replace(/[^0-9.\-]/g,""))||0;return{element:e,from:n.from,to:s,rafId:null,timeoutId:null,startTime:null,paused:!1,complete:!1}});function r(e){e.paused||(e.startTime=performance.now(),e.complete=!1,e.rafId=requestAnimationFrame(function t(s){if(e.paused)return;const i=s-e.startTime,r=Math.min(i/n.duration,1),a=function(e){switch(n.easing){case"linear":return e;case"ease-in-out":return e<.5?2*e*e:(4-2*e)*e-1;default:return 1-Math.pow(1-e,3)}}(r),l=e.from+(e.to-e.from)*a;e.element.textContent=n.prefix+o(l,n.decimals,n.separator)+n.suffix,n.onUpdate&&n.onUpdate(l),r<1?e.rafId=requestAnimationFrame(t):(e.complete=!0,e.element.textContent=n.prefix+o(e.to,n.decimals,n.separator)+n.suffix,n.onComplete&&n.onComplete())}))}let a=null;function l(e,t){t>0?e.timeoutId=setTimeout(()=>r(e),t):r(e)}return"scroll"===n.trigger?(a=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const t=i.find(t=>t.element===e.target);if(t&&!t.complete){l(t,i.indexOf(t)*n.stagger)}a.unobserve(e.target)}})},{threshold:n.threshold}),s.forEach(e=>a.observe(e))):i.forEach((e,t)=>{l(e,t*n.stagger)}),{pause(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)})},resume(){i.forEach(e=>{e.paused&&!e.complete&&(e.paused=!1,r(e))})},stop(){i.forEach(e=>{e.paused=!0,e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},restart(){i.forEach((e,t)=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId),e.paused=!1,e.complete=!1,l(e,t*n.stagger)})},destroy(){i.forEach(e=>{e.rafId&&cancelAnimationFrame(e.rafId),e.timeoutId&&clearTimeout(e.timeoutId)}),a&&a.disconnect()},isRunning:()=>i.length>0&&!i[0].paused&&!i[0].complete,isPaused:()=>i.length>0&&i[0].paused}},ripple:function(e,t={}){const n={colour:"rgba(255, 255, 255, 0.35)",duration:600,opacity:.35,unbounded:!1,centered:!1,trigger:"pointerdown",respectMotionPreference:!0,...t},s=yr(e,"ripple");if(!s)return null;if(n.respectMotionPreference&&_r())return{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o="domma-ripple-keyframes";if(!document.getElementById(o)){const e=document.createElement("style");e.id=o,e.textContent="\n @keyframes dm-ripple-expand {\n 0% {\n transform: scale(0);\n opacity: var(--dm-ripple-opacity, 0.35);\n }\n 100% {\n transform: scale(4);\n opacity: 0;\n }\n }\n ",document.head.appendChild(e)}const i=new Map;return s.forEach(e=>{e.classList.add("dm-ripple-container");"static"===getComputedStyle(e).position&&(e.style.position="relative"),n.unbounded||(e.style.overflow="hidden"),n.respectMotionPreference||e.setAttribute("data-force-animation","true");const t=t=>{const s=e.getBoundingClientRect(),o=2*Math.max(s.width,s.height);let i,r;n.centered?(i=s.width/2,r=s.height/2):(i=(t.clientX||t.touches?.[0]?.clientX||s.width/2)-s.left,r=(t.clientY||t.touches?.[0]?.clientY||s.height/2)-s.top);const a=document.createElement("span");a.className="dm-ripple",n.respectMotionPreference||a.setAttribute("data-force-animation","true"),a.style.cssText=`\n position: absolute;\n border-radius: 50%;\n pointer-events: none;\n width: ${o}px;\n height: ${o}px;\n left: ${i-o/2}px;\n top: ${r-o/2}px;\n background: ${n.colour};\n --dm-ripple-opacity: ${n.opacity};\n animation: dm-ripple-expand ${n.duration}ms ease-out forwards;\n `,e.appendChild(a),setTimeout(()=>{a.remove()},n.duration)};e.addEventListener(n.trigger,t),i.set(e,t)}),{pause(){},resume(){},stop(){},restart(){},destroy(){s.forEach(e=>{i.has(e)&&(e.removeEventListener(n.trigger,i.get(e)),i.delete(e)),e.classList.remove("dm-ripple-container"),e.querySelectorAll(".dm-ripple").forEach(e=>e.remove())})},isRunning:()=>!0,isPaused:()=>!1}},shake:function(e,t={}){const n={intensity:6,duration:500,direction:"horizontal",easing:"ease-in-out",iterations:1,stagger:0,respectMotionPreference:!0,onComplete:null,...t},s=yr(e,"shake");if(!s)return null;if(n.respectMotionPreference&&_r())return n.onComplete&&n.onComplete(),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const o=`domma-shake-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,i=n.intensity;let r;switch(n.direction){case"vertical":r=`\n 0%, 100% { transform: translateY(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateY(-${i}px); }\n 20%, 40%, 60%, 80% { transform: translateY(${i}px); }\n `;break;case"both":r=`\n 0%, 100% { transform: translate(0, 0); }\n 10% { transform: translate(-${i}px, -${i}px); }\n 20% { transform: translate(${i}px, ${i}px); }\n 30% { transform: translate(-${i}px, ${i}px); }\n 40% { transform: translate(${i}px, -${i}px); }\n 50% { transform: translate(-${i}px, 0); }\n 60% { transform: translate(${i}px, 0); }\n 70% { transform: translate(0, -${i}px); }\n 80% { transform: translate(0, ${i}px); }\n 90% { transform: translate(-${i}px, -${i}px); }\n `;break;default:r=`\n 0%, 100% { transform: translateX(0); }\n 10%, 30%, 50%, 70%, 90% { transform: translateX(-${i}px); }\n 20%, 40%, 60%, 80% { transform: translateX(${i}px); }\n `}const a=document.createElement("style");a.setAttribute("data-domma-effect",o),a.textContent=`@keyframes ${o} { ${r} }`,document.head.appendChild(a);const l=new Map;return s.forEach((e,t)=>{const i=t*n.stagger,r=()=>{e.style.animation=`${o} ${n.duration}ms ${n.easing} ${n.iterations}`;const i=()=>{e.style.animation="",e.removeEventListener("animationend",i),l.delete(e),n.onComplete&&t===s.length-1&&n.onComplete()};e.addEventListener("animationend",i),l.set(e,i)};i>0?setTimeout(r,i):r()}),{pause(){s.forEach(e=>e.style.animationPlayState="paused")},resume(){s.forEach(e=>e.style.animationPlayState="running")},stop(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))})},restart(){s.forEach((e,t)=>{e.style.animation="none",e.offsetHeight,e.style.animation=`${o} ${n.duration}ms ${n.easing} ${n.iterations}`})},destroy(){s.forEach(e=>{e.style.animation="",l.has(e)&&(e.removeEventListener("animationend",l.get(e)),l.delete(e))}),a.remove()},isRunning:()=>s.length>0&&""!==s[0].style.animation&&"paused"!==s[0].style.animationPlayState,isPaused:()=>s.length>0&&"paused"===s[0].style.animationPlayState}},twinkle:function(e,t={}){const n={count:100,minSize:1,maxSize:3,twinkleSpeed:.003,colour:"rgba(255, 240, 200, 1)",zIndex:1,shape:"star",respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.twinkle] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.twinkle] No elements found for selector:",e),null;let i=!1,r=!1,a=null;const l=`domma-twinkle-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,d=[];function c(e,t){const s=[];for(let o=0;o<n.count;o++)s.push({x:Math.random()*e,y:Math.random()*t,size:n.minSize+Math.random()*(n.maxSize-n.minSize),opacity:.3+.7*Math.random(),twinklePhase:Math.random()*Math.PI*2,twinkleSpeed:n.twinkleSpeed+Math.random()*n.twinkleSpeed});return s}function h(e,t){const s=document.createElement("canvas");if(s.id=l+(d.length>0?`-${d.length}`:""),s.setAttribute("data-domma-effect","twinkle"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const o=s.getContext("2d");return{canvas:s,ctx:o,stars:c(s.width,s.height),container:e}}function u(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}e.stars=c(e.canvas.width,e.canvas.height)}if(s){const e=h(document.body,!0);e.isFixed=!0,d.push(e)}else o.forEach(e=>{const t=h(e,!1);t.isFixed=!1,d.push(t)});let p=null;if(s){const e=()=>d.forEach(e=>u(e));window.addEventListener("resize",e),d[0]._resizeHandler=e}else"undefined"!=typeof ResizeObserver&&(p=new ResizeObserver(()=>{d.forEach(e=>u(e))}),o.forEach(e=>p.observe(e)));function m(){i&&!r&&(d.forEach(({canvas:e,ctx:t,stars:s})=>{t.clearRect(0,0,e.width,e.height),s.forEach(e=>function(e,t){t.twinklePhase+=t.twinkleSpeed;const s=.3+.7*Math.sin(t.twinklePhase);if(e.save(),e.globalAlpha=t.opacity*s,e.fillStyle=n.colour,e.shadowColor=n.colour,"circle"===n.shape)e.shadowBlur=2*t.size,e.beginPath(),e.arc(t.x,t.y,.6*t.size,0,2*Math.PI),e.fill();else{e.shadowBlur=2*t.size,e.beginPath();for(let n=0;n<4;n++){const s=n*Math.PI/2,o=t.x+Math.cos(s)*t.size,i=t.y+Math.sin(s)*t.size,r=s+Math.PI/4,a=t.x+Math.cos(r)*(.3*t.size),l=t.y+Math.sin(r)*(.3*t.size);0===n?e.moveTo(o,i):e.lineTo(o,i),e.lineTo(a,l)}e.closePath(),e.fill(),e.shadowBlur=t.size,e.beginPath(),e.arc(t.x,t.y,.25*t.size,0,2*Math.PI),e.fill()}e.restore()}(t,e))}),a=requestAnimationFrame(m))}function f(){i||(i=!0,r=!1,m())}return f(),console.log(`[Domma.effects.twinkle] Initialised with ${n.count} stars (${s?"full-page":"container"} mode)`),{pause(){i&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){i&&r&&(r=!1,m())},stop(){i=!1,r=!1,a&&(cancelAnimationFrame(a),a=null)},restart(){this.stop(),d.forEach(e=>{e.stars=c(e.canvas.width,e.canvas.height)}),f()},destroy(){this.stop(),s&&d[0]?._resizeHandler&&window.removeEventListener("resize",d[0]._resizeHandler),p&&(p.disconnect(),p=null),d.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),d.length=0},isRunning:()=>i&&!r,isPaused:()=>i&&r}},tickerTape:function(e,t={}){const n={palette:"theme",density:50,speed:1,sway:60,rotationSpeed:6,minWidth:5,maxWidth:9,minHeight:12,maxHeight:22,fadeStart:.55,burst:!1,burstCount:150,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.tickerTape] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.tickerTape] No elements found for selector:",e),null;const i=Lr(n.palette);let r=!1,a=!1,l=null;const d=`domma-ticker-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null,u=null;function p(e,t,s){const o=n.minWidth+Math.random()*(n.maxWidth-n.minWidth),r=n.minHeight+Math.random()*(n.maxHeight-n.minHeight);return{x:Math.random()*e,y:s?-r-40*Math.random():Math.random()*-t,vy:(1+2.2*Math.random())*n.speed,vx:.4*(Math.random()-.5)*n.speed,swayPhase:Math.random()*Math.PI*2,swayFreq:.005+.01*Math.random(),width:o,height:r,rotation:Math.random()*Math.PI*2,rotationSpeed:(Math.random()-.5)*n.rotationSpeed*Math.PI/180,flipPhase:Math.random()*Math.PI*2,flipSpeed:.018+.035*Math.random(),curlPhase:Math.random()*Math.PI*2,alpha:1,colour:i[Math.floor(Math.random()*i.length)],alive:!0}}function m(e,t){const s=document.createElement("canvas");if(s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","ticker-tape"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t)s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s);else{"static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s)}const o=s.getContext("2d"),i={canvas:s,ctx:o,particles:[],container:e,isFixed:t,burstFired:!1};return g(i),i}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++){const t=p(e.width,e.height,!1);t.y=-Math.random()*e.height*1.5,e.particles.push(t)}e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(p(e.width,e.height,!1))}}function g(e){const t=e.isFixed?{width:window.innerWidth,height:window.innerHeight}:e.container.getBoundingClientRect();e.width=t.width||e.container.offsetWidth||1,e.height=t.height||e.container.offsetHeight||1;const n=Math.min(window.devicePixelRatio||1,3);e.canvas.width=Math.round(e.width*n),e.canvas.height=Math.round(e.height*n),e.ctx.setTransform(n,0,0,n,0,0)}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),c.push(e);const t=()=>c.forEach(e=>g(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>{c.forEach(e=>g(e))}),o.forEach(e=>h.observe(e)));function v(e=performance.now()){if(!r||a)return;const t=null===u?1:Math.min(3,Math.max(0,(e-u)/(1e3/60)));u=e,c.forEach(e=>{const{canvas:s,ctx:o,particles:i}=e;o.clearRect(0,0,e.width,e.height);for(let s=i.length-1;s>=0;s--){const r=i[s];gr(r,e.height,n,t),r.alive?fr(o,r):i.splice(s,1)}if(!n.burst){const t=n.density;for(;i.length<t&&Math.random()<.6;)i.push(p(e.width,e.height,!0))}}),l=requestAnimationFrame(v)}function b(){r||(r=!0,a=!1,u=null,v())}return b(),console.log(`[Domma.effects.tickerTape] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,u=null,v())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),c.forEach(e=>f(e)),b()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},butterflies:function(e,t={}){const n={palette:"meadow",density:18,speed:1,wander:1,riseSpeed:.4,flapSpeed:1,minSize:14,maxSize:26,twoTone:!0,burst:!1,burstCount:40,zIndex:1,respectMotionPreference:!0,...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.butterflies] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.butterflies] No elements found for selector:",e),null;const i=Mr(n.palette);let r=!1,a=!1,l=null;const d=`domma-butterflies-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null;function u(e,t){const s=n.minSize+Math.random()*(n.maxSize-n.minSize),o=Math.random();let r,a;o<.6?(r=Math.random()*e,a=t+s):o<.8?(r=-s,a=t*(.4+.6*Math.random())):(r=e+s,a=t*(.4+.6*Math.random()));const l=-Math.PI/2+1.2*(Math.random()-.5),d=i[Math.floor(Math.random()*i.length)],c=n.twoTone?i[Math.floor(Math.random()*i.length)]:d;return{x:r,y:a,heading:l,targetHeading:l,speed:.6+.8*Math.random(),wanderTimer:60*Math.random(),flapPhase:Math.random()*Math.PI*2,flapSpeed:(.18+.12*Math.random())*n.flapSpeed,size:s,colourUpper:d,colourLower:c,alpha:1,alive:!0}}function p(e,t,s){e.wanderTimer-=1,e.wanderTimer<=0&&(e.targetHeading=-Math.PI/2+(Math.random()-.5)*(1.4*n.wander),e.wanderTimer=30+Math.random()*(60/Math.max(.2,n.wander)));let o=e.targetHeading-e.heading;for(;o>Math.PI;)o-=2*Math.PI;for(;o<-Math.PI;)o+=2*Math.PI;e.heading+=.05*o*n.wander;const i=e.speed*n.speed;e.x+=Math.cos(e.heading)*i+.3*Math.sin(e.flapPhase),e.y+=Math.sin(e.heading)*i-n.riseSpeed*n.speed,e.flapPhase+=e.flapSpeed,(e.y+e.size<0||e.y-e.size>2*s||e.x<3*-e.size||e.x>t+3*e.size)&&(e.alive=!1)}function m(e,t){const s=document.createElement("canvas");s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","butterflies"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const o=s.getContext("2d");return{canvas:s,ctx:o,particles:[],container:e,burstFired:!1}}function f(e){if(e.particles=[],n.burst){for(let t=0;t<n.burstCount;t++)e.particles.push(u(e.canvas.width,e.canvas.height));e.burstFired=!0}else{const t=Math.floor(.5*n.density);for(let n=0;n<t;n++)e.particles.push(u(e.canvas.width,e.canvas.height))}}function g(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,f(e),c.push(e);const t=()=>c.forEach(e=>g(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,f(t),c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>c.forEach(e=>g(e))),o.forEach(e=>h.observe(e)));function v(){r&&!a&&(c.forEach(e=>{const{canvas:t,ctx:s,particles:o}=e;s.clearRect(0,0,t.width,t.height);for(let e=o.length-1;e>=0;e--){const n=o[e];p(n,t.width,t.height),n.alive?vr(s,n):o.splice(e,1)}if(!n.burst)for(;o.length<n.density&&Math.random()<.3;)o.push(u(t.width,t.height))}),l=requestAnimationFrame(v))}function b(){r||(r=!0,a=!1,v())}return b(),console.log(`[Domma.effects.butterflies] Initialised (${s?"full-page":"container"} mode, palette: ${Array.isArray(n.palette)?"custom":n.palette})`),{pause(){r&&!a&&(a=!0,l&&(cancelAnimationFrame(l),l=null))},resume(){r&&a&&(a=!1,v())},stop(){r=!1,a=!1,l&&(cancelAnimationFrame(l),l=null)},restart(){this.stop(),c.forEach(e=>f(e)),b()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>r&&!a,isPaused:()=>r&&a}},strobe:function(e,t={}){const n={preset:"club",origins:["tl","tr","bl","br"],motion:"sweep",sweepArc:100,speed:1,beamWidth:16,flicker:!0,hz:10,colours:["#ffffff","#38bdf8","#f472b6","#a855f7"],intensity:.7,duration:null,zIndex:9999,respectMotionPreference:!0,...function(e){return kr[e]?kr[e]:(console.warn(`[Domma.effects.strobe] Unknown preset '${e}', using 'club'.`),kr.club)}(t.preset||"club"),...t};if(n.respectMotionPreference&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)return console.log("[Domma.effects.strobe] Disabled due to prefers-reduced-motion"),{pause:()=>{},resume:()=>{},stop:()=>{},restart:()=>{},destroy:()=>{},isRunning:()=>!1,isPaused:()=>!1};n.flicker&&n.hz>5&&console.warn(`[Domma.effects.strobe] flicker hz=${n.hz} exceeds 5Hz - rapid flashing can trigger photosensitive seizures.`);const s=!e||"body"===e||e===document.body;let o=[];if(!s&&("string"==typeof e?o=Array.from(document.querySelectorAll(e)):e instanceof Element?o=[e]:(e instanceof NodeList||Array.isArray(e))&&(o=Array.from(e)),0===o.length))return console.warn("[Domma.effects.strobe] No elements found for selector:",e),null;let i=!1,r=!1,a=null,l=null;const d=`domma-strobe-${Date.now()}-${Math.random().toString(36).substr(2,9)}`,c=[];let h=null;function u(){return n.origins.map((e,t)=>({corner:e,colour:n.colours[t%n.colours.length],phase:t/Math.max(1,n.origins.length)*Math.PI*2}))}const p=[{widthMul:1.9,alphaMul:.16},{widthMul:1,alphaMul:.5},{widthMul:.45,alphaMul:1}];function m(e,t){const s=document.createElement("canvas");s.id=d+(c.length>0?`-${c.length}`:""),s.setAttribute("data-domma-effect","strobe"),s.style.pointerEvents="none",s.style.zIndex=n.zIndex,t?(s.style.position="fixed",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=window.innerWidth,s.height=window.innerHeight,document.body.appendChild(s)):("static"===window.getComputedStyle(e).position&&(e.style.position="relative"),s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",s.width=e.offsetWidth||e.getBoundingClientRect().width,s.height=e.offsetHeight||e.getBoundingClientRect().height,e.appendChild(s));const o=s.getContext("2d");return{canvas:s,ctx:o,container:e,beams:u()}}function f(e){if(e.isFixed)e.canvas.width=window.innerWidth,e.canvas.height=window.innerHeight;else{const t=e.container.getBoundingClientRect();e.canvas.width=t.width||e.container.offsetWidth,e.canvas.height=t.height||e.container.offsetHeight}}if(s){const e=m(document.body,!0);e.isFixed=!0,c.push(e);const t=()=>c.forEach(e=>f(e));window.addEventListener("resize",t),c[0]._resizeHandler=t}else o.forEach(e=>{const t=m(e,!1);t.isFixed=!1,c.push(t)}),"undefined"!=typeof ResizeObserver&&(h=new ResizeObserver(()=>c.forEach(e=>f(e))),o.forEach(e=>h.observe(e)));function g(){if(!i||r)return;let e=1;if(n.flicker){const t=.5+.5*Math.sin(("undefined"!=typeof performance&&performance.now?performance.now():Date.now())/1e3*n.hz*Math.PI*2);e=.4+.6*t}c.forEach(t=>{const{canvas:s,ctx:o,beams:i}=t,r=s.width,a=s.height;o.globalCompositeOperation="destination-out",o.fillStyle="rgba(0, 0, 0, 0.14)",o.fillRect(0,0,r,a),o.globalCompositeOperation="lighter";const l=r/2,d=a/2;i.forEach(t=>{const{x:s,y:i}=function(e,t,n){switch(e){case"tr":return{x:t,y:0};case"bl":return{x:0,y:n};case"br":return{x:t,y:n};default:return{x:0,y:0}}}(t.corner,r,a);let c;if("rotate"===n.motion)c=t.phase,t.phase+=.01*n.speed;else{c=Math.atan2(d-i,l-s)+Math.sin(t.phase)*(n.sweepArc*Math.PI/180)/2,t.phase+=.02*n.speed}!function(e,t,s,o,i,r,a,l){const d=1.5*Math.hypot(r,a),c=n.beamWidth*Math.PI/180/2;for(let r=0;r<p.length;r++){const a=p[r],h=c*a.widthMul,u=n.intensity*a.alphaMul*l;if(u<=.003)continue;const m=t+Math.cos(o-h)*d,f=s+Math.sin(o-h)*d,g=t+Math.cos(o+h)*d,v=s+Math.sin(o+h)*d,b=e.createRadialGradient(t,s,0,t,s,d);b.addColorStop(0,wr(i,u)),b.addColorStop(.4,wr(i,.4*u)),b.addColorStop(1,wr(i,0)),e.fillStyle=b,e.beginPath(),e.moveTo(t,s),e.lineTo(m,f),e.lineTo(g,v),e.closePath(),e.fill()}}(o,s,i,c,t.colour,r,a,e)}),o.globalCompositeOperation="source-over"}),a=requestAnimationFrame(g)}function v(){i||(i=!0,r=!1,g(),n.duration&&(l=setTimeout(()=>b.stop(),n.duration)))}const b={pause(){i&&!r&&(r=!0,a&&(cancelAnimationFrame(a),a=null))},resume(){i&&r&&(r=!1,g())},stop(){i=!1,r=!1,a&&(cancelAnimationFrame(a),a=null),l&&(clearTimeout(l),l=null),c.forEach(({canvas:e,ctx:t})=>t&&t.clearRect(0,0,e.width,e.height))},restart(){this.stop(),c.forEach(e=>{e.beams=u()}),v()},destroy(){this.stop(),s&&c[0]?._resizeHandler&&window.removeEventListener("resize",c[0]._resizeHandler),h&&(h.disconnect(),h=null),c.forEach(({canvas:e})=>{e&&e.parentNode&&e.parentNode.removeChild(e)}),c.length=0},isRunning:()=>i&&!r,isPaused:()=>i&&r};return v(),console.log(`[Domma.effects.strobe] Initialised (${s?"full-page":"container"} mode, preset: ${n.preset})`),b}};const Er={_configs:new Map,_components:new Map,_eventHandlers:new Map,_initCallbacks:[],_domReady:!1,_autoWrap:!0,process(e,t={}){if(!e||"object"!=typeof e)return;(void 0!==t.autoWrap?t.autoWrap:this._autoWrap)&&!this._domReady&&"loading"===document.readyState?document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,this._processConfig(e)},{once:!0}):this._processConfig(e)},_processConfig(e){e.$init&&"function"==typeof e.$init&&(this._initCallbacks.push(e.$init),e.$init(),delete e.$init),Object.keys(e).forEach(t=>{const n=e[t];if(this._configs.set(t,c.cloneDeep(n)),n.init&&"function"==typeof n.init){const e=l(t);n.init.call(e,e)}const s=l(t);if(n.component){const e=this.initComponent(t,n.component,n.options||{});e&&this._components.set(t,e)}n.initial&&this.applyProperties(s,n.initial),n.events&&this.bindEvents(t,n.events,!0)})},update(e,t){const n=this._configs.get(e);if(!n)return this.process({[e]:t}),this._configs.get(e);const s=c.merge({},n,t);this._configs.set(e,s);const o=l(e);if(t.options&&this._components.has(e)){const n=this._components.get(e);n&&"function"==typeof n.setOptions&&n.setOptions(t.options)}return t.initial&&this.applyProperties(o,t.initial),t.events&&this.updateEvents(e,t.events),s},config(e){if(!e){const e={};return this._configs.forEach((t,n)=>{e[n]=t}),e}return this._configs.get(e)||null},getComponent(e){return e?this._components.get(e)||null:new Map(this._components)},reset(e){if(!e){return void Array.from(this._configs.keys()).forEach(e=>this.reset(e))}const t=this._components.get(e);t&&"function"==typeof t.destroy&&t.destroy(),this._components.delete(e),this.unbindEvents(e),this._configs.delete(e)},initComponent(e,t,n){const s={card:ln.card,modal:ln.modal,tabs:ln.tabs,accordion:ln.accordion,tooltip:ln.tooltip,carousel:ln.carousel,dropdown:ln.dropdown,contextMenu:ln.contextMenu,sortable:ln.sortable,skeleton:ln.skeleton,avatar:ln.avatar,avatarGroup:ln.avatarGroup,inputGroup:ln.inputGroup,popover:ln.popover,badge:ln.badge,numberBadge:ln.numberBadge,listGroup:ln.listGroup,cookieConsent:ln.cookieConsent,backToTop:ln.backToTop,buttonGroup:ln.buttonGroup,loader:ln.loader,breadcrumbs:ln.breadcrumbs,navbar:ln.navbar,sidebar:ln.sidebar,footer:ln.footer,notification:ln.notification,timer:ln.timer,alarm:ln.alarm,autocomplete:ln.autocomplete,pillbox:ln.pillbox,signature:ln.signature,form:mr.create,breathe:Cr.breathe,pulse:Cr.pulse,scribe:Cr.scribe}[t];if(s){if("form"===t){if(!n.schema)return console.error("Forms component requires a schema option"),null;const t=s(n.schema,n.data||{},n);return t.renderTo(e),t}return s.call(ln,e,n)}console.warn(`Unknown component type: ${t}`)},applyProperties(e,t){Object.keys(t).forEach(n=>{"css"===n?e.css(t[n]):"text"===n?e.text(t[n]):"html"===n?e.html(t[n]):"addClass"===n?e.addClass(t[n]):"removeClass"===n?e.removeClass(t[n]):"toggleClass"===n?e.toggleClass(t[n]):"attr"===n&&Object.keys(t[n]).forEach(s=>{e.attr(s,t[n][s])})})},bindEvents(e,t,n=!1){const s=l(e);n&&!this._eventHandlers.has(e)&&this._eventHandlers.set(e,new Map),Object.keys(t).forEach(o=>{const i=t[o],r=e=>this.executeActions(e,i);s.on(o,r),n&&this._eventHandlers.get(e).set(o,r)})},unbindEvents(e){const t=this._eventHandlers.get(e);if(!t)return;const n=l(e);t.forEach((e,t)=>{n.off(t,e)}),this._eventHandlers.delete(e)},updateEvents(e,t){const n=this._eventHandlers.get(e),s=l(e);n&&Object.keys(t).forEach(e=>{n.has(e)&&(s.off(e,n.get(e)),n.delete(e))}),this.bindEvents(e,t,!0)},executeActions(e,t){if("function"==typeof t)return void t.call(e.target,e,l(e.target));const n=Array.isArray(t)?t:[t],s=l(e.target);n.forEach(t=>{if("function"==typeof t)return void t.call(e.target,e,s);const n=t.target?l(t.target):s;t.css&&n.css(t.css),t.text&&n.text(t.text),t.html&&n.html(t.html),t.addClass&&n.addClass(t.addClass),t.removeClass&&n.removeClass(t.removeClass),t.toggleClass&&n.toggleClass(t.toggleClass),t.log&&console.log(t.log)})},ready(e){"function"==typeof e?this._domReady||"complete"===document.readyState||"interactive"===document.readyState?e():document.addEventListener("DOMContentLoaded",()=>{this._domReady=!0,e()},{once:!0}):console.warn("ready() requires a function")}},Ar=1e3,Sr=6e4,$r=36e5,zr=864e5,Tr=6048e5,jr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],Br=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],Dr=["January","February","March","April","May","June","July","August","September","October","November","December"],Wr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];class Hr{constructor(e){e instanceof Hr?this._date=new Date(e._date):e instanceof Date?this._date=new Date(e):this._date="string"==typeof e||"number"==typeof e?new Date(e):null==e?new Date:new Date(e)}add(e,t){const n=this._normalizeUnit(t),s=this._date;return"years"===n?s.setFullYear(s.getFullYear()+e):"months"===n?s.setMonth(s.getMonth()+e):"weeks"===n?s.setDate(s.getDate()+7*e):"days"===n?s.setDate(s.getDate()+e):"hours"===n?s.setHours(s.getHours()+e):"minutes"===n?s.setMinutes(s.getMinutes()+e):"seconds"===n?s.setSeconds(s.getSeconds()+e):"milliseconds"===n&&s.setMilliseconds(s.getMilliseconds()+e),this}subtract(e,t){return this.add(-e,t)}startOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(0,1),n.setHours(0,0,0,0)):"months"===t||"month"===t?(n.setDate(1),n.setHours(0,0,0,0)):"weeks"===t||"week"===t?(n.setDate(n.getDate()-n.getDay()),n.setHours(0,0,0,0)):"days"===t||"day"===t?n.setHours(0,0,0,0):"hours"===t||"hour"===t?n.setMinutes(0,0,0):"minutes"===t||"minute"===t?n.setSeconds(0,0):"seconds"!==t&&"second"!==t||n.setMilliseconds(0),this}endOf(e){const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?(n.setMonth(11,31),n.setHours(23,59,59,999)):"months"===t||"month"===t?(n.setMonth(n.getMonth()+1,0),n.setHours(23,59,59,999)):"weeks"===t||"week"===t?(n.setDate(n.getDate()+(6-n.getDay())),n.setHours(23,59,59,999)):"days"===t||"day"===t?n.setHours(23,59,59,999):"hours"===t||"hour"===t?n.setMinutes(59,59,999):"minutes"===t||"minute"===t?n.setSeconds(59,999):"seconds"!==t&&"second"!==t||n.setMilliseconds(999),this}set(e,t){const n=this._normalizeUnit(e),s=this._date;return"years"===n||"year"===n?s.setFullYear(t):"months"===n||"month"===n?s.setMonth(t):"days"===n||"day"===n||"date"===n?s.setDate(t):"hours"===n||"hour"===n?s.setHours(t):"minutes"===n||"minute"===n?s.setMinutes(t):"seconds"===n||"second"===n?s.setSeconds(t):"milliseconds"!==n&&"millisecond"!==n||s.setMilliseconds(t),this}get(e){if(!e)return this._date;const t=this._normalizeUnit(e),n=this._date;return"years"===t||"year"===t?n.getFullYear():"months"===t||"month"===t?n.getMonth():"days"===t||"day"===t?n.getDay():"date"===t?n.getDate():"hours"===t||"hour"===t?n.getHours():"minutes"===t||"minute"===t?n.getMinutes():"seconds"===t||"second"===t?n.getSeconds():"milliseconds"===t||"millisecond"===t?n.getMilliseconds():this._date}year(){return this._date.getFullYear()}month(){return this._date.getMonth()}date(){return this._date.getDate()}day(){return this._date.getDay()}hour(){return this._date.getHours()}minute(){return this._date.getMinutes()}second(){return this._date.getSeconds()}millisecond(){return this._date.getMilliseconds()}dayOfYear(){const e=new Date(this._date.getFullYear(),0,0),t=this._date-e;return Math.floor(t/864e5)}week(){const e=new Date(this._date.getFullYear(),0,1),t=this._date-e;return Math.ceil(t/6048e5+e.getDay()/7)}quarter(){return Math.floor(this._date.getMonth()/3)+1}unix(){return Math.floor(this._date.getTime()/1e3)}valueOf(){return this._date.getTime()}format(e="YYYY-MM-DD HH:mm:ss"){const t=this._date,n=t.getFullYear(),s=t.getMonth(),o=t.getDate(),i=t.getDay(),r=t.getHours(),a=t.getMinutes(),l=t.getSeconds(),d=t.getMilliseconds(),c=r%12||12,h=(e,t=2)=>String(e).padStart(t,"0"),u={YYYY:n,YY:String(n).slice(-2),MMMM:Dr[s],MMM:Wr[s],MM:h(s+1),M:s+1,dddd:jr[i],ddd:Br[i],DD:h(o),D:o,HH:h(r),H:r,hh:h(c),h:c,mm:h(a),m:a,ss:h(l),s:l,SSS:h(d,3),A:r<12?"AM":"PM",a:r<12?"am":"pm"},p=Object.keys(u).sort((e,t)=>t.length-e.length),m=new RegExp(p.join("|"),"g");return e.replace(m,e=>u[e])}toISOString(){return this._date.toISOString()}toDate(){return new Date(this._date)}toString(){return this._date.toString()}fromNow(e){const t=e?new Hr(e)._date:new Date,n=this._date.getTime()-t.getTime(),s=Math.abs(n),o=n<0;let i,r;return s<Sr?"just now":(s<$r?(i=Math.floor(s/Sr),r=1===i?"minute":"minutes"):s<zr?(i=Math.floor(s/$r),r=1===i?"hour":"hours"):s<Tr?(i=Math.floor(s/zr),r=1===i?"day":"days"):s<30*zr?(i=Math.floor(s/Tr),r=1===i?"week":"weeks"):s<365*zr?(i=Math.floor(s/(30*zr)),r=1===i?"month":"months"):(i=Math.floor(s/(365*zr)),r=1===i?"year":"years"),o?`${i} ${r} ago`:`in ${i} ${r}`)}to(e){const t=new Hr(e)._date.getTime()-this._date.getTime(),n=Math.abs(t),s=t>0;let o,i;return n<Sr?"just now":(n<$r?(o=Math.floor(n/Sr),i=1===o?"minute":"minutes"):n<zr?(o=Math.floor(n/$r),i=1===o?"hour":"hours"):n<Tr?(o=Math.floor(n/zr),i=1===o?"day":"days"):n<30*zr?(o=Math.floor(n/Tr),i=1===o?"week":"weeks"):n<365*zr?(o=Math.floor(n/(30*zr)),i=1===o?"month":"months"):(o=Math.floor(n/(365*zr)),i=1===o?"year":"years"),s?`in ${o} ${i}`:`${o} ${i} ago`)}isBefore(e,t){const n=new Hr(e);return t?this.clone().endOf(t).valueOf()<n.clone().startOf(t).valueOf():this._date.getTime()<n._date.getTime()}isAfter(e,t){const n=new Hr(e);return t?this.clone().startOf(t).valueOf()>n.clone().endOf(t).valueOf():this._date.getTime()>n._date.getTime()}isSame(e,t){const n=new Hr(e);if(!t)return this._date.getTime()===n._date.getTime();const s=this.clone().startOf(t).valueOf(),o=this.clone().endOf(t).valueOf(),i=n.valueOf();return i>=s&&i<=o}isBetween(e,t,n,s="()"){const o=new Hr(e),i=new Hr(t);let r,a,l;n?(r=o.clone().startOf(n).valueOf(),a=i.clone().endOf(n).valueOf(),l=this.clone().startOf(n).valueOf()):(r=o.valueOf(),a=i.valueOf(),l=this.valueOf());const d="["===s[0],c="]"===s[1];return(d?l>=r:l>r)&&(c?l<=a:l<a)}diff(e,t="milliseconds",n=!1){const s=new Hr(e),o=this._date.getTime()-s._date.getTime(),i=this._normalizeUnit(t);let r;return r="milliseconds"===i?o:"seconds"===i?o/Ar:"minutes"===i?o/Sr:"hours"===i?o/$r:"days"===i?o/zr:"weeks"===i?o/Tr:"months"===i?this._monthDiff(s):"years"===i?this._monthDiff(s)/12:o,n?r:Math.floor(r)}_monthDiff(e){const t=this._date,n=e._date;return 12*(t.getFullYear()-n.getFullYear())+(t.getMonth()-n.getMonth())}isValid(){return!isNaN(this._date.getTime())}isLeapYear(){const e=this._date.getFullYear();return e%4==0&&e%100!=0||e%400==0}daysInMonth(){return new Date(this._date.getFullYear(),this._date.getMonth()+1,0).getDate()}clone(){return new Hr(this._date)}_normalizeUnit(e){if(!e)return e;const t=String(e).toLowerCase().trim();return"year"===t?"years":"month"===t?"months":"week"===t?"weeks":"day"===t?"days":"hour"===t?"hours":"minute"===t?"minutes":"second"===t?"seconds":"millisecond"===t?"milliseconds":t}}const Or=function(e){return new Hr(e)};Object.assign(Or,{now:()=>Date.now(),parse(e,t){if(!t)return new Hr(e);const n={YYYY:{regex:"(\\d{4})",setter:"year"},YY:{regex:"(\\d{2})",setter:"year",transform:e=>2e3+parseInt(e)},MM:{regex:"(\\d{2})",setter:"month",transform:e=>parseInt(e)-1},M:{regex:"(\\d{1,2})",setter:"month",transform:e=>parseInt(e)-1},DD:{regex:"(\\d{2})",setter:"date"},D:{regex:"(\\d{1,2})",setter:"date"},HH:{regex:"(\\d{2})",setter:"hour"},H:{regex:"(\\d{1,2})",setter:"hour"},mm:{regex:"(\\d{2})",setter:"minute"},m:{regex:"(\\d{1,2})",setter:"minute"},ss:{regex:"(\\d{2})",setter:"second"},s:{regex:"(\\d{1,2})",setter:"second"}};let s=t;const o=[],i=Object.keys(n).sort((e,t)=>t.length-e.length);for(const e of i)if(t.includes(e)){-1!==s.indexOf(e)&&(s=s.replace(e,n[e].regex),o.push({token:e,...n[e]}))}s=s.replace(/[-\/\\^$*+?.()|[\]{}]/g,e=>"("===e||")"===e?e:"\\"+e);try{const t=new RegExp("^"+s+"$"),n=e.match(t);if(!n)return new Hr(NaN);const i=new Hr;i.set("hour",0).set("minute",0).set("second",0).set("millisecond",0);for(let e=0;e<o.length;e++){let t=parseInt(n[e+1]);o[e].transform&&(t=o[e].transform(n[e+1])),i.set(o[e].setter,t)}return i}catch(e){return new Hr(NaN)}},isValid:e=>new Hr(e).isValid(),min(...e){const t=e.flat().map(e=>new Hr(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()<n.valueOf()&&(n=t[e]);return n},max(...e){const t=e.flat().map(e=>new Hr(e));let n=t[0];for(let e=1;e<t.length;e++)t[e].valueOf()>n.valueOf()&&(n=t[e]);return n},tokens:{YYYY:"Full year (2025)",YY:"Short year (25)",MM:"Month 01-12",M:"Month 1-12",DD:"Day 01-31",D:"Day 1-31",HH:"Hour 00-23",H:"Hour 0-23",hh:"Hour 01-12",h:"Hour 1-12",mm:"Minute 00-59",m:"Minute 0-59",ss:"Second 00-59",s:"Second 0-59",SSS:"Milliseconds",A:"AM/PM",a:"am/pm",ddd:"Day name short (Mon)",dddd:"Day name full (Monday)",MMM:"Month name short (Jan)",MMMM:"Month name full (January)"}});const Ir={"arrow-up":{viewBox:"0 0 24 24",path:"M12 19V5M5 12l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down":{viewBox:"0 0 24 24",path:"M12 5v14M19 12l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-left":{viewBox:"0 0 24 24",path:"M19 12H5M12 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-right":{viewBox:"0 0 24 24",path:"M5 12h14M12 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-left":{viewBox:"0 0 24 24",path:"M17 17L7 7M7 17V7h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-up-right":{viewBox:"0 0 24 24",path:"M7 17L17 7M7 7h10v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-left":{viewBox:"0 0 24 24",path:"M17 7L7 17M17 17H7V7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"arrow-down-right":{viewBox:"0 0 24 24",path:"M7 7l10 10M17 7v10H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},menu:{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h18","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"menu-alt":{viewBox:"0 0 24 24",paths:["M3 6h18","M3 12h12","M3 18h18"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},"dots-horizontal":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},"dots-vertical":{viewBox:"0 0 24 24",paths:["M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0","M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"],fill:"currentColor"},grid:{viewBox:"0 0 24 24",path:"M3 3h7v7H3zM14 3h7v7h-7zM14 14h7v7h-7zM3 14h7v7H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},list:{viewBox:"0 0 24 24",paths:["M8 6h13","M8 12h13","M8 18h13","M3 6h.01","M3 12h.01","M3 18h.01"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},columns:{viewBox:"0 0 24 24",path:"M12 3v18M3 3h18v18H3V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 3h16a1 1 0 011 1v16a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1zM9 21V9m12-6H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},close:{viewBox:"0 0 24 24",path:"M18 6L6 18M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plus:{viewBox:"0 0 24 24",path:"M12 5v14M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minus:{viewBox:"0 0 24 24",path:"M5 12h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"plus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM12 8v8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minus-square":{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},search:{viewBox:"0 0 24 24",path:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},refresh:{viewBox:"0 0 24 24",path:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},edit:{viewBox:"0 0 24 24",path:"M11 4H4a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2v-7M18.5 2.5a2.121 2.121 0 013 3L12 15l-4 1 1-4 9.5-9.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-2":{viewBox:"0 0 24 24",path:"M17 3a2.85 2.85 0 114 4L7.5 20.5 2 22l1.5-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"edit-3":{viewBox:"0 0 24 24",path:"M12 20h9M16.5 3.5a2.121 2.121 0 013 3L7 19l-4 1 1-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trash:{viewBox:"0 0 24 24",path:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filter:{viewBox:"0 0 24 24",path:"M3 4a1 1 0 011-1h16a1 1 0 011 1v2.586a1 1 0 01-.293.707l-6.414 6.414a1 1 0 00-.293.707V17l-4 4v-6.586a1 1 0 00-.293-.707L3.293 7.293A1 1 0 013 6.586V4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sort:{viewBox:"0 0 24 24",paths:["M3 6h7","M3 12h5","M3 18h3","M16 6l4 4-4 4","M20 10H10"],stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 12l2-2m0 0l7-7 7 7M5 10v10a1 1 0 001 1h3m10-11l2 2m-2-2v10a1 1 0 01-1 1h-3m-6 0a1 1 0 001-1v-4a1 1 0 011-1h2a1 1 0 011 1v4a1 1 0 001 1m-6 0h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},user:{viewBox:"0 0 24 24",path:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},users:{viewBox:"0 0 24 24",path:"M17 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2M9 11a4 4 0 100-8 4 4 0 000 8zM23 21v-2a4 4 0 00-3-3.87M16 3.13a4 4 0 010 7.75",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},settings:{viewBox:"0 0 24 24",path:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065zM15 12a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cog:{viewBox:"0 0 24 24",path:"M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tool:{viewBox:"0 0 24 24",path:"M14.7 6.3a1 1 0 000 1.4l1.6 1.6a1 1 0 001.4 0l3.77-3.77a6 6 0 01-7.94 7.94l-6.91 6.91a2.12 2.12 0 01-3-3l6.91-6.91a6 6 0 017.94-7.94l-3.76 3.76z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},eye:{viewBox:"0 0 24 24",path:"M15 12a3 3 0 11-6 0 3 3 0 016 0z M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-off":{viewBox:"0 0 24 24",path:"M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lock:{viewBox:"0 0 24 24",path:"M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlock:{viewBox:"0 0 24 24",path:"M8 11V7a4 4 0 118 0m-4 8v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clock:{viewBox:"0 0 24 24",path:"M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calendar:{viewBox:"0 0 24 24",path:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},star:{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-filled":{viewBox:"0 0 24 24",path:"M11.049 2.927c.3-.921 1.603-.921 1.902 0l1.519 4.674a1 1 0 00.95.69h4.915c.969 0 1.371 1.24.588 1.81l-3.976 2.888a1 1 0 00-.363 1.118l1.518 4.674c.3.922-.755 1.688-1.538 1.118l-3.976-2.888a1 1 0 00-1.176 0l-3.976 2.888c-.783.57-1.838-.197-1.538-1.118l1.518-4.674a1 1 0 00-.363-1.118l-3.976-2.888c-.784-.57-.38-1.81.588-1.81h4.914a1 1 0 00.951-.69l1.519-4.674z",fill:"currentColor"},sun:{viewBox:"0 0 24 24",path:"M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},globe:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},map:{viewBox:"0 0 24 24",path:"M9 20l-5.447-2.724A1 1 0 013 16.382V5.618a1 1 0 011.447-.894L9 7m0 13l6-3m-6 3V7m6 10l4.553 2.276A1 1 0 0021 18.382V7.618a1 1 0 00-.553-.894L15 4m0 13V4m0 0L9 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pin:{viewBox:"0 0 24 24",path:"M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z M15 11a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},feather:{viewBox:"0 0 24 24",path:"M20.24 12.24a6 6 0 00-8.49-8.49L5 10.5V19h8.5zM16 8L2 22M17.5 15H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},palette:{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10c.93 0 1.68-.75 1.68-1.68 0-.43-.16-.84-.44-1.13-.27-.29-.43-.7-.43-1.13 0-.93.76-1.69 1.69-1.69h1.98c3.03 0 5.52-2.49 5.52-5.52C22 6.48 17.52 2 12 2zm-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 8 6.5 8 8 8.67 8 9.5 7.33 11 6.5 11zm3-4C8.67 7 8 6.33 8 5.5S8.67 4 9.5 4s1.5.67 1.5 1.5S10.33 7 9.5 7zm5 0c-.83 0-1.5-.67-1.5-1.5S13.67 4 14.5 4s1.5.67 1.5 1.5S15.33 7 14.5 7zm3 4c-.83 0-1.5-.67-1.5-1.5S16.67 8 17.5 8s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z",fill:"currentColor"},type:{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},square:{viewBox:"0 0 24 24",path:"M5 3h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mouse-pointer":{viewBox:"0 0 24 24",path:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z M13 13l6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"refresh-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sync:{viewBox:"0 0 24 24",path:"M1 4v6h6m16 10v-6h-6M2 20l6-6M22 4l-6 6M9 12l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gauge:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 0110 10c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2z M8 12l4 4 4-4M12 16V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"map-pin":{viewBox:"0 0 24 24",path:"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0118 0z M12 13a3 3 0 100-6 3 3 0 000 6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"help-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M9.09 9a3 3 0 015.83 1c0 2-3 3-3 3 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sliders:{viewBox:"0 0 24 24",path:"M4 21v-7m0-4V3m8 18v-9m0-4V3m8 18v-5m0-4V3M1 14h6m2-6h6m2 8h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-check":{viewBox:"0 0 24 24",path:"M16 21v-2a4 4 0 00-4-4H5a4 4 0 00-4 4v2m16-13l2 2 4-4M13 7a4 4 0 11-8 0 4 4 0 018 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},component:{viewBox:"0 0 24 24",path:"M21 16V8a2 2 0 00-1-1.73l-7-4a2 2 0 00-2 0l-7 4A2 2 0 003 8v8a2 2 0 001 1.73l7 4a2 2 0 002 0l7-4A2 2 0 0021 16zM3.27 6.96L12 12.01l8.73-5.05M12 22.08V12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07A19.5 19.5 0 013.07 9.8a19.79 19.79 0 01-3.07-8.64A2 2 0 012 .18h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L6.09 7.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7A2 2 0 0122 14v2.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mail:{viewBox:"0 0 24 24",path:"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z M22 6l-10 7L2 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2z M16 7V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},building:{viewBox:"0 0 24 24",path:"M3 21h18 M5 21V5a2 2 0 012-2h10a2 2 0 012 2v16 M9 9h2 M9 13h2 M9 17h2 M13 9h2 M13 13h2 M13 17h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-2":{viewBox:"0 0 24 24",path:"M15 7h3a5 5 0 015 5 5 5 0 01-5 5h-3m-6 0H6a5 5 0 01-5-5 5 5 0 015-5h3 M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 11-8 0 4 4 0 018 0z M16 8v5a3 3 0 006 0v-1a10 10 0 10-3.92 7.94",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M20.84 4.61a5.5 5.5 0 00-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 00-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 000-7.78z",stroke:"currentColor",fill:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cake:{viewBox:"0 0 24 24",path:"M20 21H4a2 2 0 01-2-2v-4a2 2 0 012-2h16a2 2 0 012 2v4a2 2 0 01-2 2z M8 13V9 M12 13V9 M16 13V9 M8 9a1 1 0 010-2 1 1 0 010 2z M12 9a1 1 0 010-2 1 1 0 010 2z M16 9a1 1 0 010-2 1 1 0 010 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sidebar:{viewBox:"0 0 24 24",path:"M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2z M9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},window:{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 00-2 2v12a2 2 0 002 2h16a2 2 0 002-2V6a2 2 0 00-2-2z M2 9h20 M5.5 6.5h.01 M8 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Nr={mail:{viewBox:"0 0 24 24",path:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mail-open":{viewBox:"0 0 24 24",path:"M3 19V9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2z M3 9l9 6 9-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},inbox:{viewBox:"0 0 24 24",path:"M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},send:{viewBox:"0 0 24 24",path:"M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},phone:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-incoming":{viewBox:"0 0 24 24",path:"M14.5 2v6m0 0h6m-6 0l7-7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-outgoing":{viewBox:"0 0 24 24",path:"M21.5 2h-6m6 0v6m0-6l-7 7M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M16.5 10.5l5.5-5.5M22 5l-5.5 5.5M10.68 13.31a16 16 0 003.41 2.6l1.27-1.27a2 2 0 012.11-.45 12.84 12.84 0 002.81.7 2 2 0 011.72 2v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.42 19.42 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72 12.84 12.84 0 00.7 2.81 2 2 0 01-.45 2.11L8.09 9.91",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},chat:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chat-alt":{viewBox:"0 0 24 24",path:"M17 8h2a2 2 0 012 2v6a2 2 0 01-2 2h-2v4l-4-4H9a1.994 1.994 0 01-1.414-.586m0 0L11 14h4a2 2 0 002-2V6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2v4l.586-.586z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-circle":{viewBox:"0 0 24 24",path:"M21 11.5a8.38 8.38 0 01-.9 3.8 8.5 8.5 0 01-7.6 4.7 8.38 8.38 0 01-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 01-.9-3.8 8.5 8.5 0 014.7-7.6 8.38 8.38 0 013.8-.9h.5a8.48 8.48 0 018 8v.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"message-square":{viewBox:"0 0 24 24",path:"M21 15a2 2 0 01-2 2H7l-4 4V5a2 2 0 012-2h14a2 2 0 012 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bell:{viewBox:"0 0 24 24",path:"M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bell-off":{viewBox:"0 0 24 24",path:"M13.73 21a2 2 0 01-3.46 0M18.63 13A17.89 17.89 0 0118 8M6.26 6.26A5.86 5.86 0 006 8c0 7-3 9-3 9h14M18 8a6 6 0 00-9.33-5M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},notification:{viewBox:"0 0 24 24",path:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-2 1H8v-6c0-2.48 1.51-4.5 4-4.5s4 2.02 4 4.5v6z",fill:"currentColor"},"at-sign":{viewBox:"0 0 24 24",path:"M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},paperclip:{viewBox:"0 0 24 24",path:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rss:{viewBox:"0 0 24 24",path:"M4 11a9 9 0 0 1 9 9M4 4a16 16 0 0116 16M5 20a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wifi:{viewBox:"0 0 24 24",path:"M12 20h.01M2 8.82a15 15 0 0120 0M5 12.859a10 10 0 0114 0M8.5 16.429a5 5 0 017 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"wifi-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M16.72 11.06A10.94 10.94 0 0119 12.55M5 12.55a10.94 10.94 0 015.17-2.39m3.64.46a10.88 10.88 0 012.69 1.92M8.5 16.429a5 5 0 013.5-1.43M12 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Pr={play:{viewBox:"0 0 24 24",path:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-filled":{viewBox:"0 0 24 24",path:"M5 3l14 9-14 9V3z",fill:"currentColor"},pause:{viewBox:"0 0 24 24",path:"M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pause-filled":{viewBox:"0 0 24 24",paths:["M6 4h4v16H6z","M14 4h4v16h-4z"],fill:"currentColor"},stop:{viewBox:"0 0 24 24",path:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z M9 10a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"stop-filled":{viewBox:"0 0 24 24",path:"M6 6h12v12H6z",fill:"currentColor"},"skip-back":{viewBox:"0 0 24 24",path:"M19 20L9 12l10-8v16zM5 19V5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"skip-forward":{viewBox:"0 0 24 24",path:"M5 4l10 8-10 8V4zM19 5v14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rewind:{viewBox:"0 0 24 24",path:"M11 19l-7-7 7-7m8 14l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"fast-forward":{viewBox:"0 0 24 24",path:"M13 5l7 7-7 7M5 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volume:{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-up":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072m2.828-9.9a9 9 0 010 12.728M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-down":{viewBox:"0 0 24 24",path:"M15.536 8.464a5 5 0 010 7.072M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-mute":{viewBox:"0 0 24 24",path:"M5.586 15H4a1 1 0 01-1-1v-4a1 1 0 011-1h1.586l4.707-4.707C10.923 3.663 12 4.109 12 5v14c0 .891-1.077 1.337-1.707.707L5.586 15z M17 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"volume-off":{viewBox:"0 0 24 24",path:"M12 6l-4 4H4v4h4l4 4V6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M3 9a2 2 0 012-2h.93a2 2 0 001.664-.89l.812-1.22A2 2 0 0110.07 4h3.86a2 2 0 011.664.89l.812 1.22A2 2 0 0018.07 7H19a2 2 0 012 2v9a2 2 0 01-2 2H5a2 2 0 01-2-2V9z M15 13a3 3 0 11-6 0 3 3 0 016 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"camera-off":{viewBox:"0 0 24 24",path:"M1 1l22 22M21 21H3a2 2 0 01-2-2V8a2 2 0 012-2h3m3-3h6l2 3h4a2 2 0 012 2v9.34m-7.72-2.06a4 4 0 11-5.56-5.56",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},video:{viewBox:"0 0 24 24",path:"M15 10l4.553-2.276A1 1 0 0121 8.618v6.764a1 1 0 01-1.447.894L15 14M5 18h8a2 2 0 002-2V8a2 2 0 00-2-2H5a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"video-off":{viewBox:"0 0 24 24",path:"M16 16v1a2 2 0 01-2 2H5a2 2 0 01-2-2V8a2 2 0 012-2h2m5.66 0H14a2 2 0 012 2v3.34l1 1L23 7v10M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},image:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},images:{viewBox:"0 0 24 24",path:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z M9 3h12a2 2 0 012 2v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},music:{viewBox:"0 0 24 24",path:"M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mic:{viewBox:"0 0 24 24",path:"M19 10v2a7 7 0 01-14 0v-2m7 9v4m-4 0h8m-4-13a3 3 0 00-3 3v4a3 3 0 006 0v-4a3 3 0 00-3-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"mic-off":{viewBox:"0 0 24 24",path:"M1 1l22 22m-2-2a10 10 0 01-11 2.955M12 19v4m-4 0h8M9 9v3a3 3 0 005.12 2.12M15 9.34V4a3 3 0 00-5.94-.6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0118 0v6M21 19a2 2 0 01-2 2h-1a2 2 0 01-2-2v-3a2 2 0 012-2h3zM3 19a2 2 0 002 2h1a2 2 0 002-2v-3a2 2 0 00-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},radio:{viewBox:"0 0 24 24",path:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0 M16.24 7.76a6 6 0 010 8.49m-8.48-.01a6 6 0 010-8.49m11.31-2.82a10 10 0 010 14.14m-14.14 0a10 10 0 010-14.14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},film:{viewBox:"0 0 24 24",path:"M7 4v16M17 4v16M3 8h4m10 0h4M3 12h18M3 16h4m10 0h4M4 20h16a1 1 0 001-1V5a1 1 0 00-1-1H4a1 1 0 00-1 1v14a1 1 0 001 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM17 3l-5 4-5-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cast:{viewBox:"0 0 24 24",path:"M2 16.1A5 5 0 015.9 20M2 12.05A9 9 0 019.95 20M2 8V6a2 2 0 012-2h16a2 2 0 012 2v12a2 2 0 01-2 2h-6M2 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximise:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimise:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},maximize:{viewBox:"0 0 24 24",path:"M8 3H5a2 2 0 00-2 2v3m18 0V5a2 2 0 00-2-2h-3m0 18h3a2 2 0 002-2v-3M3 16v3a2 2 0 002 2h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},minimize:{viewBox:"0 0 24 24",path:"M8 3v3a2 2 0 01-2 2H3m18 0h-3a2 2 0 01-2-2V3m0 18v-3a2 2 0 012-2h3M3 16h3a2 2 0 012 2v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximise-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimise-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"maximize-2":{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"minimize-2":{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scissors:{viewBox:"0 0 24 24",path:"M6 9a3 3 0 100-6 3 3 0 000 6zM6 21a3 3 0 100-6 3 3 0 000 6zM20 4L8.12 15.88M14.47 14.48L20 20M8.12 8.12L12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"play-circle":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z M10 8l6 4-6 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Vr={document:{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-text":{viewBox:"0 0 24 24",path:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z M14 2v6h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6m5 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-remove":{viewBox:"0 0 24 24",path:"M9 13h6m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"document-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m2 11H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},folder:{viewBox:"0 0 24 24",path:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-open":{viewBox:"0 0 24 24",path:"M5 19a2 2 0 01-2-2V7a2 2 0 012-2h4l2 2h6a2 2 0 012 2v1M5 19h14a2 2 0 002-2v-5a2 2 0 00-2-2H9a2 2 0 00-2 2v5a2 2 0 01-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-add":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-remove":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},download:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},upload:{viewBox:"0 0 24 24",path:"M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l-4-4m0 0L8 8m4-4v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-download":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M9 19l3 3m0 0l3-3m-3 3V10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-upload":{viewBox:"0 0 24 24",path:"M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M8 19c-3.314 0-6-2.462-6-5.5S4.686 8 8 8c.642-2.87 3.251-5 6.375-5C18.086 3 21 5.91 21 9.5a6.458 6.458 0 01-.705 2.945A4.5 4.5 0 0119 21H8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},attachment:{viewBox:"0 0 24 24",path:"M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},copy:{viewBox:"0 0 24 24",path:"M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},clipboard:{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-check":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clipboard-list":{viewBox:"0 0 24 24",path:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-3 7h3m-3 4h3m-6-4h.01M9 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},save:{viewBox:"0 0 24 24",path:"M8 7H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-3m-1 4l-3 3m0 0l-3-3m3 3V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},archive:{viewBox:"0 0 24 24",path:"M5 8h14M5 8a2 2 0 110-4h14a2 2 0 110 4M5 8v10a2 2 0 002 2h10a2 2 0 002-2V8m-9 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-code":{viewBox:"0 0 24 24",path:"M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-zip":{viewBox:"0 0 24 24",path:"M17 21H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2zM10 3v4h1V3h-1zm1 4h-1v2h1V7zm-1 2v2h1V9h-1zm1 2h-1v2h1v-2zm-1 2v2h1v-2h-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M4 7v10c0 2.21 3.582 4 8 4s8-1.79 8-4V7M4 7c0 2.21 3.582 4 8 4s8-1.79 8-4M4 7c0-2.21 3.582-4 8-4s8 1.79 8 4m0 5c0 2.21-3.582 4-8 4s-8-1.79-8-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},server:{viewBox:"0 0 24 24",path:"M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 002 2h16a2 2 0 002-2v-6l-3.45-6.89A2 2 0 0016.76 4H7.24a2 2 0 00-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"file-text":{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8l-6-6zM14 2v6h6M16 13H8M16 17H8M10 9H8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},book:{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-open":{viewBox:"0 0 24 24",path:"M2 3h6a4 4 0 014 4v14a3 3 0 00-3-3H2V3zM22 3h-6a4 4 0 00-4 4v14a3 3 0 013-3h7V3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"book-closed":{viewBox:"0 0 24 24",path:"M4 19.5A2.5 2.5 0 016.5 17H20M4 19.5A2.5 2.5 0 006.5 22H20v-5M6 3h14v16H6a2 2 0 01-2-2V5a2 2 0 012-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-plus":{viewBox:"0 0 24 24",path:"M9 13h6m-3-3v6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"folder-minus":{viewBox:"0 0 24 24",path:"M9 13h6M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Fr={share:{viewBox:"0 0 24 24",path:"M8.684 13.342C8.886 12.938 9 12.482 9 12c0-.482-.114-.938-.316-1.342m0 2.684a3 3 0 110-2.684m0 2.684l6.632 3.316m-6.632-6l6.632-3.316m0 0a3 3 0 105.367-2.684 3 3 0 00-5.367 2.684zm0 9.316a3 3 0 105.368 2.684 3 3 0 00-5.368-2.684z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"share-alt":{viewBox:"0 0 24 24",path:"M4 12v8a2 2 0 002 2h12a2 2 0 002-2v-8M16 6l-4-4-4 4M12 2v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heart:{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-filled":{viewBox:"0 0 24 24",path:"M4.318 6.318a4.5 4.5 0 000 6.364L12 20.364l7.682-7.682a4.5 4.5 0 00-6.364-6.364L12 7.636l-1.318-1.318a4.5 4.5 0 00-6.364 0z",fill:"currentColor"},bookmark:{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bookmark-filled":{viewBox:"0 0 24 24",path:"M5 5a2 2 0 012-2h10a2 2 0 012 2v16l-7-3.5L5 21V5z",fill:"currentColor"},"thumb-up":{viewBox:"0 0 24 24",path:"M14 10h4.764a2 2 0 011.789 2.894l-3.5 7A2 2 0 0115.263 21h-4.017c-.163 0-.326-.02-.485-.06L7 20m7-10V5a2 2 0 00-2-2h-.095c-.5 0-.905.405-.905.905 0 .714-.211 1.412-.608 2.006L7 11v9m7-10h-2M7 20H5a2 2 0 01-2-2v-6a2 2 0 012-2h2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thumb-down":{viewBox:"0 0 24 24",path:"M10 14H5.236a2 2 0 01-1.789-2.894l3.5-7A2 2 0 018.736 3h4.018a2 2 0 01.485.06l3.76.94m-7 10v5a2 2 0 002 2h.096c.5 0 .905-.405.905-.904 0-.715.211-1.413.608-2.008L17 13V4m-7 10h2m5-10h2a2 2 0 012 2v6a2 2 0 01-2 2h-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},comment:{viewBox:"0 0 24 24",path:"M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-add":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-plus":{viewBox:"0 0 24 24",path:"M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-remove":{viewBox:"0 0 24 24",path:"M13 7a4 4 0 11-8 0 4 4 0 018 0zM9 14a6 6 0 00-6 6v1h12v-1a6 6 0 00-6-6zM21 12h-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"user-group":{viewBox:"0 0 24 24",path:"M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-happy":{viewBox:"0 0 24 24",path:"M14.828 14.828a4 4 0 01-5.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"emoji-sad":{viewBox:"0 0 24 24",path:"M9.172 16.172a4 4 0 015.656 0M9 10h.01M15 10h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},flag:{viewBox:"0 0 24 24",path:"M3 21v-4m0 0V5a2 2 0 012-2h6.5l1 1H21l-3 6 3 6h-8.5l-1-1H5a2 2 0 00-2 2zm9-13.5V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M12 15V17M8 21H16M8 3H16V9C16 11.2091 14.2091 13 12 13C9.79086 13 8 11.2091 8 9V3ZM16 5H18C19.1046 5 20 5.89543 20 7V8C20 9.10457 19.1046 10 18 10H16M8 5H6C4.89543 5 4 5.89543 4 7V8C4 9.10457 4.89543 10 6 10H8M12 17V21",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",path:"M12 8V21M12 8H8.464C7.103 8 6 6.897 6 5.536C6 4.175 7.103 3 8.464 3C10.059 3 11.162 4.162 12 5.536M12 8H15.536C16.897 8 18 6.897 18 5.536C18 4.175 16.897 3 15.536 3C13.941 3 12.838 4.162 12 5.536M20 12V21H4V12M3 8H21V12H3V8Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sparkles:{viewBox:"0 0 24 24",path:"M5 3v4M3 5h4M6 17v4m-2-2h4m5-16l2.286 6.857L21 12l-5.714 2.143L13 21l-2.286-6.857L5 12l5.714-2.143L13 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fire:{viewBox:"0 0 24 24",path:"M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z M9.879 16.121A3 3 0 1012.015 11L11 14H9c0 .768.293 1.536.879 2.121z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},github:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0022 12.017C22 6.484 17.522 2 12 2z",fill:"currentColor"},twitter:{viewBox:"0 0 24 24",path:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z",fill:"currentColor"},linkedin:{viewBox:"0 0 24 24",path:"M20.447 20.452h-3.554v-5.569c0-1.328-.027-3.037-1.852-3.037-1.853 0-2.136 1.445-2.136 2.939v5.667H9.351V9h3.414v1.561h.046c.477-.9 1.637-1.85 3.37-1.85 3.601 0 4.267 2.37 4.267 5.455v6.286zM5.337 7.433a2.062 2.062 0 01-2.063-2.065 2.064 2.064 0 112.063 2.065zm1.782 13.019H3.555V9h3.564v11.452zM22.225 0H1.771C.792 0 0 .774 0 1.729v20.542C0 23.227.792 24 1.771 24h20.451C23.2 24 24 23.227 24 22.271V1.729C24 .774 23.2 0 22.222 0h.003z",fill:"currentColor"},youtube:{viewBox:"0 0 24 24",path:"M23.498 6.186a3.016 3.016 0 00-2.122-2.136C19.505 3.545 12 3.545 12 3.545s-7.505 0-9.377.505A3.017 3.017 0 00.502 6.186C0 8.07 0 12 0 12s0 3.93.502 5.814a3.016 3.016 0 002.122 2.136c1.871.505 9.376.505 9.376.505s7.505 0 9.377-.505a3.015 3.015 0 002.122-2.136C24 15.93 24 12 24 12s0-3.93-.502-5.814zM9.545 15.568V8.432L15.818 12l-6.273 3.568z",fill:"currentColor"},"share-2":{viewBox:"0 0 24 24",path:"M18 8a3 3 0 100-6 3 3 0 000 6zM6 15a3 3 0 100-6 3 3 0 000 6zM18 22a3 3 0 100-6 3 3 0 000 6zM8.59 13.51l6.83 3.98M15.41 6.51l-6.82 3.98",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},facebook:{viewBox:"0 0 24 24",path:"M18 2h-3a5 5 0 00-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 011-1h3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},instagram:{viewBox:"0 0 24 24",path:"M2 7a5 5 0 015-5h10a5 5 0 015 5v10a5 5 0 01-5 5H7a5 5 0 01-5-5zM16 11.37A4 4 0 1112.63 8 4 4 0 0116 11.37zM17.5 6.5h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Rr={cart:{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cart-add":{viewBox:"0 0 24 24",path:"M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0zm6-8v-2m0 0V7m0 2h2m-2 0H11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-bag":{viewBox:"0 0 24 24",path:"M16 11V7a4 4 0 00-8 0v4M5 9h14l1 12H4L5 9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M3 3h18v4H3V3zM3 7v12a2 2 0 002 2h14a2 2 0 002-2V7M3 11h18M12 7v14M8 11v10M16 11v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-2m-5-3h9m0 0l-3-3m3 3l-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cash:{viewBox:"0 0 24 24",path:"M17 9V7a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2m2 4h10a2 2 0 002-2v-6a2 2 0 00-2-2H9a2 2 0 00-2 2v6a2 2 0 002 2zm7-5a2 2 0 11-4 0 2 2 0 014 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-dollar":{viewBox:"0 0 24 24",path:"M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-pound":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h6a3 3 0 003-3M9 12h6M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"currency-euro":{viewBox:"0 0 24 24",path:"M15 9a3 3 0 00-3-3H9a3 3 0 00-3 3v6a3 3 0 003 3h3a3 3 0 003-3M7 10h5m-5 4h5M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tag:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tags:{viewBox:"0 0 24 24",path:"M7 7h.01M7 3h5c.512 0 1.024.195 1.414.586l7 7a2 2 0 010 2.828l-7 7a2 2 0 01-2.828 0l-7-7A1.994 1.994 0 013 12V7a4 4 0 014-4z M17 17l4.414-4.414a2 2 0 000-2.828L14 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M9 14l6 0M9 10l6 0M9 18l3 0M5 21l1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2 1-2 1 2V3l-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2-1 2-1-2v18z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barcode:{viewBox:"0 0 24 24",path:"M5 7v10M8 7v10M11 7v10M14 7v10M19 7v10M17 7v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round"},qrcode:{viewBox:"0 0 24 24",path:"M3 3h6v6H3V3zM15 3h6v6h-6V3zM3 15h6v6H3v-6zM15 15h2v2h-2v-2zM19 15h2v2h-2v-2zM15 19h2v2h-2v-2zM19 19h2v2h-2v-2zM5 5h2v2H5V5zM17 5h2v2h-2V5zM5 17h2v2H5v-2zM12 3h1v4h-1V3zM12 9h1v3h-1V9zM3 12h4v1H3v-1zM9 12h3v1H9v-1zM12 14h1v3h-1v-3zM12 19h1v2h-1v-2z",fill:"currentColor"},percent:{viewBox:"0 0 24 24",path:"M9 9a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM15 18a1.5 1.5 0 100-3 1.5 1.5 0 000 3zM19 5L5 19",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},package:{viewBox:"0 0 24 24",path:"M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4M9 4l3 1.5L15 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M13 16V6a1 1 0 00-1-1H4a1 1 0 00-1 1v10a1 1 0 001 1h1m8-1a1 1 0 01-1 1H9m4-1V8a1 1 0 011-1h2.586a1 1 0 01.707.293l3.414 3.414a1 1 0 01.293.707V16a1 1 0 01-1 1h-1m-6-1a1 1 0 001 1h1M5 17a2 2 0 104 0m-4 0a2 2 0 114 0m6 0a2 2 0 104 0m-4 0a2 2 0 114 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},box:{viewBox:"0 0 24 24",path:"M12 3L2 8.5V15.5L12 21L22 15.5V8.5L12 3ZM12 12V21M12 12L2 7M12 12L22 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shipping:{viewBox:"0 0 24 24",path:"M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2M4 7V4h16v3M4 7h16M8 4v3M16 4v3M12 11v4m-2-2h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M4 4a2 2 0 012-2h12a2 2 0 012 2v16a2 2 0 01-2 2H6a2 2 0 01-2-2V4zM8 6h8v4H8V6zM8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 00-2 2v10a2 2 0 002 2h16a2 2 0 002-2V9a2 2 0 00-2-2zM16 21V5a2 2 0 00-2-2h-4a2 2 0 00-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gem:{viewBox:"0 0 24 24",path:"M6 3h12l4 6-10 12L2 9l4-6z M11 3L8 9l4 12 4-12-3-6 M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shopping-cart":{viewBox:"0 0 24 24",path:"M9 22a1 1 0 100-2 1 1 0 000 2z M20 22a1 1 0 100-2 1 1 0 000 2z M1 1h4l2.68 13.39a2 2 0 002 1.61h9.72a2 2 0 002-1.61L23 6H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},qr={check:{viewBox:"0 0 24 24",path:"M5 13l4 4L19 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"check-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",fill:"currentColor"},"check-square":{viewBox:"0 0 24 24",path:"M9 11l3 3L22 4M21 12v7a2 2 0 01-2 2H5a2 2 0 01-2-2V5a2 2 0 012-2h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},x:{viewBox:"0 0 24 24",path:"M6 18L18 6M6 6l12 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"x-circle-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z",fill:"currentColor"},warning:{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"warning-filled":{viewBox:"0 0 24 24",path:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z",fill:"currentColor"},"alert-warning":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},info:{viewBox:"0 0 24 24",path:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"info-filled":{viewBox:"0 0 24 24",path:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z",fill:"currentColor"},question:{viewBox:"0 0 24 24",path:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},exclamation:{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-circle":{viewBox:"0 0 24 24",path:"M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ban:{viewBox:"0 0 24 24",path:"M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shield:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-check":{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-x":{viewBox:"0 0 24 24",path:"M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m5.618-6.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},spinner:{viewBox:"0 0 24 24",path:"M12 2v4m0 12v4m10-10h-4M6 12H2m15.364-5.364l-2.828 2.828M9.464 14.536l-2.828 2.828m11.728 0l-2.828-2.828M9.464 9.464L6.636 6.636",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},loading:{viewBox:"0 0 24 24",path:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"},loader:{viewBox:"0 0 24 24",path:"M12 2v4M12 18v4M4.93 4.93l2.83 2.83M16.24 16.24l2.83 2.83M2 12h4M18 12h4M4.93 19.07l2.83-2.83M16.24 7.76l2.83-2.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},circle:{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"circle-filled":{viewBox:"0 0 24 24",path:"M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z",fill:"currentColor"},dot:{viewBox:"0 0 24 24",path:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",fill:"currentColor"},badge:{viewBox:"0 0 24 24",path:"M9 12l2 2 4-4M7.835 4.697a3.42 3.42 0 001.946-.806 3.42 3.42 0 014.438 0 3.42 3.42 0 001.946.806 3.42 3.42 0 013.138 3.138 3.42 3.42 0 00.806 1.946 3.42 3.42 0 010 4.438 3.42 3.42 0 00-.806 1.946 3.42 3.42 0 01-3.138 3.138 3.42 3.42 0 00-1.946.806 3.42 3.42 0 01-4.438 0 3.42 3.42 0 00-1.946-.806 3.42 3.42 0 01-3.138-3.138 3.42 3.42 0 00-.806-1.946 3.42 3.42 0 010-4.438 3.42 3.42 0 00.806-1.946 3.42 3.42 0 013.138-3.138z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zap:{viewBox:"0 0 24 24",path:"M13 10V3L4 14h7v7l9-11h-7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18M17 6h6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6M17 18h6v-6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},key:{viewBox:"0 0 24 24",path:"M21 2l-2 2m-7.61 7.61a5.5 5.5 0 11-7.778 7.778 5.5 5.5 0 017.777-7.777zm0 0L15.5 7.5m0 0l3 3L22 7l-3-3m-3.5 3.5L19 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"shield-alert":{viewBox:"0 0 24 24",path:"M12 9v2m0 4h.01M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"alert-triangle":{viewBox:"0 0 24 24",path:"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z M12 9v4 M12 17h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Ur={"chevron-up":{viewBox:"0 0 24 24",path:"M5 15l7-7 7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-down":{viewBox:"0 0 24 24",path:"M19 9l-7 7-7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-left":{viewBox:"0 0 24 24",path:"M15 19l-7-7 7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevron-right":{viewBox:"0 0 24 24",path:"M9 5l7 7-7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-up":{viewBox:"0 0 24 24",path:"M17 11l-5-5-5 5M17 18l-5-5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-down":{viewBox:"0 0 24 24",path:"M7 13l5 5 5-5M7 6l5 5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-left":{viewBox:"0 0 24 24",path:"M11 17l-5-5 5-5M18 17l-5-5 5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chevrons-right":{viewBox:"0 0 24 24",path:"M13 7l5 5-5 5M6 7l5 5-5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"external-link":{viewBox:"0 0 24 24",path:"M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},link:{viewBox:"0 0 24 24",path:"M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},unlink:{viewBox:"0 0 24 24",path:"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 00-.12-7.07 5.006 5.006 0 00-6.95 0l-1.72 1.71M5.17 11.75l-1.71 1.71a5.004 5.004 0 00.12 7.07 5.006 5.006 0 006.95 0l1.71-1.71M8 2v3M2 8h3M16 22v-3M22 16h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-left":{viewBox:"0 0 24 24",path:"M9 14L4 9l5-5M20 20v-7a4 4 0 00-4-4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-up-right":{viewBox:"0 0 24 24",path:"M15 14l5-5-5-5M4 20v-7a4 4 0 014-4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-left":{viewBox:"0 0 24 24",path:"M9 10L4 15l5 5M20 4v7a4 4 0 01-4 4H4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-down-right":{viewBox:"0 0 24 24",path:"M15 10l5 5-5 5M4 4v7a4 4 0 004 4h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-cw":{viewBox:"0 0 24 24",path:"M23 4v6h-6M1 20v-6h6M3.51 9a9 9 0 0114.85-3.36L23 10M1 14l4.64 4.36A9 9 0 0020.49 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"rotate-ccw":{viewBox:"0 0 24 24",path:"M1 4v6h6M23 20v-6h-6M20.49 9A9 9 0 005.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 013.51 15",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M3 13l4.64-4.36A9 9 0 0121 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M21 13l-4.64-4.36A9 9 0 003 12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},move:{viewBox:"0 0 24 24",path:"M5 9l-3 3 3 3M9 5l3-3 3 3M15 19l-3 3-3-3M19 9l3 3-3 3M2 12h20M12 2v20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"grip-vertical":{viewBox:"0 0 24 24",paths:["M9 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 5m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 12m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M9 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M15 19m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},"grip-horizontal":{viewBox:"0 0 24 24",paths:["M5 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M5 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M12 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 9m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0","M19 15m-1.5 0a1.5 1.5 0 1 0 3 0a1.5 1.5 0 1 0 -3 0"],fill:"currentColor"},expand:{viewBox:"0 0 24 24",path:"M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shrink:{viewBox:"0 0 24 24",path:"M4 14h6v6M20 10h-6V4M14 10l7-7M3 21l7-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-in":{viewBox:"0 0 24 24",path:"M15 3h4a2 2 0 012 2v14a2 2 0 01-2 2h-4M10 17l5-5-5-5M15 12H3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"log-out":{viewBox:"0 0 24 24",path:"M9 21H5a2 2 0 01-2-2V5a2 2 0 012-2h4M16 17l5-5-5-5M21 12H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-left":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM9 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"sidebar-right":{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM15 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-left":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM9 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-right":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM15 3v18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-top":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 9h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"panel-bottom":{viewBox:"0 0 24 24",path:"M3 3h18v18H3V3zM3 15h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layers:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},layout:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2zM2 9h20M9 20V9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hash:{viewBox:"0 0 24 24",path:"M4 9h16M4 15h16M10 3L8 21M16 3l-2 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"more-horizontal":{viewBox:"0 0 24 24",path:"M12 12h.01M8 12h.01M16 12h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"},"more-vertical":{viewBox:"0 0 24 24",path:"M12 12h.01M12 8h.01M12 16h.01",stroke:"currentColor",fill:"none",strokeWidth:3,strokeLinecap:"round",strokeLinejoin:"round"}},Kr={tree:{viewBox:"0 0 24 24",path:"M12 2l2 4h-1l2 4h-1.5l2.5 5h-2l3 6H7l3-6H8l2.5-5H9l2-4h-1l2-4zm-1 19h2v3h-2v-3z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"star-decoration":{viewBox:"0 0 24 24",path:"M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z",stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",paths:["M12 2v20M2 12h20","M4.93 4.93l14.14 14.14M19.07 4.93L4.93 19.07","M12 6l-2 2 2 2 2-2-2-2zM12 14l-2 2 2 2 2-2-2-2z","M6 12l2-2-2-2-2 2 2 2zM14 12l2 2 2-2-2-2-2 2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},gift:{viewBox:"0 0 24 24",paths:["M20 12v10H4V12","M22 7H2v5h20V7z","M12 22V7","M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z","M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"candy-cane":{viewBox:"0 0 24 24",path:"M14.5 3a4.5 4.5 0 0 0-4.5 4.5v13a.5.5 0 0 0 1 0V7.5a3.5 3.5 0 1 1 7 0v1a2.5 2.5 0 0 1-5 0v-.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bauble:{viewBox:"0 0 24 24",paths:["M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16z","M12 6V3","M9 3h6","M12 6a1 1 0 0 0 1-1V4a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},bells:{viewBox:"0 0 24 24",paths:["M9 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M15 18a5 5 0 0 1-5-5c0-2.76 2.24-5 5-5s5 2.24 5 5a5 5 0 0 1-5 5z","M7 8L5 4M17 8l2-4M9 8V5M15 8V5","M11 5h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},holly:{viewBox:"0 0 24 24",paths:["M8 4c-2 2-3 5-1 8 1 2 3 3 5 3s4-1 5-3c2-3 1-6-1-8","M16 4c2 2 3 5 1 8-1 2-3 3-5 3s-4-1-5-3c-2-3-1-6 1-8","M10 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M14 17a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z","M12 19a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},snowman:{viewBox:"0 0 24 24",paths:["M12 22a5 5 0 1 0 0-10 5 5 0 0 0 0 10z","M12 12a3 3 0 1 0 0-6 3 3 0 0 0 0 6z","M9 9h.01M15 9h.01","M10 10.5s.5 1 2 1 2-1 2-1","M7 2l3 3M17 2l-3 3M12 2v3","M5 15h2M17 15h2"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},reindeer:{viewBox:"0 0 24 24",paths:["M12 22c-3 0-5-2-5-5 0-2 1-4 3-5l2-1 2 1c2 1 3 3 3 5 0 3-2 5-5 5z","M7 12c-2-1-3-3-3-5 0-1 .5-2 1-2s1 .5 1.5 1c.5.5 1 1.5 1.5 2","M17 12c2-1 3-3 3-5 0-1-.5-2-1-2s-1 .5-1.5 1c-.5.5-1 1.5-1.5 2","M4 5l1 2M3 7l2 1M20 5l-1 2M21 7l-2 1","M10 17h.01M14 17h.01","M12 19a1 1 0 1 0 0 2 1 1 0 0 0 0-2z"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},sleigh:{viewBox:"0 0 24 24",paths:["M4 15h14c1 0 2 1 2 2v1H4v-3z","M6 15V8c0-1 1-2 2-2h8c1 0 2 1 2 2v7","M2 20c0-1 2-2 4-2h12c2 0 4 1 4 2","M3 18h1M20 18h1"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},wreath:{viewBox:"0 0 24 24",paths:["M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10z","M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12z","M12 2v2M12 20v2M2 12h2M20 12h2","M10 3l1 2M13 3l-1 2","M10 3h4"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"},"party-popper":{viewBox:"0 0 24 24",paths:["M5.8 11.3 2 22l10.7-3.79","M4 3h.01","M22 8h.01","M15 2h.01","M22 20h.01","M22 2 19.79 7.3 16 8l3.79.79L22 14","M9.6 14.4 14 10","M22 13c-1.93 1.93-5.07 1.93-7 0","M11 8c1.93-1.93 1.93-5.07 0-7","M2 13c1.93 1.93 5.07 1.93 7 0"],stroke:"currentColor",fill:"none",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}},Yr={sun:{viewBox:"0 0 24 24",path:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41M12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunrise:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 2v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M8 6l4-4 4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sunset:{viewBox:"0 0 24 24",path:"M17 18a5 5 0 1 0-10 0M12 9v7M4.22 10.22l1.42 1.42M1 18h2M21 18h2M18.36 11.64l1.42-1.42M23 22H1M16 5l-4 4-4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cloud:{viewBox:"0 0 24 24",path:"M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-sun":{viewBox:"0 0 24 24",path:"M12 2v2M4.93 4.93l1.41 1.41M2 12h2M19 12a4 4 0 0 0-4-4h-.35A5.5 5.5 0 0 0 4 11a5 5 0 0 0 0 10h11a4 4 0 0 0 4-5v-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-off":{viewBox:"0 0 24 24",path:"M22.61 16.95A5 5 0 0 0 18 10h-1.26a8 8 0 0 0-7.05-6M5 5a8 8 0 0 0 4 15h9a5 5 0 0 0 1.7-.3M1 1l22 22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rain:{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-rain":{viewBox:"0 0 24 24",path:"M16 13v8M8 13v8M12 15v8M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-drizzle":{viewBox:"0 0 24 24",path:"M8 19v2M8 13v2M16 19v2M16 13v2M12 21v2M12 15v2M20 16.58A5 5 0 0 0 18 7h-1.26A8 8 0 1 0 4 15.25",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snow:{viewBox:"0 0 24 24",path:"M20 17.58A5 5 0 0 0 18 8h-1.26A8 8 0 1 0 4 16.25M8 16h.01M8 20h.01M12 18h.01M12 22h.01M16 16h.01M16 20h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},snowflake:{viewBox:"0 0 24 24",path:"M12 2v20M17.66 7l-11.32 10M20.54 12H3.46M17.66 17L6.34 7M12 2l3 3M12 2l-3 3M12 22l3-3M12 22l-3-3M2 12l3 3M2 12l3-3M22 12l-3 3M22 12l-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wind:{viewBox:"0 0 24 24",path:"M9.59 4.59A2 2 0 1 1 11 8H2m10.59 11.41A2 2 0 1 0 14 16H2m15.73-8.27A2.5 2.5 0 1 1 19.5 12H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"cloud-lightning":{viewBox:"0 0 24 24",path:"M19 16.9A5 5 0 0 0 18 7h-1.26a8 8 0 1 0-11.62 9M13 11l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lightning:{viewBox:"0 0 24 24",path:"M13 2L3 14h9l-1 8 10-12h-9l1-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fog:{viewBox:"0 0 24 24",path:"M20 15h2M2 15h8M6 19h14M4 11h16M8 7h12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},haze:{viewBox:"0 0 24 24",path:"M12 3v1M12 20v1M3 12h1M20 12h1M5.6 5.6l.7.7M17.7 17.7l.7.7M5.6 18.4l.7-.7M17.7 6.3l.7-.7M8 12a4 4 0 1 0 8 0 4 4 0 0 0-8 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thermometer:{viewBox:"0 0 24 24",path:"M14 14.76V3.5a2.5 2.5 0 0 0-5 0v11.26a4.5 4.5 0 1 0 5 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-sun":{viewBox:"0 0 24 24",path:"M12 9a4 4 0 0 0-2 7.5M12 3v2M5.6 5.6l1.4 1.4M3 12h2M5.6 18.4l1.4-1.4M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 10V3M16 14.76V8a2 2 0 0 0-4 0v6.76",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},moon:{viewBox:"0 0 24 24",path:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"moon-star":{viewBox:"0 0 24 24",path:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9zM19 3v4M17 5h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},umbrella:{viewBox:"0 0 24 24",path:"M23 12a11.05 11.05 0 0 0-22 0zm-5 7a3 3 0 0 1-6 0v-7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplet:{viewBox:"0 0 24 24",path:"M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},droplets:{viewBox:"0 0 24 24",path:"M7 16.3c2.2 0 4-1.83 4-4.05 0-1.16-.57-2.26-1.71-3.19S7.29 6.75 7 5.3c-.29 1.45-1.14 2.84-2.29 3.76S3 11.1 3 12.25c0 2.22 1.8 4.05 4 4.05zM12.56 14.94c1.47 0 2.67-1.25 2.67-2.77 0-.8-.38-1.55-1.14-2.18-.76-.64-1.17-1.32-1.38-2.29-.21.97-.62 1.65-1.38 2.29-.76.63-1.14 1.38-1.14 2.18 0 1.52 1.19 2.77 2.67 2.77zM19.5 17.35c1.1 0 2-.93 2-2.08 0-.6-.29-1.17-.86-1.64-.57-.48-.88-1-.57-1.73-.31.73-.62 1.25-1.19 1.73-.57.47-.86 1.04-.86 1.64 0 1.15.9 2.08 2 2.08z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rainbow:{viewBox:"0 0 24 24",path:"M22 17a10 10 0 0 0-20 0M18 17a6 6 0 0 0-12 0M14 17a2 2 0 0 0-4 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Gr={smartphone:{viewBox:"0 0 24 24",path:"M17 2H7a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-call":{viewBox:"0 0 24 24",path:"M15.05 5A5 5 0 0 1 19 8.95M15.05 1A9 9 0 0 1 23 8.94m-1 7.98v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"phone-off":{viewBox:"0 0 24 24",path:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91M23 1L1 23",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tablet:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tablet-smartphone":{viewBox:"0 0 24 24",path:"M18 2H10a2 2 0 0 0-2 2v4M14 22h4a2 2 0 0 0 2-2V8M8 14H6a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM7 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laptop:{viewBox:"0 0 24 24",path:"M20 16V7a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v9m16 0H4m16 0l1.28 2.55a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45L4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monitor:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},desktop:{viewBox:"0 0 24 24",path:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4M2 12h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tv:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM17 2l-5 5-5-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"tv-minimal":{viewBox:"0 0 24 24",path:"M20 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},watch:{viewBox:"0 0 24 24",path:"M12 19a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM12 9v3l1.5 1.5M16.51 17.35l-.35 3.83a2 2 0 0 1-2 1.82H9.83a2 2 0 0 1-2-1.82l-.35-3.83m.01-10.7l.35-3.83A2 2 0 0 1 9.83 1h4.35a2 2 0 0 1 2 1.82l.35 3.83",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},smartwatch:{viewBox:"0 0 24 24",path:"M18 8a6 6 0 0 0-12 0v8a6 6 0 0 0 12 0V8zM12 11v3M18 6l1-3H5l1 3M18 18l1 3H5l1-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},speaker:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM12 6h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},headphones:{viewBox:"0 0 24 24",path:"M3 18v-6a9 9 0 0 1 18 0v6M21 19a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3zM3 19a2 2 0 0 0 2 2h1a2 2 0 0 0 2-2v-3a2 2 0 0 0-2-2H3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airpods:{viewBox:"0 0 24 24",path:"M5.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 5.5 4zM18.5 4a2.5 2.5 0 0 0-2.5 2.5v5a2.5 2.5 0 0 0 5 0v-5A2.5 2.5 0 0 0 18.5 4zM5.5 14v6M18.5 14v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},camera:{viewBox:"0 0 24 24",path:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2zM12 17a4 4 0 1 0 0-8 4 4 0 0 0 0 8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},webcam:{viewBox:"0 0 24 24",path:"M12 14a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM12 14v8M8 22h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},keyboard:{viewBox:"0 0 24 24",path:"M20 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2zM6 9h.01M10 9h.01M14 9h.01M18 9h.01M6 13h.01M18 13h.01M8 17h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mouse:{viewBox:"0 0 24 24",path:"M6 3h12a3 3 0 0 1 3 3v12a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3zM12 3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},gamepad:{viewBox:"0 0 24 24",path:"M6 12h4M8 10v4M15 13h.01M18 11h.01M17.32 5H6.68a4 4 0 0 0-3.978 3.59l-.891 9a4 4 0 0 0 6.9 3.31l1.29-1.29 1.29 1.29a4 4 0 0 0 6.9-3.31l-.891-9A4 4 0 0 0 17.32 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joystick:{viewBox:"0 0 24 24",path:"M21 17a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2zM6 15v-2M12 15V5m0 0l4 4m-4-4L8 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},database:{viewBox:"0 0 24 24",path:"M12 2C6.477 2 2 3.582 2 5.5v3C2 10.418 6.477 12 12 12s10-1.582 10-3.5v-3C22 3.582 17.523 2 12 2zM2 8.5v4C2 14.418 6.477 16 12 16s10-1.582 10-3.5v-4M2 12.5v4C2 18.418 6.477 20 12 20s10-1.582 10-3.5v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"hard-drive":{viewBox:"0 0 24 24",path:"M22 12H2M5.45 5.11L2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11zM6 16h.01M10 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},usb:{viewBox:"0 0 24 24",path:"M16 4h2a2 2 0 0 1 2 2v1M6 4h2a2 2 0 0 1 2 2v1M10 16v-5a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM20 16v-5a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h2a2 2 0 0 0 2-2zM12 12v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},router:{viewBox:"0 0 24 24",path:"M20 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2zM6 18h.01M12 7a5 5 0 0 0-5 5M19 7a5 5 0 0 0-5-5M12 7V2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},printer:{viewBox:"0 0 24 24",path:"M6 9V2h12v7M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 14h12v8H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cpu:{viewBox:"0 0 24 24",path:"M18 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM9 9h6v6H9zM9 1v3M15 1v3M9 20v3M15 20v3M20 9h3M20 14h3M1 9h3M1 14h3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},battery:{viewBox:"0 0 24 24",path:"M17 6H5a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM23 13v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"battery-charging":{viewBox:"0 0 24 24",path:"M5 18H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h3.19M15 6h2a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-3.19M23 13v-2M11 6l-4 6h6l-4 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},plug:{viewBox:"0 0 24 24",path:"M12 22v-5M9 8V2M15 8V2M18 8H6a2 2 0 0 0-2 2v1a8 8 0 0 0 16 0v-1a2 2 0 0 0-2-2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Xr={"chart-line":{viewBox:"0 0 24 24",path:"M3 3v18h18M18 9l-5 5-4-4-3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"bar-chart":{viewBox:"0 0 24 24",path:"M12 20V10M6 20v-4M18 20V4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-bar-horizontal":{viewBox:"0 0 24 24",path:"M4 12h10M4 6h4M4 18h14",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-pie":{viewBox:"0 0 24 24",path:"M21.21 15.89A10 10 0 1 1 8 2.83M22 12A10 10 0 0 0 12 2v10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-area":{viewBox:"0 0 24 24",path:"M3 3v18h18M7 12l5-5 4 4 5-5v12H7z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"chart-candlestick":{viewBox:"0 0 24 24",path:"M9 5v4M9 11v8M15 5v8M15 17v2M7 9h4v2H7zM13 13h4v4h-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-up":{viewBox:"0 0 24 24",path:"M23 6l-9.5 9.5-5-5L1 18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-down":{viewBox:"0 0 24 24",path:"M23 18l-9.5-9.5-5 5L1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"trending-neutral":{viewBox:"0 0 24 24",path:"M22 12H2M18 8l4 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wallet:{viewBox:"0 0 24 24",path:"M21 12V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-1M21 12H17a2 2 0 0 1 0-4h4M17 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"credit-card":{viewBox:"0 0 24 24",path:"M21 4H3a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h18a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2zM1 10h22",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},banknote:{viewBox:"0 0 24 24",path:"M2 8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8zM12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM6 10h.01M18 14h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},coins:{viewBox:"0 0 24 24",path:"M8 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM8 12c2.2 0 4 1.8 4 4s-1.8 4-4 4-4-1.8-4-4 1.8-4 4-4zM16 8a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM16 8c2.2 0 4 1.8 4 4s-1.8 4-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"dollar-sign":{viewBox:"0 0 24 24",path:"M12 1v22M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pound-sign":{viewBox:"0 0 24 24",path:"M18 5H9a4 4 0 0 0-4 4v3a4 4 0 0 0 4 4h3M5 12h10M18 19H7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"euro-sign":{viewBox:"0 0 24 24",path:"M4 10h12M4 14h12M17 5a8 8 0 0 0-14 5.5 8 8 0 0 0 14 5.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bitcoin:{viewBox:"0 0 24 24",path:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bank:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V10M8 21V10M12 21V10M16 21V10M20 21V10M12 3L2 8h20z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vault:{viewBox:"0 0 24 24",path:"M3 5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5zM12 12m-3 0a3 3 0 1 0 6 0 3 3 0 1 0-6 0M7 12h2M15 12h2M12 9V7M12 17v-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"piggy-bank":{viewBox:"0 0 24 24",path:"M19 5c-1.5 0-2.8 1.4-3 2-3.5-1.5-11-.3-11 5 0 1.8 0 3 2 4.5V20h4v-2h3v2h4v-4c1-.5 1.7-1 2-2h2v-4h-2c0-1-.5-1.5-1-2zM2 9v1c0 1.1.9 2 2 2h1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},safe:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2zM12 12m-2 0a2 2 0 1 0 4 0 2 2 0 1 0-4 0M16 8h.01M16 16h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},receipt:{viewBox:"0 0 24 24",path:"M4 2v20l3-2 3 2 3-2 3 2 3-2 3 2V2l-3 2-3-2-3 2-3-2-3 2-3-2zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},invoice:{viewBox:"0 0 24 24",path:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8zM14 2v6h6M8 13h8M8 17h8M8 9h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},briefcase:{viewBox:"0 0 24 24",path:"M20 7H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2zM16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},percent:{viewBox:"0 0 24 24",path:"M19 5L5 19M6.5 9a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5zM17.5 20a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},calculator:{viewBox:"0 0 24 24",path:"M18 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2zM8 6h8M8 10h.01M12 10h.01M16 10h.01M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},growth:{viewBox:"0 0 24 24",path:"M12 20V12M12 12l-4 4M12 12l4 4M8 20h8M3 8l4-4 4 4 5-5 5 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},investment:{viewBox:"0 0 24 24",path:"M12 2v20M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6M2 12h4M18 12h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scale:{viewBox:"0 0 24 24",path:"M12 3v18M3 6l3 10a6 6 0 0 0 6 0L15 6M9 6l6 0M21 6l-3 10a6 6 0 0 1-6 0",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Jr={"heart-pulse":{viewBox:"0 0 24 24",path:"M19.5 12.572l-7.5 7.428-7.5-7.428A5 5 0 1 1 12 5.006a5 5 0 1 1 7.5 7.566zM3 12h4l2-4 4 8 2-4h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},activity:{viewBox:"0 0 24 24",path:"M22 12h-4l-3 9L9 3l-3 9H2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pulse:{viewBox:"0 0 24 24",path:"M3 12h4l2-7 4 14 2-7h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pill:{viewBox:"0 0 24 24",path:"M10.5 20.5l9-9a4.95 4.95 0 0 0-7-7l-9 9a4.95 4.95 0 0 0 7 7zM8.5 8.5l7 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"pill-bottle":{viewBox:"0 0 24 24",path:"M6 3h12v5H6zM5 8h14a1 1 0 0 1 1 1v11a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V9a1 1 0 0 1 1-1zM10 14h4M12 12v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},capsule:{viewBox:"0 0 24 24",path:"M8 8a4 4 0 0 1 8 0v8a4 4 0 0 1-8 0V8zM8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},syringe:{viewBox:"0 0 24 24",path:"M18 2l4 4M15 5l6 6M8 6l10 10-4 4L4 10zM2 22l6-6M7 11l2 2M11 7l2 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},vaccine:{viewBox:"0 0 24 24",path:"M14 2l4 4M8 8l8 8M3 17l4 4M6.5 6.5L20 20M12 12l2.5-2.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stethoscope:{viewBox:"0 0 24 24",path:"M4.8 2.3A.3.3 0 1 0 5 2H4a2 2 0 0 0-2 2v5a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6V4a2 2 0 0 0-2-2h-1a.2.2 0 1 0 .3.3M8 15v1a6 6 0 0 0 6 6v0a6 6 0 0 0 6-6v-4M22 10a2 2 0 1 0-4 0 2 2 0 0 0 4 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"thermometer-medical":{viewBox:"0 0 24 24",path:"M14 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0zM12 14v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bandage:{viewBox:"0 0 24 24",path:"M18 2l4 4-14 14-4-4zM10.5 7.5l6 6M8.5 9.5l1 1M14.5 15.5l1 1M12.5 11.5l1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hospital:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-6h6v6M10 9h4M12 7v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ambulance:{viewBox:"0 0 24 24",path:"M10 10H6M8 8v4M15 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM7 21a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM21 15V8a2 2 0 0 0-2-2h-3l-2-3H6a2 2 0 0 0-2 2v10M21 9h-4a2 2 0 0 0-2 2v4h6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"first-aid":{viewBox:"0 0 24 24",path:"M20 6H4a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2zM9 12h6M12 9v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"medical-cross":{viewBox:"0 0 24 24",path:"M8 3h8v6h5v6h-5v6H8v-6H3V9h5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dna:{viewBox:"0 0 24 24",path:"M2 15c6.667-6 13.333 0 20-6M9 22c1.798-1.998 2.518-3.995 2.807-5.993M15 2c-1.798 1.998-2.518 3.995-2.807 5.993M2 9c6.667 6 13.333 0 20 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},microscope:{viewBox:"0 0 24 24",path:"M6 18h8M3 22h18M14 22a7 7 0 1 0 0-14M9 14h.01M9 6v8M6 6h6l-3-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"test-tube":{viewBox:"0 0 24 24",path:"M14.5 2v17.5c0 1.4-1.1 2.5-2.5 2.5s-2.5-1.1-2.5-2.5V2M7 2h10M8.5 14h7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},brain:{viewBox:"0 0 24 24",path:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18ZM12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18ZM12 5v13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lungs:{viewBox:"0 0 24 24",path:"M6.081 20C2.477 20 2 15.5 2 12.5S4 6 4 6s2-1 2-3M17.92 20c3.603 0 4.08-4.5 4.08-7.5S20 6 20 6s-2-1-2-3M12 3v17M12 12c-4 0-7-2-7-2M12 12c4 0 7-2 7-2M12 16c-4 0-7-2-7-2M12 16c4 0 7-2 7-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bone:{viewBox:"0 0 24 24",path:"M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tooth:{viewBox:"0 0 24 24",path:"M12 2C7 2 4 5 4 8c0 5 1 8 2 10 .5 1 1 4 2.5 4s1.5-2 3.5-2 2 2 3.5 2 2-3 2.5-4c1-2 2-5 2-10 0-3-3-6-8-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"eye-medical":{viewBox:"0 0 24 24",path:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8zM12 9v6M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wheelchair:{viewBox:"0 0 24 24",path:"M12 10a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM15 21a4 4 0 1 0-5-6M12 10v4h4l2 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crutch:{viewBox:"0 0 24 24",path:"M5 5l7 7M7 3l7 7M19 19l-7-7M21 17l-7-7M11 11l-6 6M13 13l-6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"scale-weight":{viewBox:"0 0 24 24",path:"M12 3a9 9 0 0 0-9 9 9 9 0 0 0 9 9 9 9 0 0 0 9-9 9 9 0 0 0-9-9zM12 7v5l3 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"blood-drop":{viewBox:"0 0 24 24",path:"M12 2c-4 4-7 7-7 11a7 7 0 0 0 14 0c0-4-3-7-7-11z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},heartbeat:{viewBox:"0 0 24 24",path:"M3 12h4l3-9 4 18 3-9h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Zr={football:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6l4 4-4 4-4-4zM6 12l4-4v8zM18 12l-4 4V8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},soccer:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 8l2.5 2-1 3h-3l-1-3zM12 2v3M22 12h-3M12 22v-3M2 12h3M4.93 4.93l2.12 2.12M19.07 4.93l-2.12 2.12M4.93 19.07l2.12-2.12M19.07 19.07l-2.12-2.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},basketball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM2.05 11h19.9M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tennis:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM3.5 8.5c4-1 8 0 12 4M3.5 15.5c4 1 8 0 12-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},baseball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 5c1.5 2 2.5 4 2.5 7s-1 5-2.5 7M19 5c-1.5 2-2.5 4-2.5 7s1 5 2.5 7",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},volleyball:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 2v10M12 12l8.66 5M12 12l-8.66 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},golf:{viewBox:"0 0 24 24",path:"M12 18v4M8 22h8M12 2v16M12 6l6-2-6 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bowling:{viewBox:"0 0 24 24",path:"M12 22a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 6V2M10 9h.01M14 9h.01M12 12h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rugby:{viewBox:"0 0 24 24",path:"M5 5c8-2 16 6 14 14C11 21 3 13 5 5zM9 9l6 6M11 9l-1 1M13 11l-1 1M15 13l-1 1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cricket:{viewBox:"0 0 24 24",path:"M14 2l8 8-9 9-3-3 9-9M13 3l-9 9M7 17a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hockey:{viewBox:"0 0 24 24",path:"M7 2v11c0 3 2 5 5 5h3a3 3 0 0 0 0-6M19 18.5a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"table-tennis":{viewBox:"0 0 24 24",path:"M14.5 3.5a7 7 0 0 0-9.9 9.9l-2.3 4.3a1 1 0 0 0 1.3 1.3l4.3-2.3a7 7 0 0 0 6.6-13.2zM17 15.5a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"world-cup":{viewBox:"0 0 24 24",path:"M12 2a5 5 0 1 0 0 10 5 5 0 0 0 0-10zM7 7h10M12 2v10M9 3.2c-1.4 2-1.4 5.6 0 7.6M15 3.2c1.4 2 1.4 5.6 0 7.6M10 12l-1 4h6l-1-4M8 16h8M11 16v4M13 16v4M8 20h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},jersey:{viewBox:"0 0 24 24",path:"M9 3L4 6l2.5 3.5L9 8M15 3l5 3-2.5 3.5L15 8M9 3a3 3 0 0 0 6 0M9 8v13h6V8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"football-boot":{viewBox:"0 0 24 24",path:"M3 7v5a3 3 0 0 0 3 3h11a4 4 0 0 0 1-7.9L9 7c-1-1-2.2-2-4-2H3zM5 18h2M9 18h2M13 18h2M17 18h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},goal:{viewBox:"0 0 24 24",path:"M2 5h20v11H2zM2 5l3 3v8M22 5l-3 3v8M5 8h14v8M2 11h20M9 8v8M15 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"corner-flag":{viewBox:"0 0 24 24",path:"M6 2v20M6 3h12l-3.5 4L18 11H6M3 22h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"referee-card":{viewBox:"0 0 24 24",path:"M8.5 2.5l9 3a2 2 0 0 1 1.3 2.5l-4.6 13a2 2 0 0 1-2.5 1.3l-9-3a2 2 0 0 1-1.3-2.5l4.6-13a2 2 0 0 1 2.5-1.3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 8c0-2.2 4.5-4 10-4s10 1.8 10 4-4.5 4-10 4-10-1.8-10-4zM2 8v6c0 2.2 4.5 4 10 4s10-1.8 10-4V8M8 12.5V18M16 12.5V18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},scoreboard:{viewBox:"0 0 24 24",path:"M3 4h18v12H3zM3 16l3 4M21 16l-3 4M12 6v8M6 8h3v6H6zM15 8h3v6h-3z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dumbbell:{viewBox:"0 0 24 24",path:"M6.5 6.5h11M17.5 4v5M6.5 4v5M17.5 15v5M6.5 15v5M4 6v3a1 1 0 0 0 1 1h1.5M4 18v-3a1 1 0 0 1 1-1h1.5M20 6v3a1 1 0 0 1-1 1h-1.5M20 18v-3a1 1 0 0 0-1-1h-1.5M6.5 17.5h11",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barbell:{viewBox:"0 0 24 24",path:"M4 12h16M6 8v8M10 6v12M14 6v12M18 8v8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},kettlebell:{viewBox:"0 0 24 24",path:"M12 6a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM17 22H7a5 5 0 0 1-1-9.9V10a6 6 0 0 1 12 0v2.1a5 5 0 0 1-1 9.9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},running:{viewBox:"0 0 24 24",path:"M13 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM5 22l3-9 3 3v6M10 6l5 3 4-1M4 13l5 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},swimming:{viewBox:"0 0 24 24",path:"M2 20c.9 0 1.6-.4 2.2-.9.8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 1.1 1 2.8 1 3.9 0 .8-.7 1.9-.7 2.7 0 .6.5 1.3.9 2.2.9M8 16l-2-4 4-2 6 4 4-3M15 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cycling:{viewBox:"0 0 24 24",path:"M5 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM19 18a4 4 0 1 0 0-8 4 4 0 0 0 0 8zM5 14l4-4 3 3 4-4M12 6a2 2 0 1 0 0-4 2 2 0 0 0 0 4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},yoga:{viewBox:"0 0 24 24",path:"M12 4a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM4 17l4-4-2-4 6-3 6 3-2 4 4 4M8 22l4-5 4 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},trophy:{viewBox:"0 0 24 24",path:"M6 9H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h2M18 9h2a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-2M6 3v6a6 6 0 0 0 12 0V3M12 15v4M8 22h8M8 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},medal:{viewBox:"0 0 24 24",path:"M12 15a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM8 3l4 6 4-6M8 3h8M12 9v6M9 19.5l3 1.5 3-1.5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},award:{viewBox:"0 0 24 24",path:"M12 15a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM8.21 13.89L7 23l5-3 5 3-1.21-9.12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},crown:{viewBox:"0 0 24 24",path:"M2 17l3-10 5 6 2-8 2 8 5-6 3 10H2zM4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},podium:{viewBox:"0 0 24 24",path:"M5 10h4v12H5zM10 6h4v16h-4zM15 14h4v8h-4zM12 2v4M10 4h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stopwatch:{viewBox:"0 0 24 24",path:"M12 5a9 9 0 1 0 0 18 9 9 0 0 0 0-18zM12 9v5l3 3M10 2h4M21 6l-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},whistle:{viewBox:"0 0 24 24",path:"M5 16a4 4 0 1 0 8 0 4 4 0 0 0-8 0zM2 12l7-4h8l3 4-3 4M18 8l4-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},target:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM12 6a6 6 0 1 0 0 12 6 6 0 0 0 0-12zM12 10a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"boxing-glove":{viewBox:"0 0 24 24",path:"M5 8c0-3 2-5 5-5h4c3 0 5 2 5 5v5c0 4-3 7-7 7s-7-3-7-7V8zM9 5v4M12 20v2M9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},racket:{viewBox:"0 0 24 24",path:"M12 2a6 6 0 0 0-6 6v4a6 6 0 0 0 12 0V8a6 6 0 0 0-6-6zM12 18v4M8 8h8M8 12h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skate:{viewBox:"0 0 24 24",path:"M4 16V6a2 2 0 0 1 2-2h8l4 4v8M2 16h18v2a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-2zM6 20v2M16 20v2M10 10h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},ski:{viewBox:"0 0 24 24",path:"M5 16l14-6M3 21l18-8M12 2a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM12 8l-4 8M14 10l2 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surfboard:{viewBox:"0 0 24 24",path:"M21 3L3 21M17 3c3 3 4 8 1 15L3 21c7-3 12-2 15 1M12 12l-4 4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mountain:{viewBox:"0 0 24 24",path:"M8 21l4-10 3 6 2-4 4 8H3l5-10 4 10z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tent:{viewBox:"0 0 24 24",path:"M12 2L2 20h20L12 2zM12 2v18M7 14l5-6 5 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},compass:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM16.24 7.76l-2.12 6.36-6.36 2.12 2.12-6.36z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fishing:{viewBox:"0 0 24 24",path:"M18 2l-3 3v3l-4 4-5-2-4 4v5h5l4-4-2-5 4-4h3l3-3M12 22c-2 0-3-1-3-3M9 19c-2 0-3-1-3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},Qr={building:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V7l7-4 7 4v14M9 21v-4h6v4M9 9h.01M15 9h.01M9 13h.01M15 13h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},house:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9zM9 22V12h6v10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},home:{viewBox:"0 0 24 24",path:"M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V9z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cabin:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10l8-8 8 8v10M10 20v-6h4v6M12 2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},apartment:{viewBox:"0 0 24 24",path:"M4 21V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v17M8 6h2M14 6h2M8 10h2M14 10h2M8 14h2M14 14h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},office:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 21v-4h6v4M9 7h.01M15 7h.01M9 11h.01M15 11h.01M9 15h.01M15 15h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},store:{viewBox:"0 0 24 24",path:"M4 3h16l1 6H3l1-6zM3 9v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9M10 21v-6h4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},warehouse:{viewBox:"0 0 24 24",path:"M3 21h18M4 21V8l8-5 8 5v13M9 17h6v4H9zM9 12h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},factory:{viewBox:"0 0 24 24",path:"M2 21h20M5 21V11l6 4V9l6 4V5a2 2 0 0 1 2-2h0a2 2 0 0 1 2 2v16M8 21v-3M12 21v-3M16 21v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},hotel:{viewBox:"0 0 24 24",path:"M4 21V3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v18M8 5h2M14 5h2M8 9h2M14 9h2M8 13h2M14 13h2M10 21v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},school:{viewBox:"0 0 24 24",path:"M2 22h20M12 2l10 6v14M2 8l10-6M12 8v14M4 10v12M20 10v12M8 14h.01M16 14h.01M10 22v-4h4v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},university:{viewBox:"0 0 24 24",path:"M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},library:{viewBox:"0 0 24 24",path:"M4 21h16M5 21V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16M9 7h6M9 11h6M9 15h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},museum:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V10M20 20V10M12 2L2 8h20L12 2zM8 20v-6h3v6M13 20v-6h3v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},court:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8l8-6 8 6v12M10 20v-6h4v6M6 10h12M12 4v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},church:{viewBox:"0 0 24 24",path:"M18 22H6a2 2 0 0 1-2-2V9l8-7 8 7v11a2 2 0 0 1-2 2zM12 2v4M10 4h4M10 22v-5a2 2 0 0 1 4 0v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mosque:{viewBox:"0 0 24 24",path:"M3 21h18M5 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M15 21v-8c0-2 .5-4 2-6 1.5 2 2 4 2 6v8M12 3a4 4 0 0 1 4 4v14M12 3a4 4 0 0 0-4 4v14M12 1v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},temple:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V12h4v10M16 22V12h4v10M8 22V8h8v14M12 2l6 6H6l6-6M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},castle:{viewBox:"0 0 24 24",path:"M2 22h20M4 22V10h4V6H6V2h3v2h2V2h2v2h2V2h3v4h-2v4h4v12M10 22v-5h4v5M4 6h4M16 6h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fortress:{viewBox:"0 0 24 24",path:"M2 20h20M4 20V8h16v12M8 8V4h2v4M14 8V4h2v4M4 4h4M16 4h4M8 20v-4h3v4M13 20v-4h3v4M7 12h2M15 12h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tower:{viewBox:"0 0 24 24",path:"M8 22V4a4 4 0 0 1 8 0v18M8 8h8M8 14h8M10 22v-4h4v4M12 1v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},lighthouse:{viewBox:"0 0 24 24",path:"M7 22l2-16h6l2 16M9 6V3a3 3 0 0 1 6 0v3M2 11h5M17 11h5M9 12h6M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bridge:{viewBox:"0 0 24 24",path:"M2 18h20M4 14c0-2 2-4 4-4s4 2 4 4c0-2 2-4 4-4s4 2 4 4M4 18v-4M20 18v-4M12 18v-4M8 10V6M16 10V6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},stadium:{viewBox:"0 0 24 24",path:"M2 16c0-3 4.5-5 10-5s10 2 10 5v2c0 3-4.5 5-10 5s-10-2-10-5v-2zM2 12c0-3 4.5-5 10-5s10 2 10 5M12 3v4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},airport:{viewBox:"0 0 24 24",path:"M21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"train-station":{viewBox:"0 0 24 24",path:"M4 21h16M6 17V7a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v10M8 21v-4h3v4M13 21v-4h3v4M12 2v3M9 9h6M9 13h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},monument:{viewBox:"0 0 24 24",path:"M8 22h8M10 22V10L12 2l2 8v12M6 18h12M8 14h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},obelisk:{viewBox:"0 0 24 24",path:"M7 22l2-18h6l2 18M12 2l-1 2h2l-1-2M9 8h6M9 14h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},arch:{viewBox:"0 0 24 24",path:"M4 22V10a8 8 0 0 1 16 0v12M4 8h16M4 14h16M8 22v-8M16 22v-8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},windmill:{viewBox:"0 0 24 24",path:"M7 22l3-10h4l3 10M12 12V3M12 6l6-3M12 6L6 3M12 6l6 3M12 6L6 9M10 16h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},skyscraper:{viewBox:"0 0 24 24",path:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18M2 22h20M10 6h4M10 10h4M10 14h4M10 18h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},pyramid:{viewBox:"0 0 24 24",path:"M12 2L2 22h20L12 2zM12 2v20M7 12h10",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dome:{viewBox:"0 0 24 24",path:"M2 22h20M4 22v-6a8 8 0 0 1 16 0v6M12 2v6M12 2a3 3 0 0 1 0 6M10 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},barn:{viewBox:"0 0 24 24",path:"M3 21h18M5 21V11l7-8 7 8v10M10 21v-5h4v5M9 11h6M12 3v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ea={smile:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},grin:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M6 13a6 6 0 0 0 12 0H6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},laugh:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9c0-.6.4-1 1-1s1 .4 1 1M15 9c0-.6.4-1 1-1s1 .4 1 1M7 13h10a5 5 0 0 1-10 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},joy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9l2 1M15 9l2 1M6 13h12a6 6 0 0 1-12 0z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},wink:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M14 9h4M8 14s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},blush:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 14s1.5 2 4 2 4-2 4-2M5 13h2M17 13h2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heart-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M6.5 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1zM15 10c.5-1 1.5-2 2.5-1s-1 2.5-2.5 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"star-eyes":{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 14s1.5 2 4 2 4-2 4-2M8 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1zM16 9l.5-1 .5 1 1-.5-.5 1 .5 1-1-.5-.5 1-.5-1-1 .5.5-1-.5-1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sad:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M16 16s-1.5-2-4-2-4 2-4 2M8 11v2M16 11v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sob:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9l3 1M18 9l-3 1M16 17s-1.5-2-4-2-4 2-4 2M7 12l1 6M17 12l-1 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},disappointed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M16 16s-1.5-2-4-2-4 2-4 2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},angry:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 2M18 8l-4 2M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rage:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 7l5 3M19 7l-5 3M9 16h6M9 16l1-2M15 16l-1-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},annoyed:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M8 9h.01M16 9h.01M9 15h6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},surprised:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v1M16 8v1M12 13a2 2 0 1 0 0 4 2 2 0 0 0 0-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},shocked:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 8l2 1M17 8l-2 1M12 13v5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},astonished:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 1M18 8l-4 1M12 12a3 3 0 1 0 0 6 3 3 0 0 0 0-6z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},thinking:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M10 15h4c0 1-1 2-2 2s-2-1-2-2zM19 9c1 0 2-1 2-2s-1-2-2-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},confused:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M9 15c2-2 4 0 6-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},neutral:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},expressionless:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h3M14 9h3M8 15h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},cool:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM5 10h5l1-2h2l1 2h5M5 10c0 1 1 2 2.5 2s2.5-1 2.5-2M14 10c0 1 1 2 2.5 2s2.5-1 2.5-2M8 16s1.5 2 4 2 4-2 4-2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},nerd:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM14 9a2 2 0 1 0 4 0 2 2 0 0 0-4 0zM10 9h4M8 15s1.5 1 4 1 4-1 4-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},tongue:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 13h8M10 13v3c0 1 1 2 2 2s2-1 2-2v-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},silly:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 9h2M17 9l-2-1M7 13c2 0 3 3 5 3s3-3 5-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},zany:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 8v2M15 8l2 2M8 14h8c0 2-2 4-4 4s-4-2-4-4z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sick:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M8 15c2 1 6-1 8 0M18 5c1.5 1.5 1.5 3.5 0 5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},sleepy:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM7 10c.5-.5 1.5-.5 2 0M15 10c.5-.5 1.5-.5 2 0M12 14a2 2 0 1 0 0 4 2 2 0 0 0 0-4zM18 4l2 2M20 4h-2v2",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},dead:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM6 8l4 4M10 8l-4 4M14 8l4 4M18 8l-4 4M8 16h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},mask:{viewBox:"0 0 24 24",path:"M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zM8 9h.01M16 9h.01M4 13h16M5 14c1 2 3 4 7 4s6-2 7-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}},ta={car:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M7.5 6.5l.5 1h8l.5-1a1 1 0 00-1-1H8.5a1 1 0 00-1 1z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},truck:{viewBox:"0 0 24 24",path:"M1 3h15v13H1zM16 8h4l3 3v5h-7V8z M5.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z M18.5 21a2.5 2.5 0 100-5 2.5 2.5 0 000 5z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},van:{viewBox:"0 0 24 24",path:"M3 6h13v11H3z M16 6h2l3 4v7h-5V6z M7 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M17 20.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z M3 10h13",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},motorcycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 4l-3 7h5.5L18 8m-4 3l3 8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bicycle:{viewBox:"0 0 24 24",path:"M5 19a3 3 0 100-6 3 3 0 000 6z M19 19a3 3 0 100-6 3 3 0 000 6z M12 11l2-5h3M12 19v-8m0 0L9 8M12 11l3-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bus:{viewBox:"0 0 24 24",path:"M4 6a2 2 0 012-2h12a2 2 0 012 2v11a3 3 0 01-3 3H7a3 3 0 01-3-3V6z M4 10h16M8 20v-2M16 20v-2M8 14h.01M16 14h.01M4 6h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},taxi:{viewBox:"0 0 24 24",path:"M5 11l1.5-4.5h11L19 11M5 17h1m13 0h1M6 13v4m12-4v4M5 17h14a1 1 0 001-1v-5H4v5a1 1 0 001 1z M9 4h6v2H9V4z M7 16a1 1 0 100-2 1 1 0 000 2z M17 16a1 1 0 100-2 1 1 0 000 2z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},parking:{viewBox:"0 0 24 24",path:"M4 4h16a2 2 0 012 2v12a2 2 0 01-2 2H4a2 2 0 01-2-2V6a2 2 0 012-2z M9 8v8M9 8h3.5a2.5 2.5 0 010 5H9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},fuel:{viewBox:"0 0 24 24",path:"M3 4h10v12H3z M13 7h2a2 2 0 012 2v7a2 2 0 002 2M14 7V4M3 10h10M5 20v-4M11 20v-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},garage:{viewBox:"0 0 24 24",path:"M2 9l10-7 10 7v11a2 2 0 01-2 2H4a2 2 0 01-2-2V9z M7 21V13h10v8M2 9h20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},road:{viewBox:"0 0 24 24",path:"M6 4h2v16H6zM16 4h2v16h-2zM12 4v4M12 12v4M12 20v1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},rocket:{viewBox:"0 0 24 24",path:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11A22.35 22.35 0 0 1 15 15z M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};var na={code:{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"git-branch":{viewBox:"0 0 24 24",path:"M6 3v12M18 9a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM6 21a3 3 0 1 0 0-6 3 3 0 0 0 0 6zM18 9c-3 0-6 3-6 6v3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},terminal:{viewBox:"0 0 24 24",path:"M4 17l6-6-6-6M12 19h8",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},bold:{viewBox:"0 0 24 24",path:"M6 4h8a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6V4zm0 8h9a4 4 0 0 1 4 4 4 4 0 0 1-4 4H6v-8z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},italic:{viewBox:"0 0 24 24",path:"M19 4h-9M14 20H5M15 4L9 20",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},underline:{viewBox:"0 0 24 24",path:"M6 3v7a6 6 0 0 0 6 6 6 6 0 0 0 6-6V3M4 21h16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},strikethrough:{viewBox:"0 0 24 24",path:"M17.3 4.9c-2.3-.6-4.4-1-6.2-.9-2.7.1-5.3 1.1-6.6 3.1-.5.8-.7 1.7-.7 2.6 0 1.7.8 3.1 2 4M3 12h18M13 20c2 0 3.5-.5 4.5-1.5 1-.9 1.5-2.2 1.5-3.5 0-1.3-.5-2.5-1.4-3.4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-1":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 6h3m0 0V6m0 6v6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-2":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 10.5c0-2.5 4-2.5 4 0s-4 2.5-4 5m4 0h-4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"heading-3":{viewBox:"0 0 24 24",path:"M4 12h8m-8 6V6m8 12V6m5 4.5h3a1.5 1.5 0 0 1 0 3 1.5 1.5 0 0 1 0 3h-3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-bullet":{viewBox:"0 0 24 24",path:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"list-numbered":{viewBox:"0 0 24 24",path:"M10 6h11M10 12h11M10 18h11M4 6h1v4M4 10h2M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},quote:{viewBox:"0 0 24 24",path:"M3 21c3 0 7-1 7-8V5c0-1.25-.756-2.017-2-2H4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2 1 0 1 0 1 1v1c0 1-1 2-2 2s-1 .008-1 1.031V20c0 1 0 1 1 1zM15 21c3 0 7-1 7-8V5c0-1.25-.757-2.017-2-2h-4c-1.25 0-2 .75-2 1.972V11c0 1.25.75 2 2 2h.75c0 2.25.25 4-2.75 4v3c0 1 0 1 1 1z",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-inline":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"code-block":{viewBox:"0 0 24 24",path:"M16 18l6-6-6-6M8 6l-6 6 6 6M14 4l-4 16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"link-add":{viewBox:"0 0 24 24",path:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"image-add":{viewBox:"0 0 24 24",path:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M17 8l-5-5-5 5M12 3v12",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},undo:{viewBox:"0 0 24 24",path:"M3 7v6h6M21 17a9 9 0 0 0-9-9 9 9 0 0 0-9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},redo:{viewBox:"0 0 24 24",path:"M21 7v6h-6M3 17a9 9 0 0 1 9-9 9 9 0 0 1 9 9",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-left":{viewBox:"0 0 24 24",path:"M3 6h18M3 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-center":{viewBox:"0 0 24 24",path:"M3 6h18M6 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"text-right":{viewBox:"0 0 24 24",path:"M3 6h18M9 12h12M3 18h18",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},indent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M3 9l4 3-4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},outdent:{viewBox:"0 0 24 24",path:"M3 6h18M3 12h18M3 18h18M7 9l-4 3 4 3",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},embed:{viewBox:"0 0 24 24",path:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v10zM8 10h8M8 14h4",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},"clear-format":{viewBox:"0 0 24 24",path:"M4 7V4h16v3M9 20h6M12 4v16",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}};const sa=e=>({viewBox:"0 0 24 24",path:e,stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),oa={email:sa("M16 12a4 4 0 10-8 0 4 4 0 008 0zm0 0v1.5a2.5 2.5 0 005 0V12a9 9 0 10-9 9h4"),name:sa("M5 5h14a2 2 0 012 2v10a2 2 0 01-2 2H5a2 2 0 01-2-2V7a2 2 0 012-2z M9 9a2 2 0 110 4 2 2 0 010-4z M6 16.5c.6-1.4 1.7-2 3-2s2.4.6 3 2 M15 10h3 M15 14h3"),username:sa("M12 2a10 10 0 110 20 10 10 0 010-20z M12 7a3 3 0 110 6 3 3 0 010-6z M6.2 18.3c1.3-1.9 3.4-3 5.8-3s4.5 1.1 5.8 3"),password:sa("M5 7h14a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2V9a2 2 0 012-2z M7.5 12h.01 M12 12h.01 M16.5 12h.01"),signature:sa("M3 16c2.5-2.5 4.5-7 6.5-7 1.6 0-.6 6 1.2 6 1.4 0 2.6-3.5 4.3-3.5 1.4 0 .8 2.5 2.5 2.5 M3 20h18"),birthday:sa("M4 21h16 M5 21v-6a2 2 0 012-2h10a2 2 0 012 2v6 M5 17c1.2.9 2.3.9 3.5 0s2.3-.9 3.5 0 2.3.9 3.5 0 2.3-.9 3.5 0 M12 13V9 M12 7c-.9-.9-.9-2 0-3.5.9 1.5.9 2.6 0 3.5z"),company:sa("M4 21V5a2 2 0 012-2h8a2 2 0 012 2v16 M16 9h2a2 2 0 012 2v10 M3 21h18 M8 7h4 M8 11h4 M8 15h4"),telephone:sa("M22 16.9v3a2 2 0 01-2.2 2 19.8 19.8 0 01-8.6-3.1 19.5 19.5 0 01-6-6 19.8 19.8 0 01-3.1-8.7A2 2 0 014.1 2h3a2 2 0 012 1.7c.1.9.4 1.9.7 2.8a2 2 0 01-.5 2.1L8 9.9a16 16 0 006 6l1.3-1.3a2 2 0 012.1-.4c.9.3 1.8.6 2.8.7a2 2 0 011.7 2z"),mobile:sa("M8 2h8a2 2 0 012 2v16a2 2 0 01-2 2H8a2 2 0 01-2-2V4a2 2 0 012-2z M11 18h2"),address:sa("M3 10.5L12 3l9 7.5 M5 9v12h14V9 M10 21v-6h4v6"),postcode:sa("M4 5h16a1 1 0 011 1v12a1 1 0 01-1 1H4a1 1 0 01-1-1V6a1 1 0 011-1z M10 9l-1 6 M14 9l-1 6 M7.5 11h8 M7 13h8"),website:sa("M5 4h14a2 2 0 012 2v12a2 2 0 01-2 2H5a2 2 0 01-2-2V6a2 2 0 012-2z M3 9h18 M6.5 6.5h.01 M9.5 6.5h.01"),pound:sa("M17 7.5a4 4 0 00-7.5-1.5c-.8 1.5-.4 3.3 0 5 .5 2.2.4 4.5-1.5 7H18 M6.5 12.5h8"),dollar:sa("M12 2v20 M17 6.5C16.1 5 14.3 4.3 12 4.3 9 4.3 7 5.8 7 8c0 5 10 2.5 10 8 0 2.2-2 3.7-5 3.7-2.4 0-4.3-.8-5.2-2.3"),euro:sa("M18.5 6.5a7 7 0 100 11 M4 10h9 M4 14h9"),weight:sa("M9 7a3 3 0 116 0 M6.5 9h11l2 12h-15l2-12z M10.5 14.5h3"),ruler:sa("M3 17L17 3l4 4L7 21l-4-4z M7 13l2 2 M10 10l2 2 M13 7l2 2"),quantity:sa("M4 6h16 M4 12h16 M4 18h10 M18 16v4 M16 18h4")},ia={...Ir,...Nr,...Pr,...Vr,...Fr,...Rr,...qr,...Ur,...Kr,...Yr,...Gr,...Xr,...Jr,...Zr,...Qr,...ea,...ta,...na,...oa},ra={ui:{name:"UI",description:"Core user interface icons",icons:Object.keys(Ir)},communication:{name:"Communication",description:"Messaging and notifications",icons:Object.keys(Nr)},media:{name:"Media",description:"Audio, video, and images",icons:Object.keys(Pr)},files:{name:"Files",description:"Documents and file operations",icons:Object.keys(Vr)},social:{name:"Social",description:"Social interactions and sharing",icons:Object.keys(Fr)},commerce:{name:"Commerce",description:"Shopping and payments",icons:Object.keys(Rr)},status:{name:"Status",description:"Indicators and alerts",icons:Object.keys(qr)},navigation:{name:"Navigation",description:"Directional and navigation",icons:Object.keys(Ur)},seasonal:{name:"Seasonal",description:"Festive and holiday icons",icons:Object.keys(Kr)},weather:{name:"Weather",description:"Weather conditions and meteorology",icons:Object.keys(Yr)},devices:{name:"Devices",description:"Electronic devices and hardware",icons:Object.keys(Gr)},finance:{name:"Finance",description:"Financial and charts",icons:Object.keys(Xr)},health:{name:"Health",description:"Medical and wellness",icons:Object.keys(Jr)},sport:{name:"Sport",description:"Sports and fitness",icons:Object.keys(Zr)},buildings:{name:"Buildings",description:"Architecture and structures",icons:Object.keys(Qr)},emojis:{name:"Emojis",description:"Emoji expressions and faces",icons:Object.keys(ea)},transport:{name:"Transport",description:"Vehicles and transportation",icons:Object.keys(ta)},code:{name:"Code & Editor",description:"Text editing, formatting, and code icons",icons:Object.keys(na)},forms:{name:"Forms",description:"Beside a form field - email, name, phone, address, money, measurements",icons:[...Object.keys(oa),"at-sign","mail","user","users","phone","smartphone","map-pin","home","calendar","clock","lock","key","globe","link","credit-card","hash","percent","briefcase","building","message-square","tag","search","cake","gift","scale"]}},aa="http://www.w3.org/2000/svg";const la=new class{constructor(){this._icons={...ia},this._categories={...ra}}render(e,t={}){const n=this._icons[e];if(!n)return console.warn(`Icon "${e}" not found`),null;const{size:s=24,class:o="",colour:i=null,color:r=null,attrs:a={}}=t,l=document.createElementNS(aa,"svg");l.setAttribute("viewBox",n.viewBox||"0 0 24 24"),l.setAttribute("width",s),l.setAttribute("height",s),l.setAttribute("fill",n.fill||"none"),l.setAttribute("aria-hidden","true");const d=["dm-icon"];if(o&&d.push(o),l.setAttribute("class",d.join(" ")),n.stroke&&l.setAttribute("stroke",i||r||n.stroke),n.strokeWidth&&l.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&l.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&l.setAttribute("stroke-linejoin",n.strokeLinejoin),(i||r)&&"currentColor"===n.fill&&l.setAttribute("fill",i||r),Object.entries(a).forEach(([e,t])=>{l.setAttribute(e,t)}),n.path){const e=document.createElementNS(aa,"path");e.setAttribute("d",n.path),"currentColor"===n.fill&&e.setAttribute("fill",i||r||"currentColor"),l.appendChild(e)}return n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(aa,"path");t.setAttribute("d",e),"currentColor"===n.fill&&t.setAttribute("fill",i||r||"currentColor"),l.appendChild(t)}),l}html(e,t={}){const n=this.render(e,t);if(!n)return"";const s=document.createElement("div");return s.appendChild(n),s.innerHTML}inject(e,t,n={}){const{position:s="prepend",...o}=n,i="string"==typeof e?document.querySelector(e):e;if(!i)return console.warn(`Target element not found: ${e}`),null;const r=this.render(t,o);if(!r)return null;switch(s){case"append":i.appendChild(r);break;case"replace":i.innerHTML="",i.appendChild(r);break;default:i.insertBefore(r,i.firstChild)}return r}scan(e=document){const t="string"==typeof e?document.querySelector(e):e;if(!t)return 0;const n=t.querySelectorAll("[data-icon]:not([data-icon-processed]):not([data-icon-processing])");let s=0;return n.forEach(e=>{if("svg"===e.tagName.toLowerCase()||e.hasAttribute("data-icon-processed")||e.querySelector("svg"))return;const t=e.dataset.icon,n=parseInt(e.dataset.iconSize,10)||24,o=e.dataset.iconColour||e.dataset.iconColor||null,i=e.dataset.iconClass||"",r=this.render(t,{size:n,colour:o,class:i});if(r){const n=e.className;n&&r.classList.add(...n.split(" ").filter(e=>e)),r.setAttribute("data-icon",t),r.setAttribute("data-icon-processed","true"),r.setAttribute("data-original-icon",t),r.setAttribute("data-icon-converted",Date.now().toString()),e.replaceWith(r),s++}else e.setAttribute("data-icon-processed","true")}),s}register(e,t){return e&&t?(t.viewBox||(t.viewBox="0 0 24 24"),t.path||t.paths?(this._icons[e]=t,this._categories.custom||(this._categories.custom={name:"Custom",description:"Custom registered icons",icons:[]}),this._categories.custom.icons.push(e),this):(console.warn(`Icon "${e}" must have a path or paths property`),this)):(console.warn("Invalid icon registration: name and definition required"),this)}unregister(e){if(this._icons[e]){if(delete this._icons[e],this._categories.custom){const t=this._categories.custom.icons.indexOf(e);t>-1&&this._categories.custom.icons.splice(t,1)}return!0}return!1}has(e){return!!this._icons[e]}get(e){return this._icons[e]||null}list(e=null){return e&&this._categories[e]?[...this._categories[e].icons]:Object.keys(this._icons)}listCategories(){return{...this._categories}}count(){return Object.keys(this._icons).length}search(e){const t=e.toLowerCase();return Object.keys(this._icons).filter(e=>e.toLowerCase().includes(t))}createSprite(){const e=document.createElementNS(aa,"svg");return e.setAttribute("xmlns",aa),e.style.display="none",Object.entries(this._icons).forEach(([t,n])=>{const s=document.createElementNS(aa,"symbol");if(s.setAttribute("id",`dm-icon-${t}`),s.setAttribute("viewBox",n.viewBox||"0 0 24 24"),n.path){const e=document.createElementNS(aa,"path");e.setAttribute("d",n.path),n.fill&&e.setAttribute("fill",n.fill),n.stroke&&(e.setAttribute("stroke",n.stroke),n.strokeWidth&&e.setAttribute("stroke-width",n.strokeWidth),n.strokeLinecap&&e.setAttribute("stroke-linecap",n.strokeLinecap),n.strokeLinejoin&&e.setAttribute("stroke-linejoin",n.strokeLinejoin)),s.appendChild(e)}n.paths&&n.paths.forEach(e=>{const t=document.createElementNS(aa,"path");t.setAttribute("d",e),n.fill&&t.setAttribute("fill",n.fill),n.stroke&&t.setAttribute("stroke",n.stroke),s.appendChild(t)}),e.appendChild(s)}),e}use(e,t={}){if(!this._icons[e])return console.warn(`Icon "${e}" not found`),null;const{size:n=24,class:s=""}=t,o=document.createElementNS(aa,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("aria-hidden","true");const i=["dm-icon"];s&&i.push(s),o.setAttribute("class",i.join(" "));const r=document.createElementNS(aa,"use");return r.setAttributeNS("http://www.w3.org/1999/xlink","href",`#dm-icon-${e}`),o.appendChild(r),o}};class da{static stripeColors={none:"transparent",lighter:"var(--dm-gray-100, #f8f9fa)",light:"var(--dm-gray-200, #e9ecef)",medium:"var(--dm-gray-300, #dee2e6)",dark:"var(--dm-gray-400, #ced4da)","primary-tint":"rgba(100, 149, 237, 0.05)","success-tint":"rgba(40, 167, 69, 0.05)","warning-tint":"rgba(255, 193, 7, 0.05)","danger-tint":"rgba(220, 53, 69, 0.05)","info-tint":"rgba(23, 162, 184, 0.05)",default:"var(--dm-table-stripe-bg, #f9f9f9)"};static hoverColors={none:"transparent",lighter:"var(--dm-gray-200, #e9ecef)",light:"var(--dm-gray-300, #dee2e6)",medium:"var(--dm-gray-400, #ced4da)",dark:"var(--dm-gray-500, #adb5bd)",default:"var(--dm-hover-bg, #f0f0f0)"};constructor(e,t={}){this.element="string"==typeof e?document.querySelector(e):e,this.options={data:[],columns:[],rowKey:"id",sortable:!0,multiSort:!1,defaultSort:null,filterable:!0,searchable:!0,searchPlaceholder:"Search...",pagination:!0,pageSize:10,pageSizeOptions:[10,25,50,100],selectable:!1,selectionMode:"single",editable:!1,editMode:"cell",resizable:!0,loadingSkeleton:!1,loadingLabel:"Loading...",striped:!0,hover:!0,bordered:!0,responsive:!0,evenRowColor:null,oddRowColor:null,hoverColor:null,classes:{wrapper:"domma-table-wrapper",table:"domma-table",header:"domma-table-header",body:"domma-table-body",row:"domma-table-row",cell:"domma-table-cell",selected:"domma-table-selected",sorted:"domma-table-sorted",sortAsc:"domma-table-sort-asc",sortDesc:"domma-table-sort-desc",pagination:"domma-table-pagination",search:"domma-table-search"},exportPanel:!1,exportOptions:["copy","csv","excel","json"],columnToggle:!1,regexSearch:!1,persistSettings:!1,storageKey:null,onSort:null,onFilter:null,onPageChange:null,onSelect:null,onEdit:null,onRender:null,onExport:null,...t},this._originalData=[...this.options.data],this._data=[...this.options.data],this._filteredData=[...this._data],this._currentPage=1,this._pageSize=this.options.pageSize,this._sorts=[],this._filters=[],this._searchQuery="",this._selected=new Set,this._editingCell=null,this._eventListeners=new Map,this._columnDropdownOpen=!1,this._searchIsRegex=!1,this._loading=!(!this.options.loadingSkeleton||this.options.data&&this.options.data.length),this._columns=this.options.columns.map(e=>({key:e.key||e,title:e.title||e.key||e,sortable:!1!==e.sortable&&this.options.sortable,filterable:!1!==e.filterable,editable:e.editable||!1,width:e.width||null,render:e.render||null,filterOptions:e.filterOptions||null,visible:!1!==e.visible})),this.options.persistSettings&&this._loadSettings(),this._init()}_init(){this.element&&(this.options.defaultSort&&(this._sorts=[this.options.defaultSort]),this.render())}_resolveColor(e,t,n){return e?t[e]?t[e]:e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")||e.startsWith("var(")?e:n:n}_getRowColors(e){const t=this.options;if(!t.striped)return{background:"transparent",hover:t.hover?this._resolveColor(t.hoverColor,da.hoverColors,da.hoverColors.default):"transparent"};const n=e%2==1,s=this._resolveColor(t.evenRowColor,da.stripeColors,"transparent"),o=this._resolveColor(t.oddRowColor,da.stripeColors,da.stripeColors.default);return{background:n?o:s,hover:t.hover?this._resolveColor(t.hoverColor,da.hoverColors,da.hoverColors.default):null}}setData(e){return this._loading=!1,this._originalData=[...e],this._data=[...e],this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}getData(){return[...this._getPageData()]}setLoading(e=!0){return this._loading=!!e,this.render(),this}isLoading(){return this._loading}getFilteredData(){return[...this._filteredData]}getOriginalData(){return[...this._originalData]}addRow(e){return this._loading=!1,this._originalData.push(e),this._data.push(e),this._applyFiltersAndSort(),this.render(),this}updateRow(e,t){const n=this._findRowIndex(e);return-1!==n&&(this._originalData[n]={...this._originalData[n],...t},this._data[n]={...this._data[n],...t},this._applyFiltersAndSort(),this.render()),this}removeRow(e){const t=this._findRowIndex(e);return-1!==t&&(this._originalData.splice(t,1),this._data.splice(t,1),this._applyFiltersAndSort(),this.render()),this}_findRowIndex(e){const t=this.options.rowKey;return"number"==typeof e?e:this._originalData.findIndex(n=>n[t]===e)}sort(e,t="asc"){return this._sorts=[{column:e,direction:t}],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({column:e,direction:t,sorts:this._sorts}),this}sortMultiple(e){return this._sorts=e,this._applyFiltersAndSort(),this.render(),this._saveSettings(),this.options.onSort&&this.options.onSort({sorts:this._sorts}),this}clearSort(){return this._sorts=[],this._applyFiltersAndSort(),this.render(),this._saveSettings(),this}_applySort(e){return 0===this._sorts.length?e:[...e].sort((e,t)=>{for(const n of this._sorts){const{column:s,direction:o}=n,i=e[s],r=t[s];let a=0;if(null==i?a=1:null==r||i<r?a=-1:i>r&&(a=1),0!==a)return"desc"===o?-a:a}return 0})}search(e){return this._searchQuery=this._searchIsRegex?e.trim():e.toLowerCase().trim(),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({query:e,type:"search",isRegex:this._searchIsRegex}),this}setSearchMode(e){return this._searchIsRegex=e,this._searchQuery&&(this._applyFiltersAndSort(),this.render()),this}toggleSearchMode(){return this.setSearchMode(!this._searchIsRegex)}filter(e,t,n="equals"){return this._filters=this._filters.filter(t=>t.column!==e),null!=t&&""!==t&&this._filters.push({column:e,value:t,operator:n}),this._applyFiltersAndSort(),this._currentPage=1,this.render(),this.options.onFilter&&this.options.onFilter({column:e,value:t,operator:n,type:"column"}),this}filterBy(e){return this._customFilter=e,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}clearFilters(){return this._filters=[],this._searchQuery="",this._customFilter=null,this._applyFiltersAndSort(),this._currentPage=1,this.render(),this}_applyFilters(e){let t=e;if(this._searchQuery)if(this._searchIsRegex)try{const e=new RegExp(this._searchQuery,"i");t=t.filter(t=>this._columns.some(n=>{const s=t[n.key];return null!=s&&e.test(String(s))}))}catch(e){t=[]}else t=t.filter(e=>this._columns.some(t=>{const n=e[t.key];return null!=n&&String(n).toLowerCase().includes(this._searchQuery)}));for(const e of this._filters)t=t.filter(t=>{const n=t[e.column];return this._matchFilter(n,e.value,e.operator)});return this._customFilter&&(t=t.filter(this._customFilter)),t}_matchFilter(e,t,n){if(null==e)return!1;const s=String(e).toLowerCase(),o=String(t).toLowerCase();switch(n){case"equals":default:return s===o;case"contains":return s.includes(o);case"startsWith":return s.startsWith(o);case"endsWith":return s.endsWith(o);case"gt":return Number(e)>Number(t);case"lt":return Number(e)<Number(t);case"gte":return Number(e)>=Number(t);case"lte":return Number(e)<=Number(t);case"between":const[n,i]=t,r=Number(e);return r>=n&&r<=i;case"in":return t.includes(e)}}_applyFiltersAndSort(){this._filteredData=this._applyFilters(this._data),this._filteredData=this._applySort(this._filteredData)}page(e){const t=this._getTotalPages();return this._currentPage=Math.max(1,Math.min(e,t)),this.render(),this.options.onPageChange&&this.options.onPageChange(this.pageInfo()),this}pageSize(e){return this._pageSize=e,this._currentPage=1,this.render(),this._saveSettings(),this}nextPage(){return this.page(this._currentPage+1)}prevPage(){return this.page(this._currentPage-1)}firstPage(){return this.page(1)}lastPage(){return this.page(this._getTotalPages())}pageInfo(){const e=this._getTotalPages();return{page:this._currentPage,pageSize:this._pageSize,totalPages:e,totalRows:this._filteredData.length,startRow:(this._currentPage-1)*this._pageSize+1,endRow:Math.min(this._currentPage*this._pageSize,this._filteredData.length)}}_getTotalPages(){return this.options.pagination&&Math.ceil(this._filteredData.length/this._pageSize)||1}_getPageData(){if(!this.options.pagination)return this._filteredData;const e=(this._currentPage-1)*this._pageSize,t=e+this._pageSize;return this._filteredData.slice(e,t)}select(e){if(!this.options.selectable)return this;const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return"single"===this.options.selectionMode&&this._selected.clear(),this._selected.add(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.delete(n),this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}toggleSelect(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)?this.deselect(e):this.select(e),this}selectAll(){if(!this.options.selectable||"single"===this.options.selectionMode)return this;const e=this.options.rowKey;for(const t of this._filteredData)this._selected.add(t[e]);return this.render(),this.options.onSelect&&this.options.onSelect(this.getSelected()),this}deselectAll(){return this._selected.clear(),this.render(),this.options.onSelect&&this.options.onSelect([]),this}getSelected(){const e=this.options.rowKey;return this._filteredData.filter(t=>this._selected.has(t[e]))}isSelected(e){const t=this.options.rowKey,n="object"==typeof e?e[t]:e;return this._selected.has(n)}_getStorageKey(){return this.options.storageKey||(this.element.id?`domma-table-${this.element.id}`:"domma-table-default")}_loadSettings(){try{const e=this._getStorageKey(),t=Q.get(e);t&&t.columns&&t.columns.forEach(e=>{const t=this._columns.find(t=>t.key===e.key);t&&(t.visible=e.visible,e.width&&(t.width=e.width))}),t&&t.pageSize&&this.options.pagination&&(this._pageSize=t.pageSize,this.options.pageSize=t.pageSize),t&&t.sorts&&this.options.sortable&&(this._sorts=t.sorts)}catch(e){console.warn("Failed to load table settings:",e)}}_saveSettings(){if(this.options.persistSettings)try{const e=this._getStorageKey(),t={columns:this._columns.map(e=>({key:e.key,visible:e.visible,width:e.width})),pageSize:this._pageSize,sorts:this._sorts,timestamp:Date.now()};Q.set(e,t)}catch(e){console.warn("Failed to save table settings:",e)}}clearSettings(){if(this.options.persistSettings){const e=this._getStorageKey();Q.remove(e)}}showColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!0,this.render(),this._saveSettings()),this}hideColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!1,this.render(),this._saveSettings()),this}toggleColumn(e){const t=this._columns.find(t=>t.key===e);return t&&(t.visible=!t.visible,this.render(),this._saveSettings()),this}getVisibleColumns(){return this._columns.filter(e=>e.visible)}getHiddenColumns(){return this._columns.filter(e=>!e.visible)}resizeColumn(e,t){const n=this._columns.find(t=>t.key===e);return n&&(n.width=t,this.render()),this}getColumns(){return[...this._columns]}editCell(e,t){return this.options.editable?(this._editingCell={rowIndex:e,column:t},this.render(),this):this}saveEdits(){return this._editingCell=null,this.render(),this}cancelEdits(){return this._editingCell=null,this.render(),this}toCSV(e={}){const{columns:t=this._columns.filter(e=>e.visible),includeHeaders:n=!0}=e,s=[],o=this._getExportData();n&&s.push(t.map(e=>`"${e.title}"`).join(","));for(const e of o){const n=t.map(t=>{const n=e[t.key];return null==n?'""':`"${String(n).replace(/"/g,'""')}"`});s.push(n.join(","))}return s.join("\n")}_getExportData(){const e=this.getSelected();return e.length>0?e:this._filteredData}toJSON(e={}){const{columns:t=this._columns.filter(e=>e.visible),pretty:n=!1}=e,s=t.map(e=>e.key),o=this._getExportData().map(e=>{const t={};for(const n of s)t[n]=e[n];return t});return n?JSON.stringify(o,null,2):JSON.stringify(o)}download(e,t){let n,s;switch(e){case"csv":n=this.toCSV(),s="text/csv",t=t||"data.csv";break;case"excel":n=this.toExcel(),s="application/vnd.ms-excel",t=t||"data.xls";break;default:n=this.toJSON({pretty:!0}),s="application/json",t=t||"data.json"}const o=new Blob([n],{type:s}),i=URL.createObjectURL(o),r=document.createElement("a");if(r.href=i,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(i),this.options.onExport){const n=this._getExportData(),s=this.getSelected();this.options.onExport({format:e,filename:t,rowCount:n.length,selectedOnly:s.length>0})}}toExcel(e={}){const{columns:t=this._columns.filter(e=>e.visible)}=e,n=this._getExportData();let s='\n <html xmlns:o="urn:schemas-microsoft-com:office:office"\n xmlns:x="urn:schemas-microsoft-com:office:excel">\n <head>\n <meta charset="UTF-8">\n \x3c!--[if gte mso 9]>\n <xml>\n <x:ExcelWorkbook>\n <x:ExcelWorksheets>\n <x:ExcelWorksheet>\n <x:Name>Data</x:Name>\n <x:WorksheetOptions>\n <x:DisplayGridlines/>\n </x:WorksheetOptions>\n </x:ExcelWorksheet>\n </x:ExcelWorksheets>\n </x:ExcelWorkbook>\n </xml>\n <![endif]--\x3e\n <style>\n table { border-collapse: collapse; }\n th, td { border: 1px solid #000; padding: 8px; }\n th { background: #f0f0f0; font-weight: bold; }\n </style>\n </head>\n <body>\n <table>\n <thead>\n <tr>';for(const e of t)s+=`<th>${this._escapeHtml(e.title)}</th>`;s+="</tr></thead><tbody>";for(const e of n){s+="<tr>";for(const n of t){const t=e[n.key];s+=`<td>${null!=t?this._escapeHtml(String(t)):""}</td>`}s+="</tr>"}return s+="</tbody></table></body></html>",s}async copyToClipboard(e="text"){let t;const n=this._getExportData();if("json"===e)t=this.toJSON({pretty:!0});else if("csv"===e)t=this.toCSV();else{const e=this._columns.filter(e=>e.visible),s=[];s.push(e.map(e=>e.title).join("\t"));for(const t of n)s.push(e.map(e=>t[e.key]??"").join("\t"));t=s.join("\n")}return await c.copyToClipboard(t),this.options.onExport&&this.options.onExport({format:"clipboard",rowCount:this._filteredData.length}),this}_escapeHtml(e){const t=document.createElement("div");return t.textContent=e,t.innerHTML}render(){if(!this.element)return this;const e=this.options,t=e.classes,n=this._columns.filter(e=>e.visible),s=this._getPageData();this._restoreIconsBeforeRebuild(),this.element.innerHTML="",this._clearEventListeners();const o=document.createElement("div");o.className=t.wrapper;const i=document.createElement("div");if(i.className="domma-table-toolbar",e.searchable){const t=document.createElement("div");t.className="domma-table-search-wrapper";const n=document.createElement("input");if(n.type="text",n.className="domma-table-search-input"+(this._searchIsRegex?" regex-mode":""),n.placeholder=this._searchIsRegex?"Regex pattern...":e.searchPlaceholder,n.value=this._searchQuery,n.setAttribute("aria-label","Search table"),this._addEventHandler(n,"input",c.debounce(e=>{this.search(e.target.value)},300)),t.appendChild(n),e.regexSearch){const e=document.createElement("button");e.type="button",e.className="domma-table-regex-button"+(this._searchIsRegex?" active":""),e.title=this._searchIsRegex?"Regex mode (click for text)":"Text mode (click for regex)",e.setAttribute("aria-label",this._searchIsRegex?"Regex search mode enabled":"Regex search mode disabled"),e.setAttribute("aria-pressed",this._searchIsRegex?"true":"false"),e.innerHTML=".*",this._addEventHandler(e,"click",()=>{this._searchIsRegex=!this._searchIsRegex,this._searchQuery&&(this._searchQuery=this._searchIsRegex?n.value.trim():n.value.toLowerCase().trim(),this._applyFiltersAndSort()),this.render()}),t.appendChild(e)}i.appendChild(t)}if(e.columnToggle){const e=document.createElement("div");e.className="domma-table-column-toggle";const t=document.createElement("button");t.type="button",t.className="domma-table-column-button",t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-expanded",this._columnDropdownOpen?"true":"false"),t.setAttribute("aria-label","Toggle column visibility"),t.innerHTML=`${la.html("columns",{size:16})} Columns`;const n=document.createElement("div");n.className="domma-column-dropdown"+(this._columnDropdownOpen?" show":"");for(const e of this._columns){const t=document.createElement("label");t.className="domma-column-toggle-item";const s=document.createElement("span");s.className="domma-column-toggle-label",s.textContent=e.title;const o=document.createElement("div");o.className="domma-toggle-switch";const i=document.createElement("input");i.type="checkbox",i.checked=e.visible,i.style.cssText="opacity: 0; width: 0; height: 0; position: absolute;";const r=document.createElement("span");r.className="domma-toggle-track"+(e.visible?" active":"");const a=document.createElement("span");a.className="domma-toggle-knob"+(e.visible?" active":""),r.appendChild(a),o.appendChild(i),o.appendChild(r),this._addEventHandler(t,"click",t=>{t.preventDefault(),t.stopPropagation(),e.visible=!e.visible,e.visible?(r.classList.add("active"),a.classList.add("active")):(r.classList.remove("active"),a.classList.remove("active")),i.checked=e.visible,this._columnDropdownOpen=!0,this.render(),this._saveSettings()}),t.appendChild(s),t.appendChild(o),n.appendChild(t)}this._addEventHandler(t,"click",e=>{e.stopPropagation(),this._columnDropdownOpen=!this._columnDropdownOpen,this._columnDropdownOpen?n.classList.add("show"):n.classList.remove("show")}),this._addEventHandler(document,"click",()=>{this._columnDropdownOpen&&(this._columnDropdownOpen=!1,n.classList.remove("show"))}),this._addEventHandler(n,"click",e=>{e.stopPropagation()}),e.appendChild(t),e.appendChild(n),i.appendChild(e)}if(e.exportPanel){const t=document.createElement("div");t.className="domma-table-export-wrapper";let n=!1;const s=document.createElement("div");s.className="domma-export-mode-toggle";const o=document.createElement("span");o.className="domma-export-mode-label active",o.textContent="Copy";const r=document.createElement("label");r.className="domma-export-toggle-switch";const a=document.createElement("input");a.type="checkbox",a.className="domma-export-toggle-input";const l=document.createElement("span");l.className="domma-export-toggle-slider";const d=document.createElement("span");d.className="domma-export-toggle-knob",l.appendChild(d),r.appendChild(a),r.appendChild(l);const c=document.createElement("span");c.className="domma-export-mode-label",c.textContent="Download";const h=()=>{n?(l.classList.add("active"),d.classList.add("active"),o.classList.remove("active"),c.classList.add("active")):(l.classList.remove("active"),d.classList.remove("active"),o.classList.add("active"),c.classList.remove("active"))};this._addEventHandler(a,"change",()=>{n=a.checked,h()}),h(),s.appendChild(o),s.appendChild(r),s.appendChild(c),t.appendChild(s);const u=document.createElement("span");u.className="domma-export-separator",t.appendChild(u);const p={text:{label:"Text",icon:la.html("clipboard",{size:16}),format:"text"},csv:{label:"CSV",icon:la.html("document",{size:16}),format:"csv"},excel:{label:"Excel",icon:la.html("grid",{size:16}),format:"excel"},json:{label:"JSON",icon:la.html("file-code",{size:16}),format:"json"}},m=e.exportOptions.map(e=>"copy"===e?"text":e);for(const e of m){const s=p[e];if(!s)continue;const o=document.createElement("button");o.type="button",o.className="domma-export-button",o.setAttribute("data-export",e),o.innerHTML=`${s.icon} ${s.label}`;const i=(e,t=!0)=>{const n=o.innerHTML;o.innerHTML=e,o.classList.add(t?"success":"error"),setTimeout(()=>{o.innerHTML=n,o.classList.remove("success","error")},1500)};this._addEventHandler(o,"click",()=>{const e=this.getSelected(),t=e.length>0?e.length:this._filteredData.length,o=e.length>0?` (${t} selected)`:` (${t} rows)`;if(n){const e="text"===s.format?"csv":s.format;this.download(e),i("✓ Downloaded!"+o)}else{const e="excel"===s.format?"text":s.format;this.copyToClipboard(e),i("✓ Copied!"+o)}}),t.appendChild(o)}i.appendChild(t)}(e.searchable||e.columnToggle||e.exportPanel)&&o.appendChild(i);const r=document.createElement("table");r.className=t.table,r.style.cssText="width: 100%; border-collapse: collapse;";const a=document.createElement("thead");a.className=t.header;const l=document.createElement("tr");if(e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("th");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); width: 40px;";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label","Select all rows"),t.checked=this._selected.size>0&&this._selected.size===s.length,t.disabled=this._loading,this._addEventHandler(t,"change",()=>{t.checked?this.selectAll():this.deselectAll()}),e.appendChild(t),l.appendChild(e)}for(const e of n){const n=document.createElement("th");n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-table-header-bg, var(--dm-background-alt, #f8f9fa)); text-align: left;",e.width&&(n.style.width="number"==typeof e.width?e.width+"px":e.width);const s=this._sorts.find(t=>t.column===e.key);if(s&&(n.classList.add(t.sorted),n.classList.add("asc"===s.direction?t.sortAsc:t.sortDesc)),e.sortable){n.style.cursor="pointer",n.tabIndex=0,n.setAttribute("aria-sort",s?"asc"===s.direction?"ascending":"descending":"none"),n.innerHTML=`${e.title} <span style="opacity: 0.5" aria-hidden="true">${s?"asc"===s.direction?"▲":"▼":"⇅"}</span>`;const t=()=>{const t=this._sorts.find(t=>t.column===e.key),n="asc"===t?.direction?"desc":"asc";this.sort(e.key,n)};this._addEventHandler(n,"click",t),this._addEventHandler(n,"keydown",e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),t())})}else n.textContent=e.title;l.appendChild(n)}a.appendChild(l),r.appendChild(a);const d=document.createElement("tbody");d.className=t.body;const h=e.rowKey;if(this._loading){const s=parseInt(e.loadingSkeleton,10),i=s>0?s:Math.min(this._pageSize||5,5),a=n.length+(e.selectable&&"multiple"===e.selectionMode?1:0);for(let e=0;e<i;e++){const n=document.createElement("tr");n.className=`${t.row} domma-table-skeleton-row`,n.setAttribute("aria-hidden","true");for(let s=0;s<a;s++){const o=document.createElement("td");o.className=t.cell,o.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const i=document.createElement("span");i.className="skeleton skeleton-text",i.style.width=`${[80,60,70,50][(e+s)%4]}%`,o.appendChild(i),n.appendChild(o)}d.appendChild(n)}r.setAttribute("aria-busy","true");const l=document.createElement("span");l.className="skeleton-status",l.setAttribute("role","status"),l.setAttribute("aria-live","polite"),o.appendChild(l),setTimeout(()=>{l.isConnected&&(l.textContent=e.loadingLabel)},100)}else e.loadingSkeleton&&r.setAttribute("aria-busy","false");if((this._loading?[]:s).forEach((s,o)=>{const i=document.createElement("tr");i.className=t.row;const r=this._getRowColors(o);if(i.style.background=r.background,e.hover&&r.hover){i.style.transition="background 0.2s";const e=r.background;this._addEventHandler(i,"mouseenter",()=>i.style.background=r.hover),this._addEventHandler(i,"mouseleave",()=>i.style.background=e)}if(this._selected.has(s[h])?(i.classList.add(t.selected),i.style.background="var(--dm-primary-light, #e3f2fd)",i.setAttribute("aria-selected","true")):e.selectable&&i.setAttribute("aria-selected","false"),e.selectable&&"multiple"===e.selectionMode){const e=document.createElement("td");e.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";const t=document.createElement("input");t.type="checkbox",t.setAttribute("aria-label",`Select row ${o+1}`),t.checked=this._selected.has(s[h]),this._addEventHandler(t,"change",()=>{this.toggleSelect(s[h])}),e.appendChild(t),i.appendChild(e)}e.selectable&&"single"===e.selectionMode&&(i.style.cursor="pointer",this._addEventHandler(i,"click",()=>{this.toggleSelect(s[h])}));for(const r of n){const n=document.createElement("td");n.className=t.cell,n.style.cssText="padding: 12px; border: 1px solid var(--dm-border, #ddd);";if(this._editingCell&&this._editingCell.rowIndex===o&&this._editingCell.column===r.key&&r.editable){const t=document.createElement("input");t.type="text",t.value=s[r.key]||"",t.style.cssText="width: 100%; padding: 4px; border: 1px solid var(--dm-primary, #007bff);",this._addEventHandler(t,"blur",()=>{this.updateRow(s[h],{[r.key]:t.value}),this.saveEdits(),e.onEdit&&e.onEdit({row:s,column:r.key,oldValue:s[r.key],newValue:t.value})}),this._addEventHandler(t,"keydown",e=>{"Enter"===e.key?t.blur():"Escape"===e.key&&this.cancelEdits()}),n.appendChild(t),setTimeout(()=>t.focus(),0)}else r.render?n.innerHTML=r.render(s[r.key],s,o):n.textContent=s[r.key]??"",r.editable&&e.editable&&(n.style.cursor="pointer",this._addEventHandler(n,"dblclick",()=>{this.editCell(o,r.key)}));i.appendChild(n)}d.appendChild(i)}),r.appendChild(d),o.appendChild(r),e.pagination&&!this._loading){const n=document.createElement("div");n.className=t.pagination,n.setAttribute("role","navigation"),n.setAttribute("aria-label","Table pagination"),n.style.cssText="display: flex; justify-content: space-between; align-items: center; margin-top: 15px; padding: 10px 0;";const s=this.pageInfo(),i=document.createElement("span");i.textContent=`Showing ${s.startRow}-${s.endRow} of ${s.totalRows}`;const r=document.createElement("span");r.innerHTML="Show ";const a=document.createElement("select");a.className="form-select",a.setAttribute("aria-label","Rows per page"),a.style.cssText="width: auto; display: inline-block; margin: 0 5px;";for(const t of e.pageSizeOptions){const e=document.createElement("option");e.value=t,e.textContent=t,t===this._pageSize&&(e.selected=!0),a.appendChild(e)}this._addEventHandler(a,"change",()=>{this.pageSize(Number(a.value))}),r.appendChild(a),r.appendChild(document.createTextNode(" entries"));const l=document.createElement("span");l.setAttribute("role","group"),l.setAttribute("aria-label","Pagination controls");const d=(e,t,n=!1,s=!1,o="")=>{const i=document.createElement("button");return i.type="button",o&&i.setAttribute("aria-label",o),s?i.innerHTML=e:i.textContent=e,i.disabled=n,n&&i.setAttribute("aria-disabled","true"),i.style.cssText="padding: 6px 12px; margin: 0 2px; border: 1px solid var(--dm-border, #ddd); background: var(--dm-surface, #fff); cursor: pointer; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center;",n&&(i.style.opacity="0.5"),this._addEventHandler(i,"click",t),i};l.appendChild(d(la.html("chevrons-left",{size:14}),()=>this.firstPage(),1===this._currentPage,!0,"First page")),l.appendChild(d(la.html("chevron-left",{size:14}),()=>this.prevPage(),1===this._currentPage,!0,"Previous page"));const c=5;let h=Math.max(1,this._currentPage-Math.floor(c/2)),u=Math.min(s.totalPages,h+c-1);h=Math.max(1,u-c+1);for(let e=h;e<=u;e++){const t=e===this._currentPage,n=d(e,()=>this.page(e),!1,!1,`Page ${e}`);t&&(n.setAttribute("aria-current","page"),n.style.background="var(--dm-primary, #007bff)",n.style.color="var(--dm-primary-text, #fff)",n.style.borderColor="var(--dm-primary, #007bff)"),l.appendChild(n)}l.appendChild(d(la.html("chevron-right",{size:14}),()=>this.nextPage(),this._currentPage===s.totalPages,!0,"Next page")),l.appendChild(d(la.html("chevrons-right",{size:14}),()=>this.lastPage(),this._currentPage===s.totalPages,!0,"Last page")),n.appendChild(r),n.appendChild(i),n.appendChild(l),o.appendChild(n)}return this.element.appendChild(o),this._reinitRenderedContent(),e.onRender&&e.onRender(this),this}_reinitRenderedContent(){try{la.scan(this.element)}catch{}const e="undefined"!=typeof window&&window.Domma&&window.Domma.elements&&window.Domma.elements.tooltip;"function"==typeof e&&this.element.querySelectorAll("[data-tooltip]").forEach(t=>{try{e(t,{position:"top",trigger:"hover",delay:{show:200,hide:0}})}catch{}})}_addEventHandler(e,t,n){e.addEventListener(t,n),this._eventListeners.has(e)||this._eventListeners.set(e,[]),this._eventListeners.get(e).push({event:t,handler:n})}_clearEventListeners(){for(const[e,t]of this._eventListeners)for(const{event:n,handler:s}of t)e.removeEventListener(n,s);this._eventListeners.clear()}_restoreIconsBeforeRebuild(){this.element.querySelectorAll('svg[data-icon-processed="true"][data-original-icon]').forEach(e=>{const t=e.getAttribute("data-original-icon");if(t){const n=document.createElement("span");n.setAttribute("data-icon",t);const s=e.getAttribute("data-icon-size"),o=e.getAttribute("data-icon-color")||e.getAttribute("data-icon-colour"),i=e.getAttribute("data-icon-class");s&&n.setAttribute("data-icon-size",s),o&&n.setAttribute("data-icon-colour",o),i&&n.setAttribute("data-icon-class",i),e.replaceWith(n)}})}on(e,t){if(["sort","filter","page","select","edit","render"].includes(e)){const n="on"+e.charAt(0).toUpperCase()+e.slice(1);this.options[n]=t}return this}off(e){const t="on"+e.charAt(0).toUpperCase()+e.slice(1);return this.options[t]=null,this}refresh(){return this._applyFiltersAndSort(),this.render(),this}destroy(){this._clearEventListeners(),this.element&&(this.element.innerHTML="")}}const ca={_instances:new Map,create(e,t={}){const n="string"==typeof e?document.querySelector(e):e,s=new da(n,t);return n&&this._instances.set(n,s),s},get(e){const t="string"==typeof e?document.querySelector(e):e;return this._instances.get(t)},destroy(e){const t="string"==typeof e?document.querySelector(e):e,n=this._instances.get(t);n&&(n.destroy(),this._instances.delete(t))},destroyAll(){for(const e of this._instances.values())e.destroy();this._instances.clear()}},ha=["fontFamily","fontSize","fontWeight","fontStyle","fontVariant","fontStretch","fontFeatureSettings","fontKerning","fontVariationSettings","lineHeight","letterSpacing","wordSpacing","textIndent","textAlign","textTransform","direction","tabSize","paddingTop","paddingRight","paddingBottom","paddingLeft","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth"],ua=new WeakMap,pa=new WeakMap,ma=new Set(["text","search","url","tel"]);function fa(e){return!!e&&!e.disabled&&!e.readOnly&&("TEXTAREA"===e.tagName||"INPUT"===e.tagName&&ma.has(e.type)||"true"===e.getAttribute?.("contenteditable")||""===e.getAttribute?.("contenteditable"))}const ga="domma:editor-caret",va="dm-editor-caret-preference";function ba(e=globalThis.window){try{const t=e.localStorage.getItem(ga);return["smooth","native"].includes(t)?t:"auto"}catch{return"auto"}}function ya(e){if(!fa(e))return{refresh(){},destroy(){}};const t=ua.get(e);if(t)return t;const n=e.ownerDocument,s=n.defaultView,o=e.parentElement,i="INPUT"!==e.tagName&&"TEXTAREA"!==e.tagName,r="INPUT"===e.tagName,a=()=>e.getRootNode().activeElement===e;if(!o||!s?.ResizeObserver||!s.matchMedia)return{refresh(){},destroy(){}};const l=s.matchMedia("(prefers-reduced-motion: reduce)"),d=s.matchMedia("(forced-colors: active)"),c=o.style.position,h="static"===s.getComputedStyle(o).position;h&&(o.style.position="relative");const u=n.createElement("div");u.setAttribute("aria-hidden","true"),u.style.cssText="position:fixed;left:-100000px;top:0;visibility:hidden;pointer-events:none;box-sizing:border-box;height:auto;min-height:0;border-style:solid;";const p=n.createTextNode(""),m=n.createElement("span");u.append(p,m),i||n.body.appendChild(u);const f=n.createElement("div");f.className="dm-smooth-caret-layer",f.setAttribute("aria-hidden","true"),f.style.cssText="position:absolute;overflow:hidden;pointer-events:none;z-index:3;display:none;";const g=n.createElement("span");g.className="dm-smooth-caret",g.style.cssText="position:absolute;top:0;left:0;width:2px;pointer-events:none;will-change:transform;",f.appendChild(g),o.appendChild(f);let v=null,b=null,y=null,_=!1,k=!1,w=!1,x=null,M=!0,L=null,C=ba(s);const E=[];function A(e,t,n,s){e.addEventListener(t,n,s),E.push(()=>e.removeEventListener(t,n,s))}function S(){f.style.display="none",x=null,clearTimeout(b),y?.cancel(),L&&(L.value?e.style.setProperty("caret-color",L.value,L.priority):e.style.removeProperty("caret-color"),L=null)}function $(){if(v=null,w)return;const t=i?n.getSelection():null,c=i?!t?.isCollapsed||!e.contains(t?.anchorNode):e.selectionStart!==e.selectionEnd,h="native"===C||"auto"===C&&l.matches;if(e.dataset.caretMode=d.matches?"forced-colors":h?"native"===C?"native":"system-reduced-motion":"smooth",!a()||!fa(e)||_||k||h||d.matches||c||!e.getClientRects().length)return void S();const E=s.getComputedStyle(e),A=e.getBoundingClientRect(),$=o.getBoundingClientRect();let z,T,j,B;if(i){const o=t.getRangeAt(0).cloneRange();let i=o.startContainer,r=1===i.nodeType?i:i.parentElement;if(1===i.nodeType){const e=i.childNodes[o.startOffset],t=i.childNodes[o.startOffset-1],a=e||t;if(a){const t=n.createTreeWalker(a,s.NodeFilter.SHOW_TEXT),l=[];if(3===a.nodeType&&a.length)l.push(a);else{let e;for(;e=t.nextNode();)e.length&&l.push(e)}const d=e?l[0]:l[l.length-1];d?(o.setStart(d,e?0:d.length),o.collapse(!0),i=d):1===a.nodeType&&"BR"!==a.tagName&&(r=a)}}let a=o.getClientRects()[0],l=!1;if((!a||!a.height)&&3===i.nodeType&&i.length){const e=o.startOffset;o.setStart(i,e>0?e-1:0),o.setEnd(i,e>0?e:1),a=o.getClientRects()[0],l=e>0}const d=1===i.nodeType?r:i.parentElement,c=s.getComputedStyle(d||e);if(B=parseFloat(c.lineHeight)||1.2*parseFloat(c.fontSize),j=a?.height||1.2*parseFloat(c.fontSize),a?.height)z=(l?a.right:a.left)-A.left,T=a.top-A.top;else{const t=(d||e).getBoundingClientRect();z=t.left-A.left+parseFloat(c.paddingLeft),T=t.top-A.top+parseFloat(c.paddingTop)}}else{for(const e of ha)u.style[e]=E[e];u.style.width=e.clientWidth+parseFloat(E.borderLeftWidth)+parseFloat(E.borderRightWidth)+"px",u.style.whiteSpace=r||"off"===e.wrap?"pre":"pre-wrap",u.style.overflowWrap=r||"off"===e.wrap?"normal":"break-word",p.data=e.value.slice(0,e.selectionStart),m.textContent=e.value.slice(e.selectionStart)||"";const t=m.getClientRects()[0];if(!t)return void S();const n=u.getBoundingClientRect();z=t.left-n.left-e.scrollLeft,B=parseFloat(E.lineHeight)||1.2*parseFloat(E.fontSize),j=Math.min(B,1.2*parseFloat(E.fontSize)),T=r?e.clientTop+(e.clientHeight-j)/2:t.top-n.top-e.scrollTop}if(z<e.clientLeft||z>e.clientLeft+e.clientWidth||T+j<e.clientTop||T>=e.clientTop+e.clientHeight)return void S();const D=L?L.color:E.caretColor;f.style.left=A.left-$.left+o.scrollLeft-o.clientLeft+"px",f.style.top=A.top-$.top+o.scrollTop-o.clientTop+"px",f.style.width=A.width+"px",f.style.height=A.height+"px",g.style.height=j+"px",g.style.background="auto"===D||"transparent"===D?E.color:D,g.style.transition=!M&&x&&Math.abs(T-x.y)<1.5*B?"transform 100ms cubic-bezier(.2,.7,.3,1)":"none",g.style.transform=`translate(${z}px, ${T}px)`,f.style.display="block",L||(L={value:e.style.getPropertyValue("caret-color"),priority:e.style.getPropertyPriority("caret-color"),color:D},e.style.setProperty("caret-color","transparent","important")),y?.cancel(),g.style.opacity="1",clearTimeout(b),b=setTimeout(()=>{!w&&"none"!==f.style.display&&g.animate&&(y=g.animate([{opacity:1},{opacity:0}],{duration:1e3,iterations:1/0,easing:"steps(2, jump-none)"}))},500),x={x:z,y:T},M=!1}function z(e=!1){w||(M||=e,null===v&&(v=s.requestAnimationFrame($)))}for(const t of["input","keyup","select","selectionchange"])A(e,t,()=>z());A(n,"selectionchange",()=>{a()&&z()}),A(e,"focus",()=>z(!0)),A(e,"blur",S),A(s,"blur",S),A(s,"focus",()=>z(!0)),A(e,"scroll",()=>z(!0),{passive:!0}),A(e,"pointerdown",()=>{k=!0,S()}),A(n,"pointerup",()=>{k&&(k=!1,z(!0))}),A(e,"compositionstart",()=>{_=!0,S()}),A(e,"compositionend",()=>{_=!1,z(!0)});const T=e=>{C=e.type===va?e.detail:ba(s),z(!0)};A(s,va,T),A(s,"storage",T),A(n,"pointercancel",()=>{k=!1,z(!0)}),A(l,"change",()=>z(!0)),A(d,"change",()=>z(!0));const j=new s.ResizeObserver(()=>z(!0));j.observe(e),z(!0);const B={refresh(){z(!0)},destroy(){if(!w){w=!0,ua.delete(e),S(),null!==v&&s.cancelAnimationFrame(v),j.disconnect();for(const e of E)e();delete e.dataset.caretMode,u.remove(),f.remove(),h&&(o.style.position=c)}}};return ua.set(e,B),B}const _a={attach:ya,install:function(e=globalThis.document){if(!e?.addEventListener)return{destroy(){}};const t=pa.get(e);if(t)return t;const n=e.ownerDocument||e;let s=null;const o=()=>{s?.api.destroy(),s=null,i?.disconnect()},i=n.defaultView?.MutationObserver?new n.defaultView.MutationObserver(()=>{s&&!s.element.isConnected&&o()}):null,r=e=>{const t=(e.composedPath?.()||[e.target]).find(fa);t&&s?.element!==t&&(o(),ua.has(t)||(s={element:t,api:ya(t)},i?.observe(n,{childList:!0,subtree:!0})))},a=e=>{s&&(e.composedPath?.()||[e.target]).includes(s.element)&&o()};e.addEventListener("focusin",r,!0),e.addEventListener("focusout",a,!0);const l=n.activeElement;l&&r({target:l,composedPath:()=>[l]});const d={destroy(){o(),e.removeEventListener("focusin",r,!0),e.removeEventListener("focusout",a,!0),pa.delete(e)}};return pa.set(e,d),d},getPreference:ba,setPreference:function(e,t=globalThis.window){const n=["smooth","native"].includes(e)?e:"auto";try{t.localStorage.setItem(ga,n)}catch{}t.dispatchEvent(new t.CustomEvent(va,{detail:n}))}},ka={apiUrl:null,token:null,user:null,config:{},eventHandlers:{},initialized:!1,init(e={}){this.config={apiUrl:e.apiUrl||(()=>{if("undefined"==typeof window)return"http://localhost:3000/api";const{hostname:e,origin:t}=window.location;return"localhost"===e||"127.0.0.1"===e?`http://${e}:3000/api`:`${t}/api`})(),storageKey:e.storageKey||"auth_token",userStorageKey:e.userStorageKey||"auth_user",autoCheck:!1!==e.autoCheck},this.apiUrl=this.config.apiUrl,this.token=Q.get(this.config.storageKey),this.user=Q.get(this.config.userStorageKey),this.config.autoCheck&&this.token&&this._verifyToken().catch(()=>{this._clearToken(),this.emit("tokenExpired",null)}),this.initialized=!0},async login(e,t){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const n=await d.post(`${this.apiUrl}/auth/login`,{email:e,password:t});if(!n.success||!n.token)throw new Error(n.message||"Login failed");return this.token=n.token,this.user=n.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("login",this.user),this.user}catch(e){throw this.emit("error",e.message||"Login failed"),e}},async register(e,t,n){if(!this.initialized)throw new Error("Auth module not initialized. Call auth.init() first.");try{const s=await d.post(`${this.apiUrl}/auth/register`,{email:e,password:t,name:n});if(!s.success||!s.token)throw new Error(s.message||"Registration failed");return this.token=s.token,this.user=s.user,this._storeToken(this.token),this._storeUser(this.user),this.emit("register",this.user),this.user}catch(e){throw this.emit("error",e.message||"Registration failed"),e}},logout(){this.token=null,this.user=null,this._clearToken(),this._clearUser(),this.emit("logout",null)},getUser(){return this.user},isAuthenticated(){return!!this.token&&!!this.user},getHeaders(){return this.token?{Authorization:`Bearer ${this.token}`}:{}},getApiUrl(){return this.apiUrl},getRole(){return this.user?.role||null},hasRole(e){return this.user?.role===e},hasAnyRole(e){return e.includes(this.user?.role)},isAdmin(){return"admin"===this.user?.role},isSubscriber(){return"subscriber"===this.user?.role},isGuest(){return"guest"===this.user?.role},async _verifyToken(){if(!this.token)throw new Error("No token to verify");try{const e=await d.get(`${this.apiUrl}/auth/me`,{headers:this.getHeaders(),silent:!0});if(!e.success||!e.user)throw new Error("Token verification failed");return this.user=e.user,this._storeUser(this.user),this.user}catch(e){throw this._clearToken(),this._clearUser(),e}},_storeToken(e){Q.set(this.config.storageKey,e)},_storeUser(e){Q.set(this.config.userStorageKey,e)},_clearToken(){Q.remove(this.config.storageKey),this.token=null},_clearUser(){Q.remove(this.config.userStorageKey),this.user=null},on(e,t){this.eventHandlers[e]||(this.eventHandlers[e]=[]),this.eventHandlers[e].push(t)},off(e,t){this.eventHandlers[e]&&(this.eventHandlers[e]=t?this.eventHandlers[e].filter(e=>e!==t):[])},emit(e,t){this.eventHandlers[e]&&this.eventHandlers[e].forEach(n=>{try{n(t)}catch(t){console.error(`Error in auth event handler for '${e}':`,t)}})}};class wa extends h{static defaults={emailPlaceholder:"your@email.com",passwordPlaceholder:"Enter your password",buttonText:"Login",showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-login-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n required>\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="email"]').value,n=e.querySelector('[name="password"]').value;this.options.onSubmit&&this.options.onSubmit(t,n);try{await ka.login(t,n),this.options.onSuccess&&this.options.onSuccess(ka.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}}class xa extends h{static defaults={namePlaceholder:"Your name",emailPlaceholder:"your@email.com",passwordPlaceholder:"Create a password",buttonText:"Register",minPasswordLength:6,showLabels:!0,onSubmit:null,onSuccess:null,onError:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();const e=this.element.querySelector("form");e&&this._addEventListener(e,"submit",async e=>{e.preventDefault(),await this.handleSubmit()})}render(){const e=this.options,t=`\n <form class="auth-register-form">\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Name</label>':""}\n <input\n type="text"\n class="form-input"\n name="name"\n placeholder="${e.namePlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Email</label>':""}\n <input\n type="email"\n class="form-input"\n name="email"\n placeholder="${e.emailPlaceholder}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="password"\n placeholder="${e.passwordPlaceholder}"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n <div class="form-group">\n ${e.showLabels?'<label class="form-label">Confirm Password</label>':""}\n <input\n type="password"\n class="form-input"\n name="confirmPassword"\n placeholder="Re-enter your password"\n minlength="${e.minPasswordLength}"\n required>\n </div>\n \x3c!-- Honeypot field - hidden from users, bots will fill it --\x3e\n <div class="form-group" style="position: absolute; left: -9999px; opacity: 0; pointer-events: none;" aria-hidden="true">\n <label for="website">Website</label>\n <input\n type="text"\n class="form-input"\n name="website"\n id="website"\n tabindex="-1"\n autocomplete="off">\n </div>\n <button type="submit" class="btn btn-primary btn-block" style="margin-top: 1rem;">${e.buttonText}</button>\n </form>\n `;this.element.innerHTML=t}async handleSubmit(){const e=this.element.querySelector("form"),t=e.querySelector('[name="name"]').value,n=e.querySelector('[name="email"]').value,s=e.querySelector('[name="password"]').value,o=e.querySelector('[name="confirmPassword"]').value;if(e.querySelector('[name="website"]').value)return console.warn("[Auth] Honeypot triggered - possible bot detected"),void(this.options.onError&&this.options.onError(new Error("Registration failed. Please try again.")));if(s===o){this.options.onSubmit&&this.options.onSubmit(n,s,t);try{await ka.register(n,s,t),this.options.onSuccess&&this.options.onSuccess(ka.getUser())}catch(e){this.options.onError&&this.options.onError(e)}}else this.options.onError&&this.options.onError(new Error("Passwords do not match. Please try again."))}}class Ma extends h{static defaults={activeTab:"login",loginText:"Login",registerText:"Register",onChange:null};constructor(e,t={}){super(e,t),this._init()}_init(){if(!this.element)return;this.render();this.element.querySelectorAll("[data-tab]").forEach(e=>{this._addEventListener(e,"click",()=>{this.switchTab(e.getAttribute("data-tab"))})})}render(){const e=this.options,t=`\n <div class="btn-group btn-group-block" style="margin-bottom: 1.5rem;">\n <button class="btn ${"login"===e.activeTab?"active":""}" data-tab="login">\n ${e.loginText}\n </button>\n <button class="btn ${"register"===e.activeTab?"active":""}" data-tab="register">\n ${e.registerText}\n </button>\n </div>\n `;this.element.innerHTML=t}switchTab(e){this.options.activeTab=e;this.element.querySelectorAll("[data-tab]").forEach(t=>{t.getAttribute("data-tab")===e?t.classList.add("active"):t.classList.remove("active")}),this.options.onChange&&this.options.onChange(e)}}class La extends h{static defaults={showIcon:!0,showRole:!0,logoutText:"Logout",onLogout:null};_init(){if(!this.element)return;this.render();const e=this.element.querySelector(".auth-logout-btn");e&&this._addEventListener(e,"click",()=>{this.handleLogout()}),ka.on("login",()=>this.render()),ka.on("logout",()=>this.render())}render(){const e=this.options,t=ka.getUser();if(!t)return void(this.element.innerHTML="");this.element.innerHTML="";const n=document.createElement("div");n.className="auth-user-info";const s=document.createElement("span");if(s.className="auth-user-email",e.showIcon){const e=document.createElement("span");e.setAttribute("data-icon","user"),e.setAttribute("data-icon-size","18"),s.appendChild(e)}const o=document.createTextNode(t.email);if(s.appendChild(o),!1!==e.showRole&&t.role){const e={admin:"badge-danger",subscriber:"badge-primary",guest:"badge-secondary"}[t.role]||"badge-secondary",n=document.createElement("span");n.className=`badge ${e}`,n.textContent=t.role.charAt(0).toUpperCase()+t.role.slice(1),s.appendChild(n)}const i=document.createElement("button");i.className="auth-logout-btn",i.textContent=e.logoutText,n.appendChild(s),n.appendChild(i),this.element.appendChild(n)}handleLogout(){ka.logout(),this.options.onLogout&&this.options.onLogout()}}ka.LoginForm=wa,ka.RegisterForm=xa,ka.AuthTabs=Ma,ka.UserInfo=La,ka.createLoginForm=(e,t)=>new wa(e,t),ka.createRegisterForm=(e,t)=>new xa(e,t),ka.createAuthTabs=(e,t)=>new Ma(e,t),ka.createUserInfo=(e,t)=>new La(e,t);const Ca={_routes:[],_views:{},_currentRoute:null,_container:null,_defaultRoute:"/",_notFoundView:null,_middleware:[],_transitioning:!1,_routing:!1,_missedChange:!1,_shownPath:null,_transitions:{},_initialised:!1,_templateCache:{},init(e={}){if(this._initialised)return console.warn("[Domma Router] Already initialised"),this;if(this._container=document.querySelector(e.container),!this._container)throw new Error(`[Domma Router] Container "${e.container}" not found`);return this._routes=e.routes||[],this._views=e.views||{},this._defaultRoute=e.default||"/",this._notFoundView=e.notFound||"404",this._transitions=e.transitions||{enter:"fadeIn",leave:"fadeOut",duration:200},window.addEventListener("hashchange",()=>this._handleRouteChange()),this._handleRouteChange(),this._initialised=!0,"undefined"!=typeof window&&window.M&&window.M.publish("router:ready",{router:this}),this},navigate(e,t={}){this._initialised?t.replace?window.location.replace(`#${e}`):window.location.hash=e:console.error("[Domma Router] Router not initialised. Call R.init() first.")},back(){window.history.back()},forward(){window.history.forward()},current(){return this._currentRoute},view(e,t){return this._views[e]=t,this},route(e){return this._routes.push(e),this},use(e){return this._middleware.push(e),this},destroy(){window.removeEventListener("hashchange",this._handleRouteChange),this._routes=[],this._views={},this._middleware=[],this._currentRoute=null,this._shownPath=null,this._routing=!1,this._missedChange=!1,this._initialised=!1},async _handleRouteChange(){if(this._routing||this._transitioning)this._missedChange=!0;else{this._routing=!0;try{await this._routeOnce();let e=0;for(;this._missedChange&&e<5;e++){this._missedChange=!1;const e=window.location.hash.slice(1)||this._defaultRoute;if(this._shownPath===e)break;await this._routeOnce()}this._missedChange&&e>=5&&setTimeout(()=>this._handleRouteChange(),0)}finally{this._routing=!1,this._missedChange=!1}}},async _routeOnce(){const e=window.location.hash.slice(1)||this._defaultRoute,{route:t,params:n}=this._matchRoute(e);if(!t){const t=await this._renderNotFound(e);return this._matchRoute(e).route||(this._shownPath=e),t}const s=this._currentRoute,o={...t,params:n,path:e};if(await this._runMiddleware(o,s)){if(s?.onLeave){if(!1===await s.onLeave())return}if("undefined"!=typeof window&&window.M&&window.M.publish("router:beforeChange",{from:s,to:o}),t.onEnter){if(!1===await t.onEnter(n))return}t.title&&(document.title=t.title),await this._renderView(t.view,n),this._currentRoute=o,this._shownPath=e,"undefined"!=typeof window&&window.M&&window.M.publish("router:afterChange",{from:s,to:o})}},_matchRoute(e){for(const t of this._routes){const n=this._extractParams(t.path,e);if(null!==n)return{route:t,params:n}}return{route:null,params:{}}},_extractParams(e,t){const n=e.split("/").filter(Boolean),s=t.split("/").filter(Boolean);if(n.length!==s.length)return null;const o={};for(let e=0;e<n.length;e++)if(n[e].startsWith(":"))o[n[e].slice(1)]=s[e];else if(n[e]!==s[e])return null;return o},async _runMiddleware(e,t){for(const n of this._middleware){let s=!1;const o=()=>{s=!0};if(await n(e,t,o),!s)return!1}return!0},async _renderView(e,t){this._transitioning=!0;const n=this._views[e];if(!n)return console.error(`[Domma Router] View "${e}" not found`),void(this._transitioning=!1);const s="undefined"!=typeof window&&window.$?window.$:null;if(!s)return console.error("[Domma Router] jQuery/Domma $ not found. Cannot animate transitions."),this._renderViewStatic(n,t),void(this._transitioning=!1);const o=s(this._container);await new Promise(e=>{o.fadeOut(this._transitions.duration,e)}),await this._renderContent(n,t,o),await new Promise(e=>{o.fadeIn(this._transitions.duration,e)}),this._transitioning=!1},async _loadTemplate(e){if(this._templateCache[e])return this._templateCache[e];try{const t=await fetch(e);if(!t.ok)throw new Error(`Failed to load template: ${e} (${t.status})`);const n=await t.text();return this._templateCache[e]=n,n}catch(e){throw console.error("[Domma Router] Template load error:",e),e}},async _renderContent(e,t,n){let s;if("object"==typeof e&&e.component&&!Array.isArray(e)){const s=e.component,o=n[0]||n,i="function"==typeof e.props?e.props(t):e.props||{},r=document.createElement(s);for(const[e,t]of Object.entries(i)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?r.setAttribute(n,""):!1!==t&&null!=t&&r.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;o.firstChild;)o.removeChild(o.firstChild);return o.appendChild(r),void("function"==typeof e.onMount&&e.onMount(n))}if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(s=await e(t),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container)):"string"==typeof e&&(s=this._renderTemplate(e,t),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container));else{let o=e.template;!o&&e.templateUrl&&(o=await this._loadTemplate(e.templateUrl));let i={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));i=Object.fromEntries(n)}"function"==typeof o?s=await o(t):"string"==typeof o&&(s=this._renderTemplate(o,t,i)),n.html(s,{safe:!1}),"undefined"!=typeof window&&window.I&&window.I.scan(this._container),e.onMount&&"function"==typeof e.onMount&&e.onMount(n)}},_renderTemplate:(e,t,n={})=>"undefined"!=typeof window&&window._&&"function"==typeof window._.render?window._.render(e,t||{},{partials:n}):e.replace(/\{\{(\w+)\}\}/g,(e,n)=>t[n]||""),async _renderViewStatic(e,t){if("object"==typeof e&&e.component&&!Array.isArray(e)){const n=e.component,s=this._container[0]||this._container,o="function"==typeof e.props?e.props(t):e.props||{},i=document.createElement(n);for(const[e,t]of Object.entries(o)){const n=e.replace(/([A-Z])/g,"-$1").toLowerCase();!0===t||""===t?i.setAttribute(n,""):!1!==t&&null!=t&&i.setAttribute(n,"object"==typeof t?JSON.stringify(t):String(t))}for(;s.firstChild;)s.removeChild(s.firstChild);return s.appendChild(i),"function"==typeof e.onMount&&e.onMount(this._container),void("undefined"!=typeof window&&window.I&&window.I.scan(s))}let n;if("object"!=typeof e||Array.isArray(e))"function"==typeof e?(n=await e(t),this._container.innerHTML=n):"string"==typeof e&&(n=this._renderTemplate(e,t),this._container.innerHTML=n);else{let s=e.template;!s&&e.templateUrl&&(s=await this._loadTemplate(e.templateUrl));let o={};if(e.partials){const t=Object.entries(e.partials),n=await Promise.all(t.map(([e,t])=>this._loadTemplate(t).then(t=>[e,t])));o=Object.fromEntries(n)}"function"==typeof s?n=await s(t):"string"==typeof s&&(n=this._renderTemplate(s,t,o)),this._container.innerHTML=n,e.onMount&&"function"==typeof e.onMount&&e.onMount(this._container)}"undefined"!=typeof window&&window.I&&window.I.scan(this._container)},async _renderNotFound(e){if(this._views[this._notFoundView])await this._renderView(this._notFoundView,{path:e});else{const t=this._container;t.textContent="";const n=document.createElement("div");n.style.cssText="text-align: center; padding: 4rem 1rem;";const s=document.createElement("h1");s.style.cssText="font-size: 4rem; margin-bottom: 1rem;",s.textContent="404";const o=document.createElement("p");o.style.cssText="font-size: 1.25rem; color: #666;",o.textContent=`Page not found: ${e}`;const i=document.createElement("a");i.href="#/",i.style.cssText="color: #3b82f6; text-decoration: underline; margin-top: 1rem; display: inline-block;",i.textContent="Go Home",n.appendChild(s),n.appendChild(o),n.appendChild(i),t.appendChild(n)}}},Ea=new Map,Aa=new Map;function Sa(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function $a(e,t={}){if(null==e)return void 0!==t.default?"function"==typeof t.default?t.default():t.default:null;const n=t.type;if(n===ur.types?.number||"number"===n){const t=Number(e);return isNaN(t)?null:t}if(n===ur.types?.boolean||"boolean"===n)return""===e||"true"===e||"false"!==e&&Boolean(e);if(n===ur.types?.array||"array"===n||n===ur.types?.object||"object"===n)try{return JSON.parse(e)}catch{return e}return e}function za(e,t){if(Aa.has(e))return void console.warn(`[Domma Component] "${e}" is already registered.`);const{template:n,templateUrl:s,props:o={},data:i,computed:r={},methods:a={},onBeforeMount:l,onMount:d,onUpdated:h,onBeforeUnmount:u,onUnmount:p,onPropsChanged:m,style:f=""}=t,g=Object.keys(o),v=g.map(Sa);class b extends yt{static get observedAttributes(){return v}constructor(){super(),this._model=null,this._props={},this._bindings=null,this._template=null,this._contentRoot=null,this._context=null,this._unsubs=[],this._computeds=new Map,this._effects=[],this._updateQueued=!1,this._teardown=!1}connectedCallback(){if(this._initialised)return this._teardown=!1,void d?.call(this._ctx());this._initialised=!0,this._initProps(),this._initModel(),this._initComputeds(),this._injectStyles(),this._contentRoot=document.createElement("div"),this._contentRoot.className="dm-component-root",this.shadowRoot.appendChild(this._contentRoot),l?.call(this._ctx()),this._renderComponent().then(()=>{this._wireBindings(),d?.call(this._ctx())})}disconnectedCallback(){this._teardown=!0,u?.call(this._ctx()),this._cleanup();for(const e of this._unsubs)e();this._unsubs=[];for(const e of this._effects)e.dispose();this._effects=[];for(const e of this._computeds.values())e.dispose();this._computeds.clear(),this._model&&this._model.destroy(),p?.call(this._ctx())}attributeChangedCallback(e,t,n){if(t===n)return;const s=e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase());if(this._props[s]=$a(n,o[s]),m?.call(this._ctx(),s,t,n),this._initialised&&this._bindings){for(const e of this._computeds.values())e.invalidate();this._rerenderFull()}}_initProps(){for(const e of g){const t=Sa(e),n=this.hasAttribute(t)?this.getAttribute(t):null;this._props[e]=$a(n,o[e])}}_initModel(){const e=i?i():{},t={};for(const n of Object.keys(e))t[n]={};this._model=ur.create(t,e)}_initComputeds(){for(const[e,t]of Object.entries(r))this._computeds.set(e,Cn(()=>t.call(this._ctx()),{label:e}))}async _renderComponent(){let e=n;!e&&s&&(e=await async function(e){if(Ea.has(e))return Ea.get(e);const t=await fetch(e);if(!t.ok)throw new Error(`[Domma Component] Failed to load template: ${e} (${t.status})`);const n=await t.text();return Ea.set(e,n),n}(s)),e?(this._template=e,this._bindings=Ki.compile(e,this._mergeData(),this._contentRoot,(e,t)=>c.render(e,t))):this._contentRoot.textContent=""}_rerenderFull(){this._bindings&&(this._bindings.rerenderAll(this._mergeData()),h?.call(this._ctx()))}_wireBindings(){if(this._bindings){for(const e of this._bindings.bindings){const t=[...e.deps].filter(e=>this._computeds.has(e)||!Object.prototype.hasOwnProperty.call(this._props,e));if(0===t.length)continue;let n=!1;const s=En(()=>{for(const e of t)this._readBound(e);n?An(()=>{this._bindings.update(e.id,this._mergeData()),this._scheduleUpdate()}):n=!0},{label:`${this.tagName.toLowerCase()}:${e.id}`});this._effects.push(s)}this._wireUpdateWatcher()}}_wireUpdateWatcher(){if(!h||!this._model)return;let e=!1;const t=En(()=>{this._model.get(),e?An(()=>this._scheduleUpdate()):e=!0},{label:`${this.tagName.toLowerCase()}:updated`});this._effects.push(t)}_readBound(e){return this._computeds.has(e)?this._computeds.get(e).get():Object.prototype.hasOwnProperty.call(this._props,e)?this._props[e]:this._model?this._model.get(e):void 0}_scheduleUpdate(){this._updateQueued||(this._updateQueued=!0,Promise.resolve().then(()=>{this._updateQueued=!1,!this._teardown&&this._initialised&&this._bindings&&h?.call(this._ctx())}))}_getStyles(){return"\n :host {\n --dm-primary: var(--dm-primary, #6495ED);\n --dm-secondary: var(--dm-secondary, #6c757d);\n --dm-success: var(--dm-success, #28a745);\n --dm-danger: var(--dm-danger, #dc3545);\n --dm-warning: var(--dm-warning, #ffc107);\n --dm-info: var(--dm-info, #17a2b8);\n --dm-white: var(--dm-white, #ffffff);\n --dm-gray-100: var(--dm-gray-100, #f8f9fa);\n --dm-gray-200: var(--dm-gray-200, #e9ecef);\n --dm-gray-300: var(--dm-gray-300, #dee2e6);\n --dm-gray-400: var(--dm-gray-400, #ced4da);\n --dm-gray-500: var(--dm-gray-500, #adb5bd);\n --dm-gray-600: var(--dm-gray-600, #6c757d);\n --dm-gray-700: var(--dm-gray-700, #495057);\n --dm-gray-800: var(--dm-gray-800, #343a40);\n --dm-gray-900: var(--dm-gray-900, #212529);\n --dm-radius-sm: var(--dm-radius-sm, 0.25rem);\n --dm-radius-md: var(--dm-radius-md, 0.375rem);\n --dm-radius-lg: var(--dm-radius-lg, 0.5rem);\n --dm-radius-full: var(--dm-radius-full, 9999px);\n --dm-transition-fast: var(--dm-transition-fast, 150ms);\n --dm-transition-normal: var(--dm-transition-normal, 300ms);\n --dm-transition-slow: var(--dm-transition-slow, 500ms);\n --dm-shadow-sm: var(--dm-shadow-sm, 0 1px 2px 0 rgba(0, 0, 0, 0.05));\n --dm-shadow-md: var(--dm-shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.1));\n --dm-shadow-lg: var(--dm-shadow-lg, 0 10px 15px -3px rgba(0, 0, 0, 0.1));\n --dm-shadow-xl: var(--dm-shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.1));\n }\n "+(f||"")}_ctx(){if(this._context)return this._context;const e=this,t={get data(){return e._model?e._model.tracked():{}},get props(){return{...e._props}},get root(){return e.shadowRoot},get el(){return e},set(t){e._model&&e._model.set(t)}};for(const[n,s]of Object.entries(r))Object.defineProperty(t,n,{get(){const t=e._computeds.get(n);return t?t.get():s.call(e._ctx())},enumerable:!0,configurable:!0});for(const[e,n]of Object.entries(a))t[e]=n.bind(t);return this._context=t,t}_mergeData(){const e=this._model?this._model.toJSON():{},t={};for(const[e,n]of this._computeds.entries())t[e]=n.get();const n={},s=this._ctx();for(const e of Object.keys(a))n[e]=s[e];const o={...n,...e,...this._props,...t},i=this._model;return dn(o,{onWrite:i?(e,t)=>i.set({[e]:t}):void 0})}}const y=e.includes("-")?e:`domma-${e}`;return customElements.define(y,b),Aa.set(e,t),b}const Ta={define:(e,t)=>za(e,t),has:e=>Aa.has(e),registry:()=>new Map(Aa),get templateCache(){return Ea}},ja={"domma-badge":kt,"domma-tooltip":xt,"domma-loader":Mt,"domma-back-to-top":Lt,"domma-toast":Ct,"domma-modal":Et,"domma-card":At};function Ba(){for(const[e,t]of Object.entries(ja))customElements.get(e)||customElements.define(e,t)}Ba(),Ba();let Da=!0;"undefined"!=typeof document&&document.body?document.body.classList.add("dm-cloaked"):"undefined"!=typeof document&&document.addEventListener("DOMContentLoaded",()=>{Da&&document.body.classList.add("dm-cloaked")});const Wa=(e,t)=>l(e,t);Wa.version="0.53.0",Wa.buildInfo={version:"0.53.0",built:"15/10/2026 22:10",commit:"e15cc27"},Wa.http=d,Wa.utils=c,Wa.setup=e=>(!1===e.cloak&&(Da=!1,"undefined"!=typeof document&&document.body&&(document.body.classList.remove("dm-cloaked"),document.body.classList.add("dm-ready"))),e.noStyles?b.init({disabled:!0}):(e.theme||e.autoDetectTheme)&&b.init({theme:e.theme,autoDetect:e.autoDetectTheme,persist:!1!==e.persistTheme}),e.scanIcons&&la.scan(),Er.process(e)),Wa.update=(e,t)=>Er.update(e,t),Wa.config=e=>Er.config(e),Wa.getComponent=e=>Er.getComponent(e),Wa.reset=e=>Er.reset(e),Wa.ready=e=>Er.ready(e),Wa.models=ur,Wa.elements=ln,Wa.effects=Cr,Wa.dates=Or,Wa.tables=ca,Wa.forms=mr,Wa.smoothCaret=_a,Wa.theme=b,Wa.icons=la,Wa.storage=Q,Wa.auth=ka,Wa.router=Ca,Wa.sanitize=r,Wa.components=Ta,Wa.component=(e,t)=>za(e,t),Wa.DesktopNotification=Ot;const Ha=Wa,Oa=c,Ia=ur,Na=Or,Pa=Q,Va=ka,Fa=mr,Ra=d,qa=ln,Ua=la,Ka=ca,Ya=Ca,Ga={extend:ur.extend.bind(ur),pick:ur.pick.bind(ur),omit:ur.omit.bind(ur)};if(Wa.M=Ia,Wa.D=Na,Wa.S=Pa,Wa.A=Va,Wa.F=Fa,Wa.H=Ra,Wa.E=qa,Wa.I=Ua,Wa.T=Ka,Wa.R=Ya,Wa.B=Ga,"undefined"!=typeof window&&(window.Domma=Wa,window.$=Ha,window._=Oa,window.M=Ia,window.D=Na,window.S=Pa,window.A=Va,window.F=Fa,window.H=Ra,window.E=qa,window.I=Ua,window.T=Ka,window.R=Ya,window.B=Ga),"undefined"!=typeof document){const e=()=>{Da&&document.body.classList.contains("dm-cloaked")&&document.body.classList.add("dm-ready")};"complete"===document.readyState?setTimeout(e,0):window.addEventListener("load",e)}e.$=Ha,e.A=Va,e.B=Ga,e.D=Na,e.Domma=Wa,e.E=qa,e.F=Fa,e.H=Ra,e.I=Ua,e.M=Ia,e.R=Ya,e.S=Pa,e.T=Ka,e._=Oa,e.components=Ta,e.default=Wa,e.smoothCaret=_a,Object.defineProperty(e,"__esModule",{value:!0})});
|