@nodex.ui/core 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,56 +7,67 @@
7
7
  /* Vendored from @odoo/owl@2.8.3's dist/owl.iife.min.js, patched to key off globalThis instead of top-level `this` (safe in both classic scripts and ES modules) — see scripts/build.mjs and src/owl/owl-dev-shim.js. */
8
8
  !function(t){"use strict";function e(t){t=t.slice();const e=[];let n;for(;(n=t[0])&&"string"==typeof n;)e.push(t.shift());return{modifiers:e,data:t}}const n={shouldNormalizeDom:!0,mainEventHandler:(t,n,o)=>("function"==typeof t?t(n):Array.isArray(t)&&(t=e(t).data)[0](t[1],n),!1)};class o{constructor(t,e){this.key=t,this.child=e}mount(t,e){this.parentEl=t,this.child.mount(t,e)}moveBeforeDOMNode(t,e){this.child.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.moveBeforeDOMNode(t&&t.firstNode()||e)}patch(t,e){if(this===t)return;let n=this.child,o=t.child;this.key===t.key?n.patch(o,e):(o.mount(this.parentEl,n.firstNode()),e&&n.beforeRemove(),n.remove(),this.child=o,this.key=t.key)}beforeRemove(){this.child.beforeRemove()}remove(){this.child.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}function s(t,e){return new o(t,e)}class r extends Error{}let i,l,a,c;if("undefined"!=typeof Element){({setAttribute:i,removeAttribute:l}=Element.prototype);const t=DOMTokenList.prototype;a=t.add,c=t.remove}const h=Array.isArray,{split:u,trim:d}=String.prototype,f=/\s+/;function p(t,e){switch(e){case!1:case void 0:l.call(this,t);break;case!0:i.call(this,t,"");break;default:i.call(this,t,e)}}function m(t){return function(e){p.call(this,t,e)}}function g(t){if(h(t))"class"===t[0]?y.call(this,t[1]):p.call(this,t[0],t[1]);else for(let e in t)"class"===e?y.call(this,t[e]):p.call(this,e,t[e])}function b(t,e){if(h(t)){const n=t[0],o=t[1];if(n===e[0]){if(o===e[1])return;"class"===n?w.call(this,o,e[1]):p.call(this,n,o)}else l.call(this,e[0]),p.call(this,n,o)}else{for(let n in e)n in t||("class"===n?w.call(this,"",e[n]):l.call(this,n));for(let n in t){const o=t[n];o!==e[n]&&("class"===n?w.call(this,o,e[n]):p.call(this,n,o))}}}function v(t){const e={};switch(typeof t){case"string":const n=d.call(t);if(!n)return{};let o=u.call(n,f);for(let t=0,n=o.length;t<n;t++)e[o[t]]=!0;return e;case"object":for(let n in t){const o=t[n];if(o){if(n=d.call(n),!n)continue;const t=u.call(n,f);for(let n of t)e[n]=o}}return e;case"undefined":return{};case"number":return{[t]:!0};default:return{[t]:!0}}}function y(t){t=""===t?{}:v(t);const e=this.classList;for(let n in t)a.call(e,n)}function w(t,e){e=""===e?{}:v(e),t=""===t?{}:v(t);const n=this.classList;for(let o in e)o in t||c.call(n,o);for(let o in t)o in e||a.call(n,o)}function $(t){let e=!1;return async(...n)=>{e||(e=!0,await Promise.resolve(),e=!1,t(...n))}}function x(t){if(!t)return!1;if(t.ownerDocument.contains(t))return!0;const e=t.getRootNode();return e instanceof ShadowRoot&&t.ownerDocument.contains(e.host)}class N extends EventTarget{trigger(t,e){this.dispatchEvent(new CustomEvent(t,{detail:e}))}}class k extends String{}function T(t){return t instanceof k?t:void 0===t?E(""):"number"==typeof t?E(String(t)):([["&","&amp;"],["<","&lt;"],[">","&gt;"],["'","&#x27;"],['"',"&quot;"],["`","&#x60;"]].forEach((e=>{t=String(t).replace(new RegExp(e[0],"g"),e[1])})),E(t))}function E(t,...e){if(!Array.isArray(t))return new k(t);const n=t;let o="",s=0;for(;s<e.length;++s)o+=n[s]+T(e[s]);return o+=n[s],new k(o)}function A(t){const e=t.split(".")[0],o=t.includes(".capture");return t.includes(".synthetic")?function(t,e=!1){let o=`__event__synthetic_${t}`;e&&(o=`${o}_capture`);!function(t,e,o=!1){if(D[e])return;document.addEventListener(t,(t=>function(t,e){let o=e.target;for(;null!==o;){const s=o[t];if(s)for(const t of Object.values(s)){if(n.mainEventHandler(t,e,o))return}o=o.parentNode}}(e,t)),{capture:o}),D[e]=!0}(t,o,e);const s=C++;function r(t){const e=this[o]||{};e[s]=t,this[o]=e}function i(){delete this[o]}return{setup:r,update:r,remove:i}}(e,o):function(t,e=!1){let o=`__event__${t}_${_++}`;e&&(o=`${o}_capture`);function s(t){const e=t.currentTarget;if(!e||!x(e))return;const s=e[o];s&&n.mainEventHandler(s,t,e)}function r(n){this[o]=n,this.addEventListener(t,s,{capture:e})}function i(){delete this[o],this.removeEventListener(t,s,{capture:e})}function l(t){this[o]=t}return{setup:r,update:l,remove:i}}(e,o)}let _=1;let C=1;const D={};let S,O,R;if("undefined"!=typeof Node){const t=Node.prototype;S=t.insertBefore,O=(L=t,B="textContent",Object.getOwnPropertyDescriptor(L,B)).set,R=t.removeChild}var L,B;class P{constructor(t){this.children=t}mount(t,e){const n=this.children,o=n.length,s=new Array(o);for(let r=0;r<o;r++){let o=n[r];if(o)o.mount(t,e);else{const n=document.createTextNode("");s[r]=n,S.call(t,n,e)}}this.anchors=s,this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children,o=this.anchors;for(let s=0,r=n.length;s<r;s++){let r=n[s];if(r)r.moveBeforeDOMNode(t,e);else{const n=o[s];S.call(e,n,t)}}}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchors[0])||null}const n=this.children,o=this.parentEl,s=this.anchors;for(let t=0,r=n.length;t<r;t++){let r=n[t];if(r)r.moveBeforeVNode(null,e);else{const n=s[t];S.call(o,n,e)}}}patch(t,e){if(this===t)return;const n=this.children,o=t.children,s=this.anchors,r=this.parentEl;for(let t=0,i=n.length;t<i;t++){const i=n[t],l=o[t];if(i)if(l)i.patch(l,e);else{const o=i.firstNode(),l=document.createTextNode("");s[t]=l,S.call(r,l,o),e&&i.beforeRemove(),i.remove(),n[t]=void 0}else if(l){n[t]=l;const e=s[t];l.mount(r,e),R.call(r,e)}}}beforeRemove(){const t=this.children;for(let e=0,n=t.length;e<n;e++){const n=t[e];n&&n.beforeRemove()}}remove(){const t=this.parentEl;if(this.isOnlyChild)O.call(t,"");else{const e=this.children,n=this.anchors;for(let o=0,s=e.length;o<s;o++){const s=e[o];s?s.remove():R.call(t,n[o])}}}firstNode(){const t=this.children[0];return t?t.firstNode():this.anchors[0]}toString(){return this.children.map((t=>t?t.toString():"")).join("")}}function j(t){return new P(t)}let M,I,W;if("undefined"!=typeof Node){const t=Node.prototype;M=t.insertBefore,W=t.removeChild,I=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(CharacterData.prototype,"data").set}class V{constructor(t){this.text=t}mountNode(t,e,n){this.parentEl=e,M.call(e,t,n),this.el=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,M.call(e,this.el,t)}moveBeforeVNode(t,e){M.call(this.parentEl,this.el,t?t.el:e)}beforeRemove(){}remove(){W.call(this.parentEl,this.el)}firstNode(){return this.el}toString(){return this.text}}class F extends V{mount(t,e){this.mountNode(document.createTextNode(U(this.text)),t,e)}patch(t){const e=t.text;this.text!==e&&(I.call(this.el,U(e)),this.text=e)}}class K extends V{mount(t,e){this.mountNode(document.createComment(U(this.text)),t,e)}patch(){}}function z(t){return new F(t)}function H(t){return new K(t)}function U(t){switch(typeof t){case"string":return t;case"number":return String(t);case"boolean":return t?"true":"false";default:return t||""}}const q=(t,e)=>Object.getOwnPropertyDescriptor(t,e);let G,X,Y,Z,J;"undefined"!=typeof Node&&(G=Node.prototype,X=Element.prototype,Y=q(CharacterData.prototype,"data").set,Z=q(G,"firstChild").get,J=q(G,"nextSibling").get);const Q=()=>{};function tt(t){return function(e){this[t]=0===e?0:e?e.valueOf():""}}const et={};function nt(t){if(t in et)return et[t];const e=(new DOMParser).parseFromString(`<t>${t}</t>`,"text/xml").firstChild.firstChild;n.shouldNormalizeDom&&ot(e);const o=st(e),s=lt(o),r=function(t,e){let n=function(t,e){const{refN:n,collectors:o,children:s}=e,r=o.length;e.locations.sort(((t,e)=>t.idx-e.idx));const i=e.locations.map((t=>({refIdx:t.refIdx,setData:t.setData,updateData:t.updateData}))),l=i.length,a=s.length,c=s,h=n>0,u=G.cloneNode,d=G.insertBefore,f=X.remove;class p{constructor(t){this.data=t}beforeRemove(){}remove(){f.call(this.el)}firstNode(){return this.el}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,d.call(e,this.el,t)}moveBeforeVNode(t,e){d.call(this.parentEl,this.el,t?t.el:e)}toString(){const t=document.createElement("div");return this.mount(t,null),t.innerHTML}mount(e,n){const o=u.call(t,!0);d.call(e,o,n),this.el=o,this.parentEl=e}patch(t,e){}}h&&(p.prototype.mount=function(e,s){const h=u.call(t,!0),f=new Array(n);this.refs=f,f[0]=h;for(let t=0;t<r;t++){const e=o[t];f[e.idx]=e.getVal.call(f[e.prevIdx])}if(l){const t=this.data;for(let e=0;e<l;e++){const n=i[e];n.setData.call(f[n.refIdx],t[e])}}if(d.call(e,h,s),a){const t=this.children;for(let e=0;e<a;e++){const n=t[e];if(n){const t=c[e],o=t.afterRefIdx?f[t.afterRefIdx]:null;n.isOnlyChild=t.isOnlyChild,n.mount(f[t.parentRefIdx],o)}}}this.el=h,this.parentEl=e},p.prototype.patch=function(t,e){if(this===t)return;const n=this.refs;if(l){const e=this.data,o=t.data;for(let t=0;t<l;t++){const s=e[t],r=o[t];if(s!==r){const e=i[t];e.updateData.call(n[e.refIdx],r,s)}}this.data=o}if(a){let o=this.children;const s=t.children;for(let t=0;t<a;t++){const r=o[t],i=s[t];if(r)i?r.patch(i,e):(e&&r.beforeRemove(),r.remove(),o[t]=void 0);else if(i){const e=c[t],s=e.afterRefIdx?n[e.afterRefIdx]:null;i.mount(n[e.parentRefIdx],s),o[t]=i}}}});return p}(t,e);if(e.cbRefs.length){const t=e.cbRefs,o=e.refList;let s=t.length;n=class extends n{mount(t,e){o.push(new Array(s)),super.mount(t,e);for(let t of o.pop())t()}remove(){super.remove();for(let e of t){(0,this.data[e])(null)}}}}if(e.children.length)return n=class extends n{constructor(t,e){super(t),this.children=e}},n.prototype.beforeRemove=P.prototype.beforeRemove,(t,e=[])=>new n(t,e);return t=>new n(t)}(o.el,s);return et[t]=r,r}function ot(t){if(t.nodeType!==Node.TEXT_NODE||/\S/.test(t.textContent)){if(t.nodeType!==Node.ELEMENT_NODE||"pre"!==t.tagName)for(let e=t.childNodes.length-1;e>=0;--e)ot(t.childNodes.item(e))}else t.remove()}function st(t,e=null,n=null){switch(t.nodeType){case Node.ELEMENT_NODE:{let o=n&&n.currentNS;const s=t.tagName;let r;const i=[];if(s.startsWith("block-text-")){const t=parseInt(s.slice(11),10);i.push({type:"text",idx:t}),r=document.createTextNode("")}if(s.startsWith("block-child-")){n.isRef||rt(n);const t=parseInt(s.slice(12),10);i.push({type:"child",idx:t}),r=document.createTextNode("")}if(o||(o=t.namespaceURI),r||(r=o?document.createElementNS(o,s):document.createElement(s)),r instanceof Element){if(!n){document.createElement("template").content.appendChild(r)}const e=t.attributes;for(let t=0;t<e.length;t++){const n=e[t].name,o=e[t].value;if(n.startsWith("block-handler-")){const t=parseInt(n.slice(14),10);i.push({type:"handler",idx:t,event:o})}else if(n.startsWith("block-attribute-")){const t=parseInt(n.slice(16),10);i.push({type:"attribute",idx:t,name:o,tag:s})}else if(n.startsWith("block-property-")){const t=parseInt(n.slice(15),10);i.push({type:"property",idx:t,name:o,tag:s})}else"block-attributes"===n?i.push({type:"attributes",idx:parseInt(o,10)}):"block-ref"===n?i.push({type:"ref",idx:parseInt(o,10)}):r.setAttribute(e[t].name,o)}}const l={parent:e,firstChild:null,nextSibling:null,el:r,info:i,refN:0,currentNS:o};if(t.firstChild){const e=t.childNodes[0];if(1===t.childNodes.length&&e.nodeType===Node.ELEMENT_NODE&&e.tagName.startsWith("block-child-")){const t=e.tagName,n=parseInt(t.slice(12),10);i.push({idx:n,type:"child",isOnlyChild:!0})}else{l.firstChild=st(t.firstChild,l,l),r.appendChild(l.firstChild.el);let e=t.firstChild,n=l.firstChild;for(;e=e.nextSibling;)n.nextSibling=st(e,n,l),r.appendChild(n.nextSibling.el),n=n.nextSibling}}return l.info.length&&rt(l),l}case Node.TEXT_NODE:case Node.COMMENT_NODE:return{parent:e,firstChild:null,nextSibling:null,el:t.nodeType===Node.TEXT_NODE?document.createTextNode(t.textContent):document.createComment(t.textContent),info:[],refN:0,currentNS:null}}throw new r("boom")}function rt(t){t.isRef=!0;do{t.refN++}while(t=t.parent)}function it(t){let e=t.parent;for(;e&&e.nextSibling===t;)t=e,e=e.parent;return e}function lt(t,e,n){if(!e){e={collectors:[],locations:[],children:new Array(t.info.filter((t=>"child"===t.type)).length),cbRefs:[],refN:t.refN,refList:[]},n=0}if(t.refN){const o=n,s=t.isRef,r=t.firstChild?t.firstChild.refN:0,i=t.nextSibling?t.nextSibling.refN:0;if(s){for(let e of t.info)e.refIdx=o;t.refIdx=o,function(t,e){for(let n of e.info)switch(n.type){case"text":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:at,updateData:at});break;case"child":n.isOnlyChild?t.children[n.idx]={parentRefIdx:n.refIdx,isOnlyChild:!0}:t.children[n.idx]={parentRefIdx:it(e).refIdx,afterRefIdx:n.refIdx};break;case"property":{const e=n.refIdx,o=tt(n.name);t.locations.push({idx:n.idx,refIdx:e,setData:o,updateData:o});break}case"attribute":{const e=n.refIdx;let o,s;"class"===n.name?(s=y,o=w):(s=m(n.name),o=s),t.locations.push({idx:n.idx,refIdx:e,setData:s,updateData:o});break}case"attributes":t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:g,updateData:b});break;case"handler":{const{setup:e,update:o}=A(n.event);t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:e,updateData:o});break}case"ref":const o=t.cbRefs.push(n.idx)-1;t.locations.push({idx:n.idx,refIdx:n.refIdx,setData:ct(o,t.refList),updateData:Q})}}(e,t),n++}if(i){const s=n+r;e.collectors.push({idx:s,prevIdx:o,getVal:J}),lt(t.nextSibling,e,s)}r&&(e.collectors.push({idx:n,prevIdx:o,getVal:Z}),lt(t.firstChild,e,n))}return e}function at(t){Y.call(this,U(t))}function ct(t,e){return function(n){e[e.length-1][t]=()=>n(this)}}let ht,ut,dt,ft,pt,mt;if("undefined"!=typeof Node){const t=Node.prototype;ht=t.insertBefore,ut=t.appendChild,dt=t.removeChild,ft=((t,e)=>Object.getOwnPropertyDescriptor(t,e))(t,"textContent").set}class gt{constructor(t){this.children=t}mount(t,e){const n=this.children,o=document.createTextNode("");this.anchor=o,ht.call(t,o,e);const s=n.length;if(s){const e=n[0].mount;for(let r=0;r<s;r++)e.call(n[r],t,o)}this.parentEl=t}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;const n=this.children;for(let o=0,s=n.length;o<s;o++)n[o].moveBeforeDOMNode(t,e);e.insertBefore(this.anchor,t)}moveBeforeVNode(t,e){if(t){const n=t.children[0];e=(n?n.firstNode():t.anchor)||null}const n=this.children;for(let t=0,o=n.length;t<o;t++)n[t].moveBeforeVNode(null,e);this.parentEl.insertBefore(this.anchor,e)}patch(t,e){if(this===t)return;const n=this.children,o=t.children;if(0===o.length&&0===n.length)return;this.children=o;const s=o[0]||n[0],{mount:r,patch:i,remove:l,beforeRemove:a,moveBeforeVNode:c,firstNode:h}=s,u=this.anchor,d=this.isOnlyChild,f=this.parentEl;if(0===o.length&&d){if(e)for(let t=0,e=n.length;t<e;t++)a.call(n[t]);return ft.call(f,""),void ut.call(f,u)}let p,m=0,g=0,b=n[0],v=o[0],y=n.length-1,w=o.length-1,$=n[y],x=o[w];for(;m<=y&&g<=w;){if(null===b){b=n[++m];continue}if(null===$){$=n[--y];continue}let t=b.key,s=v.key;if(t===s){i.call(b,v,e),o[g]=b,b=n[++m],v=o[++g];continue}let l=$.key,a=x.key;if(l===a){i.call($,x,e),o[w]=$,$=n[--y],x=o[--w];continue}if(t===a){i.call(b,x,e),o[w]=b;const t=o[w+1];c.call(b,t,u),b=n[++m],x=o[--w];continue}if(l===s){i.call($,v,e),o[g]=$;const t=n[m];c.call($,t,u),$=n[--y],v=o[++g];continue}p=p||vt(n,m,y);let d=p[s];if(void 0===d)r.call(v,f,h.call(b)||null);else{const t=n[d];c.call(t,b,null),i.call(t,v,e),o[g]=t,n[d]=null}v=o[++g]}if(m<=y||g<=w)if(m>y){const t=o[w+1],e=t?h.call(t)||null:u;for(let t=g;t<=w;t++)r.call(o[t],f,e)}else for(let t=m;t<=y;t++){let o=n[t];o&&(e&&a.call(o),l.call(o))}}beforeRemove(){const t=this.children,e=t.length;if(e){const n=t[0].beforeRemove;for(let o=0;o<e;o++)n.call(t[o])}}remove(){const{parentEl:t,anchor:e}=this;if(this.isOnlyChild)ft.call(t,"");else{const n=this.children,o=n.length;if(o){const t=n[0].remove;for(let e=0;e<o;e++)t.call(n[e])}dt.call(t,e)}}firstNode(){const t=this.children[0];return t?t.firstNode():void 0}toString(){return this.children.map((t=>t.toString())).join("")}}function bt(t){return new gt(t)}function vt(t,e,n){let o={};for(let s=e;s<=n;s++)o[t[s].key]=s;return o}if("undefined"!=typeof Node){const t=Node.prototype;pt=t.insertBefore,mt=t.removeChild}class yt{constructor(t){this.content=[],this.html=t}mount(t,e){this.parentEl=t;const n=document.createElement("template");n.innerHTML=this.html,this.content=[...n.content.childNodes];for(let n of this.content)pt.call(t,n,e);if(!this.content.length){const n=document.createTextNode("");this.content.push(n),pt.call(t,n,e)}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e;for(let n of this.content)pt.call(e,n,t)}moveBeforeVNode(t,e){const n=t?t.content[0]:e;this.moveBeforeDOMNode(n)}patch(t){if(this===t)return;const e=t.html;if(this.html!==e){const n=this.parentEl,o=this.content[0],s=document.createElement("template");s.innerHTML=e;const r=[...s.content.childNodes];for(let t of r)pt.call(n,t,o);if(!r.length){const t=document.createTextNode("");r.push(t),pt.call(n,t,o)}this.remove(),this.content=r,this.html=t.html}}beforeRemove(){}remove(){const t=this.parentEl;for(let e of this.content)mt.call(t,e)}firstNode(){return this.content[0]}toString(){return this.html}}function wt(t){return new yt(t)}function $t(t,e,n=null){t.mount(e,n)}const xt=new WeakMap,Nt=new WeakMap;function kt(t,e){if(!t)return!1;const n=t.fiber;n&&xt.set(n,e);const o=Nt.get(t);if(o){let t=!1;for(let n=o.length-1;n>=0;n--)try{o[n](e),t=!0;break}catch(t){e=t}if(t)return!0}return kt(t.parent,e)}function Tt(t){let{error:e}=t;e instanceof r||(e=Object.assign(new r('An error occured in the owl lifecycle (see this Error\'s "cause" property)'),{cause:e}));const n="node"in t?t.node:t.fiber.node,o="fiber"in t?t.fiber:n.fiber;if(o){let t=o;do{t.node.fiber=t,xt.set(t,e),t=t.parent}while(t);xt.set(o.root,e)}if(!kt(n,e)){console.warn("[Owl] Unhandled error. Destroying the root component");try{n.app.destroy()}catch(t){console.error(t)}throw e}}function Et(){throw new r("Attempted to render cancelled fiber")}function At(t){let e=0;for(let n of t){let t=n.node;n.render=Et,0===t.status&&t.cancel(),t.fiber=null,n.bdom?t.forceNextRender=!0:e++,e+=At(n.children)}return e}class _t{constructor(t,e){if(this.bdom=null,this.children=[],this.appliedToDom=!1,this.deep=!1,this.childrenMap={},this.node=t,this.parent=e,e){this.deep=e.deep;const t=e.root;t.setCounter(t.counter+1),this.root=t,e.children.push(this)}else this.root=this}render(){let t=this.root.node,e=t.app.scheduler,n=t.parent;for(;n;){if(n.fiber){let o=n.fiber.root;if(0!==o.counter||!(t.parentKey in n.fiber.childrenMap))return void e.delayedRenders.push(this);n=o.node}t=n,n=n.parent}this._render()}_render(){const t=this.node,e=this.root;if(e){try{this.bdom=!0,this.bdom=t.renderFn()}catch(e){t.app.handleError({node:t,error:e})}e.setCounter(e.counter-1)}}}class Ct extends _t{constructor(){super(...arguments),this.counter=1,this.willPatch=[],this.patched=[],this.mounted=[],this.locked=!1}complete(){const t=this.node;let e;this.locked=!0;let n=this.mounted;try{for(e of this.willPatch){let t=e.node;if(t.fiber===e){const e=t.component;for(let n of t.willPatch)n.call(e)}}for(e=void 0,t._patch(),this.locked=!1;e=n.pop();)if(e.appliedToDom)for(let t of e.node.mounted)t();let o=this.patched;for(;e=o.pop();)if(e.appliedToDom)for(let t of e.node.patched)t()}catch(o){for(let t of n)t.node.willUnmount=[];this.locked=!1,t.app.handleError({fiber:e||this,error:o})}}setCounter(t){this.counter=t,0===t&&this.node.app.scheduler.flush()}}class Dt extends Ct{constructor(t,e,n={}){super(t,null),this.target=e,this.position=n.position||"last-child"}complete(){let t=this;try{const e=this.node;if(e.children=this.childrenMap,e.app.constructor.validateTarget(this.target),e.bdom)e.updateDom();else if(e.bdom=this.bdom,"last-child"===this.position||0===this.target.childNodes.length)$t(e.bdom,this.target);else{const t=this.target.childNodes[0];$t(e.bdom,this.target,t)}e.fiber=null,e.status=1,this.appliedToDom=!0;let n=this.mounted;for(;t=n.pop();)if(t.appliedToDom)for(let e of t.node.mounted)e()}catch(e){this.node.app.handleError({fiber:t,error:e})}}}const St=Symbol("Key changes"),Ot=()=>{throw new Error("Called NO_CALLBACK. Owl is broken, please report this to the maintainers.")},Rt=Object.prototype.toString,Lt=Object.prototype.hasOwnProperty,Bt=["Object","Array","Set","Map","WeakMap"],Pt=["Set","Map","WeakMap"];function jt(t){return Rt.call(Ft(t)).slice(8,-1)}function Mt(t){return"object"==typeof t&&Bt.includes(jt(t))}function It(t,e){return Mt(t)?Yt(t,e):t}const Wt=new WeakSet;function Vt(t){return Wt.add(t),t}function Ft(t){return Gt.has(t)?Gt.get(t):t}const Kt=new WeakMap;function zt(t,e,n){if(n===Ot)return;Kt.get(t)||Kt.set(t,new Map);const o=Kt.get(t);o.get(e)||o.set(e,new Set),o.get(e).add(n),Ut.has(n)||Ut.set(n,new Set),Ut.get(n).add(t)}function Ht(t,e){const n=Kt.get(t);if(!n)return;const o=n.get(e);if(o)for(const t of[...o])qt(t),t()}const Ut=new WeakMap;function qt(t){const e=Ut.get(t);if(e){for(const n of e){const e=Kt.get(n);if(e)for(const[n,o]of e.entries())o.delete(t),o.size||e.delete(n)}e.clear()}}const Gt=new WeakMap,Xt=new WeakMap;function Yt(t,e=Ot){if(!Mt(t))throw new r("Cannot make the given value reactive");if(Wt.has(t))return t;if(Gt.has(t))return Yt(Gt.get(t),e);Xt.has(t)||Xt.set(t,new WeakMap);const n=Xt.get(t);if(!n.has(e)){const o=jt(t),s=Pt.includes(o)?function(t,e,n){const o=oe[n](t,e);return Object.assign(Zt(e),{get:(t,n)=>Lt.call(o,n)?o[n]:(zt(t,n,e),It(t[n],e))})}(t,e,o):Zt(e),r=new Proxy(t,s);n.set(e,r),Gt.set(r,t)}return n.get(e)}function Zt(t){return{get(e,n,o){const s=Object.getOwnPropertyDescriptor(e,n);return!s||s.writable||s.configurable?(zt(e,n,t),It(Reflect.get(e,n,o),t)):Reflect.get(e,n,o)},set(t,e,n,o){const s=Lt.call(t,e),r=Reflect.get(t,e,o),i=Reflect.set(t,e,Ft(n),o);return!s&&Lt.call(t,e)&&Ht(t,St),(r!==Reflect.get(t,e,o)||"length"===e&&Array.isArray(t))&&Ht(t,e),i},deleteProperty(t,e){const n=Reflect.deleteProperty(t,e);return Ht(t,St),Ht(t,e),n},ownKeys:e=>(zt(e,St,t),Reflect.ownKeys(e)),has:(e,n)=>(zt(e,St,t),Reflect.has(e,n))}}function Jt(t,e,n){return o=>(o=Ft(o),zt(e,o,n),It(e[t](o),n))}function Qt(t,e,n){return function*(){zt(e,St,n);const o=e.keys();for(const s of e[t]()){const t=o.next().value;zt(e,t,n),yield It(s,n)}}}function te(t,e){return function(n,o){zt(t,St,e),t.forEach((function(s,r,i){zt(t,r,e),n.call(o,It(s,e),It(r,e),It(i,e))}),o)}}function ee(t,e,n){return(o,s)=>{o=Ft(o);const r=n.has(o),i=n[e](o),l=n[t](o,s);return r!==n.has(o)&&Ht(n,St),i!==n[e](o)&&Ht(n,o),l}}function ne(t){return()=>{const e=[...t.keys()];t.clear(),Ht(t,St);for(const n of e)Ht(t,n)}}const oe={Set:(t,e)=>({has:Jt("has",t,e),add:ee("add","has",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),Map:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t),keys:Qt("keys",t,e),values:Qt("values",t,e),entries:Qt("entries",t,e),[Symbol.iterator]:Qt(Symbol.iterator,t,e),forEach:te(t,e),clear:ne(t),get size(){return zt(t,St,e),t.size}}),WeakMap:(t,e)=>({has:Jt("has",t,e),get:Jt("get",t,e),set:ee("set","get",t),delete:ee("delete","has",t)})};let se=null;function re(){if(!se)throw new r("No active component (a hook function should only be called in 'setup')");return se}function ie(t,e){for(let n in e)void 0===t[n]&&(t[n]=e[n])}const le=new WeakMap;function ae(t){const e=re();let n=le.get(e);if(!n){const t={fn:$(e.render.bind(e,!1))};n=(...e)=>t.fn(...e),le.set(e,n),e.willDestroy.push(he.bind(null,t,n))}return Yt(t,n)}const ce=()=>{};function he(t,e){t.fn=ce,qt(e)}class ue{constructor(t,e,n,o,s){this.fiber=null,this.bdom=null,this.status=0,this.forceNextRender=!1,this.nextProps=null,this.children=Object.create(null),this.refs={},this.willStart=[],this.willUpdateProps=[],this.willUnmount=[],this.mounted=[],this.willPatch=[],this.patched=[],this.willDestroy=[],se=this,this.app=n,this.parent=o,this.props=e,this.parentKey=s;const r=t.defaultProps;e=Object.assign({},e),r&&ie(e,r);const i=o&&o.childEnv||n.env;this.childEnv=i;for(const t in e){const n=e[t];n&&"object"==typeof n&&Gt.has(n)&&(e[t]=ae(n))}this.component=new t(e,i,this);const l=Object.assign(Object.create(this.component),{this:this.component});this.renderFn=n.getTemplate(t.template).bind(this.component,l,this),this.component.setup(),se=null}mountComponent(t,e){const n=new Dt(this,t,e);this.app.scheduler.addFiber(n),this.initiateRender(n)}async initiateRender(t){this.fiber=t,this.mounted.length&&t.root.mounted.push(t);const e=this.component;try{await Promise.all(this.willStart.map((t=>t.call(e))))}catch(t){return void this.app.handleError({node:this,error:t})}0===this.status&&this.fiber===t&&t.render()}async render(t){if(this.status>=2)return;let e=this.fiber;if(e&&(e.root.locked||!0===e.bdom)&&(await Promise.resolve(),e=this.fiber),e){if(!e.bdom&&!xt.has(e))return void(t&&(e.deep=t));t=t||e.deep}else if(!this.bdom)return;const n=function(t){let e=t.fiber;if(e){let t=e.root;return t.locked=!0,t.setCounter(t.counter+1-At(e.children)),t.locked=!1,e.children=[],e.childrenMap={},e.bdom=null,xt.has(e)&&(xt.delete(e),xt.delete(t),e.appliedToDom=!1,e instanceof Ct&&(e.mounted=e instanceof Dt?[e]:[])),e}const n=new Ct(t,null);return t.willPatch.length&&n.willPatch.push(n),t.patched.length&&n.patched.push(n),n}(this);n.deep=t,this.fiber=n,this.app.scheduler.addFiber(n),await Promise.resolve(),this.status>=2||this.fiber!==n||!e&&n.parent||n.render()}cancel(){this._cancel(),delete this.parent.children[this.parentKey],this.app.scheduler.scheduleDestroy(this)}_cancel(){this.status=2;const t=this.children;for(let e in t)t[e]._cancel()}destroy(){let t=1===this.status;this._destroy(),t&&this.bdom.remove()}_destroy(){const t=this.component;if(1===this.status)for(let e of this.willUnmount)e.call(t);for(let t of Object.values(this.children))t._destroy();if(this.willDestroy.length)try{for(let e of this.willDestroy)e.call(t)}catch(t){this.app.handleError({error:t,node:this})}this.status=3}async updateAndRender(t,e){this.nextProps=t,t=Object.assign({},t);const n=function(t,e){let n=t.fiber;return n&&(At(n.children),n.root=null),new _t(t,e)}(this,e);this.fiber=n;const o=this.component,s=o.constructor.defaultProps;s&&ie(t,s),se=this;for(const e in t){const n=t[e];n&&"object"==typeof n&&Gt.has(n)&&(t[e]=ae(n))}se=null;const r=Promise.all(this.willUpdateProps.map((e=>e.call(o,t))));if(await r,n!==this.fiber)return;o.props=t,n.render();const i=e.root;this.willPatch.length&&i.willPatch.push(n),this.patched.length&&i.patched.push(n)}updateDom(){if(this.fiber)if(this.bdom===this.fiber.bdom)for(let t in this.children){this.children[t].updateDom()}else this.bdom.patch(this.fiber.bdom,!1),this.fiber.appliedToDom=!0,this.fiber=null}setRef(t,e){e&&(this.refs[t]=e)}firstNode(){const t=this.bdom;return t?t.firstNode():void 0}mount(t,e){const n=this.fiber.bdom;this.bdom=n,n.mount(t,e),this.status=1,this.fiber.appliedToDom=!0,this.children=this.fiber.childrenMap,this.fiber=null}moveBeforeDOMNode(t,e){this.bdom.moveBeforeDOMNode(t,e)}moveBeforeVNode(t,e){this.bdom.moveBeforeVNode(t?t.bdom:null,e)}patch(){this.fiber&&this.fiber.parent&&(this._patch(),this.props=this.nextProps)}_patch(){let t=!1;for(let e in this.children){t=!0;break}const e=this.fiber;this.children=e.childrenMap,this.bdom.patch(e.bdom,t),e.appliedToDom=!0,this.fiber=null}beforeRemove(){this._destroy()}remove(){this.bdom.remove()}get name(){return this.component.constructor.name}get subscriptions(){const t=le.get(this);return t?(e=t,[...Ut.get(e)||[]].map((t=>{const n=Kt.get(t);let o=[];if(n)for(const[t,s]of n)s.has(e)&&o.push(t);return{target:t,keys:o}}))):[];var e}}const de=Symbol("timeout"),fe={onWillStart:3e3,onWillUpdateProps:3e3};function pe(t,e){const n=new r,o=new r,s=re();return(...r)=>{const i=t=>{throw n.cause=t,n.message=t instanceof Error?`The following error occurred in ${e}: "${t.message}"`:`Something that is not an Error was thrown in ${e} (see this Error's "cause" property)`,n};let l;try{l=t(...r)}catch(t){i(t)}if(!(l instanceof Promise))return l;const a=fe[e];if(a){const t=s.fiber;Promise.race([l.catch((()=>{})),new Promise((t=>setTimeout((()=>t(de)),a)))]).then((n=>{n===de&&s.fiber===t&&s.status<=2&&(o.message=`${e}'s promise hasn't resolved after ${a/1e3} seconds`,console.log(o))}))}return l.catch(i)}}function me(t){const e=re(),n=e.app.dev?pe:t=>t;e.mounted.push(n(t.bind(e.component),"onMounted"))}function ge(t){const e=re(),n=e.app.dev?pe:t=>t;e.patched.push(n(t.bind(e.component),"onPatched"))}function be(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUnmount.unshift(n(t.bind(e.component),"onWillUnmount"))}class ve{constructor(t,e,n){this.props=t,this.env=e,this.__owl__=n}setup(){}render(t=!1){this.__owl__.render(!0===t)}}ve.template="";const ye=z("").constructor;class we extends ye{constructor(t,e){super(""),this.target=null,this.selector=t,this.content=e}mount(t,e){super.mount(t,e),this.target=document.querySelector(this.selector),this.target?this.content.mount(this.target,null):this.content.mount(t,e)}beforeRemove(){this.content.beforeRemove()}remove(){this.content&&(super.remove(),this.content.remove(),this.content=null)}patch(t){super.patch(t),this.content?this.content.patch(t.content,!0):(this.content=t.content,this.content.mount(this.target,null))}}class $e extends ve{setup(){const t=this.__owl__;me((()=>{const e=t.bdom;if(!e.target){const t=document.querySelector(this.props.target);if(!t)throw new r("invalid portal target");e.content.moveBeforeDOMNode(t.firstChild,t)}})),be((()=>{t.bdom.remove()}))}}$e.template="__portal__",$e.props={target:{type:String},slots:!0};const xe=t=>Array.isArray(t),Ne=t=>"object"!=typeof t,ke=t=>"object"==typeof t&&t&&"value"in t;function Te(t){return"object"==typeof t&&"optional"in t&&t.optional||!1}function Ee(t){return"*"===t||!0===t?"value":t.name.toLowerCase()}function Ae(t){return Ne(t)?Ee(t):xe(t)?t.map(Ae).join(" or "):ke(t)?String(t.value):"element"in t?`list of ${Ae({type:t.element,optional:!1})}s`:"shape"in t?"object":Ae(t.type||"*")}function _e(t,e){var n;Array.isArray(e)&&(n=e,e=Object.fromEntries(n.map((t=>t.endsWith("?")?[t.slice(0,-1),{optional:!0}]:[t,{type:"*",optional:!1}])))),t=Ft(t);let o=[];for(let n in t)if(n in e){let s=Ce(n,t[n],e[n]);s&&o.push(s)}else"*"in e||o.push(`unknown key '${n}'`);for(let n in e){const s=e[n];if("*"!==n&&!Te(s)&&!(n in t)){const t="object"==typeof s&&!Array.isArray(s);let e="*"===s||(t&&"type"in s?"*"===s.type:t)?"":` (should be a ${Ae(s)})`;o.push(`'${n}' is missing${e}`)}}return o}function Ce(t,e,n){if(void 0===e)return Te(n)?null:`'${t}' is undefined (should be a ${Ae(n)})`;if(Ne(n))return function(t,e,n){if("function"==typeof n)if("object"==typeof e){if(!(e instanceof n))return`'${t}' is not a ${Ee(n)}`}else if(typeof e!==n.name.toLowerCase())return`'${t}' is not a ${Ee(n)}`;return null}(t,e,n);if(ke(n))return e===n.value?null:`'${t}' is not equal to '${n.value}'`;if(xe(n)){let o=n.find((n=>!Ce(t,e,n)));return o?null:`'${t}' is not a ${Ae(n)}`}let o=null;if("element"in n)o=function(t,e,n){if(!Array.isArray(e))return`'${t}' is not a list of ${Ae(n)}s`;for(let o=0;o<e.length;o++){const s=Ce(`${t}[${o}]`,e[o],n);if(s)return s}return null}(t,e,n.element);else if("shape"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=_e(e,n.shape);s.length&&(o=`'${t}' doesn't have the correct shape (${s.join(", ")})`)}else if("values"in n)if("object"!=typeof e||Array.isArray(e))o=`'${t}' is not an object`;else{const s=Object.entries(e).map((([t,e])=>Ce(t,e,n.values))).filter(Boolean);s.length&&(o=`some of the values in '${t}' are invalid (${s.join(", ")})`)}return"type"in n&&!o&&(o=Ce(t,e,n.type)),"validate"in n&&!o&&(o=n.validate(e)?null:`'${t}' is not valid`),o}const De=Object.create;function Se(t){const e=De(t);for(let n in t)e[n]=t[n];return e}const Oe=Symbol("isBoundary");class Re{constructor(t,e,n,o,s){this.fn=t,this.ctx=Se(e),this.component=n,this.node=o,this.key=s}evaluate(){return this.fn.call(this.component,this.ctx,this.node,this.key)}toString(){return this.evaluate().toString()}}function Le(t,e,n){const o="string"!=typeof t?t:n.constructor.components[t];if(!o)return;const s=o.props;if(!s)return void(n.__owl__.app.warnIfNoStaticProps&&console.warn(`Component '${o.name}' does not have a static props description`));const i=o.defaultProps;if(i){let t=t=>Array.isArray(s)?s.includes(t):t in s&&!("*"in s)&&!Te(s[t]);for(let e in i)if(t(e))throw new r(`A default value cannot be defined for a mandatory prop (name: '${e}', component: ${o.name})`)}const l=_e(e,s);if(l.length)throw new r(`Invalid props for component '${o.name}': `+l.join(", "))}const Be={withDefault:function(t,e){return null==t||!1===t?e:t},zero:Symbol("zero"),isBoundary:Oe,callSlot:function(t,e,n,o,r,i,l){n=n+"__slot_"+o;const a=t.props.slots||{},{__render:c,__ctx:h,__scope:u}=a[o]||{},d=De(h||{});u&&(d[u]=i);const f=c?c(d,e,n):null;if(l){let i,a;return f?i=r?s(o,f):f:a=l(t,e,n),j([i,a])}return f||z("")},capture:Se,withKey:function(t,e){return t.key=e,t},prepareList:function(t){let e,n;if(Array.isArray(t))e=t,n=t;else if(t instanceof Map)e=[...t.keys()],n=[...t.values()];else if(Symbol.iterator in Object(t))e=[...t],n=e;else{if(!t||"object"!=typeof t)throw new r(`Invalid loop expression: "${t}" is not iterable`);n=Object.values(t),e=Object.keys(t)}const o=n.length;return[e,n,o,new Array(o)]},setContextValue:function(t,e,n){const o=t;for(;!t.hasOwnProperty(e)&&!t.hasOwnProperty(Oe);){const e=t.__proto__;if(!e){t=o;break}t=e}t[e]=n},shallowEqual:function(t,e){for(let n=0,o=t.length;n<o;n++)if(t[n]!==e[n])return!1;return!0},toNumber:function(t){const e=parseFloat(t);return isNaN(e)?t:e},validateProps:Le,LazyValue:Re,safeOutput:function(t,e){if(null==t)return e?s("default",e):s("undefined",z(""));let n,o;switch(typeof t){case"object":t instanceof k?(n="string_safe",o=wt(t)):t instanceof Re?(n="lazy_value",o=t.evaluate()):t instanceof String?(n="string_unsafe",o=z(t)):(n="block_safe",o=t);break;case"string":n="string_unsafe",o=z(t);break;default:n="string_unsafe",o=z(String(t))}return s(n,o)},createCatcher:function(t){const e=Object.keys(t).length;class n{constructor(t,e){this.handlerFns=[],this.afterNode=null,this.child=t,this.handlerData=e}mount(e,n){this.parentEl=e,this.child.mount(e,n),this.afterNode=document.createTextNode(""),e.insertBefore(this.afterNode,n),this.wrapHandlerData();for(let n in t){const o=t[n],s=A(n);this.handlerFns[o]=s,s.setup.call(e,this.handlerData[o])}}wrapHandlerData(){for(let t=0;t<e;t++){let e=this.handlerData[t],n=e.length-2,o=e[n];const s=this;e[n]=function(t){const e=t.target;let n=s.child.firstNode();const r=s.afterNode;for(;n&&n!==r;){if(n.contains(e))return o.call(this,t);n=n.nextSibling}}}}moveBeforeDOMNode(t,e=this.parentEl){this.parentEl=e,this.child.moveBeforeDOMNode(t,e),e.insertBefore(this.afterNode,t)}moveBeforeVNode(t,e){t&&(e=t.firstNode()||e),this.child.moveBeforeVNode(t?t.child:null,e),this.parentEl.insertBefore(this.afterNode,e)}patch(t,n){if(this!==t){this.handlerData=t.handlerData,this.wrapHandlerData();for(let t=0;t<e;t++)this.handlerFns[t].update.call(this.parentEl,this.handlerData[t]);this.child.patch(t.child,n)}}beforeRemove(){this.child.beforeRemove()}remove(){for(let t=0;t<e;t++)this.handlerFns[t].remove.call(this.parentEl);this.child.remove(),this.afterNode.remove()}firstNode(){return this.child.firstNode()}toString(){return this.child.toString()}}return function(t,e){return new n(t,e)}},markRaw:Vt,OwlError:r,makeRefWrapper:function(t){let e=new Set;return(n,o)=>{if(e.has(n))throw new r(`Cannot set the same ref more than once in the same component, ref "${n}" was set multiple times in ${t.name}`);return e.add(n),o}}};function Pe(t){const e=(new DOMParser).parseFromString(t,"text/xml");if(e.getElementsByTagName("parsererror").length){let n="Invalid XML in template.";const o=e.getElementsByTagName("parsererror")[0].textContent;if(o){n+="\nThe parser has produced the following error message:\n"+o;const e=/\d+/g,s=e.exec(o);if(s){const r=Number(s[0]),i=t.split("\n")[r-1],l=e.exec(o);if(i&&l){const t=Number(l[0])-1;i[t]&&(n+=`\nThe error might be located at xml line ${r} column ${t}\n${i}\n${"-".repeat(t-1)}^`)}}}throw new r(n)}return e}const je={text:z,createBlock:nt,list:bt,multi:j,html:wt,toggler:s,comment:H};class Me{constructor(t={}){if(this.rawTemplates=Object.create(Ie),this.templates={},this.Portal=$e,this.dev=t.dev||!1,this.translateFn=t.translateFn,this.translatableAttributes=t.translatableAttributes,t.templates)if(t.templates instanceof Document||"string"==typeof t.templates)this.addTemplates(t.templates);else for(const e in t.templates)this.addTemplate(e,t.templates[e]);this.getRawTemplate=t.getTemplate,this.customDirectives=t.customDirectives||{},this.runtimeUtils={...Be,__globals__:t.globalValues||{}},this.hasGlobalValues=Boolean(t.globalValues&&Object.keys(t.globalValues).length)}static registerTemplate(t,e){Ie[t]=e}addTemplate(t,e){if(t in this.rawTemplates){if(!this.dev)return;const n=this.rawTemplates[t];if(("string"==typeof n?n:n instanceof Element?n.outerHTML:n.toString())===("string"==typeof e?e:e.outerHTML))return;throw new r(`Template ${t} already defined with different content`)}this.rawTemplates[t]=e}addTemplates(t){if(t){t=t instanceof Document?t:Pe(t);for(const e of t.querySelectorAll("[t-name]")){const t=e.getAttribute("t-name");this.addTemplate(t,e)}}}getTemplate(t){var e;if(!(t in this.templates)){const n=(null===(e=this.getRawTemplate)||void 0===e?void 0:e.call(this,t))||this.rawTemplates[t];if(void 0===n){let e="";try{e=` (for component "${re().component.constructor.name}")`}catch{}throw new r(`Missing template: "${t}"${e}`)}const o="function"==typeof n&&!(n instanceof Element)?n:this._compileTemplate(t,n),s=this.templates;this.templates[t]=function(e,n){return s[t].call(this,e,n)};const i=o(this,je,this.runtimeUtils);this.templates[t]=i}return this.templates[t]}_compileTemplate(t,e){throw new r("Unable to compile a template. Please use owl full build instead")}callTemplate(t,e,n,o,r){return s(e,this.getTemplate(e).call(t,n,o,r+e))}}const Ie={};function We(...t){const e="__template__"+We.nextId++,n=String.raw(...t);return Ie[e]=n,e}We.nextId=1,Me.registerTemplate("__portal__",(function(t,e,n){let{callSlot:o}=n;return function(t,e,n=""){return new we(t.props.target,o(t,e,n,"default",!1,null))}}));const Ve="true,false,NaN,null,undefined,debugger,console,window,in,instanceof,new,function,return,eval,void,Math,RegExp,Array,Object,Date,__globals__".split(","),Fe=Object.assign(Object.create(null),{and:"&&",or:"||",gt:">",gte:">=",lt:"<",lte:"<="}),Ke=Object.assign(Object.create(null),{"{":"LEFT_BRACE","}":"RIGHT_BRACE","[":"LEFT_BRACKET","]":"RIGHT_BRACKET",":":"COLON",",":"COMMA","(":"LEFT_PAREN",")":"RIGHT_PAREN"}),ze="...,.,===,==,+,!==,!=,!,||,&&,>=,>,<=,<,?,-,*,/,%,typeof ,=>,=,;,in ,new ,|,&,^,~".split(",");const He=[function(t){let e=t[0],n=e;if("'"!==e&&'"'!==e&&"`"!==e)return!1;let o,s=1;for(;t[s]&&t[s]!==n;){if(o=t[s],e+=o,"\\"===o){if(s++,o=t[s],!o)throw new r("Invalid expression");e+=o}s++}if(t[s]!==n)throw new r("Invalid expression");return e+=n,"`"===n?{type:"TEMPLATE_STRING",value:e,replace:t=>e.replace(/\$\{(.*?)\}/g,((e,n)=>"${"+t(n)+"}"))}:{type:"VALUE",value:e}},function(t){let e=t[0];if(e&&e.match(/[0-9]/)){let n=1;for(;t[n]&&t[n].match(/[0-9]|\./);)e+=t[n],n++;return{type:"VALUE",value:e}}return!1},function(t){for(let e of ze)if(t.startsWith(e))return{type:"OPERATOR",value:e};return!1},function(t){let e=t[0];if(e&&e.match(/[a-zA-Z_\$]/)){let n=1;for(;t[n]&&t[n].match(/\w/);)e+=t[n],n++;return e in Fe?{type:"OPERATOR",value:Fe[e],size:e.length}:{type:"SYMBOL",value:e}}return!1},function(t){const e=t[0];return!(!e||!(e in Ke))&&{type:Ke[e],value:e}}];const Ue=t=>t&&("LEFT_BRACE"===t.type||"COMMA"===t.type),qe=t=>t&&("RIGHT_BRACE"===t.type||"COMMA"===t.type);function Ge(t){const e=new Set,n=function(t){const e=[];let n,o=!0,s=t;try{for(;o;)if(s=s.trim(),s){for(let t of He)if(o=t(s),o){e.push(o),s=s.slice(o.size||o.value.length);break}}else o=!1}catch(t){n=t}if(s.length||n)throw new r(`Tokenizer error: could not tokenize \`${t}\``);return e}(t);let o=0,s=[];for(;o<n.length;){let t=n[o],r=n[o-1],i=n[o+1],l=s[s.length-1];switch(t.type){case"LEFT_BRACE":case"LEFT_BRACKET":case"LEFT_PAREN":s.push(t.type);break;case"RIGHT_BRACE":case"RIGHT_BRACKET":case"RIGHT_PAREN":s.pop()}let a="SYMBOL"===t.type&&!Ve.includes(t.value);if("SYMBOL"!==t.type||Ve.includes(t.value)||r&&("LEFT_BRACE"===l&&Ue(r)&&qe(i)&&(n.splice(o+1,0,{type:"COLON",value:":"},{...t}),i=n[o+1]),"OPERATOR"===r.type&&"."===r.value?a=!1:"LEFT_BRACE"!==r.type&&"COMMA"!==r.type||i&&"COLON"===i.type&&(a=!1)),"TEMPLATE_STRING"===t.type&&(t.value=t.replace((t=>Ye(t)))),i&&"OPERATOR"===i.type&&"=>"===i.value)if("RIGHT_PAREN"===t.type){let t=o-1;for(;t>0&&"LEFT_PAREN"!==n[t].type;)"SYMBOL"===n[t].type&&n[t].originalValue&&(n[t].value=n[t].originalValue,e.add(n[t].value)),t--}else e.add(t.value);a&&(t.varName=t.value,e.has(t.value)||(t.originalValue=t.value,t.value=`ctx['${t.value}']`)),o++}for(const t of n)"SYMBOL"===t.type&&t.varName&&e.has(t.value)&&(t.originalValue=t.value,t.value=`_${t.value}`,t.isLocal=!0);return n}const Xe=new Map([["in "," in "]]);function Ye(t){return Ge(t).map((t=>Xe.get(t.value)||t.value)).join("")}const Ze=/\{\{.*?\}\}|\#\{.*?\}/g;function Je(t,e){let n=t.match(Ze);if(n&&n[0].length===t.length)return`(${e(t.slice(2,"{"===n[0][0]?-2:-1))})`;let o=t.replace(Ze,(t=>"${"+e(t.slice(2,"{"===t[0]?-2:-1))+"}"));return"`"+o+"`"}function Qe(t){return Je(t,Ye)}const tn=/\s+/g;let en;"undefined"!=typeof document&&(en=document.implementation.createDocument(null,null,null));const nn=new Set(["stop","capture","prevent","self","synthetic"]);let on={};function sn(t=""){return on[t]=(on[t]||0)+1,t+on[t]}function rn(t,e){switch(t){case"input":return"checked"===e||"indeterminate"===e||"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"option":return"selected"===e||"disabled"===e;case"textarea":return"value"===e||"readonly"===e||"readOnly"===e||"disabled"===e;case"select":return"value"===e||"disabled"===e;case"button":case"optgroup":return"disabled"===e}return!1}function ln(t){return`\`${t.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/,"\\${")}\``}class an{constructor(t,e){this.dynamicTagName=null,this.isRoot=!1,this.hasDynamicChildren=!1,this.children=[],this.data=[],this.childNumber=0,this.parentVar="",this.id=an.nextBlockId++,this.varName="b"+this.id,this.blockName="block"+this.id,this.target=t,this.type=e}insertData(t,e="d"){const n=sn(e);return this.target.addLine(`let ${n} = ${t};`),this.data.push(n)-1}insert(t){this.currentDom?this.currentDom.appendChild(t):this.dom=t}generateExpr(t){if("block"===this.type){const t=this.children.length;let e=this.data.length?`[${this.data.join(", ")}]`:t?"[]":"";return t&&(e+=", ["+this.children.map((t=>t.varName)).join(", ")+"]"),this.dynamicTagName?`toggler(${this.dynamicTagName}, ${this.blockName}(${this.dynamicTagName})(${e}))`:`${this.blockName}(${e})`}return"list"===this.type?`list(c_block${this.id})`:t}asXmlString(){const t=en.createElement("t");return t.appendChild(this.dom),t.innerHTML}}function cn(t,e){return Object.assign({block:null,index:0,forceNewBlock:!0,translate:t.translate,translationCtx:t.translationCtx,tKeyExpr:null,nameSpace:t.nameSpace,tModelSelectedExpr:t.tModelSelectedExpr},e)}an.nextBlockId=1;class hn{constructor(t,e){this.indentLevel=0,this.loopLevel=0,this.code=[],this.hasRoot=!1,this.hasCache=!1,this.shouldProtectScope=!1,this.hasRefWrapper=!1,this.name=t,this.on=e||null}addLine(t,e){const n=new Array(this.indentLevel+2).join(" ");void 0===e?this.code.push(n+t):this.code.splice(e,0,n+t)}generateCode(){let t=[];t.push(`function ${this.name}(ctx, node, key = "") {`),this.shouldProtectScope&&(t.push(" ctx = Object.create(ctx);"),t.push(" ctx[isBoundary] = 1")),this.hasRefWrapper&&t.push(" let refWrapper = makeRefWrapper(this.__owl__);"),this.hasCache&&(t.push(" let cache = ctx.cache || {};"),t.push(" let nextCache = ctx.cache = {};"));for(let e of this.code)t.push(e);return this.hasRoot||t.push("return text('');"),t.push("}"),t.join("\n ")}currentKey(t){let e=this.loopLevel?`key${this.loopLevel}`:"key";return t.tKeyExpr&&(e=`${t.tKeyExpr} + ${e}`),e}}const un=["alt","aria-label","aria-placeholder","aria-roledescription","aria-valuetext","label","placeholder","title"],dn=/^(\s*)([\s\S]+?)(\s*)$/;class fn{constructor(t,e){if(this.blocks=[],this.nextBlockId=1,this.isDebug=!1,this.targets=[],this.target=new hn("template"),this.translatableAttributes=un,this.staticDefs=[],this.slotNames=new Set,this.helpers=new Set,this.translateFn=e.translateFn||(t=>t),e.translatableAttributes){const t=new Set(un);for(let n of e.translatableAttributes)n.startsWith("-")?t.delete(n.slice(1)):t.add(n);this.translatableAttributes=[...t]}this.hasSafeContext=e.hasSafeContext||!1,this.dev=e.dev||!1,this.ast=t,this.templateName=e.name,e.hasGlobalValues&&this.helpers.add("__globals__")}generateCode(){const t=this.ast;this.isDebug=12===t.type,an.nextBlockId=1,on={},this.compileAST(t,{block:null,index:0,forceNewBlock:!1,isLast:!0,translate:!0,translationCtx:"",tKeyExpr:null});let e=[" let { text, createBlock, list, multi, html, toggler, comment } = bdom;"];this.helpers.size&&e.push(`let { ${[...this.helpers].join(", ")} } = helpers;`),this.templateName&&e.push(`// Template name: "${this.templateName}"`);for(let{id:t,expr:n}of this.staticDefs)e.push(`const ${t} = ${n};`);if(this.blocks.length){e.push("");for(let t of this.blocks)if(t.dom){let n=ln(t.asXmlString());t.dynamicTagName?(n=n.replace(/^`<\w+/,`\`<\${tag || '${t.dom.nodeName}'}`),n=n.replace(/\w+>`$/,`\${tag || '${t.dom.nodeName}'}>\``),e.push(`let ${t.blockName} = tag => createBlock(${n});`)):e.push(`let ${t.blockName} = createBlock(${n});`)}}if(this.targets.length)for(let t of this.targets)e.push(""),e=e.concat(t.generateCode());e.push(""),e=e.concat("return "+this.target.generateCode());const n=e.join("\n ");if(this.isDebug){const t=`[Owl Debug]\n${n}`;console.log(t)}return n}compileInNewTarget(t,e,n,o){const s=sn(t),r=this.target,i=new hn(s,o);return this.targets.push(i),this.target=i,this.compileAST(e,cn(n)),this.target=r,s}addLine(t,e){this.target.addLine(t,e)}define(t,e){this.addLine(`const ${t} = ${e};`)}insertAnchor(t,e=t.children.length){const n=`block-child-${e}`,o=en.createElement(n);t.insert(o)}createBlock(t,e,n){const o=this.target.hasRoot,s=new an(this.target,e);return o||(this.target.hasRoot=!0,s.isRoot=!0),t&&(t.children.push(s),"list"===t.type&&(s.parentVar=`c_block${t.id}`)),s}insertBlock(t,e,n){let o=e.generateExpr(t);if(e.parentVar){let t=this.target.currentKey(n);return this.helpers.add("withKey"),void this.addLine(`${e.parentVar}[${n.index}] = withKey(${o}, ${t});`)}n.tKeyExpr&&(o=`toggler(${n.tKeyExpr}, ${o})`),e.isRoot?(this.target.on&&(o=this.wrapWithEventCatcher(o,this.target.on)),this.addLine(`return ${o};`)):this.define(e.varName,o)}captureExpression(t,e=!1){if(!e&&!t.includes("=>"))return Ye(t);const n=Ge(t),o=new Map;return n.map((t=>{if(t.varName&&!t.isLocal){if(!o.has(t.varName)){const e=sn("v");o.set(t.varName,e),this.define(e,t.value)}t.value=o.get(t.varName)}return t.value})).join("")}translate(t,e){const n=dn.exec(t);return n[1]+this.translateFn(n[2],e)+n[3]}compileAST(t,e){switch(t.type){case 1:return this.compileComment(t,e);case 0:return this.compileText(t,e);case 2:return this.compileTDomNode(t,e);case 4:return this.compileTEsc(t,e);case 8:return this.compileTOut(t,e);case 5:return this.compileTIf(t,e);case 9:return this.compileTForeach(t,e);case 10:return this.compileTKey(t,e);case 3:return this.compileMulti(t,e);case 7:return this.compileTCall(t,e);case 15:return this.compileTCallBlock(t,e);case 6:return this.compileTSet(t,e);case 11:return this.compileComponent(t,e);case 12:return this.compileDebug(t,e);case 13:return this.compileLog(t,e);case 14:return this.compileTSlot(t,e);case 16:return this.compileTTranslation(t,e);case 17:return this.compileTTranslationContext(t,e);case 18:return this.compileTPortal(t,e)}}compileDebug(t,e){return this.addLine("debugger;"),t.content?this.compileAST(t.content,e):null}compileLog(t,e){return this.addLine(`console.log(${Ye(t.expr)});`),t.content?this.compileAST(t.content,e):null}compileComment(t,e){let{block:n,forceNewBlock:o}=e;if(!n||o)n=this.createBlock(n,"comment",e),this.insertBlock(`comment(${ln(t.value)})`,n,{...e,forceNewBlock:o&&!n});else{const e=en.createComment(t.value);n.insert(e)}return n.varName}compileText(t,e){let{block:n,forceNewBlock:o}=e,s=t.value;if(s&&!1!==e.translate&&(s=this.translate(s,e.translationCtx)),e.inPreTag||(s=s.replace(tn," ")),!n||o)n=this.createBlock(n,"text",e),this.insertBlock(`text(${ln(s)})`,n,{...e,forceNewBlock:o&&!n});else{const e=0===t.type?en.createTextNode:en.createComment;n.insert(e.call(en,s))}return n.varName}generateHandlerCode(t,e){const n=t.split(".").slice(1).map((t=>{if(!nn.has(t))throw new r(`Unknown event modifier: '${t}'`);return`"${t}"`}));let o="";return n.length&&(o=`${n.join(",")}, `),`[${o}${this.captureExpression(e)}, ctx]`}compileTDomNode(t,e){var n;let{block:o,forceNewBlock:s}=e;const r=!o||s||null!==t.dynamicTag||t.ns;let i=this.target.code.length;if(r&&((t.dynamicTag||e.tKeyExpr||t.ns)&&e.block&&this.insertAnchor(e.block),o=this.createBlock(o,"block",e),this.blocks.push(o),t.dynamicTag)){const e=sn("tag");this.define(e,Ye(t.dynamicTag)),o.dynamicTagName=e}const l={};for(let s in t.attrs){let r,i;if(s.startsWith("t-attf")){r=Qe(t.attrs[s]);const e=o.insertData(r,"attr");i=s.slice(7),l["block-attribute-"+e]=i}else if(s.startsWith("t-att"))if(i="t-att"===s?null:s.slice(6),r=Ye(t.attrs[s]),i&&rn(t.tag,i)){"readonly"===i&&(i="readOnly"),r="value"===i?`new String((${r}) === 0 ? 0 : ((${r}) || ""))`:`new Boolean(${r})`;l[`block-property-${o.insertData(r,"prop")}`]=i}else{const t=o.insertData(r,"attr");"t-att"===s?l["block-attributes"]=String(t):l[`block-attribute-${t}`]=i}else if(this.translatableAttributes.includes(s)){const o=(null===(n=t.attrsTranslationCtx)||void 0===n?void 0:n[s])||e.translationCtx;l[s]=this.translateFn(t.attrs[s],o)}else r=`"${t.attrs[s]}"`,i=s,l[s]=t.attrs[s];if("value"===i&&e.tModelSelectedExpr){l[`block-attribute-${o.insertData(`${e.tModelSelectedExpr} === ${r}`,"attr")}`]="selected"}}let a;if(t.model){const{hasDynamicChildren:e,baseExpr:n,expr:s,eventType:r,shouldNumberize:i,shouldTrim:c,targetAttr:h,specialInitTargetAttr:u}=t.model,d=Ye(n),f=sn("bExpr");this.define(f,d);const p=Ye(s),m=sn("expr");this.define(m,p);const g=`${f}[${m}]`;let b;if(u){let e=h in l&&`'${l[h]}'`;if(!e&&t.attrs){const n=t.attrs[`t-att-${h}`];n&&(e=Ye(n))}b=o.insertData(`${g} === ${e}`,"prop"),l[`block-property-${b}`]=u}else if(e){a=`${sn("bValue")}`,this.define(a,g)}else b=o.insertData(`${g}`,"prop"),l[`block-property-${b}`]=h;this.helpers.add("toNumber");let v=`ev.target.${h}`;v=c?`${v}.trim()`:v,v=i?`toNumber(${v})`:v;const y=`[(ev) => { ${g} = ${v}; }]`;b=o.insertData(y,"hdlr"),l[`block-handler-${b}`]=r}for(let e in t.on){const n=this.generateHandlerCode(e,t.on[e]);l[`block-handler-${o.insertData(n,"hdlr")}`]=e}if(t.ref){this.dev&&(this.helpers.add("makeRefWrapper"),this.target.hasRefWrapper=!0);const e=Ze.test(t.ref);let n=`\`${t.ref}\``;e&&(n=Je(t.ref,(t=>this.captureExpression(t,!0))));let s=`(el) => this.__owl__.setRef((${n}), el)`;this.dev&&(s=`refWrapper(${n}, ${s})`);const r=o.insertData(s,"ref");l["block-ref"]=String(r)}const c=t.ns||e.nameSpace,h=c?en.createElementNS(c,t.tag):en.createElement(t.tag);for(const[t,e]of Object.entries(l))"class"===t&&""===e||h.setAttribute(t,e);if(o.insert(h),t.content.length){const n=o.currentDom;o.currentDom=h;const s=t.content;for(let n=0;n<s.length;n++){const r=t.content[n],i=cn(e,{block:o,index:o.childNumber,forceNewBlock:!1,isLast:e.isLast&&n===s.length-1,tKeyExpr:e.tKeyExpr,nameSpace:c,tModelSelectedExpr:a,inPreTag:e.inPreTag||"pre"===t.tag});this.compileAST(r,i)}o.currentDom=n}if(r&&(this.insertBlock(`${o.blockName}(ddd)`,o,e),o.children.length&&o.hasDynamicChildren)){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=i;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,i)}return o.varName}compileTEsc(t,e){let n,{block:o,forceNewBlock:s}=e;if("0"===t.expr?(this.helpers.add("zero"),n="ctx[zero]"):(n=Ye(t.expr),t.defaultValue&&(this.helpers.add("withDefault"),n=`withDefault(${n}, ${ln(t.defaultValue)})`)),!o||s)o=this.createBlock(o,"text",e),this.insertBlock(`text(${n})`,o,{...e,forceNewBlock:s&&!o});else{const t=o.insertData(n,"txt"),e=en.createElement(`block-text-${t}`);o.insert(e)}return o.varName}compileTOut(t,e){let n,{block:o}=e;if(o&&this.insertAnchor(o),o=this.createBlock(o,"html",e),"0"===t.expr)this.helpers.add("zero"),n="ctx[zero]";else if(t.body){let o=null;o=an.nextBlockId;const s=cn(e);this.compileAST({type:3,content:t.body},s),this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)}, b${o})`}else this.helpers.add("safeOutput"),n=`safeOutput(${Ye(t.expr)})`;return this.insertBlock(n,o,e),o.varName}compileTIfBranch(t,e,n){this.target.indentLevel++;let o=e.children.length;this.compileAST(t,cn(n,{block:e,index:n.index})),e.children.length>o&&this.insertAnchor(e,o),this.target.indentLevel--}compileTIf(t,e,n){let{block:o,forceNewBlock:s}=e;const r=this.target.code.length,i=!o||"multi"!==o.type&&s;if(o&&(o.hasDynamicChildren=!0),(!o||"multi"!==o.type&&s)&&(o=this.createBlock(o,"multi",e)),this.addLine(`if (${Ye(t.condition)}) {`),this.compileTIfBranch(t.content,o,e),t.tElif)for(let n of t.tElif)this.addLine(`} else if (${Ye(n.condition)}) {`),this.compileTIfBranch(n.content,o,e);if(t.tElse&&(this.addLine("} else {"),this.compileTIfBranch(t.tElse,o,e)),this.addLine("}"),i){if(o.children.length){const t=this.target.code,e=o.children.slice();let n=e.shift();for(let o=r;o<t.length&&(!t[o].trimStart().startsWith(`const ${n.varName} `)||(t[o]=t[o].replace(`const ${n.varName}`,n.varName),n=e.shift(),n));o++);this.addLine(`let ${o.children.map((t=>t.varName)).join(", ")};`,r)}const t=o.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,o,e)}return o.varName}compileTForeach(t,e){let{block:n}=e;n&&this.insertAnchor(n),n=this.createBlock(n,"list",e),this.target.loopLevel++;const o=`i${this.target.loopLevel}`;this.addLine("ctx = Object.create(ctx);");const s=`v_block${n.id}`,r=`k_block${n.id}`,i=`l_block${n.id}`,l=`c_block${n.id}`;let a;this.helpers.add("prepareList"),this.define(`[${r}, ${s}, ${i}, ${l}]`,`prepareList(${Ye(t.collection)});`),this.dev&&this.define(`keys${n.id}`,"new Set()"),this.addLine(`for (let ${o} = 0; ${o} < ${i}; ${o}++) {`),this.target.indentLevel++,this.addLine(`ctx[\`${t.elem}\`] = ${r}[${o}];`),t.hasNoFirst||this.addLine(`ctx[\`${t.elem}_first\`] = ${o} === 0;`),t.hasNoLast||this.addLine(`ctx[\`${t.elem}_last\`] = ${o} === ${r}.length - 1;`),t.hasNoIndex||this.addLine(`ctx[\`${t.elem}_index\`] = ${o};`),t.hasNoValue||this.addLine(`ctx[\`${t.elem}_value\`] = ${s}[${o}];`),this.define(`key${this.target.loopLevel}`,t.key?Ye(t.key):o),this.dev&&(this.helpers.add("OwlError"),this.addLine(`if (keys${n.id}.has(String(key${this.target.loopLevel}))) { throw new OwlError(\`Got duplicate key in t-foreach: \${key${this.target.loopLevel}}\`)}`),this.addLine(`keys${n.id}.add(String(key${this.target.loopLevel}));`)),t.memo&&(this.target.hasCache=!0,a=sn(),this.define(`memo${a}`,Ye(t.memo)),this.define(`vnode${a}`,`cache[key${this.target.loopLevel}];`),this.addLine(`if (vnode${a}) {`),this.target.indentLevel++,this.addLine(`if (shallowEqual(vnode${a}.memo, memo${a})) {`),this.target.indentLevel++,this.addLine(`${l}[${o}] = vnode${a};`),this.addLine(`nextCache[key${this.target.loopLevel}] = vnode${a};`),this.addLine("continue;"),this.target.indentLevel--,this.addLine("}"),this.target.indentLevel--,this.addLine("}"));const c=cn(e,{block:n,index:o});return this.compileAST(t.body,c),t.memo&&this.addLine(`nextCache[key${this.target.loopLevel}] = Object.assign(${l}[${o}], {memo: memo${a}});`),this.target.indentLevel--,this.target.loopLevel--,this.addLine("}"),e.isLast||this.addLine("ctx = ctx.__proto__;"),this.insertBlock("l",n,e),n.varName}compileTKey(t,e){const n=sn("tKey_");return this.define(n,Ye(t.expr)),e=cn(e,{tKeyExpr:n,block:e.block,index:e.index}),this.compileAST(t.content,e)}compileMulti(t,e){let{block:n,forceNewBlock:o}=e;const s=!n||o;let r=this.target.code.length;if(s){let o=null;if(t.content.filter((t=>!t.hasNoRepresentation)).length<=1){for(let n of t.content){const t=this.compileAST(n,e);o=o||t}return o}n=this.createBlock(n,"multi",e)}let i=0;for(let o=0,s=t.content.length;o<s;o++){const r=t.content[o],l=!r.hasNoRepresentation,a=cn(e,{block:n,index:i,forceNewBlock:l,isLast:e.isLast&&o===s-1});this.compileAST(r,a),l&&i++}if(s){if(n.hasDynamicChildren&&n.children.length){const t=this.target.code,e=n.children.slice();let o=e.shift();for(let n=r;n<t.length&&(!t[n].trimStart().startsWith(`const ${o.varName} `)||(t[n]=t[n].replace(`const ${o.varName}`,o.varName),o=e.shift(),o));n++);this.addLine(`let ${n.children.map((t=>t.varName)).join(", ")};`,r)}const t=n.children.map((t=>t.varName)).join(", ");this.insertBlock(`multi([${t}])`,n,e)}return n.varName}compileTCall(t,e){let{block:n,forceNewBlock:o}=e,s=e.ctxVar||"ctx";t.context&&(s=sn("ctx"),this.addLine(`let ${s} = ${Ye(t.context)};`));const r=Ze.test(t.name),i=r?Qe(t.name):"`"+t.name+"`";if(n&&!o&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),t.body){this.addLine(`${s} = Object.create(${s});`),this.addLine(`${s}[isBoundary] = 1;`),this.helpers.add("isBoundary");const n=cn(e,{ctxVar:s}),o=this.compileMulti({type:3,content:t.body},n);o&&(this.helpers.add("zero"),this.addLine(`${s}[zero] = ${o};`))}const l=this.generateComponentKey();if(r){const t=sn("template");this.staticDefs.find((t=>"call"===t.id))||this.staticDefs.push({id:"call",expr:"app.callTemplate.bind(app)"}),this.define(t,i),this.insertBlock(`call(this, ${t}, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}else{const t=sn("callTemplate_");this.staticDefs.push({id:t,expr:`app.getTemplate(${i})`}),this.insertBlock(`${t}.call(this, ${s}, node, ${l})`,n,{...e,forceNewBlock:!n})}return t.body&&!e.isLast&&this.addLine(`${s} = ${s}.__proto__;`),n.varName}compileTCallBlock(t,e){let{block:n,forceNewBlock:o}=e;return n&&(o||this.insertAnchor(n)),n=this.createBlock(n,"multi",e),this.insertBlock(Ye(t.name),n,{...e,forceNewBlock:!n}),n.varName}compileTSet(t,e){this.target.shouldProtectScope=!0,this.helpers.add("isBoundary").add("withDefault");const n=t.value?Ye(t.value||""):"null";if(t.body){this.helpers.add("LazyValue");const o={type:3,content:t.body};let s=`new LazyValue(${this.compileInNewTarget("value",o,e)}, ctx, this, node, ${this.target.currentKey(e)})`;s=t.value?s?`withDefault(${n}, ${s})`:n:s,this.addLine(`ctx[\`${t.name}\`] = ${s};`)}else{let o;if(t.defaultValue){const s=ln(e.translate?this.translate(t.defaultValue,e.translationCtx):t.defaultValue);o=t.value?`withDefault(${n}, ${s})`:s}else o=n;this.helpers.add("setContextValue"),this.addLine(`setContextValue(${e.ctxVar||"ctx"}, "${t.name}", ${o});`)}return null}generateComponentKey(t="key"){const e=[sn("__")];for(let t=0;t<this.target.loopLevel;t++)e.push(`\${key${t+1}}`);return`${t} + \`${e.join("__")}\``}formatProp(t,e,n,o){if(t.endsWith(".translate")){const s=(null==n?void 0:n[t])||o;e=ln(this.translateFn(e,s))}else e=this.captureExpression(e);if(t.includes(".")){let[n,o]=t.split(".");switch(t=n,o){case"bind":e=`(${e}).bind(this)`;break;case"alike":case"translate":break;default:throw new r(`Invalid prop suffix: ${o}`)}}return`${t=/^[a-z_]+$/i.test(t)?t:`'${t}'`}: ${e||void 0}`}formatPropObject(t,e,n){return Object.entries(t).map((([t,o])=>this.formatProp(t,o,e,n)))}getPropString(t,e){let n=`{${t.join(",")}}`;return e&&(n=`Object.assign({}, ${Ye(e)}${t.length?", "+n:""})`),n}compileComponent(t,e){let{block:n}=e;const o="slots"in(t.props||{}),s=t.props?this.formatPropObject(t.props,t.propsTranslationCtx,e.translationCtx):[];let r="";if(t.slots){let n="ctx";!this.target.loopLevel&&this.hasSafeContext||(n=sn("ctx"),this.helpers.add("capture"),this.define(n,"capture(ctx)"));let o=[];for(let s in t.slots){const r=t.slots[s],i=[];if(r.content){const t=this.compileInNewTarget("slot",r.content,e,r.on);i.push(`__render: ${t}.bind(this), __ctx: ${n}`)}const l=t.slots[s].scope;l&&i.push(`__scope: "${l}"`),t.slots[s].attrs&&i.push(...this.formatPropObject(t.slots[s].attrs,t.slots[s].attrsTranslationCtx,e.translationCtx));const a=`{${i.join(", ")}}`;o.push(`'${s}': ${a}`)}r=`{${o.join(", ")}}`}!r||t.dynamicProps||o||(this.helpers.add("markRaw"),s.push(`slots: markRaw(${r})`));let i,l,a=this.getPropString(s,t.dynamicProps);(r&&(t.dynamicProps||o)||this.dev)&&(i=sn("props"),this.define(i,a),a=i),r&&(t.dynamicProps||o)&&(this.helpers.add("markRaw"),this.addLine(`${i}.slots = markRaw(Object.assign(${r}, ${i}.slots))`)),t.isDynamic?(l=sn("Comp"),this.define(l,Ye(t.name))):l=`\`${t.name}\``,this.dev&&this.addLine(`helpers.validateProps(${l}, ${i}, this);`),n&&(!1===e.forceNewBlock||e.tKeyExpr)&&this.insertAnchor(n);let c=this.generateComponentKey();e.tKeyExpr&&(c=`${e.tKeyExpr} + ${c}`);let h=sn("comp");const u=[];for(let e in t.props||{}){let[t,n]=e.split(".");n||u.push(`"${t}"`)}this.staticDefs.push({id:h,expr:`app.createComponent(${t.isDynamic?null:l}, ${!t.isDynamic}, ${!!t.slots}, ${!!t.dynamicProps}, [${u}])`}),t.isDynamic&&(c=`(${l}).name + ${c}`);let d=`${h}(${a}, ${c}, node, this, ${t.isDynamic?l:null})`;return t.isDynamic&&(d=`toggler(${l}, ${d})`),t.on&&(d=this.wrapWithEventCatcher(d,t.on)),n=this.createBlock(n,"multi",e),this.insertBlock(d,n,e),n.varName}wrapWithEventCatcher(t,e){this.helpers.add("createCatcher");let n=sn("catcher"),o={},s=[];for(let t in e){let n=sn("hdlr"),r=s.push(n)-1;o[t]=r;const i=this.generateHandlerCode(t,e[t]);this.define(n,i)}return this.staticDefs.push({id:n,expr:`createCatcher(${JSON.stringify(o)})`}),`${n}(${t}, [${s.join(",")}])`}compileTSlot(t,e){this.helpers.add("callSlot");let n,o,{block:s}=e,r=!1,i=!1;t.name.match(Ze)?(r=!0,i=!0,o=Qe(t.name)):(o="'"+t.name+"'",i=i||this.slotNames.has(t.name),this.slotNames.add(t.name));const l={...t.attrs},a=l["t-props"];delete l["t-props"];let c=this.target.loopLevel?`key${this.target.loopLevel}`:"key";i&&(c=this.generateComponentKey(c));const h=t.attrs?this.formatPropObject(l,t.attrsTranslationCtx,e.translationCtx):[],u=this.getPropString(h,a);if(t.defaultContent){n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u}, ${this.compileInNewTarget("defaultContent",t.defaultContent,e)}.bind(this))`}else if(r){let t=sn("slot");this.define(t,o),n=`toggler(${t}, callSlot(ctx, node, ${c}, ${t}, ${r}, ${u}))`}else n=`callSlot(ctx, node, ${c}, ${o}, ${r}, ${u})`;return t.on&&(n=this.wrapWithEventCatcher(n,t.on)),s&&this.insertAnchor(s),s=this.createBlock(s,"multi",e),this.insertBlock(n,s,{...e,forceNewBlock:!1}),s.varName}compileTTranslation(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translate:!1})):null}compileTTranslationContext(t,e){return t.content?this.compileAST(t.content,Object.assign({},e,{translationCtx:t.translationCtx})):null}compileTPortal(t,e){this.staticDefs.find((t=>"Portal"===t.id))||this.staticDefs.push({id:"Portal",expr:"app.Portal"});let{block:n}=e;const o=this.compileInNewTarget("slot",t.content,e);let s="ctx";!this.target.loopLevel&&this.hasSafeContext||(s=sn("ctx"),this.helpers.add("capture"),this.define(s,"capture(ctx)"));let r=sn("comp");this.staticDefs.push({id:r,expr:"app.createComponent(null, false, true, false, false)"});const i=`${r}({target: ${Ye(t.target)},slots: {'default': {__render: ${o}.bind(this), __ctx: ${s}}}}, ${this.generateComponentKey()}, node, ctx, Portal)`;return n&&this.insertAnchor(n),n=this.createBlock(n,"multi",e),this.insertBlock(i,n,{...e,forceNewBlock:!1}),n.varName}}const pn=new WeakMap;function mn(t,e){var n;return function(t){let e=t.querySelectorAll("[t-elif], [t-else]");for(let t=0,n=e.length;t<n;t++){let n=e[t],o=n.previousElementSibling,s=t=>o.getAttribute(t),i=t=>+!!n.getAttribute(t);if(!o||!s("t-if")&&!s("t-elif"))throw new r("t-elif and t-else directives must be preceded by a t-if or t-elif directive");{if(s("t-foreach"))throw new r("t-if cannot stay at the same level as t-foreach when using t-elif or t-else");if(["t-if","t-elif","t-else"].map(i).reduce((function(t,e){return t+e}))>1)throw new r("Only one conditional branching directive is allowed per node");let t;for(;(t=n.previousSibling)!==o;){if(t.nodeValue.trim().length&&8!==t.nodeType)throw new r("text is not allowed between branching directives");t.remove()}}}}(n=t),function(t){for(const e of["t-esc","t-out"]){const n=[...t.querySelectorAll(`[${e}]`)].filter((t=>t.tagName[0]===t.tagName[0].toUpperCase()||t.hasAttribute("t-component")));for(const t of n){if(t.childNodes.length)throw new r(`Cannot have ${e} on a component that already has content`);const n=t.getAttribute(e);t.removeAttribute(e);const o=t.ownerDocument.createElement("t");null!=n&&o.setAttribute(e,n),t.appendChild(o)}}}(n),gn(t,e)||{type:0,value:""}}function gn(t,e){return t instanceof Element?function(t,e){if(!e.customDirectives)return null;const n=t.getAttributeNames();for(let o of n){if("t-custom"===o||"t-custom-"===o)throw new r("Missing custom directive name with t-custom directive");if(o.startsWith("t-custom-")){const n=o.split(".")[0].slice(9),s=e.customDirectives[n];if(!s)throw new r(`Custom directive "${n}" is not defined`);const i=t.getAttribute(o),l=o.split(".").slice(1);t.removeAttribute(o);try{s(t,i,l)}catch(t){throw new r(`Custom directive "${n}" throw the following error: ${t}`)}return gn(t,e)}}return null}(t,e)||function(t,e){if(t.hasAttribute("t-debug")){t.removeAttribute("t-debug");const n=gn(t,e),o={type:12,content:n};return(null==n?void 0:n.hasNoRepresentation)&&(o.hasNoRepresentation=!0),o}if(t.hasAttribute("t-log")){const n=t.getAttribute("t-log");t.removeAttribute("t-log");const o=gn(t,e),s={type:13,expr:n,content:o};return(null==o?void 0:o.hasNoRepresentation)&&(s.hasNoRepresentation=!0),s}return null}(t,e)||function(t,e){if(!t.hasAttribute("t-foreach"))return null;const n=t.outerHTML,o=t.getAttribute("t-foreach");t.removeAttribute("t-foreach");const s=t.getAttribute("t-as")||"";t.removeAttribute("t-as");const i=t.getAttribute("t-key");if(!i)throw new r(`"Directive t-foreach should always be used with a t-key!" (expression: t-foreach="${o}" t-as="${s}")`);t.removeAttribute("t-key");const l=t.getAttribute("t-memo")||"";t.removeAttribute("t-memo");const a=gn(t,e);if(!a)return null;const c=!n.includes("t-call"),h=c&&!n.includes(`${s}_first`),u=c&&!n.includes(`${s}_last`),d=c&&!n.includes(`${s}_index`),f=c&&!n.includes(`${s}_value`);return{type:9,collection:o,elem:s,body:a,memo:l,key:i,hasNoFirst:h,hasNoLast:u,hasNoIndex:d,hasNoValue:f}}(t,e)||function(t,e){if(!t.hasAttribute("t-if"))return null;const n=t.getAttribute("t-if");t.removeAttribute("t-if");const o=gn(t,e)||{type:0,value:""};let s=t.nextElementSibling;const r=[];for(;s&&s.hasAttribute("t-elif");){const t=s.getAttribute("t-elif");s.removeAttribute("t-elif");const n=gn(s,e),o=s.nextElementSibling;s.remove(),s=o,n&&r.push({condition:t,content:n})}let i=null;s&&s.hasAttribute("t-else")&&(s.removeAttribute("t-else"),i=gn(s,e),s.remove());return{type:5,condition:n,content:o,tElif:r.length?r:null,tElse:i}}(t,e)||function(t,e){if(!t.hasAttribute("t-portal"))return null;const n=t.getAttribute("t-portal");t.removeAttribute("t-portal");const o=gn(t,e);if(!o)return{type:0,value:""};return{type:18,target:n,content:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call"))return null;const n=t.getAttribute("t-call"),o=t.getAttribute("t-call-context");if(t.removeAttribute("t-call"),t.removeAttribute("t-call-context"),"t"!==t.tagName){const s=gn(t,e),r={type:7,name:n,body:null,context:o};if(s&&2===s.type)return s.content=[r],s;if(s&&11===s.type)return{...s,slots:{default:{content:r,scope:null,on:null,attrs:null,attrsTranslationCtx:null}}}}const s=kn(t,e);return{type:7,name:n,body:s.length?s:null,context:o}}(t,e)||function(t,e){if(!t.hasAttribute("t-call-block"))return null;const n=t.getAttribute("t-call-block");return{type:15,name:n}}(t)||function(t,e){if("off"!==t.getAttribute("t-translation"))return null;t.removeAttribute("t-translation");const n=gn(t,e);if(3===(null==n?void 0:n.type)){return Tn(n.content.map(xn))}return xn(n)}(t,e)||function(t,e){const n=t.getAttribute("t-translation-context");if(!n)return null;t.removeAttribute("t-translation-context");const o=gn(t,e);if(3===(null==o?void 0:o.type)){return Tn(o.content.map((t=>Nn(t,n))))}return Nn(o,n)}(t,e)||function(t,e){if(!t.hasAttribute("t-key"))return null;const n=t.getAttribute("t-key");t.removeAttribute("t-key");const o=gn(t,e);if(!o)return null;const s={type:10,expr:n,content:o};o.hasNoRepresentation&&(s.hasNoRepresentation=!0);return s}(t,e)||function(t,e){if(!t.hasAttribute("t-esc"))return null;const n=t.getAttribute("t-esc");t.removeAttribute("t-esc");const o={type:4,expr:n,defaultValue:t.textContent||""};let s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-out")&&!t.hasAttribute("t-raw"))return null;t.hasAttribute("t-raw")&&console.warn('t-raw has been deprecated in favor of t-out. If the value to render is not wrapped by the "markup" function, it will be escaped');const n=t.getAttribute("t-out")||t.getAttribute("t-raw");t.removeAttribute("t-out"),t.removeAttribute("t-raw");const o={type:8,expr:n,body:null},s=t.getAttribute("t-ref");t.removeAttribute("t-ref");const r=gn(t,e);if(!r)return o;if(2===r.type)return o.body=r.content.length?r.content:null,{...r,ref:s,content:[o]};return o}(t,e)||function(t,e){if(!t.hasAttribute("t-slot"))return null;const n=t.getAttribute("t-slot");t.removeAttribute("t-slot");let o=null,s=null,r=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-on-"))r=r||{},r[e.slice(5)]=n;else if(e.startsWith("t-translation-context-")){s=s||{},s[e.slice(22)]=n}else o=o||{},o[e]=n}return{type:14,name:n,attrs:o,attrsTranslationCtx:s,on:r,defaultContent:En(t,e)}}(t,e)||function(t,e){let n=t.tagName;const o=n[0];let s=t.hasAttribute("t-component");if(s&&"t"!==n)throw new r(`Directive 't-component' can only be used on <t> nodes (used on a <${n}>)`);if(o!==o.toUpperCase()&&!s)return null;s&&(n=t.getAttribute("t-component"),t.removeAttribute("t-component"));const i=t.getAttribute("t-props");t.removeAttribute("t-props");const l=t.getAttribute("t-slot-scope");t.removeAttribute("t-slot-scope");let a=null,c=null,h=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else if(e.startsWith("t-")){if(!e.startsWith("t-on-")){const t=$n.get(e.split("-").slice(0,2).join("-"));throw new r(t||`unsupported directive on Component: ${e}`)}a=a||{},a[e.slice(5)]=n}else c=c||{},c[e]=n}let u=null;if(t.hasChildNodes()){const n=t.cloneNode(!0),o=Array.from(n.querySelectorAll("[t-set-slot]"));for(let t of o){if("t"!==t.tagName)throw new r(`Directive 't-set-slot' can only be used on <t> nodes (used on a <${t.tagName}>)`);const o=t.getAttribute("t-set-slot");let s=t.parentElement,i=!1;for(;s&&s!==n;){if(s.hasAttribute("t-component")||s.tagName[0]===s.tagName[0].toUpperCase()){i=!0;break}s=s.parentElement}if(i||!s)continue;t.removeAttribute("t-set-slot"),t.remove();const l=gn(t,e);let a=null,c=null,h=null,d=null;for(let e of t.getAttributeNames()){const n=t.getAttribute(e);if("t-slot-scope"!==e)if(e.startsWith("t-translation-context-")){h=h||{},h[e.slice(22)]=n}else e.startsWith("t-on-")?(a=a||{},a[e.slice(5)]=n):(c=c||{},c[e]=n);else d=n}u=u||{},u[o]={content:l,on:a,attrs:c,attrsTranslationCtx:h,scope:d}}const s=En(n,e);u=u||{},s&&!u.default&&(u.default={content:s,on:a,attrs:null,attrsTranslationCtx:null,scope:l})}return{type:11,name:n,isDynamic:s,dynamicProps:i,props:c,propsTranslationCtx:h,slots:u,on:a}}(t,e)||function(t,e){const{tagName:n}=t,o=t.getAttribute("t-tag");if(t.removeAttribute("t-tag"),"t"===n&&!o)return null;if(n.startsWith("block-"))throw new r(`Invalid tag name: '${n}'`);e=Object.assign({},e),"pre"===n&&(e.inPreTag=!0);let s=!e.nameSpace&&wn.has(n)?"http://www.w3.org/2000/svg":null;const i=t.getAttribute("t-ref");t.removeAttribute("t-ref");const l=t.getAttributeNames();let a=null,c=null,h=null,u=null;for(let o of l){const i=t.getAttribute(o);if("t-on"===o||"t-on-"===o)throw new r("Missing event name with t-on directive");if(o.startsWith("t-on-"))h=h||{},h[o.slice(5)]=i;else if(o.startsWith("t-model")){if(!["input","select","textarea"].includes(n))throw new r("The t-model directive only works with <input>, <textarea> and <select>");let s,l;if(vn.test(i)){const t=i.lastIndexOf(".");s=i.slice(0,t),l=`'${i.slice(t+1)}'`}else{if(!yn.test(i))throw new r(`Invalid t-model expression: "${i}" (it should be assignable)`);{const t=i.lastIndexOf("[");s=i.slice(0,t),l=i.slice(t+1,-1)}}const a=t.getAttribute("type"),c="input"===n,h="select"===n,d=c&&"checkbox"===a,f=c&&"radio"===a,p=o.includes(".trim"),m=p||o.includes(".lazy");u={baseExpr:s,expr:l,targetAttr:d?"checked":"value",specialInitTargetAttr:f?"checked":null,eventType:f?"click":h||m?"change":"input",hasDynamicChildren:!1,shouldTrim:p,shouldNumberize:o.includes(".number")},h&&((e=Object.assign({},e)).tModelInfo=u)}else{if(o.startsWith("block-"))throw new r(`Invalid attribute: '${o}'`);if("xmlns"===o)s=i;else if(o.startsWith("t-translation-context-")){c=c||{},c[o.slice(22)]=i}else if("t-name"!==o){if(o.startsWith("t-")&&!o.startsWith("t-att"))throw new r(`Unknown QWeb directive: '${o}'`);const t=e.tModelInfo;t&&["t-att-value","t-attf-value"].includes(o)&&(t.hasDynamicChildren=!0),a=a||{},a[o]=i}}}s&&(e.nameSpace=s);const d=kn(t,e);return{type:2,tag:n,dynamicTag:o,attrs:a,attrsTranslationCtx:c,on:h,ref:i,content:d,model:u,ns:s}}(t,e)||function(t,e){if(!t.hasAttribute("t-set"))return null;const n=t.getAttribute("t-set"),o=t.getAttribute("t-value")||null,s=t.innerHTML===t.textContent&&t.textContent||null;let r=null;t.textContent!==t.innerHTML&&(r=kn(t,e));return{type:6,name:n,value:o,defaultValue:s,body:r,hasNoRepresentation:!0}}(t,e)||function(t,e){if("t"!==t.tagName)return null;return En(t,e)}(t,e):function(t,e){if(t.nodeType===Node.TEXT_NODE){let n=t.textContent||"";return e.inPreTag||!bn.test(n)||n.trim()?{type:0,value:n}:null}if(t.nodeType===Node.COMMENT_NODE)return{type:1,value:t.textContent||""};return null}(t,e)}const bn=/[\r\n]/;const vn=/\.[\w_]+\s*$/,yn=/\[[^\[]+\]\s*$/,wn=new Set(["svg","g","path"]);const $n=new Map([["t-ref","t-ref is no longer supported on components. Consider exposing only the public part of the component's API through a callback prop."],["t-att","t-att makes no sense on component: props are already treated as expressions"],["t-attf","t-attf is not supported on components: use template strings for string interpolation in props"]]);function xn(t){const e={type:16,content:t};return(null==t?void 0:t.hasNoRepresentation)&&(e.hasNoRepresentation=!0),e}function Nn(t,e){const n={type:17,content:t,translationCtx:e};return(null==t?void 0:t.hasNoRepresentation)&&(n.hasNoRepresentation=!0),n}function kn(t,e){const n=[];for(let o of t.childNodes){const t=gn(o,e);t&&(3===t.type?n.push(...t.content):n.push(t))}return n}function Tn(t){const e={type:3,content:t};return t.every((t=>t.hasNoRepresentation))&&(e.hasNoRepresentation=!0),e}function En(t,e){const n=kn(t,e);switch(n.length){case 0:return null;case 1:return n[0];default:return Tn(n)}}function An(t,e={hasGlobalValues:!1}){const n=function(t,e){const n={inPreTag:!1,customDirectives:e};if("string"==typeof t)return mn(Pe(`<t>${t}</t>`).firstChild,n);let o=pn.get(t);return o||(o=mn(t.cloneNode(!0),n),pn.set(t,o)),o}(t,e.customDirectives),o=t instanceof Node?!(t instanceof Element)||null===t.querySelector("[t-set], [t-call]"):!t.includes("t-set")&&!t.includes("t-call"),s=new fn(n,{...e,hasSafeContext:o}).generateCode();try{return new Function("app, bdom, helpers",s)}catch(t){const{name:n}=e,o=new r(`Failed to compile ${n?`template "${n}"`:"anonymous template"}: ${t.message}\n\ngenerated code:\nfunction(app, bdom, helpers) {\n${s}\n}`);throw o.cause=t,o}}let _n;"undefined"!=typeof window&&(_n=window.requestAnimationFrame.bind(window));class Cn{constructor(){this.tasks=new Set,this.frame=0,this.delayedRenders=[],this.cancelledNodes=new Set,this.processing=!1,this.requestAnimationFrame=Cn.requestAnimationFrame}addFiber(t){this.tasks.add(t.root)}scheduleDestroy(t){this.cancelledNodes.add(t),0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}flush(){if(this.delayedRenders.length){let t=this.delayedRenders;this.delayedRenders=[];for(let e of t)e.root&&3!==e.node.status&&e.node.fiber===e&&e.render()}0===this.frame&&(this.frame=this.requestAnimationFrame((()=>this.processTasks())))}processTasks(){if(!this.processing){this.processing=!0,this.frame=0;for(let t of this.cancelledNodes)t._destroy();this.cancelledNodes.clear();for(let t of this.tasks)this.processFiber(t);for(let t of this.tasks)3===t.node.status&&this.tasks.delete(t);this.processing=!1}}processFiber(t){if(t.root!==t)return void this.tasks.delete(t);const e=xt.has(t);e&&0!==t.counter?this.tasks.delete(t):3!==t.node.status?0===t.counter&&(e||t.complete(),t.appliedToDom&&this.tasks.delete(t)):this.tasks.delete(t)}}Cn.requestAnimationFrame=_n;let Dn=!1;const Sn=new Set;"undefined"!=typeof window&&(window.__OWL_DEVTOOLS__||(window.__OWL_DEVTOOLS__={apps:Sn,Fiber:_t,RootFiber:Ct,toRaw:Ft,reactive:Yt}));class On extends Me{constructor(t,e={}){super(e),this.scheduler=new Cn,this.subRoots=new Set,this.root=null,this.name=e.name||"",this.Root=t,Sn.add(this),e.test&&(this.dev=!0),this.warnIfNoStaticProps=e.warnIfNoStaticProps||!1,!this.dev||e.test||Dn||(console.info("Owl is running in 'dev' mode."),Dn=!0);const n=e.env||{},o=Object.getOwnPropertyDescriptors(n);this.env=Object.freeze(Object.create(Object.getPrototypeOf(n),o)),this.props=e.props||{}}mount(t,e){const n=this.createRoot(this.Root,{props:this.props});return this.root=n.node,this.subRoots.delete(n.node),n.mount(t,e)}createRoot(t,e={}){const n=e.props||{},o=this.env;e.env&&(this.env=e.env);const s=function(){let t=se;return()=>{se=t}}(),r=this.makeNode(t,n);return s(),e.env&&(this.env=o),this.subRoots.add(r),{node:r,mount:(e,o)=>{On.validateTarget(e),this.dev&&Le(t,n,{__owl__:{app:this}});return this.mountNode(r,e,o)},destroy:()=>{this.subRoots.delete(r),r.destroy(),this.scheduler.processTasks()}}}makeNode(t,e){return new ue(t,e,this,null,null)}mountNode(t,e,n){const o=new Promise(((e,n)=>{let o=!1;t.mounted.push((()=>{e(t.component),o=!0}));let s=Nt.get(t);s||(s=[],Nt.set(t,s)),s.unshift((t=>{throw o||n(t),t}))}));return t.mountComponent(e,n),o}destroy(){if(this.root){for(let t of this.subRoots)t.destroy();this.root.destroy(),this.scheduler.processTasks()}Sn.delete(this)}createComponent(t,e,n,o,s){const i=!e;let l;const a=0===s.length;l=n?(t,e)=>!0:o?function(t,e){for(let n in t)if(t[n]!==e[n])return!0;return Object.keys(t).length!==Object.keys(e).length}:a?(t,e)=>!1:function(t,e){for(let n of s)if(t[n]!==e[n])return!0;return!1};const c=ue.prototype.updateAndRender,h=ue.prototype.initiateRender;return(n,o,s,a,u)=>{let d=s.children,f=d[o];i&&f&&f.component.constructor!==u&&(f=void 0);const p=s.fiber;if(f)(l(f.props,n)||p.deep||f.forceNextRender)&&(f.forceNextRender=!1,c.call(f,n,p));else{if(e){const e=a.constructor.components;if(!e)throw new r(`Cannot find the definition of component "${t}", missing static components key in parent`);if(!(u=e[t]))throw new r(`Cannot find the definition of component "${t}"`);if(!(u.prototype instanceof ve))throw new r(`"${t}" is not a Component. It must inherit from the Component class`)}f=new ue(u,n,this,s,o),d[o]=f,h.call(f,new _t(f,p))}return p.childrenMap[o]=f,f}}handleError(...t){return Tt(...t)}}On.validateTarget=function(t){const e=t&&t.ownerDocument;if(e){if(!e.defaultView)throw new r("Cannot mount a component: the target document is not attached to a window (defaultView is missing)");if(t instanceof e.defaultView.HTMLElement||t instanceof ShadowRoot){if(!function(t,e){let n=t;const o=e.defaultView.ShadowRoot;for(;n;){if(n===e)return!0;if(n.parentNode)n=n.parentNode;else{if(!(n instanceof o&&n.host))return!1;n=n.host}}return!1}(t,e))throw new r("Cannot mount a component on a detached dom node");return}}throw new r("Cannot mount component: the target is not a valid DOM element")},On.apps=Sn,On.version="2.8.3";function Rn(t,e){const n=Object.create(t),o=Object.getOwnPropertyDescriptors(e);return Object.freeze(Object.defineProperties(n,o))}function Ln(t){const e=re();e.childEnv=Rn(e.childEnv,t)}n.shouldNormalizeDom=!1,n.mainEventHandler=(t,n,o)=>{const{data:s,modifiers:i}=e(t);t=s;let l=!1;if(i.length){let t=!1;const e=n.target===o;for(const o of i)switch(o){case"self":if(t=!0,e)continue;return l;case"prevent":(t&&e||!t)&&n.preventDefault();continue;case"stop":(t&&e||!t)&&n.stopPropagation(),l=!0;continue}}if(Object.hasOwnProperty.call(t,0)){const e=t[0];if("function"!=typeof e)throw new r(`Invalid handler (expected a function, received: '${e}')`);let o=t[1]?t[1].__owl__:null;o&&1!==o.status||e.call(o?o.component:null,n)}return l};const Bn={config:n,mount:$t,patch:function(t,e,n=!1){t.patch(e,n)},remove:function(t,e=!1){e&&t.beforeRemove(),t.remove()},list:bt,multi:j,text:z,toggler:s,createBlock:nt,html:wt,comment:H},Pn={version:On.version};Me.prototype._compileTemplate=function(t,e){return An(e,{name:t,dev:this.dev,translateFn:this.translateFn,translatableAttributes:this.translatableAttributes,customDirectives:this.customDirectives,hasGlobalValues:this.hasGlobalValues})},t.App=On,t.Component=ve,t.EventBus=N,t.OwlError=r,t.__info__=Pn,t.batched=$,t.blockDom=Bn,t.htmlEscape=T,t.loadFile=async function(t){const e=await fetch(t);if(!e.ok)throw new r("Error while fetching xml templates");return await e.text()},t.markRaw=Vt,t.markup=E,t.mount=async function(t,e,n={}){return new On(t,n).mount(e,n)},t.onError=function(t){const e=re();let n=Nt.get(e);n||(n=[],Nt.set(e,n)),n.push(t.bind(e.component))},t.onMounted=me,t.onPatched=ge,t.onRendered=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onRendered"),e.renderFn=()=>{const e=n();return t(),e}},t.onWillDestroy=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willDestroy.push(n(t.bind(e.component),"onWillDestroy"))},t.onWillPatch=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willPatch.unshift(n(t.bind(e.component),"onWillPatch"))},t.onWillRender=function(t){const e=re(),n=e.renderFn,o=e.app.dev?pe:t=>t;t=o(t.bind(e.component),"onWillRender"),e.renderFn=()=>(t(),n())},t.onWillStart=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willStart.push(n(t.bind(e.component),"onWillStart"))},t.onWillUnmount=be,t.onWillUpdateProps=function(t){const e=re(),n=e.app.dev?pe:t=>t;e.willUpdateProps.push(n(t.bind(e.component),"onWillUpdateProps"))},t.reactive=Yt,t.status=function(t){switch(t.__owl__.status){case 0:return"new";case 2:return"cancelled";case 1:return"mounted";case 3:return"destroyed"}},t.toRaw=Ft,t.useChildSubEnv=Ln,t.useComponent=function(){return se.component},t.useEffect=function(t,e=(()=>[NaN])){let n,o;me((()=>{o=e(),n=t(...o)})),ge((()=>{const s=e();s.some(((t,e)=>t!==o[e]))&&(o=s,n&&n(),n=t(...o))})),be((()=>n&&n()))},t.useEnv=function(){return re().component.env},t.useExternalListener=function(t,e,n,o){const s=re(),r=n.bind(s.component);me((()=>t.addEventListener(e,r,o))),be((()=>t.removeEventListener(e,r,o)))},t.useRef=function(t){const e=re().refs;return{get el(){const n=e[t];return x(n)?n:null}}},t.useState=ae,t.useSubEnv=function(t){const e=re();e.component.env=Rn(e.component.env,t),Ln(t)},t.validate=function(t,e){let n=_e(t,e);if(n.length)throw new r("Invalid object: "+n.join(", "))},t.validateType=Ce,t.whenReady=function(t){return new Promise((function(t){"loading"!==document.readyState?t(!0):document.addEventListener("DOMContentLoaded",t,!1)})).then(t||function(){})},t.xml=We,Object.defineProperty(t,"__esModule",{value:!0}),Pn.date="2026-03-30T13:05:32.099Z",Pn.hash="efae3e4",Pn.url="https://github.com/odoo/owl"}(globalThis.owl=globalThis.owl||{});
9
9
 
10
- var NodexUIBundle=(()=>{var ol=Object.create;var wn=Object.defineProperty;var rl=Object.getOwnPropertyDescriptor;var nl=Object.getOwnPropertyNames;var il=Object.getPrototypeOf,al=Object.prototype.hasOwnProperty;var cl=(t,e,s)=>e in t?wn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var _n=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,s)=>(typeof require<"u"?require:e)[s]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Bt=(t,e,s)=>()=>{if(s)throw s[0];try{return t&&(e=t(t=0)),e}catch(o){throw s=[o],o}};var ll=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(s){throw e=0,s}},Mn=(t,e)=>{for(var s in e)wn(t,s,{get:e[s],enumerable:!0})},oa=(t,e,s,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of nl(e))!al.call(t,r)&&r!==s&&wn(t,r,{get:()=>e[r],enumerable:!(o=rl(e,r))||o.enumerable});return t};var Sn=(t,e,s)=>(s=t!=null?ol(il(t)):{},oa(e||!t||!t.__esModule?wn(s,"default",{value:t,enumerable:!0}):s,t)),ul=t=>oa(wn({},"__esModule",{value:!0}),t);var n=(t,e,s)=>cl(t,typeof e!="symbol"?e+"":e,s);function hl(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function gi(t,e,s={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:s}))}function ml(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function bl(t,e){return e===document||e===t||e.contains(t)}function fl(t,e={}){return!e.allowBootstrapControl&&t.matches(dl)}function na(t){return m.version=t,m}function ra(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let s of e)for(let o of s.addedNodes)o instanceof Element&&m.mountAll(o)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function ia(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{m.mountAll(),ra()},{once:!0}):(m.mountAll(),ra()))}var pl,fi,An,Un,dl,vi,m,j=Bt(()=>{pl="__NODEXUI_VERSION__",fi=new Map,An=new WeakMap,Un="[b-ui], [b-icon]",dl="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";vi=typeof window<"u"?window.thebase:void 0,m=vi?.register?vi:Object.assign(vi||{},{version:pl,register(t,e){if(!t||!e)throw new Error("NodexUI.register requires a name and component definition.");return fi.set(t,e),this},component(t){return fi.get(t)},mount(t,e={}){let s=hl(t);if(!s||fl(s,e))return null;let o=ml(s,e),r=fi.get(o);if(!r)return null;let a=An.get(s);if(a?.name===o)return a;a&&(a.destroy?.(),An.delete(s),gi(s,"nodexui:destroyed",{name:a.name}));let l=r.mount?.(s,this,e)||{},u={name:o,element:s,destroy:l.destroy};return An.set(s,u),gi(s,"nodexui:mounted",{name:o,instance:u}),u},mountAll(t=document){let e=t||document,s=[...e.querySelectorAll?.(Un)||[]];return e instanceof Element&&e.matches(Un)&&s.unshift(e),s.map(o=>this.mount(o)).filter(Boolean)},destroy(t=document){let e=t||document,s=[...e.querySelectorAll?.(Un)||[]];e instanceof Element&&e.matches(Un)&&s.unshift(e);for(let o of s){let r=An.get(o);r&&bl(o,e)&&(r.destroy?.(),An.delete(o),gi(o,"nodexui:destroyed",{name:r.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[s,o]of Object.entries(t||{})){let r=s==="radius"||s==="--b-radius"?"--base-radius":s.startsWith("--")?s:`--b-${s}`;e.style.setProperty(r,o)}}}});typeof window<"u"&&(window.thebase=m,window.NodexUI=m)});function g(...t){let e=[];for(let s of t)if(s){if(typeof s=="string")e.push(s);else if(Array.isArray(s)){let o=g(...s);o&&e.push(o)}else if(typeof s=="object")for(let[o,r]of Object.entries(s))r&&e.push(o)}return e.join(" ")}function i(t){return{type:t,optional:!0}}function xt(t,e,s){return t[e]??(s?t[s]:void 0)}function mt(t){return t===!0||t==="open"||t==="on"||t==="active"}function ft(...t){let e=[];for(let s of t)if(s){if(typeof s=="string"){let o=s.trim().replace(/;$/,"");o&&e.push(o)}else if(typeof s=="object")for(let[o,r]of Object.entries(s)){if(r==null||r==="")continue;let a=o.replace(/[A-Z]/g,l=>"-"+l.toLowerCase());e.push(`${a}:${r}`)}}return e.join(";")}function ut(t){return t.state!==void 0?mt(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function Ms(t){return t.state!==void 0||t.open!==void 0}var p,_=Bt(()=>{p={className:i(String),style:i([String,Object]),slots:i(Object)}});var Q,ca,la,ua,pa,da,ha,ma,ba,Fe,fa,Pn,xi,ga,tt,ct,va,He,xa,ya,Tt,st,pt,wa,Sa,Aa,Z,Ea,Ct,Ca,Us,z,M,La,ka,Na,Ta,qn,yi=Bt(()=>{Q=globalThis.owl;if(!Q)throw new Error("NodexUI: load dist/nodexui.min.js or dist/nodexui.esm.js before this script (globalThis.owl is not set).");ca=Q.App,la=Q.Component,ua=Q.EventBus,pa=Q.OwlError,da=Q.__info__,ha=Q.batched,ma=Q.blockDom,ba=Q.htmlEscape,Fe=Q.loadFile,fa=Q.markRaw,Pn=Q.markup,xi=Q.mount,ga=Q.onError,tt=Q.onMounted,ct=Q.onPatched,va=Q.onRendered,He=Q.onWillDestroy,xa=Q.onWillPatch,ya=Q.onWillRender,Tt=Q.onWillStart,st=Q.onWillUnmount,pt=Q.onWillUpdateProps,wa=Q.reactive,Sa=Q.status,Aa=Q.toRaw,Z=Q.useChildSubEnv,Ea=Q.useComponent,Ct=Q.useEffect,Ca=Q.useEnv,Us=Q.useExternalListener,z=Q.useRef,M=Q.useState,La=Q.useSubEnv,ka=Q.validate,Na=Q.validateType,Ta=Q.whenReady,qn=Q.xml});function wi(t){Object.assign(En,t)}function yl(t){let e=t.components;e?e!==En&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,En):t.components=Object.create(En)}function Oa(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,s,o="",r="")=>`<${s}${wl(s,o)}${r}>`)}function wl(t,e){let s=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),o=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(r,a,l,u,d)=>`${a}${l}=${u}${Cl(d)}${u}`);return o=o.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(r,a,l,u,d)=>Ll(t,a,l,u,d,o)),s?Sl(o):o}function Sl(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,s,o,r,a)=>o.startsWith("t-")||o==="t-props"||El(a)?e:`${s}${o}=${r}${Al(a)}${r}`)}function Al(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function El(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function Cl(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,s,o)=>`\${${s||o}}`)}\``}function Ll(t,e,s,o,r,a){let l=/^(Checkbox|Switch)$/.test(t),u=kl(t,s),d=l?"checked":"value",b=new RegExp(`\\s${d}\\s*=`).test(a)?"":`${e}${d}=${o}${r}${o}`,x=new RegExp(`\\s${u}\\s*=`).test(a)?"":`${e}${u}=${o}${Nl(r,s,l)}${o}`;return`${b}${x}`}function kl(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(t)?"onInput":"onChange"}function Nl(t,e,s){if(s)return`(value) => { ${t} = value; }`;let o="value";return e.includes(".trim")&&(o=`(typeof ${o} === 'string' ? ${o}.trim() : ${o})`),e.includes(".number")&&(o=`Number.isNaN(Number(${o})) ? ${o} : Number(${o})`),`(value) => { ${t} = ${o}; }`}function Si(t,...e){return Array.isArray(t?.raw)?qn({raw:t.raw.map(Oa)},...e):qn(t,...e)}function Ps(t,e,s={}){let o=Oa(s.templates);return t.components={...En,...t.components||{}},xi(t,e,o===s.templates?s:{...s,templates:o})}async function Tl(t){let e=await(await fetch(t,{cache:"reload"})).text(),o=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return o?o.innerHTML:e}var vl,xl,En,c,q=Bt(()=>{yi();yi();vl=xi,xl=qn,En={};c=class extends la{constructor(...e){super(...e),yl(this.constructor)}}});function Rl(t){return typeof Image>"u"?Promise.resolve(!0):(Ai.has(t)||Ai.set(t,new Promise(e=>{let s=new Image;s.onload=()=>e(!0),s.onerror=()=>e(!1),s.src=t})),Ai.get(t))}function Dn(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function Cn(t,e={}){let s=Dn(t);if(!Il.test(s))throw new Error(`NodexUI icon name is invalid: ${t}`);return`${String(e.baseUrl||m.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${s}.svg`}function dt(t,e,s={}){let o=s.url||Cn(e,s),r=s.label??t.getAttribute("aria-label")??"";t.classList.add("b-icon"),t.style.setProperty("--b-icon-url",`url("${o.replace(/"/g,"%22")}")`),(s.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",s.size||t.getAttribute("b-att-size")),r?(t.setAttribute("role","img"),t.setAttribute("aria-label",r)):t.setAttribute("aria-hidden","true");let a=s.fallback===!1?null:s.fallback||jn;return a&&!s.url&&Dn(e)!==Dn(a)&&Rl(o).then(l=>{if(l||!t.isConnected)return;let u=Cn(a,s);t.style.setProperty("--b-icon-url",`url("${u.replace(/"/g,"%22")}")`)}),t}var Ia,Ol,jn,Il,Ai,Mt=Bt(()=>{j();Ia="1.31.0",Ol=`https://cdn.jsdelivr.net/npm/lucide-static@${Ia}/icons`,jn="file",Il=/^[a-z0-9][a-z0-9-]*$/,Ai=new Map;m.icons={...m.icons||{},lucide:{version:Ia,cdnBaseUrl:Ol,normalizeName:Dn,url:Cn,render:dt}}});var gt,yt,un=Bt(()=>{gt={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},yt={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"}});function zn({variant:t="default",size:e,className:s}={}){return g("btn","b-button","b-clipboard-button",gt[t]||gt.default,yt[e],s)}async function pn(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("NodexUI ClipboardButton: no clipboard API available in this environment.");let s=document.createElement("textarea");s.value=e,s.setAttribute("readonly",""),s.style.position="fixed",s.style.opacity="0",s.style.pointerEvents="none",document.body.append(s),s.select(),s.setSelectionRange(0,e.length);let o;try{o=document.execCommand("copy")}catch{o=!1}if(s.remove(),!o)throw new Error("NodexUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var Ei,Fn=Bt(()=>{_();un();Ei=["btn","b-button","b-clipboard-button",...Object.values(gt),...Object.values(yt)]});var tc=ll((Qa,Xa)=>{var Ya=(function(){var t=function(A,P){var N=236,R=17,y=A,B=s[P],f=null,h=0,$=null,C=[],T={},Y=function(w,E){h=y*4+17,f=(function(v){for(var L=new Array(v),k=0;k<v;k+=1){L[k]=new Array(v);for(var F=0;F<v;F+=1)L[k][F]=null}return L})(h),X(0,0),X(h-7,0),X(0,h-7),vt(),lt(),Xt(w,E),y>=7&&_t(w),$==null&&($=el(y,B,C)),te($,E)},X=function(w,E){for(var v=-1;v<=7;v+=1)if(!(w+v<=-1||h<=w+v))for(var L=-1;L<=7;L+=1)E+L<=-1||h<=E+L||(0<=v&&v<=6&&(L==0||L==6)||0<=L&&L<=6&&(v==0||v==6)||2<=v&&v<=4&&2<=L&&L<=4?f[w+v][E+L]=!0:f[w+v][E+L]=!1)},it=function(){for(var w=0,E=0,v=0;v<8;v+=1){Y(!0,v);var L=r.getLostPoint(T);(v==0||w>L)&&(w=L,E=v)}return E},lt=function(){for(var w=8;w<h-8;w+=1)f[w][6]==null&&(f[w][6]=w%2==0);for(var E=8;E<h-8;E+=1)f[6][E]==null&&(f[6][E]=E%2==0)},vt=function(){for(var w=r.getPatternPosition(y),E=0;E<w.length;E+=1)for(var v=0;v<w.length;v+=1){var L=w[E],k=w[v];if(f[L][k]==null)for(var F=-2;F<=2;F+=1)for(var K=-2;K<=2;K+=1)F==-2||F==2||K==-2||K==2||F==0&&K==0?f[L+F][k+K]=!0:f[L+F][k+K]=!1}},_t=function(w){for(var E=r.getBCHTypeNumber(y),v=0;v<18;v+=1){var L=!w&&(E>>v&1)==1;f[Math.floor(v/3)][v%3+h-8-3]=L}for(var v=0;v<18;v+=1){var L=!w&&(E>>v&1)==1;f[v%3+h-8-3][Math.floor(v/3)]=L}},Xt=function(w,E){for(var v=B<<3|E,L=r.getBCHTypeInfo(v),k=0;k<15;k+=1){var F=!w&&(L>>k&1)==1;k<6?f[k][8]=F:k<8?f[k+1][8]=F:f[h-15+k][8]=F}for(var k=0;k<15;k+=1){var F=!w&&(L>>k&1)==1;k<8?f[8][h-k-1]=F:k<9?f[8][15-k-1+1]=F:f[8][15-k-1]=F}f[h-8][8]=!w},te=function(w,E){for(var v=-1,L=h-1,k=7,F=0,K=r.getMaskFunction(E),W=h-1;W>0;W-=2)for(W==6&&(W-=1);;){for(var at=0;at<2;at+=1)if(f[L][W-at]==null){var ht=!1;F<w.length&&(ht=(w[F]>>>k&1)==1);var J=K(L,W-at);J&&(ht=!ht),f[L][W-at]=ht,k-=1,k==-1&&(F+=1,k=7)}if(L+=v,L<0||h<=L){L-=v,v=-v;break}}},cn=function(w,E){for(var v=0,L=0,k=0,F=new Array(E.length),K=new Array(E.length),W=0;W<E.length;W+=1){var at=E[W].dataCount,ht=E[W].totalCount-at;L=Math.max(L,at),k=Math.max(k,ht),F[W]=new Array(at);for(var J=0;J<F[W].length;J+=1)F[W][J]=255&w.getBuffer()[J+v];v+=at;var kt=r.getErrorCorrectPolynomial(ht),Nt=l(F[W],kt.getLength()-1),ta=Nt.mod(kt);K[W]=new Array(kt.getLength()-1);for(var J=0;J<K[W].length;J+=1){var ea=J+ta.getLength()-K[W].length;K[W][J]=ea>=0?ta.getAt(ea):0}}for(var sa=0,J=0;J<E.length;J+=1)sa+=E[J].totalCount;for(var bi=new Array(sa),$n=0,J=0;J<L;J+=1)for(var W=0;W<E.length;W+=1)J<F[W].length&&(bi[$n]=F[W][J],$n+=1);for(var J=0;J<k;J+=1)for(var W=0;W<E.length;W+=1)J<K[W].length&&(bi[$n]=K[W][J],$n+=1);return bi},el=function(w,E,v){for(var L=u.getRSBlocks(w,E),k=d(),F=0;F<v.length;F+=1){var K=v[F];k.put(K.getMode(),4),k.put(K.getLength(),r.getLengthInBits(K.getMode(),w)),K.write(k)}for(var W=0,F=0;F<L.length;F+=1)W+=L[F].dataCount;if(k.getLengthInBits()>W*8)throw"code length overflow. ("+k.getLengthInBits()+">"+W*8+")";for(k.getLengthInBits()+4<=W*8&&k.put(0,4);k.getLengthInBits()%8!=0;)k.putBit(!1);for(;!(k.getLengthInBits()>=W*8||(k.put(N,8),k.getLengthInBits()>=W*8));)k.put(R,8);return cn(k,L)};T.addData=function(w,E){E=E||"Byte";var v=null;switch(E){case"Numeric":v=b(w);break;case"Alphanumeric":v=x(w);break;case"Byte":v=S(w);break;case"Kanji":v=I(w);break;default:throw"mode:"+E}C.push(v),$=null},T.isDark=function(w,E){if(w<0||h<=w||E<0||h<=E)throw w+","+E;return f[w][E]},T.getModuleCount=function(){return h},T.make=function(){if(y<1){for(var w=1;w<40;w++){for(var E=u.getRSBlocks(w,B),v=d(),L=0;L<C.length;L++){var k=C[L];v.put(k.getMode(),4),v.put(k.getLength(),r.getLengthInBits(k.getMode(),w)),k.write(v)}for(var F=0,L=0;L<E.length;L++)F+=E[L].dataCount;if(v.getLengthInBits()<=F*8)break}y=w}Y(!1,it())},T.createTableTag=function(w,E){w=w||2,E=typeof E>"u"?w*4:E;var v="";v+='<table style="',v+=" border-width: 0px; border-style: none;",v+=" border-collapse: collapse;",v+=" padding: 0px; margin: "+E+"px;",v+='">',v+="<tbody>";for(var L=0;L<T.getModuleCount();L+=1){v+="<tr>";for(var k=0;k<T.getModuleCount();k+=1)v+='<td style="',v+=" border-width: 0px; border-style: none;",v+=" border-collapse: collapse;",v+=" padding: 0px; margin: 0px;",v+=" width: "+w+"px;",v+=" height: "+w+"px;",v+=" background-color: ",v+=T.isDark(L,k)?"#000000":"#ffffff",v+=";",v+='"/>';v+="</tr>"}return v+="</tbody>",v+="</table>",v},T.createSvgTag=function(w,E,v,L){var k={};typeof arguments[0]=="object"&&(k=arguments[0],w=k.cellSize,E=k.margin,v=k.alt,L=k.title),w=w||2,E=typeof E>"u"?w*4:E,v=typeof v=="string"?{text:v}:v||{},v.text=v.text||null,v.id=v.text?v.id||"qrcode-description":null,L=typeof L=="string"?{text:L}:L||{},L.text=L.text||null,L.id=L.text?L.id||"qrcode-title":null;var F=T.getModuleCount()*w+E*2,K,W,at,ht,J="",kt;for(kt="l"+w+",0 0,"+w+" -"+w+",0 0,-"+w+"z ",J+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',J+=k.scalable?"":' width="'+F+'px" height="'+F+'px"',J+=' viewBox="0 0 '+F+" "+F+'" ',J+=' preserveAspectRatio="xMinYMin meet"',J+=L.text||v.text?' role="img" aria-labelledby="'+ln([L.id,v.id].join(" ").trim())+'"':"",J+=">",J+=L.text?'<title id="'+ln(L.id)+'">'+ln(L.text)+"</title>":"",J+=v.text?'<description id="'+ln(v.id)+'">'+ln(v.text)+"</description>":"",J+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',J+='<path d="',at=0;at<T.getModuleCount();at+=1)for(ht=at*w+E,K=0;K<T.getModuleCount();K+=1)T.isDark(at,K)&&(W=K*w+E,J+="M"+W+","+ht+kt);return J+='" stroke="transparent" fill="black"/>',J+="</svg>",J},T.createDataURL=function(w,E){w=w||2,E=typeof E>"u"?w*4:E;var v=T.getModuleCount()*w+E*2,L=E,k=v-E;return rt(v,v,function(F,K){if(L<=F&&F<k&&L<=K&&K<k){var W=Math.floor((F-L)/w),at=Math.floor((K-L)/w);return T.isDark(at,W)?0:1}else return 1})},T.createImgTag=function(w,E,v){w=w||2,E=typeof E>"u"?w*4:E;var L=T.getModuleCount()*w+E*2,k="";return k+="<img",k+=' src="',k+=T.createDataURL(w,E),k+='"',k+=' width="',k+=L,k+='"',k+=' height="',k+=L,k+='"',v&&(k+=' alt="',k+=ln(v),k+='"'),k+="/>",k};var ln=function(w){for(var E="",v=0;v<w.length;v+=1){var L=w.charAt(v);switch(L){case"<":E+="&lt;";break;case">":E+="&gt;";break;case"&":E+="&amp;";break;case'"':E+="&quot;";break;default:E+=L;break}}return E},sl=function(w){var E=1;w=typeof w>"u"?E*2:w;var v=T.getModuleCount()*E+w*2,L=w,k=v-w,F,K,W,at,ht,J={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},kt={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},Nt="";for(F=0;F<v;F+=2){for(W=Math.floor((F-L)/E),at=Math.floor((F+1-L)/E),K=0;K<v;K+=1)ht="\u2588",L<=K&&K<k&&L<=F&&F<k&&T.isDark(W,Math.floor((K-L)/E))&&(ht=" "),L<=K&&K<k&&L<=F+1&&F+1<k&&T.isDark(at,Math.floor((K-L)/E))?ht+=" ":ht+="\u2588",Nt+=w<1&&F+1>=k?kt[ht]:J[ht];Nt+=`
11
- `}return v%2&&w>0?Nt.substring(0,Nt.length-v-1)+Array(v+1).join("\u2580"):Nt.substring(0,Nt.length-1)};return T.createASCII=function(w,E){if(w=w||1,w<2)return sl(E);w-=1,E=typeof E>"u"?w*2:E;var v=T.getModuleCount()*w+E*2,L=E,k=v-E,F,K,W,at,ht=Array(w+1).join("\u2588\u2588"),J=Array(w+1).join(" "),kt="",Nt="";for(F=0;F<v;F+=1){for(W=Math.floor((F-L)/w),Nt="",K=0;K<v;K+=1)at=1,L<=K&&K<k&&L<=F&&F<k&&T.isDark(W,Math.floor((K-L)/w))&&(at=0),Nt+=at?ht:J;for(W=0;W<w;W+=1)kt+=Nt+`
12
- `}return kt.substring(0,kt.length-1)},T.renderTo2dContext=function(w,E){E=E||2;for(var v=T.getModuleCount(),L=0;L<v;L++)for(var k=0;k<v;k++)w.fillStyle=T.isDark(L,k)?"black":"white",w.fillRect(L*E,k*E,E,E)},T};t.stringToBytesFuncs={default:function(A){for(var P=[],N=0;N<A.length;N+=1){var R=A.charCodeAt(N);P.push(R&255)}return P}},t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(A,P){var N=(function(){for(var y=D(A),B=function(){var lt=y.read();if(lt==-1)throw"eof";return lt},f=0,h={};;){var $=y.read();if($==-1)break;var C=B(),T=B(),Y=B(),X=String.fromCharCode($<<8|C),it=T<<8|Y;h[X]=it,f+=1}if(f!=P)throw f+" != "+P;return h})(),R=63;return function(y){for(var B=[],f=0;f<y.length;f+=1){var h=y.charCodeAt(f);if(h<128)B.push(h);else{var $=N[y.charAt(f)];typeof $=="number"?($&255)==$?B.push($):(B.push($>>>8),B.push($&255)):B.push(R)}}return B}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},s={L:1,M:0,Q:3,H:2},o={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},r=(function(){var A=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],P=1335,N=7973,R=21522,y={},B=function(f){for(var h=0;f!=0;)h+=1,f>>>=1;return h};return y.getBCHTypeInfo=function(f){for(var h=f<<10;B(h)-B(P)>=0;)h^=P<<B(h)-B(P);return(f<<10|h)^R},y.getBCHTypeNumber=function(f){for(var h=f<<12;B(h)-B(N)>=0;)h^=N<<B(h)-B(N);return f<<12|h},y.getPatternPosition=function(f){return A[f-1]},y.getMaskFunction=function(f){switch(f){case o.PATTERN000:return function(h,$){return(h+$)%2==0};case o.PATTERN001:return function(h,$){return h%2==0};case o.PATTERN010:return function(h,$){return $%3==0};case o.PATTERN011:return function(h,$){return(h+$)%3==0};case o.PATTERN100:return function(h,$){return(Math.floor(h/2)+Math.floor($/3))%2==0};case o.PATTERN101:return function(h,$){return h*$%2+h*$%3==0};case o.PATTERN110:return function(h,$){return(h*$%2+h*$%3)%2==0};case o.PATTERN111:return function(h,$){return(h*$%3+(h+$)%2)%2==0};default:throw"bad maskPattern:"+f}},y.getErrorCorrectPolynomial=function(f){for(var h=l([1],0),$=0;$<f;$+=1)h=h.multiply(l([1,a.gexp($)],0));return h},y.getLengthInBits=function(f,h){if(1<=h&&h<10)switch(f){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+f}else if(h<27)switch(f){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+f}else if(h<41)switch(f){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+f}else throw"type:"+h},y.getLostPoint=function(f){for(var h=f.getModuleCount(),$=0,C=0;C<h;C+=1)for(var T=0;T<h;T+=1){for(var Y=0,X=f.isDark(C,T),it=-1;it<=1;it+=1)if(!(C+it<0||h<=C+it))for(var lt=-1;lt<=1;lt+=1)T+lt<0||h<=T+lt||it==0&&lt==0||X==f.isDark(C+it,T+lt)&&(Y+=1);Y>5&&($+=3+Y-5)}for(var C=0;C<h-1;C+=1)for(var T=0;T<h-1;T+=1){var vt=0;f.isDark(C,T)&&(vt+=1),f.isDark(C+1,T)&&(vt+=1),f.isDark(C,T+1)&&(vt+=1),f.isDark(C+1,T+1)&&(vt+=1),(vt==0||vt==4)&&($+=3)}for(var C=0;C<h;C+=1)for(var T=0;T<h-6;T+=1)f.isDark(C,T)&&!f.isDark(C,T+1)&&f.isDark(C,T+2)&&f.isDark(C,T+3)&&f.isDark(C,T+4)&&!f.isDark(C,T+5)&&f.isDark(C,T+6)&&($+=40);for(var T=0;T<h;T+=1)for(var C=0;C<h-6;C+=1)f.isDark(C,T)&&!f.isDark(C+1,T)&&f.isDark(C+2,T)&&f.isDark(C+3,T)&&f.isDark(C+4,T)&&!f.isDark(C+5,T)&&f.isDark(C+6,T)&&($+=40);for(var _t=0,T=0;T<h;T+=1)for(var C=0;C<h;C+=1)f.isDark(C,T)&&(_t+=1);var Xt=Math.abs(100*_t/h/h-50)/5;return $+=Xt*10,$},y})(),a=(function(){for(var A=new Array(256),P=new Array(256),N=0;N<8;N+=1)A[N]=1<<N;for(var N=8;N<256;N+=1)A[N]=A[N-4]^A[N-5]^A[N-6]^A[N-8];for(var N=0;N<255;N+=1)P[A[N]]=N;var R={};return R.glog=function(y){if(y<1)throw"glog("+y+")";return P[y]},R.gexp=function(y){for(;y<0;)y+=255;for(;y>=256;)y-=255;return A[y]},R})();function l(A,P){if(typeof A.length>"u")throw A.length+"/"+P;var N=(function(){for(var y=0;y<A.length&&A[y]==0;)y+=1;for(var B=new Array(A.length-y+P),f=0;f<A.length-y;f+=1)B[f]=A[f+y];return B})(),R={};return R.getAt=function(y){return N[y]},R.getLength=function(){return N.length},R.multiply=function(y){for(var B=new Array(R.getLength()+y.getLength()-1),f=0;f<R.getLength();f+=1)for(var h=0;h<y.getLength();h+=1)B[f+h]^=a.gexp(a.glog(R.getAt(f))+a.glog(y.getAt(h)));return l(B,0)},R.mod=function(y){if(R.getLength()-y.getLength()<0)return R;for(var B=a.glog(R.getAt(0))-a.glog(y.getAt(0)),f=new Array(R.getLength()),h=0;h<R.getLength();h+=1)f[h]=R.getAt(h);for(var h=0;h<y.getLength();h+=1)f[h]^=a.gexp(a.glog(y.getAt(h))+B);return l(f,0).mod(y)},R}var u=(function(){var A=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],P=function(y,B){var f={};return f.totalCount=y,f.dataCount=B,f},N={},R=function(y,B){switch(B){case s.L:return A[(y-1)*4+0];case s.M:return A[(y-1)*4+1];case s.Q:return A[(y-1)*4+2];case s.H:return A[(y-1)*4+3];default:return}};return N.getRSBlocks=function(y,B){var f=R(y,B);if(typeof f>"u")throw"bad rs block @ typeNumber:"+y+"/errorCorrectionLevel:"+B;for(var h=f.length/3,$=[],C=0;C<h;C+=1)for(var T=f[C*3+0],Y=f[C*3+1],X=f[C*3+2],it=0;it<T;it+=1)$.push(P(Y,X));return $},N})(),d=function(){var A=[],P=0,N={};return N.getBuffer=function(){return A},N.getAt=function(R){var y=Math.floor(R/8);return(A[y]>>>7-R%8&1)==1},N.put=function(R,y){for(var B=0;B<y;B+=1)N.putBit((R>>>y-B-1&1)==1)},N.getLengthInBits=function(){return P},N.putBit=function(R){var y=Math.floor(P/8);A.length<=y&&A.push(0),R&&(A[y]|=128>>>P%8),P+=1},N},b=function(A){var P=e.MODE_NUMBER,N=A,R={};R.getMode=function(){return P},R.getLength=function(f){return N.length},R.write=function(f){for(var h=N,$=0;$+2<h.length;)f.put(y(h.substring($,$+3)),10),$+=3;$<h.length&&(h.length-$==1?f.put(y(h.substring($,$+1)),4):h.length-$==2&&f.put(y(h.substring($,$+2)),7))};var y=function(f){for(var h=0,$=0;$<f.length;$+=1)h=h*10+B(f.charAt($));return h},B=function(f){if("0"<=f&&f<="9")return f.charCodeAt(0)-48;throw"illegal char :"+f};return R},x=function(A){var P=e.MODE_ALPHA_NUM,N=A,R={};R.getMode=function(){return P},R.getLength=function(B){return N.length},R.write=function(B){for(var f=N,h=0;h+1<f.length;)B.put(y(f.charAt(h))*45+y(f.charAt(h+1)),11),h+=2;h<f.length&&B.put(y(f.charAt(h)),6)};var y=function(B){if("0"<=B&&B<="9")return B.charCodeAt(0)-48;if("A"<=B&&B<="Z")return B.charCodeAt(0)-65+10;switch(B){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+B}};return R},S=function(A){var P=e.MODE_8BIT_BYTE,N=A,R=t.stringToBytes(A),y={};return y.getMode=function(){return P},y.getLength=function(B){return R.length},y.write=function(B){for(var f=0;f<R.length;f+=1)B.put(R[f],8)},y},I=function(A){var P=e.MODE_KANJI,N=A,R=t.stringToBytesFuncs.SJIS;if(!R)throw"sjis not supported.";(function(f,h){var $=R(f);if($.length!=2||($[0]<<8|$[1])!=h)throw"sjis not supported."})("\u53CB",38726);var y=R(A),B={};return B.getMode=function(){return P},B.getLength=function(f){return~~(y.length/2)},B.write=function(f){for(var h=y,$=0;$+1<h.length;){var C=(255&h[$])<<8|255&h[$+1];if(33088<=C&&C<=40956)C-=33088;else if(57408<=C&&C<=60351)C-=49472;else throw"illegal char at "+($+1)+"/"+C;C=(C>>>8&255)*192+(C&255),f.put(C,13),$+=2}if($<h.length)throw"illegal char at "+($+1)},B},H=function(){var A=[],P={};return P.writeByte=function(N){A.push(N&255)},P.writeShort=function(N){P.writeByte(N),P.writeByte(N>>>8)},P.writeBytes=function(N,R,y){R=R||0,y=y||N.length;for(var B=0;B<y;B+=1)P.writeByte(N[B+R])},P.writeString=function(N){for(var R=0;R<N.length;R+=1)P.writeByte(N.charCodeAt(R))},P.toByteArray=function(){return A},P.toString=function(){var N="";N+="[";for(var R=0;R<A.length;R+=1)R>0&&(N+=","),N+=A[R];return N+="]",N},P},O=function(){var A=0,P=0,N=0,R="",y={},B=function(h){R+=String.fromCharCode(f(h&63))},f=function(h){if(!(h<0)){if(h<26)return 65+h;if(h<52)return 97+(h-26);if(h<62)return 48+(h-52);if(h==62)return 43;if(h==63)return 47}throw"n:"+h};return y.writeByte=function(h){for(A=A<<8|h&255,P+=8,N+=1;P>=6;)B(A>>>P-6),P-=6},y.flush=function(){if(P>0&&(B(A<<6-P),A=0,P=0),N%3!=0)for(var h=3-N%3,$=0;$<h;$+=1)R+="="},y.toString=function(){return R},y},D=function(A){var P=A,N=0,R=0,y=0,B={};B.read=function(){for(;y<8;){if(N>=P.length){if(y==0)return-1;throw"unexpected end of file./"+y}var h=P.charAt(N);if(N+=1,h=="=")return y=0,-1;if(h.match(/^\s$/))continue;R=R<<6|f(h.charCodeAt(0)),y+=6}var $=R>>>y-8&255;return y-=8,$};var f=function(h){if(65<=h&&h<=90)return h-65;if(97<=h&&h<=122)return h-97+26;if(48<=h&&h<=57)return h-48+52;if(h==43)return 62;if(h==47)return 63;throw"c:"+h};return B},V=function(A,P){var N=A,R=P,y=new Array(A*P),B={};B.setPixel=function(C,T,Y){y[T*N+C]=Y},B.write=function(C){C.writeString("GIF87a"),C.writeShort(N),C.writeShort(R),C.writeByte(128),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(0),C.writeByte(255),C.writeByte(255),C.writeByte(255),C.writeString(","),C.writeShort(0),C.writeShort(0),C.writeShort(N),C.writeShort(R),C.writeByte(0);var T=2,Y=h(T);C.writeByte(T);for(var X=0;Y.length-X>255;)C.writeByte(255),C.writeBytes(Y,X,255),X+=255;C.writeByte(Y.length-X),C.writeBytes(Y,X,Y.length-X),C.writeByte(0),C.writeString(";")};var f=function(C){var T=C,Y=0,X=0,it={};return it.write=function(lt,vt){if(lt>>>vt)throw"length over";for(;Y+vt>=8;)T.writeByte(255&(lt<<Y|X)),vt-=8-Y,lt>>>=8-Y,X=0,Y=0;X=lt<<Y|X,Y=Y+vt},it.flush=function(){Y>0&&T.writeByte(X)},it},h=function(C){for(var T=1<<C,Y=(1<<C)+1,X=C+1,it=$(),lt=0;lt<T;lt+=1)it.add(String.fromCharCode(lt));it.add(String.fromCharCode(T)),it.add(String.fromCharCode(Y));var vt=H(),_t=f(vt);_t.write(T,X);var Xt=0,te=String.fromCharCode(y[Xt]);for(Xt+=1;Xt<y.length;){var cn=String.fromCharCode(y[Xt]);Xt+=1,it.contains(te+cn)?te=te+cn:(_t.write(it.indexOf(te),X),it.size()<4095&&(it.size()==1<<X&&(X+=1),it.add(te+cn)),te=cn)}return _t.write(it.indexOf(te),X),_t.write(Y,X),_t.flush(),vt.toByteArray()},$=function(){var C={},T=0,Y={};return Y.add=function(X){if(Y.contains(X))throw"dup key:"+X;C[X]=T,T+=1},Y.size=function(){return T},Y.indexOf=function(X){return C[X]},Y.contains=function(X){return typeof C[X]<"u"},Y};return B},rt=function(A,P,N){for(var R=V(A,P),y=0;y<P;y+=1)for(var B=0;B<A;B+=1)R.setPixel(B,y,N(B,y));var f=H();R.write(f);for(var h=O(),$=f.toByteArray(),C=0;C<$.length;C+=1)h.writeByte($[C]);return h.flush(),"data:image/gif;base64,"+h};return t})();(function(){Ya.stringToBytesFuncs["UTF-8"]=function(t){function e(s){for(var o=[],r=0;r<s.length;r++){var a=s.charCodeAt(r);a<128?o.push(a):a<2048?o.push(192|a>>6,128|a&63):a<55296||a>=57344?o.push(224|a>>12,128|a>>6&63,128|a&63):(r++,a=65536+((a&1023)<<10|s.charCodeAt(r)&1023),o.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63))}return o}return e(t)}})();(function(t){typeof define=="function"&&define.amd?define([],t):typeof Qa=="object"&&(Xa.exports=t())})(function(){return Ya})});var pc={};Mn(pc,{destroyNodexUiPreviews:()=>gn,enhanceMarkdownDiagrams:()=>On,expandSelfClosingTags:()=>Ju,extractTagCaseMap:()=>_u,mountMarkdownEditor:()=>In,normalizeOwlPreviewMarkup:()=>Qu,parseMarkdown:()=>Tn,primeNodexUiTemplates:()=>Xu,renderMermaidBlocks:()=>cc,renderNodexUiBlocks:()=>uc});function Tu(){return Ri??(Ri=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("NodexUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),Ri}function Ou(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function Iu(){return Bi??(Bi=import("./runtime/mermaid/mermaid.esm.min.mjs").then(t=>{let e=t.default||t;return e.initialize({startOnLoad:!1,securityLevel:"strict"}),e})),Bi}function Ru(){return $i??($i=import("./runtime/milkdown/milkdown-editor.js")),$i}async function Tn(t,e={}){return(await Tu()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function Mi(t,e,s,o=""){t.classList.add("b-markdown-diagram-error"),t.replaceChildren();let r=document.createElement("p");if(r.className="b-markdown-diagram-error-message",r.textContent=`Unable to render ${e} diagram: ${s?.message||s}`,t.append(r),o){let a=document.createElement("pre"),l=document.createElement("code");l.textContent=o,a.append(l),t.append(a)}}async function cc(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let s;try{s=await Iu()}catch(o){e.forEach(r=>{let a=r.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid",Mi(a,"mermaid",o,r.textContent)});return}s.initialize({startOnLoad:!1,securityLevel:"strict",theme:Ou(t)});for(let o of e){let r=o.textContent,a=o.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:l}=await s.render(`b-mermaid-${++Nu}`,r);a.innerHTML=l}catch(l){Mi(a,"mermaid",l,r)}}}function Bu(t){let e=globalThis.thebase;if(!e?.mountAll)return;let s=document.createElement("div");s.setAttribute("b-ui","toast"),s.setAttribute("b-att-state","open"),s.setAttribute("b-att-delay","2000"),s.className="b-markdown-b-copy-toast",s.textContent=t,document.body.append(s),e.mountAll(s),s.addEventListener("nodexui:close",()=>s.remove(),{once:!0})}function $u(t){let e=document.createElement("div");e.className="b-markdown-b-code";let s=document.createElement("button");s.type="button",s.className="b-markdown-b-copy";let o=document.createElement("span");dt(o,"copy",{label:"Copy code"}),s.append(o),s.addEventListener("click",async()=>{try{await pn(t),s.dispatchEvent(new CustomEvent("nodexui:markdown-copy",{bubbles:!0,detail:{source:t}})),Bu("Copied to clipboard")}catch(l){s.dispatchEvent(new CustomEvent("nodexui:markdown-copy-error",{bubbles:!0,detail:{error:l}}))}}),e.append(s);let r=document.createElement("pre"),a=document.createElement("code");a.className="b-markdown-b-code-lines";for(let l of t.replace(/\n$/,"").split(`
13
- `)){let u=document.createElement("span");u.className="b-markdown-b-code-line",u.textContent=l,a.append(u)}return r.append(a),e.append(r),e}function rc(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function _u(t){let e=new Map;for(let s of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(s[1].toLowerCase(),s[1]);return e}function Mu(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=globalThis.thebase,o=t.get(e.localName)||e.localName,r=rc(o),a=!!s?.component?.(r),l=nt(e.getAttribute("className")||e.getAttribute("class"));if(!a){let u=`b-${r}`;return e.className=l?`${u} ${l}`:u,e}e.setAttribute("b-ui",r),l&&(e.className=l);for(let u of[...e.attributes]){if(u.name==="class"||u.name==="className"||u.name==="b-ui"||/^on[A-Z]/.test(u.name))continue;let d=nt(u.value);e.removeAttribute(u.name),!(d===""||d==="false")&&e.setAttribute(`b-att-${rc(u.name)}`,d==="true"?"true":d)}return e}}function nt(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function ei(t,e){for(;t.firstChild;)e.append(t.firstChild)}function Rt(t,e){return ei(t,e),t.replaceWith(e),e}function Uu(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let s=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Rt(t,e)}function Pu(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let s=nt(t.getAttribute("orientation")||""),o=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-orientation",s),o&&(e.className=o),Rt(t,e)}function qu(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let s=nt(t.getAttribute("for")||""),o=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("for",s),o&&(e.className=o),Rt(t,e)}function nc(t,e,s){let o=document.createElement(e);o.setAttribute(s,"");let r=nt(t.getAttribute("className")||t.getAttribute("class"));return r&&(o.className=r),Rt(t,o)}function Du(t){let e=t.getAttribute("type")||"",s=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!s)return t;let o=document.createElement("button");o.setAttribute("b-ui","button");let r=nt(e||"button"),a=nt(t.getAttribute("variant")||""),l=nt(t.getAttribute("size")||""),u=nt(t.getAttribute("className")||t.getAttribute("class")),d=nt(t.getAttribute("label")||"");return o.type=r||"button",a&&o.setAttribute("b-att-variant",a),l&&o.setAttribute("b-att-size",l),u&&(o.className=u),d&&!t.childNodes.length&&(o.textContent=d),Rt(t,o)}function ju(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=nt(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let s=document.createElement("span");s.setAttribute("b-ui","icon"),s.setAttribute("b-att-icon",e);let o=nt(t.getAttribute("size")||""),r=nt(t.getAttribute("label")||""),a=nt(t.getAttribute("className")||t.getAttribute("class"));return o&&s.setAttribute("b-att-size",o),r&&s.setAttribute("b-att-label",r),a&&(s.className=a),Rt(t,s)}function zu(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let s=nt(t.getAttribute("variant")||""),o=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&e.setAttribute("b-att-variant",s),o&&(e.className=o),Rt(t,e)}function _i(t){return e=>{if(e.hasAttribute("b-ui"))return e;let s=document.createElement("div"),o=nt(e.getAttribute("className")||e.getAttribute("class"));return s.className=o?`${t} ${o}`:t,Rt(e,s)}}function Fu(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),nt(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let s=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Rt(t,e)}function Hu(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),nt(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let s=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Rt(t,e)}function Wu(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let s=nt(t.getAttribute("className")||t.getAttribute("class"));s&&(e.className=s),ei(t,e);let o=document.createElement("span");return o.setAttribute("b-icon","chevron-down"),o.className="b-accordion-trigger-icon",e.append(o),t.replaceWith(e),e}function Ku(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let s=nt(t.getAttribute("className")||t.getAttribute("class"));return s&&(e.className=s),Rt(t,e)}function Vu(t){return ic+=1,`${t}-${ic}`}function It(t,e,s){return o=>{if(o.hasAttribute("b-ui"))return o;let r=document.createElement(t);t==="button"&&(r.type="button"),s&&r.setAttribute(s,"");let a=nt(o.getAttribute("className")||o.getAttribute("class"));return r.className=a?`${e} ${a}`:e,Rt(o,r)}}function Gu(){let t=document.createElement("button");t.type="button",t.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let s=document.createElement("span");return s.className="visually-hidden",s.textContent="Close",t.append(e,s),t}function ac({tagPrefix:t,componentName:e,triggerTag:s,triggerClassName:o,panelClassName:r,closeButton:a}){return l=>{if(l.hasAttribute("b-ui"))return l;let u=l.querySelector(`:scope > ${t}trigger`),d=l.querySelector(`:scope > ${t}content`);if(!d)return l;let b=Vu(`b-preview-${e}`),x=document.createElement(s);s==="button"&&(x.type="button"),x.className=o,x.setAttribute("b-att-trigger",`#${b}`),u&&ei(u,x);let S=document.createElement("div");S.setAttribute("b-ui",e),S.id=b,S.setAttribute("b-att-trigger",`[b-att-trigger='#${b}']`);let I=document.createElement("div");I.className=r;let H=nt(d.getAttribute("size")||"");return H&&I.setAttribute("data-size",H),ei(d,I),a&&I.append(a()),S.append(I),l.before(x,S),l.remove(),S}}function Ju(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,s,o)=>Zu.has(s.toLowerCase())?e:`<${s}${o}></${s}>`)}function Yu(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let o=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${o}${e.textContent||""}`))})}function Qu(t,e){Yu(t);let s={fieldgroup:Uu,field:Pu,fieldlabel:qu,fielddescription:r=>nc(r,"p","b-field-description"),fielderror:r=>nc(r,"p","b-field-error"),button:Du,icon:ju,alert:zu,alerttitle:_i("b-alert-title"),alertdescription:_i("b-alert-description"),alertaction:_i("b-alert-action"),accordion:Fu,accordionitem:Hu,accordiontrigger:Wu,accordioncontent:Ku,dialog:ac({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:Gu}),dialogheader:It("div","b-dialog-header"),dialogfooter:It("div","b-dialog-footer"),dialogtitle:It("h2","b-dialog-title"),dialogdescription:It("p","b-dialog-description"),dialogclose:It("button","btn b-button btn-outline-secondary b-dialog-close","b-dialog-close"),alertdialog:ac({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn b-button btn-outline-secondary b-alert-dialog-trigger",panelClassName:"b-dialog-panel b-alert-dialog-panel"}),alertdialogheader:It("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:It("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:It("div","b-alert-dialog-media"),alertdialogtitle:It("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:It("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:It("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:It("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},o=Mu(e);for(let r of[...t.querySelectorAll("*")]){let a=r.localName.toLowerCase();s[a]?s[a](r):e.has(a)&&o(r)}}function Xu(t){ti=Promise.resolve(t)}function tp(){return ti??(ti=Fe("/dist/nodexui.templates.xml")),ti}function gn(t){let e=Ui.get(t);if(e){Ui.delete(t);for(let s of e)try{s.destroy()}catch{}}}function sp(t){return new Set([...t.matchAll(ep)].map(e=>e[1]))}function np(t){let e=new Set;for(let s of t.matchAll(op))e.add(s[1]);for(let s of t.matchAll(rp))e.add(s[2]);return e}function ip(t){let e=Si({raw:[t]}),s=sp(t);class o extends c{setup(){this.state=M(Object.fromEntries([...s].map(a=>[a,""])))}}n(o,"template",e);for(let r of np(t))o.prototype[r]=function(){};return o}function lc(t){t.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("b-markdown-b-preview-overlay")}async function ap(t,e){let[s,o]=await Promise.all([tp(),ip(e)]),r=await Ps(o,t,{templates:s});return lc(t),r}function cp(t,e){let s=globalThis.thebase;if(!s?.mountAll)throw new Error("NodexUI runtime not found on the page \u2014 load dist/nodexui.min.js before mounting Markdown.");t.innerHTML=e,lc(t),s.mountAll(t)}async function uc(t){gn(t);let e=[...t.querySelectorAll("pre > code.language-base-ui")];if(!e.length)return;let s=new Set;for(let o of e){let r=o.textContent,a=o.closest("pre");a.replaceChildren(),a.className="b-markdown-live b-markdown-nodexui";let l=document.createElement("div");l.className="b-markdown-b-preview",a.append(l,$u(r));try{/<[A-Z]/.test(r)?s.add(await ap(l,r)):cp(l,r)}catch(u){Mi(a,"NodexUI component",u,r)}}s.size&&Ui.set(t,s)}function lp(t){for(let e of t.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))e.setAttribute("aria-label",e.parentElement.textContent.trim())}async function On(t,{mermaid:e=!0,nodexUi:s=!0}={}){lp(t),e&&await cc(t),s&&await uc(t)}async function In(t){return(await Ru()).createMilkdownMarkdownEditor(t)}var Ri,Bi,$i,Nu,ic,Zu,ti,Ui,ep,op,rp,si=Bt(()=>{q();Mt();Fn();Nu=0;ic=0;Zu=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);Ui=new WeakMap;ep=/\bstate\.([A-Za-z_$][\w$]*)/g;op=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,rp=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g});function hp(t,e,s){let o=String(t||"").trim();if(!o)return"";let r=o.replace(/\{([^}]+)\}/g,(a,l)=>{let u=s&&typeof s=="object"?s[l]:null;return u&&u.default!==void 0?String(u.default):`{${l}}`});try{return new URL(r,`${e}/`).href.replace(/\/$/,"")}catch{return r.replace(/\/$/,"")}}function bt(t,e){if(t&&typeof t=="object"&&typeof t.$ref=="string"){let s=t.$ref.replace(/^#\//,"").split("/"),o=e;for(let r of s)o=o?.[decodeURIComponent(r.replace(/~1/g,"/").replace(/~0/g,"~"))];return o?{...o}:{}}return t}function Vi(t,e){if(!Array.isArray(t?.allOf))return t;let s={...t,properties:{...t.properties},required:[...t.required||[]]};delete s.allOf;for(let o of t.allOf){let r=Vi(bt(o,e),e)||{};Object.assign(s.properties,r.properties),s.required.push(...r.required||[]),s.type||(s.type=r.type)}return s}function mp(t,e){if(!t)return null;let s=bt(t,e);return!s||typeof s!="object"?null:s}function Ki(t){return t&&typeof t.$ref=="string"?t.$ref.split("/").pop():null}function Ec(t,e){if(!t||typeof t!="object")return null;for(let[s,o]of Object.entries(t)){let r=mp(o,e);if(r){if(r.dataValue!==void 0)return{key:s,label:r.summary||s,value:r.dataValue,isAuto:!1};if(r.serializedValue!==void 0)return{key:s,label:r.summary||s,value:r.serializedValue,isAuto:!1};if(r.value!==void 0)return{key:s,label:r.summary||s,value:r.value,isAuto:!1};if(r.externalValue)return{key:s,label:r.summary||s,value:r.externalValue,isAuto:!1}}}return null}function Gi(t){if(t){if(t.example!==void 0)return t.example;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0]}}function Fi(t,e){if(!t)return null;let s=Ec(t.examples,e);if(s)return s;if(t.example!==void 0)return{label:"media example",value:t.example,isAuto:!1};let o=bt(t.schema,e),r=Gi(o);return r!==void 0?{label:"schema example",value:r,isAuto:!1}:null}function Cc(t,e){let s=Ec(t.examples,e);if(s)return s;if(t.example!==void 0)return{label:"example",value:t.example,isAuto:!1};let o=bt(t.schema,e),r=Gi(o);return r!==void 0?{label:"schema example",value:r,isAuto:!1}:null}function vn(t,e,s=new Set){if(!t)return null;let o=Ki(t);if(o){if(s.has(o))return{};s=new Set(s).add(o)}let r=Vi(bt(t,e),e);if(!r)return null;let a=Gi(r);if(a!==void 0)return a;if(r.type==="array"||r.items)return[vn(r.items||{},e,s)];if(r.properties||r.type==="object"){let l={};for(let[u,d]of Object.entries(r.properties||{}))l[u]=vn(d,e,s);return l}switch(r.type){case"integer":return r.minimum??0;case"number":return r.minimum??0;case"boolean":return!0;case"string":return r.format==="date-time"?new Date().toISOString():r.format==="date"?new Date().toISOString().slice(0,10):r.format==="byte"?"base64==":r.title||"string";default:return null}}function Bn(t,e,{depth:s=0,prefix:o="",seen:r=new Set,required:a=!1,selfRow:l=!0}={}){if(!t||s>4)return[];let u=Ki(t);if(u){if(r.has(u))return[];r=new Set(r).add(u)}let d=Vi(bt(t,e),e),b=[],x=d.contentMediaType||d.contentEncoding?[d.contentMediaType,d.contentEncoding&&`encoding:${d.contentEncoding}`].filter(Boolean).join(", "):"",S=d.discriminator?.propertyName?`discriminator: ${d.discriminator.propertyName}`:"";if(Array.isArray(d.prefixItems))return l&&b.push({path:o||"items",type:"tuple",required:a,description:d.description||""}),d.prefixItems.forEach((I,H)=>{b.push(...Bn(I,e,{depth:s+1,prefix:`${o}[${H}]`,seen:r,required:!1}))}),d.items&&b.push(...Bn(d.items,e,{depth:s+1,prefix:`${o}[n]`,seen:r,required:!1})),b;if(d.type==="array"||d.items)return l&&b.push({path:o||"items",type:"array",required:a,description:d.description||""}),b.push(...Bn(d.items||{},e,{depth:s+1,prefix:`${o}[]`,seen:r,required:!1})),b;if(d.properties||d.type==="object"||d.patternProperties){let I=new Set(d.required||[]);for(let[H,O]of Object.entries(d.properties||{})){let D=bt(O,e),V=o?`${o}.${H}`:H;b.push({path:V,type:D.type||(D.$ref?Ki(O):"any")||"any",format:D.format||"",enum:D.enum,required:I.has(H),description:D.description||""}),(D.type==="object"||D.properties||D.type==="array"||D.items)&&b.push(...Bn(O,e,{depth:s+1,prefix:V,seen:r,required:I.has(H),selfRow:!1}))}for(let[H,O]of Object.entries(d.patternProperties||{})){let D=bt(O,e);b.push({path:o?`${o}.<${H}>`:`<${H}>`,type:D.type||"any",format:D.format||"",required:!1,description:D.description||""})}return b}return b.push({path:o||"value",type:d.type||"any",format:d.format||"",enum:d.enum,required:a,description:[d.description,x,S].filter(Boolean).join(" \u2014 ")}),b}function bp(t){let e=Cc(t,this);return{name:t.name,in:t.in,required:!!t.required,type:t.type||t.schema?.type||"string",format:t.format||t.schema?.format||"",description:t.description||"",default:t.default??t.schema?.default,enum:t.enum||t.schema?.enum,example:e?e.value:void 0,exampleLabel:e?e.label:""}}function gp(t){if(t.type==="http")return{...t,type:String(t.scheme).toLowerCase()==="basic"?"basic":"bearer"};if(t.type==="openIdConnect")return{...t,type:"bearer",oauth2MetadataUrl:t.openIdConnectUrl};if(t.type!=="oauth2"||!t.flows)return t;let[e,s]=Object.entries(t.flows)[0]||[];return{...t,...s,flow:fp[e]||e,scopes:s?.scopes||{}}}function Lc(t){let e=t.securityDefinitions||t.components?.securitySchemes||{};return Object.fromEntries(Object.entries(e).map(([s,o])=>[s,gp(bt(o,t))]))}function vp(t,e){let s=Lc(e),o=t.security||e.security||[],r=[];for(let a of o)for(let l of Object.keys(a)){let u=s[l];u&&r.push({key:l,...u})}return r}function Hi(t,e,s,o){let r={path:[],query:[],header:[],formData:[],body:null};for(let b of o.parameters||[]){let x=bt(b,t);if(x.in==="body"){let S={schema:x.schema},I=Fi(S,t);r.body={required:!!x.required,schema:x.schema,description:x.description||"",contentType:"application/json",example:I?I.value:vn(x.schema,t),exampleLabel:I?I.label:"auto",exampleIsAuto:!I}}else r[x.in]&&r[x.in].push(bp.call(t,x))}if(o.requestBody){let b=bt(o.requestBody,t)||{},[x,S]=Object.entries(b.content||{})[0]||[];if(x&&S){let I=Fi(S,t);r.body={required:!!b.required,schema:S.schema||null,description:b.description||"",contentType:x,encoding:S.encoding||null,itemSchema:S.itemSchema||null,example:I?I.value:vn(S.schema,t),exampleLabel:I?I.label:"auto",exampleIsAuto:!I}}}let a=Object.entries(o.responses||{}).map(([b,x])=>{let S=bt(x,t)||{},[I,H]=Object.entries(S.content||{})[0]||[],O=H?Fi(H,t):null;return{status:b,summary:S.summary||"",description:S.description||"",contentType:I||"application/json",schema:H?.schema||S.schema||null,encoding:H?.encoding||null,headers:xp(S.headers,t),links:yp(S.links,t),example:O?O.value:H?.schema?vn(H.schema,t):null,exampleLabel:O?O.label:"auto",exampleIsAuto:!O&&!!H?.schema}}).sort((b,x)=>{let S=Ac(b.status),I=Ac(x.status);return S-I}),l=wp(o.callbacks,t),u=s.toUpperCase();return{id:(o.operationId||`${s}-${e}`).replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase(),method:u,path:e,tag:o.tags&&o.tags[0]||"default",summary:o.summary||o.operationId||`${u} ${e}`,description:o.description||"",deprecated:!!o.deprecated,produces:o.produces||t.produces||["application/json"],consumes:o.consumes||t.consumes||(r.body?["application/json"]:[]),parameters:r,responses:a,callbacks:l,externalDocs:o.externalDocs||null,security:vp(o,t)}}function xp(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([s,o])=>{let r=bt(o,e)||{},a=Cc({...r,in:"header"},e);return{name:s,required:!!r.required,deprecated:!!r.deprecated,type:r.schema?.type||"string",description:r.description||"",example:a?a.value:void 0}})}function yp(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([s,o])=>{let r=bt(o,e)||{};return{name:s,operationId:r.operationId||"",operationRef:r.operationRef||"",description:r.description||"",parameters:r.parameters||{}}})}function wp(t,e){if(!t||typeof t!="object")return[];let s=[];for(let[o,r]of Object.entries(t)){let a=bt(r,e)||{};for(let[l,u]of Object.entries(a)){let d=bt(u,e)||{};for(let b of Wi)d[b]&&s.push({name:o,expression:l,method:b.toUpperCase(),summary:d[b].summary||"",description:d[b].description||""})}}return s}function Ac(t){if(t==="default")return 999;let e=parseInt(t,10);return Number.isNaN(e)?998:e}async function kc(t,e=""){let s=await fetch(t);if(!s.ok)throw new Error(`Failed to fetch spec: HTTP ${s.status}`);return Zi(await s.json(),e)}function Zi(t,e=""){if(!t||typeof t!="object"||!t.paths&&!t.webhooks)throw new Error("Not an OpenAPI document (missing paths).");let s=t.schemes&&t.schemes.includes("https")?"https":t.schemes?.[0]||"https",o=t.host||location.host,r=t.basePath||"",a=`${s}://${o}${r}`.replace(/\/$/,""),l=e?[{name:"",url:e.replace(/\/$/,""),description:""}]:Array.isArray(t.servers)&&t.servers.length?t.servers.map(O=>({name:O?.name||"",url:hp(O?.url,a,O?.variables),description:String(O?.description||"").trim()})).filter(O=>O.url):[{name:"",url:a,description:""}],u=l[0]?.url||a,d=(t.tags||[]).map(O=>O.name),b=new Map((t.tags||[]).map(O=>[O.name,O])),x=[];for(let[O,D]of Object.entries(t.paths||{})){let V=bt(D,t)||{};for(let rt of Wi)V[rt]&&x.push(Hi(t,O,rt,V[rt]));for(let[rt,A]of Object.entries(V.additionalOperations||{}))x.push(Hi(t,O,rt.toLowerCase(),A))}let S=[];for(let[O,D]of Object.entries(t.webhooks||{})){let V=bt(D,t)||{};for(let rt of Wi)V[rt]&&S.push(Hi(t,O,rt,V[rt]))}let H=[...new Set([...d,...x.map(O=>O.tag)])].map(O=>{let D=b.get(O);return{id:O.replace(/[^a-zA-Z0-9]+/g,"-").toLowerCase(),name:O,summary:D?.summary||"",description:D?.description||"",parent:D?.parent||"",kind:D?.kind||"",items:x.filter(V=>V.tag===O)}}).filter(O=>O.items.length);return{spec:t,info:t.info||{},baseUrl:u,derivedBaseUrl:a,servers:l,securityDefinitions:Lc(t),groups:H,webhooks:S,resolveRef:O=>bt(O,t),generateExample:O=>vn(O,t),schemaRows:O=>Bn(O,t),findOperation:O=>x.find(D=>D.id===O)||S.find(D=>D.id===O),firstOperation:()=>x[0]}}var Wi,fp,Nc=Bt(()=>{Wi=["get","post","put","patch","delete","options","head","trace","query"];fp={authorizationCode:"accessCode",implicit:"implicit",password:"password",clientCredentials:"application"}});function Sp(t){let e=new URL(t.url);return(t.query||[]).forEach(([s,o])=>{s&&e.searchParams.set(s,String(o||""))}),e.toString()}function Ap(t,e){let s=[];return(t.headers||[]).forEach(([r,a])=>{r&&s.push([r,String(a??"")])}),e&&t.bodyText&&!Ep(s,"Content-Type")&&s.push(["Content-Type",t.mimeType||"application/json"]),s}function Ep(t,e){let s=e.toLowerCase();return t.some(function(o){return String(o[0]||"").toLowerCase()===s})}function Cp(t,e){return String(t||"").split(`
14
- `).map(function(s){return e+s}).join(`
15
- `)}function Et(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function ot(t){return String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function Lp(t){return String(t).replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function kp(t){return String(t).replace(/`/g,'` + "`" + `')}function Np(t){return String(t).replace(/\\/g,"\\\\").replace(/"""/g,'\\"\\"\\"')}function ri(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function ni(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\\\'")}function ii(t){return String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function ai(t){return String(t).replace(/`/g,"``").replace(/"/g,'`"')}function Tp(t){return String(t).replace(/\]=\]/g,']==] .. "]=" .. [=[')}function Op(t,e){let s=e&&e.quote==="double"?'"':"'";return t.map(function(r){let a=s==='"'?ot(r[0]):Et(r[0]),l=s==='"'?ot(r[1]):Et(r[1]);return s+a+s+": "+s+l+s}).join(`,
16
- `)}function Ip(t,e,s){let o=["curl --request "+t.method];return s.forEach(function(r){o.push("--header '"+Et(r[0]+": "+r[1])+"'")}),t.bodyText&&o.push("--data '"+Et(t.bodyText)+"'"),o.push("'"+Et(e)+"'"),o.join(` \\
17
- `)}function Tc(t,e,s){let o=["const url = '"+Et(e)+"';","const options = {"," method: '"+Et(t.method)+"',"];return s.length&&(o.push(" headers: {"),o.push(Cp(Op(s)," ")),o.push(" },")),t.bodyText&&o.push(" body: `"+Lp(t.bodyText)+"`,"),o.push("};","","const response = await fetch(url, options);","const data = await response.text();","console.log(response.status, data);"),o.join(`
18
- `)}function Rp(t,e,s){return Tc(t,e,s)}function Bp(t,e,s){let o=["import requests","","url = '"+Et(e)+"'"];return s.length?(o.push("headers = {"),s.forEach(function(r){o.push(" '"+Et(r[0])+"': '"+Et(r[1])+"',")}),o.push("}")):o.push("headers = {}"),t.bodyText?(o.push("",'payload = """'+Np(t.bodyText)+'"""'),o.push("response = requests.request('"+Et(t.method)+"', url, headers=headers, data=payload)")):o.push("","response = requests.request('"+Et(t.method)+"', url, headers=headers)"),o.push("print(response.status_code)","print(response.text)"),o.join(`
19
- `)}function $p(t,e,s){let o=["package main","","import (",' "fmt"',' "io"',' "net/http"'];return t.bodyText&&o.push(' "strings"'),o.push(")","","func main() {"),t.bodyText?(o.push(" body := strings.NewReader(`"+kp(t.bodyText)+"`)"),o.push(' req, err := http.NewRequest("'+t.method+'", "'+e+'", body)')):o.push(' req, err := http.NewRequest("'+t.method+'", "'+e+'", nil)'),o.push(" if err != nil {"," panic(err)"," }"),s.forEach(function(r){o.push(' req.Header.Set("'+ot(r[0])+'", "'+ot(r[1])+'")')}),o.push(""," res, err := http.DefaultClient.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()",""," data, err := io.ReadAll(res.Body)"," if err != nil {"," panic(err)"," }",""," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),o.join(`
20
- `)}function _p(t,e,s){let o=["OkHttpClient client = new OkHttpClient();","","Request.Builder builder = new Request.Builder()",' .url("'+ot(e)+'")'];return s.forEach(function(r){o.push(' .addHeader("'+ot(r[0])+'", "'+ot(r[1])+'")')}),t.bodyText?o.push(";","",'MediaType mediaType = MediaType.parse("'+ot(t.mimeType||"application/json")+'");','RequestBody body = RequestBody.create("""'+ot(t.bodyText)+'""", mediaType);','Request request = builder.method("'+t.method+'", body).build();'):o.push(";","",'Request request = builder.method("'+t.method+'", null).build();'),o.push("","try (Response response = client.newCall(request).execute()) {"," System.out.println(response.code());",' System.out.println(response.body() != null ? response.body().string() : "");',"}"),o.join(`
21
- `)}function Mp(t,e,s){let r=["using var client = new HttpClient();","using var request = new HttpRequestMessage(HttpMethod."+(t.method.charAt(0)+t.method.slice(1).toLowerCase())+', "'+ot(e)+'");'];return s.forEach(function(a){r.push('request.Headers.TryAddWithoutValidation("'+ot(a[0])+'", "'+ot(a[1])+'");')}),t.bodyText&&r.push('request.Content = new StringContent("""'+ot(t.bodyText)+'""", Encoding.UTF8, "'+ot(t.mimeType||"application/json")+'");'),r.push("","using var response = await client.SendAsync(request);","var body = await response.Content.ReadAsStringAsync();","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(body);"),r.join(`
22
- `)}function Up(t,e,s){let o=["$ch = curl_init();","curl_setopt_array($ch, ["," CURLOPT_URL => '"+ri(e)+"',"," CURLOPT_CUSTOMREQUEST => '"+ri(t.method)+"',"," CURLOPT_RETURNTRANSFER => true,"];return s.length&&(o.push(" CURLOPT_HTTPHEADER => ["),s.forEach(function(r){o.push(" '"+ri(r[0]+": "+r[1])+"',")}),o.push(" ],")),t.bodyText&&o.push(" CURLOPT_POSTFIELDS => '"+ri(t.bodyText)+"',"),o.push("]);","","$response = curl_exec($ch);","echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE) . PHP_EOL;","echo $response;","curl_close($ch);"),o.join(`
23
- `)}function Pp(t,e,s){let o=t.method.charAt(0)+t.method.slice(1).toLowerCase(),r=['require "uri"','require "net/http"',"","uri = URI('"+ni(e)+"')","http = Net::HTTP.new(uri.host, uri.port)",'http.use_ssl = uri.scheme == "https"',"","request = Net::HTTP::"+o+".new(uri)"];return s.forEach(function(a){r.push("request['"+ni(a[0])+"'] = '"+ni(a[1])+"'")}),t.bodyText&&r.push("request.body = '"+ni(t.bodyText)+"'"),r.push("","response = http.request(request)","puts response.code","puts response.body"),r.join(`
24
- `)}function qp(t,e,s){let o=["#include <curl/curl.h>","","int main(void) {"," CURL *curl = curl_easy_init();"," if (!curl) return 1;",""," struct curl_slist *headers = NULL;"];return s.forEach(function(r){o.push(' headers = curl_slist_append(headers, "'+ii(r[0]+": "+r[1])+'");')}),o.push(' curl_easy_setopt(curl, CURLOPT_URL, "'+ii(e)+'");'),o.push(' curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "'+ii(t.method)+'");'),s.length&&o.push(" curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);"),t.bodyText&&o.push(' curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "'+ii(t.bodyText)+'");'),o.push(""," curl_easy_perform(curl);"," curl_slist_free_all(headers);"," curl_easy_cleanup(curl);"," return 0;","}"),o.join(`
25
- `)}function Dp(t,e,s){let o=['var request = URLRequest(url: URL(string: "'+ot(e)+'")!)','request.httpMethod = "'+ot(t.method)+'"'];return s.forEach(function(r){o.push('request.setValue("'+ot(r[1])+'", forHTTPHeaderField: "'+ot(r[0])+'")')}),t.bodyText&&o.push('request.httpBody = """',t.bodyText,'""".data(using: .utf8)'),o.push("","URLSession.shared.dataTask(with: request) { data, response, error in"," if let error = error {"," print(error)"," return"," }"," let status = (response as? HTTPURLResponse)?.statusCode ?? 0"," print(status)",' print(String(data: data ?? Data(), encoding: .utf8) ?? "")',"}.resume()"),o.join(`
26
- `)}function jp(t,e,s){let o=['NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"'+ot(e)+'"]];','request.HTTPMethod = @"'+ot(t.method)+'";'];return s.forEach(function(r){o.push('[request setValue:@"'+ot(r[1])+'" forHTTPHeaderField:@"'+ot(r[0])+'"];')}),t.bodyText&&o.push('request.HTTPBody = [@"'+ot(t.bodyText)+'" dataUsingEncoding:NSUTF8StringEncoding];'),o.push("","NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request"," completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"," if (error) {",' NSLog(@"%@", error);'," return;"," }"," NSInteger status = [(NSHTTPURLResponse *)response statusCode];"," NSString *body = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];",' NSLog(@"%ld", (long)status);',' NSLog(@"%@", body);',"}];","[task resume];"),o.join(`
27
- `)}function zp(t,e,s){let o=["val client = OkHttpClient()"];return t.bodyText&&o.push('val body = """',t.bodyText,'""".trimIndent().toRequestBody("'+ot(t.mimeType||"application/json")+'".toMediaType())'),o.push("val request = Request.Builder()",' .url("'+ot(e)+'")'),s.forEach(function(r){o.push(' .addHeader("'+ot(r[0])+'", "'+ot(r[1])+'")')}),o.push(t.bodyText?' .method("'+t.method+'", body)':' .method("'+t.method+'", null)'," .build()","","client.newCall(request).execute().use { response ->"," println(response.code)"," println(response.body?.string().orEmpty())","}"),o.join(`
28
- `)}function Fp(t,e,s){let o=["let client = reqwest::Client::new();","let response = client"," ."+t.method.toLowerCase()+'("'+ot(e)+'")'];return s.forEach(function(r){o.push(' .header("'+ot(r[0])+'", "'+ot(r[1])+'")')}),t.bodyText&&o.push(' .body(r#"'+t.bodyText.replace(/"#/g,'"#""#')+'"#)'),o.push(" .send()"," .await?;","",'println!("{}", response.status());','println!("{}", response.text().await?);'),o.join(`
29
- `)}function Hp(t,e,s){let o=["$headers = @{"];return s.forEach(function(r){o.push(' "'+ai(r[0])+'" = "'+ai(r[1])+'"')}),o.push("}",""),t.bodyText&&o.push('$body = @"',t.bodyText,'"@',""),o.push("$response = Invoke-RestMethod -Method "+t.method+' -Uri "'+ai(e)+'" -Headers $headers'+(t.bodyText?' -Body $body -ContentType "'+ai(t.mimeType||"application/json")+'"':""),"$response | ConvertTo-Json -Depth 10"),o.join(`
30
- `)}function Wp(t,e,s){let o=["import 'package:http/http.dart' as http;","","final uri = Uri.parse('"+Et(e)+"');","final headers = <String, String>{"];return s.forEach(function(r){o.push(" '"+Et(r[0])+"': '"+Et(r[1])+"',")}),o.push("};",""),t.bodyText?o.push("final response = await http."+t.method.toLowerCase()+"(uri, headers: headers, body: '''"+t.bodyText.replace(/'''/g,"'' '")+"''');"):o.push("final response = await http."+t.method.toLowerCase()+"(uri, headers: headers);"),o.push("print('Status: ${response.statusCode}');","print(response.body);"),o.join(`
31
- `)}function Kp(t,e,s){let o=['local http = require("socket.http")','local ltn12 = require("ltn12")',"","local response_body = {}","local headers = {"];return s.forEach(function(r){o.push(' ["'+ot(r[0])+'"] = "'+ot(r[1])+'",')}),o.push("}",""),t.bodyText&&(o.push("local body = [==["+Tp(t.bodyText)+"]==]",""),o.push('headers["Content-Length"] = tostring(#body)')),o.push("local _, code = http.request{",' url = "'+ot(e)+'",',' method = "'+ot(t.method)+'",'," headers = headers,"),t.bodyText&&o.push(" source = ltn12.source.string(body),"),o.push(" sink = ltn12.sink.table(response_body),","}","",'print("Status: " .. tostring(code))',"print(table.concat(response_body))"),o.join(`
32
- `)}async function Oc(t,e){let s=Ji.find(function(a){return a.id===t});if(!s)throw new Error("Unknown language: "+t);let o=Ap(e,!0),r=Sp(e);return Vp[s.id](e,r,o)}var Ji,Vp,Ic=Bt(()=>{Ji=[{id:"curl",label:"CURL",icon:"img/bash-plain.svg"},{id:"csharp",label:"CSHARP",icon:"img/csharp-original.svg"},{id:"go",label:"GO",icon:"img/go-original-wordmark.svg"},{id:"node",label:"NODEJS",icon:"img/nodejs-original.svg"},{id:"ruby",label:"RUBY",icon:"img/ruby-plain.svg"},{id:"php",label:"PHP",icon:"img/php-original.svg"},{id:"javascript",label:"JAVASCRIPT",icon:"img/javascript-original.svg"},{id:"python",label:"PYTHON",icon:"img/python-original.svg"},{id:"java",label:"JAVA",icon:"img/java-original.svg"},{id:"c",label:"C",icon:"img/c-original.svg"},{id:"swift",label:"SWIFT",icon:"img/swift-original.svg"},{id:"objc",label:"OBJECTIVE-C",icon:"img/objectivec-plain.svg"},{id:"kotlin",label:"KOTLIN",icon:"img/kotlin-original.svg"},{id:"rust",label:"RUST",icon:"img/rust-original.svg"},{id:"powershell",label:"POWERSHELL",icon:"img/windows8-original.svg"},{id:"dart",label:"DART",icon:"img/dart-original.svg"},{id:"lua",label:"LUA",icon:"img/lua.svg"}];Vp={curl:Ip,javascript:Tc,node:Rp,python:Bp,go:$p,java:_p,csharp:Mp,php:Up,ruby:Pp,c:qp,swift:Dp,objc:jp,kotlin:zp,rust:Fp,powershell:Hp,dart:Wp,lua:Kp}});var Rc={};Mn(Rc,{LANGUAGES:()=>Ji,buildOpenApiDoc:()=>Zi,generateSnippet:()=>Oc,loadOpenApiDoc:()=>kc});var Bc=Bt(()=>{Nc();Ic()});var Xh={};Mn(Xh,{Accordion:()=>zo,AccordionContent:()=>Ho,AccordionItem:()=>Fo,AccordionTrigger:()=>ns,Alert:()=>Pt,AlertAction:()=>js,AlertDescription:()=>ee,AlertDialog:()=>co,AlertDialogAction:()=>Ye,AlertDialogCancel:()=>Je,AlertDialogContent:()=>lo,AlertDialogDescription:()=>bo,AlertDialogFooter:()=>po,AlertDialogHeader:()=>uo,AlertDialogMedia:()=>ho,AlertDialogTitle:()=>mo,AlertDialogTrigger:()=>Ze,AlertTitle:()=>Ds,ApiDoc:()=>Yt,ApiDocGroup:()=>Qt,App:()=>ca,AspectRatio:()=>Ur,Attachment:()=>Ar,AttachmentAction:()=>As,AttachmentActions:()=>Nr,AttachmentContent:()=>Cr,AttachmentDescription:()=>kr,AttachmentDropzone:()=>Or,AttachmentGroup:()=>Tr,AttachmentMedia:()=>Er,AttachmentTitle:()=>Lr,AttachmentTrigger:()=>Es,Avatar:()=>Ir,Badge:()=>Lt,BlockViewer:()=>Is,Breadcrumb:()=>Ne,BreadcrumbEllipsis:()=>as,BreadcrumbItem:()=>Oe,BreadcrumbLink:()=>Ie,BreadcrumbList:()=>Te,BreadcrumbPage:()=>Re,BreadcrumbSeparator:()=>Wt,Bubble:()=>Pr,Button:()=>U,ButtonGroup:()=>jr,ButtonGroupSeparator:()=>zr,ButtonGroupText:()=>Fr,Calendar:()=>ys,Card:()=>re,CardBody:()=>ie,CardDescription:()=>ce,CardFooter:()=>Hs,CardHeader:()=>ne,CardTitle:()=>ae,Carousel:()=>xr,CarouselNext:()=>Ss,CarouselPrevious:()=>ws,CarouselSlide:()=>yr,Chart:()=>vr,Checkbox:()=>Se,ClipboardButton:()=>Ut,CodeEditor:()=>We,Collapsible:()=>Wo,CollapsibleContent:()=>Ko,CollapsibleTrigger:()=>is,Combobox:()=>fr,Command:()=>gr,Component:()=>c,ContextMenu:()=>Po,ContextMenuContent:()=>Do,ContextMenuItem:()=>jo,ContextMenuTrigger:()=>qo,DataTable:()=>xs,DatePicker:()=>br,Dialog:()=>me,DialogClose:()=>Ke,DialogContent:()=>jt,DialogDescription:()=>ve,DialogFooter:()=>fe,DialogHeader:()=>be,DialogTitle:()=>ge,DialogTrigger:()=>Ws,Direction:()=>qr,Drawer:()=>fo,DrawerClose:()=>Xe,DrawerContent:()=>go,DrawerDescription:()=>wo,DrawerFooter:()=>xo,DrawerHeader:()=>vo,DrawerTitle:()=>yo,DrawerTrigger:()=>Qe,DropdownMenu:()=>Ae,DropdownMenuCheckboxItem:()=>os,DropdownMenuContent:()=>Ee,DropdownMenuGroup:()=>Bo,DropdownMenuItem:()=>Ce,DropdownMenuLabel:()=>$o,DropdownMenuRadioGroup:()=>_o,DropdownMenuRadioItem:()=>rs,DropdownMenuSeparator:()=>Mo,DropdownMenuShortcut:()=>Uo,DropdownMenuSub:()=>Le,DropdownMenuSubContent:()=>ke,DropdownMenuSubTrigger:()=>Ft,DropdownMenuTrigger:()=>zt,Empty:()=>Ks,EmptyContent:()=>Ys,EmptyDescription:()=>Js,EmptyHeader:()=>Vs,EmptyMedia:()=>Gs,EmptyTitle:()=>Zs,EventBus:()=>ua,Field:()=>Pe,FieldContent:()=>Kr,FieldDescription:()=>De,FieldError:()=>je,FieldGroup:()=>Ue,FieldLabel:()=>qe,FieldLegend:()=>Wr,FieldSeparator:()=>Gr,FieldSet:()=>Hr,FieldTitle:()=>Vr,Form:()=>$s,HoverCard:()=>Oo,HoverCardContent:()=>Ro,HoverCardTrigger:()=>Io,Icon:()=>et,Input:()=>le,InputOtp:()=>ro,Item:()=>Dr,Kbd:()=>se,Label:()=>Zr,Markdown:()=>Jt,MarkdownTree:()=>Os,MarkdownTreeNode:()=>yn,Marker:()=>to,Menubar:()=>Yo,Message:()=>Rr,MessageScroller:()=>Br,NativeSelect:()=>we,NavigationMenu:()=>Zo,NavigationMenuItem:()=>Jo,NodexUI:()=>m,NodexUIComponents:()=>di,NodexUITheme:()=>Ii,OwlError:()=>pa,Pagination:()=>Vo,PaginationItem:()=>Go,Popover:()=>No,PopoverContent:()=>To,PopoverTrigger:()=>ss,Progress:()=>Mr,Pwa:()=>Qr,PwaBody:()=>on,PwaClose:()=>Bs,PwaContent:()=>Xr,PwaDescription:()=>sn,PwaFooter:()=>nn,PwaHeader:()=>tn,PwaSteps:()=>rn,PwaTitle:()=>en,PwaTrigger:()=>Rs,QRCard:()=>ks,Questionnaire:()=>$r,QuestionnaireNext:()=>Ls,QuestionnairePrevious:()=>Cs,QuestionnaireStep:()=>_r,RadioGroup:()=>eo,RadioGroupItem:()=>so,Resizable:()=>wr,ScrollArea:()=>Sr,Select:()=>no,SelectContent:()=>io,SelectItem:()=>ao,SelectTrigger:()=>Ge,Separator:()=>Qs,Sheet:()=>So,SheetClose:()=>es,SheetContent:()=>Ao,SheetDescription:()=>ko,SheetFooter:()=>Co,SheetHeader:()=>Eo,SheetTitle:()=>Lo,SheetTrigger:()=>ts,Shell:()=>bs,ShellContent:()=>gs,ShellHeader:()=>pr,ShellMain:()=>ur,ShellNav:()=>lr,ShellSidebar:()=>fs,ShellSidebarHeader:()=>cr,ShellUserMenu:()=>vs,Sidebar:()=>Vt,SidebarClose:()=>us,SidebarContent:()=>Be,SidebarFooter:()=>Xo,SidebarGroup:()=>$e,SidebarGroupAction:()=>ps,SidebarGroupCollapsible:()=>ds,SidebarGroupContent:()=>or,SidebarGroupLabel:()=>_e,SidebarHeader:()=>Qo,SidebarInput:()=>er,SidebarInset:()=>tr,SidebarMenu:()=>Gt,SidebarMenuAction:()=>hs,SidebarMenuBadge:()=>nr,SidebarMenuButton:()=>Kt,SidebarMenuItem:()=>Me,SidebarMenuSkeleton:()=>ir,SidebarMenuSub:()=>rr,SidebarMenuSubButton:()=>ms,SidebarMenuSubItem:()=>ar,SidebarProvider:()=>bn,SidebarRail:()=>ls,SidebarSeparator:()=>sr,SidebarTrigger:()=>cs,Skeleton:()=>xe,Slider:()=>oo,Spinner:()=>oe,Switch:()=>Ve,TabContent:()=>he,TabTrigger:()=>Dt,Table:()=>dr,Tabs:()=>ue,TabsContainer:()=>pe,TabsList:()=>de,TextEditor:()=>an,Textarea:()=>ye,ThemeButton:()=>Zt,Toast:()=>Ht,Toggle:()=>Ns,ToggleGroup:()=>Jr,ToggleGroupItem:()=>Ts,Tooltip:()=>$t,Typography:()=>Xs,__info__:()=>da,batched:()=>ha,blockDom:()=>ma,cn:()=>g,createNamedIcon:()=>qs,createThemeController:()=>ze,default:()=>tl,findMarkdownTreeNode:()=>ci,htmlEscape:()=>ba,iconComponentName:()=>Oi,loadFile:()=>Fe,loadTemplate:()=>Tl,markRaw:()=>fa,markup:()=>Pn,mergeStyle:()=>ft,mount:()=>Ps,normalizeTheme:()=>Qn,onError:()=>ga,onMounted:()=>tt,onPatched:()=>ct,onRendered:()=>va,onWillDestroy:()=>He,onWillPatch:()=>xa,onWillRender:()=>ya,onWillStart:()=>Tt,onWillUnmount:()=>st,onWillUpdateProps:()=>pt,rawMount:()=>vl,rawXml:()=>xl,reactive:()=>wa,registerGlobalComponents:()=>wi,status:()=>Sa,toRaw:()=>Aa,useChildSubEnv:()=>Z,useComponent:()=>Ea,useEffect:()=>Ct,useEnv:()=>Ca,useExternalListener:()=>Us,useRef:()=>z,useState:()=>M,useSubEnv:()=>La,validate:()=>ka,validateType:()=>Na,whenReady:()=>Ta,xml:()=>Si});j();_();var aa="1.0.0";q();var di={};Mn(di,{Accordion:()=>zo,AccordionContent:()=>Ho,AccordionItem:()=>Fo,AccordionTrigger:()=>ns,Alert:()=>Pt,AlertAction:()=>js,AlertDescription:()=>ee,AlertDialog:()=>co,AlertDialogAction:()=>Ye,AlertDialogCancel:()=>Je,AlertDialogContent:()=>lo,AlertDialogDescription:()=>bo,AlertDialogFooter:()=>po,AlertDialogHeader:()=>uo,AlertDialogMedia:()=>ho,AlertDialogTitle:()=>mo,AlertDialogTrigger:()=>Ze,AlertTitle:()=>Ds,ApiDoc:()=>Yt,ApiDocGroup:()=>Qt,AspectRatio:()=>Ur,Attachment:()=>Ar,AttachmentAction:()=>As,AttachmentActions:()=>Nr,AttachmentContent:()=>Cr,AttachmentDescription:()=>kr,AttachmentDropzone:()=>Or,AttachmentGroup:()=>Tr,AttachmentMedia:()=>Er,AttachmentTitle:()=>Lr,AttachmentTrigger:()=>Es,Avatar:()=>Ir,Badge:()=>Lt,BlockViewer:()=>Is,Breadcrumb:()=>Ne,BreadcrumbEllipsis:()=>as,BreadcrumbItem:()=>Oe,BreadcrumbLink:()=>Ie,BreadcrumbList:()=>Te,BreadcrumbPage:()=>Re,BreadcrumbSeparator:()=>Wt,Bubble:()=>Pr,Button:()=>U,ButtonGroup:()=>jr,ButtonGroupSeparator:()=>zr,ButtonGroupText:()=>Fr,Calendar:()=>ys,Card:()=>re,CardBody:()=>ie,CardDescription:()=>ce,CardFooter:()=>Hs,CardHeader:()=>ne,CardTitle:()=>ae,Carousel:()=>xr,CarouselNext:()=>Ss,CarouselPrevious:()=>ws,CarouselSlide:()=>yr,Chart:()=>vr,Checkbox:()=>Se,ClipboardButton:()=>Ut,CodeEditor:()=>We,Collapsible:()=>Wo,CollapsibleContent:()=>Ko,CollapsibleTrigger:()=>is,Combobox:()=>fr,Command:()=>gr,ContextMenu:()=>Po,ContextMenuContent:()=>Do,ContextMenuItem:()=>jo,ContextMenuTrigger:()=>qo,DataTable:()=>xs,DatePicker:()=>br,Dialog:()=>me,DialogClose:()=>Ke,DialogContent:()=>jt,DialogDescription:()=>ve,DialogFooter:()=>fe,DialogHeader:()=>be,DialogTitle:()=>ge,DialogTrigger:()=>Ws,Direction:()=>qr,Drawer:()=>fo,DrawerClose:()=>Xe,DrawerContent:()=>go,DrawerDescription:()=>wo,DrawerFooter:()=>xo,DrawerHeader:()=>vo,DrawerTitle:()=>yo,DrawerTrigger:()=>Qe,DropdownMenu:()=>Ae,DropdownMenuCheckboxItem:()=>os,DropdownMenuContent:()=>Ee,DropdownMenuGroup:()=>Bo,DropdownMenuItem:()=>Ce,DropdownMenuLabel:()=>$o,DropdownMenuRadioGroup:()=>_o,DropdownMenuRadioItem:()=>rs,DropdownMenuSeparator:()=>Mo,DropdownMenuShortcut:()=>Uo,DropdownMenuSub:()=>Le,DropdownMenuSubContent:()=>ke,DropdownMenuSubTrigger:()=>Ft,DropdownMenuTrigger:()=>zt,Empty:()=>Ks,EmptyContent:()=>Ys,EmptyDescription:()=>Js,EmptyHeader:()=>Vs,EmptyMedia:()=>Gs,EmptyTitle:()=>Zs,Field:()=>Pe,FieldContent:()=>Kr,FieldDescription:()=>De,FieldError:()=>je,FieldGroup:()=>Ue,FieldLabel:()=>qe,FieldLegend:()=>Wr,FieldSeparator:()=>Gr,FieldSet:()=>Hr,FieldTitle:()=>Vr,Form:()=>$s,HoverCard:()=>Oo,HoverCardContent:()=>Ro,HoverCardTrigger:()=>Io,Icon:()=>et,Input:()=>le,InputOtp:()=>ro,Item:()=>Dr,Kbd:()=>se,Label:()=>Zr,Markdown:()=>Jt,MarkdownTree:()=>Os,MarkdownTreeNode:()=>yn,Marker:()=>to,Menubar:()=>Yo,Message:()=>Rr,MessageScroller:()=>Br,NativeSelect:()=>we,NavigationMenu:()=>Zo,NavigationMenuItem:()=>Jo,Pagination:()=>Vo,PaginationItem:()=>Go,Popover:()=>No,PopoverContent:()=>To,PopoverTrigger:()=>ss,Progress:()=>Mr,Pwa:()=>Qr,PwaBody:()=>on,PwaClose:()=>Bs,PwaContent:()=>Xr,PwaDescription:()=>sn,PwaFooter:()=>nn,PwaHeader:()=>tn,PwaSteps:()=>rn,PwaTitle:()=>en,PwaTrigger:()=>Rs,QRCard:()=>ks,Questionnaire:()=>$r,QuestionnaireNext:()=>Ls,QuestionnairePrevious:()=>Cs,QuestionnaireStep:()=>_r,RadioGroup:()=>eo,RadioGroupItem:()=>so,Resizable:()=>wr,ScrollArea:()=>Sr,Select:()=>no,SelectContent:()=>io,SelectItem:()=>ao,SelectTrigger:()=>Ge,Separator:()=>Qs,Sheet:()=>So,SheetClose:()=>es,SheetContent:()=>Ao,SheetDescription:()=>ko,SheetFooter:()=>Co,SheetHeader:()=>Eo,SheetTitle:()=>Lo,SheetTrigger:()=>ts,Shell:()=>bs,ShellContent:()=>gs,ShellHeader:()=>pr,ShellMain:()=>ur,ShellNav:()=>lr,ShellSidebar:()=>fs,ShellSidebarHeader:()=>cr,ShellUserMenu:()=>vs,Sidebar:()=>Vt,SidebarClose:()=>us,SidebarContent:()=>Be,SidebarFooter:()=>Xo,SidebarGroup:()=>$e,SidebarGroupAction:()=>ps,SidebarGroupCollapsible:()=>ds,SidebarGroupContent:()=>or,SidebarGroupLabel:()=>_e,SidebarHeader:()=>Qo,SidebarInput:()=>er,SidebarInset:()=>tr,SidebarMenu:()=>Gt,SidebarMenuAction:()=>hs,SidebarMenuBadge:()=>nr,SidebarMenuButton:()=>Kt,SidebarMenuItem:()=>Me,SidebarMenuSkeleton:()=>ir,SidebarMenuSub:()=>rr,SidebarMenuSubButton:()=>ms,SidebarMenuSubItem:()=>ar,SidebarProvider:()=>bn,SidebarRail:()=>ls,SidebarSeparator:()=>sr,SidebarTrigger:()=>cs,Skeleton:()=>xe,Slider:()=>oo,Spinner:()=>oe,Switch:()=>Ve,TabContent:()=>he,TabTrigger:()=>Dt,Table:()=>dr,Tabs:()=>ue,TabsContainer:()=>pe,TabsList:()=>de,TextEditor:()=>an,Textarea:()=>ye,ThemeButton:()=>Zt,Toast:()=>Ht,Toggle:()=>Ns,ToggleGroup:()=>Jr,ToggleGroupItem:()=>Ts,Tooltip:()=>$t,Typography:()=>Xs,createNamedIcon:()=>qs,findMarkdownTreeNode:()=>ci,iconComponentName:()=>Oi});q();_();q();Mt();_();var et=class extends c{setup(){this.state=M({failed:!1}),Ct(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===jn)return;let s=new Image;return s.onerror=()=>{this.state.failed=!0},s.src=this.buildUrl(e),()=>{s.onload=null,s.onerror=null}},()=>[this.name])}buildUrl(e){return Cn(e,{baseUrl:xt(this.props,"base-url","baseUrl")})}get name(){return xt(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?jn:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),ft(e.join(";"),this.props.style)}get classNames(){return g("b-icon",this.props.className)}};n(et,"template","nodexui.Icon"),n(et,"props",{icon:i(String),name:i(String),label:i(String),title:i(String),size:i(String),"base-url":i(String),baseUrl:i(String),className:i(String),style:i([String,Object])});function qs(t){return class extends et{get name(){return xt(this.props,"icon","name")||t}}}un();var U=class extends c{setup(){this.rootRef=z("root"),this.props.getRef&&(tt(()=>this.props.getRef(this.rootRef.el)),st(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?g(this.props.className):g("btn","b-button",gt[this.props.variant]||gt.default,yt[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return xt(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return xt(this.props,"aria-label","ariaLabel")}get ariaPressed(){return xt(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=xt(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};n(U,"template","nodexui.Button"),n(U,"components",{Icon:et}),n(U,"props",{variant:i(String),size:i(String),type:i(String),href:i(String),disabled:i(Boolean),label:i(String),icon:i(String),"icon-position":i(String),iconPosition:i(String),unstyled:i(Boolean),attrs:i(Object),getRef:i(Function),...p,id:i(String),title:i(String),"aria-label":i(String),ariaLabel:i(String),"aria-pressed":i(String),ariaPressed:i(String),"aria-invalid":i([String,Boolean]),ariaInvalid:i([String,Boolean]),onClick:i(Function)});q();_();Fn();var Ut=class extends c{setup(){this.state=M({copied:!1}),this.resetTimer=null,st(()=>window.clearTimeout(this.resetTimer))}get classNames(){return zn(this.props)}get resetDelay(){return xt(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return xt(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let s=this.props.getValue?this.props.getValue():this.props.value??"";try{await pn(s),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:s,event:e})}catch(o){this.props.onCopyError?.({error:o,event:e})}}};n(Ut,"template","nodexui.ClipboardButton"),n(Ut,"components",{Button:U}),n(Ut,"props",{variant:i(String),size:i(String),value:i(String),getValue:i(Function),label:i(String),copiedLabel:i(String),icon:i(String),copiedIcon:i(String),"reset-delay":i(Number),resetDelay:i(Number),disabled:i(Boolean),...p,"aria-label":i(String),ariaLabel:i(String),onCopy:i(Function),onCopyError:i(Function)});q();_();q();function G(){let t=globalThis.bootstrap;if(!t)throw new Error("NodexUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}_();var Ra={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"},Pt=class extends c{setup(){this.rootRef=z("root"),this.bootstrapAlert=null,this.props.dismissible&&(tt(()=>{this.bootstrapAlert=new(G()).Alert(this.rootRef.el)}),st(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return g("alert","b-alert",Ra[this.props.variant]||Ra.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};n(Pt,"template","nodexui.Alert"),n(Pt,"components",{Button:U}),n(Pt,"props",{variant:i(String),dismissible:i(Boolean),...p});var Ds=class extends c{};n(Ds,"template","nodexui.AlertTitle"),n(Ds,"props",p);var ee=class extends c{};n(ee,"template","nodexui.AlertDescription"),n(ee,"props",p);var js=class extends c{};n(js,"template","nodexui.AlertAction"),n(js,"props",p);q();_();var zs={primary:"b-badge-primary",secondary:"b-badge-secondary",success:"b-badge-success",warning:"b-badge-warning",danger:"b-badge-danger",info:"b-badge-info",muted:"b-badge-muted"};var Lt=class extends c{get classNames(){return g("badge",zs[this.props.variant]||zs.secondary,this.props.pill&&"rounded-pill",this.props.className)}};n(Lt,"template","nodexui.Badge"),n(Lt,"props",{variant:i(String),pill:i(Boolean),label:i(String),...p});q();_();var se=class extends c{get classNames(){return g("b-kbd",this.props.className)}};n(se,"template","nodexui.Kbd"),n(se,"props",{...p});q();_();var oe=class extends c{get classNames(){return g("b-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};n(oe,"template","nodexui.Spinner"),n(oe,"props",{type:i(String),label:i(String),className:i(String),style:i([String,Object])});var qt={line:["//"],block:["/*","*/"],quotes:`"'`},Hn={line:["#"],quotes:`"'`},Ba="auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while include define ifdef ifndef endif pragma",Bl="abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true false try var void volatile while record",$a="async await break case catch class const continue debugger default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",Ln={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...qt,quotes:"\"'`",multiline:"`",indent:" ",keywords:$a,builtins:"console document window JSON Math Object Array Promise Map Set Date Number String Boolean Symbol require module exports process"},typescript:{annotations:!0,label:"TypeScript",...qt,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${$a} abstract as declare enum implements interface keyof namespace private protected public readonly type`,builtins:"console JSON Math Object Array Promise Map Set Date Number string number boolean any unknown never void Record Partial Readonly"},go:{label:"Go",...qt,quotes:"\"'`",multiline:"`",indent:" ",keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var nil true false",builtins:"append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 bool byte rune error any context fmt"},c:{label:"C",...qt,indent:" ",keywords:Ba,builtins:"NULL size_t printf scanf malloc free memcpy memset strlen strcmp FILE stdin stdout stderr uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t bool"},cpp:{label:"C++",...qt,indent:" ",keywords:`${Ba} alignas alignof and bool catch class constexpr const_cast decltype delete dynamic_cast explicit export false friend mutable namespace new noexcept nullptr operator or private protected public reinterpret_cast static_assert static_cast template this throw true try typeid typename using virtual override final`,builtins:"std string vector map set unordered_map unique_ptr shared_ptr cout cin endl size_t NULL"},java:{annotations:!0,label:"Java",...qt,indent:" ",keywords:Bl,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...qt,indent:" ",keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using var virtual void volatile while async await record",builtins:"Console String List Dictionary Task Math Exception"},kotlin:{annotations:!0,label:"Kotlin",...qt,quotes:`"'`,indent:" ",keywords:"abstract as break by catch class companion const constructor continue data do else enum false final finally for fun if import in infix init inline interface internal is lateinit null object open operator override package private protected public return sealed super suspend this throw true try typealias val var when while",builtins:"String Int Long Double Boolean List Map Set Any Unit println"},swift:{label:"Swift",...qt,indent:" ",keywords:"as associatedtype break case catch class continue default defer deinit do else enum extension fallthrough false fileprivate for func guard if import in init inout internal is let nil open operator private protocol public repeat rethrows return self static struct subscript super switch throw throws true try typealias var where while async await",builtins:"String Int Double Bool Array Dictionary Set Any print"},rust:{label:"Rust",...qt,quotes:'"',indent:" ",keywords:"as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait true type unsafe use where while",builtins:"String Vec Option Result Some None Ok Err Box Rc Arc println format vec i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool str"},php:{label:"PHP",variables:!0,line:["//","#"],block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global if implements include instanceof interface isset namespace new null or print private protected public require return static switch this throw trait true false try unset use var while yield",builtins:"count strlen array_map array_filter in_array json_encode json_decode var_dump"},python:{annotations:!0,label:"Python",...Hn,indent:" ",keywords:"and as assert async await break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield match case",builtins:"print len range str int float bool list dict set tuple open isinstance super self cls enumerate zip map filter sorted sum min max abs"},ruby:{label:"Ruby",...Hn,indent:" ",keywords:"BEGIN END alias and begin break case class def defined do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield",builtins:"puts print require require_relative attr_accessor attr_reader attr_writer lambda proc raise"},bash:{label:"Shell",variables:!0,...Hn,indent:" ",keywords:"case do done elif else esac fi for function if in select then until while",builtins:"echo cd ls cat grep sed awk export source exit read printf test set unset local return trap"},sql:{label:"SQL",line:["--"],block:["/*","*/"],quotes:`"'`,indent:" ",ci:!0,keywords:"add all alter and as asc begin between by case check column commit constraint create cross database default delete desc distinct drop else end exists foreign from full group having if in index inner insert into is join key left like limit not null offset on or order outer primary references returning right rollback select set table then transaction union unique update values view when where with",builtins:"count sum avg min max coalesce now cast varchar text integer int bigint boolean timestamp date numeric serial"},json:{label:"JSON",plainWords:!0,keys:!0,quotes:'"',indent:" ",keywords:"true false null"},yaml:{label:"YAML",plainWords:!0,keys:!0,...Hn,indent:" ",keywords:"true false null yes no on off"},css:{label:"CSS",plainWords:!0,keys:"prop",dashed:!0,hex:!0,block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"important inherit initial unset auto none",builtins:"var calc rgb rgba hsl hsla url"},html:{label:"HTML",plainWords:!0,tags:!0,block:["<!--","-->"],quotes:`"'`,indent:" "},lua:{label:"Lua",line:["--"],block:["--[[","]]"],quotes:`"'`,indent:" ",keywords:"and break do else elseif end false for function goto if in local nil not or repeat return then true until while",builtins:"assert error ipairs next pairs pcall print select tonumber tostring type unpack xpcall string table math os"}};Ln.xml={...Ln.html,label:"XML"};var $l={js:"javascript",jsx:"javascript",node:"javascript",ts:"typescript",tsx:"typescript",golang:"go",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",rs:"rust",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",postgres:"sql",postgresql:"sql",mysql:"sql",mjs:"javascript",cjs:"javascript",htm:"html",yml:"yaml",svg:"xml",text:"plaintext",txt:"plaintext"},_l={comment:"b-code-comment",string:"b-code-string",number:"b-code-number",keyword:"b-code-keyword",builtin:"b-code-builtin",function:"b-code-function",type:"b-code-type",tag:"b-code-tag",attr:"b-code-attr",meta:"b-code-meta",variable:"b-code-variable",plain:""},Li=/[A-Za-z_$]/,qa=/[A-Za-z0-9_$]/,Da=/[A-Za-z0-9_:-]/,Ml=/[0-9A-Za-z_.]/,_a=/[0-9]/,Ul=/[A-Za-z0-9_-]/,Ma=/^#[0-9a-fA-F]{3,8}\b/,Pl=/^&#?\w+;/,ql=/[A-Za-z/!?]/,Ci=new Map;function Ua(t,e){return new Set((t?e?t.toLowerCase():t:"").split(" ").filter(Boolean))}function Nn(t){let e=String(t??"").trim().toLowerCase(),s=$l[e]??e,o=s in Ln?s:"plaintext";if(!Ci.has(o)){let r=Ln[o];Ci.set(o,{id:o,...r,keywordSet:Ua(r.keywords,r.ci),builtinSet:Ua(r.builtins,r.ci)})}return Ci.get(o)}function ja(t){let e=String(t??"").split(/[?#]/)[0].split("/").pop();return e.includes(".")?e.split(".").pop().toLowerCase():""}var Xm=Object.keys(Ln);function kn(t,e,s){let o=e;for(;o<t.length&&s.test(t[o]);)o+=1;return o}function Dl(t,e,s){if(s.block&&t.startsWith(s.block[0],e)){let r=t.indexOf(s.block[1],e+s.block[0].length);return r===-1?t.length:r+s.block[1].length}if(!s.line?.some(r=>t.startsWith(r,e)))return-1;let o=t.indexOf(`
33
- `,e);return o===-1?t.length:o}function za(t,e,s){let o=t[e],r=s.multiline?.includes(o),a=e+1;for(;a<t.length&&t[a]!==o&&(r||t[a]!==`
34
- `);)a+=t[a]==="\\"?2:1;return Math.min(t.length,t[a]===o?a+1:a)}function jl(t,e){let s=e-1;for(;s>=0&&/\s/.test(t[s]);)s-=1;return t[s]}function Pa(t,e,s,o){return!o.keys||!/^\s*:(?!:|\/\/)/.test(t.slice(s,s+8))?!1:o.keys!=="prop"||"{;".includes(jl(t,e))}function zl(t,e,s,o){let r=o.ci?t.slice(e,s).toLowerCase():t.slice(e,s);if(o.keywordSet.has(r))return"keyword";let a=t[e-1]==="."||t[e-1]===":";return o.builtinSet.has(r)&&!a?"builtin":o.plainWords?"plain":/^\s*\(/.test(t.slice(s,s+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(r)?"type":"plain"}function Fl(t,e,s,o){let r=t[e],a=/^(\/|\?)?>/.exec(t.slice(e,e+2));return a?(o.inTag=!1,["tag",e+a[0].length]):s.quotes.includes(r)?["string",za(t,e,s)]:Li.test(r)?["attr",kn(t,e+1,Da)]:["plain",e+1]}function Hl(t,e,s){if(t[e]==="<"&&ql.test(t[e+1]??""))return s.inTag=!0,["tag",kn(t,e+2,Da)];let o=t[e]==="&"?Pl.exec(t.slice(e,e+12)):null;return o?["number",e+o[0].length]:["plain",e+1]}function Wl(t,e,s){let o=t[e];return!(o==="$"&&s.variables||o==="@"&&s.annotations)||!Li.test(t[e+1]??"")?null:[o==="$"?"variable":"meta",kn(t,e+2,qa)]}function Kl(t,e,s,o,r){let a=t[e];if(r.inTag)return Fl(t,e,s,r);let l=Dl(t,e,s);if(l!==-1)return["comment",l];if(s.tags)return Hl(t,e,r);if(s.quotes?.includes(a)){let I=za(t,e,s);return[Pa(t,e,I,s)?"attr":"string",I]}if(s.hex&&a==="#"&&Ma.test(t.slice(e,e+10)))return["number",e+Ma.exec(t.slice(e,e+10))[0].length];if(_a.test(a)||a==="."&&_a.test(t[e+1]??""))return["number",kn(t,e+1,Ml)];let u=Wl(t,e,s);if(u)return u;let d=s.dashed&&a==="-"&&/[A-Za-z-]/.test(t[e+1]??"");if(!Li.test(a)&&!d)return["plain",e+1];let b=kn(t,e+1,s.dashed?Ul:qa);if(Pa(t,e,b,s))return["attr",b];let x=zl(t,e,b,s);return[x==="plain"&&o.has(t.slice(e,b))&&t[e-1]!=="."?"builtin":x,b]}function Wn(t,e,s=[]){let o=Nn(e),r=new Set(s),a={inTag:!1},l=[],u=0;for(;u<t.length;){let[d,b]=Kl(t,u,o,r,a),x=t.slice(u,b),S=l[l.length-1];d==="plain"&&S?.kind==="plain"?S.text+=x:l.push({kind:d,text:x,className:_l[d]}),u=b}return l}function Fa(t,e){return t.startsWith(" ")?1:/^ */.exec(t.slice(0,e.length))[0].length}var Vl=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),Gl=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),Zl=/^[}\])]+/,Jl=/\b(function|if|for|while|repeat)\b/g,Yl=/\b(end|until)\b/g,Ql=/^(else|elseif)\b/,Xl=/^(end|until)\b/;function Fs(t,e){return(t.match(e)??[]).length}function tu(t,e){let s=new Uint8Array(t.length),o="",r=0;for(let{kind:a,text:l}of Wn(t,e)){let u=a==="comment"||a==="string";o+=u?l.replace(/[^\n]/g," "):l,u&&s.fill(1,r,r+l.length),r+=l.length}return{masked:o,inside:s}}function eu(t,e){let s=u=>!(e&&Gl.has(u.toLowerCase())),o=[...t.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(u=>s(u[1])).length,r=[...t.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(u=>s(u[1])).length,a=t.includes("<")?0:Fs(t,/\/>/g);return{leading:Fs(/^(?:<\/[^>]*>\s*)+/.exec(t)?.[0]??"",/<\//g),net:o-r-a-Fs(t,/<\//g)}}function su(t,e){let s=t.trim();if(e.tags)return eu(s,e.id==="html");let o=e.id==="lua",r=Zl.exec(s)?.[0].length??0,a=Fs(s,/[{([]/g)-Fs(s,/[})\]]/g);if(!o)return{leading:r,net:a};let l=Fs(s,Jl)+(/^do\b/.test(s)?1:0)-Fs(s,Yl);return{leading:r||(Ql.test(s)||Xl.test(s)?1:0),net:a+l}}function ou(t,e){return(t.id==="c"||t.id==="cpp")&&e.startsWith("#")}function ru(t,e){let{masked:s,inside:o}=tu(t,e.id),r=[],a=0,l=0;for(let u of t.split(`
35
- `)){let d=s.slice(l,l+u.length),b=l>0&&o[l-1]===1;l+=u.length+1;let x=u.trim(),{leading:S,net:I}=su(d,e);b?r.push(u.trimEnd()):x?ou(e,x)?r.push(x):r.push(e.indent.repeat(Math.max(0,a-S))+x):r.push(""),a=Math.max(0,a+I)}return r}function nu(t){return t.split(`
36
- `).map(e=>e.trimEnd())}function iu(t){return`${t.filter((s,o)=>s!==""||o>0&&t[o-1]!=="").join(`
10
+ var NodexUIBundle=(()=>{var wl=Object.create;var bn=Object.defineProperty;var Sl=Object.getOwnPropertyDescriptor;var Al=Object.getOwnPropertyNames;var El=Object.getPrototypeOf,Cl=Object.prototype.hasOwnProperty;var Ll=(t,e,o)=>e in t?bn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[e]=o;var Nn=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Tn=(t,e,o)=>()=>{if(o)throw o[0];try{return t&&(e=t(t=0)),e}catch(r){throw o=[r],r}};var kl=(t,e)=>()=>{try{return e||t((e={exports:{}}).exports,e),e.exports}catch(o){throw e=0,o}},On=(t,e)=>{for(var o in e)bn(t,o,{get:e[o],enumerable:!0})},aa=(t,e,o,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of Al(e))!Cl.call(t,s)&&s!==o&&bn(t,s,{get:()=>e[s],enumerable:!(r=Sl(e,s))||r.enumerable});return t};var gn=(t,e,o)=>(o=t!=null?wl(El(t)):{},aa(e||!t||!t.__esModule?bn(o,"default",{value:t,enumerable:!0}):o,t)),Nl=t=>aa(bn({},"__esModule",{value:!0}),t);var n=(t,e,o)=>Ll(t,typeof e!="symbol"?e+"":e,o);var sc=kl((oc,rc)=>{var ec=(function(){var t=function(L,_){var N=236,M=17,y=L,R=o[_],b=null,h=0,B=null,A=[],T={},G=function(w,S){h=y*4+17,b=(function(x){for(var E=new Array(x),C=0;C<x;C+=1){E[C]=new Array(x);for(var q=0;q<x;q+=1)E[C][q]=null}return E})(h),J(0,0),J(h-7,0),J(0,h-7),bt(),ct(),Zt(w,S),y>=7&&Rt(w),B==null&&(B=xl(y,R,A)),Jt(B,S)},J=function(w,S){for(var x=-1;x<=7;x+=1)if(!(w+x<=-1||h<=w+x))for(var E=-1;E<=7;E+=1)S+E<=-1||h<=S+E||(0<=x&&x<=6&&(E==0||E==6)||0<=E&&E<=6&&(x==0||x==6)||2<=x&&x<=4&&2<=E&&E<=4?b[w+x][S+E]=!0:b[w+x][S+E]=!1)},rt=function(){for(var w=0,S=0,x=0;x<8;x+=1){G(!0,x);var E=s.getLostPoint(T);(x==0||w>E)&&(w=E,S=x)}return S},ct=function(){for(var w=8;w<h-8;w+=1)b[w][6]==null&&(b[w][6]=w%2==0);for(var S=8;S<h-8;S+=1)b[6][S]==null&&(b[6][S]=S%2==0)},bt=function(){for(var w=s.getPatternPosition(y),S=0;S<w.length;S+=1)for(var x=0;x<w.length;x+=1){var E=w[S],C=w[x];if(b[E][C]==null)for(var q=-2;q<=2;q+=1)for(var F=-2;F<=2;F+=1)q==-2||q==2||F==-2||F==2||q==0&&F==0?b[E+q][C+F]=!0:b[E+q][C+F]=!1}},Rt=function(w){for(var S=s.getBCHTypeNumber(y),x=0;x<18;x+=1){var E=!w&&(S>>x&1)==1;b[Math.floor(x/3)][x%3+h-8-3]=E}for(var x=0;x<18;x+=1){var E=!w&&(S>>x&1)==1;b[x%3+h-8-3][Math.floor(x/3)]=E}},Zt=function(w,S){for(var x=R<<3|S,E=s.getBCHTypeInfo(x),C=0;C<15;C+=1){var q=!w&&(E>>C&1)==1;C<6?b[C][8]=q:C<8?b[C+1][8]=q:b[h-15+C][8]=q}for(var C=0;C<15;C+=1){var q=!w&&(E>>C&1)==1;C<8?b[8][h-C-1]=q:C<9?b[8][15-C-1+1]=q:b[8][15-C-1]=q}b[h-8][8]=!w},Jt=function(w,S){for(var x=-1,E=h-1,C=7,q=0,F=s.getMaskFunction(S),j=h-1;j>0;j-=2)for(j==6&&(j-=1);;){for(var st=0;st<2;st+=1)if(b[E][j-st]==null){var pt=!1;q<w.length&&(pt=(w[q]>>>C&1)==1);var W=F(E,j-st);W&&(pt=!pt),b[E][j-st]=pt,C-=1,C==-1&&(q+=1,C=7)}if(E+=x,E<0||h<=E){E-=x,x=-x;break}}},sn=function(w,S){for(var x=0,E=0,C=0,q=new Array(S.length),F=new Array(S.length),j=0;j<S.length;j+=1){var st=S[j].dataCount,pt=S[j].totalCount-st;E=Math.max(E,st),C=Math.max(C,pt),q[j]=new Array(st);for(var W=0;W<q[j].length;W+=1)q[j][W]=255&w.getBuffer()[W+x];x+=st;var Ct=s.getErrorCorrectPolynomial(pt),Lt=c(q[j],Ct.getLength()-1),sa=Lt.mod(Ct);F[j]=new Array(Ct.getLength()-1);for(var W=0;W<F[j].length;W+=1){var na=W+sa.getLength()-F[j].length;F[j][W]=na>=0?sa.getAt(na):0}}for(var ia=0,W=0;W<S.length;W+=1)ia+=S[W].totalCount;for(var fi=new Array(ia),kn=0,W=0;W<E;W+=1)for(var j=0;j<S.length;j+=1)W<q[j].length&&(fi[kn]=q[j][W],kn+=1);for(var W=0;W<C;W+=1)for(var j=0;j<S.length;j+=1)W<F[j].length&&(fi[kn]=F[j][W],kn+=1);return fi},xl=function(w,S,x){for(var E=l.getRSBlocks(w,S),C=d(),q=0;q<x.length;q+=1){var F=x[q];C.put(F.getMode(),4),C.put(F.getLength(),s.getLengthInBits(F.getMode(),w)),F.write(C)}for(var j=0,q=0;q<E.length;q+=1)j+=E[q].dataCount;if(C.getLengthInBits()>j*8)throw"code length overflow. ("+C.getLengthInBits()+">"+j*8+")";for(C.getLengthInBits()+4<=j*8&&C.put(0,4);C.getLengthInBits()%8!=0;)C.putBit(!1);for(;!(C.getLengthInBits()>=j*8||(C.put(N,8),C.getLengthInBits()>=j*8));)C.put(M,8);return sn(C,E)};T.addData=function(w,S){S=S||"Byte";var x=null;switch(S){case"Numeric":x=f(w);break;case"Alphanumeric":x=v(w);break;case"Byte":x=O(w);break;case"Kanji":x=k(w);break;default:throw"mode:"+S}A.push(x),B=null},T.isDark=function(w,S){if(w<0||h<=w||S<0||h<=S)throw w+","+S;return b[w][S]},T.getModuleCount=function(){return h},T.make=function(){if(y<1){for(var w=1;w<40;w++){for(var S=l.getRSBlocks(w,R),x=d(),E=0;E<A.length;E++){var C=A[E];x.put(C.getMode(),4),x.put(C.getLength(),s.getLengthInBits(C.getMode(),w)),C.write(x)}for(var q=0,E=0;E<S.length;E++)q+=S[E].dataCount;if(x.getLengthInBits()<=q*8)break}y=w}G(!1,rt())},T.createTableTag=function(w,S){w=w||2,S=typeof S>"u"?w*4:S;var x="";x+='<table style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: "+S+"px;",x+='">',x+="<tbody>";for(var E=0;E<T.getModuleCount();E+=1){x+="<tr>";for(var C=0;C<T.getModuleCount();C+=1)x+='<td style="',x+=" border-width: 0px; border-style: none;",x+=" border-collapse: collapse;",x+=" padding: 0px; margin: 0px;",x+=" width: "+w+"px;",x+=" height: "+w+"px;",x+=" background-color: ",x+=T.isDark(E,C)?"#000000":"#ffffff",x+=";",x+='"/>';x+="</tr>"}return x+="</tbody>",x+="</table>",x},T.createSvgTag=function(w,S,x,E){var C={};typeof arguments[0]=="object"&&(C=arguments[0],w=C.cellSize,S=C.margin,x=C.alt,E=C.title),w=w||2,S=typeof S>"u"?w*4:S,x=typeof x=="string"?{text:x}:x||{},x.text=x.text||null,x.id=x.text?x.id||"qrcode-description":null,E=typeof E=="string"?{text:E}:E||{},E.text=E.text||null,E.id=E.text?E.id||"qrcode-title":null;var q=T.getModuleCount()*w+S*2,F,j,st,pt,W="",Ct;for(Ct="l"+w+",0 0,"+w+" -"+w+",0 0,-"+w+"z ",W+='<svg version="1.1" xmlns="http://www.w3.org/2000/svg"',W+=C.scalable?"":' width="'+q+'px" height="'+q+'px"',W+=' viewBox="0 0 '+q+" "+q+'" ',W+=' preserveAspectRatio="xMinYMin meet"',W+=E.text||x.text?' role="img" aria-labelledby="'+nn([E.id,x.id].join(" ").trim())+'"':"",W+=">",W+=E.text?'<title id="'+nn(E.id)+'">'+nn(E.text)+"</title>":"",W+=x.text?'<description id="'+nn(x.id)+'">'+nn(x.text)+"</description>":"",W+='<rect width="100%" height="100%" fill="white" cx="0" cy="0"/>',W+='<path d="',st=0;st<T.getModuleCount();st+=1)for(pt=st*w+S,F=0;F<T.getModuleCount();F+=1)T.isDark(st,F)&&(j=F*w+S,W+="M"+j+","+pt+Ct);return W+='" stroke="transparent" fill="black"/>',W+="</svg>",W},T.createDataURL=function(w,S){w=w||2,S=typeof S>"u"?w*4:S;var x=T.getModuleCount()*w+S*2,E=S,C=x-S;return nt(x,x,function(q,F){if(E<=q&&q<C&&E<=F&&F<C){var j=Math.floor((q-E)/w),st=Math.floor((F-E)/w);return T.isDark(st,j)?0:1}else return 1})},T.createImgTag=function(w,S,x){w=w||2,S=typeof S>"u"?w*4:S;var E=T.getModuleCount()*w+S*2,C="";return C+="<img",C+=' src="',C+=T.createDataURL(w,S),C+='"',C+=' width="',C+=E,C+='"',C+=' height="',C+=E,C+='"',x&&(C+=' alt="',C+=nn(x),C+='"'),C+="/>",C};var nn=function(w){for(var S="",x=0;x<w.length;x+=1){var E=w.charAt(x);switch(E){case"<":S+="&lt;";break;case">":S+="&gt;";break;case"&":S+="&amp;";break;case'"':S+="&quot;";break;default:S+=E;break}}return S},yl=function(w){var S=1;w=typeof w>"u"?S*2:w;var x=T.getModuleCount()*S+w*2,E=w,C=x-w,q,F,j,st,pt,W={"\u2588\u2588":"\u2588","\u2588 ":"\u2580"," \u2588":"\u2584"," ":" "},Ct={"\u2588\u2588":"\u2580","\u2588 ":"\u2580"," \u2588":" "," ":" "},Lt="";for(q=0;q<x;q+=2){for(j=Math.floor((q-E)/S),st=Math.floor((q+1-E)/S),F=0;F<x;F+=1)pt="\u2588",E<=F&&F<C&&E<=q&&q<C&&T.isDark(j,Math.floor((F-E)/S))&&(pt=" "),E<=F&&F<C&&E<=q+1&&q+1<C&&T.isDark(st,Math.floor((F-E)/S))?pt+=" ":pt+="\u2588",Lt+=w<1&&q+1>=C?Ct[pt]:W[pt];Lt+=`
11
+ `}return x%2&&w>0?Lt.substring(0,Lt.length-x-1)+Array(x+1).join("\u2580"):Lt.substring(0,Lt.length-1)};return T.createASCII=function(w,S){if(w=w||1,w<2)return yl(S);w-=1,S=typeof S>"u"?w*2:S;var x=T.getModuleCount()*w+S*2,E=S,C=x-S,q,F,j,st,pt=Array(w+1).join("\u2588\u2588"),W=Array(w+1).join(" "),Ct="",Lt="";for(q=0;q<x;q+=1){for(j=Math.floor((q-E)/w),Lt="",F=0;F<x;F+=1)st=1,E<=F&&F<C&&E<=q&&q<C&&T.isDark(j,Math.floor((F-E)/w))&&(st=0),Lt+=st?pt:W;for(j=0;j<w;j+=1)Ct+=Lt+`
12
+ `}return Ct.substring(0,Ct.length-1)},T.renderTo2dContext=function(w,S){S=S||2;for(var x=T.getModuleCount(),E=0;E<x;E++)for(var C=0;C<x;C++)w.fillStyle=T.isDark(E,C)?"black":"white",w.fillRect(E*S,C*S,S,S)},T};t.stringToBytesFuncs={default:function(L){for(var _=[],N=0;N<L.length;N+=1){var M=L.charCodeAt(N);_.push(M&255)}return _}},t.stringToBytes=t.stringToBytesFuncs.default,t.createStringToBytes=function(L,_){var N=(function(){for(var y=I(L),R=function(){var ct=y.read();if(ct==-1)throw"eof";return ct},b=0,h={};;){var B=y.read();if(B==-1)break;var A=R(),T=R(),G=R(),J=String.fromCharCode(B<<8|A),rt=T<<8|G;h[J]=rt,b+=1}if(b!=_)throw b+" != "+_;return h})(),M=63;return function(y){for(var R=[],b=0;b<y.length;b+=1){var h=y.charCodeAt(b);if(h<128)R.push(h);else{var B=N[y.charAt(b)];typeof B=="number"?(B&255)==B?R.push(B):(R.push(B>>>8),R.push(B&255)):R.push(M)}}return R}};var e={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},o={L:1,M:0,Q:3,H:2},r={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s=(function(){var L=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],_=1335,N=7973,M=21522,y={},R=function(b){for(var h=0;b!=0;)h+=1,b>>>=1;return h};return y.getBCHTypeInfo=function(b){for(var h=b<<10;R(h)-R(_)>=0;)h^=_<<R(h)-R(_);return(b<<10|h)^M},y.getBCHTypeNumber=function(b){for(var h=b<<12;R(h)-R(N)>=0;)h^=N<<R(h)-R(N);return b<<12|h},y.getPatternPosition=function(b){return L[b-1]},y.getMaskFunction=function(b){switch(b){case r.PATTERN000:return function(h,B){return(h+B)%2==0};case r.PATTERN001:return function(h,B){return h%2==0};case r.PATTERN010:return function(h,B){return B%3==0};case r.PATTERN011:return function(h,B){return(h+B)%3==0};case r.PATTERN100:return function(h,B){return(Math.floor(h/2)+Math.floor(B/3))%2==0};case r.PATTERN101:return function(h,B){return h*B%2+h*B%3==0};case r.PATTERN110:return function(h,B){return(h*B%2+h*B%3)%2==0};case r.PATTERN111:return function(h,B){return(h*B%3+(h+B)%2)%2==0};default:throw"bad maskPattern:"+b}},y.getErrorCorrectPolynomial=function(b){for(var h=c([1],0),B=0;B<b;B+=1)h=h.multiply(c([1,a.gexp(B)],0));return h},y.getLengthInBits=function(b,h){if(1<=h&&h<10)switch(b){case e.MODE_NUMBER:return 10;case e.MODE_ALPHA_NUM:return 9;case e.MODE_8BIT_BYTE:return 8;case e.MODE_KANJI:return 8;default:throw"mode:"+b}else if(h<27)switch(b){case e.MODE_NUMBER:return 12;case e.MODE_ALPHA_NUM:return 11;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 10;default:throw"mode:"+b}else if(h<41)switch(b){case e.MODE_NUMBER:return 14;case e.MODE_ALPHA_NUM:return 13;case e.MODE_8BIT_BYTE:return 16;case e.MODE_KANJI:return 12;default:throw"mode:"+b}else throw"type:"+h},y.getLostPoint=function(b){for(var h=b.getModuleCount(),B=0,A=0;A<h;A+=1)for(var T=0;T<h;T+=1){for(var G=0,J=b.isDark(A,T),rt=-1;rt<=1;rt+=1)if(!(A+rt<0||h<=A+rt))for(var ct=-1;ct<=1;ct+=1)T+ct<0||h<=T+ct||rt==0&&ct==0||J==b.isDark(A+rt,T+ct)&&(G+=1);G>5&&(B+=3+G-5)}for(var A=0;A<h-1;A+=1)for(var T=0;T<h-1;T+=1){var bt=0;b.isDark(A,T)&&(bt+=1),b.isDark(A+1,T)&&(bt+=1),b.isDark(A,T+1)&&(bt+=1),b.isDark(A+1,T+1)&&(bt+=1),(bt==0||bt==4)&&(B+=3)}for(var A=0;A<h;A+=1)for(var T=0;T<h-6;T+=1)b.isDark(A,T)&&!b.isDark(A,T+1)&&b.isDark(A,T+2)&&b.isDark(A,T+3)&&b.isDark(A,T+4)&&!b.isDark(A,T+5)&&b.isDark(A,T+6)&&(B+=40);for(var T=0;T<h;T+=1)for(var A=0;A<h-6;A+=1)b.isDark(A,T)&&!b.isDark(A+1,T)&&b.isDark(A+2,T)&&b.isDark(A+3,T)&&b.isDark(A+4,T)&&!b.isDark(A+5,T)&&b.isDark(A+6,T)&&(B+=40);for(var Rt=0,T=0;T<h;T+=1)for(var A=0;A<h;A+=1)b.isDark(A,T)&&(Rt+=1);var Zt=Math.abs(100*Rt/h/h-50)/5;return B+=Zt*10,B},y})(),a=(function(){for(var L=new Array(256),_=new Array(256),N=0;N<8;N+=1)L[N]=1<<N;for(var N=8;N<256;N+=1)L[N]=L[N-4]^L[N-5]^L[N-6]^L[N-8];for(var N=0;N<255;N+=1)_[L[N]]=N;var M={};return M.glog=function(y){if(y<1)throw"glog("+y+")";return _[y]},M.gexp=function(y){for(;y<0;)y+=255;for(;y>=256;)y-=255;return L[y]},M})();function c(L,_){if(typeof L.length>"u")throw L.length+"/"+_;var N=(function(){for(var y=0;y<L.length&&L[y]==0;)y+=1;for(var R=new Array(L.length-y+_),b=0;b<L.length-y;b+=1)R[b]=L[b+y];return R})(),M={};return M.getAt=function(y){return N[y]},M.getLength=function(){return N.length},M.multiply=function(y){for(var R=new Array(M.getLength()+y.getLength()-1),b=0;b<M.getLength();b+=1)for(var h=0;h<y.getLength();h+=1)R[b+h]^=a.gexp(a.glog(M.getAt(b))+a.glog(y.getAt(h)));return c(R,0)},M.mod=function(y){if(M.getLength()-y.getLength()<0)return M;for(var R=a.glog(M.getAt(0))-a.glog(y.getAt(0)),b=new Array(M.getLength()),h=0;h<M.getLength();h+=1)b[h]=M.getAt(h);for(var h=0;h<y.getLength();h+=1)b[h]^=a.gexp(a.glog(y.getAt(h))+R);return c(b,0).mod(y)},M}var l=(function(){var L=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12,7,37,13],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],_=function(y,R){var b={};return b.totalCount=y,b.dataCount=R,b},N={},M=function(y,R){switch(R){case o.L:return L[(y-1)*4+0];case o.M:return L[(y-1)*4+1];case o.Q:return L[(y-1)*4+2];case o.H:return L[(y-1)*4+3];default:return}};return N.getRSBlocks=function(y,R){var b=M(y,R);if(typeof b>"u")throw"bad rs block @ typeNumber:"+y+"/errorCorrectionLevel:"+R;for(var h=b.length/3,B=[],A=0;A<h;A+=1)for(var T=b[A*3+0],G=b[A*3+1],J=b[A*3+2],rt=0;rt<T;rt+=1)B.push(_(G,J));return B},N})(),d=function(){var L=[],_=0,N={};return N.getBuffer=function(){return L},N.getAt=function(M){var y=Math.floor(M/8);return(L[y]>>>7-M%8&1)==1},N.put=function(M,y){for(var R=0;R<y;R+=1)N.putBit((M>>>y-R-1&1)==1)},N.getLengthInBits=function(){return _},N.putBit=function(M){var y=Math.floor(_/8);L.length<=y&&L.push(0),M&&(L[y]|=128>>>_%8),_+=1},N},f=function(L){var _=e.MODE_NUMBER,N=L,M={};M.getMode=function(){return _},M.getLength=function(b){return N.length},M.write=function(b){for(var h=N,B=0;B+2<h.length;)b.put(y(h.substring(B,B+3)),10),B+=3;B<h.length&&(h.length-B==1?b.put(y(h.substring(B,B+1)),4):h.length-B==2&&b.put(y(h.substring(B,B+2)),7))};var y=function(b){for(var h=0,B=0;B<b.length;B+=1)h=h*10+R(b.charAt(B));return h},R=function(b){if("0"<=b&&b<="9")return b.charCodeAt(0)-48;throw"illegal char :"+b};return M},v=function(L){var _=e.MODE_ALPHA_NUM,N=L,M={};M.getMode=function(){return _},M.getLength=function(R){return N.length},M.write=function(R){for(var b=N,h=0;h+1<b.length;)R.put(y(b.charAt(h))*45+y(b.charAt(h+1)),11),h+=2;h<b.length&&R.put(y(b.charAt(h)),6)};var y=function(R){if("0"<=R&&R<="9")return R.charCodeAt(0)-48;if("A"<=R&&R<="Z")return R.charCodeAt(0)-65+10;switch(R){case" ":return 36;case"$":return 37;case"%":return 38;case"*":return 39;case"+":return 40;case"-":return 41;case".":return 42;case"/":return 43;case":":return 44;default:throw"illegal char :"+R}};return M},O=function(L){var _=e.MODE_8BIT_BYTE,N=L,M=t.stringToBytes(L),y={};return y.getMode=function(){return _},y.getLength=function(R){return M.length},y.write=function(R){for(var b=0;b<M.length;b+=1)R.put(M[b],8)},y},k=function(L){var _=e.MODE_KANJI,N=L,M=t.stringToBytesFuncs.SJIS;if(!M)throw"sjis not supported.";(function(b,h){var B=M(b);if(B.length!=2||(B[0]<<8|B[1])!=h)throw"sjis not supported."})("\u53CB",38726);var y=M(L),R={};return R.getMode=function(){return _},R.getLength=function(b){return~~(y.length/2)},R.write=function(b){for(var h=y,B=0;B+1<h.length;){var A=(255&h[B])<<8|255&h[B+1];if(33088<=A&&A<=40956)A-=33088;else if(57408<=A&&A<=60351)A-=49472;else throw"illegal char at "+(B+1)+"/"+A;A=(A>>>8&255)*192+(A&255),b.put(A,13),B+=2}if(B<h.length)throw"illegal char at "+(B+1)},R},D=function(){var L=[],_={};return _.writeByte=function(N){L.push(N&255)},_.writeShort=function(N){_.writeByte(N),_.writeByte(N>>>8)},_.writeBytes=function(N,M,y){M=M||0,y=y||N.length;for(var R=0;R<y;R+=1)_.writeByte(N[R+M])},_.writeString=function(N){for(var M=0;M<N.length;M+=1)_.writeByte(N.charCodeAt(M))},_.toByteArray=function(){return L},_.toString=function(){var N="";N+="[";for(var M=0;M<L.length;M+=1)M>0&&(N+=","),N+=L[M];return N+="]",N},_},X=function(){var L=0,_=0,N=0,M="",y={},R=function(h){M+=String.fromCharCode(b(h&63))},b=function(h){if(!(h<0)){if(h<26)return 65+h;if(h<52)return 97+(h-26);if(h<62)return 48+(h-52);if(h==62)return 43;if(h==63)return 47}throw"n:"+h};return y.writeByte=function(h){for(L=L<<8|h&255,_+=8,N+=1;_>=6;)R(L>>>_-6),_-=6},y.flush=function(){if(_>0&&(R(L<<6-_),L=0,_=0),N%3!=0)for(var h=3-N%3,B=0;B<h;B+=1)M+="="},y.toString=function(){return M},y},I=function(L){var _=L,N=0,M=0,y=0,R={};R.read=function(){for(;y<8;){if(N>=_.length){if(y==0)return-1;throw"unexpected end of file./"+y}var h=_.charAt(N);if(N+=1,h=="=")return y=0,-1;if(h.match(/^\s$/))continue;M=M<<6|b(h.charCodeAt(0)),y+=6}var B=M>>>y-8&255;return y-=8,B};var b=function(h){if(65<=h&&h<=90)return h-65;if(97<=h&&h<=122)return h-97+26;if(48<=h&&h<=57)return h-48+52;if(h==43)return 62;if(h==47)return 63;throw"c:"+h};return R},K=function(L,_){var N=L,M=_,y=new Array(L*_),R={};R.setPixel=function(A,T,G){y[T*N+A]=G},R.write=function(A){A.writeString("GIF87a"),A.writeShort(N),A.writeShort(M),A.writeByte(128),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(0),A.writeByte(255),A.writeByte(255),A.writeByte(255),A.writeString(","),A.writeShort(0),A.writeShort(0),A.writeShort(N),A.writeShort(M),A.writeByte(0);var T=2,G=h(T);A.writeByte(T);for(var J=0;G.length-J>255;)A.writeByte(255),A.writeBytes(G,J,255),J+=255;A.writeByte(G.length-J),A.writeBytes(G,J,G.length-J),A.writeByte(0),A.writeString(";")};var b=function(A){var T=A,G=0,J=0,rt={};return rt.write=function(ct,bt){if(ct>>>bt)throw"length over";for(;G+bt>=8;)T.writeByte(255&(ct<<G|J)),bt-=8-G,ct>>>=8-G,J=0,G=0;J=ct<<G|J,G=G+bt},rt.flush=function(){G>0&&T.writeByte(J)},rt},h=function(A){for(var T=1<<A,G=(1<<A)+1,J=A+1,rt=B(),ct=0;ct<T;ct+=1)rt.add(String.fromCharCode(ct));rt.add(String.fromCharCode(T)),rt.add(String.fromCharCode(G));var bt=D(),Rt=b(bt);Rt.write(T,J);var Zt=0,Jt=String.fromCharCode(y[Zt]);for(Zt+=1;Zt<y.length;){var sn=String.fromCharCode(y[Zt]);Zt+=1,rt.contains(Jt+sn)?Jt=Jt+sn:(Rt.write(rt.indexOf(Jt),J),rt.size()<4095&&(rt.size()==1<<J&&(J+=1),rt.add(Jt+sn)),Jt=sn)}return Rt.write(rt.indexOf(Jt),J),Rt.write(G,J),Rt.flush(),bt.toByteArray()},B=function(){var A={},T=0,G={};return G.add=function(J){if(G.contains(J))throw"dup key:"+J;A[J]=T,T+=1},G.size=function(){return T},G.indexOf=function(J){return A[J]},G.contains=function(J){return typeof A[J]<"u"},G};return R},nt=function(L,_,N){for(var M=K(L,_),y=0;y<_;y+=1)for(var R=0;R<L;R+=1)M.setPixel(R,y,N(R,y));var b=D();M.write(b);for(var h=X(),B=b.toByteArray(),A=0;A<B.length;A+=1)h.writeByte(B[A]);return h.flush(),"data:image/gif;base64,"+h};return t})();(function(){ec.stringToBytesFuncs["UTF-8"]=function(t){function e(o){for(var r=[],s=0;s<o.length;s++){var a=o.charCodeAt(s);a<128?r.push(a):a<2048?r.push(192|a>>6,128|a&63):a<55296||a>=57344?r.push(224|a>>12,128|a>>6&63,128|a&63):(s++,a=65536+((a&1023)<<10|o.charCodeAt(s)&1023),r.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|a&63))}return r}return e(t)}})();(function(t){typeof define=="function"&&define.amd?define([],t):typeof oc=="object"&&(rc.exports=t())})(function(){return ec})});var yc={};On(yc,{expandSelfClosingTags:()=>vc,extractTagCaseMap:()=>gc,normalizeOwlPreviewMarkup:()=>xc});function hc(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}function gc(t){let e=new Map;for(let o of t.matchAll(/<\/?([A-Z][A-Za-z0-9]*)\b/g))e.set(o[1].toLowerCase(),o[1]);return e}function sp(t){return e=>{if(e.hasAttribute("b-ui"))return e;let o=globalThis.thebase,r=t.get(e.localName)||e.localName,s=hc(r),a=!!o?.component?.(s),c=ot(e.getAttribute("className")||e.getAttribute("class"));if(!a){let l=`b-${s}`;return e.className=c?`${l} ${c}`:l,e}e.setAttribute("b-ui",s),c&&(e.className=c);for(let l of[...e.attributes]){if(l.name==="class"||l.name==="className"||l.name==="b-ui"||/^on[A-Z]/.test(l.name))continue;let d=ot(l.value);e.removeAttribute(l.name),!(d===""||d==="false")&&e.setAttribute(`b-att-${hc(l.name)}`,d==="true"?"true":d)}return e}}function ot(t){if(!t)return"";let e=t.trim();return e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"')?e.slice(1,-1):e}function Jn(t,e){for(;t.firstChild;)e.append(t.firstChild)}function Tt(t,e){return Jn(t,e),t.replaceWith(e),e}function np(t){let e=document.createElement("div");e.setAttribute("b-field-group","");let o=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),Tt(t,e)}function ip(t){let e=document.createElement("div");e.setAttribute("b-ui","field");let o=ot(t.getAttribute("orientation")||""),r=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("b-att-orientation",o),r&&(e.className=r),Tt(t,e)}function ap(t){let e=document.createElement("label");e.setAttribute("b-field-label","");let o=ot(t.getAttribute("for")||""),r=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("for",o),r&&(e.className=r),Tt(t,e)}function mc(t,e,o){let r=document.createElement(e);r.setAttribute(o,"");let s=ot(t.getAttribute("className")||t.getAttribute("class"));return s&&(r.className=s),Tt(t,r)}function cp(t){let e=t.getAttribute("type")||"",o=t.hasAttribute("variant")||t.hasAttribute("size")||t.hasAttribute("className")||t.hasAttribute("onClick")||t.hasAttribute("label")||e.trim().startsWith("'")||e.trim().startsWith('"');if(t.hasAttribute("b-ui")||!o)return t;let r=document.createElement("button");r.setAttribute("b-ui","button");let s=ot(e||"button"),a=ot(t.getAttribute("variant")||""),c=ot(t.getAttribute("size")||""),l=ot(t.getAttribute("className")||t.getAttribute("class")),d=ot(t.getAttribute("label")||"");return r.type=s||"button",a&&r.setAttribute("b-att-variant",a),c&&r.setAttribute("b-att-size",c),l&&(r.className=l),d&&!t.childNodes.length&&(r.textContent=d),Tt(t,r)}function lp(t){if(t.hasAttribute("b-ui")||t.hasAttribute("b-icon"))return t;let e=ot(t.getAttribute("name")||t.getAttribute("icon")||"");if(!e)return t;let o=document.createElement("span");o.setAttribute("b-ui","icon"),o.setAttribute("b-att-icon",e);let r=ot(t.getAttribute("size")||""),s=ot(t.getAttribute("label")||""),a=ot(t.getAttribute("className")||t.getAttribute("class"));return r&&o.setAttribute("b-att-size",r),s&&o.setAttribute("b-att-label",s),a&&(o.className=a),Tt(t,o)}function up(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","alert");let o=ot(t.getAttribute("variant")||""),r=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&e.setAttribute("b-att-variant",o),r&&(e.className=r),Tt(t,e)}function Ri(t){return e=>{if(e.hasAttribute("b-ui"))return e;let o=document.createElement("div"),r=ot(e.getAttribute("className")||e.getAttribute("class"));return o.className=r?`${t} ${r}`:t,Tt(e,o)}}function pp(t){if(t.hasAttribute("b-ui"))return t;let e=document.createElement("div");e.setAttribute("b-ui","accordion"),ot(t.getAttribute("multiple"))==="true"&&e.setAttribute("b-att-multiple","true");let o=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),Tt(t,e)}function dp(t){if(t.hasAttribute("b-accordion-item"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-item",""),ot(t.getAttribute("state"))==="open"&&e.setAttribute("b-att-state","open");let o=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),Tt(t,e)}function hp(t){if(t.hasAttribute("b-accordion-trigger"))return t;let e=document.createElement("button");e.type="button",e.setAttribute("b-accordion-trigger","");let o=ot(t.getAttribute("className")||t.getAttribute("class"));o&&(e.className=o),Jn(t,e);let r=document.createElement("span");return r.setAttribute("b-icon","chevron-down"),r.className="b-accordion-trigger-icon",e.append(r),t.replaceWith(e),e}function mp(t){if(t.hasAttribute("b-accordion-panel"))return t;let e=document.createElement("div");e.setAttribute("b-accordion-panel","");let o=ot(t.getAttribute("className")||t.getAttribute("class"));return o&&(e.className=o),Tt(t,e)}function fp(t){return fc+=1,`${t}-${fc}`}function Nt(t,e,o){return r=>{if(r.hasAttribute("b-ui"))return r;let s=document.createElement(t);t==="button"&&(s.type="button"),o&&s.setAttribute(o,"");let a=ot(r.getAttribute("className")||r.getAttribute("class"));return s.className=a?`${e} ${a}`:e,Tt(r,s)}}function bp(){let t=document.createElement("button");t.type="button",t.className="btn b-button btn-light btn-icon-sm b-dialog-close b-dialog-close-control",t.setAttribute("b-dialog-close",""),t.setAttribute("aria-label","Close");let e=document.createElement("span");e.setAttribute("b-ui","icon"),e.setAttribute("b-att-icon","x");let o=document.createElement("span");return o.className="visually-hidden",o.textContent="Close",t.append(e,o),t}function bc({tagPrefix:t,componentName:e,triggerTag:o,triggerClassName:r,panelClassName:s,closeButton:a}){return c=>{if(c.hasAttribute("b-ui"))return c;let l=c.querySelector(`:scope > ${t}trigger`),d=c.querySelector(`:scope > ${t}content`);if(!d)return c;let f=fp(`b-preview-${e}`),v=document.createElement(o);o==="button"&&(v.type="button"),v.className=r,v.setAttribute("b-att-trigger",`#${f}`),l&&Jn(l,v);let O=document.createElement("div");O.setAttribute("b-ui",e),O.id=f,O.setAttribute("b-att-trigger",`[b-att-trigger='#${f}']`);let k=document.createElement("div");k.className=s;let D=ot(d.getAttribute("size")||"");return D&&k.setAttribute("data-size",D),Jn(d,k),a&&k.append(a()),O.append(k),c.before(v,O),c.remove(),O}}function vc(t){return t.replace(/<([a-zA-Z][a-zA-Z0-9-]*)((?:"[^"]*"|'[^']*'|[^"'>])*?)\/>/g,(e,o,r)=>gp.has(o.toLowerCase())?e:`<${o}${r}></${o}>`)}function vp(t){t.querySelectorAll("t[t-esc]").forEach(e=>{let r=e.getAttribute("t-esc")?.includes(".length")?"0":"";e.replaceWith(document.createTextNode(`${r}${e.textContent||""}`))})}function xc(t,e){vp(t);let o={fieldgroup:np,field:ip,fieldlabel:ap,fielddescription:s=>mc(s,"p","b-field-description"),fielderror:s=>mc(s,"p","b-field-error"),button:cp,icon:lp,alert:up,alerttitle:Ri("b-alert-title"),alertdescription:Ri("b-alert-description"),alertaction:Ri("b-alert-action"),accordion:pp,accordionitem:dp,accordiontrigger:hp,accordioncontent:mp,dialog:bc({tagPrefix:"dialog",componentName:"dialog",triggerTag:"span",triggerClassName:"b-dialog-trigger",panelClassName:"b-dialog-panel",closeButton:bp}),dialogheader:Nt("div","b-dialog-header"),dialogfooter:Nt("div","b-dialog-footer"),dialogtitle:Nt("h2","b-dialog-title"),dialogdescription:Nt("p","b-dialog-description"),dialogclose:Nt("button","btn b-button btn-outline-secondary b-dialog-close","b-dialog-close"),alertdialog:bc({tagPrefix:"alertdialog",componentName:"alert-dialog",triggerTag:"button",triggerClassName:"btn b-button btn-outline-secondary b-alert-dialog-trigger",panelClassName:"b-dialog-panel b-alert-dialog-panel"}),alertdialogheader:Nt("div","b-dialog-header b-alert-dialog-header"),alertdialogfooter:Nt("div","b-dialog-footer b-alert-dialog-footer"),alertdialogmedia:Nt("div","b-alert-dialog-media"),alertdialogtitle:Nt("h2","b-dialog-title b-alert-dialog-title"),alertdialogdescription:Nt("p","b-dialog-description b-alert-dialog-description"),alertdialogcancel:Nt("button","btn b-button btn-outline-secondary b-alert-dialog-cancel","b-alert-dialog-cancel"),alertdialogaction:Nt("button","btn b-button btn-primary b-alert-dialog-action","b-alert-dialog-action")},r=sp(e);for(let s of[...t.querySelectorAll("*")]){let a=s.localName.toLowerCase();o[a]?o[a](s):e.has(a)&&r(s)}}var fc,gp,Bi=Tn(()=>{fc=0;gp=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"])});function Hp(t,e,o){let r=String(t||"").trim();if(!r)return"";let s=r.replace(/\{([^}]+)\}/g,(a,c)=>{let l=o&&typeof o=="object"?o[c]:null;return l&&l.default!==void 0?String(l.default):`{${c}}`});try{return new URL(s,`${e}/`).href.replace(/\/$/,"")}catch{return s.replace(/\/$/,"")}}function ht(t,e){if(t&&typeof t=="object"&&typeof t.$ref=="string"){let o=t.$ref.replace(/^#\//,"").split("/"),r=e;for(let s of o)r=r?.[decodeURIComponent(s.replace(/~1/g,"/").replace(/~0/g,"~"))];return r?{...r}:{}}return t}function Zi(t,e){if(!Array.isArray(t?.allOf))return t;let o={...t,properties:{...t.properties},required:[...t.required||[]]};delete o.allOf;for(let r of t.allOf){let s=Zi(ht(r,e),e)||{};Object.assign(o.properties,s.properties),o.required.push(...s.required||[]),o.type||(o.type=s.type)}return o}function Wp(t,e){if(!t)return null;let o=ht(t,e);return!o||typeof o!="object"?null:o}function Gi(t){return t&&typeof t.$ref=="string"?t.$ref.split("/").pop():null}function _c(t,e){if(!t||typeof t!="object")return null;for(let[o,r]of Object.entries(t)){let s=Wp(r,e);if(s){if(s.dataValue!==void 0)return{key:o,label:s.summary||o,value:s.dataValue,isAuto:!1};if(s.serializedValue!==void 0)return{key:o,label:s.summary||o,value:s.serializedValue,isAuto:!1};if(s.value!==void 0)return{key:o,label:s.summary||o,value:s.value,isAuto:!1};if(s.externalValue)return{key:o,label:s.summary||o,value:s.externalValue,isAuto:!1}}}return null}function Ji(t){if(t){if(t.example!==void 0)return t.example;if(t.default!==void 0)return t.default;if(Array.isArray(t.enum)&&t.enum.length)return t.enum[0]}}function Wi(t,e){if(!t)return null;let o=_c(t.examples,e);if(o)return o;if(t.example!==void 0)return{label:"media example",value:t.example,isAuto:!1};let r=ht(t.schema,e),s=Ji(r);return s!==void 0?{label:"schema example",value:s,isAuto:!1}:null}function Pc(t,e){let o=_c(t.examples,e);if(o)return o;if(t.example!==void 0)return{label:"example",value:t.example,isAuto:!1};let r=ht(t.schema,e),s=Ji(r);return s!==void 0?{label:"schema example",value:s,isAuto:!1}:null}function fn(t,e,o=new Set){if(!t)return null;let r=Gi(t);if(r){if(o.has(r))return{};o=new Set(o).add(r)}let s=Zi(ht(t,e),e);if(!s)return null;let a=Ji(s);if(a!==void 0)return a;if(s.type==="array"||s.items)return[fn(s.items||{},e,o)];if(s.properties||s.type==="object"){let c={};for(let[l,d]of Object.entries(s.properties||{}))c[l]=fn(d,e,o);return c}switch(s.type){case"integer":return s.minimum??0;case"number":return s.minimum??0;case"boolean":return!0;case"string":return s.format==="date-time"?new Date().toISOString():s.format==="date"?new Date().toISOString().slice(0,10):s.format==="byte"?"base64==":s.title||"string";default:return null}}function Ln(t,e,{depth:o=0,prefix:r="",seen:s=new Set,required:a=!1,selfRow:c=!0}={}){if(!t||o>4)return[];let l=Gi(t);if(l){if(s.has(l))return[];s=new Set(s).add(l)}let d=Zi(ht(t,e),e),f=[],v=d.contentMediaType||d.contentEncoding?[d.contentMediaType,d.contentEncoding&&`encoding:${d.contentEncoding}`].filter(Boolean).join(", "):"",O=d.discriminator?.propertyName?`discriminator: ${d.discriminator.propertyName}`:"";if(Array.isArray(d.prefixItems))return c&&f.push({path:r||"items",type:"tuple",required:a,description:d.description||""}),d.prefixItems.forEach((k,D)=>{f.push(...Ln(k,e,{depth:o+1,prefix:`${r}[${D}]`,seen:s,required:!1}))}),d.items&&f.push(...Ln(d.items,e,{depth:o+1,prefix:`${r}[n]`,seen:s,required:!1})),f;if(d.type==="array"||d.items)return c&&f.push({path:r||"items",type:"array",required:a,description:d.description||""}),f.push(...Ln(d.items||{},e,{depth:o+1,prefix:`${r}[]`,seen:s,required:!1})),f;if(d.properties||d.type==="object"||d.patternProperties){let k=new Set(d.required||[]);for(let[D,X]of Object.entries(d.properties||{})){let I=ht(X,e),K=r?`${r}.${D}`:D;f.push({path:K,type:I.type||(I.$ref?Gi(X):"any")||"any",format:I.format||"",enum:I.enum,required:k.has(D),description:I.description||""}),(I.type==="object"||I.properties||I.type==="array"||I.items)&&f.push(...Ln(X,e,{depth:o+1,prefix:K,seen:s,required:k.has(D),selfRow:!1}))}for(let[D,X]of Object.entries(d.patternProperties||{})){let I=ht(X,e);f.push({path:r?`${r}.<${D}>`:`<${D}>`,type:I.type||"any",format:I.format||"",required:!1,description:I.description||""})}return f}return f.push({path:r||"value",type:d.type||"any",format:d.format||"",enum:d.enum,required:a,description:[d.description,v,O].filter(Boolean).join(" \u2014 ")}),f}function Kp(t){let e=Pc(t,this);return{name:t.name,in:t.in,required:!!t.required,type:t.type||t.schema?.type||"string",format:t.format||t.schema?.format||"",description:t.description||"",default:t.default??t.schema?.default,enum:t.enum||t.schema?.enum,example:e?e.value:void 0,exampleLabel:e?e.label:""}}function Gp(t){if(t.type==="http")return{...t,type:String(t.scheme).toLowerCase()==="basic"?"basic":"bearer"};if(t.type==="openIdConnect")return{...t,type:"bearer",oauth2MetadataUrl:t.openIdConnectUrl};if(t.type!=="oauth2"||!t.flows)return t;let[e,o]=Object.entries(t.flows)[0]||[];return{...t,...o,flow:Vp[e]||e,scopes:o?.scopes||{}}}function qc(t){let e=t.securityDefinitions||t.components?.securitySchemes||{};return Object.fromEntries(Object.entries(e).map(([o,r])=>[o,Gp(ht(r,t))]))}function Zp(t,e){let o=qc(e),r=t.security||e.security||[],s=[];for(let a of r)for(let c of Object.keys(a)){let l=o[c];l&&s.push({key:c,...l})}return s}function Ki(t,e,o,r){let s={path:[],query:[],header:[],formData:[],body:null};for(let f of r.parameters||[]){let v=ht(f,t);if(v.in==="body"){let O={schema:v.schema},k=Wi(O,t);s.body={required:!!v.required,schema:v.schema,description:v.description||"",contentType:"application/json",example:k?k.value:fn(v.schema,t),exampleLabel:k?k.label:"auto",exampleIsAuto:!k}}else s[v.in]&&s[v.in].push(Kp.call(t,v))}if(r.requestBody){let f=ht(r.requestBody,t)||{},[v,O]=Object.entries(f.content||{})[0]||[];if(v&&O){let k=Wi(O,t);s.body={required:!!f.required,schema:O.schema||null,description:f.description||"",contentType:v,encoding:O.encoding||null,itemSchema:O.itemSchema||null,example:k?k.value:fn(O.schema,t),exampleLabel:k?k.label:"auto",exampleIsAuto:!k}}}let a=Object.entries(r.responses||{}).map(([f,v])=>{let O=ht(v,t)||{},[k,D]=Object.entries(O.content||{})[0]||[],X=D?Wi(D,t):null;return{status:f,summary:O.summary||"",description:O.description||"",contentType:k||"application/json",schema:D?.schema||O.schema||null,encoding:D?.encoding||null,headers:Jp(O.headers,t),links:Yp(O.links,t),example:X?X.value:D?.schema?fn(D.schema,t):null,exampleLabel:X?X.label:"auto",exampleIsAuto:!X&&!!D?.schema}}).sort((f,v)=>{let O=Uc(f.status),k=Uc(v.status);return O-k}),c=Qp(r.callbacks,t),l=o.toUpperCase();return{id:(r.operationId||`${o}-${e}`).replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase(),method:l,path:e,tag:r.tags&&r.tags[0]||"default",summary:r.summary||r.operationId||`${l} ${e}`,description:r.description||"",deprecated:!!r.deprecated,produces:r.produces||t.produces||["application/json"],consumes:r.consumes||t.consumes||(s.body?["application/json"]:[]),parameters:s,responses:a,callbacks:c,externalDocs:r.externalDocs||null,security:Zp(r,t)}}function Jp(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([o,r])=>{let s=ht(r,e)||{},a=Pc({...s,in:"header"},e);return{name:o,required:!!s.required,deprecated:!!s.deprecated,type:s.schema?.type||"string",description:s.description||"",example:a?a.value:void 0}})}function Yp(t,e){return!t||typeof t!="object"?[]:Object.entries(t).map(([o,r])=>{let s=ht(r,e)||{};return{name:o,operationId:s.operationId||"",operationRef:s.operationRef||"",description:s.description||"",parameters:s.parameters||{}}})}function Qp(t,e){if(!t||typeof t!="object")return[];let o=[];for(let[r,s]of Object.entries(t)){let a=ht(s,e)||{};for(let[c,l]of Object.entries(a)){let d=ht(l,e)||{};for(let f of Vi)d[f]&&o.push({name:r,expression:c,method:f.toUpperCase(),summary:d[f].summary||"",description:d[f].description||""})}}return o}function Uc(t){if(t==="default")return 999;let e=parseInt(t,10);return Number.isNaN(e)?998:e}async function Dc(t,e=""){let o=await fetch(t);if(!o.ok)throw new Error(`Failed to fetch spec: HTTP ${o.status}`);return Yi(await o.json(),e)}function Yi(t,e=""){if(!t||typeof t!="object"||!t.paths&&!t.webhooks)throw new Error("Not an OpenAPI document (missing paths).");let o=t.schemes&&t.schemes.includes("https")?"https":t.schemes?.[0]||"https",r=t.host||location.host,s=t.basePath||"",a=`${o}://${r}${s}`.replace(/\/$/,""),c=e?[{name:"",url:e.replace(/\/$/,""),description:""}]:Array.isArray(t.servers)&&t.servers.length?t.servers.map(I=>({name:I?.name||"",url:Hp(I?.url,a,I?.variables),description:String(I?.description||"").trim()})).filter(I=>I.url):[{name:"",url:a,description:""}],l=c[0]?.url||a,d=(t.tags||[]).map(I=>I.name),f=new Map((t.tags||[]).map(I=>[I.name,I])),v=[];for(let[I,K]of Object.entries(t.paths||{})){let nt=ht(K,t)||{};for(let L of Vi)nt[L]&&v.push(Ki(t,I,L,nt[L]));for(let[L,_]of Object.entries(nt.additionalOperations||{}))v.push(Ki(t,I,L.toLowerCase(),_))}let O=[];for(let[I,K]of Object.entries(t.webhooks||{})){let nt=ht(K,t)||{};for(let L of Vi)nt[L]&&O.push(Ki(t,I,L,nt[L]))}let k=new Map;for(let I of[...v,...O])k.has(I.id)||k.set(I.id,I);let X=[...new Set([...d,...v.map(I=>I.tag)])].map(I=>{let K=f.get(I);return{id:I.replace(/[^a-zA-Z0-9]+/g,"-").toLowerCase(),name:I,summary:K?.summary||"",description:K?.description||"",parent:K?.parent||"",kind:K?.kind||"",items:v.filter(nt=>nt.tag===I)}}).filter(I=>I.items.length);return{spec:t,info:t.info||{},baseUrl:l,derivedBaseUrl:a,servers:c,securityDefinitions:qc(t),groups:X,webhooks:O,resolveRef:I=>ht(I,t),generateExample:I=>fn(I,t),schemaRows:I=>Ln(I,t),findOperation:I=>k.get(I),firstOperation:()=>v[0]}}var Vi,Vp,jc=Tn(()=>{Vi=["get","post","put","patch","delete","options","head","trace","query"];Vp={authorizationCode:"accessCode",implicit:"implicit",password:"password",clientCredentials:"application"}});function Xp(t){let e=new URL(t.url);return(t.query||[]).forEach(([o,r])=>{o&&e.searchParams.set(o,String(r||""))}),e.toString()}function td(t,e){let o=[];return(t.headers||[]).forEach(([s,a])=>{s&&o.push([s,String(a??"")])}),e&&t.bodyText&&!ed(o,"Content-Type")&&o.push(["Content-Type",t.mimeType||"application/json"]),o}function ed(t,e){let o=e.toLowerCase();return t.some(function(r){return String(r[0]||"").toLowerCase()===o})}function od(t,e){return String(t||"").split(`
13
+ `).map(function(o){return e+o}).join(`
14
+ `)}function wt(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function tt(t){return String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"')}function rd(t){return String(t).replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}function sd(t){return String(t).replace(/`/g,'` + "`" + `')}function nd(t){return String(t).replace(/\\/g,"\\\\").replace(/"""/g,'\\"\\"\\"')}function ri(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\'")}function si(t){return String(t).replace(/\\/g,"\\\\").replace(/'/g,"\\\\'")}function ni(t){return String(t).replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\r/g,"\\r").replace(/\n/g,"\\n")}function ii(t){return String(t).replace(/`/g,"``").replace(/"/g,'`"')}function id(t){return String(t).replace(/\]=\]/g,']==] .. "]=" .. [=[')}function ad(t,e){let o=e&&e.quote==="double"?'"':"'";return t.map(function(s){let a=o==='"'?tt(s[0]):wt(s[0]),c=o==='"'?tt(s[1]):wt(s[1]);return o+a+o+": "+o+c+o}).join(`,
15
+ `)}function cd(t,e,o){let r=["curl --request "+t.method];return o.forEach(function(s){r.push("--header '"+wt(s[0]+": "+s[1])+"'")}),t.bodyText&&r.push("--data '"+wt(t.bodyText)+"'"),r.push("'"+wt(e)+"'"),r.join(` \\
16
+ `)}function Fc(t,e,o){let r=["const url = '"+wt(e)+"';","const options = {"," method: '"+wt(t.method)+"',"];return o.length&&(r.push(" headers: {"),r.push(od(ad(o)," ")),r.push(" },")),t.bodyText&&r.push(" body: `"+rd(t.bodyText)+"`,"),r.push("};","","const response = await fetch(url, options);","const data = await response.text();","console.log(response.status, data);"),r.join(`
17
+ `)}function ld(t,e,o){return Fc(t,e,o)}function ud(t,e,o){let r=["import requests","","url = '"+wt(e)+"'"];return o.length?(r.push("headers = {"),o.forEach(function(s){r.push(" '"+wt(s[0])+"': '"+wt(s[1])+"',")}),r.push("}")):r.push("headers = {}"),t.bodyText?(r.push("",'payload = """'+nd(t.bodyText)+'"""'),r.push("response = requests.request('"+wt(t.method)+"', url, headers=headers, data=payload)")):r.push("","response = requests.request('"+wt(t.method)+"', url, headers=headers)"),r.push("print(response.status_code)","print(response.text)"),r.join(`
18
+ `)}function pd(t,e,o){let r=["package main","","import (",' "fmt"',' "io"',' "net/http"'];return t.bodyText&&r.push(' "strings"'),r.push(")","","func main() {"),t.bodyText?(r.push(" body := strings.NewReader(`"+sd(t.bodyText)+"`)"),r.push(' req, err := http.NewRequest("'+t.method+'", "'+e+'", body)')):r.push(' req, err := http.NewRequest("'+t.method+'", "'+e+'", nil)'),r.push(" if err != nil {"," panic(err)"," }"),o.forEach(function(s){r.push(' req.Header.Set("'+tt(s[0])+'", "'+tt(s[1])+'")')}),r.push(""," res, err := http.DefaultClient.Do(req)"," if err != nil {"," panic(err)"," }"," defer res.Body.Close()",""," data, err := io.ReadAll(res.Body)"," if err != nil {"," panic(err)"," }",""," fmt.Println(res.StatusCode)"," fmt.Println(string(data))","}"),r.join(`
19
+ `)}function dd(t,e,o){let r=["OkHttpClient client = new OkHttpClient();","","Request.Builder builder = new Request.Builder()",' .url("'+tt(e)+'")'];return o.forEach(function(s){r.push(' .addHeader("'+tt(s[0])+'", "'+tt(s[1])+'")')}),t.bodyText?r.push(";","",'MediaType mediaType = MediaType.parse("'+tt(t.mimeType||"application/json")+'");','RequestBody body = RequestBody.create("""'+tt(t.bodyText)+'""", mediaType);','Request request = builder.method("'+t.method+'", body).build();'):r.push(";","",'Request request = builder.method("'+t.method+'", null).build();'),r.push("","try (Response response = client.newCall(request).execute()) {"," System.out.println(response.code());",' System.out.println(response.body() != null ? response.body().string() : "");',"}"),r.join(`
20
+ `)}function hd(t,e,o){let s=["using var client = new HttpClient();","using var request = new HttpRequestMessage(HttpMethod."+(t.method.charAt(0)+t.method.slice(1).toLowerCase())+', "'+tt(e)+'");'];return o.forEach(function(a){s.push('request.Headers.TryAddWithoutValidation("'+tt(a[0])+'", "'+tt(a[1])+'");')}),t.bodyText&&s.push('request.Content = new StringContent("""'+tt(t.bodyText)+'""", Encoding.UTF8, "'+tt(t.mimeType||"application/json")+'");'),s.push("","using var response = await client.SendAsync(request);","var body = await response.Content.ReadAsStringAsync();","Console.WriteLine((int)response.StatusCode);","Console.WriteLine(body);"),s.join(`
21
+ `)}function md(t,e,o){let r=["$ch = curl_init();","curl_setopt_array($ch, ["," CURLOPT_URL => '"+ri(e)+"',"," CURLOPT_CUSTOMREQUEST => '"+ri(t.method)+"',"," CURLOPT_RETURNTRANSFER => true,"];return o.length&&(r.push(" CURLOPT_HTTPHEADER => ["),o.forEach(function(s){r.push(" '"+ri(s[0]+": "+s[1])+"',")}),r.push(" ],")),t.bodyText&&r.push(" CURLOPT_POSTFIELDS => '"+ri(t.bodyText)+"',"),r.push("]);","","$response = curl_exec($ch);","echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE) . PHP_EOL;","echo $response;","curl_close($ch);"),r.join(`
22
+ `)}function fd(t,e,o){let r=t.method.charAt(0)+t.method.slice(1).toLowerCase(),s=['require "uri"','require "net/http"',"","uri = URI('"+si(e)+"')","http = Net::HTTP.new(uri.host, uri.port)",'http.use_ssl = uri.scheme == "https"',"","request = Net::HTTP::"+r+".new(uri)"];return o.forEach(function(a){s.push("request['"+si(a[0])+"'] = '"+si(a[1])+"'")}),t.bodyText&&s.push("request.body = '"+si(t.bodyText)+"'"),s.push("","response = http.request(request)","puts response.code","puts response.body"),s.join(`
23
+ `)}function bd(t,e,o){let r=["#include <curl/curl.h>","","int main(void) {"," CURL *curl = curl_easy_init();"," if (!curl) return 1;",""," struct curl_slist *headers = NULL;"];return o.forEach(function(s){r.push(' headers = curl_slist_append(headers, "'+ni(s[0]+": "+s[1])+'");')}),r.push(' curl_easy_setopt(curl, CURLOPT_URL, "'+ni(e)+'");'),r.push(' curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "'+ni(t.method)+'");'),o.length&&r.push(" curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);"),t.bodyText&&r.push(' curl_easy_setopt(curl, CURLOPT_POSTFIELDS, "'+ni(t.bodyText)+'");'),r.push(""," curl_easy_perform(curl);"," curl_slist_free_all(headers);"," curl_easy_cleanup(curl);"," return 0;","}"),r.join(`
24
+ `)}function gd(t,e,o){let r=['var request = URLRequest(url: URL(string: "'+tt(e)+'")!)','request.httpMethod = "'+tt(t.method)+'"'];return o.forEach(function(s){r.push('request.setValue("'+tt(s[1])+'", forHTTPHeaderField: "'+tt(s[0])+'")')}),t.bodyText&&r.push('request.httpBody = """',t.bodyText,'""".data(using: .utf8)'),r.push("","URLSession.shared.dataTask(with: request) { data, response, error in"," if let error = error {"," print(error)"," return"," }"," let status = (response as? HTTPURLResponse)?.statusCode ?? 0"," print(status)",' print(String(data: data ?? Data(), encoding: .utf8) ?? "")',"}.resume()"),r.join(`
25
+ `)}function vd(t,e,o){let r=['NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"'+tt(e)+'"]];','request.HTTPMethod = @"'+tt(t.method)+'";'];return o.forEach(function(s){r.push('[request setValue:@"'+tt(s[1])+'" forHTTPHeaderField:@"'+tt(s[0])+'"];')}),t.bodyText&&r.push('request.HTTPBody = [@"'+tt(t.bodyText)+'" dataUsingEncoding:NSUTF8StringEncoding];'),r.push("","NSURLSessionDataTask *task = [[NSURLSession sharedSession] dataTaskWithRequest:request"," completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"," if (error) {",' NSLog(@"%@", error);'," return;"," }"," NSInteger status = [(NSHTTPURLResponse *)response statusCode];"," NSString *body = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];",' NSLog(@"%ld", (long)status);',' NSLog(@"%@", body);',"}];","[task resume];"),r.join(`
26
+ `)}function xd(t,e,o){let r=["val client = OkHttpClient()"];return t.bodyText&&r.push('val body = """',t.bodyText,'""".trimIndent().toRequestBody("'+tt(t.mimeType||"application/json")+'".toMediaType())'),r.push("val request = Request.Builder()",' .url("'+tt(e)+'")'),o.forEach(function(s){r.push(' .addHeader("'+tt(s[0])+'", "'+tt(s[1])+'")')}),r.push(t.bodyText?' .method("'+t.method+'", body)':' .method("'+t.method+'", null)'," .build()","","client.newCall(request).execute().use { response ->"," println(response.code)"," println(response.body?.string().orEmpty())","}"),r.join(`
27
+ `)}function yd(t,e,o){let r=["let client = reqwest::Client::new();","let response = client"," ."+t.method.toLowerCase()+'("'+tt(e)+'")'];return o.forEach(function(s){r.push(' .header("'+tt(s[0])+'", "'+tt(s[1])+'")')}),t.bodyText&&r.push(' .body(r#"'+t.bodyText.replace(/"#/g,'"#""#')+'"#)'),r.push(" .send()"," .await?;","",'println!("{}", response.status());','println!("{}", response.text().await?);'),r.join(`
28
+ `)}function wd(t,e,o){let r=["$headers = @{"];return o.forEach(function(s){r.push(' "'+ii(s[0])+'" = "'+ii(s[1])+'"')}),r.push("}",""),t.bodyText&&r.push('$body = @"',t.bodyText,'"@',""),r.push("$response = Invoke-RestMethod -Method "+t.method+' -Uri "'+ii(e)+'" -Headers $headers'+(t.bodyText?' -Body $body -ContentType "'+ii(t.mimeType||"application/json")+'"':""),"$response | ConvertTo-Json -Depth 10"),r.join(`
29
+ `)}function Sd(t,e,o){let r=["import 'package:http/http.dart' as http;","","final uri = Uri.parse('"+wt(e)+"');","final headers = <String, String>{"];return o.forEach(function(s){r.push(" '"+wt(s[0])+"': '"+wt(s[1])+"',")}),r.push("};",""),t.bodyText?r.push("final response = await http."+t.method.toLowerCase()+"(uri, headers: headers, body: '''"+t.bodyText.replace(/'''/g,"'' '")+"''');"):r.push("final response = await http."+t.method.toLowerCase()+"(uri, headers: headers);"),r.push("print('Status: ${response.statusCode}');","print(response.body);"),r.join(`
30
+ `)}function Ad(t,e,o){let r=['local http = require("socket.http")','local ltn12 = require("ltn12")',"","local response_body = {}","local headers = {"];return o.forEach(function(s){r.push(' ["'+tt(s[0])+'"] = "'+tt(s[1])+'",')}),r.push("}",""),t.bodyText&&(r.push("local body = [==["+id(t.bodyText)+"]==]",""),r.push('headers["Content-Length"] = tostring(#body)')),r.push("local _, code = http.request{",' url = "'+tt(e)+'",',' method = "'+tt(t.method)+'",'," headers = headers,"),t.bodyText&&r.push(" source = ltn12.source.string(body),"),r.push(" sink = ltn12.sink.table(response_body),","}","",'print("Status: " .. tostring(code))',"print(table.concat(response_body))"),r.join(`
31
+ `)}async function zc(t,e){let o=Qi.find(function(a){return a.id===t});if(!o)throw new Error("Unknown language: "+t);let r=td(e,!0),s=Xp(e);return Ed[o.id](e,s,r)}var Qi,Ed,Hc=Tn(()=>{Qi=[{id:"curl",label:"CURL",icon:"img/bash-plain.svg"},{id:"csharp",label:"CSHARP",icon:"img/csharp-original.svg"},{id:"go",label:"GO",icon:"img/go-original-wordmark.svg"},{id:"node",label:"NODEJS",icon:"img/nodejs-original.svg"},{id:"ruby",label:"RUBY",icon:"img/ruby-plain.svg"},{id:"php",label:"PHP",icon:"img/php-original.svg"},{id:"javascript",label:"JAVASCRIPT",icon:"img/javascript-original.svg"},{id:"python",label:"PYTHON",icon:"img/python-original.svg"},{id:"java",label:"JAVA",icon:"img/java-original.svg"},{id:"c",label:"C",icon:"img/c-original.svg"},{id:"swift",label:"SWIFT",icon:"img/swift-original.svg"},{id:"objc",label:"OBJECTIVE-C",icon:"img/objectivec-plain.svg"},{id:"kotlin",label:"KOTLIN",icon:"img/kotlin-original.svg"},{id:"rust",label:"RUST",icon:"img/rust-original.svg"},{id:"powershell",label:"POWERSHELL",icon:"img/windows8-original.svg"},{id:"dart",label:"DART",icon:"img/dart-original.svg"},{id:"lua",label:"LUA",icon:"img/lua.svg"}];Ed={curl:cd,javascript:Fc,node:ld,python:ud,go:pd,java:dd,csharp:hd,php:md,ruby:fd,c:bd,swift:gd,objc:vd,kotlin:xd,rust:yd,powershell:wd,dart:Sd,lua:Ad}});var Wc={};On(Wc,{LANGUAGES:()=>Qi,buildOpenApiDoc:()=>Yi,generateSnippet:()=>zc,loadOpenApiDoc:()=>Dc});var Kc=Tn(()=>{jc();Hc()});var Fm={};On(Fm,{Accordion:()=>Pr,AccordionContent:()=>Dr,AccordionItem:()=>qr,AccordionTrigger:()=>eo,Alert:()=>$t,AlertAction:()=>Po,AlertDescription:()=>Yt,AlertDialog:()=>nr,AlertDialogAction:()=>Ve,AlertDialogCancel:()=>Ke,AlertDialogContent:()=>ir,AlertDialogDescription:()=>pr,AlertDialogFooter:()=>cr,AlertDialogHeader:()=>ar,AlertDialogMedia:()=>lr,AlertDialogTitle:()=>ur,AlertDialogTrigger:()=>We,AlertTitle:()=>_o,ApiDoc:()=>Vt,ApiDocGroup:()=>Gt,App:()=>da,AspectRatio:()=>Bs,Attachment:()=>xs,AttachmentAction:()=>yo,AttachmentActions:()=>Es,AttachmentContent:()=>ws,AttachmentDescription:()=>As,AttachmentDropzone:()=>Ls,AttachmentGroup:()=>Cs,AttachmentMedia:()=>ys,AttachmentTitle:()=>Ss,AttachmentTrigger:()=>wo,Avatar:()=>ks,Badge:()=>Et,BlockViewer:()=>No,Breadcrumb:()=>Ee,BreadcrumbEllipsis:()=>ro,BreadcrumbItem:()=>Le,BreadcrumbLink:()=>ke,BreadcrumbList:()=>Ce,BreadcrumbPage:()=>Ne,BreadcrumbSeparator:()=>jt,Bubble:()=>$s,Button:()=>U,ButtonGroup:()=>_s,ButtonGroupSeparator:()=>Ps,ButtonGroupText:()=>qs,Calendar:()=>go,Card:()=>te,CardBody:()=>oe,CardDescription:()=>se,CardFooter:()=>jo,CardHeader:()=>ee,CardTitle:()=>re,Carousel:()=>fs,CarouselNext:()=>xo,CarouselPrevious:()=>vo,CarouselSlide:()=>bs,Chart:()=>ms,Checkbox:()=>ve,ClipboardButton:()=>Bt,CodeEditor:()=>je,Collapsible:()=>jr,CollapsibleContent:()=>Fr,CollapsibleTrigger:()=>oo,Combobox:()=>ds,Command:()=>hs,Component:()=>u,ContextMenu:()=>$r,ContextMenuContent:()=>Ur,ContextMenuItem:()=>_r,ContextMenuTrigger:()=>Mr,DataTable:()=>bo,DatePicker:()=>ps,Dialog:()=>ue,DialogClose:()=>Fe,DialogContent:()=>_t,DialogDescription:()=>me,DialogFooter:()=>de,DialogHeader:()=>pe,DialogTitle:()=>he,DialogTrigger:()=>Fo,Direction:()=>Ms,DocViewer:()=>ko,Drawer:()=>dr,DrawerClose:()=>Ze,DrawerContent:()=>hr,DrawerDescription:()=>gr,DrawerFooter:()=>fr,DrawerHeader:()=>mr,DrawerTitle:()=>br,DrawerTrigger:()=>Ge,DropdownMenu:()=>xe,DropdownMenuCheckboxItem:()=>Xe,DropdownMenuContent:()=>ye,DropdownMenuGroup:()=>Tr,DropdownMenuItem:()=>we,DropdownMenuLabel:()=>Or,DropdownMenuRadioGroup:()=>Ir,DropdownMenuRadioItem:()=>to,DropdownMenuSeparator:()=>Rr,DropdownMenuShortcut:()=>Br,DropdownMenuSub:()=>Se,DropdownMenuSubContent:()=>Ae,DropdownMenuSubTrigger:()=>qt,DropdownMenuTrigger:()=>Pt,Empty:()=>zo,EmptyContent:()=>Go,EmptyDescription:()=>Vo,EmptyHeader:()=>Ho,EmptyMedia:()=>Wo,EmptyTitle:()=>Ko,EventBus:()=>ma,Field:()=>$e,FieldContent:()=>Fs,FieldDescription:()=>Ue,FieldError:()=>_e,FieldGroup:()=>Be,FieldLabel:()=>Me,FieldLegend:()=>js,FieldSeparator:()=>Hs,FieldSet:()=>Ds,FieldTitle:()=>zs,Form:()=>Io,HoverCard:()=>Lr,HoverCardContent:()=>Nr,HoverCardTrigger:()=>kr,Icon:()=>Y,Input:()=>ne,InputOtp:()=>er,Item:()=>Us,Kbd:()=>Qt,Label:()=>Ws,Markdown:()=>Ot,MarkdownTree:()=>Kt,MarkdownTreeNode:()=>mn,Marker:()=>Yo,Menubar:()=>Vr,Message:()=>Ns,MessageScroller:()=>Ts,NativeSelect:()=>ge,NavigationMenu:()=>Wr,NavigationMenuItem:()=>Kr,NodexUI:()=>m,NodexUIComponents:()=>ui,NodexUITheme:()=>Ii,OwlError:()=>fa,Pagination:()=>zr,PaginationItem:()=>Hr,Popover:()=>Er,PopoverContent:()=>Cr,PopoverTrigger:()=>Qe,Progress:()=>Rs,Pwa:()=>Zs,PwaBody:()=>tn,PwaClose:()=>Oo,PwaContent:()=>Js,PwaDescription:()=>Xs,PwaFooter:()=>on,PwaHeader:()=>Ys,PwaSteps:()=>en,PwaTitle:()=>Qs,PwaTrigger:()=>To,QRCard:()=>Eo,Questionnaire:()=>Os,QuestionnaireNext:()=>Ao,QuestionnairePrevious:()=>So,QuestionnaireStep:()=>Is,RadioGroup:()=>Qo,RadioGroupItem:()=>Xo,Resizable:()=>gs,ScrollArea:()=>vs,Select:()=>or,SelectContent:()=>rr,SelectItem:()=>sr,SelectTrigger:()=>He,Separator:()=>Zo,Sheet:()=>vr,SheetClose:()=>Ye,SheetContent:()=>xr,SheetDescription:()=>Ar,SheetFooter:()=>wr,SheetHeader:()=>yr,SheetTitle:()=>Sr,SheetTrigger:()=>Je,Shell:()=>po,ShellContent:()=>mo,ShellHeader:()=>as,ShellMain:()=>is,ShellNav:()=>ns,ShellSidebar:()=>ho,ShellSidebarHeader:()=>ss,ShellUserMenu:()=>fo,Sidebar:()=>zt,SidebarClose:()=>io,SidebarContent:()=>Te,SidebarFooter:()=>Zr,SidebarGroup:()=>Oe,SidebarGroupAction:()=>ao,SidebarGroupCollapsible:()=>co,SidebarGroupContent:()=>Xr,SidebarGroupLabel:()=>Ie,SidebarHeader:()=>Gr,SidebarInput:()=>Yr,SidebarInset:()=>Jr,SidebarMenu:()=>Ht,SidebarMenuAction:()=>lo,SidebarMenuBadge:()=>es,SidebarMenuButton:()=>Ft,SidebarMenuItem:()=>Re,SidebarMenuSkeleton:()=>os,SidebarMenuSub:()=>ts,SidebarMenuSubButton:()=>uo,SidebarMenuSubItem:()=>rs,SidebarProvider:()=>pn,SidebarRail:()=>no,SidebarSeparator:()=>Qr,SidebarTrigger:()=>so,Skeleton:()=>fe,Slider:()=>tr,Spinner:()=>Xt,Switch:()=>ze,TabContent:()=>le,TabTrigger:()=>Ut,Table:()=>cs,Tabs:()=>ie,TabsContainer:()=>ae,TabsList:()=>ce,TextEditor:()=>rn,Textarea:()=>be,ThemeButton:()=>Wt,Toast:()=>Dt,Toggle:()=>Co,ToggleGroup:()=>Ks,ToggleGroupItem:()=>Lo,Tooltip:()=>It,Typography:()=>Jo,__info__:()=>ba,batched:()=>ga,blockDom:()=>va,cn:()=>g,createNamedIcon:()=>Uo,createThemeController:()=>Pe,default:()=>vl,findMarkdownTreeNode:()=>Vs,htmlEscape:()=>xa,iconComponentName:()=>Oi,loadFile:()=>qe,loadTemplate:()=>Vl,markRaw:()=>ya,markup:()=>Rn,mergeStyle:()=>mt,mount:()=>Mo,normalizeTheme:()=>Kn,onError:()=>wa,onMounted:()=>V,onPatched:()=>it,onRendered:()=>Sa,onWillDestroy:()=>De,onWillPatch:()=>Aa,onWillRender:()=>Bn,onWillStart:()=>St,onWillUnmount:()=>Q,onWillUpdateProps:()=>at,rawMount:()=>Ul,rawXml:()=>_l,reactive:()=>Ea,registerGlobalComponents:()=>yi,status:()=>Ca,toRaw:()=>La,useChildSubEnv:()=>H,useComponent:()=>ka,useEffect:()=>At,useEnv:()=>Na,useExternalListener:()=>$o,useRef:()=>P,useState:()=>$,useSubEnv:()=>Ta,validate:()=>Oa,validateType:()=>Ia,whenReady:()=>Ra,xml:()=>wi});var Tl="__NODEXUI_VERSION__",bi=new Map,vn=new WeakMap,In="[b-ui], [b-icon]",Ol="[data-bs-toggle], [data-bs-target], [data-bs-dismiss]";function Il(t){return typeof t=="string"?document.querySelector(t):t instanceof Element?t:null}function gi(t,e,o={}){t.dispatchEvent(new CustomEvent(e,{bubbles:!0,detail:o}))}function Rl(t,e={}){return t.hasAttribute("b-icon")?"icon":e.name||t.getAttribute("b-ui")}function Bl(t,e){return e===document||e===t||e.contains(t)}function $l(t,e={}){return!e.allowBootstrapControl&&t.matches(Ol)}var vi=typeof window<"u"?window.thebase:void 0,m=vi?.register?vi:Object.assign(vi||{},{version:Tl,register(t,e){if(!t||!e)throw new Error("NodexUI.register requires a name and component definition.");return bi.set(t,e),this},component(t){return bi.get(t)},mount(t,e={}){let o=Il(t);if(!o||$l(o,e))return null;let r=Rl(o,e),s=bi.get(r);if(!s)return null;let a=vn.get(o);if(a?.name===r)return a;a&&(a.destroy?.(),vn.delete(o),gi(o,"nodexui:destroyed",{name:a.name}));let c=s.mount?.(o,this,e)||{},l={name:r,element:o,destroy:c.destroy};return vn.set(o,l),gi(o,"nodexui:mounted",{name:r,instance:l}),l},mountAll(t=document){let e=t||document,o=[...e.querySelectorAll?.(In)||[]];return e instanceof Element&&e.matches(In)&&o.unshift(e),o.map(r=>this.mount(r)).filter(Boolean)},destroy(t=document){let e=t||document,o=[...e.querySelectorAll?.(In)||[]];e instanceof Element&&e.matches(In)&&o.unshift(e);for(let r of o){let s=vn.get(r);s&&Bl(r,e)&&(s.destroy?.(),vn.delete(r),gi(r,"nodexui:destroyed",{name:s.name}))}},theme:{set(t){let e=document.documentElement;if(typeof t=="string"){e.setAttribute("b-theme",t),e.dataset.bsTheme=t;return}for(let[o,r]of Object.entries(t||{})){let s=o==="radius"||o==="--b-radius"?"--base-radius":o.startsWith("--")?o:`--b-${o}`;e.style.setProperty(s,r)}}}});typeof window<"u"&&(window.thebase=m,window.NodexUI=m);function la(t){return m.version=t,m}function ca(){if(typeof MutationObserver>"u")return;let t=new MutationObserver(e=>{for(let o of e)for(let r of o.addedNodes)r instanceof Element&&m.mountAll(r)});return t.observe(document.documentElement,{childList:!0,subtree:!0}),t}function ua(){typeof document>"u"||(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>{m.mountAll(),ca()},{once:!0}):(m.mountAll(),ca()))}function g(...t){let e=[];for(let o of t)if(o){if(typeof o=="string")e.push(o);else if(Array.isArray(o)){let r=g(...o);r&&e.push(r)}else if(typeof o=="object")for(let[r,s]of Object.entries(o))s&&e.push(r)}return e.join(" ")}function i(t){return{type:t,optional:!0}}var p={className:i(String),style:i([String,Object]),slots:i(Object)};function et(t,e,o){return t[e]??(o?t[o]:void 0)}function dt(t){return t===!0||t==="open"||t==="on"||t==="active"}function mt(...t){let e=[];for(let o of t)if(o){if(typeof o=="string"){let r=o.trim().replace(/;$/,"");r&&e.push(r)}else if(typeof o=="object")for(let[r,s]of Object.entries(o)){if(s==null||s==="")continue;let a=r.replace(/[A-Z]/g,c=>"-"+c.toLowerCase());e.push(`${a}:${s}`)}}return e.join(";")}function lt(t){return t.state!==void 0?dt(t.state):t.open!==void 0?t.open:t["default-open"]!==void 0?t["default-open"]:t.defaultOpen??!1}function Bo(t){return t.state!==void 0||t.open!==void 0}var pa="1.0.1";var Z=globalThis.owl;if(!Z)throw new Error("NodexUI: load dist/nodexui.min.js or dist/nodexui.esm.js before this script (globalThis.owl is not set).");var da=Z.App,ha=Z.Component,ma=Z.EventBus,fa=Z.OwlError,ba=Z.__info__,ga=Z.batched,va=Z.blockDom,xa=Z.htmlEscape,qe=Z.loadFile,ya=Z.markRaw,Rn=Z.markup,xi=Z.mount,wa=Z.onError,V=Z.onMounted,it=Z.onPatched,Sa=Z.onRendered,De=Z.onWillDestroy,Aa=Z.onWillPatch,Bn=Z.onWillRender,St=Z.onWillStart,Q=Z.onWillUnmount,at=Z.onWillUpdateProps,Ea=Z.reactive,Ca=Z.status,La=Z.toRaw,H=Z.useChildSubEnv,ka=Z.useComponent,At=Z.useEffect,Na=Z.useEnv,$o=Z.useExternalListener,P=Z.useRef,$=Z.useState,Ta=Z.useSubEnv,Oa=Z.validate,Ia=Z.validateType,Ra=Z.whenReady,$n=Z.xml;var Ul=xi,_l=$n,xn={};function yi(t){Object.assign(xn,t)}function Pl(t){let e=t.components;e?e!==xn&&Object.getPrototypeOf(e)===Object.prototype&&Object.setPrototypeOf(e,xn):t.components=Object.create(xn)}var u=class extends ha{constructor(...e){super(...e),Pl(this.constructor)}};function Ba(t){return typeof t!="string"||!/\st-(att|attf|model)([.\s=-]|$)/.test(t)?t:t.replace(/<([A-Z][\w.:-]*)(\s[^<>]*?)?(\/?)>/g,(e,o,r="",s="")=>`<${o}${ql(o,r)}${s}>`)}function ql(t,e){let o=/\st-(att|attf|model|on)([.\s=-]|$)/.test(e),r=e.replace(/(\s)t-att\s*=/g,"$1t-props=").replace(/(\s)t-att-([A-Za-z_][\w:.-]*)\s*=/g,"$1$2=").replace(/(\s)t-attf-([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(s,a,c,l,d)=>`${a}${c}=${l}${zl(d)}${l}`);return r=r.replace(/(\s)t-model((?:\.[\w-]+)*)\s*=\s*(["'])(.*?)\3/g,(s,a,c,l,d)=>Hl(t,a,c,l,d,r)),o?Dl(r):r}function Dl(t){return t.replace(/(\s)([A-Za-z_][\w:.-]*)\s*=\s*(["'])(.*?)\3/g,(e,o,r,s,a)=>r.startsWith("t-")||r==="t-props"||Fl(a)?e:`${o}${r}=${s}${jl(a)}${s}`)}function jl(t){return`'${t.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}function Fl(t){let e=t.trim();return!e||/^(['"`[{(]|-?\d+(?:\.\d+)?$)/.test(e)||/[?.()[\]+*/]|=>|===|!==|&&|\|\|/.test(e)||/^(true|false|null|undefined)$/.test(e)}function zl(t){return`\`${t.replace(/`/g,"\\`").replace(/{{\s*([\s\S]*?)\s*}}|#\{\s*([\s\S]*?)\s*\}/g,(e,o,r)=>`\${${o||r}}`)}\``}function Hl(t,e,o,r,s,a){let c=/^(Checkbox|Switch)$/.test(t),l=Wl(t,o),d=c?"checked":"value",f=new RegExp(`\\s${d}\\s*=`).test(a)?"":`${e}${d}=${r}${s}${r}`,v=new RegExp(`\\s${l}\\s*=`).test(a)?"":`${e}${l}=${r}${Kl(s,o,c)}${r}`;return`${f}${v}`}function Wl(t,e){return e.includes(".lazy")?"onChange":/^(Input|Textarea)$/.test(t)?"onInput":"onChange"}function Kl(t,e,o){if(o)return`(value) => { ${t} = value; }`;let r="value";return e.includes(".trim")&&(r=`(typeof ${r} === 'string' ? ${r}.trim() : ${r})`),e.includes(".number")&&(r=`Number.isNaN(Number(${r})) ? ${r} : Number(${r})`),`(value) => { ${t} = ${r}; }`}function wi(t,...e){return Array.isArray(t?.raw)?$n({raw:t.raw.map(Ba)},...e):$n(t,...e)}function Mo(t,e,o={}){let r=Ba(o.templates);return t.components={...xn,...t.components||{}},xi(t,e,r===o.templates?o:{...o,templates:r})}async function Vl(t){let e=await(await fetch(t,{cache:"reload"})).text(),r=new DOMParser().parseFromString(e,"application/xml").querySelector("templates > t[t-name]");return r?r.innerHTML:e}var ui={};On(ui,{Accordion:()=>Pr,AccordionContent:()=>Dr,AccordionItem:()=>qr,AccordionTrigger:()=>eo,Alert:()=>$t,AlertAction:()=>Po,AlertDescription:()=>Yt,AlertDialog:()=>nr,AlertDialogAction:()=>Ve,AlertDialogCancel:()=>Ke,AlertDialogContent:()=>ir,AlertDialogDescription:()=>pr,AlertDialogFooter:()=>cr,AlertDialogHeader:()=>ar,AlertDialogMedia:()=>lr,AlertDialogTitle:()=>ur,AlertDialogTrigger:()=>We,AlertTitle:()=>_o,ApiDoc:()=>Vt,ApiDocGroup:()=>Gt,AspectRatio:()=>Bs,Attachment:()=>xs,AttachmentAction:()=>yo,AttachmentActions:()=>Es,AttachmentContent:()=>ws,AttachmentDescription:()=>As,AttachmentDropzone:()=>Ls,AttachmentGroup:()=>Cs,AttachmentMedia:()=>ys,AttachmentTitle:()=>Ss,AttachmentTrigger:()=>wo,Avatar:()=>ks,Badge:()=>Et,BlockViewer:()=>No,Breadcrumb:()=>Ee,BreadcrumbEllipsis:()=>ro,BreadcrumbItem:()=>Le,BreadcrumbLink:()=>ke,BreadcrumbList:()=>Ce,BreadcrumbPage:()=>Ne,BreadcrumbSeparator:()=>jt,Bubble:()=>$s,Button:()=>U,ButtonGroup:()=>_s,ButtonGroupSeparator:()=>Ps,ButtonGroupText:()=>qs,Calendar:()=>go,Card:()=>te,CardBody:()=>oe,CardDescription:()=>se,CardFooter:()=>jo,CardHeader:()=>ee,CardTitle:()=>re,Carousel:()=>fs,CarouselNext:()=>xo,CarouselPrevious:()=>vo,CarouselSlide:()=>bs,Chart:()=>ms,Checkbox:()=>ve,ClipboardButton:()=>Bt,CodeEditor:()=>je,Collapsible:()=>jr,CollapsibleContent:()=>Fr,CollapsibleTrigger:()=>oo,Combobox:()=>ds,Command:()=>hs,ContextMenu:()=>$r,ContextMenuContent:()=>Ur,ContextMenuItem:()=>_r,ContextMenuTrigger:()=>Mr,DataTable:()=>bo,DatePicker:()=>ps,Dialog:()=>ue,DialogClose:()=>Fe,DialogContent:()=>_t,DialogDescription:()=>me,DialogFooter:()=>de,DialogHeader:()=>pe,DialogTitle:()=>he,DialogTrigger:()=>Fo,Direction:()=>Ms,DocViewer:()=>ko,Drawer:()=>dr,DrawerClose:()=>Ze,DrawerContent:()=>hr,DrawerDescription:()=>gr,DrawerFooter:()=>fr,DrawerHeader:()=>mr,DrawerTitle:()=>br,DrawerTrigger:()=>Ge,DropdownMenu:()=>xe,DropdownMenuCheckboxItem:()=>Xe,DropdownMenuContent:()=>ye,DropdownMenuGroup:()=>Tr,DropdownMenuItem:()=>we,DropdownMenuLabel:()=>Or,DropdownMenuRadioGroup:()=>Ir,DropdownMenuRadioItem:()=>to,DropdownMenuSeparator:()=>Rr,DropdownMenuShortcut:()=>Br,DropdownMenuSub:()=>Se,DropdownMenuSubContent:()=>Ae,DropdownMenuSubTrigger:()=>qt,DropdownMenuTrigger:()=>Pt,Empty:()=>zo,EmptyContent:()=>Go,EmptyDescription:()=>Vo,EmptyHeader:()=>Ho,EmptyMedia:()=>Wo,EmptyTitle:()=>Ko,Field:()=>$e,FieldContent:()=>Fs,FieldDescription:()=>Ue,FieldError:()=>_e,FieldGroup:()=>Be,FieldLabel:()=>Me,FieldLegend:()=>js,FieldSeparator:()=>Hs,FieldSet:()=>Ds,FieldTitle:()=>zs,Form:()=>Io,HoverCard:()=>Lr,HoverCardContent:()=>Nr,HoverCardTrigger:()=>kr,Icon:()=>Y,Input:()=>ne,InputOtp:()=>er,Item:()=>Us,Kbd:()=>Qt,Label:()=>Ws,Markdown:()=>Ot,MarkdownTree:()=>Kt,MarkdownTreeNode:()=>mn,Marker:()=>Yo,Menubar:()=>Vr,Message:()=>Ns,MessageScroller:()=>Ts,NativeSelect:()=>ge,NavigationMenu:()=>Wr,NavigationMenuItem:()=>Kr,Pagination:()=>zr,PaginationItem:()=>Hr,Popover:()=>Er,PopoverContent:()=>Cr,PopoverTrigger:()=>Qe,Progress:()=>Rs,Pwa:()=>Zs,PwaBody:()=>tn,PwaClose:()=>Oo,PwaContent:()=>Js,PwaDescription:()=>Xs,PwaFooter:()=>on,PwaHeader:()=>Ys,PwaSteps:()=>en,PwaTitle:()=>Qs,PwaTrigger:()=>To,QRCard:()=>Eo,Questionnaire:()=>Os,QuestionnaireNext:()=>Ao,QuestionnairePrevious:()=>So,QuestionnaireStep:()=>Is,RadioGroup:()=>Qo,RadioGroupItem:()=>Xo,Resizable:()=>gs,ScrollArea:()=>vs,Select:()=>or,SelectContent:()=>rr,SelectItem:()=>sr,SelectTrigger:()=>He,Separator:()=>Zo,Sheet:()=>vr,SheetClose:()=>Ye,SheetContent:()=>xr,SheetDescription:()=>Ar,SheetFooter:()=>wr,SheetHeader:()=>yr,SheetTitle:()=>Sr,SheetTrigger:()=>Je,Shell:()=>po,ShellContent:()=>mo,ShellHeader:()=>as,ShellMain:()=>is,ShellNav:()=>ns,ShellSidebar:()=>ho,ShellSidebarHeader:()=>ss,ShellUserMenu:()=>fo,Sidebar:()=>zt,SidebarClose:()=>io,SidebarContent:()=>Te,SidebarFooter:()=>Zr,SidebarGroup:()=>Oe,SidebarGroupAction:()=>ao,SidebarGroupCollapsible:()=>co,SidebarGroupContent:()=>Xr,SidebarGroupLabel:()=>Ie,SidebarHeader:()=>Gr,SidebarInput:()=>Yr,SidebarInset:()=>Jr,SidebarMenu:()=>Ht,SidebarMenuAction:()=>lo,SidebarMenuBadge:()=>es,SidebarMenuButton:()=>Ft,SidebarMenuItem:()=>Re,SidebarMenuSkeleton:()=>os,SidebarMenuSub:()=>ts,SidebarMenuSubButton:()=>uo,SidebarMenuSubItem:()=>rs,SidebarProvider:()=>pn,SidebarRail:()=>no,SidebarSeparator:()=>Qr,SidebarTrigger:()=>so,Skeleton:()=>fe,Slider:()=>tr,Spinner:()=>Xt,Switch:()=>ze,TabContent:()=>le,TabTrigger:()=>Ut,Table:()=>cs,Tabs:()=>ie,TabsContainer:()=>ae,TabsList:()=>ce,TextEditor:()=>rn,Textarea:()=>be,ThemeButton:()=>Wt,Toast:()=>Dt,Toggle:()=>Co,ToggleGroup:()=>Ks,ToggleGroupItem:()=>Lo,Tooltip:()=>It,Typography:()=>Jo,createNamedIcon:()=>Uo,findMarkdownTreeNode:()=>Vs,iconComponentName:()=>Oi});var $a="1.31.0",Gl=`https://cdn.jsdelivr.net/npm/lucide-static@${$a}/icons`,Un="file",Zl=/^[a-z0-9][a-z0-9-]*$/,Si=new Map;function Jl(t){return typeof Image>"u"?Promise.resolve(!0):(Si.has(t)||Si.set(t,new Promise(e=>{let o=new Image;o.onload=()=>e(!0),o.onerror=()=>e(!1),o.src=t})),Si.get(t))}function Mn(t){return String(t||"").trim().replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase()}function yn(t,e={}){let o=Mn(t);if(!Zl.test(o))throw new Error(`NodexUI icon name is invalid: ${t}`);return`${String(e.baseUrl||m.icons.lucide.cdnBaseUrl).replace(/\/+$/,"")}/${o}.svg`}function ut(t,e,o={}){let r=o.url||yn(e,o),s=o.label??t.getAttribute("aria-label")??"";t.classList.add("b-icon"),t.style.setProperty("--b-icon-url",`url("${r.replace(/"/g,"%22")}")`),(o.size||t.getAttribute("b-att-size"))&&t.style.setProperty("--b-icon-size",o.size||t.getAttribute("b-att-size")),s?(t.setAttribute("role","img"),t.setAttribute("aria-label",s)):t.setAttribute("aria-hidden","true");let a=o.fallback===!1?null:o.fallback||Un;return a&&!o.url&&Mn(e)!==Mn(a)&&Jl(r).then(c=>{if(c||!t.isConnected)return;let l=yn(a,o);t.style.setProperty("--b-icon-url",`url("${l.replace(/"/g,"%22")}")`)}),t}m.icons={...m.icons||{},lucide:{version:$a,cdnBaseUrl:Gl,normalizeName:Mn,url:yn,render:ut}};var Y=class extends u{setup(){this.state=$({failed:!1}),At(e=>{if(this.state.failed=!1,typeof Image>"u"||!e||e===Un)return;let o=new Image;return o.onerror=()=>{this.state.failed=!0},o.src=this.buildUrl(e),()=>{o.onload=null,o.onerror=null}},()=>[this.name])}buildUrl(e){return yn(e,{baseUrl:et(this.props,"base-url","baseUrl")})}get name(){return et(this.props,"icon","name")}get url(){return this.buildUrl(this.state.failed?Un:this.name)}get style(){let e=[`--b-icon-url:url("${this.url.replace(/"/g,"%22")}")`];return this.props.size&&e.push(`--b-icon-size:${this.props.size}`),mt(e.join(";"),this.props.style)}get classNames(){return g("b-icon",this.props.className)}};n(Y,"template","nodexui.Icon"),n(Y,"props",{icon:i(String),name:i(String),label:i(String),title:i(String),size:i(String),"base-url":i(String),baseUrl:i(String),className:i(String),style:i([String,Object])});function Uo(t){return class extends Y{get name(){return et(this.props,"icon","name")||t}}}var ft={default:"btn-primary",secondary:"btn-secondary",destructive:"btn-danger",outline:"btn-outline-secondary",ghost:"btn-light",link:"btn-link"},gt={xs:"btn-xs",sm:"btn-sm",lg:"btn-lg",icon:"btn-icon","icon-xs":"btn-icon-xs","icon-sm":"btn-icon-sm","icon-lg":"btn-icon-lg"};var U=class extends u{setup(){this.rootRef=P("root"),this.props.getRef&&(V(()=>this.props.getRef(this.rootRef.el)),Q(()=>this.props.getRef(null)))}get classNames(){return this.props.unstyled?g(this.props.className):g("btn","b-button",ft[this.props.variant]||ft.default,gt[this.props.size],this.isIconOnly&&"b-button-icon",this.props.className)}get iconPosition(){return et(this.props,"icon-position","iconPosition")==="end"?"end":"start"}get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}get ariaPressed(){return et(this.props,"aria-pressed","ariaPressed")}get ariaInvalid(){let e=et(this.props,"aria-invalid","ariaInvalid");return e===!0?"true":e}get isIconOnly(){return!!(this.props.icon&&!this.props.label&&!this.props.slots?.default)}onClick(e){if(this.props.href&&this.props.disabled){e.preventDefault();return}this.props.onClick?.(e)}};n(U,"template","nodexui.Button"),n(U,"components",{Icon:Y}),n(U,"props",{variant:i(String),size:i(String),type:i(String),href:i(String),disabled:i(Boolean),label:i(String),icon:i(String),"icon-position":i(String),iconPosition:i(String),unstyled:i(Boolean),attrs:i(Object),getRef:i(Function),...p,id:i(String),title:i(String),"aria-label":i(String),ariaLabel:i(String),"aria-pressed":i(String),ariaPressed:i(String),"aria-invalid":i([String,Boolean]),ariaInvalid:i([String,Boolean]),onClick:i(Function)});var Ai=["btn","b-button","b-clipboard-button",...Object.values(ft),...Object.values(gt)];function _n({variant:t="default",size:e,className:o}={}){return g("btn","b-button","b-clipboard-button",ft[t]||ft.default,gt[e],o)}async function an(t){let e=String(t??"");if(globalThis.navigator?.clipboard?.writeText)try{await globalThis.navigator.clipboard.writeText(e);return}catch{}if(typeof document>"u")throw new Error("NodexUI ClipboardButton: no clipboard API available in this environment.");let o=document.createElement("textarea");o.value=e,o.setAttribute("readonly",""),o.style.position="fixed",o.style.opacity="0",o.style.pointerEvents="none",document.body.append(o),o.select(),o.setSelectionRange(0,e.length);let r;try{r=document.execCommand("copy")}catch{r=!1}if(o.remove(),!r)throw new Error("NodexUI ClipboardButton: clipboard copy is unavailable in this browser/context.")}var Bt=class extends u{setup(){this.state=$({copied:!1}),this.resetTimer=null,Q(()=>window.clearTimeout(this.resetTimer))}get classNames(){return _n(this.props)}get resetDelay(){return et(this.props,"reset-delay","resetDelay")??2e3}get iconName(){return this.state.copied?this.props.copiedIcon||"check":this.props.icon||"copy"}get label(){return this.state.copied&&this.props.copiedLabel?this.props.copiedLabel:this.props.label}get ariaLabel(){return et(this.props,"aria-label","ariaLabel")||this.label}get attrs(){return{"data-copied":this.state.copied?"true":void 0}}async onClick(e){if(this.props.disabled)return;let o=this.props.getValue?this.props.getValue():this.props.value??"";try{await an(o),this.state.copied=!0,window.clearTimeout(this.resetTimer),this.resetTimer=window.setTimeout(()=>{this.state.copied=!1},this.resetDelay),this.props.onCopy?.({value:o,event:e})}catch(r){this.props.onCopyError?.({error:r,event:e})}}};n(Bt,"template","nodexui.ClipboardButton"),n(Bt,"components",{Button:U}),n(Bt,"props",{variant:i(String),size:i(String),value:i(String),getValue:i(Function),label:i(String),copiedLabel:i(String),icon:i(String),copiedIcon:i(String),"reset-delay":i(Number),resetDelay:i(Number),disabled:i(Boolean),...p,"aria-label":i(String),ariaLabel:i(String),onCopy:i(Function),onCopyError:i(Function)});function z(){let t=globalThis.bootstrap;if(!t)throw new Error("NodexUI: load dist/bootstrap.bundle.min.js before this script (globalThis.bootstrap is not set).");return t}var Ma={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"},$t=class extends u{setup(){this.rootRef=P("root"),this.bootstrapAlert=null,this.props.dismissible&&(V(()=>{this.bootstrapAlert=new(z()).Alert(this.rootRef.el)}),Q(()=>{this.bootstrapAlert?.dispose()}))}get classNames(){return g("alert","b-alert",Ma[this.props.variant]||Ma.default,this.props.dismissible&&"alert-dismissible",this.props.dismissible&&"fade",this.props.dismissible&&"show",this.props.className)}};n($t,"template","nodexui.Alert"),n($t,"components",{Button:U}),n($t,"props",{variant:i(String),dismissible:i(Boolean),...p});var _o=class extends u{};n(_o,"template","nodexui.AlertTitle"),n(_o,"props",p);var Yt=class extends u{};n(Yt,"template","nodexui.AlertDescription"),n(Yt,"props",p);var Po=class extends u{};n(Po,"template","nodexui.AlertAction"),n(Po,"props",p);var qo={primary:"b-badge-primary",secondary:"b-badge-secondary",success:"b-badge-success",warning:"b-badge-warning",danger:"b-badge-danger",info:"b-badge-info",muted:"b-badge-muted"};var Et=class extends u{get classNames(){return g("badge",qo[this.props.variant]||qo.secondary,this.props.pill&&"rounded-pill",this.props.className)}};n(Et,"template","nodexui.Badge"),n(Et,"props",{variant:i(String),pill:i(Boolean),label:i(String),...p});var Qt=class extends u{get classNames(){return g("b-kbd",this.props.className)}};n(Qt,"template","nodexui.Kbd"),n(Qt,"props",{...p});var Xt=class extends u{get classNames(){return g("b-spinner",this.props.type==="grow"?"spinner-grow":"spinner-border",this.props.className)}get label(){return this.props.label||"Loading"}};n(Xt,"template","nodexui.Spinner"),n(Xt,"props",{type:i(String),label:i(String),className:i(String),style:i([String,Object])});var Mt={line:["//"],block:["/*","*/"],quotes:`"'`},Pn={line:["#"],quotes:`"'`},Ua="auto break case char const continue default do double else enum extern float for goto if inline int long register restrict return short signed sizeof static struct switch typedef union unsigned void volatile while include define ifdef ifndef endif pragma",Yl="abstract assert boolean break byte case catch char class const continue default do double else enum extends final finally float for goto if implements import instanceof int interface long native new null package private protected public return short static strictfp super switch synchronized this throw throws transient true false try var void volatile while record",_a="async await break case catch class const continue debugger default delete do else export extends false finally for from function if import in instanceof let new null of return static super switch this throw true try typeof undefined var void while with yield",wn={plaintext:{label:"Plain text",indent:" "},javascript:{label:"JavaScript",...Mt,quotes:"\"'`",multiline:"`",indent:" ",keywords:_a,builtins:"console document window JSON Math Object Array Promise Map Set Date Number String Boolean Symbol require module exports process"},typescript:{annotations:!0,label:"TypeScript",...Mt,quotes:"\"'`",multiline:"`",indent:" ",keywords:`${_a} abstract as declare enum implements interface keyof namespace private protected public readonly type`,builtins:"console JSON Math Object Array Promise Map Set Date Number string number boolean any unknown never void Record Partial Readonly"},go:{label:"Go",...Mt,quotes:"\"'`",multiline:"`",indent:" ",keywords:"break case chan const continue default defer else fallthrough for func go goto if import interface map package range return select struct switch type var nil true false",builtins:"append cap close complex copy delete imag len make new panic print println real recover string int int8 int16 int32 int64 uint uint8 uint16 uint32 uint64 uintptr float32 float64 bool byte rune error any context fmt"},c:{label:"C",...Mt,indent:" ",keywords:Ua,builtins:"NULL size_t printf scanf malloc free memcpy memset strlen strcmp FILE stdin stdout stderr uint8_t uint16_t uint32_t uint64_t int8_t int16_t int32_t int64_t bool"},cpp:{label:"C++",...Mt,indent:" ",keywords:`${Ua} alignas alignof and bool catch class constexpr const_cast decltype delete dynamic_cast explicit export false friend mutable namespace new noexcept nullptr operator or private protected public reinterpret_cast static_assert static_cast template this throw true try typeid typename using virtual override final`,builtins:"std string vector map set unordered_map unique_ptr shared_ptr cout cin endl size_t NULL"},java:{annotations:!0,label:"Java",...Mt,indent:" ",keywords:Yl,builtins:"String System Object Integer Long Double Boolean List Map Set ArrayList HashMap Exception Override Math"},csharp:{label:"C#",...Mt,indent:" ",keywords:"abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false finally fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof static string struct switch this throw true try typeof uint ulong unchecked unsafe ushort using var virtual void volatile while async await record",builtins:"Console String List Dictionary Task Math Exception"},kotlin:{annotations:!0,label:"Kotlin",...Mt,quotes:`"'`,indent:" ",keywords:"abstract as break by catch class companion const constructor continue data do else enum false final finally for fun if import in infix init inline interface internal is lateinit null object open operator override package private protected public return sealed super suspend this throw true try typealias val var when while",builtins:"String Int Long Double Boolean List Map Set Any Unit println"},swift:{label:"Swift",...Mt,indent:" ",keywords:"as associatedtype break case catch class continue default defer deinit do else enum extension fallthrough false fileprivate for func guard if import in init inout internal is let nil open operator private protocol public repeat rethrows return self static struct subscript super switch throw throws true try typealias var where while async await",builtins:"String Int Double Bool Array Dictionary Set Any print"},rust:{label:"Rust",...Mt,quotes:'"',indent:" ",keywords:"as async await break const continue crate dyn else enum extern false fn for if impl in let loop match mod move mut pub ref return self Self static struct super trait true type unsafe use where while",builtins:"String Vec Option Result Some None Ok Err Box Rc Arc println format vec i8 i16 i32 i64 u8 u16 u32 u64 usize isize f32 f64 bool str"},php:{label:"PHP",variables:!0,line:["//","#"],block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"abstract and array as break callable case catch class clone const continue declare default do echo else elseif empty extends final finally fn for foreach function global if implements include instanceof interface isset namespace new null or print private protected public require return static switch this throw trait true false try unset use var while yield",builtins:"count strlen array_map array_filter in_array json_encode json_decode var_dump"},python:{annotations:!0,label:"Python",...Pn,indent:" ",keywords:"and as assert async await break class continue def del elif else except False finally for from global if import in is lambda None nonlocal not or pass raise return True try while with yield match case",builtins:"print len range str int float bool list dict set tuple open isinstance super self cls enumerate zip map filter sorted sum min max abs"},ruby:{label:"Ruby",...Pn,indent:" ",keywords:"BEGIN END alias and begin break case class def defined do else elsif end ensure false for if in module next nil not or redo rescue retry return self super then true undef unless until when while yield",builtins:"puts print require require_relative attr_accessor attr_reader attr_writer lambda proc raise"},bash:{label:"Shell",variables:!0,...Pn,indent:" ",keywords:"case do done elif else esac fi for function if in select then until while",builtins:"echo cd ls cat grep sed awk export source exit read printf test set unset local return trap"},sql:{label:"SQL",line:["--"],block:["/*","*/"],quotes:`"'`,indent:" ",ci:!0,keywords:"add all alter and as asc begin between by case check column commit constraint create cross database default delete desc distinct drop else end exists foreign from full group having if in index inner insert into is join key left like limit not null offset on or order outer primary references returning right rollback select set table then transaction union unique update values view when where with",builtins:"count sum avg min max coalesce now cast varchar text integer int bigint boolean timestamp date numeric serial"},json:{label:"JSON",plainWords:!0,keys:!0,quotes:'"',indent:" ",keywords:"true false null"},yaml:{label:"YAML",plainWords:!0,keys:!0,...Pn,indent:" ",keywords:"true false null yes no on off"},css:{label:"CSS",plainWords:!0,keys:"prop",dashed:!0,hex:!0,block:["/*","*/"],quotes:`"'`,indent:" ",keywords:"important inherit initial unset auto none",builtins:"var calc rgb rgba hsl hsla url"},html:{label:"HTML",plainWords:!0,tags:!0,block:["<!--","-->"],quotes:`"'`,indent:" "},lua:{label:"Lua",line:["--"],block:["--[[","]]"],quotes:`"'`,indent:" ",keywords:"and break do else elseif end false for function goto if in local nil not or repeat return then true until while",builtins:"assert error ipairs next pairs pcall print select tonumber tostring type unpack xpcall string table math os"}};wn.xml={...wn.html,label:"XML"};var Ql={js:"javascript",jsx:"javascript",node:"javascript",ts:"typescript",tsx:"typescript",golang:"go",h:"c","c++":"cpp",cc:"cpp",cxx:"cpp",hpp:"cpp",cs:"csharp","c#":"csharp",kt:"kotlin",rs:"rust",py:"python",rb:"ruby",sh:"bash",shell:"bash",zsh:"bash",postgres:"sql",postgresql:"sql",mysql:"sql",mjs:"javascript",cjs:"javascript",htm:"html",yml:"yaml",svg:"xml",text:"plaintext",txt:"plaintext"},Xl={comment:"b-code-comment",string:"b-code-string",number:"b-code-number",keyword:"b-code-keyword",builtin:"b-code-builtin",function:"b-code-function",type:"b-code-type",tag:"b-code-tag",attr:"b-code-attr",meta:"b-code-meta",variable:"b-code-variable",plain:""},Ci=/[A-Za-z_$]/,Fa=/[A-Za-z0-9_$]/,za=/[A-Za-z0-9_:-]/,tu=/[0-9A-Za-z_.]/,Pa=/[0-9]/,eu=/[A-Za-z0-9_-]/,qa=/^#[0-9a-fA-F]{3,8}\b/,ou=/^&#?\w+;/,ru=/[A-Za-z/!?]/,Ei=new Map;function Da(t,e){return new Set((t?e?t.toLowerCase():t:"").split(" ").filter(Boolean))}function An(t){let e=String(t??"").trim().toLowerCase(),o=Ql[e]??e,r=o in wn?o:"plaintext";if(!Ei.has(r)){let s=wn[r];Ei.set(r,{id:r,...s,keywordSet:Da(s.keywords,s.ci),builtinSet:Da(s.builtins,s.ci)})}return Ei.get(r)}function Ha(t){let e=String(t??"").split(/[?#]/)[0].split("/").pop();return e.includes(".")?e.split(".").pop().toLowerCase():""}var zf=Object.keys(wn);function Sn(t,e,o){let r=e;for(;r<t.length&&o.test(t[r]);)r+=1;return r}function su(t,e,o){if(o.block&&t.startsWith(o.block[0],e)){let s=t.indexOf(o.block[1],e+o.block[0].length);return s===-1?t.length:s+o.block[1].length}if(!o.line?.some(s=>t.startsWith(s,e)))return-1;let r=t.indexOf(`
32
+ `,e);return r===-1?t.length:r}function Wa(t,e,o){let r=t[e],s=o.multiline?.includes(r),a=e+1;for(;a<t.length&&t[a]!==r&&(s||t[a]!==`
33
+ `);)a+=t[a]==="\\"?2:1;return Math.min(t.length,t[a]===r?a+1:a)}function nu(t,e){let o=e-1;for(;o>=0&&/\s/.test(t[o]);)o-=1;return t[o]}function ja(t,e,o,r){return!r.keys||!/^\s*:(?!:|\/\/)/.test(t.slice(o,o+8))?!1:r.keys!=="prop"||"{;".includes(nu(t,e))}function iu(t,e,o,r){let s=r.ci?t.slice(e,o).toLowerCase():t.slice(e,o);if(r.keywordSet.has(s))return"keyword";let a=t[e-1]==="."||t[e-1]===":";return r.builtinSet.has(s)&&!a?"builtin":r.plainWords?"plain":/^\s*\(/.test(t.slice(o,o+8))?"function":/^[A-Z][A-Za-z0-9_$]*[a-z]/.test(s)?"type":"plain"}function au(t,e,o,r){let s=t[e],a=/^(\/|\?)?>/.exec(t.slice(e,e+2));return a?(r.inTag=!1,["tag",e+a[0].length]):o.quotes.includes(s)?["string",Wa(t,e,o)]:Ci.test(s)?["attr",Sn(t,e+1,za)]:["plain",e+1]}function cu(t,e,o){if(t[e]==="<"&&ru.test(t[e+1]??""))return o.inTag=!0,["tag",Sn(t,e+2,za)];let r=t[e]==="&"?ou.exec(t.slice(e,e+12)):null;return r?["number",e+r[0].length]:["plain",e+1]}function lu(t,e,o){let r=t[e];return!(r==="$"&&o.variables||r==="@"&&o.annotations)||!Ci.test(t[e+1]??"")?null:[r==="$"?"variable":"meta",Sn(t,e+2,Fa)]}function uu(t,e,o,r,s){let a=t[e];if(s.inTag)return au(t,e,o,s);let c=su(t,e,o);if(c!==-1)return["comment",c];if(o.tags)return cu(t,e,s);if(o.quotes?.includes(a)){let k=Wa(t,e,o);return[ja(t,e,k,o)?"attr":"string",k]}if(o.hex&&a==="#"&&qa.test(t.slice(e,e+10)))return["number",e+qa.exec(t.slice(e,e+10))[0].length];if(Pa.test(a)||a==="."&&Pa.test(t[e+1]??""))return["number",Sn(t,e+1,tu)];let l=lu(t,e,o);if(l)return l;let d=o.dashed&&a==="-"&&/[A-Za-z-]/.test(t[e+1]??"");if(!Ci.test(a)&&!d)return["plain",e+1];let f=Sn(t,e+1,o.dashed?eu:Fa);if(ja(t,e,f,o))return["attr",f];let v=iu(t,e,f,o);return[v==="plain"&&r.has(t.slice(e,f))&&t[e-1]!=="."?"builtin":v,f]}function qn(t,e,o=[]){let r=An(e),s=new Set(o),a={inTag:!1},c=[],l=0;for(;l<t.length;){let[d,f]=uu(t,l,r,s,a),v=t.slice(l,f),O=c[c.length-1];d==="plain"&&O?.kind==="plain"?O.text+=v:c.push({kind:d,text:v,className:Xl[d]}),l=f}return c}function Ka(t,e){return t.startsWith(" ")?1:/^ */.exec(t.slice(0,e.length))[0].length}var pu=new Set(["javascript","typescript","go","c","cpp","java","csharp","kotlin","swift","rust","php","css","lua","html","xml"]),du=new Set("area base br col embed hr img input link meta source track wbr".split(" ")),hu=/^[}\])]+/,mu=/\b(function|if|for|while|repeat)\b/g,fu=/\b(end|until)\b/g,bu=/^(else|elseif)\b/,gu=/^(end|until)\b/;function Do(t,e){return(t.match(e)??[]).length}function vu(t,e){let o=new Uint8Array(t.length),r="",s=0;for(let{kind:a,text:c}of qn(t,e)){let l=a==="comment"||a==="string";r+=l?c.replace(/[^\n]/g," "):c,l&&o.fill(1,s,s+c.length),s+=c.length}return{masked:r,inside:o}}function xu(t,e){let o=l=>!(e&&du.has(l.toLowerCase())),r=[...t.matchAll(/<([A-Za-z][\w:.-]*)/g)].filter(l=>o(l[1])).length,s=[...t.matchAll(/<([A-Za-z][\w:.-]*)[^<>]*\/>/g)].filter(l=>o(l[1])).length,a=t.includes("<")?0:Do(t,/\/>/g);return{leading:Do(/^(?:<\/[^>]*>\s*)+/.exec(t)?.[0]??"",/<\//g),net:r-s-a-Do(t,/<\//g)}}function yu(t,e){let o=t.trim();if(e.tags)return xu(o,e.id==="html");let r=e.id==="lua",s=hu.exec(o)?.[0].length??0,a=Do(o,/[{([]/g)-Do(o,/[})\]]/g);if(!r)return{leading:s,net:a};let c=Do(o,mu)+(/^do\b/.test(o)?1:0)-Do(o,fu);return{leading:s||(bu.test(o)||gu.test(o)?1:0),net:a+c}}function wu(t,e){return(t.id==="c"||t.id==="cpp")&&e.startsWith("#")}function Su(t,e){let{masked:o,inside:r}=vu(t,e.id),s=[],a=0,c=0;for(let l of t.split(`
34
+ `)){let d=o.slice(c,c+l.length),f=c>0&&r[c-1]===1;c+=l.length+1;let v=l.trim(),{leading:O,net:k}=yu(d,e);f?s.push(l.trimEnd()):v?wu(e,v)?s.push(v):s.push(e.indent.repeat(Math.max(0,a-O))+v):s.push(""),a=Math.max(0,a+k)}return s}function Au(t){return t.split(`
35
+ `).map(e=>e.trimEnd())}function Eu(t){return`${t.filter((o,r)=>o!==""||r>0&&t[r-1]!=="").join(`
37
36
  `).replace(/^\n+|\n+$/g,"")}
38
- `}function Ha(t,e){let s=Nn(e),o=String(t??"").replace(/\r\n?/g,`
39
- `);return o.trim()?s.id==="json"?`${JSON.stringify(JSON.parse(o),null,2)}
40
- `:iu(Vl.has(s.id)?ru(o,s):nu(o)):""}var We=class extends c{setup(){this.state=M({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=z("fileInput"),this.input=z("input"),this.controller=null,tt(()=>this.syncInput()),ct(()=>this.syncInput()),Tt(()=>this.loadUrl(this.props.src)),pt(e=>{if(e.readonly!==this.props.readonly&&(this.state.editing=!e.readonly),e.src!==this.props.src)return this.loadUrl(e.src)}),st(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return g("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??ja(this.state.name||this.props.src)}get language(){return Nn(this.codeLang)}get globals(){return this.props.globals??[]}get isReadonly(){return!this.state.editing}get showToggle(){return this.props.toggle!==!1}get showFormat(){return this.props.format!==!1&&!this.isReadonly}get ariaLabel(){return this.props.title||`${this.language.label} code`}get tokens(){return Wn(`${this.code}
37
+ `}function Va(t,e){let o=An(e),r=String(t??"").replace(/\r\n?/g,`
38
+ `);return r.trim()?o.id==="json"?`${JSON.stringify(JSON.parse(r),null,2)}
39
+ `:Eu(pu.has(o.id)?Su(r,o):Au(r)):""}var je=class extends u{setup(){this.state=$({text:null,name:"",loading:!1,error:"",editing:!this.props.readonly}),this.fileInput=P("fileInput"),this.input=P("input"),this.controller=null,V(()=>this.syncInput()),it(()=>this.syncInput()),St(()=>this.loadUrl(this.props.src)),at(e=>{if(e.readonly!==this.props.readonly&&(this.state.editing=!e.readonly),e.src!==this.props.src)return this.loadUrl(e.src)}),Q(()=>this.controller?.abort()),this.tabReleased=!1}get classNames(){return g("b-code-editor",this.props.className)}get code(){return this.state.text??this.props.value??""}get codeLang(){return this.props.codeLang??Ha(this.state.name||this.props.src)}get language(){return An(this.codeLang)}get globals(){return this.props.globals??[]}get isReadonly(){return!this.state.editing}get showToggle(){return this.props.toggle!==!1}get showFormat(){return this.props.format!==!1&&!this.isReadonly}get ariaLabel(){return this.props.title||`${this.language.label} code`}get tokens(){return qn(`${this.code}
41
40
  `,this.codeLang,this.globals)}get lineCount(){return this.code.split(`
42
- `).length}get lineLabel(){return`${this.lineCount} ${this.lineCount===1?"line":"lines"}`}get lineNumbers(){return Array.from({length:this.lineCount},(e,s)=>s+1).join(`
43
- `)}commit(e){(this.state.text!==null||!this.props.onChange)&&(this.state.text=e),this.props.onChange?.(e)}async loadUrl(e){if(this.controller?.abort(),!!e){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let s=await fetch(e,{signal:this.controller.signal});if(!s.ok)throw new Error(`Could not load ${e} (HTTP ${s.status})`);this.setFile(await s.text(),e)}catch(s){s.name!=="AbortError"&&this.fail(s)}this.state.loading=!1}}syncInput(){let e=this.input.el;if(!e||e.value===this.code)return;let{selectionStart:s,selectionEnd:o}=e;e.value=this.code,e.setSelectionRange(Math.min(s,this.code.length),Math.min(o,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(Ha(this.code,this.codeLang)),this.state.error=""}catch(e){this.fail(e)}}openPicker(){this.fileInput.el.click()}async onFileChange(e){let s=e.target.files[0];if(e.target.value="",!!s)try{this.setFile(await s.text(),s.name)}catch(o){this.fail(o)}}setFile(e,s){Object.assign(this.state,{text:e,name:s,error:""}),this.props.onLoad?.({code:e,name:s})}fail(e){this.state.error=e.message,this.props.onError?.(e)}onInput(e){this.commit(e.target.value),this.revealCaret(e.target)}revealCaret(e){let s=e.closest(".b-code-editor-box");if(!s||!e.isConnected)return;let o=getComputedStyle(e),r=parseFloat(o.paddingTop)||0,a=parseFloat(o.lineHeight)||21,l=e.value.slice(0,e.selectionEnd),u=l.split(`
44
- `).length-1,d=r+u*a;d-r<s.scrollTop?s.scrollTop=Math.max(0,d-r):d+a+r>s.scrollTop+s.clientHeight&&(s.scrollTop=d+a+r-s.clientHeight);let b=l.slice(l.lastIndexOf(`
45
- `)+1).replaceAll(" "," ".repeat(4)).length,x=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!x)return;x.font=`${o.fontSize} ${o.fontFamily}`;let S=e.offsetLeft+parseFloat(o.paddingLeft)+b*x.measureText("0").width,I=s.querySelector(".b-code-editor-gutter")?.offsetWidth??0;S<s.scrollLeft+I?s.scrollLeft=Math.max(0,S-I-r):S+r>s.scrollLeft+s.clientWidth&&(s.scrollLeft=S+r-s.clientWidth)}onKeydown(e){let s=e.target;if(requestAnimationFrame(()=>this.revealCaret(s)),e.key==="F"&&e.shiftKey&&e.altKey&&this.showFormat){e.preventDefault(),this.format();return}if(e.key==="Escape"){this.tabReleased=!0;return}let o=this.tabReleased;if(this.tabReleased=!1,e.key==="Tab"&&!o)e.preventDefault(),e.shiftKey?this.outdentLine(s):s.setRangeText(this.language.indent,s.selectionStart,s.selectionEnd,"end");else if(e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();let r=s.value.lastIndexOf(`
46
- `,s.selectionStart-1)+1,a=/^[ \t]*/.exec(s.value.slice(r,s.selectionStart))[0];s.setRangeText(`
47
- ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}outdentLine(e){let s=e.value.lastIndexOf(`
48
- `,e.selectionStart-1)+1,o=Fa(e.value.slice(s),this.language.indent);if(!o)return;let{selectionStart:r,selectionEnd:a}=e;e.setRangeText("",s,s+o,"preserve"),e.setSelectionRange(Math.max(s,r-o),Math.max(s,a-o))}};n(We,"template","nodexui.CodeEditor"),n(We,"components",{Alert:Pt,AlertDescription:ee,Badge:Lt,Button:U,ClipboardButton:Ut,Kbd:se,Spinner:oe}),n(We,"props",{value:i(String),codeLang:i(String),src:i(String),upload:i(Boolean),format:i(Boolean),toggle:i(Boolean),onChange:i(Function),onLoad:i(Function),onError:i(Function),readonly:i(Boolean),title:i(String),globals:i(Array),hint:i(String),id:i(String),...p});q();_();var re=class extends c{get tag(){return this.props.tag||"div"}};n(re,"template","nodexui.Card"),n(re,"props",{...p,tag:i(String)});var ne=class extends c{};n(ne,"template","nodexui.CardHeader"),n(ne,"props",p);var ie=class extends c{};n(ie,"template","nodexui.CardBody"),n(ie,"props",p);var Hs=class extends c{};n(Hs,"template","nodexui.CardFooter"),n(Hs,"props",p);var ae=class extends c{};n(ae,"template","nodexui.CardTitle"),n(ae,"props",p);var ce=class extends c{};n(ce,"template","nodexui.CardDescription"),n(ce,"props",p);_();q();_();q();_();var $t=class extends c{setup(){this.state=M({open:mt(this.props.state)}),this.triggerRef=z("trigger"),this.bufferRef=z("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},tt(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(G()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),mt(this.props.state)&&this.bootstrapTooltip.show()}),ct(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),st(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};n($t,"template","nodexui.Tooltip"),n($t,"props",{content:i(String),state:i(String),...p});var au=qs("circle-question-mark"),cu=0,Ot={label:i(String),labelBackground:i(String),supportingText:i(String),useTip:i(Number),errorText:i(String),leadingIcon:i(String),trailingIcon:i(String),maxLength:i(Number),invalid:i(Boolean),placeholder:i(String),disabled:i(Boolean),slots:i(Object)},wt=class extends c{setup(){this.supportId=`b-input-support-${cu++}`,this.box=z("box"),this.slotRefs={start:z("start"),end:z("end"),footer:z("footer")},tt(()=>this.measureSlots()),ct(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--b-label-bg:${e}`:void 0}get isOutlined(){return!!this.label||this.hasStart||this.hasEnd||this.hasFooter}get hasStart(){return!!this.props.slots?.start}get hasEnd(){return!!this.props.slots?.end}get hasFooter(){return!!this.props.slots?.footer}measureSlots(){let e=this.box.el;if(!e)return;let{start:s,end:o,footer:r}=this.slotRefs;e.style.setProperty("--b-slot-start",`${s.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-end",`${o.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-footer",`${r.el?.offsetHeight??0}px`)}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"b-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return g("b-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing",this.hasStart&&"has-start",this.hasEnd&&"has-end",this.hasFooter&&"has-footer")}};n(wt,"components",{Icon:et,IconCircleQuestionMark:au,Tooltip:$t});function Kn({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var le=class extends wt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return g("b-input",Kn({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(le,"template","nodexui.Input"),n(le,"props",{...Ot,value:i(String),type:i(String),readonly:i(Boolean),className:i(String),style:i([String,Object]),id:i(String),list:i(String),autocomplete:i(String),"aria-label":i(String),ariaLabel:i(String),min:i([String,Number]),max:i([String,Number]),step:i([String,Number]),onInput:i(Function),onChange:i(Function)});q();_();var ki={default:"b-tabs-list-default",line:"b-tabs-list-line"};function Vn(t,e,s,o="horizontal"){let r=o==="vertical",u=t===(r?"ArrowDown":"ArrowRight")?1:t===(r?"ArrowUp":"ArrowLeft")?-1:0;return!u||s===0?-1:(e+u+s)%s}var lu=0;function Wa(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var ue=class extends c{setup(){this.tabsState=M({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++lu}`,Z({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),pt(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};n(ue,"template","nodexui.Tabs"),n(ue,"props",{value:i(String),defaultValue:i(String),orientation:i(String),onChange:i(Function),...p});var pe=class extends c{};n(pe,"template","nodexui.TabsContainer"),n(pe,"props",{...p});var de=class extends c{setup(){this.listRef=z("list")}get classNames(){return g("nav","b-tabs-list",ki[this.props.variant]||ki.default,this.props.className)}onKeyDown(e){let s=[...this.listRef.el.querySelectorAll("[role='tab']")],o=s.indexOf(e.target),r=Vn(e.key,o,s.length,this.env.orientation);r!==-1&&(e.preventDefault(),s[r].focus(),s[r].click())}};n(de,"template","nodexui.TabsList"),n(de,"props",{variant:i(String),...p});var Dt=class extends c{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=G().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${Wa(this.props.value)}`}get classNames(){return g("nav-link","b-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};n(Dt,"template","nodexui.TabTrigger"),n(Dt,"components",{Button:U}),n(Dt,"props",{value:{type:String},disabled:i(Boolean),...p});var he=class extends c{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${Wa(this.props.value)}`}};n(he,"template","nodexui.TabContent"),n(he,"props",{value:{type:String},...p});q();_();q();_();function St(t,e){pt(s=>{Ms(s)&&(t.open=ut(s),t.open?e?.instance?.show():e?.instance?.hide())})}function At(t,e,s){Ms(t)||(e.open=s),t.onOpenChange?.(s)}function Gn(t,e){let s=null;tt(()=>{s=new(G()).Collapse(t.el,{toggle:!1})}),ct(()=>{if(!s)return;let o=t.el.classList.contains("show");e()&&!o?s.show():!e()&&o&&s.hide()}),st(()=>s?.dispose())}var me=class extends c{setup(){this.dialogState=M({open:ut(this.props)}),this.control={instance:null},Z({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),St(this.dialogState,this.control)}setOpen(e){At(this.props,this.dialogState,e)}};n(me,"template","nodexui.Dialog"),n(me,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),style:i([String,Object]),slots:i(Object)});var Ws=class extends c{onClick(){this.env.dialogControl.instance?.show()}};n(Ws,"template","nodexui.DialogTrigger"),n(Ws,"props",p);var jt=class extends c{setup(){this.rootRef=z("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},tt(()=>{this.env.dialogControl.instance=G().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};n(jt,"template","nodexui.DialogContent"),n(jt,"components",{Button:U}),n(jt,"props",{...p,showCloseButton:i(Boolean),"show-close-button":i(Boolean)});var be=class extends c{};n(be,"template","nodexui.DialogHeader"),n(be,"props",p);var fe=class extends c{};n(fe,"template","nodexui.DialogFooter"),n(fe,"props",p);var ge=class extends c{};n(ge,"template","nodexui.DialogTitle"),n(ge,"props",p);var ve=class extends c{};n(ve,"template","nodexui.DialogDescription"),n(ve,"props",p);var Ke=class extends c{};n(Ke,"template","nodexui.DialogClose"),n(Ke,"components",{Button:U}),n(Ke,"props",p);q();_();var Ka={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},uu={default:"b-empty-media-default",icon:"b-empty-media-icon"},Ks=class extends c{get classNames(){return g("b-empty",Ka[this.props.variant]||Ka.default,this.props.className)}};n(Ks,"template","nodexui.Empty"),n(Ks,"props",{variant:i(String),...p});var Vs=class extends c{};n(Vs,"template","nodexui.EmptyHeader"),n(Vs,"props",p);var Gs=class extends c{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return g("b-empty-media",uu[this.variant],this.props.className)}};n(Gs,"template","nodexui.EmptyMedia"),n(Gs,"props",{variant:i(String),...p});var Zs=class extends c{};n(Zs,"template","nodexui.EmptyTitle"),n(Zs,"props",p);var Js=class extends c{};n(Js,"template","nodexui.EmptyDescription"),n(Js,"props",p);var Ys=class extends c{};n(Ys,"template","nodexui.EmptyContent"),n(Ys,"props",p);q();_();var Qs=class extends c{get vertical(){return this.props.orientation==="vertical"}get classNames(){return g("b-separator",this.vertical?"b-separator-vertical":"b-separator-horizontal",this.props.className)}};n(Qs,"template","nodexui.Separator"),n(Qs,"props",{orientation:i(String),className:i(String),style:i([String,Object])});q();_();var xe=class extends c{get classNames(){return g("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};n(xe,"template","nodexui.Skeleton"),n(xe,"props",{shape:i(String),className:i(String),style:i([String,Object])});q();_();var pu={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"},du={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},Xs=class extends c{get tag(){return this.props.tag||du[this.props.variant]||"p"}get classNames(){return g("b-typography",pu[this.props.variant],this.props.className)}};n(Xs,"template","nodexui.Typography"),n(Xs,"props",{variant:i(String),tag:i(String),...p});q();_();var to=class extends c{get classNames(){return g("b-marker",this.props.className)}get variant(){return this.props.variant}};n(to,"template","nodexui.Marker"),n(to,"props",{variant:i(String),...p});_();var ye=class extends wt{get outlinedClassNames(){return g(super.outlinedClassNames,"is-anchored")}get classNames(){return g("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(ye,"template","nodexui.Textarea"),n(ye,"props",{...Ot,value:i(String),rows:i(Number),readonly:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),id:i(String),onInput:i(Function),onChange:i(Function)});_();var we=class extends wt{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}get classNames(){return g("b-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(we,"template","nodexui.NativeSelect"),n(we,"props",{...Ot,value:i(String),size:i(String),...p,"aria-label":i(String),ariaLabel:i(String),id:i(String),onChange:i(Function)});q();_();var Se=class extends c{onChange(e){this.props.onChange?.(e.target.checked,e)}};n(Se,"template","nodexui.Checkbox"),n(Se,"props",{checked:i(Boolean),disabled:i(Boolean),...p,id:i(String),onChange:i(Function)});q();_();var eo=class extends c{setup(){Z({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return g("b-radio-group",this.props.className)}};n(eo,"template","nodexui.RadioGroup"),n(eo,"props",{value:i(String),name:i(String),disabled:i(Boolean),...p,onChange:i(Function)});var so=class extends c{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};n(so,"template","nodexui.RadioGroupItem"),n(so,"props",{value:{type:String},disabled:i(Boolean),...p});q();_();var hu=qs("circle-question-mark"),Ve=class extends c{get tipText(){return Number(this.props.useTip??0)===1?this.props.supportingText:void 0}get supportingText(){return this.tipText?void 0:this.props.supportingText}onChange(e){this.props.onChange?.(e.target.checked,e)}};n(Ve,"template","nodexui.Switch"),n(Ve,"components",{IconCircleQuestionMark:hu,Tooltip:$t}),n(Ve,"props",{checked:i(Boolean),disabled:i(Boolean),supportingText:i(String),useTip:i(Number),...p,onChange:i(Function)});q();_();var oo=class extends c{get classNames(){return g("b-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};n(oo,"template","nodexui.Slider"),n(oo,"props",{value:i([Number,String]),min:i([Number,String]),max:i([Number,String]),step:i([Number,String]),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});q();_();var ro=class extends c{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=M({digits:Array.from({length:this.length},(s,o)=>e[o]||"")}),this.rootRef=z("root")}get classNames(){return g("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,s)=>({index:s,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,s){let o=s.target.value.slice(-1);this.state.digits[e]=o,o&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let s=e.clipboardData.getData("text").trim();if(s){e.preventDefault();for(let o=0;o<this.length;o++)this.state.digits[o]=s[o]||"";this.emit()}}};n(ro,"template","nodexui.InputOtp"),n(ro,"props",{length:i(Number),value:i(String),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});q();q();function dn(t,{defaultOpen:e=!1,onOpenChange:s}={}){let o=M({open:e}),r=d=>{o.open!==d&&(o.open=d,s?.(d))},a=()=>r(!o.open),l=d=>{t.el&&!t.el.contains(d.target)&&r(!1)},u=d=>{d.key==="Escape"&&r(!1)};return Ct(d=>{if(d)return document.addEventListener("click",l),document.addEventListener("keydown",u),()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",u)}},()=>[o.open]),st(()=>{document.removeEventListener("click",l),document.removeEventListener("keydown",u)}),{state:o,setOpen:r,toggle:a}}_();var no=class extends wt{setup(){super.setup(),this.rootRef=z("root");let{state:e,setOpen:s,toggle:o}=dn(this.rootRef,{defaultOpen:mt(this.props.state)});this.disclosure=e,Z({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:o,selectClose:()=>s(!1),selectChoose:r=>{this.props.onChange?.(r),s(!1)}})}get outlinedClassNames(){return g(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return ft(this.labelStyle,this.props.style)}get classNames(){return g("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};n(no,"template","nodexui.Select"),n(no,"props",{...Ot,value:i(String),state:i(String),onChange:i(Function),...p});var Ge=class extends c{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};n(Ge,"template","nodexui.SelectTrigger"),n(Ge,"components",{Button:U}),n(Ge,"props",p);var io=class extends c{get open(){return this.env.select.open}};n(io,"template","nodexui.SelectContent"),n(io,"props",p);var ao=class extends c{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};n(ao,"template","nodexui.SelectItem"),n(ao,"props",{value:{type:String},...p});q();function hn(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function Ni(t,e){if(t.key!=="Tab")return;let s=hn(e);if(!s.length){t.preventDefault();return}let o=s[0],r=s[s.length-1];t.shiftKey&&document.activeElement===o?(t.preventDefault(),r.focus()):!t.shiftKey&&document.activeElement===r&&(t.preventDefault(),o.focus())}function Zn(t,{closeSelector:e,trapFocus:s=!1}={}){let o=t.getAttribute("b-att-trigger"),r=o?document.querySelector(o):null,a=[...t.querySelectorAll(e)],l=null,u=()=>hn(t),d=()=>{l=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),u()[0]?.focus(),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},b=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),l?.focus?.(),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},x=I=>{if(I.key==="Escape"){b();return}!s||t.hidden||Ni(I,t)},S=I=>{I.target===t&&b()};return r?.addEventListener("click",d),a.forEach(I=>I.addEventListener("click",b)),t.addEventListener("keydown",x),t.addEventListener("click",S),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:d,close:b,destroy:()=>{r?.removeEventListener("click",d),a.forEach(I=>I.removeEventListener("click",b)),t.removeEventListener("keydown",x),t.removeEventListener("click",S)}}}function mn(t,e,s,o){let r=t.getAttribute("b-att-trigger"),a=r?document.querySelector(r):null,l=null,u=()=>{l=document.activeElement},d=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},b=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0})),l?.focus?.(),l=null},x=()=>e.show(),S=()=>e.hide();return t.addEventListener(`show.bs.${s}`,u),t.addEventListener(`shown.bs.${s}`,d),t.addEventListener(`hidden.bs.${s}`,b),a?.addEventListener("click",x),t.setAttribute("b-att-state","closed"),t[o]={open:x,close:S},{destroy:()=>{a?.removeEventListener("click",x),t.removeEventListener(`show.bs.${s}`,u),t.removeEventListener(`shown.bs.${s}`,d),t.removeEventListener(`hidden.bs.${s}`,b),e.dispose(),delete t[o]}}}_();var co=class extends c{setup(){this.alertDialogState=M({open:ut(this.props)}),Z({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),St(this.alertDialogState)}setOpen(e){At(this.props,this.alertDialogState,e)}};n(co,"template","nodexui.AlertDialog"),n(co,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Ze=class extends c{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};n(Ze,"template","nodexui.AlertDialogTrigger"),n(Ze,"components",{Button:U}),n(Ze,"props",p);var lo=class extends c{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=z("root"),Ct(e=>{if(!e)return;let s=document.activeElement;return hn(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}Ni(e,this.rootRef.el)}};n(lo,"template","nodexui.AlertDialogContent"),n(lo,"props",{...p,size:i(String)});var uo=class extends c{};n(uo,"template","nodexui.AlertDialogHeader"),n(uo,"props",p);var po=class extends c{};n(po,"template","nodexui.AlertDialogFooter"),n(po,"props",p);var ho=class extends c{};n(ho,"template","nodexui.AlertDialogMedia"),n(ho,"props",p);var mo=class extends c{};n(mo,"template","nodexui.AlertDialogTitle"),n(mo,"props",p);var bo=class extends c{};n(bo,"template","nodexui.AlertDialogDescription"),n(bo,"props",p);var Je=class extends c{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};n(Je,"template","nodexui.AlertDialogCancel"),n(Je,"components",{Button:U}),n(Je,"props",p);var Ye=class extends c{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};n(Ye,"template","nodexui.AlertDialogAction"),n(Ye,"components",{Button:U}),n(Ye,"props",{...p,onClick:i(Function)});q();_();var fo=class extends c{setup(){this.drawerState=M({open:ut(this.props)}),this.control={instance:null},Z({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),St(this.drawerState,this.control)}setOpen(e){At(this.props,this.drawerState,e)}};n(fo,"template","nodexui.Drawer"),n(fo,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Qe=class extends c{onClick(){this.env.drawerControl.instance?.show()}};n(Qe,"template","nodexui.DrawerTrigger"),n(Qe,"components",{Button:U}),n(Qe,"props",p);var go=class extends c{setup(){this.rootRef=z("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},tt(()=>{this.env.drawerControl.instance=G().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};n(go,"template","nodexui.DrawerContent"),n(go,"props",p);var vo=class extends c{};n(vo,"template","nodexui.DrawerHeader"),n(vo,"props",p);var xo=class extends c{};n(xo,"template","nodexui.DrawerFooter"),n(xo,"props",p);var yo=class extends c{};n(yo,"template","nodexui.DrawerTitle"),n(yo,"props",p);var wo=class extends c{};n(wo,"template","nodexui.DrawerDescription"),n(wo,"props",p);var Xe=class extends c{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};n(Xe,"template","nodexui.DrawerClose"),n(Xe,"components",{Button:U}),n(Xe,"props",p);q();_();var So=class extends c{setup(){this.sheetState=M({open:ut(this.props),side:this.props.side}),this.control={instance:null},Z({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),St(this.sheetState,this.control),pt(e=>{this.sheetState.side=e.side})}setOpen(e){At(this.props,this.sheetState,e)}};n(So,"template","nodexui.Sheet"),n(So,"props",{open:i(Boolean),state:i(String),side:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var ts=class extends c{onClick(){this.env.sheetControl.instance?.show()}};n(ts,"template","nodexui.SheetTrigger"),n(ts,"components",{Button:U}),n(ts,"props",p);var Ao=class extends c{setup(){this.rootRef=z("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},tt(()=>{this.env.sheetControl.instance=G().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),st(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};n(Ao,"template","nodexui.SheetContent"),n(Ao,"props",{...p,side:i(String)});var Eo=class extends c{};n(Eo,"template","nodexui.SheetHeader"),n(Eo,"props",p);var Co=class extends c{};n(Co,"template","nodexui.SheetFooter"),n(Co,"props",p);var Lo=class extends c{};n(Lo,"template","nodexui.SheetTitle"),n(Lo,"props",p);var ko=class extends c{};n(ko,"template","nodexui.SheetDescription"),n(ko,"props",p);var es=class extends c{};n(es,"template","nodexui.SheetClose"),n(es,"components",{Button:U}),n(es,"props",p);q();_();var No=class extends c{setup(){let e=M({open:mt(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let s=o=>{e.open!==o&&(e.open=o,this.props.onOpenChange?.(o))};Z({popover:e,popoverControl:this.control,popoverSetOpen:s,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};n(No,"template","nodexui.Popover"),n(No,"props",{state:i(String),onOpenChange:i(Function),...p});var ss=class extends c{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),tt(()=>{let e=this.env.popoverControl,s=e.bufferEl?.innerHTML??"";e.lastContentHtml=s,e.instance=new(G()).Popover(this.rootRef.el,{content:s,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),st(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};n(ss,"template","nodexui.PopoverTrigger"),n(ss,"components",{Button:U}),n(ss,"props",p);var To=class extends c{get style(){return ft("display:none",this.props.style)}setup(){this.bufferRef=z("buffer"),tt(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),ct(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let s=this.currentContentHtml();e.instance&&s!==e.lastContentHtml&&(e.lastContentHtml=s,e.instance.setContent({".popover-body":s}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};n(To,"template","nodexui.PopoverContent"),n(To,"props",{...p,content:i(String)});q();_();var Oo=class extends c{setup(){this.state=M({open:!1}),Z({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};n(Oo,"template","nodexui.HoverCard"),n(Oo,"props",{...p});var Io=class extends c{};n(Io,"template","nodexui.HoverCardTrigger"),n(Io,"props",p);var Ro=class extends c{get open(){return this.env.hoverCard.open}};n(Ro,"template","nodexui.HoverCardContent"),n(Ro,"props",p);q();_();var Ti={...p,disabled:i(Boolean),inset:i(Boolean),onClick:i(Function),onSelect:i(Function),variant:i(String)},Ae=class extends c{setup(){this.rootRef=z("root");let e=M({open:mt(this.props.state)});this.control={instance:null};let s=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};Z({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:s,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let o=a=>{this.rootRef.el&&!this.rootRef.el.contains(a.target)&&this.control.instance?.hide()},r=a=>{a.key==="Escape"&&this.control.instance?.hide()};Ct(a=>{if(a)return document.addEventListener("click",o),document.addEventListener("keydown",r),()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",r)}},()=>[e.open]),st(()=>{document.removeEventListener("click",o),document.removeEventListener("keydown",r)})}};n(Ae,"template","nodexui.DropdownMenu"),n(Ae,"props",{state:i(String),onOpenChange:i(Function),...p});var zt=class extends c{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=G().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return g("btn","b-button","btn-outline-secondary","b-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};n(zt,"template","nodexui.DropdownMenuTrigger"),n(zt,"components",{Button:U}),n(zt,"props",p);var Ee=class extends c{get open(){return this.env.dropdownMenu.open}get classNames(){return g("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};n(Ee,"template","nodexui.DropdownMenuContent"),n(Ee,"props",{...p,align:i(String),alignOffset:i(Number),side:i(String),sideOffset:i(Number)});var Bo=class extends c{};n(Bo,"template","nodexui.DropdownMenuGroup"),n(Bo,"props",p);var $o=class extends c{};n($o,"template","nodexui.DropdownMenuLabel"),n($o,"props",{...p,inset:i(Boolean)});var Ce=class extends c{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};n(Ce,"template","nodexui.DropdownMenuItem"),n(Ce,"props",Ti);var os=class extends c{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};n(os,"template","nodexui.DropdownMenuCheckboxItem"),n(os,"components",{Icon:et}),n(os,"props",{...Ti,checked:i(Boolean),onCheckedChange:i(Function)});var _o=class extends c{setup(){Z({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};n(_o,"template","nodexui.DropdownMenuRadioGroup"),n(_o,"props",{...p,value:i(String),onValueChange:i(Function)});var rs=class extends c{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};n(rs,"template","nodexui.DropdownMenuRadioItem"),n(rs,"components",{Icon:et}),n(rs,"props",{...Ti,value:i(String)});var Mo=class extends c{};n(Mo,"template","nodexui.DropdownMenuSeparator"),n(Mo,"props",p);var Uo=class extends c{};n(Uo,"template","nodexui.DropdownMenuShortcut"),n(Uo,"props",p);var Le=class extends c{setup(){this.rootRef=z("root");let{state:e,setOpen:s,toggle:o}=dn(this.rootRef);Z({dropdownSub:e,dropdownSubToggle:o,dropdownSubOpen:()=>s(!0),dropdownSubClose:()=>s(!1)})}};n(Le,"template","nodexui.DropdownMenuSub"),n(Le,"props",p);var Ft=class extends c{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};n(Ft,"template","nodexui.DropdownMenuSubTrigger"),n(Ft,"components",{Icon:et}),n(Ft,"props",{...p,disabled:i(Boolean),inset:i(Boolean)});var ke=class extends c{get open(){return this.env.dropdownSub.open}};n(ke,"template","nodexui.DropdownMenuSubContent"),n(ke,"props",p);q();_();var Po=class extends c{setup(){this.state=M({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,Z({contextMenu:this.state,contextMenuOpenAt:(s,o)=>{this.state.open=!0,this.state.x=s,this.state.y=o},contextMenuClose:e}),document.addEventListener("click",e),st(()=>document.removeEventListener("click",e))}};n(Po,"template","nodexui.ContextMenu"),n(Po,"props",{className:i(String),slots:i(Object)});var qo=class extends c{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};n(qo,"template","nodexui.ContextMenuTrigger"),n(qo,"props",p);var Do=class extends c{setup(){this.rootRef=z("root")}get open(){return this.env.contextMenu.open}get style(){return ft(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};n(Do,"template","nodexui.ContextMenuContent"),n(Do,"props",p);var jo=class extends c{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};n(jo,"template","nodexui.ContextMenuItem"),n(jo,"props",{...p,onClick:i(Function)});q();_();var mu={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function Jn(t){let e=mu[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var Ht=class extends c{setup(){this.state=M({open:ut(this.props)}),this.rootRef=z("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},tt(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),pt(e=>{let s=Ms(e)?ut(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),s&&this.bootstrapToast.show()):s!==this.state.open&&(s?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),st(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let s=this.rootRef.el,o=e??3e3;this.bootstrapToast=new(G()).Toast(s,{autohide:o>0,delay:o||3e3}),s.addEventListener("shown.bs.toast",this.handleShown),s.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return g("toast","fade","b-toast",Jn(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};n(Ht,"template","nodexui.Toast"),n(Ht,"components",{Button:U}),n(Ht,"props",{open:i(Boolean),state:i(String),variant:i(String),delay:i(Number),position:i(String),...p,onOpenChange:i(Function)});q();_();var zo=class extends c{setup(){this.state=M({open:new Set}),Z({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let s=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),s?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(s)}};n(zo,"template","nodexui.Accordion"),n(zo,"props",{multiple:i(Boolean),onChange:i(Function),...p});var Fo=class extends c{setup(){Z({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};n(Fo,"template","nodexui.AccordionItem"),n(Fo,"props",{value:{type:String},state:i(String),...p});var ns=class extends c{get open(){return this.env.accordionItemState!==void 0?mt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};n(ns,"template","nodexui.AccordionTrigger"),n(ns,"components",{Icon:et,Button:U}),n(ns,"props",p);var Ho=class extends c{setup(){this.rootRef=z("root"),this.initialOpen=this.open,Gn(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?mt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};n(Ho,"template","nodexui.AccordionContent"),n(Ho,"props",p);q();_();var Wo=class extends c{setup(){this.state=M({open:ut(this.props)}),Z({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),St(this.state)}toggle(){let e=!this.state.open;At(this.props,this.state,e)}};n(Wo,"template","nodexui.Collapsible"),n(Wo,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var is=class extends c{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};n(is,"template","nodexui.CollapsibleTrigger"),n(is,"components",{Button:U}),n(is,"props",p);var Ko=class extends c{setup(){this.rootRef=z("root"),this.initialOpen=this.open,Gn(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};n(Ko,"template","nodexui.CollapsibleContent"),n(Ko,"props",p);q();_();var Ne=class extends c{};n(Ne,"template","nodexui.Breadcrumb"),n(Ne,"props",{...p});var Te=class extends c{};n(Te,"template","nodexui.BreadcrumbList"),n(Te,"props",{...p});var Oe=class extends c{get classNames(){return g("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};n(Oe,"template","nodexui.BreadcrumbItem"),n(Oe,"props",{current:i(Boolean),...p});var Ie=class extends c{get classNames(){return g("b-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};n(Ie,"template","nodexui.BreadcrumbLink"),n(Ie,"props",{href:i(String),target:i(String),rel:i(String),...p,onClick:i(Function)});var Re=class extends c{get classNames(){return g("b-breadcrumb-page",this.props.className)}};n(Re,"template","nodexui.BreadcrumbPage"),n(Re,"props",{...p});var Wt=class extends c{get classNames(){return g("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};n(Wt,"template","nodexui.BreadcrumbSeparator"),n(Wt,"components",{Icon:et}),n(Wt,"props",{...p});var as=class extends c{get classNames(){return g("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};n(as,"template","nodexui.BreadcrumbEllipsis"),n(as,"components",{Icon:et}),n(as,"props",{...p});q();_();var Vo=class extends c{get classNames(){return g("b-pagination",this.props.className)}};n(Vo,"template","nodexui.Pagination"),n(Vo,"props",{...p});var Go=class extends c{get classNames(){return g("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};n(Go,"template","nodexui.PaginationItem"),n(Go,"props",{current:i(Boolean),disabled:i(Boolean),style:i([String,Object]),onClick:i(Function),slots:i(Object)});q();_();var Zo=class extends c{setup(){this.rootRef=z("root")}onKeyDown(e){let s=[...this.rootRef.el.querySelectorAll("a, button")].filter(a=>!a.disabled),o=s.indexOf(e.target),r=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!r||o<0||(e.preventDefault(),s[(o+r+s.length)%s.length]?.focus())}};n(Zo,"template","nodexui.NavigationMenu"),n(Zo,"props",{...p});var Jo=class extends c{};n(Jo,"template","nodexui.NavigationMenuItem"),n(Jo,"props",{href:i(String),...p});q();_();var Yo=class extends c{get classNames(){return g("b-menubar",this.props.className)}};n(Yo,"template","nodexui.Menubar"),n(Yo,"props",{...p});q();_();var Va={...p,href:i(String)};function Ga(t){globalThis.matchMedia?.("(max-width: 991.98px)").matches&&t.setSidebarOpen?.(!1)}var Vt=class extends c{setup(){this.state=M({open:ut(this.props)}),Z({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),St(this.state)}setOpen(e){At(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return g("b-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};n(Vt,"template","nodexui.Sidebar"),n(Vt,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),side:i(String),variant:i(String),collapsible:i(String),...p});var bn=class extends Vt{};n(bn,"template","nodexui.Sidebar");var cs=class extends c{onClick(){if(this.env.setShellCollapsed&&!globalThis.matchMedia?.("(max-width: 991.98px)").matches){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};n(cs,"template","nodexui.SidebarTrigger"),n(cs,"components",{Icon:et,Button:U}),n(cs,"props",{...p,icon:i(String),label:i(String)});var Be=class extends c{get open(){return this.env.sidebar.open}};n(Be,"template","nodexui.SidebarContent"),n(Be,"props",p);var Qo=class extends c{};n(Qo,"template","nodexui.SidebarHeader"),n(Qo,"props",p);var Xo=class extends c{};n(Xo,"template","nodexui.SidebarFooter"),n(Xo,"props",p);var tr=class extends c{};n(tr,"template","nodexui.SidebarInset"),n(tr,"props",p);var ls=class extends c{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};n(ls,"template","nodexui.SidebarRail"),n(ls,"components",{Button:U}),n(ls,"props",p);var er=class extends c{};n(er,"template","nodexui.SidebarInput"),n(er,"props",{className:i(String),style:i([String,Object]),placeholder:i(String),value:i(String),type:i(String)});var sr=class extends c{};n(sr,"template","nodexui.SidebarSeparator"),n(sr,"props",p);var us=class extends c{onClick(){this.env.setSidebarOpen(!1)}};n(us,"template","nodexui.SidebarClose"),n(us,"components",{Icon:et,Button:U}),n(us,"props",{...p,icon:i(String),label:i(String)});var $e=class extends c{};n($e,"template","nodexui.SidebarGroup"),n($e,"props",{muted:i(Boolean),...p});var _e=class extends c{};n(_e,"template","nodexui.SidebarGroupLabel"),n(_e,"props",Va);var ps=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};n(ps,"template","nodexui.SidebarGroupAction"),n(ps,"components",{Button:U}),n(ps,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function),...p});var or=class extends c{};n(or,"template","nodexui.SidebarGroupContent"),n(or,"props",p);var ds=class extends c{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=M({open:Ms(this.props)||e?ut(this.props):!0}),St(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;At(this.props,this.state,e)}};n(ds,"template","nodexui.SidebarGroupCollapsible"),n(ds,"components",{Icon:et,Button:U}),n(ds,"props",{label:{type:String},open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var Gt=class extends c{};n(Gt,"template","nodexui.SidebarMenu"),n(Gt,"props",p);var Me=class extends c{};n(Me,"template","nodexui.SidebarMenuItem"),n(Me,"props",p);var Kt=class extends c{get classNames(){return g("b-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),Ga(this.env)}};n(Kt,"template","nodexui.SidebarMenuButton"),n(Kt,"components",{Icon:et,Button:U}),n(Kt,"props",{href:i(String),icon:i(String),active:i(Boolean),isActive:i(Boolean),variant:i(String),size:i(String),tooltip:i(String),disabled:i(Boolean),onClick:i(Function),...p});var hs=class extends c{get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};n(hs,"template","nodexui.SidebarMenuAction"),n(hs,"components",{Button:U}),n(hs,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),showOnHover:i(Boolean),onClick:i(Function),...p});var rr=class extends c{};n(rr,"template","nodexui.SidebarMenuSub"),n(rr,"props",p);var nr=class extends c{};n(nr,"template","nodexui.SidebarMenuBadge"),n(nr,"props",p);var ir=class extends c{setup(){this.state=M({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return ft(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};n(ir,"template","nodexui.SidebarMenuSkeleton"),n(ir,"props",{showIcon:i(Boolean),width:i(String),className:i(String),style:i([String,Object])});var ar=class extends c{};n(ar,"template","nodexui.SidebarMenuSubItem"),n(ar,"props",p);var ms=class extends c{get classNames(){return g("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),Ga(this.env)}};n(ms,"template","nodexui.SidebarMenuSubButton"),n(ms,"components",{Button:U}),n(ms,"props",{...Va,active:i(Boolean),isActive:i(Boolean),size:i(String),onClick:i(Function)});q();_();var bs=class extends c{setup(){this.state=M({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),Z({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),pt(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};n(bs,"template","nodexui.Shell"),n(bs,"components",{Sidebar:Vt,Toast:Ht,Button:U}),n(bs,"props",{open:i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),collapsed:i(Boolean),defaultCollapsed:i(Boolean),onCollapsedChange:i(Function),authState:i(Object),toast:i(Object),onToastOpenChange:i(Function),notificationPage:i(Function),pwa:i(Function),...p});var fs=class extends c{};n(fs,"template","nodexui.ShellSidebar"),n(fs,"components",{SidebarContent:Be}),n(fs,"props",p);var cr=class extends c{};n(cr,"template","nodexui.ShellSidebarHeader"),n(cr,"props",p);var lr=class extends c{};n(lr,"template","nodexui.ShellNav"),n(lr,"props",p);var ur=class extends c{};n(ur,"template","nodexui.ShellMain"),n(ur,"props",p);var pr=class extends c{};n(pr,"template","nodexui.ShellHeader"),n(pr,"props",p);var gs=class extends c{};n(gs,"template","nodexui.ShellContent"),n(gs,"components",{Skeleton:xe}),n(gs,"props",{loading:i(Boolean),...p});var vs=class extends c{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};n(vs,"template","nodexui.ShellUserMenu"),n(vs,"components",{Button:U}),n(vs,"props",p);q();_();var dr=class extends c{get classNames(){return g("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};n(dr,"template","nodexui.Table"),n(dr,"props",{striped:i(Boolean),hover:i(Boolean),responsive:i(Boolean),...p});q();_();var bu=[{key:"status",label:"Status",format:"capitalize"},{key:"email",label:"Email",sortable:!0,filterable:!0},{key:"amount",label:"Amount",align:"right",format:"currency"}],fu=[{id:"728ed52f",status:"success",email:"ken99@example.com",amount:316},{id:"489e1d42",status:"success",email:"abe45@example.com",amount:242},{id:"6b0888f6",status:"processing",email:"monserrat44@example.com",amount:837},{id:"a1dc8c4e",status:"success",email:"silas22@example.com",amount:874},{id:"15b96de0",status:"failed",email:"carmella@example.com",amount:721}],gu=[{label:"Copy payment ID"},{label:"View customer"},{label:"View payment details"}],hr=4,mr=8,vu=32,xs=class extends c{setup(){this.state=M({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=z("actionsMenu"),this.actionsMenuTriggerEl=null,Us(window,"click",this.onWindowClick,!0),Us(window,"keydown",this.onWindowKeydown),Us(window,"resize",this.closeRowActions),Us(window,"scroll",this.closeRowActions,!0),ct(()=>this.refreshActionsMenuPosition())}get columns(){return this.props.columns?.length?this.props.columns:bu}get rows(){return this.props.rows?.length?this.props.rows:fu}get usesDefaultRows(){return!this.props.rows?.length}get initialPageSize(){return this.props["page-size"]??this.props.pageSize??10}get pageSizeOptions(){return this.props["page-size-options"]??this.props.pageSizeOptions??[10,20,50,80]}get rowActions(){return this.props["row-actions"]??this.props.rowActions??(this.usesDefaultRows?gu:[])}get variant(){return this.props.variant||"default"}get classNames(){return g("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=this.props["max-height"]??this.props.maxHeight;return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return this.props["column-toggle"]??this.props.columnToggle??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??this.usesDefaultRows}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let e=this.state.query.toLowerCase(),s=this.columns.filter(a=>a.filterable===!0),o=(s.length?s:this.columns).map(a=>a.key),r=this.rows.filter(a=>!e||o.some(l=>String(a[l]).toLowerCase().includes(e)));return this.state.sortKey&&(r=[...r].sort((a,l)=>String(a[this.state.sortKey]).localeCompare(String(l[this.state.sortKey]))*this.state.sortDir)),r}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let s=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(s,s+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return this.props["empty-label"]??this.props.emptyLabel??"No results."}get filterPlaceholder(){return this.props["filter-placeholder"]??this.props.filterPlaceholder??"Filter emails..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,s){return e.id??e.key??s}isSelected(e,s){return this.state.selectedKeys.includes(this.rowKey(e,s))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let s=this.columns.find(o=>o.key===e);!s||!this.isColumnSortable(s)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(s=>s!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,s,o){let r=this.rowKey(e,s);if(this.state.actionRowKey===r){this.closeRowActions();return}this.actionsMenuTriggerEl=o.currentTarget,this.state.actionRowKey=r,this.state.actionMenuStyle=this.estimateActionMenuStyle(o.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((s,o)=>this.rowKey(s,o)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let s=e.getBoundingClientRect(),o=this.rowActions.length*vu+hr*2,r=window.innerHeight-s.bottom,l=r<o+hr&&s.top>r?Math.max(mr,s.top-hr-o):s.bottom+hr,u=Math.min(Math.max(mr,s.right-160),window.innerWidth-160-mr);return`position: fixed; top: ${Math.round(l)}px; left: ${Math.round(u)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let s=this.actionsMenuTriggerEl.getBoundingClientRect(),o=e.getBoundingClientRect(),r=window.innerHeight-s.bottom,a=s.top,u=r<o.height+hr&&a>r?Math.max(mr,s.top-hr-o.height):Math.min(s.bottom+hr,window.innerHeight-o.height-mr),d=Math.min(Math.max(mr,s.right-o.width),window.innerWidth-o.width-mr),b=`position: fixed; top: ${Math.round(u)}px; left: ${Math.round(d)}px;`;this.state.actionMenuStyle!==b&&(this.state.actionMenuStyle=b)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,s,o){let r=this.rowKey(e,s);this.state.selectedKeys=o?[...new Set([...this.state.selectedKeys,r])]:this.state.selectedKeys.filter(a=>a!==r),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let s=this.pageRows.map((o,r)=>this.rowKey(o,r));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...s])]:this.state.selectedKeys.filter(o=>!s.includes(o)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,s,o){e.onSelect?.(s,o),this.props.onRowAction?.(e,s,o),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,s){let o=e[s.key];if(s.format==="currency"){let r=Number(o);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(r)?r:0)}if(s.format==="capitalize"){let r=String(o??"");return r.charAt(0).toUpperCase()+r.slice(1)}return o??""}cellComponentProps(e,s){return s.componentProps?s.componentProps(e,s):{row:e,column:s,value:e[s.key]}}};n(xs,"template","nodexui.DataTable"),n(xs,"components",{Button:U,Icon:et}),n(xs,"props",{columns:i(Array),rows:i(Array),variant:i(String),searchable:i(Boolean),sortable:i(Boolean),pagination:i(Boolean),selectable:i(Boolean),"column-toggle":i(Boolean),columnToggle:i(Boolean),"row-actions":i(Array),rowActions:i(Array),"page-size":i(Number),pageSize:i(Number),"page-size-options":i(Array),pageSizeOptions:i(Array),"filter-placeholder":i(String),filterPlaceholder:i(String),"empty-label":i(String),emptyLabel:i(String),onRowAction:i(Function),onSelectionChange:i(Function),...p,"max-height":i([String,Number]),maxHeight:i([String,Number])});q();_();var xu=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),yu=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],ys=class extends c{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return xu.format(new Date(this.year,this.month0,1))}get weekdays(){return yu}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),s=new Date(this.year,this.month0,1).getDay(),o=[];for(let r=0;r<s;r++)o.push(null);for(let r=1;r<=e;r++){let a=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(r).padStart(2,"0")}`;o.push({day:r,value:a,selected:a===this.props.selected})}return o}onSelect(e){this.props.onChange?.(e)}};n(ys,"template","nodexui.Calendar"),n(ys,"components",{Button:U}),n(ys,"props",{selected:i(String),month:i(Number),year:i(Number),className:i(String),style:i([String,Object]),onChange:i(Function)});_();var br=class extends wt{get classNames(){return g("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};n(br,"template","nodexui.DatePicker"),n(br,"props",{...Ot,value:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});q();_();var fr=class extends wt{setup(){super.setup(),this.rootRef=z("root");let{state:e}=dn(this.rootRef);this.disclosure=e,this.state=M({query:this.selectedLabel})}get classNames(){return g("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};n(fr,"template","nodexui.Combobox"),n(fr,"props",{options:{type:Array},...Ot,value:i(String),className:i(String),style:i([String,Object]),id:i(String),onChange:i(Function)});q();_();var gr=class extends c{setup(){this.state=M({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(s=>s.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};n(gr,"template","nodexui.Command"),n(gr,"props",{items:{type:Array},placeholder:i(String),className:i(String),style:i([String,Object]),onSelect:i(Function)});q();_();var vr=class extends c{get classNames(){return g("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};n(vr,"template","nodexui.Chart"),n(vr,"props",{config:i([String,Object]),label:i(String),type:i(String),value:i([String,Number]),variant:i(String),...p});q();_();var xr=class extends c{setup(){this.state=M({index:this.props.defaultIndex??0}),this.rootRef=z("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},Z({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),tt(()=>{this.bootstrapCarousel=new(G()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),st(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};n(xr,"template","nodexui.Carousel"),n(xr,"props",{slideCount:{type:Number},defaultIndex:i(Number),onChange:i(Function),...p});var yr=class extends c{setup(){this.rootRef=z("root"),this.initialActive=this.active,ct(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?mt(this.props.state):this.env.carousel.index===this.props.index}};n(yr,"template","nodexui.CarouselSlide"),n(yr,"props",{index:{type:Number},state:i(String),...p});var ws=class extends c{onClick(){this.env.carouselInstance()?.prev()}};n(ws,"template","nodexui.CarouselPrevious"),n(ws,"components",{Button:U}),n(ws,"props",p);var Ss=class extends c{onClick(){this.env.carouselInstance()?.next()}};n(Ss,"template","nodexui.CarouselNext"),n(Ss,"components",{Button:U}),n(Ss,"props",p);q();_();var wr=class extends c{setup(){this.panelRef=z("panel"),this.state=M({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let s=e.clientX,o=this.panelRef.el.getBoundingClientRect().width,r=this.props.min||160,a=this.props.max||720,l=d=>{this.state.width=Math.min(a,Math.max(r,o+d.clientX-s))},u=()=>{document.removeEventListener("pointermove",l),document.removeEventListener("pointerup",u),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",l),document.addEventListener("pointerup",u)}};n(wr,"template","nodexui.Resizable"),n(wr,"props",{min:i(Number),max:i(Number),onChange:i(Function),...p});q();_();var Sr=class extends c{get classNames(){return g("b-scroll-area",this.props.className)}};n(Sr,"template","nodexui.ScrollArea"),n(Sr,"props",p);q();_();var Za={idle:"b-attachment-idle",uploading:"b-attachment-uploading",processing:"b-attachment-processing",error:"b-attachment-error",done:"b-attachment-done"},Ja={default:"b-attachment-default",sm:"b-attachment-sm",xs:"b-attachment-xs"},Ar=class extends c{get state(){return Za[this.props.state]?this.props.state:"done"}get size(){return Ja[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-attachment",Za[this.state],Ja[this.size],`b-attachment-${this.orientation}`,!this.hasContent&&"b-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};n(Ar,"template","nodexui.Attachment"),n(Ar,"props",{state:i(String),size:i(String),orientation:i(String),multiple:i(Boolean),...p,onChange:i(Function)});var Er=class extends c{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return g("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};n(Er,"template","nodexui.AttachmentMedia"),n(Er,"props",{variant:i(String),...p});var Cr=class extends c{};n(Cr,"template","nodexui.AttachmentContent"),n(Cr,"props",p);var Lr=class extends c{};n(Lr,"template","nodexui.AttachmentTitle"),n(Lr,"props",p);var kr=class extends c{};n(kr,"template","nodexui.AttachmentDescription"),n(kr,"props",p);var Nr=class extends c{};n(Nr,"template","nodexui.AttachmentActions"),n(Nr,"props",p);var As=class extends c{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return g("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};n(As,"template","nodexui.AttachmentAction"),n(As,"components",{Button:U}),n(As,"props",{type:i(String),variant:i(String),size:i(String),disabled:i(Boolean),label:i(String),...p,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Es=class extends c{get classNames(){return g("b-attachment-trigger",this.props.className)}get ariaLabel(){return this.props["aria-label"]??this.props.ariaLabel}onClick(e){this.props.onClick?.(e)}};n(Es,"template","nodexui.AttachmentTrigger"),n(Es,"components",{Button:U}),n(Es,"props",{href:i(String),target:i(String),rel:i(String),type:i(String),className:i(String),style:i([String,Object]),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Tr=class extends c{get classNames(){return g("b-attachment-group",this.props.className)}};n(Tr,"template","nodexui.AttachmentGroup"),n(Tr,"props",{...p});var Or=class extends c{setup(){this.state=M({dragging:!1}),this.fileInput=z("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return g("b-attachment-dropzone",this.state.dragging&&"b-attachment-dropzone-dragging",this.props.disabled&&"b-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let s=Array.from(e.target.files??[]);e.target.value="",s.length&&this.props.onFilesSelected?.(s)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let s=Array.from(e.dataTransfer?.files??[]);s.length&&this.props.onFilesSelected?.(s)}};n(Or,"template","nodexui.AttachmentDropzone"),n(Or,"props",{multiple:i(Boolean),disabled:i(Boolean),...p,onFilesSelected:i(Function)});q();_();var Ir=class extends c{setup(){this.state=M({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};n(Ir,"template","nodexui.Avatar"),n(Ir,"props",{src:i(String),alt:i(String),title:i(String),...p});q();_();var Rr=class extends c{get classNames(){return g("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};n(Rr,"template","nodexui.Message"),n(Rr,"props",{side:i(String),...p});q();_();var Br=class extends c{setup(){this.rootRef=z("root"),Ct(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};n(Br,"template","nodexui.MessageScroller"),n(Br,"props",{autoscroll:i(Boolean),...p});q();_();var $r=class extends c{setup(){this.state=M({index:0}),Z({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};n($r,"template","nodexui.Questionnaire"),n($r,"props",{stepCount:{type:Number},onChange:i(Function),...p});var _r=class extends c{get active(){return this.props.state!==void 0?mt(this.props.state):this.env.questionnaire.index===this.props.index}};n(_r,"template","nodexui.QuestionnaireStep"),n(_r,"props",{index:{type:Number},state:i(String),...p});var Cs=class extends c{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};n(Cs,"template","nodexui.QuestionnairePrevious"),n(Cs,"components",{Button:U}),n(Cs,"props",p);var Ls=class extends c{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};n(Ls,"template","nodexui.QuestionnaireNext"),n(Ls,"components",{Button:U}),n(Ls,"props",{...p,stepCount:i(Number)});q();_();var Mr=class extends c{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return ft(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return g("progress b-progress",this.props.className)}};n(Mr,"template","nodexui.Progress"),n(Mr,"props",{value:i(Number),max:i(Number),className:i(String),style:i([String,Object])});q();_();var Yn=Sn(tc(),1);Yn.default.stringToBytes=Yn.default.stringToBytesFuncs["UTF-8"];function ec(t,{ecc:e="M"}={}){let s=(0,Yn.default)(0,e);return s.addData(String(t)),s.make(),{size:s.getModuleCount(),isDark:(o,r)=>s.isDark(o,r)}}var ks=class extends c{get code(){let{matrix:e}=this.props;if(e)return e;let s=this.props.qrContent;return s?(this.encoded?.text!==s&&(this.encoded={text:s,matrix:ec(s)}),this.encoded.matrix):{size:0}}get path(){let{size:e,isDark:s}=this.code,o=[];for(let r=0;r<e;r+=1)for(let a=0;a<e;a+=1)s(r,a)&&o.push(`M${a} ${r}h1v1h-1z`);return o.join("")}get size(){return this.code.size}};n(ks,"template","nodexui.QRCard"),n(ks,"components",{Card:re,CardBody:ie,CardHeader:ne,CardTitle:ae,CardDescription:ce}),n(ks,"props",{matrix:i(Object),qrContent:i(String),label:i(String),title:i(String),description:i(String),...p});q();_();var Ur=class extends c{get classNames(){return g("b-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return ft(`--b-aspect-ratio:${e}`,this.props.style)}};n(Ur,"template","nodexui.AspectRatio"),n(Ur,"props",{ratio:i(String),width:i(Number),height:i(Number),...p});q();_();var Pr=class extends c{get classNames(){return g("b-bubble",this.props.className)}get side(){return this.props.side}};n(Pr,"template","nodexui.Bubble"),n(Pr,"props",{side:i(String),...p});q();_();var qr=class extends c{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};n(qr,"template","nodexui.Direction"),n(qr,"props",{dir:i(String),...p});q();_();var Dr=class extends c{get classNames(){return g("b-item",this.props.className)}get variant(){return this.props.variant}};n(Dr,"template","nodexui.Item"),n(Dr,"props",{variant:i(String),...p});q();_();var jr=class extends c{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};n(jr,"template","nodexui.ButtonGroup"),n(jr,"props",{orientation:i(String),size:i(String),"aria-label":i(String),"aria-labelledby":i(String),...p});var zr=class extends c{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return g("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};n(zr,"template","nodexui.ButtonGroupSeparator"),n(zr,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var Fr=class extends c{get classNames(){return g("b-button-group-text",this.props.className)}};n(Fr,"template","nodexui.ButtonGroupText"),n(Fr,"props",{...p});q();_();var Hr=class extends c{get classNames(){return g("b-field-set",this.props.className)}};n(Hr,"template","nodexui.FieldSet"),n(Hr,"props",{...p});var Wr=class extends c{get variant(){return this.props.variant||"legend"}get classNames(){return g("b-field-legend",this.props.className)}};n(Wr,"template","nodexui.FieldLegend"),n(Wr,"props",{variant:i(String),...p});var Ue=class extends c{get classNames(){return g("b-field-group",this.props.className)}};n(Ue,"template","nodexui.FieldGroup"),n(Ue,"props",{...p});var Pe=class extends c{setup(){Z({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return g("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};n(Pe,"template","nodexui.Field"),n(Pe,"props",{orientation:i(String),invalid:i(Boolean),label:i(String),labelBackground:i(String),description:i(String),useTip:i(Number),error:i(String),...p});var Kr=class extends c{get classNames(){return g("b-field-content",this.props.className)}};n(Kr,"template","nodexui.FieldContent"),n(Kr,"props",{...p});var qe=class extends c{get classNames(){return g("b-field-label",this.props.className)}};n(qe,"template","nodexui.FieldLabel"),n(qe,"props",{for:i(String),...p});var Vr=class extends c{get classNames(){return g("b-field-title",this.props.className)}};n(Vr,"template","nodexui.FieldTitle"),n(Vr,"props",{...p});var De=class extends c{get classNames(){return g("b-field-description",this.props.className)}};n(De,"template","nodexui.FieldDescription"),n(De,"props",{...p});var Gr=class extends c{get hasContent(){return!!this.props.slots?.default}get classNames(){return g("b-field-separator",this.props.className)}};n(Gr,"template","nodexui.FieldSeparator"),n(Gr,"props",{...p});var je=class extends c{get classNames(){return g("b-field-error",this.props.className)}};n(je,"template","nodexui.FieldError"),n(je,"props",{message:i(String),...p});function Oi(t){return`Icon${String(t).split("-").filter(Boolean).map(s=>s[0].toUpperCase()+s.slice(1)).join("")}`}q();_();var Zr=class extends c{get classNames(){return g("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};n(Zr,"template","nodexui.Label"),n(Zr,"props",{for:i(String),required:i(Boolean),state:i(String),...p});q();var wu="b-theme",Su="theme",Au="[b-theme-toggle]",Eu="[b-theme-label]";function Qn(t){return t==="dark"?"dark":"light"}function Cu(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function Lu(t,e=document.documentElement){let s=Qn(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(s):e&&(e.setAttribute("b-theme",s),e.setAttribute("data-bs-theme",s)),s}function sc(t,e,s){try{t.contentWindow?.NodexUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let o=new URL(t.getAttribute("src"),globalThis.location.href);o.searchParams.set(s,e),t.setAttribute("src",o.pathname+o.search+o.hash)}}function ku(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("nodexui:theme-change",{detail:{theme:t}}))}function ze(t={}){let e=t.storageKey||wu,s=t.queryKey||Su,o=t.toggleSelector??Au,r=t.labelSelector??Eu,a=t.root||(typeof document>"u"?null:document.documentElement);function l(){return Cu(s)}function u(){return Qn(l()||globalThis.localStorage?.getItem(e)||a?.getAttribute("b-theme")||"light")}function d(H){typeof document>"u"||!o||document.querySelectorAll(o).forEach(O=>{O.setAttribute("aria-pressed",H==="dark"?"true":"false");let D=r?O.querySelector(r):null;D&&(D.textContent=H==="dark"?"Light theme":"Dark theme")})}function b(H){typeof document>"u"||document.querySelectorAll("iframe").forEach(O=>sc(O,H,s))}function x(H,O={}){let D=Lu(H,a);return!O.skipStorage&&!l()&&globalThis.localStorage?.setItem(e,D),d(D),b(D),ku(D),D}function S(){return x(a?.getAttribute("b-theme")==="dark"?"light":"dark")}function I(){if(typeof document>"u")return u();let H=u();return x(H,{skipStorage:!!l()}),o&&document.addEventListener("click",O=>{O.target.closest?.(o)&&S()}),document.querySelectorAll("iframe").forEach(O=>{O.addEventListener("load",()=>sc(O,a?.getAttribute("b-theme")||H,s))}),H}return{current:u,set:x,toggle:S,syncFrames:b,init:I}}var Ii=ze();typeof window<"u"&&(window.NodexUITheme=Ii);_();_();un();var oc=["btn","b-theme-button",...Object.values(gt),...Object.values(yt)];function fn(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function Xn({variant:t="outline",size:e,className:s}={}){return g("btn","b-theme-button",gt[t]||gt.outline,yt[e],s)}var Zt=class extends c{setup(){this.theme=ze({storageKey:xt(this.props,"storage-key","storageKey")}),this.state=M({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},tt(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("nodexui:theme-change",this.onThemeChange)}),st(()=>document.removeEventListener("nodexui:theme-change",this.onThemeChange))}get iconName(){return fn(this.state.theme).icon}get baseUrl(){return xt(this.props,"base-url")}get label(){return fn(this.state.theme).label}get pressed(){return fn(this.state.theme).pressed}get classNames(){return Xn(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};n(Zt,"template","nodexui.ThemeButton"),n(Zt,"components",{Icon:et,Button:U}),n(Zt,"props",{variant:i(String),size:i(String),"base-url":i(String),"storage-key":i(String),storageKey:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});q();_();var Ns=class extends c{get classNames(){return g("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?mt(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};n(Ns,"template","nodexui.Toggle"),n(Ns,"components",{Button:U}),n(Ns,"props",{pressed:i(Boolean),state:i(String),variant:i(String),...p,onChange:i(Function)});q();_();var Jr=class extends c{setup(){this.state=M({selected:new Set}),Z({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let s=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(s)}};n(Jr,"template","nodexui.ToggleGroup"),n(Jr,"props",{multiple:i(Boolean),onChange:i(Function),...p});var Ts=class extends c{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};n(Ts,"template","nodexui.ToggleGroupItem"),n(Ts,"components",{Button:U}),n(Ts,"props",{value:{type:String},...p});q();_();q();_();si();function oi(t){let e=String(t??""),s=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!s)return{data:{},content:e};let o={};for(let r of s[1].split(/\r?\n/)){let a=r.trim();if(!a||a.startsWith("#"))continue;let l=a.indexOf(":");if(l===-1)continue;let u=a.slice(0,l).trim();u&&(o[u]=up(a.slice(l+1).trim()))}return{data:o,content:e.slice(s[0].length)}}function dc(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function up(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(s=>dc(s.trim())):[]}return dc(t)}var Jt=class extends c{setup(){this.rootRef=z("root"),this.editorRef=z("editor"),this.editorHandle=null,this.state=M({html:"",source:"",status:"loading",error:"",frontmatter:{}}),Tt(()=>this.load(this.props)),pt(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),tt(()=>this.afterRender()),ct(()=>this.afterRender()),He(()=>{this.destroyEditor(),this.rootRef.el&&gn(this.rootRef.el)})}get classNames(){return g("b-markdown",this.props.className)}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}try{this.state.source=s;let{data:o,content:r}=oi(s);this.state.frontmatter=o,this.state.html=Pn(await Tn(r)),this.state.status="ready"}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||On(e,{mermaid:this.props.mermaid!==!1,nodexUi:this.props.nodexUi!==!1})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await In({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"b-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,o,r)=>{this.state.source=s,this.props.onChange?.(s,o,r)}})}catch(s){this.state.status="error",this.state.error=s.message||String(s)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};n(Jt,"template","nodexui.Markdown"),n(Jt,"components",{Badge:Lt}),n(Jt,"props",{content:i(String),src:i(String),mermaid:i(Boolean),nodexUi:i(Boolean),editable:i(Boolean),collaborative:i(Boolean),room:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});var hc={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},pp=["POST","PUT","PATCH"];function Yr(t){try{return sessionStorage.getItem(t)||""}catch{return""}}function Rn(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function qi(){return!!(Yr("apikey")||Yr("oauthkey"))}function Pi(t){return t.example!==void 0?String(t.example):t.default!==void 0?String(t.default):t.enum?.length?String(t.enum[0]):t.type==="integer"||t.type==="number"?t.format==="int64"?"10":"1":t.type==="boolean"?"true":t.required&&t.in==="path"?"string":""}function Di(t,e){let s=Yr("apikey"),o=Yr("oauthkey");for(let r of t.security)r.type==="apiKey"&&r.in==="header"?e.header[r.name]=s:r.type==="apiKey"&&r.in==="query"?e.query[r.name]=s:r.type==="basic"?e.header.Authorization=s?`Basic ${s}`:"":(r.type==="oauth2"||r.type==="bearer")&&(e.header.Authorization=o?`Bearer ${o}`:"")}function mc(t,e){let s={baseUrl:e,path:{},query:{},header:{},bodyText:"",mimeType:t.consumes?.[0]||"application/json"};return t.parameters.path.forEach(o=>{s.path[o.name]=Pi(o)}),t.parameters.query.forEach(o=>{s.query[o.name]=o.required?Pi(o):""}),t.parameters.header.forEach(o=>{s.header[o.name]=o.required?Pi(o):""}),t.produces?.length&&(s.header.Accept=t.produces.includes("application/json")?"application/json":t.produces[0]),t.parameters.body&&(s.mimeType=t.parameters.body.contentType||s.mimeType,s.bodyText=ji(t.parameters.body.example)),Di(t,s),s}function ji(t){return typeof t=="string"?t:JSON.stringify(t,null,2)??""}function zi(t,e){let s=t.path;for(let[r,a]of Object.entries(e.path))s=s.replace(`{${r}}`,encodeURIComponent(a??""));let o=!!t.parameters.body&&pp.includes(t.method);return{method:t.method,url:`${e.baseUrl}${s}`,query:Object.entries(e.query).filter(([,r])=>r!==""),headers:Object.entries(e.header).filter(([,r])=>r!==""),bodyText:o?e.bodyText:"",mimeType:e.mimeType}}function bc(t){let e=t.query.length?`${t.url}?${new URLSearchParams(t.query)}`:t.url,s=Object.fromEntries(t.headers);return t.bodyText&&(s["Content-Type"]=s["Content-Type"]||t.mimeType),{url:e,headers:s,headerLines:Object.entries(s).map(([o,r])=>`${o}: ${r}`).join(`
49
- `)}}async function fc(t,e){let s=performance.now(),o=await fetch(e.url,{method:t.method,headers:e.headers,body:t.bodyText||void 0}),r=Math.round(performance.now()-s),a=await o.text();return{status:o.status,statusText:o.statusText,ms:r,headerLines:[...o.headers.entries()].map(([l,u])=>`${l}: ${u}`).join(`
50
- `),bodyText:dp(a)}}function dp(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function gc(t){let e=parseInt(t,10);return t==="default"||Number.isNaN(e)?"default":e<300?"2xx":e<400?"3xx":e<500?"4xx":"5xx"}function vc(t,e,s){if(!t)return"";try{let o=new URL(e),r=new URL(s.derivedBaseUrl||s.baseUrl||e),a=new URL(t,`${o.href.replace(/\/$/,"")}/`);return a.host===r.host&&(a.protocol=o.protocol,a.username=o.username,a.password=o.password,a.host=o.host),a.href}catch{return String(t)}}function xc(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function yc({def:t,clientId:e,scopes:s,state:o,redirectUri:r,baseUrl:a,doc:l}){let u=new URL(vc(t.authorizationUrl,a,l));return u.searchParams.set("response_type",t.flow==="implicit"?"token":"code"),e&&u.searchParams.set("client_id",e),u.searchParams.set("redirect_uri",r),s.length&&u.searchParams.set("scope",s.join(" ")),u.searchParams.set("state",o),u.toString()}async function wc(t,e,s,o){if(!t)throw new Error("No tokenUrl defined for this scheme.");let r=new URLSearchParams;for(let[u,d]of Object.entries(e))d&&r.set(u,d);let a=await fetch(vc(t,s,o),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:r.toString()}),l=await a.json().catch(()=>({}));if(!a.ok||!l.access_token)throw new Error(l.error_description||l.error||`HTTP ${a.status}`);return l.access_token}function Sc(t,e,s){let o={client_id:e.clientId,client_secret:e.clientSecret,scope:s.join(" ")};return t==="password"?{grant_type:"password",username:e.username,password:e.password,...o}:{grant_type:"client_credentials",...o}}var $c;function Gp(){return $c??($c=Promise.resolve().then(()=>(Bc(),Rc)))}var Zp=["curl","csharp","go","node","ruby","php"],Jp="(max-width: 1100px)";function _c(t){return t==="DELETE"?"DEL":t}function Yp(){let t=[...document.scripts].find(e=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(e.src));return t?`${t.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var Qt=class extends c{get children(){return this.props.groups.filter(e=>e.parent===this.props.group.name)}methodLabel(e){return _c(e)}};n(Qt,"template","nodexui.ApiDocGroup"),n(Qt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});Qt.components={ApiDocGroup:Qt,Icon:et};var Yt=class extends c{setup(){this.rootRef=z("root"),this.mainRef=z("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.overlayQuery=window.matchMedia(Jp),this.state=M({status:"loading",error:"",current:"introduction",lang:this.props.language||"curl",sidebarOpen:!this.overlayQuery.matches,systemTheme:"light",themeOverride:"",drafts:{},snippet:"",result:null,respTab:0,respView:{},authOpen:!1,authed:qi(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=e=>this.closeSidebarOnOutsideClick(e),this.onOAuthMessage=e=>this.handleOAuthMessage(e),this.onThemeChange=()=>this.readSystemTheme(),Tt(()=>this.load(this.props)),pt(e=>this.shouldReload(e)?this.load(e):void 0),tt(()=>this.addListeners()),He(()=>this.removeListeners())}get classNames(){return g("b-apidoc",this.props.className)}get rootStyle(){return ft(this.props.height?`--b-apidoc-height:${this.props.height}`:"",this.props.style)}get theme(){return(this.props.theme==="light"||this.props.theme==="dark"?this.props.theme:"")||this.state.themeOverride||this.state.systemTheme}get title(){return this.props.title||this.doc?.info.title||"API Documentation"}get tryItEnabled(){return this.props.tryIt!==!1}get hasSecurity(){return this.props.authorize!==!1&&Object.keys(this.doc?.securityDefinitions||{}).length>0}get languages(){let e=this.logic?.LANGUAGES||[],s=this.props.languages;return s?.length?e.filter(o=>s.includes(o.id)):e}get currentLanguage(){return this.languages.find(e=>e.id===this.state.lang)||this.languages[0]}get op(){return this.state.current==="introduction"?null:this.doc.findOperation(this.state.current)}get draft(){return this.state.drafts[this.state.current]}get showTryIt(){return this.tryItEnabled&&!!this.op}get sidebarGroups(){let e=this.doc.groups.filter(s=>!s.parent);return this.doc.webhooks.length&&e.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),e}get breadcrumb(){let e=this.op;if(!e)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let s=this.doc.groups.find(o=>o.name===e.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:e.tag,id:s?s.items[0].id:"introduction"},{label:e.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([e,s])=>({key:e,def:s,scopes:Object.entries(s.scopes||{})}))}get serverOptions(){return this.doc.servers.length?this.doc.servers:[{url:this.doc.baseUrl,name:"",description:""}]}get tryItParams(){let{path:e,query:s,header:o}=this.op.parameters;return[...e.map(r=>({...r,group:"path"})),...s.map(r=>({...r,group:"query"})),...o.map(r=>({...r,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}methodLabel(e){return _c(e)}statusClass(e){return gc(e)}formatExample(e){return ji(e)}serverLabel(e){let s=[e.name,e.description].filter(Boolean).join(" \u2014 ");return s?`${s} (${e.url})`:e.url}languageTone(e){return Zp.includes(e)?e:"default"}encodingEntries(e){return Object.entries(e)}oauthFlowLabel(e){return hc[e]||e||"unknown"}schemaRows(e){return this.rowsCache.has(e)||this.rowsCache.set(e,this.doc.schemaRows(e)),this.rowsCache.get(e)}depth(e){return(e.match(/\./g)||[]).length}lineNumbers(e){return String(e||"").split(`
51
- `).map((s,o)=>o+1)}iconUrl(e){let s=this.props.assetBase??this.assetBase??(this.assetBase=Yp());return s?`${s.replace(/\/$/,"")}/${e.icon}`:""}href(e){return this.props.hash?`#/${e}`:"#"}shouldReload(e){return e.src!==this.props.src||e.spec!==this.props.spec||e.serverUrl!==this.props.serverUrl}async load(e){this.state.status="loading";try{this.logic=await Gp(),this.doc=e.spec?this.logic.buildOpenApiDoc(e.spec,e.serverUrl):await this.logic.loadOpenApiDoc(e.src,e.serverUrl)}catch(s){this.state.status="error",this.state.error=s.message||String(s),e.onError?.(s);return}this.state.drafts={},this.state.current=this.routeId(e),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),e.onLoad?.(this.doc)}routeId(e=this.props){let s=e.hash?location.hash.replace(/^#\//,""):e.operation;return s&&this.doc.findOperation(s)?s:"introduction"}go(e,s){this.props.hash||(e.preventDefault(),this.setCurrent(s)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(e){let s=this.state;s.current=e,s.result=null,s.respTab=0,s.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(e)}ensureDraft(){let e=this.op;e&&!this.state.drafts[e.id]&&(this.state.drafts[e.id]=mc(e,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(e){!this.overlayQuery.matches||!this.state.sidebarOpen||e.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(e){this.state.respTab=Number(e)}setResponseView(e,s){this.state.respView[e]=s}setLanguage(e){this.state.lang=e,this.updateSnippet()}onBaseUrl(e){this.draft.baseUrl=e,this.updateSnippet()}onParam(e,s,o){this.draft[s][o]=e,this.updateSnippet()}onBody(e){this.draft.bodyText=e,this.updateSnippet()}async updateSnippet(){let e=this.op;if(!e||!this.tryItEnabled)return;let s=this.currentLanguage;try{this.state.snippet=await this.logic.generateSnippet(s.id,zi(e,this.draft))}catch(o){this.state.snippet=`// Could not generate ${s.label} snippet: ${o.message}`}}async send(){let e=this.op,s=zi(e,this.draft),o=bc(s),r={method:s.method,url:o.url,headerLines:o.headerLines,bodyText:s.bodyText};this.state.result={phase:"sending",sent:r};let a;try{a={phase:"done",sent:r,res:await fc(s,o)}}catch(l){a={phase:"error",sent:r,message:l.message}}this.state.current===e.id&&(this.state.result=a)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((e,s)=>{s<3&&(e.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let e=document.documentElement.getAttribute("data-bs-theme"),s=e?e==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=s?"dark":"light"}openAuth(){var s;let e=this.state;e.stored.apikey=Yr("apikey"),e.stored.oauthkey=Yr("oauthkey"),e.inputs.apikey=e.stored.apikey,e.inputs.oauthkey=e.stored.oauthkey;for(let{key:o,def:r}of this.authSchemes)(s=e.oauth)[o]??(s[o]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(r.scopes||{})});e.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(e){this.state.authOpen=e}setAuthInput(e,s){this.state.inputs[e]=s}setField(e,s,o){e[s]=o}saveAuth(){Rn("apikey",this.state.inputs.apikey.trim()),Rn("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(e){Rn(e,""),this.state.stored[e]="",this.state.inputs[e]="",this.applyAuthToAll()}applyAuthToAll(){for(let[e,s]of Object.entries(this.state.drafts))Di(this.doc.findOperation(e),s);this.state.authed=qi(),this.updateSnippet()}toggleScope(e,s){let o=this.state.oauth[e].scopes,r=o.indexOf(s);r<0?o.push(s):o.splice(r,1)}setOAuthStatus(e,s,o=!1){this.state.oauthStatus[e]={message:s,isError:o}}applyOAuthToken(e,s,o){Rn("oauthkey",s),this.state.stored.oauthkey=s,this.state.inputs.oauthkey=s,Object.assign(this.state.oauth[e],{clientId:o.clientId,clientSecret:o.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(e,"Token acquired.")}async fetchToken(e,s,o){try{let r=await wc(this.doc.securityDefinitions[e].tokenUrl,s,this.selectedBaseUrl,this.doc);this.applyOAuthToken(e,r,o)}catch(r){this.setOAuthStatus(e,`Token request failed: ${r.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(e){let s=this.doc.securityDefinitions[e],o=this.state.oauth[e],r=[...o.scopes];if(s.flow==="implicit"||s.flow==="accessCode")return this.openOAuthPopup(e,s,o,r);if(s.flow==="password"||s.flow==="application")return this.setOAuthStatus(e,"Requesting token\u2026"),this.fetchToken(e,Sc(s.flow,o,r),o);this.setOAuthStatus(e,`Unsupported OAuth2 flow: ${s.flow}`,!0)}openOAuthPopup(e,s,o,r){if(!s.authorizationUrl)return this.setOAuthStatus(e,"No authorizationUrl defined for this scheme.",!0);let a=xc(),l=yc({def:s,clientId:o.clientId,scopes:r,state:a,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),u=window.open(l,`oauth2-authorize-${e}`,"width=560,height=680");if(!u)return this.setOAuthStatus(e,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(a,{key:e,flow:s.flow,fields:{...o}}),this.setOAuthStatus(e,"Waiting for authorization in the popup\u2026"),this.watchPopup(u,a,e)}watchPopup(e,s,o){let r=setInterval(()=>{e.closed&&(clearInterval(r),this.watchers.delete(r),this.pendingOAuth.delete(s)&&this.setOAuthStatus(o,"Authorization window was closed before completing.",!0))},500);this.watchers.add(r)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(e){let s=e.data;if(e.origin!==window.location.origin||s?.source!=="oauth2-redirect")return;let o=this.pendingOAuth.get(s.state);if(!o)return;this.pendingOAuth.delete(s.state);let{key:r,flow:a,fields:l}=o;if(s.error)return this.setOAuthStatus(r,`Authorization failed: ${s.error}${s.errorDescription?" - "+s.errorDescription:""}`,!0);if(a==="implicit")return s.accessToken?this.applyOAuthToken(r,s.accessToken,l):this.setOAuthStatus(r,"Authorization server did not return an access token.",!0);if(!s.code)return this.setOAuthStatus(r,"Authorization server did not return a code.",!0);this.setOAuthStatus(r,"Exchanging code for token\u2026"),this.fetchToken(r,{grant_type:"authorization_code",code:s.code,redirect_uri:this.redirectUri,client_id:l.clientId,client_secret:l.clientSecret},l)}addListeners(){this.readSystemTheme(),this.themeObserver=new MutationObserver(this.onThemeChange),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),window.addEventListener("hashchange",this.onHashChange),window.addEventListener("message",this.onOAuthMessage),document.addEventListener("click",this.onDocumentClick),this.overlayQuery.addEventListener("change",this.onViewportChange)}removeListeners(){this.themeObserver?.disconnect(),window.removeEventListener("hashchange",this.onHashChange),window.removeEventListener("message",this.onOAuthMessage),document.removeEventListener("click",this.onDocumentClick),this.overlayQuery.removeEventListener("change",this.onViewportChange),this.watchers.forEach(clearInterval)}};n(Yt,"template","nodexui.ApiDoc"),n(Yt,"components",{ApiDocGroup:Qt,Markdown:Jt,Badge:Lt,Breadcrumb:Ne,BreadcrumbItem:Oe,BreadcrumbLink:Ie,BreadcrumbList:Te,BreadcrumbPage:Re,BreadcrumbSeparator:Wt,Button:U,Checkbox:Se,Dialog:me,DialogContent:jt,DialogDescription:ve,DialogFooter:fe,DialogHeader:be,DialogTitle:ge,Icon:et,Input:le,NativeSelect:we,TabContent:he,Tabs:ue,TabsContainer:pe,TabsList:de,TabTrigger:Dt,Textarea:ye}),n(Yt,"props",{src:i(String),spec:i(Object),title:i(String),serverUrl:i(String),theme:i(String),themeToggle:i(Boolean),hash:i(Boolean),operation:i(String),tryIt:i(Boolean),authorize:i(Boolean),languages:i(Array),language:i(String),assetBase:i(String),oauthRedirectUri:i(String),height:i(String),onLoad:i(Function),onError:i(Function),onNavigate:i(Function),className:i(String),style:i([String,Object])});q();_();function ci(t,e){if(!t)return null;if(t.type==="file"&&(t.path===e||t.meta?.slug===e))return t;for(let s of t.children||[]){let o=ci(s,e);if(o)return o}return null}function Qp(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(s=>s.charAt(0).toUpperCase()+s.slice(1)).join(" ")}var xn=class xn extends c{get label(){let e=this.props.node.meta;return e?.sidebar_label||e?.title||Qp(this.props.node.name)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};n(xn,"template","nodexui.MarkdownTreeNode"),n(xn,"components",{MarkdownTreeNode:xn,Icon:et,SidebarGroupLabel:_e,SidebarMenu:Gt,SidebarMenuItem:Me,SidebarMenuButton:Kt,DropdownMenu:Ae,DropdownMenuTrigger:zt,DropdownMenuContent:Ee,DropdownMenuItem:Ce,DropdownMenuSub:Le,DropdownMenuSubTrigger:Ft,DropdownMenuSubContent:ke}),n(xn,"props",{node:{type:Object},activePath:i(String),onSelect:{type:Function},nested:i(Boolean)});var yn=xn,Os=class extends c{setup(){this.state=M({tree:null,status:"loading",error:""}),Tt(()=>this.load())}async load(){this.state.status="loading",this.state.error="";try{let e=await fetch(this.props.src);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);this.state.tree=await e.json(),this.state.status="ready"}catch(e){this.state.status="error",this.state.error=e.message||String(e)}}};n(Os,"template","nodexui.MarkdownTree"),n(Os,"components",{MarkdownTreeNode:yn,SidebarGroup:$e,SidebarMenu:Gt}),n(Os,"props",{src:{type:String},activePath:i(String),onSelect:{type:Function},className:i(String),style:i([String,Object])});q();function Mc(t=document.querySelector("[b-block-code-template]")){let o=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
52
- `),r=o.filter(l=>l.trim()).map(l=>l.match(/^\s*/)?.[0].length||0),a=r.length?Math.min(...r):0;return o.map(l=>l.slice(a)).join(`
53
- `)}function Uc(t,e=0){let s=" ".repeat(e),o=[];for(let r of t.childNodes){if(r.nodeType===Node.TEXT_NODE){let u=r.textContent.trim();u&&o.push(`${s}${u}`);continue}if(r.nodeType!==Node.ELEMENT_NODE)continue;let a=[...r.attributes].map(u=>` ${u.name}="${u.value}"`).join("");if(![...r.childNodes].some(u=>u.nodeType===Node.ELEMENT_NODE||u.nodeType===Node.TEXT_NODE&&u.textContent.trim())){o.push(`${s}<${r.localName}${a}>${r.textContent.trim()}</${r.localName}>`);continue}o.push(`${s}<${r.localName}${a}>`),o.push(...Uc(r,e+1)),o.push(`${s}</${r.localName}>`)}return o}async function Pc(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:s,normalizeOwlPreviewMarkup:o}=await Promise.resolve().then(()=>(si(),pc)),r=document.createElement("div");return r.innerHTML=e(t),o(r,s(t)),Uc(r).join(`
54
- `)}function qc(t){t.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(e=>{let s=e.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),o=e.querySelector("[b-block-sidebar]");!s||!o||(e.setAttribute("b-att-sidebar",e.getAttribute("b-att-sidebar")||"open"),s.setAttribute("b-block-sidebar-toggle",""),s.setAttribute("aria-expanded",e.getAttribute("b-att-sidebar")==="open"?"true":"false"),s.addEventListener("click",()=>{let r=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",r?"open":"collapsed"),s.setAttribute("aria-expanded",r?"true":"false")}))}),t.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(e=>{let s=e.previousElementSibling;s&&(s.setAttribute("b-block-subnav-toggle",""),s.setAttribute("aria-expanded","true"),e.setAttribute("b-att-state","open"),s.addEventListener("click",o=>{o.preventDefault();let r=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",r?"open":"collapsed"),s.setAttribute("aria-expanded",r?"true":"false")}))})}_();var li=ze({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),Xp=[{key:"docs",label:"Docs",href:"/docs"},{key:"icons",label:"Icons",href:"/docs/icons"},{key:"examples",label:"Examples",href:"/examples/index.html"},{key:"blocks",label:"Blocks",href:"/blocks"}],td={desktop:"",tablet:"768px",mobile:"390px"},ed="/dist/icons/lucide";function sd(){return document.querySelector("[b-block-code-template]")}function od(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function rd(t){for(let e of t.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!e.hasAttribute("b-icon-base-url")&&!e.hasAttribute("b-att-base-url")&&e.setAttribute("b-icon-base-url",ed)}var Is=class extends c{setup(){this.navItems=this.props.navItems||Xp,this.previewFrame=z("previewFrame"),this.embedRoot=z("embedRoot"),this.code=Mc(),this.state=M({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),tt(()=>this.mountPreview()),ct(()=>this.mountStaticNodexUI())}get activeCode(){return this.state.codeVariant==="template"?this.state.staticTemplateStatus==="ready"?this.state.staticTemplate:"Converting to a static template...":this.code}async setCodeVariant(e){if(this.state.codeVariant=e,e==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let s=await Pc(this.code);this.state.staticTemplate=s,this.state.staticTemplateStatus="ready"}}get title(){return document.body.dataset.blockTitle||document.title||"Block"}get description(){return document.body.dataset.blockDescription||"Preview and copy this NodexUI block."}get previewStyle(){let e=td[this.state.viewport]||"";return e?`max-width:${e}`:""}setMode(e){this.state.mode=e}setViewport(e){this.state.viewport=e}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let e=this.state.embed?this.embedRoot.el:this.previewFrame.el,s=sd();if(!(!e||!s)){if(s.tagName==="SCRIPT"){this.mountOwlPreview(e,s);return}e.replaceChildren(s.content.cloneNode(!0)),this.mountStaticNodexUI(e),qc(e)}}async mountOwlPreview(e,s){e.replaceChildren();class o extends c{setup(){this.state=M({collapsed:!1})}}n(o,"template","examples.SidebarBlock");let r=[await Fe("/dist/nodexui.templates.xml"),s.textContent].map(od).join(`
55
- `);await Ps(o,e,{templates:`<templates>${r}</templates>`}),li.set(li.current(),{skipStorage:!0})}mountStaticNodexUI(e=document){rd(e),globalThis.thebase?.mountAll(e),li.set(li.current(),{skipStorage:!0})}};n(Is,"template","nodexui.BlockViewer"),n(Is,"components",{Button:U,Icon:et,ThemeButton:Zt}),n(Is,"props",{navItems:i(Array)});q();_();var Qr=class extends c{setup(){this.pwaState=M({open:ut(this.props)}),Z({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),St(this.pwaState)}setOpen(e){At(this.props,this.pwaState,e)}};n(Qr,"template","nodexui.Pwa"),n(Qr,"props",{open:i(Boolean),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Rs=class extends c{onClick(){this.env.setPwaOpen(!0)}};n(Rs,"template","nodexui.PwaTrigger"),n(Rs,"components",{Button:U}),n(Rs,"props",p);var Xr=class extends c{setup(){this.rootRef=z("root"),Ct(e=>{if(!e)return;let s=document.activeElement;return hn(this.rootRef.el)[0]?.focus(),()=>s?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};n(Xr,"template","nodexui.PwaContent"),n(Xr,"props",p);var tn=class extends c{};n(tn,"template","nodexui.PwaHeader"),n(tn,"props",p);var en=class extends c{};n(en,"template","nodexui.PwaTitle"),n(en,"props",p);var sn=class extends c{};n(sn,"template","nodexui.PwaDescription"),n(sn,"props",p);var on=class extends c{};n(on,"template","nodexui.PwaBody"),n(on,"props",p);var rn=class extends c{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};n(rn,"template","nodexui.PwaSteps"),n(rn,"props",{...p,steps:i(Array)});var nn=class extends c{};n(nn,"template","nodexui.PwaFooter"),n(nn,"props",p);var Bs=class extends c{onClick(){this.env.setPwaOpen(!1)}};n(Bs,"template","nodexui.PwaClose"),n(Bs,"components",{Button:U}),n(Bs,"props",p);q();_();var Dc="",jc="";function zc(t,e){return typeof t=="string"?t:e}function nd(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var $s=class extends c{setup(){this.state=M({title:zc(this.props.title,Dc),description:zc(this.props.description,jc),submitted:!1})}get classNames(){return g("b-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return nd(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=Dc,this.state.description=jc,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};n($s,"template","nodexui.Form"),n($s,"components",{Button:U,Field:Pe,FieldDescription:De,FieldError:je,FieldGroup:Ue,FieldLabel:qe}),n($s,"props",{title:i(String),description:i(String),titlePlaceholder:i(String),descriptionPlaceholder:i(String),maxDescriptionLength:i(Number),className:i(String),style:i([String,Object]),onSubmit:i(Function)});q();_();var Yi;function id(){return Yi??(Yi=import("./runtime/milkdown/milkdown-text-editor.js")),Yi}async function ui(t){return(await id()).createMilkdownTextEditor(t)}function pi({collaborative:t,providerType:e,url:s}={}){return!!t||!!(e&&s)}var an=class extends c{setup(){this.editorRef=z("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=M({content:"",status:"loading",error:""}),Tt(()=>this.load(this.props)),pt(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),tt(()=>this.mountEditor()),ct(()=>this.mountEditor()),He(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return g("b-text-editor",this.props.className)}get isCollaborative(){return pi({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let s=e.content??"";if(e.src)try{let o=await fetch(e.src);if(!o.ok)throw new Error(`${o.status} ${o.statusText}`);s=await o.text()}catch(o){this.state.status="error",this.state.error=o.message||String(o);return}this.state.content=s,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let s=++this.mountToken;return this.mountPromise=(async()=>{try{let o=await ui({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"b-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(r,a,l)=>{this.state.content=r,this.props.onChange?.(r,a,l)}});if(s!==this.mountToken){o.destroy?.();return}this.editorHandle=o}catch(o){s===this.mountToken&&(this.state.status="error",this.state.error=o.message||String(o))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};n(an,"template","nodexui.TextEditor"),n(an,"props",{content:i(String),src:i(String),placeholder:i(String),collaborative:i(Boolean),provider:i(String),room:i(String),url:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});j();function ad(t){let{open:e,close:s,destroy:o}=Zn(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.NodexUIAlertDialog={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIAlertDialog}}}m.register("alert-dialog",{type:"owl",mount:ad});j();var Qi={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"};function cd(t){t.classList.add("alert","b-alert",Qi[t.getAttribute("b-att-variant")||"default"]||Qi.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let o=document.createElement("button");o.type="button",o.className="btn-close",o.setAttribute("data-bs-dismiss","alert"),o.setAttribute("aria-label","Close"),t.appendChild(o)}e=new(G()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","b-alert","alert-dismissible","fade","show",...Object.values(Qi))}}}m.register("alert",{type:"static",mount:cd});q();j();function Fc(t,e){return t.getAttribute(e)!=="false"}function ld(t){let e=t.getAttribute("b-att-templates");if(e)return e;let s=[...document.scripts].find(o=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(o.src));return s?s.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"nodexui.templates.xml"):"/dist/nodexui.templates.xml"}function ud(t){let e=(o,r)=>t.dispatchEvent(new CustomEvent(`nodexui:${o}`,{bubbles:!0,detail:r})),s=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:Fc(t,"b-att-try-it"),authorize:Fc(t,"b-att-authorize"),languages:s?s.split(",").map(o=>o.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:o=>e("load",{info:o.info,operations:o.groups.flatMap(r=>r.items).length}),onError:o=>e("error",{error:o}),onNavigate:o=>e("navigate",{id:o})}}function pd(t){let e=ud(t),s=Fe(ld(t)).then(o=>Ps(Yt,t,{templates:o,props:e}));return{destroy:async()=>{(await s).destroy()}}}m.register("apidoc",{type:"owl",mount:pd});j();function dd(t){let e=[...t.querySelectorAll("[b-accordion-item]")],s=t.getAttribute("b-att-multiple")==="true",o=new Map,r=new Map,a=new Map,l=(u,d)=>{let b=u.querySelector("[b-accordion-trigger]");u.setAttribute("b-att-state",d?"open":"closed"),b?.setAttribute("aria-expanded",String(d)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:d}}))};return t.setAttribute("role","presentation"),t.classList.add("accordion"),e.forEach((u,d)=>{let b=u.querySelector("[b-accordion-trigger]"),x=u.querySelector("[b-accordion-panel]");if(!x)return;u.classList.add("accordion-item"),b?.classList.add("accordion-button"),x.classList.add("accordion-collapse");let S=x.id||`b-accordion-panel-${d}`;x.id=S;let I=u.getAttribute("b-att-state")==="open";x.classList.add("collapse"),I&&x.classList.add("show");let H=new(G()).Collapse(x,{toggle:!1});a.set(u,H);let O=()=>l(u,!0),D=()=>l(u,!1);x.addEventListener("shown.bs.collapse",O),x.addEventListener("hidden.bs.collapse",D),r.set(u,{onShown:O,onHidden:D}),b?.setAttribute("aria-expanded",String(I)),b?.setAttribute("aria-controls",S);let V=()=>{let rt=x.classList.contains("show");!s&&!rt&&e.forEach(A=>{if(A===u)return;let P=a.get(A),N=A.querySelector("[b-accordion-panel]");P&&N?.classList.contains("show")&&P.hide()}),rt?H.hide():H.show()};o.set(u,V),b?.addEventListener("click",V)}),{destroy:()=>{e.forEach(u=>{let d=u.querySelector("[b-accordion-trigger]"),b=u.querySelector("[b-accordion-panel]");d?.removeEventListener("click",o.get(u));let x=r.get(u);b&&x&&(b.removeEventListener("shown.bs.collapse",x.onShown),b.removeEventListener("hidden.bs.collapse",x.onHidden)),a.get(u)?.dispose()}),o.clear(),r.clear(),a.clear()}}}m.register("accordion",{type:"owl",mount:dd});j();function hd(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("b-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("b-aspect-ratio")}}m.register("aspect-ratio",{type:"static",mount:hd});j();un();var md=["idle","uploading","processing","error","done"],bd=["default","sm","xs"],fd=["content","title","description","actions"];function Hc(t,e){t.classList.add(`b-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function gd(t){let e=t.querySelector("input[type='file']"),s=t.querySelector("[b-attachment-list]"),o=md.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",r=bd.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",a=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("b-attachment"),t.classList.add(`b-attachment-${o}`,`b-attachment-${r}`,`b-attachment-${a}`),t.setAttribute("data-state",o),t.setAttribute("data-size",r),t.setAttribute("data-orientation",a),t.setAttribute("data-slot","attachment"),e&&t.classList.add("b-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(u=>{let d=u.getAttribute("b-att-variant")==="image"?"image":"icon";Hc(u,"media"),u.classList.add(`b-attachment-media-${d}`),u.setAttribute("data-variant",d)}),fd.forEach(u=>t.querySelectorAll(`[b-attachment-${u}]`).forEach(d=>Hc(d,u))),t.querySelectorAll("[b-attachment-action]").forEach(u=>{let d=gt[u.getAttribute("b-att-variant")]||gt.ghost,b=yt[u.getAttribute("b-att-size")]||yt["icon-xs"];u.classList.add("btn","b-button",d,b,"b-button-icon","b-attachment-action"),u.setAttribute("data-slot","attachment-action"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(u=>{u.classList.add("b-attachment-trigger"),u.setAttribute("data-slot","attachment-trigger"),!u.getAttribute("type")&&u.tagName==="BUTTON"&&u.setAttribute("type","button")}),e?.classList.add("form-control");let l=()=>{s&&(s.innerHTML=[...e.files].map(u=>`<li>${u.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",l),{destroy:()=>e?.removeEventListener("change",l)}}function vd(t){return t.classList.add("b-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("b-attachment-group")}}function xd(t){let e=t.querySelector("input[type='file']");t.classList.add("b-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let s=()=>e?.click(),o=d=>{d.preventDefault(),t.classList.add("b-attachment-dropzone-dragging")},r=()=>t.classList.remove("b-attachment-dropzone-dragging"),a=d=>{d.length&&t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:d}}))},l=d=>{d.preventDefault(),t.classList.remove("b-attachment-dropzone-dragging"),a([...d.dataTransfer?.files??[]])},u=()=>{a([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",s),t.addEventListener("dragover",o),t.addEventListener("dragleave",r),t.addEventListener("drop",l),e?.addEventListener("change",u),{destroy:()=>{t.removeEventListener("click",s),t.removeEventListener("dragover",o),t.removeEventListener("dragleave",r),t.removeEventListener("drop",l),e?.removeEventListener("change",u)}}}m.register("attachment",{type:"owl",mount:gd});m.register("attachment-group",{type:"static",mount:vd});m.register("attachment-dropzone",{type:"static",mount:xd});j();function yd(t){t.classList.add("b-avatar");let e=t.querySelector("img"),s=t.querySelector("[b-avatar-fallback]");if(e&&s){let o=()=>{e.hidden=!0,s.hidden=!1};return s.hidden=!!e.getAttribute("src"),e.addEventListener("error",o),{destroy:()=>e.removeEventListener("error",o)}}return{}}m.register("avatar",{type:"static",mount:yd});j();function wd(t){let e=zs[t.getAttribute("b-att-variant")||"secondary"]||zs.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(zs))}}m.register("badge",{type:"static",mount:wd});j();Mt();function Wc(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .b-breadcrumb-separator"))}function Vc(t,e,s){return dt(t,e,{size:s}),t}function Sd(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="b-breadcrumb-separator",e.className="b-breadcrumb-separator-icon",t.append(Vc(e,"chevron-right","var(--b3_5)")),t}function Ad(t){t.classList.add("b-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function Ed(t){if(t.classList.add("b-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".b-icon")){let e=document.createElement("span");e.className="b-breadcrumb-ellipsis-icon",t.prepend(Vc(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function Kc(t){t.classList.add("b-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function Cd(t){let e=t.querySelector("ol, ul")||t;t.classList.add("b-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","b-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator], .b-breadcrumb-separator"))Ad(o);for(let o of e.querySelectorAll("[b-breadcrumb-ellipsis], .b-breadcrumb-ellipsis"))Ed(o);for(let o of e.querySelectorAll("[b-breadcrumb-page], .b-breadcrumb-page"))Kc(o);e.querySelector("[b-breadcrumb-separator], .b-breadcrumb-separator")||Wc(e).slice(0,-1).forEach(r=>r.after(Sd()));let s=Wc(e);return s.forEach((o,r)=>{o.classList.add("b-breadcrumb-item"),o.setAttribute("data-slot",o.getAttribute("data-slot")||"breadcrumb-item");for(let a of o.querySelectorAll("a"))a.classList.add("b-breadcrumb-link"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-link");if(r===s.length-1){let a=o.querySelector("[b-breadcrumb-page], .b-breadcrumb-page");a?Kc(a):(o.classList.add("b-breadcrumb-page"),o.setAttribute("aria-current",o.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("b-breadcrumb"),e.classList.remove("breadcrumb","b-breadcrumb-list");for(let o of e.querySelectorAll("[b-breadcrumb-separator]"))o.remove()}}}m.register("breadcrumb",{type:"owl",mount:Cd});j();function Ld(t){return t.classList.add("b-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("b-bubble")}}m.register("bubble",{type:"static",mount:Ld});j();Mt();un();function kd(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let s=document.createElement("span");return s.textContent=e.textContent.trim(),e.replaceWith(s),s})}function Nd(t){let e=t.getAttribute("b-att-icon"),s=t.getAttribute("b-att-icon-position")==="end"?"end":"start",o=!!t.textContent.trim(),r=e&&o?kd(t):[],a=null;return t.classList.add("btn","b-button",gt[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),yt[t.getAttribute("b-att-size")]&&t.classList.add(yt[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(a=document.createElement("span"),a.setAttribute("b-icon",e),a.dataset.icon=`inline-${s}`,dt(a,e,{label:""}),t.insertBefore(a,s==="end"?null:t.firstChild),t.dataset.icon=`inline-${s}`,o||(t.dataset.iconOnly="true",t.classList.add("b-button-icon"))),{destroy:()=>{a?.remove();for(let l of r)l.replaceWith(document.createTextNode(l.textContent));t.classList.remove("btn","b-button","b-button-icon",...Object.values(gt),...Object.values(yt)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}m.register("button",{type:"static",mount:Nd});j();function Td(t){let e=t.getAttribute("b-att-orientation")==="vertical",s=t.getAttribute("b-att-size"),o=[...t.querySelectorAll("[b-button-group-separator]")],r=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("b-button-group",e?"btn-group-vertical":"btn-group"),(s==="sm"||s==="lg")&&t.classList.add(`btn-group-${s}`),t.setAttribute("role",t.getAttribute("role")||"group"),o.forEach(a=>{let l=a.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";a.classList.add("b-button-group-separator",`b-button-group-separator-${l}`),a.setAttribute("data-orientation",l),a.setAttribute("role","separator")}),r.forEach(a=>{a.classList.add("b-button-group-text")}),{destroy:()=>{t.classList.remove("b-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}m.register("button-group",{type:"static",mount:Td});j();var Od=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function Id(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,s=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,o=Number(t.getAttribute("b-att-year")??e.getFullYear()),r=new Date(o,s,1),a=new Date(o,s+1,0).getDate(),l=r.getDay();t.classList.add("b-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
56
- <div class="b-calendar__header">${Od.format(r)}</div>
57
- <div class="b-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(b=>`<span>${b}</span>`).join("")}</div>
41
+ `).length}get lineLabel(){return`${this.lineCount} ${this.lineCount===1?"line":"lines"}`}get lineNumbers(){return Array.from({length:this.lineCount},(e,o)=>o+1).join(`
42
+ `)}commit(e){(this.state.text!==null||!this.props.onChange)&&(this.state.text=e),this.props.onChange?.(e)}async loadUrl(e){if(this.controller?.abort(),!!e){this.controller=new globalThis.AbortController,this.state.loading=!0,this.state.error="";try{let o=await fetch(e,{signal:this.controller.signal});if(!o.ok)throw new Error(`Could not load ${e} (HTTP ${o.status})`);this.setFile(await o.text(),e)}catch(o){o.name!=="AbortError"&&this.fail(o)}this.state.loading=!1}}syncInput(){let e=this.input.el;if(!e||e.value===this.code)return;let{selectionStart:o,selectionEnd:r}=e;e.value=this.code,e.setSelectionRange(Math.min(o,this.code.length),Math.min(r,this.code.length))}toggleEditing(){this.state.editing=!this.state.editing}format(){try{this.commit(Va(this.code,this.codeLang)),this.state.error=""}catch(e){this.fail(e)}}openPicker(){this.fileInput.el.click()}async onFileChange(e){let o=e.target.files[0];if(e.target.value="",!!o)try{this.setFile(await o.text(),o.name)}catch(r){this.fail(r)}}setFile(e,o){Object.assign(this.state,{text:e,name:o,error:""}),this.props.onLoad?.({code:e,name:o})}fail(e){this.state.error=e.message,this.props.onError?.(e)}onInput(e){this.commit(e.target.value),this.revealCaret(e.target)}revealCaret(e){let o=e.closest(".b-code-editor-box");if(!o||!e.isConnected)return;let r=getComputedStyle(e),s=parseFloat(r.paddingTop)||0,a=parseFloat(r.lineHeight)||21,c=e.value.slice(0,e.selectionEnd),l=c.split(`
43
+ `).length-1,d=s+l*a;d-s<o.scrollTop?o.scrollTop=Math.max(0,d-s):d+a+s>o.scrollTop+o.clientHeight&&(o.scrollTop=d+a+s-o.clientHeight);let f=c.slice(c.lastIndexOf(`
44
+ `)+1).replaceAll(" "," ".repeat(4)).length,v=this.measure??(this.measure=document.createElement("canvas").getContext("2d"));if(!v)return;v.font=`${r.fontSize} ${r.fontFamily}`;let O=e.offsetLeft+parseFloat(r.paddingLeft)+f*v.measureText("0").width,k=o.querySelector(".b-code-editor-gutter")?.offsetWidth??0;O<o.scrollLeft+k?o.scrollLeft=Math.max(0,O-k-s):O+s>o.scrollLeft+o.clientWidth&&(o.scrollLeft=O+s-o.clientWidth)}onKeydown(e){let o=e.target;if(requestAnimationFrame(()=>this.revealCaret(o)),e.key==="F"&&e.shiftKey&&e.altKey&&this.showFormat){e.preventDefault(),this.format();return}if(e.key==="Escape"){this.tabReleased=!0;return}let r=this.tabReleased;if(this.tabReleased=!1,e.key==="Tab"&&!r)e.preventDefault(),e.shiftKey?this.outdentLine(o):o.setRangeText(this.language.indent,o.selectionStart,o.selectionEnd,"end");else if(e.key==="Enter"&&!e.shiftKey&&!e.ctrlKey&&!e.metaKey&&!e.altKey){e.preventDefault();let s=o.value.lastIndexOf(`
45
+ `,o.selectionStart-1)+1,a=/^[ \t]*/.exec(o.value.slice(s,o.selectionStart))[0];o.setRangeText(`
46
+ ${a}`,o.selectionStart,o.selectionEnd,"end")}else return;this.commit(o.value)}outdentLine(e){let o=e.value.lastIndexOf(`
47
+ `,e.selectionStart-1)+1,r=Ka(e.value.slice(o),this.language.indent);if(!r)return;let{selectionStart:s,selectionEnd:a}=e;e.setRangeText("",o,o+r,"preserve"),e.setSelectionRange(Math.max(o,s-r),Math.max(o,a-r))}};n(je,"template","nodexui.CodeEditor"),n(je,"components",{Alert:$t,AlertDescription:Yt,Badge:Et,Button:U,ClipboardButton:Bt,Kbd:Qt,Spinner:Xt}),n(je,"props",{value:i(String),codeLang:i(String),src:i(String),upload:i(Boolean),format:i(Boolean),toggle:i(Boolean),onChange:i(Function),onLoad:i(Function),onError:i(Function),readonly:i(Boolean),title:i(String),globals:i(Array),hint:i(String),id:i(String),...p});var te=class extends u{get tag(){return this.props.tag||"div"}};n(te,"template","nodexui.Card"),n(te,"props",{...p,tag:i(String)});var ee=class extends u{};n(ee,"template","nodexui.CardHeader"),n(ee,"props",p);var oe=class extends u{};n(oe,"template","nodexui.CardBody"),n(oe,"props",p);var jo=class extends u{};n(jo,"template","nodexui.CardFooter"),n(jo,"props",p);var re=class extends u{};n(re,"template","nodexui.CardTitle"),n(re,"props",p);var se=class extends u{};n(se,"template","nodexui.CardDescription"),n(se,"props",p);var It=class extends u{setup(){this.state=$({open:dt(this.props.state)}),this.triggerRef=P("trigger"),this.bufferRef=P("buffer"),this.bootstrapTooltip=null,this.lastContentHtml=null,this.onShown=()=>{this.state.open=!0},this.onHidden=()=>{this.state.open=!1},V(()=>{this.lastContentHtml=this.currentContentHtml();let e=this.triggerElement();this.bootstrapTooltip=new(z()).Tooltip(e,{title:this.lastContentHtml,html:!0,trigger:"hover focus"}),e.addEventListener("shown.bs.tooltip",this.onShown),e.addEventListener("hidden.bs.tooltip",this.onHidden),dt(this.props.state)&&this.bootstrapTooltip.show()}),it(()=>{let e=this.currentContentHtml();e!==this.lastContentHtml&&(this.lastContentHtml=e,this.bootstrapTooltip?.setContent({".tooltip-inner":e}))}),Q(()=>{let e=this.triggerElement();e?.removeEventListener("shown.bs.tooltip",this.onShown),e?.removeEventListener("hidden.bs.tooltip",this.onHidden),this.bootstrapTooltip?.dispose()})}triggerElement(){return this.triggerRef.el?.firstElementChild||this.triggerRef.el}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}show(){this.bootstrapTooltip?.show()}hide(){this.bootstrapTooltip?.hide()}};n(It,"template","nodexui.Tooltip"),n(It,"props",{content:i(String),state:i(String),...p});var Cu=Uo("circle-question-mark"),Lu=0,kt={label:i(String),labelBackground:i(String),supportingText:i(String),useTip:i(Number),errorText:i(String),leadingIcon:i(String),trailingIcon:i(String),maxLength:i(Number),invalid:i(Boolean),placeholder:i(String),disabled:i(Boolean),slots:i(Object)},vt=class extends u{setup(){this.supportId=`b-input-support-${Lu++}`,this.box=P("box"),this.slotRefs={start:P("start"),end:P("end"),footer:P("footer")},V(()=>this.measureSlots()),it(()=>this.measureSlots())}get field(){return this.env.fieldProps?.()??{}}get label(){return this.props.label??this.field.label}get labelStyle(){let e=this.props.labelBackground??this.field.labelBackground;return e?`--b-label-bg:${e}`:void 0}get isOutlined(){return!!this.label||this.hasStart||this.hasEnd||this.hasFooter}get hasStart(){return!!this.props.slots?.start}get hasEnd(){return!!this.props.slots?.end}get hasFooter(){return!!this.props.slots?.footer}measureSlots(){let e=this.box.el;if(!e)return;let{start:o,end:r,footer:s}=this.slotRefs;e.style.setProperty("--b-slot-start",`${o.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-end",`${r.el?.offsetWidth??0}px`),e.style.setProperty("--b-slot-footer",`${s.el?.offsetHeight??0}px`)}get isInvalid(){return!!(this.props.invalid||this.field.invalid||this.errorText)}get errorText(){return this.props.errorText??this.field.error}get helperText(){return this.props.supportingText||this.field.description}get useTip(){return Number(this.props.useTip??this.field.useTip??0)===1}get supportingText(){return this.errorText||(this.useTip?void 0:this.helperText)}get tipText(){return this.useTip&&!this.errorText?this.helperText:void 0}get leadingIcon(){return this.props.leadingIcon}get trailingIcon(){return this.isInvalid?"circle-alert":this.props.trailingIcon}get fieldPlaceholder(){return this.props.placeholder??(this.isOutlined?" ":void 0)}get counter(){return`${(this.props.value??"").length}/${this.props.maxLength}`}get controlClass(){return this.isOutlined&&"b-outlined-control"}get describedBy(){return this.supportingText?this.supportId:void 0}get outlinedClassNames(){return g("b-input-outlined",this.isInvalid&&"is-invalid",this.props.disabled&&"is-disabled",this.props.placeholder&&"has-placeholder",this.leadingIcon&&"has-leading",this.trailingIcon&&"has-trailing",this.hasStart&&"has-start",this.hasEnd&&"has-end",this.hasFooter&&"has-footer")}};n(vt,"components",{Icon:Y,IconCircleQuestionMark:Cu,Tooltip:It});function Dn({tag:t="input",type:e}={}){return t==="select"?"form-select":e==="checkbox"||e==="radio"?"form-check-input":"form-control"}var ne=class extends vt{get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}get classNames(){return g("b-input",Dn({tag:"input",type:this.props.type}),this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(ne,"template","nodexui.Input"),n(ne,"props",{...kt,value:i(String),type:i(String),readonly:i(Boolean),className:i(String),style:i([String,Object]),id:i(String),list:i(String),autocomplete:i(String),"aria-label":i(String),ariaLabel:i(String),min:i([String,Number]),max:i([String,Number]),step:i([String,Number]),onInput:i(Function),onChange:i(Function)});var Li={default:"b-tabs-list-default",line:"b-tabs-list-line"};function jn(t,e,o,r="horizontal"){let s=r==="vertical",l=t===(s?"ArrowDown":"ArrowRight")?1:t===(s?"ArrowUp":"ArrowLeft")?-1:0;return!l||o===0?-1:(e+l+o)%o}var ku=0;function Ga(t){return String(t).replace(/[^a-zA-Z0-9_-]/g,"_")}var ie=class extends u{setup(){this.tabsState=$({active:this.props.value??this.props.defaultValue??""}),this.instanceId=`t${++ku}`,H({tabs:this.tabsState,selectTab:e=>this.select(e),tabsId:this.instanceId,orientation:this.orientation}),at(e=>{e.value!==void 0&&(this.tabsState.active=e.value)})}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-tabs",this.props.className)}select(e){this.props.value===void 0&&(this.tabsState.active=e),this.props.onChange?.(e)}};n(ie,"template","nodexui.Tabs"),n(ie,"props",{value:i(String),defaultValue:i(String),orientation:i(String),onChange:i(Function),...p});var ae=class extends u{};n(ae,"template","nodexui.TabsContainer"),n(ae,"props",{...p});var ce=class extends u{setup(){this.listRef=P("list")}get classNames(){return g("nav","b-tabs-list",Li[this.props.variant]||Li.default,this.props.className)}onKeyDown(e){let o=[...this.listRef.el.querySelectorAll("[role='tab']")],r=o.indexOf(e.target),s=jn(e.key,r,o.length,this.env.orientation);s!==-1&&(e.preventDefault(),o[s].focus(),o[s].click())}};n(ce,"template","nodexui.TabsList"),n(ce,"props",{variant:i(String),...p});var Ut=class extends u{setup(){this.rootEl=null,this.tabInstance=null,this.onShown=()=>this.env.selectTab(this.props.value)}onRootRef(e){e?(this.rootEl=e,this.tabInstance=z().Tab.getOrCreateInstance(e),e.addEventListener("shown.bs.tab",this.onShown)):this.rootEl&&(this.rootEl.removeEventListener("shown.bs.tab",this.onShown),this.tabInstance?.dispose(),this.tabInstance=null,this.rootEl=null)}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${Ga(this.props.value)}`}get classNames(){return g("nav-link","b-tabs-trigger",this.isActive&&"active",this.props.className)}get tabAttrs(){return{role:"tab","data-bs-target":`#${this.panelId}`,"aria-selected":this.isActive?"true":"false",tabindex:this.isActive?0:-1}}onClick(){this.props.disabled||this.tabInstance?.show()}};n(Ut,"template","nodexui.TabTrigger"),n(Ut,"components",{Button:U}),n(Ut,"props",{value:{type:String},disabled:i(Boolean),...p});var le=class extends u{setup(){this.initialActive=this.isActive}get isActive(){return this.env.tabs.active===this.props.value}get panelId(){return`b-tabs-panel-${this.env.tabsId}-${Ga(this.props.value)}`}};n(le,"template","nodexui.TabContent"),n(le,"props",{value:{type:String},...p});function xt(t,e){at(o=>{Bo(o)&&(t.open=lt(o),t.open?e?.instance?.show():e?.instance?.hide())})}function yt(t,e,o){Bo(t)||(e.open=o),t.onOpenChange?.(o)}function Fn(t,e){let o=null;V(()=>{o=new(z()).Collapse(t.el,{toggle:!1})}),it(()=>{if(!o)return;let r=t.el.classList.contains("show");e()&&!r?o.show():!e()&&r&&o.hide()}),Q(()=>o?.dispose())}var ue=class extends u{setup(){this.dialogState=$({open:lt(this.props)}),this.control={instance:null},H({dialog:this.dialogState,dialogControl:this.control,setDialogOpen:e=>this.setOpen(e)}),xt(this.dialogState,this.control)}setOpen(e){yt(this.props,this.dialogState,e)}};n(ue,"template","nodexui.Dialog"),n(ue,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),style:i([String,Object]),slots:i(Object)});var Fo=class extends u{onClick(){this.env.dialogControl.instance?.show()}};n(Fo,"template","nodexui.DialogTrigger"),n(Fo,"props",p);var _t=class extends u{setup(){this.rootRef=P("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDialogOpen(!0),this.onHidden=()=>{this.env.setDialogOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},V(()=>{this.env.dialogControl.instance=z().Modal.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,focus:!0}),this.rootRef.el.addEventListener("show.bs.modal",this.onShow),this.rootRef.el.addEventListener("shown.bs.modal",this.onShown),this.rootRef.el.addEventListener("hidden.bs.modal",this.onHidden),this.env.dialog.open&&this.env.dialogControl.instance.show()}),Q(()=>{this.rootRef.el.removeEventListener("show.bs.modal",this.onShow),this.rootRef.el.removeEventListener("shown.bs.modal",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.modal",this.onHidden),this.env.dialogControl.instance?.dispose(),this.env.dialogControl.instance=null})}get showCloseButton(){return this.props.showCloseButton!==!1&&this.props["show-close-button"]!==!1}};n(_t,"template","nodexui.DialogContent"),n(_t,"components",{Button:U}),n(_t,"props",{...p,showCloseButton:i(Boolean),"show-close-button":i(Boolean)});var pe=class extends u{};n(pe,"template","nodexui.DialogHeader"),n(pe,"props",p);var de=class extends u{};n(de,"template","nodexui.DialogFooter"),n(de,"props",p);var he=class extends u{};n(he,"template","nodexui.DialogTitle"),n(he,"props",p);var me=class extends u{};n(me,"template","nodexui.DialogDescription"),n(me,"props",p);var Fe=class extends u{};n(Fe,"template","nodexui.DialogClose"),n(Fe,"components",{Button:U}),n(Fe,"props",p);var Za={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"},Nu={default:"b-empty-media-default",icon:"b-empty-media-icon"},zo=class extends u{get classNames(){return g("b-empty",Za[this.props.variant]||Za.default,this.props.className)}};n(zo,"template","nodexui.Empty"),n(zo,"props",{variant:i(String),...p});var Ho=class extends u{};n(Ho,"template","nodexui.EmptyHeader"),n(Ho,"props",p);var Wo=class extends u{get variant(){return this.props.variant==="icon"?"icon":"default"}get classNames(){return g("b-empty-media",Nu[this.variant],this.props.className)}};n(Wo,"template","nodexui.EmptyMedia"),n(Wo,"props",{variant:i(String),...p});var Ko=class extends u{};n(Ko,"template","nodexui.EmptyTitle"),n(Ko,"props",p);var Vo=class extends u{};n(Vo,"template","nodexui.EmptyDescription"),n(Vo,"props",p);var Go=class extends u{};n(Go,"template","nodexui.EmptyContent"),n(Go,"props",p);var Zo=class extends u{get vertical(){return this.props.orientation==="vertical"}get classNames(){return g("b-separator",this.vertical?"b-separator-vertical":"b-separator-horizontal",this.props.className)}};n(Zo,"template","nodexui.Separator"),n(Zo,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var fe=class extends u{get classNames(){return g("b-skeleton",this.props.shape==="circle"?"b-skeleton-circle":"b-skeleton-block",this.props.className)}};n(fe,"template","nodexui.Skeleton"),n(fe,"props",{shape:i(String),className:i(String),style:i([String,Object])});var Tu={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"},Ou={h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"ul"},Jo=class extends u{get tag(){return this.props.tag||Ou[this.props.variant]||"p"}get classNames(){return g("b-typography",Tu[this.props.variant],this.props.className)}};n(Jo,"template","nodexui.Typography"),n(Jo,"props",{variant:i(String),tag:i(String),...p});var Yo=class extends u{get classNames(){return g("b-marker",this.props.className)}get variant(){return this.props.variant}};n(Yo,"template","nodexui.Marker"),n(Yo,"props",{variant:i(String),...p});var be=class extends vt{get outlinedClassNames(){return g(super.outlinedClassNames,"is-anchored")}get classNames(){return g("form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.resize==="none"&&"b-textarea-no-resize",this.props.className)}onInput(e){this.props.onInput?.(e.target.value,e)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(be,"template","nodexui.Textarea"),n(be,"props",{...kt,value:i(String),rows:i(Number),readonly:i(Boolean),resize:i(String),className:i(String),style:i([String,Object]),id:i(String),onInput:i(Function),onChange:i(Function)});var ge=class extends vt{get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}get classNames(){return g("b-native-select","form-select",this.controlClass,this.isInvalid&&"is-invalid",(this.props.size==="sm"||this.props.size==="lg")&&`form-select-${this.props.size}`,this.props.className)}onChange(e){this.props.onChange?.(e.target.value,e)}};n(ge,"template","nodexui.NativeSelect"),n(ge,"props",{...kt,value:i(String),size:i(String),...p,"aria-label":i(String),ariaLabel:i(String),id:i(String),onChange:i(Function)});var ve=class extends u{onChange(e){this.props.onChange?.(e.target.checked,e)}};n(ve,"template","nodexui.Checkbox"),n(ve,"props",{checked:i(Boolean),disabled:i(Boolean),...p,id:i(String),onChange:i(Function)});var Qo=class extends u{setup(){H({radioGroupValue:()=>this.props.value,radioGroupDisabled:()=>this.props.disabled,radioGroupName:()=>this.props.name||"b-radio-group",selectRadio:e=>this.props.onChange?.(e)})}get classNames(){return g("b-radio-group",this.props.className)}};n(Qo,"template","nodexui.RadioGroup"),n(Qo,"props",{value:i(String),name:i(String),disabled:i(Boolean),...p,onChange:i(Function)});var Xo=class extends u{get checked(){return this.env.radioGroupValue()===this.props.value}get disabled(){return this.props.disabled||this.env.radioGroupDisabled()}onChange(){this.disabled||this.env.selectRadio(this.props.value)}};n(Xo,"template","nodexui.RadioGroupItem"),n(Xo,"props",{value:{type:String},disabled:i(Boolean),...p});var Iu=Uo("circle-question-mark"),ze=class extends u{get tipText(){return Number(this.props.useTip??0)===1?this.props.supportingText:void 0}get supportingText(){return this.tipText?void 0:this.props.supportingText}onChange(e){this.props.onChange?.(e.target.checked,e)}};n(ze,"template","nodexui.Switch"),n(ze,"components",{IconCircleQuestionMark:Iu,Tooltip:It}),n(ze,"props",{checked:i(Boolean),disabled:i(Boolean),supportingText:i(String),useTip:i(Number),...p,onChange:i(Function)});var tr=class extends u{get classNames(){return g("b-slider",this.props.className)}onInput(e){e.target.style.setProperty("--b-slider-value",`${e.target.value}%`),this.props.onChange?.(e.target.value,e)}};n(tr,"template","nodexui.Slider"),n(tr,"props",{value:i([Number,String]),min:i([Number,String]),max:i([Number,String]),step:i([Number,String]),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});var er=class extends u{setup(){this.length=this.props.length||6;let e=(this.props.value||"").split("");this.state=$({digits:Array.from({length:this.length},(o,r)=>e[r]||"")}),this.rootRef=P("root")}get classNames(){return g("b-input-otp",this.props.className)}get boxes(){return this.state.digits.map((e,o)=>({index:o,value:e}))}emit(){this.props.onChange?.(this.state.digits.join(""))}onInput(e,o){let r=o.target.value.slice(-1);this.state.digits[e]=r,r&&this.rootRef.el&&[...this.rootRef.el.querySelectorAll("input")][e+1]?.focus(),this.emit()}onPaste(e){let o=e.clipboardData.getData("text").trim();if(o){e.preventDefault();for(let r=0;r<this.length;r++)this.state.digits[r]=o[r]||"";this.emit()}}};n(er,"template","nodexui.InputOtp"),n(er,"props",{length:i(Number),value:i(String),disabled:i(Boolean),className:i(String),style:i([String,Object]),onChange:i(Function)});function cn(t,{defaultOpen:e=!1,onOpenChange:o}={}){let r=$({open:e}),s=d=>{r.open!==d&&(r.open=d,o?.(d))},a=()=>s(!r.open),c=d=>{t.el&&!t.el.contains(d.target)&&s(!1)},l=d=>{d.key==="Escape"&&s(!1)};return At(d=>{if(d)return document.addEventListener("click",c),document.addEventListener("keydown",l),()=>{document.removeEventListener("click",c),document.removeEventListener("keydown",l)}},()=>[r.open]),Q(()=>{document.removeEventListener("click",c),document.removeEventListener("keydown",l)}),{state:r,setOpen:s,toggle:a}}var or=class extends vt{setup(){super.setup(),this.rootRef=P("root");let{state:e,setOpen:o,toggle:r}=cn(this.rootRef,{defaultOpen:dt(this.props.state)});this.disclosure=e,H({select:this.disclosure,selectValue:()=>this.props.value,selectToggle:r,selectClose:()=>o(!1),selectChoose:s=>{this.props.onChange?.(s),o(!1)}})}get outlinedClassNames(){return g(super.outlinedClassNames,"is-anchored",this.props.value&&"is-floated")}get rootStyle(){return mt(this.labelStyle,this.props.style)}get classNames(){return g("b-select",this.isOutlined&&this.outlinedClassNames,this.props.className)}};n(or,"template","nodexui.Select"),n(or,"props",{...kt,value:i(String),state:i(String),onChange:i(Function),...p});var He=class extends u{get attrs(){return{"aria-haspopup":"listbox","aria-expanded":this.env.select.open?"true":"false"}}onClick(){this.env.selectToggle()}};n(He,"template","nodexui.SelectTrigger"),n(He,"components",{Button:U}),n(He,"props",p);var rr=class extends u{get open(){return this.env.select.open}};n(rr,"template","nodexui.SelectContent"),n(rr,"props",p);var sr=class extends u{get selected(){return this.env.selectValue()===this.props.value}onClick(){this.env.selectChoose(this.props.value)}};n(sr,"template","nodexui.SelectItem"),n(sr,"props",{value:{type:String},...p});function ln(t){return[...t.querySelectorAll("button, [href], input, select, textarea, [tabindex]:not([tabindex='-1'])")].filter(e=>!e.disabled&&!e.hidden)}function ki(t,e){if(t.key!=="Tab")return;let o=ln(e);if(!o.length){t.preventDefault();return}let r=o[0],s=o[o.length-1];t.shiftKey&&document.activeElement===r?(t.preventDefault(),s.focus()):!t.shiftKey&&document.activeElement===s&&(t.preventDefault(),r.focus())}function zn(t,{closeSelector:e,trapFocus:o=!1}={}){let r=t.getAttribute("b-att-trigger"),s=r?document.querySelector(r):null,a=[...t.querySelectorAll(e)],c=null,l=()=>ln(t),d=()=>{t.hidden&&(c=document.activeElement,t.hidden=!1,t.setAttribute("b-att-state","open"),t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),l()[0]?.focus(),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0})))},f=()=>{t.hidden=!0,t.setAttribute("b-att-state","closed"),c?.focus?.(),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},v=k=>{if(k.key==="Escape"){f();return}!o||t.hidden||ki(k,t)},O=k=>{k.target===t&&f()};return s?.addEventListener("click",d),a.forEach(k=>k.addEventListener("click",f)),t.addEventListener("keydown",v),t.addEventListener("click",O),(!t.getAttribute("b-att-state")||t.getAttribute("b-att-state")==="closed")&&(t.hidden=!0),{open:d,close:f,destroy:()=>{s?.removeEventListener("click",d),a.forEach(k=>k.removeEventListener("click",f)),t.removeEventListener("keydown",v),t.removeEventListener("click",O)}}}function un(t,e,o,r){let s=t.getAttribute("b-att-trigger"),a=s?document.querySelector(s):null,c=null,l=()=>{c=document.activeElement},d=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},f=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0})),c?.focus?.(),c=null},v=()=>e.show(),O=()=>e.hide();return t.addEventListener(`show.bs.${o}`,l),t.addEventListener(`shown.bs.${o}`,d),t.addEventListener(`hidden.bs.${o}`,f),a?.addEventListener("click",v),t.setAttribute("b-att-state","closed"),t[r]={open:v,close:O},{destroy:()=>{a?.removeEventListener("click",v),t.removeEventListener(`show.bs.${o}`,l),t.removeEventListener(`shown.bs.${o}`,d),t.removeEventListener(`hidden.bs.${o}`,f),e.dispose(),delete t[r]}}}var nr=class extends u{setup(){this.alertDialogState=$({open:lt(this.props)}),H({alertDialog:this.alertDialogState,setAlertDialogOpen:e=>this.setOpen(e)}),xt(this.alertDialogState)}setOpen(e){yt(this.props,this.alertDialogState,e)}};n(nr,"template","nodexui.AlertDialog"),n(nr,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var We=class extends u{get attrs(){return{"data-slot":"alert-dialog-trigger"}}onClick(){this.env.setAlertDialogOpen(!0)}};n(We,"template","nodexui.AlertDialogTrigger"),n(We,"components",{Button:U}),n(We,"props",p);var ir=class extends u{get size(){return this.props.size==="sm"?"sm":"default"}setup(){this.rootRef=P("root"),At(e=>{if(!e)return;let o=document.activeElement;return ln(this.rootRef.el)[0]?.focus(),()=>o?.focus?.()},()=>[this.env.alertDialog.open])}get open(){return this.env.alertDialog.open}onKeyDown(e){if(e.key==="Escape"){this.env.setAlertDialogOpen(!1);return}ki(e,this.rootRef.el)}};n(ir,"template","nodexui.AlertDialogContent"),n(ir,"props",{...p,size:i(String)});var ar=class extends u{};n(ar,"template","nodexui.AlertDialogHeader"),n(ar,"props",p);var cr=class extends u{};n(cr,"template","nodexui.AlertDialogFooter"),n(cr,"props",p);var lr=class extends u{};n(lr,"template","nodexui.AlertDialogMedia"),n(lr,"props",p);var ur=class extends u{};n(ur,"template","nodexui.AlertDialogTitle"),n(ur,"props",p);var pr=class extends u{};n(pr,"template","nodexui.AlertDialogDescription"),n(pr,"props",p);var Ke=class extends u{get attrs(){return{"data-slot":"alert-dialog-cancel"}}onClick(){this.env.setAlertDialogOpen(!1)}};n(Ke,"template","nodexui.AlertDialogCancel"),n(Ke,"components",{Button:U}),n(Ke,"props",p);var Ve=class extends u{get attrs(){return{"data-slot":"alert-dialog-action"}}onClick(){this.props.onClick?.(),this.env.setAlertDialogOpen(!1)}};n(Ve,"template","nodexui.AlertDialogAction"),n(Ve,"components",{Button:U}),n(Ve,"props",{...p,onClick:i(Function)});var dr=class extends u{setup(){this.drawerState=$({open:lt(this.props)}),this.control={instance:null},H({drawer:this.drawerState,drawerControl:this.control,setDrawerOpen:e=>this.setOpen(e)}),xt(this.drawerState,this.control)}setOpen(e){yt(this.props,this.drawerState,e)}};n(dr,"template","nodexui.Drawer"),n(dr,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Ge=class extends u{onClick(){this.env.drawerControl.instance?.show()}};n(Ge,"template","nodexui.DrawerTrigger"),n(Ge,"components",{Button:U}),n(Ge,"props",p);var hr=class extends u{setup(){this.rootRef=P("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setDrawerOpen(!0),this.onHidden=()=>{this.env.setDrawerOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},V(()=>{this.env.drawerControl.instance=z().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawer.open&&this.env.drawerControl.instance.show()}),Q(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.drawerControl.instance?.dispose(),this.env.drawerControl.instance=null})}get open(){return this.env.drawer.open}};n(hr,"template","nodexui.DrawerContent"),n(hr,"props",p);var mr=class extends u{};n(mr,"template","nodexui.DrawerHeader"),n(mr,"props",p);var fr=class extends u{};n(fr,"template","nodexui.DrawerFooter"),n(fr,"props",p);var br=class extends u{};n(br,"template","nodexui.DrawerTitle"),n(br,"props",p);var gr=class extends u{};n(gr,"template","nodexui.DrawerDescription"),n(gr,"props",p);var Ze=class extends u{get attrs(){return{"data-bs-dismiss":"offcanvas"}}};n(Ze,"template","nodexui.DrawerClose"),n(Ze,"components",{Button:U}),n(Ze,"props",p);var vr=class extends u{setup(){this.sheetState=$({open:lt(this.props),side:this.props.side}),this.control={instance:null},H({sheet:this.sheetState,sheetControl:this.control,setSheetOpen:e=>this.setOpen(e)}),xt(this.sheetState,this.control),at(e=>{this.sheetState.side=e.side})}setOpen(e){yt(this.props,this.sheetState,e)}};n(vr,"template","nodexui.Sheet"),n(vr,"props",{open:i(Boolean),state:i(String),side:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var Je=class extends u{onClick(){this.env.sheetControl.instance?.show()}};n(Je,"template","nodexui.SheetTrigger"),n(Je,"components",{Button:U}),n(Je,"props",p);var xr=class extends u{setup(){this.rootRef=P("root"),this.previousFocus=null,this.onShow=()=>{this.previousFocus=document.activeElement},this.onShown=()=>this.env.setSheetOpen(!0),this.onHidden=()=>{this.env.setSheetOpen(!1),this.previousFocus?.focus?.(),this.previousFocus=null},V(()=>{this.env.sheetControl.instance=z().Offcanvas.getOrCreateInstance(this.rootRef.el,{backdrop:!0,keyboard:!0,scroll:!1}),this.rootRef.el.addEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.addEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.addEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheet.open&&this.env.sheetControl.instance.show()}),Q(()=>{this.rootRef.el.removeEventListener("show.bs.offcanvas",this.onShow),this.rootRef.el.removeEventListener("shown.bs.offcanvas",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.offcanvas",this.onHidden),this.env.sheetControl.instance?.dispose(),this.env.sheetControl.instance=null})}get open(){return this.env.sheet.open}get side(){return this.props.side??this.env.sheet.side}get placementClass(){return this.side==="left"?"offcanvas-start":"offcanvas-end"}};n(xr,"template","nodexui.SheetContent"),n(xr,"props",{...p,side:i(String)});var yr=class extends u{};n(yr,"template","nodexui.SheetHeader"),n(yr,"props",p);var wr=class extends u{};n(wr,"template","nodexui.SheetFooter"),n(wr,"props",p);var Sr=class extends u{};n(Sr,"template","nodexui.SheetTitle"),n(Sr,"props",p);var Ar=class extends u{};n(Ar,"template","nodexui.SheetDescription"),n(Ar,"props",p);var Ye=class extends u{};n(Ye,"template","nodexui.SheetClose"),n(Ye,"components",{Button:U}),n(Ye,"props",p);var Er=class extends u{setup(){let e=$({open:dt(this.props.state)});this.control={instance:null,bufferEl:null,lastContentHtml:null};let o=r=>{e.open!==r&&(e.open=r,this.props.onOpenChange?.(r))};H({popover:e,popoverControl:this.control,popoverSetOpen:o,popoverToggle:()=>this.control.instance?.toggle(),popoverClose:()=>this.control.instance?.hide()})}};n(Er,"template","nodexui.Popover"),n(Er,"props",{state:i(String),onOpenChange:i(Function),...p});var Qe=class extends u{setup(){this.rootRef={el:null},this.getRef=e=>{this.rootRef.el=e},this.onShown=()=>this.env.popoverSetOpen(!0),this.onHidden=()=>this.env.popoverSetOpen(!1),V(()=>{let e=this.env.popoverControl,o=e.bufferEl?.innerHTML??"";e.lastContentHtml=o,e.instance=new(z()).Popover(this.rootRef.el,{content:o,html:!0,trigger:"manual"}),this.rootRef.el.addEventListener("shown.bs.popover",this.onShown),this.rootRef.el.addEventListener("hidden.bs.popover",this.onHidden)}),Q(()=>{this.rootRef.el.removeEventListener("shown.bs.popover",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.popover",this.onHidden),this.env.popoverControl.instance?.dispose(),this.env.popoverControl.instance=null})}get attrs(){return{"aria-haspopup":"dialog","aria-expanded":this.env.popover.open?"true":"false"}}onClick(){this.env.popoverControl.instance?.toggle()}};n(Qe,"template","nodexui.PopoverTrigger"),n(Qe,"components",{Button:U}),n(Qe,"props",p);var Cr=class extends u{get style(){return mt("display:none",this.props.style)}setup(){this.bufferRef=P("buffer"),V(()=>{this.env.popoverControl.bufferEl=this.bufferRef.el}),it(()=>{let e=this.env.popoverControl;e.bufferEl=this.bufferRef.el;let o=this.currentContentHtml();e.instance&&o!==e.lastContentHtml&&(e.lastContentHtml=o,e.instance.setContent({".popover-body":o}))})}currentContentHtml(){return this.props.content??this.bufferRef.el?.innerHTML??""}};n(Cr,"template","nodexui.PopoverContent"),n(Cr,"props",{...p,content:i(String)});var Lr=class extends u{setup(){this.state=$({open:!1}),H({hoverCard:this.state})}open(){this.state.open=!0}close(){this.state.open=!1}onKeyDown(e){e.key==="Escape"&&this.close()}};n(Lr,"template","nodexui.HoverCard"),n(Lr,"props",{...p});var kr=class extends u{};n(kr,"template","nodexui.HoverCardTrigger"),n(kr,"props",p);var Nr=class extends u{get open(){return this.env.hoverCard.open}};n(Nr,"template","nodexui.HoverCardContent"),n(Nr,"props",p);var Ni={...p,disabled:i(Boolean),inset:i(Boolean),onClick:i(Function),onSelect:i(Function),variant:i(String)},xe=class extends u{setup(){this.rootRef=P("root");let e=$({open:dt(this.props.state)});this.control={instance:null};let o=a=>{e.open!==a&&(e.open=a,this.props.onOpenChange?.(a))};H({dropdownMenu:e,dropdownControl:this.control,dropdownSetOpen:o,dropdownToggle:()=>this.control.instance?.toggle(),dropdownClose:()=>this.control.instance?.hide()});let r=a=>{this.rootRef.el&&!this.rootRef.el.contains(a.target)&&this.control.instance?.hide()},s=a=>{a.key==="Escape"&&this.control.instance?.hide()};At(a=>{if(a)return document.addEventListener("click",r),document.addEventListener("keydown",s),()=>{document.removeEventListener("click",r),document.removeEventListener("keydown",s)}},()=>[e.open]),Q(()=>{document.removeEventListener("click",r),document.removeEventListener("keydown",s)})}};n(xe,"template","nodexui.DropdownMenu"),n(xe,"props",{state:i(String),onOpenChange:i(Function),...p});var Pt=class extends u{setup(){this.rootRef={el:null},this.onShown=()=>this.env.dropdownSetOpen(!0),this.onHidden=()=>this.env.dropdownSetOpen(!1),this.getRef=e=>{e?(this.rootRef.el=e,this.env.dropdownControl.instance=z().Dropdown.getOrCreateInstance(e),e.addEventListener("shown.bs.dropdown",this.onShown),e.addEventListener("hidden.bs.dropdown",this.onHidden)):this.rootRef.el&&(this.rootRef.el.removeEventListener("shown.bs.dropdown",this.onShown),this.rootRef.el.removeEventListener("hidden.bs.dropdown",this.onHidden),this.env.dropdownControl.instance?.dispose(),this.env.dropdownControl.instance=null,this.rootRef.el=null)}}get classNames(){return g("btn","b-button","btn-outline-secondary","b-dropdown-menu-trigger",this.props.className)}get attrs(){return{"data-slot":"dropdown-menu-trigger","aria-haspopup":"menu","aria-expanded":this.env.dropdownMenu.open?"true":"false"}}onClick(){this.env.dropdownToggle()}};n(Pt,"template","nodexui.DropdownMenuTrigger"),n(Pt,"components",{Button:U}),n(Pt,"props",p);var ye=class extends u{get open(){return this.env.dropdownMenu.open}get classNames(){return g("b-dropdown-menu-content","dropdown-menu",this.open?"show":"",this.props.className)}};n(ye,"template","nodexui.DropdownMenuContent"),n(ye,"props",{...p,align:i(String),alignOffset:i(Number),side:i(String),sideOffset:i(Number)});var Tr=class extends u{};n(Tr,"template","nodexui.DropdownMenuGroup"),n(Tr,"props",p);var Or=class extends u{};n(Or,"template","nodexui.DropdownMenuLabel"),n(Or,"props",{...p,inset:i(Boolean)});var we=class extends u{get variant(){return this.props.variant||"default"}onClick(e){this.props.disabled||(this.props.onClick?.(e),this.props.onSelect?.(e),this.env.dropdownClose())}};n(we,"template","nodexui.DropdownMenuItem"),n(we,"props",Ni);var Xe=class extends u{onClick(e){this.props.disabled||(this.props.onCheckedChange?.(!this.props.checked,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};n(Xe,"template","nodexui.DropdownMenuCheckboxItem"),n(Xe,"components",{Icon:Y}),n(Xe,"props",{...Ni,checked:i(Boolean),onCheckedChange:i(Function)});var Ir=class extends u{setup(){H({dropdownRadio:{value:this.props.value,onValueChange:this.props.onValueChange}})}};n(Ir,"template","nodexui.DropdownMenuRadioGroup"),n(Ir,"props",{...p,value:i(String),onValueChange:i(Function)});var to=class extends u{get checked(){return this.env.dropdownRadio?.value===this.props.value}onClick(e){this.props.disabled||(this.env.dropdownRadio?.onValueChange?.(this.props.value,e),this.props.onClick?.(e),this.props.onSelect?.(e))}};n(to,"template","nodexui.DropdownMenuRadioItem"),n(to,"components",{Icon:Y}),n(to,"props",{...Ni,value:i(String)});var Rr=class extends u{};n(Rr,"template","nodexui.DropdownMenuSeparator"),n(Rr,"props",p);var Br=class extends u{};n(Br,"template","nodexui.DropdownMenuShortcut"),n(Br,"props",p);var Se=class extends u{setup(){this.rootRef=P("root");let{state:e,setOpen:o,toggle:r}=cn(this.rootRef);H({dropdownSub:e,dropdownSubToggle:r,dropdownSubOpen:()=>o(!0),dropdownSubClose:()=>o(!1)})}};n(Se,"template","nodexui.DropdownMenuSub"),n(Se,"props",p);var qt=class extends u{onMouseEnter(){this.props.disabled||this.env.dropdownSubOpen()}onClick(){this.props.disabled||this.env.dropdownSubToggle()}};n(qt,"template","nodexui.DropdownMenuSubTrigger"),n(qt,"components",{Icon:Y}),n(qt,"props",{...p,disabled:i(Boolean),inset:i(Boolean)});var Ae=class extends u{get open(){return this.env.dropdownSub.open}};n(Ae,"template","nodexui.DropdownMenuSubContent"),n(Ae,"props",p);var $r=class extends u{setup(){this.state=$({open:!1,x:0,y:0});let e=()=>{this.state.open=!1};this.close=e,H({contextMenu:this.state,contextMenuOpenAt:(o,r)=>{this.state.open=!0,this.state.x=o,this.state.y=r},contextMenuClose:e}),document.addEventListener("click",e),Q(()=>document.removeEventListener("click",e))}};n($r,"template","nodexui.ContextMenu"),n($r,"props",{className:i(String),slots:i(Object)});var Mr=class extends u{onContextMenu(e){e.preventDefault(),this.env.contextMenuOpenAt(e.clientX,e.clientY)}};n(Mr,"template","nodexui.ContextMenuTrigger"),n(Mr,"props",p);var Ur=class extends u{setup(){this.rootRef=P("root")}get open(){return this.env.contextMenu.open}get style(){return mt(`left:${this.env.contextMenu.x}px;top:${this.env.contextMenu.y}px`,this.props.style)}};n(Ur,"template","nodexui.ContextMenuContent"),n(Ur,"props",p);var _r=class extends u{onClick(){this.props.onClick?.(),this.env.contextMenuClose()}};n(_r,"template","nodexui.ContextMenuItem"),n(_r,"props",{...p,onClick:i(Function)});var Ru={"top-left":["top-0","start-0"],"top-right":["top-0","end-0"],"bottom-left":["bottom-0","start-0"],"bottom-right":["bottom-0","end-0"]};function Hn(t){let e=Ru[t];return e?["toast-container","position-fixed","p-3","pe-auto",...e]:null}var Dt=class extends u{setup(){this.state=$({open:lt(this.props)}),this.rootRef=P("root"),this.bootstrapToast=null,this.handleShown=()=>{this.state.open=!0},this.handleHidden=()=>{this.state.open=!1,this.props.onOpenChange?.(!1)},V(()=>{this.mountBootstrapToast(this.props.delay),this.state.open&&this.bootstrapToast.show()}),at(e=>{let o=Bo(e)?lt(e):this.state.open;e.delay!==this.props.delay?(this.bootstrapToast?.dispose(),this.mountBootstrapToast(e.delay),o&&this.bootstrapToast.show()):o!==this.state.open&&(o?this.bootstrapToast?.show():this.bootstrapToast?.hide())}),Q(()=>{this.bootstrapToast?.dispose()})}mountBootstrapToast(e){let o=this.rootRef.el,r=e??3e3;this.bootstrapToast=new(z()).Toast(o,{autohide:r>0,delay:r||3e3}),o.addEventListener("shown.bs.toast",this.handleShown),o.addEventListener("hidden.bs.toast",this.handleHidden)}get classNames(){return g("toast","fade","b-toast",Hn(this.props.position),this.props.className)}get role(){return this.props.variant==="danger"?"alert":"status"}get hasActionSlot(){return!!this.props.slots?.action}close(){this.bootstrapToast?.hide()}};n(Dt,"template","nodexui.Toast"),n(Dt,"components",{Button:U}),n(Dt,"props",{open:i(Boolean),state:i(String),variant:i(String),delay:i(Number),position:i(String),...p,onOpenChange:i(Function)});var Pr=class extends u{setup(){this.state=$({open:new Set}),H({accordion:this.state,accordionToggle:e=>this.toggle(e)})}toggle(e){let o=!this.state.open.has(e);this.props.multiple||this.state.open.clear(),o?this.state.open.add(e):this.state.open.delete(e),this.props.onChange?.(o)}};n(Pr,"template","nodexui.Accordion"),n(Pr,"props",{multiple:i(Boolean),onChange:i(Function),...p});var qr=class extends u{setup(){H({accordionItemState:this.props.state,accordionItemValue:this.props.value})}};n(qr,"template","nodexui.AccordionItem"),n(qr,"props",{value:{type:String},state:i(String),...p});var eo=class extends u{get open(){return this.env.accordionItemState!==void 0?dt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}get triggerAttrs(){return{"data-slot":"accordion-trigger","aria-expanded":this.open?"true":"false"}}onClick(){this.env.accordionToggle(this.env.accordionItemValue)}};n(eo,"template","nodexui.AccordionTrigger"),n(eo,"components",{Icon:Y,Button:U}),n(eo,"props",p);var Dr=class extends u{setup(){this.rootRef=P("root"),this.initialOpen=this.open,Fn(this.rootRef,()=>this.open)}get open(){return this.env.accordionItemState!==void 0?dt(this.env.accordionItemState):this.env.accordion.open.has(this.env.accordionItemValue)}};n(Dr,"template","nodexui.AccordionContent"),n(Dr,"props",p);var jr=class extends u{setup(){this.state=$({open:lt(this.props)}),H({collapsible:this.state,collapsibleToggle:()=>this.toggle()}),xt(this.state)}toggle(){let e=!this.state.open;yt(this.props,this.state,e)}};n(jr,"template","nodexui.Collapsible"),n(jr,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var oo=class extends u{get attrs(){return{"aria-expanded":this.env.collapsible.open?"true":"false"}}onClick(){this.env.collapsibleToggle()}};n(oo,"template","nodexui.CollapsibleTrigger"),n(oo,"components",{Button:U}),n(oo,"props",p);var Fr=class extends u{setup(){this.rootRef=P("root"),this.initialOpen=this.open,Fn(this.rootRef,()=>this.open)}get open(){return this.env.collapsible.open}};n(Fr,"template","nodexui.CollapsibleContent"),n(Fr,"props",p);var Ee=class extends u{};n(Ee,"template","nodexui.Breadcrumb"),n(Ee,"props",{...p});var Ce=class extends u{};n(Ce,"template","nodexui.BreadcrumbList"),n(Ce,"props",{...p});var Le=class extends u{get classNames(){return g("b-breadcrumb-item",this.props.current&&"b-breadcrumb-page",this.props.className)}};n(Le,"template","nodexui.BreadcrumbItem"),n(Le,"props",{current:i(Boolean),...p});var ke=class extends u{get classNames(){return g("b-breadcrumb-link",this.props.className)}onClick(e){this.props.onClick?.(e)}};n(ke,"template","nodexui.BreadcrumbLink"),n(ke,"props",{href:i(String),target:i(String),rel:i(String),...p,onClick:i(Function)});var Ne=class extends u{get classNames(){return g("b-breadcrumb-page",this.props.className)}};n(Ne,"template","nodexui.BreadcrumbPage"),n(Ne,"props",{...p});var jt=class extends u{get classNames(){return g("b-breadcrumb-separator",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};n(jt,"template","nodexui.BreadcrumbSeparator"),n(jt,"components",{Icon:Y}),n(jt,"props",{...p});var ro=class extends u{get classNames(){return g("b-breadcrumb-ellipsis",this.props.className)}get hasCustomContent(){return!!this.props.slots?.default}};n(ro,"template","nodexui.BreadcrumbEllipsis"),n(ro,"components",{Icon:Y}),n(ro,"props",{...p});var zr=class extends u{get classNames(){return g("b-pagination",this.props.className)}};n(zr,"template","nodexui.Pagination"),n(zr,"props",{...p});var Hr=class extends u{get classNames(){return g("page-item",this.props.current&&"active",this.props.disabled&&"disabled")}onClick(){this.props.disabled||this.props.onClick?.()}};n(Hr,"template","nodexui.PaginationItem"),n(Hr,"props",{current:i(Boolean),disabled:i(Boolean),style:i([String,Object]),onClick:i(Function),slots:i(Object)});var Wr=class extends u{setup(){this.rootRef=P("root")}onKeyDown(e){let o=[...this.rootRef.el.querySelectorAll("a, button")].filter(a=>!a.disabled),r=o.indexOf(e.target),s=e.key==="ArrowRight"?1:e.key==="ArrowLeft"?-1:0;!s||r<0||(e.preventDefault(),o[(r+s+o.length)%o.length]?.focus())}};n(Wr,"template","nodexui.NavigationMenu"),n(Wr,"props",{...p});var Kr=class extends u{};n(Kr,"template","nodexui.NavigationMenuItem"),n(Kr,"props",{href:i(String),...p});var Vr=class extends u{get classNames(){return g("b-menubar",this.props.className)}};n(Vr,"template","nodexui.Menubar"),n(Vr,"props",{...p});var Ja={...p,href:i(String)},Bu="(max-width: 991.98px)",Ya=()=>!!globalThis.matchMedia?.(Bu).matches;function Qa(t){Ya()&&t.setSidebarOpen?.(!1)}var zt=class extends u{setup(){this.state=$({open:lt(this.props)}),H({sidebar:this.state,setSidebarOpen:e=>this.setOpen(e)}),xt(this.state)}setOpen(e){yt(this.props,this.state,e)}get sidebarState(){return this.state.open?"expanded":"collapsed"}get side(){return this.props.side||"left"}get variant(){return this.props.variant||"sidebar"}get collapsible(){return this.props.collapsible||"offcanvas"}get classNames(){return g("b-sidebar-root",this.props.className)}onKeyDown(e){e.key==="Escape"&&this.setOpen(!1)}};n(zt,"template","nodexui.Sidebar"),n(zt,"props",{open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),side:i(String),variant:i(String),collapsible:i(String),...p});var pn=class extends zt{};n(pn,"template","nodexui.Sidebar");var so=class extends u{onClick(){if(this.env.setShellCollapsed&&!Ya()){this.env.setShellCollapsed(!this.env.shell.collapsed);return}this.env.setSidebarOpen(!this.env.sidebar.open)}};n(so,"template","nodexui.SidebarTrigger"),n(so,"components",{Icon:Y,Button:U}),n(so,"props",{...p,icon:i(String),label:i(String)});var Te=class extends u{get open(){return this.env.sidebar.open}};n(Te,"template","nodexui.SidebarContent"),n(Te,"props",p);var Gr=class extends u{};n(Gr,"template","nodexui.SidebarHeader"),n(Gr,"props",p);var Zr=class extends u{};n(Zr,"template","nodexui.SidebarFooter"),n(Zr,"props",p);var Jr=class extends u{};n(Jr,"template","nodexui.SidebarInset"),n(Jr,"props",p);var no=class extends u{onClick(){this.env.setSidebarOpen(!this.env.sidebar.open)}};n(no,"template","nodexui.SidebarRail"),n(no,"components",{Button:U}),n(no,"props",p);var Yr=class extends u{};n(Yr,"template","nodexui.SidebarInput"),n(Yr,"props",{className:i(String),style:i([String,Object]),placeholder:i(String),value:i(String),type:i(String)});var Qr=class extends u{};n(Qr,"template","nodexui.SidebarSeparator"),n(Qr,"props",p);var io=class extends u{onClick(){this.env.setSidebarOpen(!1)}};n(io,"template","nodexui.SidebarClose"),n(io,"components",{Icon:Y,Button:U}),n(io,"props",{...p,icon:i(String),label:i(String)});var Oe=class extends u{};n(Oe,"template","nodexui.SidebarGroup"),n(Oe,"props",{muted:i(Boolean),...p});var Ie=class extends u{};n(Ie,"template","nodexui.SidebarGroupLabel"),n(Ie,"props",Ja);var ao=class extends u{get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}};n(ao,"template","nodexui.SidebarGroupAction"),n(ao,"components",{Button:U}),n(ao,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function),...p});var Xr=class extends u{};n(Xr,"template","nodexui.SidebarGroupContent"),n(Xr,"props",p);var co=class extends u{setup(){let e=this.props["default-open"]!==void 0||this.props.defaultOpen!==void 0;this.state=$({open:Bo(this.props)||e?lt(this.props):!0}),xt(this.state)}get open(){return this.state.open}toggle(){let e=!this.state.open;yt(this.props,this.state,e)}};n(co,"template","nodexui.SidebarGroupCollapsible"),n(co,"components",{Icon:Y,Button:U}),n(co,"props",{label:{type:String},open:i(Boolean),state:i(String),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),...p});var Ht=class extends u{};n(Ht,"template","nodexui.SidebarMenu"),n(Ht,"props",p);var Re=class extends u{};n(Re,"template","nodexui.SidebarMenuItem"),n(Re,"props",p);var Ft=class extends u{get classNames(){return g("b-sidebar-menu-button",this.isActive&&"is-active",this.props.variant&&`is-${this.props.variant}`,this.props.size&&`is-${this.props.size}`,this.props.className)}get isActive(){return this.props.active||this.props.isActive}onClick(e){this.props.onClick?.(e),Qa(this.env)}};n(Ft,"template","nodexui.SidebarMenuButton"),n(Ft,"components",{Icon:Y,Button:U}),n(Ft,"props",{href:i(String),icon:i(String),active:i(Boolean),isActive:i(Boolean),variant:i(String),size:i(String),tooltip:i(String),disabled:i(Boolean),onClick:i(Function),...p});var lo=class extends u{get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}};n(lo,"template","nodexui.SidebarMenuAction"),n(lo,"components",{Button:U}),n(lo,"props",{icon:i(String),"aria-label":i(String),ariaLabel:i(String),showOnHover:i(Boolean),onClick:i(Function),...p});var ts=class extends u{};n(ts,"template","nodexui.SidebarMenuSub"),n(ts,"props",p);var es=class extends u{};n(es,"template","nodexui.SidebarMenuBadge"),n(es,"props",p);var os=class extends u{setup(){this.state=$({width:this.props.width||`${Math.floor(Math.random()*40)+50}%`})}get style(){return mt(`--b-sidebar-skeleton-width:${this.state.width}`,this.props.style)}};n(os,"template","nodexui.SidebarMenuSkeleton"),n(os,"props",{showIcon:i(Boolean),width:i(String),className:i(String),style:i([String,Object])});var rs=class extends u{};n(rs,"template","nodexui.SidebarMenuSubItem"),n(rs,"props",p);var uo=class extends u{get classNames(){return g("b-sidebar-menu-sub-button",(this.props.active||this.props.isActive)&&"is-active",this.props.size&&`is-${this.props.size}`,this.props.className)}onClick(e){this.props.onClick?.(e),Qa(this.env)}};n(uo,"template","nodexui.SidebarMenuSubButton"),n(uo,"components",{Button:U}),n(uo,"props",{...Ja,active:i(Boolean),isActive:i(Boolean),size:i(String),onClick:i(Function)});var po=class extends u{setup(){this.state=$({collapsed:this.props.collapsed??this.props.defaultCollapsed??!1,authState:this.props.authState??null}),H({shell:this.state,setShellCollapsed:e=>this.setCollapsed(e)}),at(e=>{e.collapsed!==void 0&&(this.state.collapsed=e.collapsed),this.state.authState=e.authState??null})}setCollapsed(e){this.props.collapsed===void 0&&(this.state.collapsed=e),this.props.onCollapsedChange?.(e)}dismissToast(){this.props.onToastOpenChange?.(!1)}runToastAction(){this.props.toast?.onAction?.()}};n(po,"template","nodexui.Shell"),n(po,"components",{Sidebar:zt,Toast:Dt,Button:U}),n(po,"props",{open:i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),collapsed:i(Boolean),defaultCollapsed:i(Boolean),onCollapsedChange:i(Function),authState:i(Object),toast:i(Object),onToastOpenChange:i(Function),notificationPage:i(Function),pwa:i(Function),...p});var ho=class extends u{};n(ho,"template","nodexui.ShellSidebar"),n(ho,"components",{SidebarContent:Te}),n(ho,"props",p);var ss=class extends u{};n(ss,"template","nodexui.ShellSidebarHeader"),n(ss,"props",p);var ns=class extends u{};n(ns,"template","nodexui.ShellNav"),n(ns,"props",p);var is=class extends u{};n(is,"template","nodexui.ShellMain"),n(is,"props",p);var as=class extends u{};n(as,"template","nodexui.ShellHeader"),n(as,"props",p);var mo=class extends u{};n(mo,"template","nodexui.ShellContent"),n(mo,"components",{Skeleton:fe}),n(mo,"props",{loading:i(Boolean),...p});var fo=class extends u{get authState(){return this.env.shell.authState}logout(){this.authState?.onLogout?.()}};n(fo,"template","nodexui.ShellUserMenu"),n(fo,"components",{Button:U}),n(fo,"props",p);var cs=class extends u{get classNames(){return g("table","b-table",this.props.striped!==!1&&"table-striped",this.props.hover!==!1&&"table-hover",this.props.className)}};n(cs,"template","nodexui.Table"),n(cs,"props",{striped:i(Boolean),hover:i(Boolean),responsive:i(Boolean),...p});var Ti=[],$u=new Intl.Collator,ls=4,us=8,Mu=32,bo=class extends u{setup(){this.state=$({query:"",sortKey:null,sortDir:1,page:0,pageSize:this.initialPageSize,selectedKeys:[],hiddenColumns:this.columns.filter(e=>e.hidden||e.visible===!1).map(e=>e.key),columnsOpen:!1,actionRowKey:null,actionMenuStyle:null}),this.actionsMenuRef=P("actionsMenu"),this.actionsMenuTriggerEl=null,$o(window,"click",this.onWindowClick,!0),$o(window,"keydown",this.onWindowKeydown),$o(window,"resize",this.closeRowActions),$o(window,"scroll",this.closeRowActions,!0),it(()=>this.refreshActionsMenuPosition()),Bn(()=>{this.visibleRowsCache=null})}get columns(){return this.props.columns??Ti}get rows(){return this.props.rows??Ti}get initialPageSize(){return et(this.props,"page-size","pageSize")??10}get pageSizeOptions(){return et(this.props,"page-size-options","pageSizeOptions")??[10,20,50,80]}get rowActions(){return et(this.props,"row-actions","rowActions")??Ti}get variant(){return this.props.variant||"default"}get classNames(){return g("b-data-table",`b-data-table-${this.variant}`,this.props.className)}get viewportStyle(){let e=et(this.props,"max-height","maxHeight");return e?`max-height: ${typeof e=="number"?`${e}px`:e};`:""}get hasSearch(){return this.props.searchable!==!1}get hasSorting(){return this.props.sortable!==!1}get hasPagination(){return this.props.pagination!==!1}get hasColumnToggle(){return et(this.props,"column-toggle","columnToggle")??!0}get hasToolbarActions(){return!!this.props.slots?.toolbarActions}get hasSelection(){return this.props.selectable??!1}get visibleColumns(){return this.columns.filter(e=>!this.state.hiddenColumns.includes(e.key))}get visibleRows(){let{query:e,sortKey:o,sortDir:r}=this.state,{rows:s,columns:a}=this,c=this.visibleRowsCache;if(c&&c.rows===s&&c.columns===a&&c.query===e&&c.sortKey===o&&c.sortDir===r)return c.result;let l=e.toLowerCase(),d=a.filter(O=>O.filterable===!0),f=(d.length?d:a).map(O=>O.key),v=s.filter(O=>!l||f.some(k=>String(O[k]).toLowerCase().includes(l)));return o&&(v=[...v].sort((O,k)=>$u.compare(String(O[o]),String(k[o]))*r)),this.visibleRowsCache={rows:s,columns:a,query:e,sortKey:o,sortDir:r,result:v},v}get pageCount(){return Math.max(1,Math.ceil(this.visibleRows.length/this.state.pageSize))}get pageRows(){if(!this.hasPagination)return this.visibleRows;let o=Math.min(this.state.page,this.pageCount-1)*this.state.pageSize;return this.visibleRows.slice(o,o+this.state.pageSize)}get selectedCount(){return this.state.selectedKeys.length}get selectionLabel(){return`${this.selectedCount} of ${this.visibleRows.length} row(s) selected.`}get emptyLabel(){return et(this.props,"empty-label","emptyLabel")??"No results."}get filterPlaceholder(){return et(this.props,"filter-placeholder","filterPlaceholder")??"Filter rows..."}get canPreviousPage(){return this.hasPagination&&this.state.page>0}get canNextPage(){return this.hasPagination&&this.state.page<this.pageCount-1}get pageLabel(){return`Page ${Math.min(this.state.page,this.pageCount-1)+1} of ${this.pageCount}`}rowKey(e,o){return e.id??e.key??o}isSelected(e,o){return this.state.selectedKeys.includes(this.rowKey(e,o))}isColumnSortable(e){return this.hasSorting&&e.sortable===!0}onSearchInput(e){this.state.query=e.target.value,this.state.page=0}sortBy(e){let o=this.columns.find(r=>r.key===e);!o||!this.isColumnSortable(o)||(this.state.sortKey===e?this.state.sortDir=-this.state.sortDir:(this.state.sortKey=e,this.state.sortDir=1))}sortIcon(e){return this.state.sortKey!==e?"arrow-up-down":this.state.sortDir===1?"arrow-up":"arrow-down"}toggleColumn(e){this.state.hiddenColumns.includes(e)?this.state.hiddenColumns=this.state.hiddenColumns.filter(o=>o!==e):this.state.hiddenColumns=[...this.state.hiddenColumns,e]}toggleColumnsMenu(){this.state.columnsOpen=!this.state.columnsOpen}toggleRowActions(e,o,r){let s=this.rowKey(e,o);if(this.state.actionRowKey===s){this.closeRowActions();return}this.actionsMenuTriggerEl=r.currentTarget,this.state.actionRowKey=s,this.state.actionMenuStyle=this.estimateActionMenuStyle(r.currentTarget)}closeRowActions(){this.state.actionRowKey!==null&&(this.state.actionRowKey=null,this.state.actionMenuStyle=null,this.actionsMenuTriggerEl=null)}get openRowAction(){if(this.state.actionRowKey===null)return null;let e=this.pageRows.findIndex((o,r)=>this.rowKey(o,r)===this.state.actionRowKey);return e===-1?null:{row:this.pageRows[e],index:e}}estimateActionMenuStyle(e){let o=e.getBoundingClientRect(),r=this.rowActions.length*Mu+ls*2,s=window.innerHeight-o.bottom,c=s<r+ls&&o.top>s?Math.max(us,o.top-ls-r):o.bottom+ls,l=Math.min(Math.max(us,o.right-160),window.innerWidth-160-us);return`position: fixed; top: ${Math.round(c)}px; left: ${Math.round(l)}px;`}refreshActionsMenuPosition(){if(this.state.actionRowKey===null||!this.actionsMenuTriggerEl)return;let e=this.actionsMenuRef.el;if(!e)return;let o=this.actionsMenuTriggerEl.getBoundingClientRect(),r=e.getBoundingClientRect(),s=window.innerHeight-o.bottom,a=o.top,l=s<r.height+ls&&a>s?Math.max(us,o.top-ls-r.height):Math.min(o.bottom+ls,window.innerHeight-r.height-us),d=Math.min(Math.max(us,o.right-r.width),window.innerWidth-r.width-us),f=`position: fixed; top: ${Math.round(l)}px; left: ${Math.round(d)}px;`;this.state.actionMenuStyle!==f&&(this.state.actionMenuStyle=f)}onWindowClick(e){this.state.actionRowKey===null||this.actionsMenuRef.el?.contains(e.target)||this.actionsMenuTriggerEl?.contains(e.target)||this.closeRowActions()}onWindowKeydown(e){e.key==="Escape"&&this.closeRowActions()}setPage(e){this.state.page=Math.max(0,Math.min(e,this.pageCount-1))}setPageSize(e){this.state.pageSize=Number(e),this.state.page=0}optionValue(e){return`${e}`}toggleRow(e,o,r){let s=this.rowKey(e,o);this.state.selectedKeys=r?[...new Set([...this.state.selectedKeys,s])]:this.state.selectedKeys.filter(a=>a!==s),this.props.onSelectionChange?.(this.state.selectedKeys)}toggleAllVisible(e){let o=this.pageRows.map((r,s)=>this.rowKey(r,s));this.state.selectedKeys=e?[...new Set([...this.state.selectedKeys,...o])]:this.state.selectedKeys.filter(r=>!o.includes(r)),this.props.onSelectionChange?.(this.state.selectedKeys)}onAction(e,o,r){e.onSelect?.(o,r),this.props.onRowAction?.(e,o,r),this.closeRowActions()}columnLabel(e){return e.label??e.key}cellValue(e,o){let r=e[o.key];if(o.format==="currency"){let s=Number(r);return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(Number.isFinite(s)?s:0)}if(o.format==="capitalize"){let s=String(r??"");return s.charAt(0).toUpperCase()+s.slice(1)}return r??""}cellComponentProps(e,o){return o.componentProps?o.componentProps(e,o):{row:e,column:o,value:e[o.key]}}};n(bo,"template","nodexui.DataTable"),n(bo,"components",{Button:U,Icon:Y}),n(bo,"props",{columns:i(Array),rows:i(Array),variant:i(String),searchable:i(Boolean),sortable:i(Boolean),pagination:i(Boolean),selectable:i(Boolean),"column-toggle":i(Boolean),columnToggle:i(Boolean),"row-actions":i(Array),rowActions:i(Array),"page-size":i(Number),pageSize:i(Number),"page-size-options":i(Array),pageSizeOptions:i(Array),"filter-placeholder":i(String),filterPlaceholder:i(String),"empty-label":i(String),emptyLabel:i(String),onRowAction:i(Function),onSelectionChange:i(Function),...p,"max-height":i([String,Number]),maxHeight:i([String,Number])});var Uu=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"}),_u=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],go=class extends u{get baseDate(){return this.props.selected?new Date(`${this.props.selected}T00:00:00`):new Date}get month0(){return(this.props.month??this.baseDate.getMonth()+1)-1}get year(){return this.props.year??this.baseDate.getFullYear()}get headerLabel(){return Uu.format(new Date(this.year,this.month0,1))}get weekdays(){return _u}get days(){let e=new Date(this.year,this.month0+1,0).getDate(),o=new Date(this.year,this.month0,1).getDay(),r=[];for(let s=0;s<o;s++)r.push(null);for(let s=1;s<=e;s++){let a=`${this.year}-${String(this.month0+1).padStart(2,"0")}-${String(s).padStart(2,"0")}`;r.push({day:s,value:a,selected:a===this.props.selected})}return r}onSelect(e){this.props.onChange?.(e)}};n(go,"template","nodexui.Calendar"),n(go,"components",{Button:U}),n(go,"props",{selected:i(String),month:i(Number),year:i(Number),className:i(String),style:i([String,Object]),onChange:i(Function)});var ps=class extends vt{get classNames(){return g("b-date-picker","form-control",this.controlClass,this.isInvalid&&"is-invalid",this.props.className)}onInput(e){this.props.onChange?.(e.target.value,e)}};n(ps,"template","nodexui.DatePicker"),n(ps,"props",{...kt,value:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});var ds=class extends vt{setup(){super.setup(),this.rootRef=P("root");let{state:e}=cn(this.rootRef);this.disclosure=e,this.state=$({query:this.selectedLabel})}get classNames(){return g("form-control",this.controlClass,this.isInvalid&&"is-invalid")}get selectedLabel(){return this.props.options.find(e=>e.value===this.props.value)?.label||""}get filteredOptions(){let e=this.state.query.toLowerCase();return this.props.options.filter(o=>o.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value,this.disclosure.open=!0}onFocus(){this.disclosure.open=!0}choose(e){this.state.query=e.label,this.disclosure.open=!1,this.props.onChange?.(e.value)}};n(ds,"template","nodexui.Combobox"),n(ds,"props",{options:{type:Array},...kt,value:i(String),className:i(String),style:i([String,Object]),id:i(String),onChange:i(Function)});var hs=class extends u{setup(){this.state=$({query:""})}get filteredItems(){let e=this.state.query.toLowerCase();return this.props.items.filter(o=>o.label.toLowerCase().includes(e))}onInput(e){this.state.query=e.target.value}select(e){this.props.onSelect?.(e.value)}};n(hs,"template","nodexui.Command"),n(hs,"props",{items:{type:Array},placeholder:i(String),className:i(String),style:i([String,Object]),onSelect:i(Function)});var ms=class extends u{get classNames(){return g("b-chart",this.props.type&&`b-chart-${this.props.type}`,this.props.variant&&`b-chart-${this.props.variant}`,this.props.className)}};n(ms,"template","nodexui.Chart"),n(ms,"props",{config:i([String,Object]),label:i(String),type:i(String),value:i([String,Number]),variant:i(String),...p});var fs=class extends u{setup(){this.state=$({index:this.props.defaultIndex??0}),this.rootRef=P("root"),this.bootstrapCarousel=null,this.onSlid=e=>{this.state.index=e.to,this.props.onChange?.(this.state.index)},H({carousel:this.state,carouselInstance:()=>this.bootstrapCarousel}),V(()=>{this.bootstrapCarousel=new(z()).Carousel(this.rootRef.el,{interval:!1,wrap:!0,touch:!0}),this.rootRef.el.addEventListener("slid.bs.carousel",this.onSlid)}),Q(()=>{this.rootRef.el.removeEventListener("slid.bs.carousel",this.onSlid),this.bootstrapCarousel?.dispose()})}};n(fs,"template","nodexui.Carousel"),n(fs,"props",{slideCount:{type:Number},defaultIndex:i(Number),onChange:i(Function),...p});var bs=class extends u{setup(){this.rootRef=P("root"),this.initialActive=this.active,it(()=>{if(!this.rootRef.el)return;let e=this.rootRef.el.classList.contains("active");this.active&&!e?this.rootRef.el.classList.add("active"):!this.active&&e&&this.rootRef.el.classList.remove("active")})}get active(){return this.props.state!==void 0?dt(this.props.state):this.env.carousel.index===this.props.index}};n(bs,"template","nodexui.CarouselSlide"),n(bs,"props",{index:{type:Number},state:i(String),...p});var vo=class extends u{onClick(){this.env.carouselInstance()?.prev()}};n(vo,"template","nodexui.CarouselPrevious"),n(vo,"components",{Button:U}),n(vo,"props",p);var xo=class extends u{onClick(){this.env.carouselInstance()?.next()}};n(xo,"template","nodexui.CarouselNext"),n(xo,"components",{Button:U}),n(xo,"props",p);var gs=class extends u{setup(){this.panelRef=P("panel"),this.state=$({width:null})}get panelStyle(){return this.state.width?`width:${this.state.width}px`:""}onPointerDown(e){let o=e.clientX,r=this.panelRef.el.getBoundingClientRect().width,s=this.props.min||160,a=this.props.max||720,c=d=>{this.state.width=Math.min(a,Math.max(s,r+d.clientX-o))},l=()=>{document.removeEventListener("pointermove",c),document.removeEventListener("pointerup",l),this.props.onChange?.(this.state.width)};document.addEventListener("pointermove",c),document.addEventListener("pointerup",l)}};n(gs,"template","nodexui.Resizable"),n(gs,"props",{min:i(Number),max:i(Number),onChange:i(Function),...p});var vs=class extends u{get classNames(){return g("b-scroll-area",this.props.className)}};n(vs,"template","nodexui.ScrollArea"),n(vs,"props",p);var Xa={idle:"b-attachment-idle",uploading:"b-attachment-uploading",processing:"b-attachment-processing",error:"b-attachment-error",done:"b-attachment-done"},tc={default:"b-attachment-default",sm:"b-attachment-sm",xs:"b-attachment-xs"},xs=class extends u{get state(){return Xa[this.props.state]?this.props.state:"done"}get size(){return tc[this.props.size]?this.props.size:"default"}get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-attachment",Xa[this.state],tc[this.size],`b-attachment-${this.orientation}`,!this.hasContent&&"b-attachment-picker",this.props.className)}get hasContent(){return!!this.props.slots?.default}onChange(e){this.props.onChange?.([...e.target.files])}};n(xs,"template","nodexui.Attachment"),n(xs,"props",{state:i(String),size:i(String),orientation:i(String),multiple:i(Boolean),...p,onChange:i(Function)});var ys=class extends u{get variant(){return this.props.variant==="image"?"image":"icon"}get classNames(){return g("b-attachment-media",`b-attachment-media-${this.variant}`,this.props.className)}};n(ys,"template","nodexui.AttachmentMedia"),n(ys,"props",{variant:i(String),...p});var ws=class extends u{};n(ws,"template","nodexui.AttachmentContent"),n(ws,"props",p);var Ss=class extends u{};n(Ss,"template","nodexui.AttachmentTitle"),n(Ss,"props",p);var As=class extends u{};n(As,"template","nodexui.AttachmentDescription"),n(As,"props",p);var Es=class extends u{};n(Es,"template","nodexui.AttachmentActions"),n(Es,"props",p);var yo=class extends u{get variant(){return this.props.variant||"ghost"}get size(){return this.props.size||"icon-xs"}get className(){return g("b-button-icon","b-attachment-action",this.props.className)}get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}onClick(e){this.props.onClick?.(e)}};n(yo,"template","nodexui.AttachmentAction"),n(yo,"components",{Button:U}),n(yo,"props",{type:i(String),variant:i(String),size:i(String),disabled:i(Boolean),label:i(String),...p,"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var wo=class extends u{get classNames(){return g("b-attachment-trigger",this.props.className)}get ariaLabel(){return et(this.props,"aria-label","ariaLabel")}onClick(e){this.props.onClick?.(e)}};n(wo,"template","nodexui.AttachmentTrigger"),n(wo,"components",{Button:U}),n(wo,"props",{href:i(String),target:i(String),rel:i(String),type:i(String),className:i(String),style:i([String,Object]),"aria-label":i(String),ariaLabel:i(String),onClick:i(Function)});var Cs=class extends u{get classNames(){return g("b-attachment-group",this.props.className)}};n(Cs,"template","nodexui.AttachmentGroup"),n(Cs,"props",{...p});var Ls=class extends u{setup(){this.state=$({dragging:!1}),this.fileInput=P("fileInput")}get hasContent(){return!!this.props.slots?.default}get classNames(){return g("b-attachment-dropzone",this.state.dragging&&"b-attachment-dropzone-dragging",this.props.disabled&&"b-attachment-dropzone-disabled",this.props.className)}openPicker(){this.props.disabled||this.fileInput.el?.click()}onInputChange(e){let o=Array.from(e.target.files??[]);e.target.value="",o.length&&this.props.onFilesSelected?.(o)}onDragOver(e){e.preventDefault(),!this.props.disabled&&(this.state.dragging=!0)}onDragLeave(){this.state.dragging=!1}onDrop(e){if(e.preventDefault(),this.state.dragging=!1,this.props.disabled)return;let o=Array.from(e.dataTransfer?.files??[]);o.length&&this.props.onFilesSelected?.(o)}};n(Ls,"template","nodexui.AttachmentDropzone"),n(Ls,"props",{multiple:i(Boolean),disabled:i(Boolean),...p,onFilesSelected:i(Function)});var ks=class extends u{setup(){this.state=$({errored:!1})}get showImage(){return!!this.props.src&&!this.state.errored}onError(){this.state.errored=!0}};n(ks,"template","nodexui.Avatar"),n(ks,"props",{src:i(String),alt:i(String),title:i(String),...p});var Ns=class extends u{get classNames(){return g("b-message",this.props.className)}get side(){return this.props.side||"incoming"}};n(Ns,"template","nodexui.Message"),n(Ns,"props",{side:i(String),...p});var Ts=class extends u{setup(){this.rootRef=P("root"),At(()=>{this.props.autoscroll!==!1&&this.rootRef.el&&(this.rootRef.el.scrollTop=this.rootRef.el.scrollHeight)})}};n(Ts,"template","nodexui.MessageScroller"),n(Ts,"props",{autoscroll:i(Boolean),...p});var Os=class extends u{setup(){this.state=$({index:0}),H({questionnaire:this.state,questionnaireShow:e=>this.show(e)})}show(e){this.state.index=Math.min(this.props.stepCount-1,Math.max(0,e)),this.props.onChange?.(this.state.index)}};n(Os,"template","nodexui.Questionnaire"),n(Os,"props",{stepCount:{type:Number},onChange:i(Function),...p});var Is=class extends u{get active(){return this.props.state!==void 0?dt(this.props.state):this.env.questionnaire.index===this.props.index}};n(Is,"template","nodexui.QuestionnaireStep"),n(Is,"props",{index:{type:Number},state:i(String),...p});var So=class extends u{get disabled(){return this.env.questionnaire.index===0}onClick(){this.env.questionnaireShow(this.env.questionnaire.index-1)}};n(So,"template","nodexui.QuestionnairePrevious"),n(So,"components",{Button:U}),n(So,"props",p);var Ao=class extends u{onClick(){this.env.questionnaireShow(this.env.questionnaire.index+1)}};n(Ao,"template","nodexui.QuestionnaireNext"),n(Ao,"components",{Button:U}),n(Ao,"props",{...p,stepCount:i(Number)});var Rs=class extends u{get max(){return this.props.max||100}get value(){return Math.min(this.max,Math.max(0,this.props.value||0))}get style(){return mt(`--b-progress-value:${this.value/this.max*100}%`,this.props.style)}get classNames(){return g("progress b-progress",this.props.className)}};n(Rs,"template","nodexui.Progress"),n(Rs,"props",{value:i(Number),max:i(Number),className:i(String),style:i([String,Object])});var Wn=gn(sc(),1);Wn.default.stringToBytes=Wn.default.stringToBytesFuncs["UTF-8"];function nc(t,{ecc:e="M"}={}){let o=(0,Wn.default)(0,e);return o.addData(String(t)),o.make(),{size:o.getModuleCount(),isDark:(r,s)=>o.isDark(r,s)}}var Eo=class extends u{get code(){let{matrix:e}=this.props;if(e)return e;let o=this.props.qrContent;return o?(this.encoded?.text!==o&&(this.encoded={text:o,matrix:nc(o)}),this.encoded.matrix):{size:0}}get path(){let{size:e,isDark:o}=this.code,r=[];for(let s=0;s<e;s+=1)for(let a=0;a<e;a+=1)o(s,a)&&r.push(`M${a} ${s}h1v1h-1z`);return r.join("")}get size(){return this.code.size}};n(Eo,"template","nodexui.QRCard"),n(Eo,"components",{Card:te,CardBody:oe,CardHeader:ee,CardTitle:re,CardDescription:se}),n(Eo,"props",{matrix:i(Object),qrContent:i(String),label:i(String),title:i(String),description:i(String),...p});var Bs=class extends u{get classNames(){return g("b-aspect-ratio",this.props.className)}get style(){let e=this.props.ratio||`${this.props.width||16} / ${this.props.height||9}`;return mt(`--b-aspect-ratio:${e}`,this.props.style)}};n(Bs,"template","nodexui.AspectRatio"),n(Bs,"props",{ratio:i(String),width:i(Number),height:i(Number),...p});var $s=class extends u{get classNames(){return g("b-bubble",this.props.className)}get side(){return this.props.side}};n($s,"template","nodexui.Bubble"),n($s,"props",{side:i(String),...p});var Ms=class extends u{get dir(){return this.props.dir==="rtl"?"rtl":"ltr"}};n(Ms,"template","nodexui.Direction"),n(Ms,"props",{dir:i(String),...p});var Us=class extends u{get classNames(){return g("b-item",this.props.className)}get variant(){return this.props.variant}};n(Us,"template","nodexui.Item"),n(Us,"props",{variant:i(String),...p});var _s=class extends u{get orientation(){return this.props.orientation==="vertical"?"vertical":"horizontal"}get classNames(){return g("b-button-group",this.orientation==="vertical"?"btn-group-vertical":"btn-group",(this.props.size==="sm"||this.props.size==="lg")&&`btn-group-${this.props.size}`,this.props.className)}get ariaLabel(){return this.props["aria-label"]}get ariaLabelledby(){return this.props["aria-labelledby"]}};n(_s,"template","nodexui.ButtonGroup"),n(_s,"props",{orientation:i(String),size:i(String),"aria-label":i(String),"aria-labelledby":i(String),...p});var Ps=class extends u{get orientation(){return this.props.orientation==="horizontal"?"horizontal":"vertical"}get classNames(){return g("b-button-group-separator",`b-button-group-separator-${this.orientation}`,this.props.className)}};n(Ps,"template","nodexui.ButtonGroupSeparator"),n(Ps,"props",{orientation:i(String),className:i(String),style:i([String,Object])});var qs=class extends u{get classNames(){return g("b-button-group-text",this.props.className)}};n(qs,"template","nodexui.ButtonGroupText"),n(qs,"props",{...p});var Ds=class extends u{get classNames(){return g("b-field-set",this.props.className)}};n(Ds,"template","nodexui.FieldSet"),n(Ds,"props",{...p});var js=class extends u{get variant(){return this.props.variant||"legend"}get classNames(){return g("b-field-legend",this.props.className)}};n(js,"template","nodexui.FieldLegend"),n(js,"props",{variant:i(String),...p});var Be=class extends u{get classNames(){return g("b-field-group",this.props.className)}};n(Be,"template","nodexui.FieldGroup"),n(Be,"props",{...p});var $e=class extends u{setup(){H({fieldProps:()=>this.props})}get orientation(){return this.props.orientation||"vertical"}get classNames(){return g("b-field",`b-field-orientation-${this.orientation}`,this.props.className)}};n($e,"template","nodexui.Field"),n($e,"props",{orientation:i(String),invalid:i(Boolean),label:i(String),labelBackground:i(String),description:i(String),useTip:i(Number),error:i(String),...p});var Fs=class extends u{get classNames(){return g("b-field-content",this.props.className)}};n(Fs,"template","nodexui.FieldContent"),n(Fs,"props",{...p});var Me=class extends u{get classNames(){return g("b-field-label",this.props.className)}};n(Me,"template","nodexui.FieldLabel"),n(Me,"props",{for:i(String),...p});var zs=class extends u{get classNames(){return g("b-field-title",this.props.className)}};n(zs,"template","nodexui.FieldTitle"),n(zs,"props",{...p});var Ue=class extends u{get classNames(){return g("b-field-description",this.props.className)}};n(Ue,"template","nodexui.FieldDescription"),n(Ue,"props",{...p});var Hs=class extends u{get hasContent(){return!!this.props.slots?.default}get classNames(){return g("b-field-separator",this.props.className)}};n(Hs,"template","nodexui.FieldSeparator"),n(Hs,"props",{...p});var _e=class extends u{get classNames(){return g("b-field-error",this.props.className)}};n(_e,"template","nodexui.FieldError"),n(_e,"props",{message:i(String),...p});function Oi(t){return`Icon${String(t).split("-").filter(Boolean).map(o=>o[0].toUpperCase()+o.slice(1)).join("")}`}var Ws=class extends u{get classNames(){return g("form-label","b-label","b-label",this.props.className)}get state(){return this.props.state||(this.props.required?"required":void 0)}};n(Ws,"template","nodexui.Label"),n(Ws,"props",{for:i(String),required:i(Boolean),state:i(String),...p});var Pu="b-theme",qu="theme",Du="[b-theme-toggle]",ju="[b-theme-label]";function Kn(t){return t==="dark"?"dark":"light"}function Fu(t){return typeof globalThis.location>"u"?null:new URLSearchParams(globalThis.location.search).get(t)}function zu(t,e=document.documentElement){let o=Kn(t);return globalThis.thebase?.theme?.set?globalThis.thebase.theme.set(o):e&&(e.setAttribute("b-theme",o),e.setAttribute("data-bs-theme",o)),o}function ic(t,e,o){try{t.contentWindow?.NodexUI?.theme.set(e),t.contentDocument?.documentElement.setAttribute("b-theme",e),t.contentDocument?.documentElement.setAttribute("data-bs-theme",e)}catch{let r=new URL(t.getAttribute("src"),globalThis.location.href);r.searchParams.set(o,e),t.setAttribute("src",r.pathname+r.search+r.hash)}}function Hu(t){typeof document>"u"||typeof CustomEvent>"u"||document.dispatchEvent(new CustomEvent("nodexui:theme-change",{detail:{theme:t}}))}function Pe(t={}){let e=t.storageKey||Pu,o=t.queryKey||qu,r=t.toggleSelector??Du,s=t.labelSelector??ju,a=t.root||(typeof document>"u"?null:document.documentElement);function c(){return Fu(o)}function l(){return Kn(c()||globalThis.localStorage?.getItem(e)||a?.getAttribute("b-theme")||"light")}function d(D){typeof document>"u"||!r||document.querySelectorAll(r).forEach(X=>{X.setAttribute("aria-pressed",D==="dark"?"true":"false");let I=s?X.querySelector(s):null;I&&(I.textContent=D==="dark"?"Light theme":"Dark theme")})}function f(D){typeof document>"u"||document.querySelectorAll("iframe").forEach(X=>ic(X,D,o))}function v(D,X={}){let I=zu(D,a);return!X.skipStorage&&!c()&&globalThis.localStorage?.setItem(e,I),d(I),f(I),Hu(I),I}function O(){return v(a?.getAttribute("b-theme")==="dark"?"light":"dark")}function k(){if(typeof document>"u")return l();let D=l();return v(D,{skipStorage:!!c()}),r&&document.addEventListener("click",X=>{X.target.closest?.(r)&&O()}),document.querySelectorAll("iframe").forEach(X=>{X.addEventListener("load",()=>ic(X,a?.getAttribute("b-theme")||D,o))}),D}return{current:l,set:v,toggle:O,syncFrames:f,init:k}}var Ii=Pe();typeof window<"u"&&(window.NodexUITheme=Ii);var ac=["btn","b-theme-button",...Object.values(ft),...Object.values(gt)];function dn(t){let e=t==="dark";return{icon:e?"sun":"moon",label:e?"Switch to light theme":"Switch to dark theme",pressed:e?"true":"false"}}function Vn({variant:t="outline",size:e,className:o}={}){return g("btn","b-theme-button",ft[t]||ft.outline,gt[e],o)}var Wt=class extends u{setup(){this.theme=Pe({storageKey:et(this.props,"storage-key","storageKey")}),this.state=$({theme:this.theme.current()}),this.onThemeChange=e=>{this.state.theme=e.detail?.theme||this.theme.current()},V(()=>{this.state.theme=this.theme.set(this.theme.current(),{skipStorage:!0}),document.addEventListener("nodexui:theme-change",this.onThemeChange)}),Q(()=>document.removeEventListener("nodexui:theme-change",this.onThemeChange))}get iconName(){return dn(this.state.theme).icon}get baseUrl(){return et(this.props,"base-url")}get label(){return dn(this.state.theme).label}get pressed(){return dn(this.state.theme).pressed}get classNames(){return Vn(this.props)}get attrs(){return{"b-theme-button":""}}onClick(){let e=this.theme.toggle();this.state.theme=e,this.props.onChange?.(e)}};n(Wt,"template","nodexui.ThemeButton"),n(Wt,"components",{Icon:Y,Button:U}),n(Wt,"props",{variant:i(String),size:i(String),"base-url":i(String),"storage-key":i(String),storageKey:i(String),className:i(String),style:i([String,Object]),onChange:i(Function)});var Co=class extends u{get classNames(){return g("b-toggle","btn",this.props.variant==="outline"?"btn-outline-secondary":"btn-light",this.props.className)}get pressed(){return this.props.state!==void 0?dt(this.props.state):!!this.props.pressed}onClick(){this.props.onChange?.(!this.pressed)}};n(Co,"template","nodexui.Toggle"),n(Co,"components",{Button:U}),n(Co,"props",{pressed:i(Boolean),state:i(String),variant:i(String),...p,onChange:i(Function)});var Ks=class extends u{setup(){this.state=$({selected:new Set}),H({toggleGroup:this.state,toggleGroupSelect:e=>this.select(e)})}select(e){this.props.multiple?this.state.selected.has(e)?this.state.selected.delete(e):this.state.selected.add(e):this.state.selected=this.state.selected.has(e)?new Set:new Set([e]);let o=this.props.multiple?[...this.state.selected]:[...this.state.selected][0];this.props.onChange?.(o)}};n(Ks,"template","nodexui.ToggleGroup"),n(Ks,"props",{multiple:i(Boolean),onChange:i(Function),...p});var Lo=class extends u{get pressed(){return this.env.toggleGroup.selected.has(this.props.value)}onClick(){this.env.toggleGroupSelect(this.props.value)}};n(Lo,"template","nodexui.ToggleGroupItem"),n(Lo,"components",{Button:U}),n(Lo,"props",{value:{type:String},...p});var Wu=/^ {0,3}(`{3,}|~{3,})/,Ku=/^(?:import\s+(?:["'{*]|[A-Za-z_$][\w$]*\s*(?:,|from\b))|export\s+(?:const|let|var|default|function|class|async)\b)/,Vu=/^import\s+(?:([A-Za-z_$][\w$]*)\s*,?\s*)?(?:\{([^}]*)\}\s*)?from\s*(["'])([^"']+)\3\s*;?\s*$/,pc=/^export\s+const\s+([A-Za-z_$][\w$]*)\s*=\s*([\s\S]+?);?\s*$/;function Gn(t){return t?new URL(t,document.baseURI).href:document.baseURI}function Zn(t){let e={source:"",islands:[],imports:[],state:{}},o=[],r=[],s=null;for(let a of String(t??"").split(`
48
+ `)){let c=Wu.exec(a);!s&&c?(r.length&&o.push(cc(r.join(`
49
+ `),e)),r=[a],s=c[1]):s&&Gu(a,s)?(o.push([...r,a].join(`
50
+ `)),r=[],s=null):r.push(a)}return r.length&&o.push(s?r.join(`
51
+ `):cc(r.join(`
52
+ `),e)),e.source=o.join(`
53
+ `),e}function Gu(t,e){let o=/^ {0,3}(`{3,}|~{3,})\s*$/.exec(t);return!!o&&o[1][0]===e[0]&&o[1].length>=e.length}function cc(t,e){let o="",r=0;for(;r<t.length;){if((r===0||t[r-1]===`
54
+ `)&&Ku.test(t.slice(r,r+120))){let c=Yu(t,r);ep(t.slice(r,c).trim(),e),r=c;continue}let a=t[r]==="`"?Qu(t,r):t[r]==="<"&&/[A-Z]/.test(t[r+1]??"")?Xu(t,r,o,e):null;o+=a?a.text:t[r],r=a?a.end:r+1}return o}function Zu(t,e){let o=/\n[ \t]*\n/g;o.lastIndex=e;let r=o.exec(t);return r?r.index+1:t.length}function lc(t,e,o){let r=t.indexOf(`
55
+ `,e);return r<0||r>=o?o:r}function Ju(t){try{return JSON.parse(pc.exec(t.trim())?.[2]),!0}catch{return!1}}function Yu(t,e){let o=Zu(t,e),r=lc(t,e,o);for(;t.startsWith("export",e)&&r+1<o&&!Ju(t.slice(e,r));)r=lc(t,r+1,o);return r}function Qu(t,e){let o=1;for(;t[e+o]==="`";)o+=1;let r="`".repeat(o),s=t.indexOf(`
56
+ `,e),a=t.slice(0,s<0?t.length:s).indexOf(r,e+o),c=a<0?e+o:a+o;return{text:t.slice(e,c),end:c}}function Xu(t,e,o,r){let s=tp(t,e);if(s<0)return null;let a=o.slice(o.lastIndexOf(`
57
+ `)+1),c=/^\s*$/.test(a)&&/^[ \t]*(\n|$)/.test(t.slice(s)),l=r.islands.length;r.islands.push({markup:t.slice(e,s),block:c});let d=c?"div":"span";return{text:`<${d} class="b-markdown-island" data-mdx-island="${l}"></${d}>${c?`
58
+ `:""}`,end:s}}function uc(t,e){let o="";for(let r=e+1;r<t.length;r+=1){let s=t[r];if(o)s===o&&(o="");else if(s==='"'||s==="'")o=s;else if(s===">")return{end:r+1,selfClosing:t[r-1]==="/"}}return null}function tp(t,e){let o=uc(t,e);if(!o)return-1;if(o.selfClosing)return o.end;let r=/^<([A-Z]\w*)/.exec(t.slice(e,e+80))[1],s=new RegExp(`<(/?)${r}(?=[\\s/>])`,"g");s.lastIndex=o.end;let a=1;for(let c=s.exec(t);c;c=s.exec(t)){if(c[1]){if(a-=1,a===0)return t.indexOf(">",c.index)+1;continue}let l=uc(t,c.index);if(!l)return-1;l.selfClosing||(a+=1),s.lastIndex=l.end}return-1}function ep(t,e){if(t.startsWith("import")){let r=Vu.exec(t);if(!r)throw new Error(`Unsupported import in Markdown: ${t}`);let[,s,a="",,c]=r;s&&e.imports.push({specifier:c,imported:"default",local:s});for(let l of a.split(",").map(d=>d.trim()).filter(Boolean)){let[d,f=d]=l.split(/\s+as\s+/);e.imports.push({specifier:c,imported:d,local:f})}return}let o=pc.exec(t);if(!o)throw new Error(`Unsupported export in Markdown (use \`export const name = <JSON>\`): ${t}`);try{e.state[o[1]]=JSON.parse(o[2])}catch{throw new Error(`export const ${o[1]} must be a JSON value`)}}function op(t,e){if(!/^(\.{0,2}\/|[a-z][a-z0-9+.-]*:)/i.test(t))return t;let o=new URL(t,e);if(o.origin!==window.location.origin)throw new Error(`Import blocked (not same-origin): ${t}`);return o.href}function rp(t){return typeof t=="function"&&typeof t.template=="string"}async function dc(t,e,o=r=>import(r)){let r={components:{},values:{}};for(let s of t.imports){let c=(await o(op(s.specifier,e)))[s.imported];if(c===void 0)throw new Error(`"${s.imported}" is not exported by "${s.specifier}"`);(rp(c)?r.components:r.values)[s.local]=c}return r}Bi();var $i,Mi,Ui,xp=0;function yp(){return $i??($i=import("./runtime/marked/marked.min.js").then(t=>{let e=t.marked||t.default?.marked||globalThis.marked;if(!e?.parse)throw new Error("NodexUI markdown: failed to load src/runtime/marked/marked.min.js");return e})),$i}function wp(t){let e=t.closest("[data-bs-theme]")?.getAttribute("data-bs-theme")||document.documentElement.getAttribute("data-bs-theme");return(e?e==="dark":window.matchMedia?.("(prefers-color-scheme: dark)").matches)?"dark":"default"}function Sp(){return Mi??(Mi=import("./runtime/mermaid/mermaid.esm.min.js").then(t=>t.default||t)),Mi}function Ap(){return Ui??(Ui=import("./runtime/milkdown/milkdown-editor.js")),Ui}async function Qn(t,e={}){return(await yp()).parse(String(t??""),{gfm:!0,breaks:!1,...e})}function Yn(t,e,o,r=""){t.classList.add("b-markdown-diagram-error"),t.replaceChildren();let s=document.createElement("p");if(s.className="b-markdown-diagram-error-message",s.textContent=`Unable to render ${e} diagram: ${o?.message||o}`,t.append(s),r){let a=document.createElement("pre"),c=document.createElement("code");c.textContent=r,a.append(c),t.append(a)}}async function Ep(t){let e=[...t.querySelectorAll("pre > code.language-mermaid")];if(!e.length)return;let o;try{o=await Sp()}catch(r){e.forEach(s=>{let a=s.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid",Yn(a,"mermaid",r,s.textContent)});return}o.initialize({startOnLoad:!1,securityLevel:"strict",theme:wp(t)});for(let r of e){let s=r.textContent,a=r.closest("pre");a.replaceChildren(),a.className="b-markdown-diagram b-markdown-mermaid";try{let{svg:c}=await o.render(`b-mermaid-${++xp}`,s);a.isConnected&&(a.innerHTML=c)}catch(c){a.isConnected&&Yn(a,"mermaid",c,s)}}}function Cp(t){let e=globalThis.thebase;if(!e?.mountAll)return;let o=document.createElement("div");o.setAttribute("b-ui","toast"),o.setAttribute("b-att-state","open"),o.setAttribute("b-att-delay","2000"),o.className="b-markdown-b-copy-toast",o.textContent=t,document.body.append(o),e.mountAll(o),o.addEventListener("nodexui:close",()=>o.remove(),{once:!0})}function Lp(t){let e=document.createElement("div");e.className="b-markdown-b-code";let o=document.createElement("button");o.type="button",o.className="b-markdown-b-copy";let r=document.createElement("span");ut(r,"copy",{label:"Copy code"}),o.append(r),o.addEventListener("click",async()=>{try{await an(t),o.dispatchEvent(new CustomEvent("nodexui:markdown-copy",{bubbles:!0,detail:{source:t}})),Cp("Copied to clipboard")}catch(c){o.dispatchEvent(new CustomEvent("nodexui:markdown-copy-error",{bubbles:!0,detail:{error:c}}))}}),e.append(o);let s=document.createElement("pre"),a=document.createElement("code");a.className="b-markdown-b-code-lines";for(let c of t.replace(/\n$/,"").split(`
59
+ `)){let l=document.createElement("span");l.className="b-markdown-b-code-line",l.textContent=c,a.append(l)}return s.append(a),e.append(s),e}var _i;function kp(){return _i??(_i=qe("/dist/nodexui.templates.xml")),_i}var Pi=new WeakMap;function En(t){let e=Pi.get(t);if(e){Pi.delete(t);for(let o of e)try{o.destroy()}catch{}}}var Np=/\bstate\.([A-Za-z_$][\w$]*)/g;function Tp(t){return new Set([...t.matchAll(Np)].map(e=>e[1]))}var Op=/\bthis\.([A-Za-z_$][\w$]*)\s*\(/g,Ip=/\bt-on-[\w:-]+\s*=\s*(["'])([A-Za-z_$][\w$]*)\1/g;function Rp(t){let e=new Set;for(let o of t.matchAll(Op))e.add(o[1]);for(let o of t.matchAll(Ip))e.add(o[2]);return e}function Bp(t,{components:e={},values:o={},state:r}={}){let s=wi({raw:[t]}),a=Tp(t);class c extends u{setup(){let d=r??{};for(let f of a)d[f]??(d[f]="");this.state=$(d);for(let[f,v]of Object.entries(o))this[f]=typeof v=="function"?v.bind(this):v}}n(c,"template",s),n(c,"components",{...e});for(let l of Rp(t))c.prototype[l]=function(){};return c}function Sc(t){t.querySelector("[data-slot='dropdown-menu'], .b-dropdown-menu, [b-ui='dropdown-menu'], [b-dropdown-menu]")&&t.classList.add("b-markdown-b-preview-overlay")}async function wc(t,e,o){let[r,s]=await Promise.all([kp(),Bp(e,o)]),a=await Mo(s,t,{templates:r});return Sc(t),a}function $p(t,e){let o=globalThis.thebase;if(!o?.mountAll)throw new Error("NodexUI runtime not found on the page \u2014 load dist/nodexui.min.js before mounting Markdown.");t.innerHTML=e,Sc(t),o.mountAll(t)}async function Mp(t,{mdx:e,baseUrl:o}={}){En(t);let r=[...t.querySelectorAll("pre > code.language-base-ui, pre > code.language-base-ui-render")],s=e?[...t.querySelectorAll("[data-mdx-island]")].filter(d=>!d.hasChildNodes()):[];if(!r.length&&!s.length)return;let a=new Set,c={},l=null;try{e?.imports.length&&(c=await dc(e,o))}catch(d){l=d}for(let d of r){let f=d.textContent,v=d.closest("pre"),O=d.classList.contains("language-base-ui-render");v.replaceChildren(),v.className=O?"b-markdown-live b-markdown-nodexui b-markdown-render":"b-markdown-live b-markdown-nodexui";let k=document.createElement("div");k.className="b-markdown-b-preview",v.append(k),O||v.append(Lp(f));try{if(/<[A-Z]/.test(f)){if(l)throw l;a.add(await wc(k,f,c))}else $p(k,f)}catch(D){Yn(v,"NodexUI component",D,f)}}for(let d of s){let{markup:f}=e.islands[Number(d.dataset.mdxIsland)];try{if(l)throw l;a.add(await wc(d,f,{...c,state:e.state}))}catch(v){Yn(d,"MDX component",v,f)}}a.size&&Pi.set(t,a)}function Up(t){for(let e of t.querySelectorAll("li > input[type=checkbox]:not([aria-label])"))e.setAttribute("aria-label",e.parentElement.textContent.trim())}async function Xn(t,{mermaid:e=!0,nodexUi:o=!0,mdx:r,baseUrl:s}={}){Up(t),e&&await Ep(t),o&&await Mp(t,{mdx:r,baseUrl:s})}async function ti(t){return(await Ap()).createMilkdownMarkdownEditor(t)}function ei(t){let e=String(t??""),o=/^---\r?\n([\s\S]*?)\r?\n---[ \t]*\r?\n?/.exec(e);if(!o)return{data:{},content:e};let r={};for(let s of o[1].split(/\r?\n/)){let a=s.trim();if(!a||a.startsWith("#"))continue;let c=a.indexOf(":");if(c===-1)continue;let l=a.slice(0,c).trim();l&&(r[l]=_p(a.slice(c+1).trim()))}return{data:r,content:e.slice(o[0].length)}}function Ac(t){return t.length>=2&&(t[0]==='"'&&t.at(-1)==='"'||t[0]==="'"&&t.at(-1)==="'")?t.slice(1,-1):t}function _p(t){if(t==="")return"";if(t==="true")return!0;if(t==="false")return!1;if(/^-?\d+(\.\d+)?$/.test(t))return Number(t);if(t.startsWith("[")&&t.endsWith("]")){let e=t.slice(1,-1).trim();return e?e.split(",").map(o=>Ac(o.trim())):[]}return Ac(t)}function Vs(t,e){if(!t)return null;if(t.type==="file"&&(t.path===e||t.meta?.slug===e))return t;for(let o of t.children||[]){let r=Vs(o,e);if(r)return r}return null}function oi(t,e){if(t.type==="dir"&&t.path===e)return t;for(let o of t.children||[]){let r=o.type==="dir"?oi(o,e):null;if(r)return r}return null}function Pp(t){return t.replace(/\.[^./]+$/,"").replace(/[_-]+/g," ").trim().split(/\s+/).map(o=>o.charAt(0).toUpperCase()+o.slice(1)).join(" ")}function Ec(t){return t.meta?.sidebar_label||t.meta?.title||Pp(t.name)}function Cc(t,{exclude:e,formatLabel:o},r){if(t.type==="file"){let a=o?.(t),c=a?{...t,meta:{...t.meta,sidebar_label:a}}:t;return Ec(c).toLowerCase().includes(r)?c:null}let s=(t.children||[]).filter(a=>!e?.includes(a.path)).map(a=>Cc(a,{exclude:e,formatLabel:o},r)).filter(Boolean);return r&&!s.length?null:{...t,children:s}}function qp(t,{include:e,exclude:o,filter:r,formatLabel:s}){let a=e?{...t,children:e.map(c=>Vs(t,c)).filter(Boolean)}:t;return Cc(a,{exclude:o,formatLabel:s},(r||"").trim().toLowerCase())??{...t,children:[]}}var hn=class hn extends u{setup(){this.state=$({open:!1})}toggle(){this.state.open=!this.state.open}get label(){return Ec(this.props.node)}get hasSubfolders(){return(this.props.node.children||[]).some(e=>e.type==="dir")}select(e){this.props.onSelect(e)}};n(hn,"template","nodexui.MarkdownTreeNode"),n(hn,"components",{MarkdownTreeNode:hn,Icon:Y,SidebarGroupLabel:Ie,SidebarMenu:Ht,SidebarMenuItem:Re,SidebarMenuButton:Ft,DropdownMenu:xe,DropdownMenuTrigger:Pt,DropdownMenuContent:ye,DropdownMenuItem:we,DropdownMenuSub:Se,DropdownMenuSubTrigger:qt,DropdownMenuSubContent:Ae}),n(hn,"props",{node:{type:Object},activePath:i(String),onSelect:{type:Function},nested:i(Boolean)});var mn=hn,Kt=class extends u{setup(){this.state=$({tree:null,status:"loading",error:""}),St(()=>this.load())}get rootNode(){let e=this.state.tree;return qp(this.props.root?oi(e,this.props.root)??e:e,this.props)}async load(){this.state.status="loading",this.state.error="";try{let e=await fetch(this.props.src);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);this.state.tree=await e.json(),this.state.status="ready"}catch(e){this.state.status="error",this.state.error=e.message||String(e)}}};n(Kt,"template","nodexui.MarkdownTree"),n(Kt,"components",{MarkdownTreeNode:mn,SidebarGroup:Oe,SidebarMenu:Ht}),n(Kt,"props",{src:{type:String},root:i(String),include:i(Array),exclude:i(Array),filter:i(String),formatLabel:i(Function),activePath:i(String),onSelect:{type:Function},className:i(String),style:i([String,Object])});var qi=new Map;function Dp(t){return qi.has(t)||qi.set(t,fetch(t).then(e=>e.ok?e.json():null).catch(()=>null)),qi.get(t)}async function jp(t){let e=await fetch(t);if(e.ok)return e;let o=t.endsWith("/")?t:t.slice(0,t.lastIndexOf("/")+1);for(let r of["readme.md","README.md"]){let s=await fetch(o+r).catch(()=>null);if(s?.ok)return s}return e}var Ot=class extends u{setup(){this.rootRef=P("root"),this.editorRef=P("editor"),this.editorHandle=null,this.manifest=null,this.mdx=null,this.state=$({html:"",source:"",status:"loading",error:"",frontmatter:{}}),St(()=>this.load(this.props)),at(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),V(()=>this.afterRender()),it(()=>this.afterRender()),De(()=>{this.destroyEditor(),this.rootRef.el&&En(this.rootRef.el)})}get classNames(){return g("b-markdown",this.props.className)}onLinkClick(e){let{tree:o,src:r,onNavigate:s}=this.props,a=e.target.closest?.("a[href]");if(!o||!s||!r||!a||e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey)return;let c=a.getAttribute("href");if(!c||c.startsWith("#")||/^[a-z][a-z0-9+.-]*:/i.test(c)||c.startsWith("//"))return;let l=new URL(c,new URL(r,window.location.origin)),d=Vs(this.manifest,decodeURIComponent(l.pathname.replace(/^\//,"")));d&&(e.preventDefault(),s(d.path,l.hash))}get editorLabel(){return this.props.collaborative?"Collaborative Markdown editor":"Markdown editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src||e.tree!==this.props.tree}shouldRestartEditor(e){return e.editable!==this.props.editable||e.collaborative!==this.props.collaborative||e.room!==this.props.room||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let o=e.content??"";if(this.manifest=e.tree?await Dp(e.tree):null,e.src)try{let r=await jp(e.src);if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);o=await r.text()}catch(r){this.state.status="error",this.state.error=r.message||String(r);return}try{this.state.source=o;let{data:r,content:s}=ei(o);this.state.frontmatter=r,this.mdx=this.props.nodexUi===!1?null:Zn(s),this.state.html=Rn(await Qn(this.mdx?.source??s)),this.state.status="ready"}catch(r){this.state.status="error",this.state.error=r.message||String(r)}}get hasFrontmatterMeta(){let e=this.state.frontmatter;return!!(e.tags?.length||e.authors?.length)}enhance(){let e=this.rootRef.el;!e||this.state.status!=="ready"||Xn(e,{mermaid:this.props.mermaid!==!1,nodexUi:this.props.nodexUi!==!1,mdx:this.mdx,baseUrl:Gn(this.props.src)})}afterRender(){this.props.editable?this.mountEditor():this.enhance()}async mountEditor(){let e=this.editorRef.el;if(!(!e||this.editorHandle||this.state.status!=="ready"))try{this.editorHandle=await ti({root:e,value:this.state.source,collaborative:!!this.props.collaborative,room:this.props.room||"b-markdown",password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(o,r,s)=>{this.state.source=o,this.props.onChange?.(o,r,s)}})}catch(o){this.state.status="error",this.state.error=o.message||String(o)}}destroyEditor(){this.editorHandle?.destroy?.(),this.editorHandle=null}};n(Ot,"template","nodexui.Markdown"),n(Ot,"components",{Badge:Et}),n(Ot,"props",{content:i(String),src:i(String),mermaid:i(Boolean),nodexUi:i(Boolean),editable:i(Boolean),collaborative:i(Boolean),room:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),tree:i(String),onNavigate:i(Function),className:i(String),style:i([String,Object])});var Lc={implicit:"Implicit",password:"Resource Owner Password Credentials",application:"Client Credentials",accessCode:"Authorization Code"},Fp=["POST","PUT","PATCH"];function Gs(t){try{return sessionStorage.getItem(t)||""}catch{return""}}function Cn(t,e){try{e?sessionStorage.setItem(t,e):sessionStorage.removeItem(t)}catch{}}function ji(){return!!(Gs("apikey")||Gs("oauthkey"))}function Di(t){return t.example!==void 0?String(t.example):t.default!==void 0?String(t.default):t.enum?.length?String(t.enum[0]):t.type==="integer"||t.type==="number"?t.format==="int64"?"10":"1":t.type==="boolean"?"true":t.required&&t.in==="path"?"string":""}function Fi(t,e){let o=Gs("apikey"),r=Gs("oauthkey");for(let s of t.security)s.type==="apiKey"&&s.in==="header"?e.header[s.name]=o:s.type==="apiKey"&&s.in==="query"?e.query[s.name]=o:s.type==="basic"?e.header.Authorization=o?`Basic ${o}`:"":(s.type==="oauth2"||s.type==="bearer")&&(e.header.Authorization=r?`Bearer ${r}`:"")}function kc(t,e){let o={baseUrl:e,path:{},query:{},header:{},bodyText:"",mimeType:t.consumes?.[0]||"application/json"};return t.parameters.path.forEach(r=>{o.path[r.name]=Di(r)}),t.parameters.query.forEach(r=>{o.query[r.name]=r.required?Di(r):""}),t.parameters.header.forEach(r=>{o.header[r.name]=r.required?Di(r):""}),t.produces?.length&&(o.header.Accept=t.produces.includes("application/json")?"application/json":t.produces[0]),t.parameters.body&&(o.mimeType=t.parameters.body.contentType||o.mimeType,o.bodyText=zi(t.parameters.body.example)),Fi(t,o),o}function zi(t){return typeof t=="string"?t:JSON.stringify(t,null,2)??""}function Hi(t,e){let o=t.path;for(let[s,a]of Object.entries(e.path))o=o.replace(`{${s}}`,encodeURIComponent(a??""));let r=!!t.parameters.body&&Fp.includes(t.method);return{method:t.method,url:`${e.baseUrl}${o}`,query:Object.entries(e.query).filter(([,s])=>s!==""),headers:Object.entries(e.header).filter(([,s])=>s!==""),bodyText:r?e.bodyText:"",mimeType:e.mimeType}}function Nc(t){let e=t.query.length?`${t.url}?${new URLSearchParams(t.query)}`:t.url,o=Object.fromEntries(t.headers);return t.bodyText&&(o["Content-Type"]=o["Content-Type"]||t.mimeType),{url:e,headers:o,headerLines:Object.entries(o).map(([r,s])=>`${r}: ${s}`).join(`
60
+ `)}}async function Tc(t,e){let o=performance.now(),r=await fetch(e.url,{method:t.method,headers:e.headers,body:t.bodyText||void 0}),s=Math.round(performance.now()-o),a=await r.text();return{status:r.status,statusText:r.statusText,ms:s,headerLines:[...r.headers.entries()].map(([c,l])=>`${c}: ${l}`).join(`
61
+ `),bodyText:zp(a)}}function zp(t){try{return JSON.stringify(JSON.parse(t),null,2)}catch{return t}}function Oc(t){let e=parseInt(t,10);return t==="default"||Number.isNaN(e)?"default":e<300?"2xx":e<400?"3xx":e<500?"4xx":"5xx"}function Ic(t,e,o){if(!t)return"";try{let r=new URL(e),s=new URL(o.derivedBaseUrl||o.baseUrl||e),a=new URL(t,`${r.href.replace(/\/$/,"")}/`);return a.host===s.host&&(a.protocol=r.protocol,a.username=r.username,a.password=r.password,a.host=r.host),a.href}catch{return String(t)}}function Rc(){return Array.from(crypto.getRandomValues(new Uint8Array(16)),t=>t.toString(16).padStart(2,"0")).join("")}function Bc({def:t,clientId:e,scopes:o,state:r,redirectUri:s,baseUrl:a,doc:c}){let l=new URL(Ic(t.authorizationUrl,a,c));return l.searchParams.set("response_type",t.flow==="implicit"?"token":"code"),e&&l.searchParams.set("client_id",e),l.searchParams.set("redirect_uri",s),o.length&&l.searchParams.set("scope",o.join(" ")),l.searchParams.set("state",r),l.toString()}async function $c(t,e,o,r){if(!t)throw new Error("No tokenUrl defined for this scheme.");let s=new URLSearchParams;for(let[l,d]of Object.entries(e))d&&s.set(l,d);let a=await fetch(Ic(t,o,r),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:s.toString()}),c=await a.json().catch(()=>({}));if(!a.ok||!c.access_token)throw new Error(c.error_description||c.error||`HTTP ${a.status}`);return c.access_token}function Mc(t,e,o){let r={client_id:e.clientId,client_secret:e.clientSecret,scope:o.join(" ")};return t==="password"?{grant_type:"password",username:e.username,password:e.password,...r}:{grant_type:"client_credentials",...r}}var Vc;function Cd(){return Vc??(Vc=Promise.resolve().then(()=>(Kc(),Wc)))}var Ld=["curl","csharp","go","node","ruby","php"],kd="(max-width: 1100px)",Nd=3;function Zc(t){return t==="DELETE"?"DEL":t}function Td(){let t=[...document.scripts].find(e=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(e.src));return t?`${t.src.replace(/[?#].*$/,"").replace(/\/[^/]*$/,"")}/apidoc`:""}var Gc=new WeakMap;function Od(t){let e=Gc.get(t);if(!e){e=new Map;for(let o of t)e.has(o.parent)||e.set(o.parent,[]),e.get(o.parent).push(o);Gc.set(t,e)}return e}var Gt=class extends u{constructor(){super(...arguments);n(this,"methodLabel",Zc)}get children(){return Od(this.props.groups).get(this.props.group.name)||[]}};n(Gt,"template","nodexui.ApiDocGroup"),n(Gt,"props",{group:Object,groups:Array,current:String,href:Function,onSelect:Function});Gt.components={ApiDocGroup:Gt,Icon:Y};var Vt=class extends u{constructor(){super(...arguments);n(this,"methodLabel",Zc);n(this,"statusClass",Oc);n(this,"formatExample",zi)}setup(){this.rootRef=P("root"),this.mainRef=P("main"),this.doc=null,this.pendingOAuth=new Map,this.watchers=new Set,this.rowsCache=new WeakMap,this.snippetSeq=0,this.overlayQuery=window.matchMedia(kd),this.state=$({status:"loading",error:"",current:"introduction",lang:this.props.language||"curl",sidebarOpen:!this.overlayQuery.matches,systemTheme:"light",themeOverride:"",drafts:{},snippet:"",result:null,respTab:0,respView:{},authOpen:!1,authed:ji(),stored:{apikey:"",oauthkey:""},inputs:{apikey:"",oauthkey:""},oauth:{},oauthStatus:{}}),this.onHashChange=()=>this.setCurrent(this.routeId()),this.onViewportChange=()=>{this.state.sidebarOpen=!this.overlayQuery.matches},this.onDocumentClick=o=>this.closeSidebarOnOutsideClick(o),this.onOAuthMessage=o=>this.handleOAuthMessage(o),this.onThemeChange=()=>this.readSystemTheme(),St(()=>this.load(this.props)),at(o=>this.shouldReload(o)?this.load(o):void 0),V(()=>this.addListeners()),De(()=>this.removeListeners())}get classNames(){return g("b-apidoc",this.props.className)}get rootStyle(){return mt(this.props.height?`--b-apidoc-height:${this.props.height}`:"",this.props.style)}get theme(){return(this.props.theme==="light"||this.props.theme==="dark"?this.props.theme:"")||this.state.themeOverride||this.state.systemTheme}get title(){return this.props.title||this.doc?.info.title||"API Documentation"}get tryItEnabled(){return this.props.tryIt!==!1}get hasSecurity(){return this.props.authorize!==!1&&Object.keys(this.doc?.securityDefinitions||{}).length>0}get languages(){let o=this.logic?.LANGUAGES||[],r=this.props.languages;return r?.length?o.filter(s=>r.includes(s.id)):o}get currentLanguage(){return this.languages.find(o=>o.id===this.state.lang)||this.languages[0]}get op(){return this.state.current==="introduction"?null:this.doc.findOperation(this.state.current)}get draft(){return this.state.drafts[this.state.current]}get showTryIt(){return this.tryItEnabled&&!!this.op}get sidebarGroups(){let o=this.doc.groups.filter(r=>!r.parent);return this.doc.webhooks.length&&o.push({id:"webhooks",name:"Webhooks",items:this.doc.webhooks,kind:""}),o}get breadcrumb(){let o=this.op;if(!o)return[{label:"Home",id:"introduction",home:!0},{label:"Introduction"}];let r=this.doc.groups.find(s=>s.name===o.tag);return[{label:"Home",id:"introduction",home:!0},{label:this.title,id:"introduction"},{label:o.tag,id:r?r.items[0].id:"introduction"},{label:o.summary}]}get authSchemes(){return Object.entries(this.doc.securityDefinitions).map(([o,r])=>({key:o,def:r,scopes:Object.entries(r.scopes||{})}))}get serverOptions(){return this.doc.servers.length?this.doc.servers:[{url:this.doc.baseUrl,name:"",description:""}]}get tryItParams(){let{path:o,query:r,header:s}=this.op.parameters;return[...o.map(a=>({...a,group:"path"})),...r.map(a=>({...a,group:"query"})),...s.map(a=>({...a,group:"header"}))]}get selectedBaseUrl(){return this.draft?.baseUrl||this.doc.baseUrl}serverLabel(o){let r=[o.name,o.description].filter(Boolean).join(" \u2014 ");return r?`${r} (${o.url})`:o.url}languageTone(o){return Ld.includes(o)?o:"default"}encodingEntries(o){return Object.entries(o)}oauthFlowLabel(o){return Lc[o]||o||"unknown"}schemaRows(o){return this.rowsCache.has(o)||this.rowsCache.set(o,this.doc.schemaRows(o)),this.rowsCache.get(o)}depth(o){return(o.match(/\./g)||[]).length}lineNumbers(o){return String(o||"").split(`
62
+ `).map((r,s)=>s+1)}iconUrl(o){let r=this.props.assetBase??this.assetBase??(this.assetBase=Td());return r?`${r.replace(/\/$/,"")}/${o.icon}`:""}href(o){return this.props.hash?`#/${o}`:"#"}shouldReload(o){return o.src!==this.props.src||o.spec!==this.props.spec||o.serverUrl!==this.props.serverUrl}async load(o){this.state.status="loading";try{this.logic=await Cd(),this.doc=o.spec?this.logic.buildOpenApiDoc(o.spec,o.serverUrl):await this.logic.loadOpenApiDoc(o.src,o.serverUrl)}catch(r){this.state.status="error",this.state.error=r.message||String(r),o.onError?.(r);return}this.state.drafts={},this.state.current=this.routeId(o),this.ensureDraft(),this.state.status="ready",this.updateSnippet(),o.onLoad?.(this.doc)}routeId(o=this.props){let r=o.hash?location.hash.replace(/^#\//,""):o.operation;return r&&this.doc.findOperation(r)?r:"introduction"}go(o,r){this.props.hash||(o.preventDefault(),this.setCurrent(r)),this.overlayQuery.matches&&(this.state.sidebarOpen=!1)}setCurrent(o){let r=this.state;r.current=o,r.result=null,r.respTab=0,r.respView={},this.ensureDraft(),this.updateSnippet(),this.mainRef.el&&(this.mainRef.el.scrollTop=0),this.props.onNavigate?.(o)}ensureDraft(){let o=this.op;o&&!this.state.drafts[o.id]&&(this.state.drafts[o.id]=kc(o,this.doc.baseUrl))}toggleSidebar(){this.state.sidebarOpen=!this.state.sidebarOpen}closeSidebarOnOutsideClick(o){!this.overlayQuery.matches||!this.state.sidebarOpen||o.target.closest?.(".sidebar-shell, .sidebar-toggle")||(this.state.sidebarOpen=!1)}selectResponse(o){this.state.respTab=Number(o)}setResponseView(o,r){this.state.respView[o]=r}setLanguage(o){this.state.lang=o,this.updateSnippet()}onBaseUrl(o){this.draft.baseUrl=o,this.updateSnippet()}onParam(o,r,s){this.draft[r][s]=o,this.updateSnippet()}onBody(o){this.draft.bodyText=o,this.updateSnippet()}async updateSnippet(){let o=this.op;if(!o||!this.tryItEnabled)return;let r=this.currentLanguage,s=++this.snippetSeq,a;try{a=await this.logic.generateSnippet(r.id,Hi(o,this.draft))}catch(c){a=`// Could not generate ${r.label} snippet: ${c.message}`}s===this.snippetSeq&&(this.state.snippet=a)}async send(){let o=this.op,r=Hi(o,this.draft),s=Nc(r),a={method:r.method,url:s.url,headerLines:s.headerLines,bodyText:r.bodyText};this.state.result={phase:"sending",sent:a};let c;try{c={phase:"done",sent:a,res:await Tc(r,s)}}catch(l){c={phase:"error",sent:a,message:l.message}}this.state.current===o.id&&(this.state.result=c)}clearResult(){this.state.result=null}collapseRequest(){this.rootRef.el.querySelectorAll(".tryit-card details").forEach((o,r)=>{r<Nd&&(o.open=!1)})}toggleTheme(){this.state.themeOverride=this.theme==="dark"?"light":"dark"}readSystemTheme(){let o=document.documentElement.getAttribute("data-bs-theme"),r=o?o==="dark":window.matchMedia("(prefers-color-scheme: dark)").matches;this.state.systemTheme=r?"dark":"light"}openAuth(){var r;let o=this.state;o.stored.apikey=Gs("apikey"),o.stored.oauthkey=Gs("oauthkey"),o.inputs.apikey=o.stored.apikey,o.inputs.oauthkey=o.stored.oauthkey;for(let{key:s,def:a}of this.authSchemes)(r=o.oauth)[s]??(r[s]={clientId:"",clientSecret:"",username:"",password:"",scopes:Object.keys(a.scopes||{})});o.authOpen=!0}closeAuth(){this.state.authOpen=!1}setAuthOpen(o){this.state.authOpen=o}setAuthInput(o,r){this.state.inputs[o]=r}setField(o,r,s){o[r]=s}saveAuth(){Cn("apikey",this.state.inputs.apikey.trim()),Cn("oauthkey",this.state.inputs.oauthkey.trim()),this.closeAuth(),this.applyAuthToAll()}clearAuth(o){Cn(o,""),this.state.stored[o]="",this.state.inputs[o]="",this.applyAuthToAll()}applyAuthToAll(){for(let[o,r]of Object.entries(this.state.drafts))Fi(this.doc.findOperation(o),r);this.state.authed=ji(),this.updateSnippet()}toggleScope(o,r){let s=this.state.oauth[o].scopes,a=s.indexOf(r);a<0?s.push(r):s.splice(a,1)}setOAuthStatus(o,r,s=!1){this.state.oauthStatus[o]={message:r,isError:s}}applyOAuthToken(o,r,s){Cn("oauthkey",r),this.state.stored.oauthkey=r,this.state.inputs.oauthkey=r,Object.assign(this.state.oauth[o],{clientId:s.clientId,clientSecret:s.clientSecret}),this.applyAuthToAll(),this.setOAuthStatus(o,"Token acquired.")}async fetchToken(o,r,s){try{let a=await $c(this.doc.securityDefinitions[o].tokenUrl,r,this.selectedBaseUrl,this.doc);this.applyOAuthToken(o,a,s)}catch(a){this.setOAuthStatus(o,`Token request failed: ${a.message}. This is usually a CORS restriction on the auth server.`,!0)}}startOAuth2Flow(o){let r=this.doc.securityDefinitions[o],s=this.state.oauth[o],a=[...s.scopes];if(r.flow==="implicit"||r.flow==="accessCode")return this.openOAuthPopup(o,r,s,a);if(r.flow==="password"||r.flow==="application")return this.setOAuthStatus(o,"Requesting token\u2026"),this.fetchToken(o,Mc(r.flow,s,a),s);this.setOAuthStatus(o,`Unsupported OAuth2 flow: ${r.flow}`,!0)}openOAuthPopup(o,r,s,a){if(!r.authorizationUrl)return this.setOAuthStatus(o,"No authorizationUrl defined for this scheme.",!0);let c=Rc(),l=Bc({def:r,clientId:s.clientId,scopes:a,state:c,redirectUri:this.redirectUri,baseUrl:this.selectedBaseUrl,doc:this.doc}),d=window.open(l,`oauth2-authorize-${o}`,"width=560,height=680");if(!d)return this.setOAuthStatus(o,"Popup blocked \u2014 allow popups for this site and try again.",!0);this.pendingOAuth.set(c,{key:o,flow:r.flow,fields:{...s}}),this.setOAuthStatus(o,"Waiting for authorization in the popup\u2026"),this.watchPopup(d,c,o)}watchPopup(o,r,s){let a=setInterval(()=>{o.closed&&(clearInterval(a),this.watchers.delete(a),this.pendingOAuth.delete(r)&&this.setOAuthStatus(s,"Authorization window was closed before completing.",!0))},500);this.watchers.add(a)}get redirectUri(){return this.props.oauthRedirectUri||new URL("oauth2-redirect.html",document.baseURI).href}handleOAuthMessage(o){let r=o.data;if(o.origin!==window.location.origin||r?.source!=="oauth2-redirect")return;let s=this.pendingOAuth.get(r.state);if(!s)return;this.pendingOAuth.delete(r.state);let{key:a,flow:c,fields:l}=s;if(r.error)return this.setOAuthStatus(a,`Authorization failed: ${r.error}${r.errorDescription?" - "+r.errorDescription:""}`,!0);if(c==="implicit")return r.accessToken?this.applyOAuthToken(a,r.accessToken,l):this.setOAuthStatus(a,"Authorization server did not return an access token.",!0);if(!r.code)return this.setOAuthStatus(a,"Authorization server did not return a code.",!0);this.setOAuthStatus(a,"Exchanging code for token\u2026"),this.fetchToken(a,{grant_type:"authorization_code",code:r.code,redirect_uri:this.redirectUri,client_id:l.clientId,client_secret:l.clientSecret},l)}addListeners(){this.readSystemTheme(),this.themeObserver=new MutationObserver(this.onThemeChange),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-bs-theme"]}),window.addEventListener("hashchange",this.onHashChange),window.addEventListener("message",this.onOAuthMessage),document.addEventListener("click",this.onDocumentClick),this.overlayQuery.addEventListener("change",this.onViewportChange)}removeListeners(){this.themeObserver?.disconnect(),window.removeEventListener("hashchange",this.onHashChange),window.removeEventListener("message",this.onOAuthMessage),document.removeEventListener("click",this.onDocumentClick),this.overlayQuery.removeEventListener("change",this.onViewportChange),this.watchers.forEach(clearInterval)}};n(Vt,"template","nodexui.ApiDoc"),n(Vt,"components",{ApiDocGroup:Gt,Markdown:Ot,Badge:Et,Breadcrumb:Ee,BreadcrumbItem:Le,BreadcrumbLink:ke,BreadcrumbList:Ce,BreadcrumbPage:Ne,BreadcrumbSeparator:jt,Button:U,Checkbox:ve,Dialog:ue,DialogContent:_t,DialogDescription:me,DialogFooter:de,DialogHeader:pe,DialogTitle:he,Icon:Y,Input:ne,NativeSelect:ge,TabContent:le,Tabs:ie,TabsContainer:ae,TabsList:ce,TabTrigger:Ut,Textarea:be}),n(Vt,"props",{src:i(String),spec:i(Object),title:i(String),serverUrl:i(String),theme:i(String),themeToggle:i(Boolean),hash:i(Boolean),operation:i(String),tryIt:i(Boolean),authorize:i(Boolean),languages:i(Array),language:i(String),assetBase:i(String),oauthRedirectUri:i(String),height:i(String),onLoad:i(Function),onError:i(Function),onNavigate:i(Function),className:i(String),style:i([String,Object])});function Jc(t){let e=(t?.children||[]).filter(r=>r.type==="file"),o=e.find(r=>/^(readme|index)\.md$/i.test(r.name))||e[0];if(o)return o.path;for(let r of t?.children||[]){let s=r.type==="dir"?Jc(r):"";if(s)return s}return""}var ko=class extends u{constructor(){super(...arguments);n(this,"onHashChange",()=>{let o=this.pathFromHash();o&&(this.state.path=o)});n(this,"select",(o,r)=>{this.props.onNavigate?.(o,r),this.props.toHash?window.location.hash=this.props.toHash(o):this.props.hashPrefix?window.location.hash=this.props.hashPrefix+o:this.state.path=o})}setup(){this.state=$({path:""}),St(()=>this.start()),at(o=>{o.path&&o.path!==this.props.path&&(this.state.path=o.path)}),V(()=>window.addEventListener("hashchange",this.onHashChange)),Q(()=>window.removeEventListener("hashchange",this.onHashChange))}get classNames(){return g("b-doc-viewer",{"b-doc-viewer-split":this.props.part},this.props.className)}get docSrc(){return(this.props.base??"/").replace(/\/?$/,"/")+this.state.path}async start(){let o=this.pathFromHash();if(o||this.props.path){this.state.path=o||this.props.path;return}let r=await fetch(this.props.tree).then(a=>a.json()),s=this.props.root?oi(r,this.props.root)??r:r;this.state.path=Jc(s)}pathFromHash(){if(this.props.fromHash)return this.props.fromHash(window.location.hash);let o=this.props.hashPrefix,r=decodeURIComponent(window.location.hash);return o&&r.startsWith(o)?r.slice(o.length):""}};n(ko,"template","nodexui.DocViewer"),n(ko,"components",{Markdown:Ot,MarkdownTree:Kt}),n(ko,"props",{tree:{type:String},root:i(String),base:i(String),path:i(String),hashPrefix:i(String),part:i(String),include:i(Array),exclude:i(Array),filter:i(String),formatLabel:i(Function),toHash:i(Function),fromHash:i(Function),onNavigate:i(Function),className:i(String),style:i([String,Object])});function Yc(t=document.querySelector("[b-block-code-template]")){let r=((t?.tagName==="SCRIPT"?t.textContent:t?.innerHTML)?.replace(/^\n/,"").replace(/\s+$/,"")||"").split(`
63
+ `),s=r.filter(c=>c.trim()).map(c=>c.match(/^\s*/)?.[0].length||0),a=s.length?Math.min(...s):0;return r.map(c=>c.slice(a)).join(`
64
+ `)}function Qc(t,e=0){let o=" ".repeat(e),r=[];for(let s of t.childNodes){if(s.nodeType===Node.TEXT_NODE){let l=s.textContent.trim();l&&r.push(`${o}${l}`);continue}if(s.nodeType!==Node.ELEMENT_NODE)continue;let a=[...s.attributes].map(l=>` ${l.name}="${l.value}"`).join("");if(![...s.childNodes].some(l=>l.nodeType===Node.ELEMENT_NODE||l.nodeType===Node.TEXT_NODE&&l.textContent.trim())){r.push(`${o}<${s.localName}${a}>${s.textContent.trim()}</${s.localName}>`);continue}r.push(`${o}<${s.localName}${a}>`),r.push(...Qc(s,e+1)),r.push(`${o}</${s.localName}>`)}return r}async function Xc(t){if(!t?.trim())return"";let{expandSelfClosingTags:e,extractTagCaseMap:o,normalizeOwlPreviewMarkup:r}=await Promise.resolve().then(()=>(Bi(),yc)),s=document.createElement("div");return s.innerHTML=e(t),r(s,o(t)),Qc(s).join(`
65
+ `)}function tl(t){t.querySelectorAll('[b-block="dashboard-01"], [b-block^="sidebar-"]').forEach(e=>{let o=e.querySelector("[b-block-sidebar-toggle], button[aria-label='Toggle sidebar']"),r=e.querySelector("[b-block-sidebar]");!o||!r||(e.setAttribute("b-att-sidebar",e.getAttribute("b-att-sidebar")||"open"),o.setAttribute("b-block-sidebar-toggle",""),o.setAttribute("aria-expanded",e.getAttribute("b-att-sidebar")==="open"?"true":"false"),o.addEventListener("click",()=>{let s=e.getAttribute("b-att-sidebar")!=="open";e.setAttribute("b-att-sidebar",s?"open":"collapsed"),o.setAttribute("aria-expanded",s?"true":"false")}))}),t.querySelectorAll('[b-block^="sidebar-"] [b-block-subnav]').forEach(e=>{let o=e.previousElementSibling;o&&(o.setAttribute("b-block-subnav-toggle",""),o.setAttribute("aria-expanded","true"),e.setAttribute("b-att-state","open"),o.addEventListener("click",r=>{r.preventDefault();let s=e.getAttribute("b-att-state")!=="open";e.setAttribute("b-att-state",s?"open":"collapsed"),o.setAttribute("aria-expanded",s?"true":"false")}))})}var ai=Pe({storageKey:"b-example-theme",toggleSelector:"",labelSelector:""}),Id=[{key:"docs",label:"Docs",href:"/docs"},{key:"icons",label:"Icons",href:"/docs/icons"},{key:"examples",label:"Examples",href:"/examples/index.html"},{key:"blocks",label:"Blocks",href:"/blocks"}],Rd={desktop:"",tablet:"768px",mobile:"390px"},Bd="/dist/icons/lucide";function $d(){return document.querySelector("[b-block-code-template]")}function Md(t){return t.match(/<templates[^>]*>([\s\S]*)<\/templates>/)?.[1]||t}function Ud(t){for(let e of t.querySelectorAll?.("[b-block] [b-icon], [b-block] [b-ui='icon']")||[])!e.hasAttribute("b-icon-base-url")&&!e.hasAttribute("b-att-base-url")&&e.setAttribute("b-icon-base-url",Bd)}var No=class extends u{setup(){this.navItems=this.props.navItems||Id,this.previewFrame=P("previewFrame"),this.embedRoot=P("embedRoot"),this.code=Yc(),this.state=$({mode:"preview",viewport:"desktop",copyLabel:"Copy code",embed:new URLSearchParams(globalThis.location.search).get("embed")==="1",codeVariant:"owl",staticTemplate:"",staticTemplateStatus:"idle"}),V(()=>this.mountPreview()),it(()=>this.mountStaticNodexUI())}get activeCode(){return this.state.codeVariant==="template"?this.state.staticTemplateStatus==="ready"?this.state.staticTemplate:"Converting to a static template...":this.code}async setCodeVariant(e){if(this.state.codeVariant=e,e==="template"&&this.state.staticTemplateStatus==="idle"){this.state.staticTemplateStatus="loading";let o=await Xc(this.code);this.state.staticTemplate=o,this.state.staticTemplateStatus="ready"}}get title(){return document.body.dataset.blockTitle||document.title||"Block"}get description(){return document.body.dataset.blockDescription||"Preview and copy this NodexUI block."}get previewStyle(){let e=Rd[this.state.viewport]||"";return e?`max-width:${e}`:""}setMode(e){this.state.mode=e}setViewport(e){this.state.viewport=e}async copyCode(){await globalThis.navigator?.clipboard?.writeText(this.activeCode),this.state.copyLabel="Copied"}mountPreview(){this.state.embed&&(document.body.className="m-0");let e=this.state.embed?this.embedRoot.el:this.previewFrame.el,o=$d();if(!(!e||!o)){if(o.tagName==="SCRIPT"){this.mountOwlPreview(e,o);return}e.replaceChildren(o.content.cloneNode(!0)),this.mountStaticNodexUI(e),tl(e)}}async mountOwlPreview(e,o){e.replaceChildren();class r extends u{setup(){this.state=$({collapsed:!1})}}n(r,"template","examples.SidebarBlock");let s=[await qe("/dist/nodexui.templates.xml"),o.textContent].map(Md).join(`
66
+ `);await Mo(r,e,{templates:`<templates>${s}</templates>`}),ai.set(ai.current(),{skipStorage:!0})}mountStaticNodexUI(e=document){Ud(e),globalThis.thebase?.mountAll(e),ai.set(ai.current(),{skipStorage:!0})}};n(No,"template","nodexui.BlockViewer"),n(No,"components",{Button:U,Icon:Y,ThemeButton:Wt}),n(No,"props",{navItems:i(Array)});var Zs=class extends u{setup(){this.pwaState=$({open:lt(this.props)}),H({pwa:this.pwaState,setPwaOpen:e=>this.setOpen(e)}),xt(this.pwaState)}setOpen(e){yt(this.props,this.pwaState,e)}};n(Zs,"template","nodexui.Pwa"),n(Zs,"props",{open:i(Boolean),"default-open":i(Boolean),defaultOpen:i(Boolean),onOpenChange:i(Function),slots:i(Object)});var To=class extends u{onClick(){this.env.setPwaOpen(!0)}};n(To,"template","nodexui.PwaTrigger"),n(To,"components",{Button:U}),n(To,"props",p);var Js=class extends u{setup(){this.rootRef=P("root"),At(e=>{if(!e)return;let o=document.activeElement;return ln(this.rootRef.el)[0]?.focus(),()=>o?.focus?.()},()=>[this.env.pwa.open])}get open(){return this.env.pwa.open}onKeyDown(e){e.key==="Escape"&&this.env.setPwaOpen(!1)}onBackdropClick(e){e.target===this.rootRef.el&&this.env.setPwaOpen(!1)}};n(Js,"template","nodexui.PwaContent"),n(Js,"props",p);var Ys=class extends u{};n(Ys,"template","nodexui.PwaHeader"),n(Ys,"props",p);var Qs=class extends u{};n(Qs,"template","nodexui.PwaTitle"),n(Qs,"props",p);var Xs=class extends u{};n(Xs,"template","nodexui.PwaDescription"),n(Xs,"props",p);var tn=class extends u{};n(tn,"template","nodexui.PwaBody"),n(tn,"props",p);var en=class extends u{get steps(){return Array.isArray(this.props.steps)?this.props.steps:[]}};n(en,"template","nodexui.PwaSteps"),n(en,"props",{...p,steps:i(Array)});var on=class extends u{};n(on,"template","nodexui.PwaFooter"),n(on,"props",p);var Oo=class extends u{onClick(){this.env.setPwaOpen(!1)}};n(Oo,"template","nodexui.PwaClose"),n(Oo,"components",{Button:U}),n(Oo,"props",p);var el="",ol="";function rl(t,e){return typeof t=="string"?t:e}function _d(t){return{title:t.submitted&&t.title.trim().length>0&&t.title.trim().length<5?"Bug title must be at least 5 characters.":"",description:t.submitted&&t.description.length>0&&t.description.length<20?"Description must be at least 20 characters.":""}}var Io=class extends u{setup(){this.state=$({title:rl(this.props.title,el),description:rl(this.props.description,ol),submitted:!1})}get classNames(){return g("b-form",this.props.className)}get titlePlaceholder(){return this.props.titlePlaceholder||"Login button not working on mobile"}get descriptionPlaceholder(){return this.props.descriptionPlaceholder||"I'm having an issue with the login button on mobile."}get maxDescriptionLength(){return this.props.maxDescriptionLength||100}get descriptionLength(){return this.state.description.length}get errors(){return _d(this.state)}get titleInvalid(){return!!this.errors.title}get descriptionInvalid(){return!!this.errors.description}reset(){this.state.title=el,this.state.description=ol,this.state.submitted=!1}submit(e){e.preventDefault(),this.state.submitted=!0,!this.titleInvalid&&!this.descriptionInvalid&&this.props.onSubmit?.({title:this.state.title.trim(),description:this.state.description})}};n(Io,"template","nodexui.Form"),n(Io,"components",{Button:U,Field:$e,FieldDescription:Ue,FieldError:_e,FieldGroup:Be,FieldLabel:Me}),n(Io,"props",{title:i(String),description:i(String),titlePlaceholder:i(String),descriptionPlaceholder:i(String),maxDescriptionLength:i(Number),className:i(String),style:i([String,Object]),onSubmit:i(Function)});var Xi;function Pd(){return Xi??(Xi=import("./runtime/milkdown/milkdown-text-editor.js")),Xi}async function ci(t){return(await Pd()).createMilkdownTextEditor(t)}function li({collaborative:t,providerType:e,url:o}={}){return!!t||!!(e&&o)}var rn=class extends u{setup(){this.editorRef=P("editor"),this.editorHandle=null,this.mountPromise=null,this.mountToken=0,this.isDestroyed=!1,this.state=$({content:"",status:"loading",error:""}),St(()=>this.load(this.props)),at(e=>{if(this.shouldReload(e))return this.load(e);this.shouldRestartEditor(e)&&this.destroyEditor()}),V(()=>this.mountEditor()),it(()=>this.mountEditor()),De(()=>{this.isDestroyed=!0,this.destroyEditor()})}get classNames(){return g("b-text-editor",this.props.className)}get isCollaborative(){return li({collaborative:this.props.collaborative,providerType:this.props.provider,url:this.props.url})}get editorLabel(){return this.isCollaborative?"Collaborative rich text editor":"Rich text editor"}shouldReload(e){return e.content!==this.props.content||e.src!==this.props.src}shouldRestartEditor(e){return e.collaborative!==this.props.collaborative||e.provider!==this.props.provider||e.room!==this.props.room||e.url!==this.props.url||e.password!==this.props.password||e.signaling!==this.props.signaling}async load(e){this.destroyEditor(),this.state.status="loading",this.state.error="";let o=e.content??"";if(e.src)try{let r=await fetch(e.src);if(!r.ok)throw new Error(`${r.status} ${r.statusText}`);o=await r.text()}catch(r){this.state.status="error",this.state.error=r.message||String(r);return}this.state.content=o,this.state.status="ready"}async mountEditor(){let e=this.editorRef.el;if(this.isDestroyed||!e||this.editorHandle||this.mountPromise||this.state.status!=="ready")return;let o=++this.mountToken;return this.mountPromise=(async()=>{try{let r=await ci({root:e,value:this.state.content,placeholder:this.props.placeholder,collaborative:this.isCollaborative,providerType:this.props.provider,room:this.props.room||"b-text-editor",url:this.props.url,password:this.props.password,signaling:this.props.signaling,user:this.props.user,onChange:(s,a,c)=>{this.state.content=s,this.props.onChange?.(s,a,c)}});if(o!==this.mountToken){r.destroy?.();return}this.editorHandle=r}catch(r){o===this.mountToken&&(this.state.status="error",this.state.error=r.message||String(r))}finally{this.mountPromise=null,this.isDestroyed||this.mountEditor()}})(),this.mountPromise}destroyEditor(){this.mountToken++,this.editorHandle?.destroy?.(),this.editorHandle=null}};n(rn,"template","nodexui.TextEditor"),n(rn,"props",{content:i(String),src:i(String),placeholder:i(String),collaborative:i(Boolean),provider:i(String),room:i(String),url:i(String),password:i(String),signaling:i(Array),user:i(Object),onChange:i(Function),className:i(String),style:i([String,Object])});function qd(t){let{open:e,close:o,destroy:r}=zn(t,{closeSelector:"[b-alert-dialog-cancel], [b-alert-dialog-action], [b-alert-dialog-close]",trapFocus:!0});return t.setAttribute("role","alertdialog"),t.NodexUIAlertDialog={open:e,close:o},{destroy:()=>{r(),delete t.NodexUIAlertDialog}}}m.register("alert-dialog",{type:"owl",mount:qd});var ta={default:"b-alert-default",destructive:"b-alert-destructive",info:"b-alert-default",success:"alert-success",warning:"alert-warning",danger:"b-alert-destructive"};function Dd(t){t.classList.add("alert","b-alert",ta[t.getAttribute("b-att-variant")||"default"]||ta.default),t.setAttribute("role",t.getAttribute("role")||"alert");let e=null;if(!!t.getAttribute("b-att-dismissible")){if(t.classList.add("alert-dismissible","fade","show"),!t.querySelector('[data-bs-dismiss="alert"]')){let r=document.createElement("button");r.type="button",r.className="btn-close",r.setAttribute("data-bs-dismiss","alert"),r.setAttribute("aria-label","Close"),t.appendChild(r)}e=new(z()).Alert(t)}return{destroy:()=>{e?.dispose(),t.classList.remove("alert","b-alert","alert-dismissible","fade","show",...Object.values(ta))}}}m.register("alert",{type:"static",mount:Dd});function sl(t,e){return t.getAttribute(e)!=="false"}function jd(t){let e=t.getAttribute("b-att-templates");if(e)return e;let o=[...document.scripts].find(r=>/\/nodexui(\.[\w-]+)*\.(min\.)?js(\?|$)/.test(r.src));return o?o.src.replace(/[?#].*$/,"").replace(/[^/]*$/,"nodexui.templates.xml"):"/dist/nodexui.templates.xml"}function Fd(t){let e=(r,s)=>t.dispatchEvent(new CustomEvent(`nodexui:${r}`,{bubbles:!0,detail:s})),o=t.getAttribute("b-att-languages");return{src:t.getAttribute("b-att-src")||void 0,title:t.getAttribute("b-att-title")||void 0,serverUrl:t.getAttribute("b-att-server-url")||void 0,theme:t.getAttribute("b-att-theme")||void 0,themeToggle:t.getAttribute("b-att-theme-toggle")==="true",hash:t.getAttribute("b-att-hash")==="true",operation:t.getAttribute("b-att-operation")||void 0,tryIt:sl(t,"b-att-try-it"),authorize:sl(t,"b-att-authorize"),languages:o?o.split(",").map(r=>r.trim()).filter(Boolean):void 0,language:t.getAttribute("b-att-language")||void 0,assetBase:t.getAttribute("b-att-asset-base")??void 0,oauthRedirectUri:t.getAttribute("b-att-oauth-redirect-uri")||void 0,height:t.getAttribute("b-att-height")||void 0,onLoad:r=>e("load",{info:r.info,operations:r.groups.flatMap(s=>s.items).length}),onError:r=>e("error",{error:r}),onNavigate:r=>e("navigate",{id:r})}}function zd(t){let e=Fd(t),o=qe(jd(t)).then(r=>Mo(Vt,t,{templates:r,props:e}));return{destroy:async()=>{(await o).destroy()}}}m.register("apidoc",{type:"owl",mount:zd});function Hd(t){let e=[...t.querySelectorAll("[b-accordion-item]")],o=t.getAttribute("b-att-multiple")==="true",r=new Map,s=new Map,a=new Map,c=(l,d)=>{let f=l.querySelector("[b-accordion-trigger]");l.setAttribute("b-att-state",d?"open":"closed"),f?.setAttribute("aria-expanded",String(d)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:d}}))};return t.setAttribute("role","presentation"),t.classList.add("accordion"),e.forEach((l,d)=>{let f=l.querySelector("[b-accordion-trigger]"),v=l.querySelector("[b-accordion-panel]");if(!v)return;l.classList.add("accordion-item"),f?.classList.add("accordion-button"),v.classList.add("accordion-collapse");let O=v.id||`b-accordion-panel-${d}`;v.id=O;let k=l.getAttribute("b-att-state")==="open";v.classList.add("collapse"),k&&v.classList.add("show");let D=new(z()).Collapse(v,{toggle:!1});a.set(l,D);let X=()=>c(l,!0),I=()=>c(l,!1);v.addEventListener("shown.bs.collapse",X),v.addEventListener("hidden.bs.collapse",I),s.set(l,{onShown:X,onHidden:I}),f?.setAttribute("aria-expanded",String(k)),f?.setAttribute("aria-controls",O);let K=()=>{let nt=v.classList.contains("show");!o&&!nt&&e.forEach(L=>{if(L===l)return;let _=a.get(L),N=L.querySelector("[b-accordion-panel]");_&&N?.classList.contains("show")&&_.hide()}),nt?D.hide():D.show()};r.set(l,K),f?.addEventListener("click",K)}),{destroy:()=>{e.forEach(l=>{let d=l.querySelector("[b-accordion-trigger]"),f=l.querySelector("[b-accordion-panel]");d?.removeEventListener("click",r.get(l));let v=s.get(l);f&&v&&(f.removeEventListener("shown.bs.collapse",v.onShown),f.removeEventListener("hidden.bs.collapse",v.onHidden)),a.get(l)?.dispose()}),r.clear(),s.clear(),a.clear()}}}m.register("accordion",{type:"owl",mount:Hd});function Wd(t){let e=t.getAttribute("b-att-ratio")||`${t.getAttribute("b-att-width")||16} / ${t.getAttribute("b-att-height")||9}`;return t.classList.add("b-aspect-ratio"),t.style.setProperty("--b-aspect-ratio",e),{destroy:()=>t.classList.remove("b-aspect-ratio")}}m.register("aspect-ratio",{type:"static",mount:Wd});var Kd=["idle","uploading","processing","error","done"],Vd=["default","sm","xs"],Gd=["content","title","description","actions"];function nl(t,e){t.classList.add(`b-attachment-${e}`),t.setAttribute("data-slot",`attachment-${e}`)}function Zd(t){let e=t.querySelector("input[type='file']"),o=t.querySelector("[b-attachment-list]"),r=Kd.includes(t.getAttribute("b-att-state"))?t.getAttribute("b-att-state"):"done",s=Vd.includes(t.getAttribute("b-att-size"))?t.getAttribute("b-att-size"):"default",a=t.getAttribute("b-att-orientation")==="vertical"?"vertical":"horizontal";t.classList.add("b-attachment"),t.classList.add(`b-attachment-${r}`,`b-attachment-${s}`,`b-attachment-${a}`),t.setAttribute("data-state",r),t.setAttribute("data-size",s),t.setAttribute("data-orientation",a),t.setAttribute("data-slot","attachment"),e&&t.classList.add("b-attachment-picker"),t.querySelectorAll("[b-attachment-media]").forEach(l=>{let d=l.getAttribute("b-att-variant")==="image"?"image":"icon";nl(l,"media"),l.classList.add(`b-attachment-media-${d}`),l.setAttribute("data-variant",d)}),Gd.forEach(l=>t.querySelectorAll(`[b-attachment-${l}]`).forEach(d=>nl(d,l))),t.querySelectorAll("[b-attachment-action]").forEach(l=>{let d=ft[l.getAttribute("b-att-variant")]||ft.ghost,f=gt[l.getAttribute("b-att-size")]||gt["icon-xs"];l.classList.add("btn","b-button",d,f,"b-button-icon","b-attachment-action"),l.setAttribute("data-slot","attachment-action"),!l.getAttribute("type")&&l.tagName==="BUTTON"&&l.setAttribute("type","button")}),t.querySelectorAll("[b-attachment-trigger]").forEach(l=>{l.classList.add("b-attachment-trigger"),l.setAttribute("data-slot","attachment-trigger"),!l.getAttribute("type")&&l.tagName==="BUTTON"&&l.setAttribute("type","button")}),e?.classList.add("form-control");let c=()=>{o&&(o.innerHTML=[...e.files].map(l=>`<li>${l.name}</li>`).join("")),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:[...e.files]}}))};return e?.addEventListener("change",c),{destroy:()=>e?.removeEventListener("change",c)}}function Jd(t){return t.classList.add("b-attachment-group"),t.setAttribute("data-slot","attachment-group"),{destroy:()=>t.classList.remove("b-attachment-group")}}function Yd(t){let e=t.querySelector("input[type='file']");t.classList.add("b-attachment-dropzone"),t.setAttribute("data-slot","attachment-dropzone");let o=()=>e?.click(),r=d=>{d.preventDefault(),t.classList.add("b-attachment-dropzone-dragging")},s=()=>t.classList.remove("b-attachment-dropzone-dragging"),a=d=>{d.length&&t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{files:d}}))},c=d=>{d.preventDefault(),t.classList.remove("b-attachment-dropzone-dragging"),a([...d.dataTransfer?.files??[]])},l=()=>{a([...e?.files??[]]),e&&(e.value="")};return t.addEventListener("click",o),t.addEventListener("dragover",r),t.addEventListener("dragleave",s),t.addEventListener("drop",c),e?.addEventListener("change",l),{destroy:()=>{t.removeEventListener("click",o),t.removeEventListener("dragover",r),t.removeEventListener("dragleave",s),t.removeEventListener("drop",c),e?.removeEventListener("change",l)}}}m.register("attachment",{type:"owl",mount:Zd});m.register("attachment-group",{type:"static",mount:Jd});m.register("attachment-dropzone",{type:"static",mount:Yd});function Qd(t){t.classList.add("b-avatar");let e=t.querySelector("img"),o=t.querySelector("[b-avatar-fallback]");if(e&&o){let r=()=>{e.hidden=!0,o.hidden=!1};return o.hidden=!!e.getAttribute("src"),e.addEventListener("error",r),{destroy:()=>e.removeEventListener("error",r)}}return{}}m.register("avatar",{type:"static",mount:Qd});function Xd(t){let e=qo[t.getAttribute("b-att-variant")||"secondary"]||qo.secondary;return t.classList.add("badge",e),t.getAttribute("b-att-pill")==="true"&&t.classList.add("rounded-pill"),{destroy:()=>t.classList.remove("badge","rounded-pill",...Object.values(qo))}}m.register("badge",{type:"static",mount:Xd});function il(t){return[...t.children].filter(e=>!e.matches("[b-breadcrumb-separator], .b-breadcrumb-separator"))}function cl(t,e,o){return ut(t,e,{size:o}),t}function th(){let t=document.createElement("li"),e=document.createElement("span");return t.setAttribute("b-breadcrumb-separator",""),t.setAttribute("data-slot","breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),t.className="b-breadcrumb-separator",e.className="b-breadcrumb-separator-icon",t.append(cl(e,"chevron-right","var(--b3_5)")),t}function eh(t){t.classList.add("b-breadcrumb-separator"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-separator"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true")}function oh(t){if(t.classList.add("b-breadcrumb-ellipsis"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-ellipsis"),t.setAttribute("role","presentation"),t.setAttribute("aria-hidden","true"),!t.querySelector(".b-icon")){let e=document.createElement("span");e.className="b-breadcrumb-ellipsis-icon",t.prepend(cl(e,"ellipsis","var(--b4)"))}if(!t.querySelector(".visually-hidden")){let e=document.createElement("span");e.className="visually-hidden",e.textContent="More",t.append(e)}}function al(t){t.classList.add("b-breadcrumb-page"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb-page"),t.setAttribute("role",t.getAttribute("role")||"link"),t.setAttribute("aria-disabled","true"),t.setAttribute("aria-current","page")}function rh(t){let e=t.querySelector("ol, ul")||t;t.classList.add("b-breadcrumb"),t.setAttribute("data-slot",t.getAttribute("data-slot")||"breadcrumb"),t.setAttribute("aria-label",t.getAttribute("aria-label")||"breadcrumb"),e.classList.add("breadcrumb","b-breadcrumb-list"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"breadcrumb-list");for(let r of e.querySelectorAll("[b-breadcrumb-separator], .b-breadcrumb-separator"))eh(r);for(let r of e.querySelectorAll("[b-breadcrumb-ellipsis], .b-breadcrumb-ellipsis"))oh(r);for(let r of e.querySelectorAll("[b-breadcrumb-page], .b-breadcrumb-page"))al(r);e.querySelector("[b-breadcrumb-separator], .b-breadcrumb-separator")||il(e).slice(0,-1).forEach(s=>s.after(th()));let o=il(e);return o.forEach((r,s)=>{r.classList.add("b-breadcrumb-item"),r.setAttribute("data-slot",r.getAttribute("data-slot")||"breadcrumb-item");for(let a of r.querySelectorAll("a"))a.classList.add("b-breadcrumb-link"),a.setAttribute("data-slot",a.getAttribute("data-slot")||"breadcrumb-link");if(s===o.length-1){let a=r.querySelector("[b-breadcrumb-page], .b-breadcrumb-page");a?al(a):(r.classList.add("b-breadcrumb-page"),r.setAttribute("aria-current",r.getAttribute("aria-current")||"page"))}}),{destroy:()=>{t.classList.remove("b-breadcrumb"),e.classList.remove("breadcrumb","b-breadcrumb-list");for(let r of e.querySelectorAll("[b-breadcrumb-separator]"))r.remove()}}}m.register("breadcrumb",{type:"owl",mount:rh});function sh(t){return t.classList.add("b-bubble"),t.getAttribute("role")||t.setAttribute("role","listitem"),{destroy:()=>t.classList.remove("b-bubble")}}m.register("bubble",{type:"static",mount:sh});function nh(t){return[...t.childNodes].filter(e=>e.nodeType===Node.TEXT_NODE&&e.textContent.trim()).map(e=>{let o=document.createElement("span");return o.textContent=e.textContent.trim(),e.replaceWith(o),o})}function ih(t){let e=t.getAttribute("b-att-icon"),o=t.getAttribute("b-att-icon-position")==="end"?"end":"start",r=!!t.textContent.trim(),s=e&&r?nh(t):[],a=null;return t.classList.add("btn","b-button",ft[t.getAttribute("b-att-variant")||"default"]||"btn-primary"),gt[t.getAttribute("b-att-size")]&&t.classList.add(gt[t.getAttribute("b-att-size")]),t.dataset.slot="button",e&&(a=document.createElement("span"),a.setAttribute("b-icon",e),a.dataset.icon=`inline-${o}`,ut(a,e,{label:""}),t.insertBefore(a,o==="end"?null:t.firstChild),t.dataset.icon=`inline-${o}`,r||(t.dataset.iconOnly="true",t.classList.add("b-button-icon"))),{destroy:()=>{a?.remove();for(let c of s)c.replaceWith(document.createTextNode(c.textContent));t.classList.remove("btn","b-button","b-button-icon",...Object.values(ft),...Object.values(gt)),t.removeAttribute("data-slot"),t.removeAttribute("data-icon"),t.removeAttribute("data-icon-only")}}}m.register("button",{type:"static",mount:ih});function ah(t){let e=t.getAttribute("b-att-orientation")==="vertical",o=t.getAttribute("b-att-size"),r=[...t.querySelectorAll("[b-button-group-separator]")],s=[...t.querySelectorAll("[b-button-group-text]")];return t.classList.add("b-button-group",e?"btn-group-vertical":"btn-group"),(o==="sm"||o==="lg")&&t.classList.add(`btn-group-${o}`),t.setAttribute("role",t.getAttribute("role")||"group"),r.forEach(a=>{let c=a.getAttribute("b-att-orientation")==="horizontal"?"horizontal":"vertical";a.classList.add("b-button-group-separator",`b-button-group-separator-${c}`),a.setAttribute("data-orientation",c),a.setAttribute("role","separator")}),s.forEach(a=>{a.classList.add("b-button-group-text")}),{destroy:()=>{t.classList.remove("b-button-group","btn-group","btn-group-vertical","btn-group-sm","btn-group-lg")}}}m.register("button-group",{type:"static",mount:ah});var ch=new Intl.DateTimeFormat(void 0,{month:"long",year:"numeric"});function lh(t){let e=t.getAttribute("b-att-selected")?new Date(`${t.getAttribute("b-att-selected")}T00:00:00`):new Date,o=Number(t.getAttribute("b-att-month")??e.getMonth()+1)-1,r=Number(t.getAttribute("b-att-year")??e.getFullYear()),s=new Date(r,o,1),a=new Date(r,o+1,0).getDate(),c=s.getDay();t.classList.add("b-calendar"),t.querySelector("[b-calendar-grid]")||(t.innerHTML=`
67
+ <div class="b-calendar__header">${ch.format(s)}</div>
68
+ <div class="b-calendar__weekdays">${["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].map(f=>`<span>${f}</span>`).join("")}</div>
58
69
  <div b-calendar-grid class="b-calendar__grid"></div>
59
- `);let u=t.querySelector("[b-calendar-grid]");u.innerHTML="";for(let b=0;b<l;b+=1)u.append(document.createElement("span"));for(let b=1;b<=a;b+=1){let x=document.createElement("button"),S=`${o}-${String(s+1).padStart(2,"0")}-${String(b).padStart(2,"0")}`;x.type="button",x.textContent=String(b),x.setAttribute("b-att-value",S),x.setAttribute("aria-pressed",String(S===t.getAttribute("b-att-selected"))),u.append(x)}let d=b=>{let x=b.target.closest("button[b-att-value]");x&&(t.setAttribute("b-att-selected",x.getAttribute("b-att-value")),u.querySelectorAll("button").forEach(S=>S.setAttribute("aria-pressed",String(S===x))),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:x.getAttribute("b-att-value")}})))};return u.addEventListener("click",d),{destroy:()=>u.removeEventListener("click",d)}}m.register("calendar",{type:"owl",mount:Id});j();function Rd(t){return t.classList.add("card","b-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","b-card")}}m.register("card",{type:"static",mount:Rd});j();function Bd(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],s=t.querySelector("[b-carousel-prev]"),o=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let b=document.createElement("div");b.classList.add("carousel-inner"),e[0].before(b),e.forEach(x=>b.appendChild(x))}let r=Math.max(0,e.findIndex(b=>b.getAttribute("b-att-state")==="active"));e.forEach((b,x)=>{b.classList.add("carousel-item"),x===r&&b.classList.add("active"),b.setAttribute("b-att-state",x===r?"active":"inactive")});let a=e.length?new(G()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,l=b=>{e.forEach((x,S)=>{x.setAttribute("b-att-state",S===b.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:b.to}}))};t.addEventListener("slid.bs.carousel",l);let u=()=>a?.prev(),d=()=>a?.next();return s?.addEventListener("click",u),o?.addEventListener("click",d),{destroy:()=>{s?.removeEventListener("click",u),o?.removeEventListener("click",d),t.removeEventListener("slid.bs.carousel",l),a?.dispose()}}}m.register("carousel",{type:"owl",mount:Bd});j();function Gc(t,e,s=0){let o=Number(t.getAttribute(e));return Number.isFinite(o)?o:s}function $d(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function _d(t,e){let s=globalThis.getComputedStyle(t),o=[1,2,3,4,5].map(l=>s.getPropertyValue(`--b-chart-${l}`).trim()),r=s.getPropertyValue("--b-muted-foreground").trim(),a=s.getPropertyValue("--b-chart-grid").trim()||s.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:r,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:r,font:{size:12}}},y:{border:{display:!1},grid:{color:a},ticks:{color:r,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((l,u)=>{l.backgroundColor||(l.backgroundColor=o[u%o.length]),l.borderColor||(l.borderColor=o[u%o.length]),l.borderRadius??(l.borderRadius=4)}),e}function Md(t,e,s){if(t.querySelector("[b-chart-tooltip]"))return;let o=document.createElement("span");o.setAttribute("b-chart-tooltip",""),o.textContent=`${e}: ${s}`,t.append(o)}function Ud(t){t.classList.add("b-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),s=null;if(e&&globalThis.Chart){let a=$d(t);a&&(s=new globalThis.Chart(e,_d(t,a)))}let o=[...t.querySelectorAll("[b-att-value]")],r=Math.max(1,...o.map(a=>Gc(a,"b-att-value")));return o.forEach((a,l)=>{let u=Gc(a,"b-att-value"),d=a.getAttribute("b-att-label")||a.textContent.trim()||`Series ${l+1}`,b=Math.max(0,Math.min(100,u/r*100));a.style.setProperty("--b-chart-value",`${b}%`),a.style.setProperty("--b-chart-index",String(l%5+1)),a.style.setProperty("--b-chart-color",`var(--b-chart-${l%5+1})`),a.setAttribute("role",a.getAttribute("role")||"listitem"),a.setAttribute("aria-label",a.getAttribute("aria-label")||`${d} ${u}`),Md(a,d,u)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((a,l)=>{a.style.setProperty("--b-chart-color",a.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${l%5+1})`)}),{destroy:()=>{s?.destroy?.(),t.classList.remove("b-chart")}}}m.register("chart",{type:"static",mount:Ud});j();function hi(t,e){let s=t.matches("input")?t:t.querySelector(`input[type='${e}']`),o=t.matches("input")?t.closest("label, .form-check"):t;return s?.classList.add("form-check-input"),o?.classList.add("form-check","b-check"),{destroy:()=>{s?.classList.remove("form-check-input"),o?.classList.remove("form-check","b-check")}}}m.register("checkbox",{type:"static",mount:t=>hi(t,"checkbox")});j();Mt();Fn();function Pd(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let s=t.getAttribute("b-att-target");if(s){let o=document.querySelector(s);if(o)return o.textContent??""}return t.textContent??""}function qd(t){t.classList.remove(...Ei),t.className=`${t.className} ${zn({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let s=t.getAttribute("b-att-icon")||"copy",o=t.getAttribute("b-att-copied-icon")||"check";dt(e,s,{label:""});let r=null,a=async()=>{if(t.disabled)return;let l=Pd(t);try{await pn(l),dt(e,o,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy",{bubbles:!0,detail:{value:l}})),window.clearTimeout(r),r=window.setTimeout(()=>{dt(e,s,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(u){t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy-error",{bubbles:!0,detail:{error:u}}))}};return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),window.clearTimeout(r),e.remove(),t.classList.remove(...Ei),t.removeAttribute("data-copied")}}}m.register("clipboard-button",{type:"static",mount:qd});j();function Dd(t){let e=t.querySelector("[b-collapsible-trigger]"),s=t.querySelector("[b-collapsible-panel]"),o=b=>{t.setAttribute("b-att-state",b?"open":"closed"),e?.setAttribute("aria-expanded",String(b)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:b}}))};if(!s){let b=()=>o(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",b),{destroy:()=>e?.removeEventListener("click",b)}}let r=t.getAttribute("b-att-state")==="open";s.classList.add("collapse"),r&&s.classList.add("show");let a=new(G()).Collapse(s,{toggle:!1}),l=()=>o(!0),u=()=>o(!1);s.addEventListener("shown.bs.collapse",l),s.addEventListener("hidden.bs.collapse",u),e?.setAttribute("aria-expanded",String(r));let d=()=>{s.classList.contains("show")?a.hide():a.show()};return e?.addEventListener("click",d),{destroy:()=>{e?.removeEventListener("click",d),s.removeEventListener("shown.bs.collapse",l),s.removeEventListener("hidden.bs.collapse",u),a.dispose()}}}m.register("collapsible",{type:"owl",mount:Dd});j();function jd(t){let e=t.querySelector("input"),s=t.querySelector("[b-combobox-list]"),o=()=>[...s?.querySelectorAll("[b-att-value]")||[]];t.classList.add("b-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),s?.setAttribute("role","listbox"),s&&(s.hidden=!0);let r=u=>{s&&(s.hidden=!u),e?.setAttribute("aria-expanded",String(u))},a=()=>{let u=e.value.toLowerCase();o().forEach(d=>{d.hidden=!d.textContent.toLowerCase().includes(u)}),r(!0)},l=u=>{let d=u.target.closest("[b-att-value]");d&&(e.value=d.textContent.trim(),t.setAttribute("b-att-value",d.getAttribute("b-att-value")),r(!1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:d.getAttribute("b-att-value")}})))};return e?.addEventListener("input",a),e?.addEventListener("focus",()=>r(!0)),s?.addEventListener("click",l),{destroy:()=>{e?.removeEventListener("input",a),s?.removeEventListener("click",l)}}}m.register("combobox",{type:"owl",mount:jd});j();function zd(t){let e=t.querySelector("input"),s=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("b-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let o=()=>{let a=(e?.value||"").toLowerCase();s().forEach(l=>{l.hidden=!l.textContent.toLowerCase().includes(a)})},r=a=>{let l=a.target.closest("[b-command-item]");l&&t.dispatchEvent(new CustomEvent("nodexui:select",{bubbles:!0,detail:{value:l.getAttribute("b-att-value")||l.textContent.trim()}}))};return e?.addEventListener("input",o),t.addEventListener("click",r),{destroy:()=>{e?.removeEventListener("input",o),t.removeEventListener("click",r)}}}m.register("command",{type:"owl",mount:zd});j();function Fd(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let s=a=>{a.preventDefault(),e.hidden=!1,e.style.left=`${a.clientX}px`,e.style.top=`${a.clientY}px`,t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},o=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},r=a=>{a.key==="Escape"&&o()};return t.addEventListener("contextmenu",s),document.addEventListener("click",o),t.addEventListener("keydown",r),{destroy:()=>{t.removeEventListener("contextmenu",s),document.removeEventListener("click",o),t.removeEventListener("keydown",r)}}}m.register("context-menu",{type:"owl",mount:Fd});j();Mt();var Zc=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function Hd(t){t.querySelector("table")||(t.innerHTML=`
70
+ `);let l=t.querySelector("[b-calendar-grid]");l.innerHTML="";for(let f=0;f<c;f+=1)l.append(document.createElement("span"));for(let f=1;f<=a;f+=1){let v=document.createElement("button"),O=`${r}-${String(o+1).padStart(2,"0")}-${String(f).padStart(2,"0")}`;v.type="button",v.textContent=String(f),v.setAttribute("b-att-value",O),v.setAttribute("aria-pressed",String(O===t.getAttribute("b-att-selected"))),l.append(v)}let d=f=>{let v=f.target.closest("button[b-att-value]");v&&(t.setAttribute("b-att-selected",v.getAttribute("b-att-value")),l.querySelectorAll("button").forEach(O=>O.setAttribute("aria-pressed",String(O===v))),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:v.getAttribute("b-att-value")}})))};return l.addEventListener("click",d),{destroy:()=>l.removeEventListener("click",d)}}m.register("calendar",{type:"owl",mount:lh});function uh(t){return t.classList.add("card","b-card"),t.querySelector("[b-card-header]")?.classList.add("card-header"),t.querySelector("[b-card-body]")?.classList.add("card-body"),t.querySelector("[b-card-footer]")?.classList.add("card-footer"),{destroy:()=>t.classList.remove("card","b-card")}}m.register("card",{type:"static",mount:uh});function ph(t){let e=[...t.querySelectorAll("[b-carousel-slide]")],o=t.querySelector("[b-carousel-prev]"),r=t.querySelector("[b-carousel-next]");if(t.classList.add("carousel","slide"),e.length&&!e[0].parentElement.classList.contains("carousel-inner")){let f=document.createElement("div");f.classList.add("carousel-inner"),e[0].before(f),e.forEach(v=>f.appendChild(v))}let s=Math.max(0,e.findIndex(f=>f.getAttribute("b-att-state")==="active"));e.forEach((f,v)=>{f.classList.add("carousel-item"),v===s&&f.classList.add("active"),f.setAttribute("b-att-state",v===s?"active":"inactive")});let a=e.length?new(z()).Carousel(t,{interval:!1,wrap:!0,touch:!0}):null,c=f=>{e.forEach((v,O)=>{v.setAttribute("b-att-state",O===f.to?"active":"inactive")}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:f.to}}))};t.addEventListener("slid.bs.carousel",c);let l=()=>a?.prev(),d=()=>a?.next();return o?.addEventListener("click",l),r?.addEventListener("click",d),{destroy:()=>{o?.removeEventListener("click",l),r?.removeEventListener("click",d),t.removeEventListener("slid.bs.carousel",c),a?.dispose()}}}m.register("carousel",{type:"owl",mount:ph});function ll(t,e,o=0){let r=Number(t.getAttribute(e));return Number.isFinite(r)?r:o}function dh(t){let e=t.getAttribute("b-att-config")||t.querySelector("script[type='application/json']")?.textContent;if(!e)return null;try{return JSON.parse(e)}catch{return null}}function hh(t,e){let o=globalThis.getComputedStyle(t),r=[1,2,3,4,5].map(c=>o.getPropertyValue(`--b-chart-${c}`).trim()),s=o.getPropertyValue("--b-muted-foreground").trim(),a=o.getPropertyValue("--b-chart-grid").trim()||o.getPropertyValue("--b-border").trim();return e.options={maintainAspectRatio:!1,plugins:{legend:{labels:{boxWidth:8,boxHeight:8,color:s,font:{size:12}}},tooltip:{titleFont:{size:12},bodyFont:{size:12},cornerRadius:10,padding:10},...e.options?.plugins||{}},scales:{x:{border:{display:!1},grid:{display:!1},ticks:{color:s,font:{size:12}}},y:{border:{display:!1},grid:{color:a},ticks:{color:s,font:{size:12}}},...e.options?.scales||{}},...e.options},e.data?.datasets?.forEach((c,l)=>{c.backgroundColor||(c.backgroundColor=r[l%r.length]),c.borderColor||(c.borderColor=r[l%r.length]),c.borderRadius??(c.borderRadius=4)}),e}function mh(t,e,o){if(t.querySelector("[b-chart-tooltip]"))return;let r=document.createElement("span");r.setAttribute("b-chart-tooltip",""),r.textContent=`${e}: ${o}`,t.append(r)}function fh(t){t.classList.add("b-chart"),t.setAttribute("role",t.getAttribute("role")||"figure");let e=t.querySelector("canvas"),o=null;if(e&&globalThis.Chart){let a=dh(t);a&&(o=new globalThis.Chart(e,hh(t,a)))}let r=[...t.querySelectorAll("[b-att-value]")],s=Math.max(1,...r.map(a=>ll(a,"b-att-value")));return r.forEach((a,c)=>{let l=ll(a,"b-att-value"),d=a.getAttribute("b-att-label")||a.textContent.trim()||`Series ${c+1}`,f=Math.max(0,Math.min(100,l/s*100));a.style.setProperty("--b-chart-value",`${f}%`),a.style.setProperty("--b-chart-index",String(c%5+1)),a.style.setProperty("--b-chart-color",`var(--b-chart-${c%5+1})`),a.setAttribute("role",a.getAttribute("role")||"listitem"),a.setAttribute("aria-label",a.getAttribute("aria-label")||`${d} ${l}`),mh(a,d,l)}),[...t.querySelectorAll("[b-chart-series], [b-chart-legend] > *")].forEach((a,c)=>{a.style.setProperty("--b-chart-color",a.style.getPropertyValue("--b-chart-color")||`var(--b-chart-${c%5+1})`)}),{destroy:()=>{o?.destroy?.(),t.classList.remove("b-chart")}}}m.register("chart",{type:"static",mount:fh});function pi(t,e){let o=t.matches("input")?t:t.querySelector(`input[type='${e}']`),r=t.matches("input")?t.closest("label, .form-check"):t;return o?.classList.add("form-check-input"),r?.classList.add("form-check","b-check"),{destroy:()=>{o?.classList.remove("form-check-input"),r?.classList.remove("form-check","b-check")}}}m.register("checkbox",{type:"static",mount:t=>pi(t,"checkbox")});function bh(t){let e=t.getAttribute("b-att-value");if(e!==null)return e;let o=t.getAttribute("b-att-target");if(o){let r=document.querySelector(o);if(r)return r.textContent??""}return t.textContent??""}function gh(t){t.classList.remove(...Ai),t.className=`${t.className} ${_n({variant:t.getAttribute("b-att-variant")||"default",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button";let e=t.querySelector("[b-clipboard-button-icon]");e||(e=document.createElement("span"),e.setAttribute("b-clipboard-button-icon",""),t.prepend(e));let o=t.getAttribute("b-att-icon")||"copy",r=t.getAttribute("b-att-copied-icon")||"check";ut(e,o,{label:""});let s=null,a=async()=>{if(t.disabled)return;let c=bh(t);try{await an(c),ut(e,r,{label:""}),t.setAttribute("data-copied","true"),t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy",{bubbles:!0,detail:{value:c}})),window.clearTimeout(s),s=window.setTimeout(()=>{ut(e,o,{label:""}),t.removeAttribute("data-copied")},Number(t.getAttribute("b-att-reset-delay"))||2e3)}catch(l){t.dispatchEvent(new CustomEvent("nodexui:clipboard-copy-error",{bubbles:!0,detail:{error:l}}))}};return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),window.clearTimeout(s),e.remove(),t.classList.remove(...Ai),t.removeAttribute("data-copied")}}}m.register("clipboard-button",{type:"static",mount:gh});function vh(t){let e=t.querySelector("[b-collapsible-trigger]"),o=t.querySelector("[b-collapsible-panel]"),r=f=>{t.setAttribute("b-att-state",f?"open":"closed"),e?.setAttribute("aria-expanded",String(f)),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{open:f}}))};if(!o){let f=()=>r(t.getAttribute("b-att-state")!=="open");return e?.setAttribute("aria-expanded",String(t.getAttribute("b-att-state")==="open")),e?.addEventListener("click",f),{destroy:()=>e?.removeEventListener("click",f)}}let s=t.getAttribute("b-att-state")==="open";o.classList.add("collapse"),s&&o.classList.add("show");let a=new(z()).Collapse(o,{toggle:!1}),c=()=>r(!0),l=()=>r(!1);o.addEventListener("shown.bs.collapse",c),o.addEventListener("hidden.bs.collapse",l),e?.setAttribute("aria-expanded",String(s));let d=()=>{o.classList.contains("show")?a.hide():a.show()};return e?.addEventListener("click",d),{destroy:()=>{e?.removeEventListener("click",d),o.removeEventListener("shown.bs.collapse",c),o.removeEventListener("hidden.bs.collapse",l),a.dispose()}}}m.register("collapsible",{type:"owl",mount:vh});function xh(t){let e=t.querySelector("input"),o=t.querySelector("[b-combobox-list]"),r=()=>[...o?.querySelectorAll("[b-att-value]")||[]];t.classList.add("b-combobox"),e?.setAttribute("role","combobox"),e?.setAttribute("aria-expanded","false"),o?.setAttribute("role","listbox"),o&&(o.hidden=!0);let s=l=>{o&&(o.hidden=!l),e?.setAttribute("aria-expanded",String(l))},a=()=>{let l=e.value.toLowerCase();r().forEach(d=>{d.hidden=!d.textContent.toLowerCase().includes(l)}),s(!0)},c=l=>{let d=l.target.closest("[b-att-value]");d&&(e.value=d.textContent.trim(),t.setAttribute("b-att-value",d.getAttribute("b-att-value")),s(!1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:d.getAttribute("b-att-value")}})))};return e?.addEventListener("input",a),e?.addEventListener("focus",()=>s(!0)),o?.addEventListener("click",c),{destroy:()=>{e?.removeEventListener("input",a),o?.removeEventListener("click",c)}}}m.register("combobox",{type:"owl",mount:xh});function yh(t){let e=t.querySelector("input"),o=()=>[...t.querySelectorAll("[b-command-item]")];t.classList.add("b-command"),t.setAttribute("role",t.getAttribute("role")||"dialog"),e?.classList.add("form-control");let r=()=>{let a=(e?.value||"").toLowerCase();o().forEach(c=>{c.hidden=!c.textContent.toLowerCase().includes(a)})},s=a=>{let c=a.target.closest("[b-command-item]");c&&t.dispatchEvent(new CustomEvent("nodexui:select",{bubbles:!0,detail:{value:c.getAttribute("b-att-value")||c.textContent.trim()}}))};return e?.addEventListener("input",r),t.addEventListener("click",s),{destroy:()=>{e?.removeEventListener("input",r),t.removeEventListener("click",s)}}}m.register("command",{type:"owl",mount:yh});function wh(t){let e=t.querySelector("[b-context-menu-content]");if(!e)return{};e.hidden=!0,e.setAttribute("role","menu");let o=a=>{a.preventDefault(),e.hidden=!1,e.style.left=`${a.clientX}px`,e.style.top=`${a.clientY}px`,t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},r=()=>{e.hidden=!0,t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))},s=a=>{a.key==="Escape"&&r()};return t.addEventListener("contextmenu",o),document.addEventListener("click",r),t.addEventListener("keydown",s),{destroy:()=>{t.removeEventListener("contextmenu",o),document.removeEventListener("click",r),t.removeEventListener("keydown",s)}}}m.register("context-menu",{type:"owl",mount:wh});var ul=[["728ed52f","Success","ken99@example.com","$316.00"],["489e1d42","Success","abe45@example.com","$242.00"],["6b0888f6","Processing","monserrat44@example.com","$837.00"],["a1dc8c4e","Success","silas22@example.com","$874.00"],["15b96de0","Failed","carmella@example.com","$721.00"]];function Sh(t){t.querySelector("table")||(t.innerHTML=`
60
71
  <div class="b-data-table__toolbar">
61
72
  <input b-table-search type="search" class="form-control b-data-table__search" placeholder="Filter emails...">
62
73
  <div class="b-data-table__columns"><button type="button" class="btn b-button btn-outline-secondary" data-slot="button" data-icon="inline-end" aria-label="Toggle columns"><span>Columns</span><span b-icon="chevron-down" data-icon="inline-end"></span></button></div>
@@ -64,11 +75,11 @@ ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}ou
64
75
  <div class="b-data-table__viewport">
65
76
  <table class="table b-data-table__table">
66
77
  <thead><tr><th class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select all rows"></th><th>Status</th><th b-att-sortable="true">Email <span class="b-data-table__sort-icon" data-icon="arrow-up-down" aria-hidden="true"></span></th><th class="text-end">Amount</th><th class="b-data-table__actions-cell"><span class="visually-hidden">Actions</span></th></tr></thead>
67
- <tbody>${Zc.map(e=>`<tr data-row-key="${e[0]}"><td class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select row"></td><td>${e[1]}</td><td>${e[2]}</td><td class="text-end"><span class="b-data-table__money">${e[3]}</span></td><td class="b-data-table__actions-cell"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></td></tr>`).join("")}</tbody>
78
+ <tbody>${ul.map(e=>`<tr data-row-key="${e[0]}"><td class="b-data-table__selection-cell"><input type="checkbox" class="form-check-input" aria-label="Select row"></td><td>${e[1]}</td><td>${e[2]}</td><td class="text-end"><span class="b-data-table__money">${e[3]}</span></td><td class="b-data-table__actions-cell"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></td></tr>`).join("")}</tbody>
68
79
  </table>
69
80
  </div>
70
81
  <div class="b-data-table__cards">
71
- ${Zc.map(e=>`<div class="b-data-table__card" data-row-key="${e[0]}">
82
+ ${ul.map(e=>`<div class="b-data-table__card" data-row-key="${e[0]}">
72
83
  <div class="b-data-table__card-header"><input type="checkbox" class="form-check-input" aria-label="Select row"><div class="b-data-table__actions"><button type="button" class="btn b-button btn-ghost b-button-icon" aria-label="Open menu" data-slot="button" data-icon="inline-start" data-icon-only="true"><span b-icon="ellipsis"></span></button></div></div>
73
84
  <div class="b-data-table__card-field"><span class="b-data-table__card-label">Status</span><span class="b-data-table__card-value">${e[1]}</span></div>
74
85
  <div class="b-data-table__card-field"><span class="b-data-table__card-label">Email</span><span class="b-data-table__card-value">${e[2]}</span></div>
@@ -76,4 +87,4 @@ ${a}`,s.selectionStart,s.selectionEnd,"end")}else return;this.commit(s.value)}ou
76
87
  </div>`).join("")}
77
88
  </div>
78
89
  <div class="b-data-table__pagination"><div class="b-data-table__selection-summary">0 of 5 row(s) selected.</div><div class="b-data-table__pager"><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Previous</button><button type="button" class="btn b-button btn-outline-secondary btn-sm" disabled>Next</button></div></div>
79
- `)}function Wd(t){Hd(t),t.querySelectorAll("[b-icon]").forEach(D=>dt(D,D.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,s=t.querySelector("[b-table-search]"),o=t.querySelector(".b-data-table__selection-summary"),r=t.getAttribute("b-att-variant");t.classList.add("b-data-table"),r&&t.classList.add(`b-data-table-${r}`),e.classList.add("table");let a=t.querySelector(".b-data-table__cards"),l=()=>[...e.querySelectorAll("tbody tr")],u=D=>a?.querySelector(`[data-row-key="${D.dataset.rowKey}"]`),d=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],b=()=>{o&&(o.textContent=`${d().filter(D=>D.checked).length} of ${l().filter(D=>!D.hidden).length} row(s) selected.`)},x=()=>{let D=(s?.value||"").toLowerCase();l().forEach(V=>{let A=!(V.cells[2]||V.cells[1]||V.cells[0]).textContent.toLowerCase().includes(D);V.hidden=A;let P=u(V);P&&(P.hidden=A)}),b()},S=(D,V)=>{let rt=e.tBodies[0];l().sort((A,P)=>A.cells[D].textContent.localeCompare(P.cells[D].textContent)*V).forEach(A=>{rt.append(A);let P=u(A);P&&a.append(P)})},I=D=>{let V=D.target.closest("th");if(!V)return;let rt=V.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(A=>A.removeAttribute("b-att-sort")),V.setAttribute("b-att-sort",rt===1?"asc":"desc"),S([...V.parentElement.children].indexOf(V),rt)},H=(D,V)=>{let A=u(D)?.querySelector("input[type='checkbox']");A&&A.checked!==V&&(A.checked=V)},O=D=>{let V=D.target;if(V?.matches("input[type='checkbox']")){let rt=V.closest("tr"),A=V.closest(".b-data-table__card");if(rt)H(rt,V.checked);else if(A){let N=l().find(R=>R.dataset.rowKey===A.dataset.rowKey)?.querySelector("input[type='checkbox']");N&&N.checked!==V.checked&&(N.checked=V.checked)}}b()};return s?.addEventListener("input",x),e.tHead?.addEventListener("click",I),e.addEventListener("change",O),a?.addEventListener("change",O),b(),{destroy:()=>{s?.removeEventListener("input",x),e.tHead?.removeEventListener("click",I),e.removeEventListener("change",O),a?.removeEventListener("change",O)}}}m.register("data-table",{type:"owl",mount:Wd});j();function Kd(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("b-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let s=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",s),{destroy:()=>e?.removeEventListener("input",s)}}m.register("date-picker",{type:"owl",mount:Kd});j();function Vd(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","b-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let r=document.createElement("div");r.className="modal-dialog modal-dialog-centered",e.replaceWith(r),r.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(r=>r.setAttribute("data-bs-dismiss","modal"));let o=G().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return mn(t,o,"modal","NodexUIDialog")}m.register("dialog",{type:"owl",mount:Vd});j();function Gd(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}m.register("direction",{type:"static",mount:Gd});j();function Zd(t){t.classList.add("offcanvas","offcanvas-bottom","b-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(o=>o.setAttribute("data-bs-dismiss","offcanvas"));let s=G().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return mn(t,s,"offcanvas","NodexUIDrawer")}m.register("drawer",{type:"owl",mount:Zd});j();Mt();var Yc="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function Jc(t,e){t?.classList.add(e)}function Jd(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let s=document.createElement("span");s.setAttribute("b-dropdown-indicator",""),s.append(dt(document.createElement("span"),"check")),t.prepend(s)}function Yd(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label"),e.classList.add("dropdown-header")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.classList.add("dropdown-divider"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let s=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",s?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",s?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.classList.add("dropdown-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),Jd(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(Yc).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item"),e.classList.add("dropdown-item")})}function Qd(t){let e=[];return t.querySelectorAll("[b-dropdown-sub]").forEach(s=>{let o=s.querySelector("[b-dropdown-sub-trigger]"),r=s.querySelector("[b-dropdown-sub-content]");if(!o||!r)return;if(Jc(o,"b-dropdown-menu-sub-trigger"),Jc(r,"b-dropdown-menu-sub-content"),o.setAttribute("data-slot","dropdown-menu-sub-trigger"),o.setAttribute("role","menuitem"),o.setAttribute("aria-haspopup","menu"),r.setAttribute("data-slot","dropdown-menu-sub-content"),r.setAttribute("role","menu"),r.hidden=!0,!o.querySelector(".b-dropdown-menu-sub-trigger-icon")){let b=dt(document.createElement("span"),"chevron-right");b.classList.add("b-dropdown-menu-sub-trigger-icon"),o.append(b)}let a=b=>{r.hidden=!b,o.setAttribute("data-state",b?"open":"closed"),o.setAttribute("aria-expanded",String(b))},l=()=>a(!0),u=()=>a(!1),d=b=>{b.preventDefault(),a(r.hidden)};s.addEventListener("mouseenter",l),s.addEventListener("mouseleave",u),o.addEventListener("focus",l),o.addEventListener("click",d),e.push(()=>{s.removeEventListener("mouseenter",l),s.removeEventListener("mouseleave",u),o.removeEventListener("focus",l),o.removeEventListener("click",d)})}),()=>e.forEach(s=>s())}function Xd(t){let e=t.querySelector("[b-dropdown-trigger]"),s=t.querySelector("[b-dropdown-menu]");if(!e||!s)return{destroy:()=>{}};t.classList.add("dropdown"),s.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),s.setAttribute("role","menu");let o=G().Dropdown.getOrCreateInstance(e),r=I=>{t.setAttribute("b-att-state",I?"open":"closed"),e.setAttribute("aria-expanded",String(I)),t.dispatchEvent(new CustomEvent(I?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>r(!0),l=()=>r(!1);e.addEventListener("shown.bs.dropdown",a),e.addEventListener("hidden.bs.dropdown",l);let u=()=>o.toggle();e.addEventListener("click",u);let d=I=>{I.key==="Escape"?(o.hide(),e.focus()):I.key==="ArrowDown"&&!s.classList.contains("show")&&(I.preventDefault(),o.show(),[...s.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",d);let b=I=>{t.contains(I.target)||o.hide()};document.addEventListener("click",b),Yd(s);let x=Qd(s),S=I=>{let H=I.target.closest(Yc);!H||H.closest("[b-dropdown-sub]")||o.hide()};return s.addEventListener("click",S),{destroy:()=>{x(),s.removeEventListener("click",S),document.removeEventListener("click",b),t.removeEventListener("keydown",d),e.removeEventListener("click",u),e.removeEventListener("shown.bs.dropdown",a),e.removeEventListener("hidden.bs.dropdown",l),o.dispose()}}}m.register("dropdown-menu",{type:"owl",mount:Xd});j();var Xi={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"};function th(t){let e=t.getAttribute("b-att-variant")||"default",s=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("b-empty",Xi[e]||Xi.default),t.querySelectorAll("[b-empty-header]").forEach(o=>o.classList.add("b-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(o=>o.classList.add("b-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(o=>o.classList.add("b-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(o=>o.classList.add("b-empty-content")),s.forEach(o=>{let r=o.getAttribute("b-att-variant")==="icon"?"icon":"default";o.classList.add("b-empty-media",`b-empty-media-${r}`),o.setAttribute("data-variant",r)}),{destroy:()=>{t.classList.remove("b-empty",...Object.values(Xi))}}}m.register("empty",{type:"owl",mount:th});j();function mi(t,e){t?.classList.add(...e.filter(Boolean))}function _s(t,e,s,o){t.querySelectorAll(e).forEach(r=>{r.setAttribute("data-slot",s),mi(r,[o])})}function eh(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function sh(t,e){return e.id?e.id:`${t?.id||"b-field"}-error`}function oh(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",s=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),mi(t,["b-field-set"]),s.push("b-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),mi(t,["b-field-group"]),s.push("b-field-group");else{let a=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",a),mi(t,["b-field",`b-field-orientation-${a}`]),s.push("b-field",`b-field-orientation-${a}`)}_s(t,"legend[b-field-legend], [b-field-legend]","field-legend","b-field-legend"),_s(t,"[b-field-group]","field-group","b-field-group"),_s(t,"[b-field-content]","field-content","b-field-content"),_s(t,"label[b-field-label], [b-field-label], [b-label]","field-label","b-field-label"),_s(t,"[b-field-title]","field-label","b-field-title"),_s(t,"[b-field-description]","field-description","b-field-description"),_s(t,"[b-field-separator]","field-separator","b-field-separator"),_s(t,"[b-field-error], [b-error]","field-error","b-field-error"),t.querySelectorAll("[b-field-separator]").forEach(a=>{if(!a.querySelector(".b-field-separator-line")){let l=document.createElement("span");l.className="b-field-separator-line",l.setAttribute("aria-hidden","true"),a.prepend(l)}a.textContent.trim()&&a.setAttribute("data-content","true")});let o=eh(t),r=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(o&&r){r.setAttribute("role",r.getAttribute("role")||"alert");let a=sh(o,r);r.id=a,o.setAttribute("aria-describedby",a),o.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...s)}}m.register("field",{type:"static",mount:oh});j();function rh(t){t.classList.add("b-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),s=t.querySelector("[name='description']"),o=t.querySelector("[b-form-counter], .b-form-counter-text"),r=Number(s?.getAttribute("maxlength")||100),a=()=>{o&&s&&(o.textContent=`${s.value.length}/${r} characters`)},l=()=>{e&&(e.value=""),s&&(s.value=""),a()},u=t.querySelector("[b-form-reset]");return u?.addEventListener("click",l),s?.addEventListener("input",a),a(),{destroy(){u?.removeEventListener("click",l),s?.removeEventListener("input",a)}}}m.register("form",{type:"static",mount:rh});j();function nh(t){let e=t.querySelector("[b-hover-card-trigger]"),s=t.querySelector("[b-hover-card-content]");if(!e||!s)return{};let o=()=>{s.hidden=!1,e.setAttribute("aria-expanded","true")},r=()=>{s.hidden=!0,e.setAttribute("aria-expanded","false")},a=l=>{l.key==="Escape"&&r()};return e.setAttribute("aria-haspopup","dialog"),s.setAttribute("role","dialog"),r(),t.addEventListener("mouseenter",o),t.addEventListener("mouseleave",r),t.addEventListener("focusin",o),t.addEventListener("focusout",r),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("mouseenter",o),t.removeEventListener("mouseleave",r),t.removeEventListener("focusin",o),t.removeEventListener("focusout",r),t.removeEventListener("keydown",a)}}}m.register("hover-card",{type:"owl",mount:nh});j();Mt();function ih(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(dt(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("b-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}m.register("icon",{type:"static",mount:ih});j();function ah(t){let e=Kn({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}m.register("input",{type:"static",mount:ah});j();function ch(t){let e=[...t.querySelectorAll("input")];t.classList.add("b-input-otp"),e.forEach(a=>{a.classList.add("form-control"),a.inputMode=a.inputMode||"numeric",a.maxLength=a.maxLength>0?a.maxLength:1});let s=()=>{let a=e.map(l=>l.value).join("");t.setAttribute("b-att-value",a),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:a}}))},o=a=>{let l=e.indexOf(a.target);a.target.value&&e[l+1]&&e[l+1].focus(),s()},r=a=>{let l=a.clipboardData.getData("text").trim();l&&(a.preventDefault(),e.forEach((u,d)=>{u.value=l[d]||""}),s())};return e.forEach(a=>a.addEventListener("input",o)),t.addEventListener("paste",r),{destroy:()=>{e.forEach(a=>a.removeEventListener("input",o)),t.removeEventListener("paste",r)}}}m.register("input-otp",{type:"owl",mount:ch});j();function lh(t){return t.classList.add("b-item"),{destroy:()=>t.classList.remove("b-item")}}m.register("item",{type:"static",mount:lh});j();function uh(t){return t.classList.add("b-kbd"),{destroy:()=>t.classList.remove("b-kbd")}}m.register("kbd",{type:"static",mount:uh});j();function ph(t){return t.classList.add("form-label","b-label","b-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","b-label")}}m.register("label",{type:"static",mount:ph});j();function dh(t){return t.classList.add("b-marker"),{destroy:()=>t.classList.remove("b-marker")}}m.register("marker",{type:"static",mount:dh});j();si();function hh(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function mh(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function bh(t){t.classList.add("b-markdown");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-mermaid")!=="false",o=t.getAttribute("b-att-base-ui")!=="false",r=t.getAttribute("b-att-editable")==="true",a=t.getAttribute("b-att-collaborative")==="true",l=t.getAttribute("b-att-room")||"b-markdown",u=t.getAttribute("b-att-password")||void 0,d=mh(t.getAttribute("b-att-signaling")),b=!1,x=null;function S(H){b||(t.setAttribute("data-status","error"),t.textContent=`Unable to render Markdown: ${H?.message||H}`,t.dispatchEvent(new CustomEvent("nodexui:markdown-error",{bubbles:!0,detail:{error:H}})))}async function I(){let H=hh(t);t.setAttribute("data-status","loading");let O=H;if(e)try{let A=await fetch(e);if(!A.ok)throw new Error(`${A.status} ${A.statusText}`);O=await A.text()}catch(A){S(A);return}if(r){t.replaceChildren(),t.classList.add("b-markdown-editable"),t.setAttribute("data-status","ready");let A=document.createElement("div");A.className="b-markdown-editor",A.setAttribute("data-slot","markdown-editor"),A.setAttribute("role","group"),A.setAttribute("aria-label",a?"Collaborative Markdown editor":"Markdown editor"),t.append(A);try{if(x=await In({root:A,value:O,collaborative:a,room:l,password:u,signaling:d,onChange:(P,N)=>{t.dispatchEvent(new CustomEvent("nodexui:markdown-change",{bubbles:!0,detail:{markdown:P,previousMarkdown:N}}))}}),b){x?.destroy?.(),x=null;return}}catch(P){S(P);return}t.dispatchEvent(new CustomEvent("nodexui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:a,room:l}}));return}let{data:D,content:V}=oi(O),rt;try{rt=await Tn(V)}catch(A){S(A);return}b||(t.innerHTML=rt,t.setAttribute("data-status","ready"),await On(t,{mermaid:s,nodexUi:o}),b||t.dispatchEvent(new CustomEvent("nodexui:markdown-render",{bubbles:!0,detail:{html:rt,frontmatter:D}})))}return I(),{destroy:()=>{b=!0,x?.destroy?.(),x=null,gn(t),t.classList.remove("b-markdown"),t.classList.remove("b-markdown-editable"),t.removeAttribute("data-status")}}}m.register("markdown",{type:"static",mount:bh});j();function fh(t){return t.classList.add("b-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}m.register("message",{type:"static",mount:fh});j();function gh(t){t.classList.add("b-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},s=new window.MutationObserver(e);return s.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>s.disconnect()}}m.register("message-scroller",{type:"owl",mount:gh});j();function vh(t){t.setAttribute("role","menubar"),t.classList.add("b-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("b-menubar")}}m.register("menubar",{type:"static",mount:vh});j();function xh(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}m.register("native-select",{type:"static",mount:xh});j();function yh(t){t.classList.add("nav");let e=[...t.querySelectorAll("a, button")].filter(o=>!o.disabled);e.forEach(o=>o.classList.add("nav-link"));let s=o=>{let r=e.indexOf(o.target),a=o.key==="ArrowRight"?1:o.key==="ArrowLeft"?-1:0;!a||r<0||(o.preventDefault(),e[(r+a+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(o=>o.setAttribute("role","menuitem")),t.addEventListener("keydown",s),{destroy:()=>t.removeEventListener("keydown",s)}}m.register("navigation-menu",{type:"owl",mount:yh});j();function wh(t){let e=t.querySelector("ol, ul")||t,s=[...e.children];return t.classList.add("b-pagination"),e.classList.add("pagination"),s.forEach(o=>{let r=o.querySelector("a, button");o.classList.add("page-item"),r?.classList.add("page-link"),r?.getAttribute("aria-current")==="page"&&o.classList.add("active"),(r?.hasAttribute("disabled")||r?.getAttribute("aria-disabled")==="true")&&o.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("b-pagination"),e.classList.remove("pagination")}}}m.register("pagination",{type:"owl",mount:wh});j();function Sh(t){let e=t.querySelector("[b-popover-trigger]")||t,s=t.querySelector("[b-popover-content]"),o=s?s.innerHTML:"";s?.remove(),e.setAttribute("aria-haspopup","dialog");let r=new(G()).Popover(e,{content:o,html:!0,trigger:"click"}),a=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},l=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",a),e.addEventListener("hidden.bs.popover",l),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",a),e.removeEventListener("hidden.bs.popover",l),r.dispose()}}}m.register("popover",{type:"owl",mount:Sh});j();function Ah(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),s=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("progress","b-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(s)),t.style.setProperty("--b-progress-value",`${s/e*100}%`),!t.querySelector("[b-progress-indicator]")){let o=document.createElement("span");o.className="progress-bar",o.setAttribute("b-progress-indicator",""),t.append(o)}return{destroy:()=>t.classList.remove("progress","b-progress")}}m.register("progress",{type:"static",mount:Ah});j();function Eh(t){let{open:e,close:s,destroy:o}=Zn(t,{closeSelector:"[b-pwa-close]"});return t.NodexUIPwa={open:e,close:s},{destroy:()=>{o(),delete t.NodexUIPwa}}}m.register("pwa",{type:"owl",mount:Eh});j();function Ch(t){return t.classList.add("card","b-card","b-qr-card"),{}}m.register("qr-card",{type:"static",mount:Ch});j();function Lh(t){let e=[...t.querySelectorAll("[b-question]")],s=t.querySelector("[b-question-prev]"),o=t.querySelector("[b-question-next]"),r=0,a=d=>{r=Math.min(e.length-1,Math.max(0,d)),e.forEach((b,x)=>{b.hidden=x!==r,b.setAttribute("b-att-state",x===r?"active":"inactive")}),s&&(s.disabled=r===0),o&&(o.disabled=r===e.length-1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:r}}))},l=()=>a(r-1),u=()=>a(r+1);return s?.addEventListener("click",l),o?.addEventListener("click",u),e.length&&a(0),{destroy:()=>{s?.removeEventListener("click",l),o?.removeEventListener("click",u)}}}m.register("questionnaire",{type:"owl",mount:Lh});j();m.register("radio-group",{type:"static",mount:t=>hi(t,"radio")});j();function kh(t){let e=t.querySelector("[b-resizable-panel]")||t,s=t.querySelector("[b-resizable-handle]");if(!s)return{};let o=Number(t.getAttribute("b-att-min")||160),r=Number(t.getAttribute("b-att-max")||720),a=l=>{let u=l.clientX,d=e.getBoundingClientRect().width,b=S=>{e.style.width=`${Math.min(r,Math.max(o,d+S.clientX-u))}px`},x=()=>{document.removeEventListener("pointermove",b),document.removeEventListener("pointerup",x),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",b),document.addEventListener("pointerup",x)};return s.addEventListener("pointerdown",a),{destroy:()=>s.removeEventListener("pointerdown",a)}}m.register("resizable",{type:"owl",mount:kh});j();function Nh(t){return t.classList.add("b-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}m.register("scroll-area",{type:"static",mount:Nh});j();function Th(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("b-separator",e?"b-separator-vertical":"b-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("b-separator","b-separator-vertical","b-separator-horizontal")}}m.register("separator",{type:"static",mount:Th});j();function Qc(t,{triggerSelector:e,panelSelector:s,ariaHaspopup:o,panelRole:r,onKeyDown:a}={}){let l=t.querySelector(e),u=t.querySelector(s),d=I=>{!u||!l||(u.hidden=!I,t.setAttribute("b-att-state",I?"open":"closed"),l.setAttribute("aria-expanded",String(I)),t.dispatchEvent(new CustomEvent(I?"nodexui:open":"nodexui:close",{bubbles:!0})))},b=()=>d(u?.hidden!==!1),x=I=>{I.key==="Escape"&&(d(!1),l?.focus()),a?.(I,{setOpen:d,panel:u,trigger:l})},S=I=>{t.contains(I.target)||d(!1)};return l?.setAttribute("aria-haspopup",o),u?.setAttribute("role",r),u&&(u.hidden=!0),l?.addEventListener("click",b),t.addEventListener("keydown",x),document.addEventListener("click",S),{trigger:l,panel:u,setOpen:d,destroy:()=>{l?.removeEventListener("click",b),t.removeEventListener("keydown",x),document.removeEventListener("click",S)}}}function Oh(t){let{setOpen:e,destroy:s}=Qc(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),o=t.querySelector("[b-select-trigger]"),r=t.querySelector("[b-select-value]"),a=l=>{let u=l.target.closest("[b-select-item]");if(!(!u||!t.contains(u))){for(let d of t.querySelectorAll("[b-select-item]"))d.setAttribute("aria-selected",String(d===u));r&&(r.textContent=u.textContent.trim()),t.setAttribute("b-att-value",u.getAttribute("b-att-value")||u.textContent.trim()),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),o?.focus()}};for(let l of t.querySelectorAll("[b-select-item]"))l.setAttribute("role","option");return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),s()}}}m.register("select",{type:"owl",mount:Oh});j();function Ih(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],s=r=>{t.setAttribute("b-att-collapsed",r?"true":"false"),t.dispatchEvent(new CustomEvent(r?"nodexui:collapse":"nodexui:expand",{bubbles:!0}))},o=()=>s(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(r=>r.addEventListener("click",o)),s(t.getAttribute("b-att-collapsed")==="true"),t.NodexUIShell={collapse:()=>s(!0),expand:()=>s(!1),toggle:o},{destroy:()=>{e.forEach(r=>r.removeEventListener("click",o)),delete t.NodexUIShell}}}m.register("shell",{type:"owl",mount:Ih});j();function Rh(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"b-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(r=>r.setAttribute("data-bs-dismiss","offcanvas"));let o=G().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return mn(t,o,"offcanvas","NodexUISheet")}m.register("sheet",{type:"owl",mount:Rh});j();var Bh={"[b-sidebar-header]":["b-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["b-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["b-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["b-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["b-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["b-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["b-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["b-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["b-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["b-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["b-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["b-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["b-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["b-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["b-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["b-sidebar-separator","sidebar-separator","separator"]};function $h(t){let e=[];for(let[s,[o,r,a]]of Object.entries(Bh))for(let l of t.querySelectorAll(s))l.classList.add(o),l.dataset.slot=r,l.dataset.sidebar=a,(l.hasAttribute("b-att-active")||l.getAttribute("aria-current")==="page")&&(l.classList.add("is-active"),l.dataset.active="true"),e.push([l,o]);return e}function _h(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,s=[...t.querySelectorAll("[b-sidebar-close]")],o=$h(t),r=d=>{t.setAttribute("b-att-state",d?"open":"closed"),t.classList.toggle("is-open",d),t.dataset.state=d?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(d?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>r(!0),l=()=>r(!1),u=d=>{d.key==="Escape"&&l()};return e?.addEventListener("click",a),s.forEach(d=>d.addEventListener("click",l)),t.addEventListener("keydown",u),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",r(t.getAttribute("b-att-state")==="open"),t.NodexUISidebar={open:a,close:l},{destroy:()=>{e?.removeEventListener("click",a),s.forEach(d=>d.removeEventListener("click",l)),t.removeEventListener("keydown",u);for(let[d,b]of o)d.classList.remove(b,"is-active"),d.removeAttribute("data-slot"),d.removeAttribute("data-sidebar"),d.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.NodexUISidebar}}}m.register("sidebar",{type:"owl",mount:_h});j();function Mh(t){t.classList.add("b-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("b-slider")}}}m.register("slider",{type:"static",mount:Mh});j();function Uh(t){let e=t.getAttribute("b-att-shape")==="circle"?"b-skeleton-circle":"b-skeleton-block";return t.classList.add("b-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("b-skeleton","b-skeleton-circle","b-skeleton-block")}}m.register("skeleton",{type:"static",mount:Uh});j();function Ph(t){let e=t.getAttribute("b-att-type")==="grow",s=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let o=document.createElement("span");o.className="visually-hidden",o.textContent=s,t.append(o)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}m.register("spinner",{type:"static",mount:Ph});j();function qh(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),s=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),s?.classList.add("form-check","form-switch","b-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),s?.classList.remove("form-check","form-switch","b-switch")}}}m.register("switch",{type:"static",mount:qh});j();function Dh(t){if(t.classList.add("table","b-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","b-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","b-table","table-striped","table-hover")}}m.register("table",{type:"static",mount:Dh});j();function jh(t){t.classList.add("b-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],s=[...t.querySelectorAll("[b-panel]")],o=new Map(s.map(S=>[S.getAttribute("b-panel"),S])),r=new Map,a=new Map,l=new Map,u=new Map,d=e[0]?.parentElement;d&&!d.hasAttribute("role")&&d.setAttribute("role","tablist"),d?.classList.add("nav");let b=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",x=S=>{t.setAttribute("b-att-value",S),e.forEach(I=>{I.tabIndex=I.getAttribute("b-tab")===S?0:-1}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:S}}))};return e.forEach((S,I)=>{let H=S.getAttribute("b-tab"),O=o.get(H),D=H===b;if(S.setAttribute("role","tab"),S.classList.add("nav-link"),S.tabIndex=D?0:-1,D&&S.classList.add("active"),O){let N=O.id||`b-tabs-panel-${H}`;O.id=N,O.setAttribute("role","tabpanel"),O.classList.add("tab-pane","fade"),D&&O.classList.add("show","active"),S.setAttribute("data-bs-target",`#${N}`)}let V=G().Tab.getOrCreateInstance(S);r.set(S,V);let rt=()=>V.show();S.addEventListener("click",rt),a.set(S,rt);let A=()=>x(H);S.addEventListener("shown.bs.tab",A),u.set(S,A);let P=N=>{let R=Vn(N.key,I,e.length);if(R===-1)return;N.preventDefault();let y=e[R];y.focus(),r.get(y)?.show()};S.addEventListener("keydown",P),l.set(S,P)}),b&&t.setAttribute("b-att-value",b),{destroy:()=>{e.forEach(S=>{S.removeEventListener("click",a.get(S)),S.removeEventListener("keydown",l.get(S)),S.removeEventListener("shown.bs.tab",u.get(S)),r.get(S)?.dispose()}),a.clear(),l.clear(),u.clear(),r.clear()}}}m.register("tabs",{type:"owl",mount:jh});j();function zh(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("b-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","b-textarea-no-resize")}}m.register("textarea",{type:"static",mount:zh});j();function Fh(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function Hh(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}function Wh(t){t.classList.add("b-text-editor");let e=t.getAttribute("b-att-src"),s=t.getAttribute("b-att-provider")||void 0,o=t.getAttribute("b-att-room")||"b-text-editor",r=t.getAttribute("b-att-url")||void 0,a=pi({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:s,url:r}),l=t.getAttribute("b-att-password")||void 0,u=Hh(t.getAttribute("b-att-signaling")),d=t.getAttribute("b-att-placeholder")||void 0,b=!1,x=null;function S(H){b||(t.setAttribute("data-status","error"),t.textContent=`Unable to mount text editor: ${H?.message||H}`,t.dispatchEvent(new CustomEvent("nodexui:text-editor-error",{bubbles:!0,detail:{error:H}})))}async function I(){t.setAttribute("data-status","loading");let H=Fh(t);if(e)try{let D=await fetch(e);if(!D.ok)throw new Error(`${D.status} ${D.statusText}`);H=await D.text()}catch(D){S(D);return}t.replaceChildren();let O=document.createElement("div");O.className="b-text-editor-shell",O.setAttribute("data-slot","text-editor-shell"),O.setAttribute("role","group"),O.setAttribute("aria-label",a?"Collaborative rich text editor":"Rich text editor"),t.append(O);try{if(x=await ui({root:O,value:H,placeholder:d,collaborative:a,providerType:s,room:o,url:r,password:l,signaling:u,onChange:(D,V)=>{t.dispatchEvent(new CustomEvent("nodexui:text-editor-change",{bubbles:!0,detail:{html:D,previousHtml:V}}))}}),b){x?.destroy?.(),x=null;return}}catch(D){S(D);return}t.setAttribute("data-status","ready"),t.dispatchEvent(new CustomEvent("nodexui:text-editor-ready",{bubbles:!0,detail:{collaborative:a,room:o}}))}return I(),{destroy:()=>{b=!0,x?.destroy?.(),x=null,t.classList.remove("b-text-editor"),t.removeAttribute("data-status")}}}m.register("text-editor",{type:"static",mount:Wh});Mt();j();function Kh(t,e){let s=fn(e);t.classList.remove(...oc),t.className=`${t.className} ${Xn({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",s.label),t.setAttribute("title",s.label),t.setAttribute("aria-pressed",s.pressed);let o=t.querySelector("[b-theme-button-icon]");o||(o=document.createElement("span"),o.setAttribute("b-theme-button-icon",""),t.prepend(o)),o.setAttribute("b-icon",s.icon),dt(o,s.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let r=t.querySelector("[b-theme-button-label]");r||(r=document.createElement("span"),r.className="visually-hidden",r.setAttribute("b-theme-button-label",""),t.append(r)),r.textContent=s.label}function Vh(t){let e=ze({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),s=(a=e.current())=>Kh(t,a),o=()=>s(e.toggle()),r=a=>s(a.detail?.theme);return s(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",o),document.addEventListener("nodexui:theme-change",r),{destroy:()=>{t.removeEventListener("click",o),document.removeEventListener("nodexui:theme-change",r)}}}m.register("theme-button",{type:"static",mount:Vh});j();_();function Gh(t){let e=[...t.querySelectorAll("[b-toast-close]")],s=t.getAttribute("b-att-delay"),o=s===null?3e3:Number(s),r=Jn(t.getAttribute("b-att-position"));t.className=g(t.className,"toast","fade",r),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(x=>x.setAttribute("data-bs-dismiss","toast"));let a=new(G()).Toast(t,{autohide:o>0,delay:o||3e3}),l=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},u=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",l),t.addEventListener("hidden.bs.toast",u);let d=()=>a.show(),b=()=>a.hide();return t.getAttribute("b-att-state")==="open"&&d(),t.NodexUIToast={show:d,hide:b},{destroy:()=>{t.removeEventListener("shown.bs.toast",l),t.removeEventListener("hidden.bs.toast",u),a.dispose(),delete t.NodexUIToast}}}m.register("toast",{type:"owl",mount:Gh});j();function Zh(t){let e=t.querySelector("[b-tooltip-trigger]")||t,s=t.querySelector("[b-tooltip-content]");!s&&t.getAttribute("b-att-content")&&(s=document.createElement("span"),s.setAttribute("b-tooltip-content",""),s.textContent=t.getAttribute("b-att-content"),t.appendChild(s));let o=s?s.innerHTML:"";s?.remove();let r=new(G()).Tooltip(e,{title:o,html:!0,trigger:"hover focus"}),a=()=>t.setAttribute("b-att-state","open"),l=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",a),e.addEventListener("hidden.bs.tooltip",l),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",a),e.removeEventListener("hidden.bs.tooltip",l),r.dispose()}}}m.register("tooltip",{type:"owl",mount:Zh});j();function Jh(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let s=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(s)),t.setAttribute("b-att-state",s?"on":"off"),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{pressed:s}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}m.register("toggle",{type:"owl",mount:Jh});j();function Yh(t){let e=[...t.querySelectorAll("[b-att-value], button")],s=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",s?"group":"radiogroup"),e.forEach(r=>{r.classList.add("btn","btn-outline-secondary"),r.setAttribute("aria-pressed",r.getAttribute("aria-pressed")||"false")});let o=r=>{let a=r.target.closest("button, [b-att-value]");if(!a||!t.contains(a))return;s||e.forEach(u=>u.setAttribute("aria-pressed","false")),a.setAttribute("aria-pressed",String(a.getAttribute("aria-pressed")!=="true"));let l=e.filter(u=>u.getAttribute("aria-pressed")==="true").map(u=>u.getAttribute("b-att-value")||u.textContent.trim());t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:s?l:l[0]}}))};return t.addEventListener("click",o),{destroy:()=>t.removeEventListener("click",o)}}m.register("toggle-group",{type:"owl",mount:Yh});j();var Xc={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"};function Qh(t){let e=Xc[t.getAttribute("b-att-variant")||"body"];return t.classList.add("b-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("b-typography",...Object.values(Xc))}}m.register("typography",{type:"static",mount:Qh});q();wi(di);na(aa);ia();var tl=m;return ul(Xh);})();
90
+ `)}function Ah(t){Sh(t),t.querySelectorAll("[b-icon]").forEach(I=>ut(I,I.getAttribute("b-icon"),{label:""}));let e=t.querySelector("table")||t,o=t.querySelector("[b-table-search]"),r=t.querySelector(".b-data-table__selection-summary"),s=t.getAttribute("b-att-variant");t.classList.add("b-data-table"),s&&t.classList.add(`b-data-table-${s}`),e.classList.add("table");let a=t.querySelector(".b-data-table__cards"),c=()=>[...e.querySelectorAll("tbody tr")],l=I=>a?.querySelector(`[data-row-key="${I.dataset.rowKey}"]`),d=()=>[...e.querySelectorAll("tbody input[type='checkbox']")],f=()=>{r&&(r.textContent=`${d().filter(I=>I.checked).length} of ${c().filter(I=>!I.hidden).length} row(s) selected.`)},v=()=>{let I=(o?.value||"").toLowerCase();c().forEach(K=>{let L=!(K.cells[2]||K.cells[1]||K.cells[0]).textContent.toLowerCase().includes(I);K.hidden=L;let _=l(K);_&&(_.hidden=L)}),f()},O=(I,K)=>{let nt=e.tBodies[0];c().sort((L,_)=>L.cells[I].textContent.localeCompare(_.cells[I].textContent)*K).forEach(L=>{nt.append(L);let _=l(L);_&&a.append(_)})},k=I=>{let K=I.target.closest("th");if(!K)return;let nt=K.getAttribute("b-att-sort")==="asc"?-1:1;e.querySelectorAll("th").forEach(L=>L.removeAttribute("b-att-sort")),K.setAttribute("b-att-sort",nt===1?"asc":"desc"),O([...K.parentElement.children].indexOf(K),nt)},D=(I,K)=>{let L=l(I)?.querySelector("input[type='checkbox']");L&&L.checked!==K&&(L.checked=K)},X=I=>{let K=I.target;if(K?.matches("input[type='checkbox']")){let nt=K.closest("tr"),L=K.closest(".b-data-table__card");if(nt)D(nt,K.checked);else if(L){let N=c().find(M=>M.dataset.rowKey===L.dataset.rowKey)?.querySelector("input[type='checkbox']");N&&N.checked!==K.checked&&(N.checked=K.checked)}}f()};return o?.addEventListener("input",v),e.tHead?.addEventListener("click",k),e.addEventListener("change",X),a?.addEventListener("change",X),f(),{destroy:()=>{o?.removeEventListener("input",v),e.tHead?.removeEventListener("click",k),e.removeEventListener("change",X),a?.removeEventListener("change",X)}}}m.register("data-table",{type:"owl",mount:Ah});function Eh(t){let e=t.matches("input")?t:t.querySelector("input[type='date'], input");t.classList.add("b-date-picker"),e?.classList.add("form-control"),e?.setAttribute("type",e.getAttribute("type")||"date");let o=()=>{t.setAttribute("b-att-value",e.value),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:e.value}}))};return e?.addEventListener("input",o),{destroy:()=>e?.removeEventListener("input",o)}}m.register("date-picker",{type:"owl",mount:Eh});function Ch(t){let e=t.querySelector("[b-dialog-panel]");if(t.classList.add("modal","fade","b-dialog-backdrop"),t.setAttribute("tabindex","-1"),t.setAttribute("aria-hidden","true"),e){let s=document.createElement("div");s.className="modal-dialog modal-dialog-centered",e.replaceWith(s),s.append(e),e.classList.add("modal-content")}[...t.querySelectorAll("[b-dialog-close]")].forEach(s=>s.setAttribute("data-bs-dismiss","modal"));let r=z().Modal.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,focus:!0});return un(t,r,"modal","NodexUIDialog")}m.register("dialog",{type:"owl",mount:Ch});function Lh(t){let e=t.getAttribute("b-att-dir")||t.getAttribute("dir")||"ltr";return t.setAttribute("dir",e==="rtl"?"rtl":"ltr"),{}}m.register("direction",{type:"static",mount:Lh});function kh(t){t.classList.add("offcanvas","offcanvas-bottom","b-drawer-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-drawer-close]")].forEach(r=>r.setAttribute("data-bs-dismiss","offcanvas"));let o=z().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return un(t,o,"offcanvas","NodexUIDrawer")}m.register("drawer",{type:"owl",mount:kh});var dl="a, button, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio']";function pl(t,e){t?.classList.add(e)}function Nh(t,e){if(!e||t.querySelector("[b-dropdown-indicator], [data-slot$='indicator']"))return;let o=document.createElement("span");o.setAttribute("b-dropdown-indicator",""),o.append(ut(document.createElement("span"),"check")),t.prepend(o)}function Th(t){t.setAttribute("data-slot",t.getAttribute("data-slot")||"dropdown-menu-content"),t.querySelectorAll("[b-dropdown-group]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-group"),e.setAttribute("role",e.getAttribute("role")||"group")}),t.querySelectorAll("[b-dropdown-label]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-label"),e.classList.add("dropdown-header")}),t.querySelectorAll("[b-dropdown-separator]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-separator"),e.classList.add("dropdown-divider"),e.setAttribute("role",e.getAttribute("role")||"separator")}),t.querySelectorAll("[b-dropdown-shortcut]").forEach(e=>{e.setAttribute("data-slot","dropdown-menu-shortcut")}),t.querySelectorAll("[b-dropdown-checkbox-item], [b-dropdown-radio-item]").forEach(e=>{let o=e.hasAttribute("b-dropdown-radio-item");e.setAttribute("role",o?"menuitemradio":"menuitemcheckbox"),e.setAttribute("data-slot",o?"dropdown-menu-radio-item":"dropdown-menu-checkbox-item"),e.classList.add("dropdown-item"),e.setAttribute("aria-checked",e.hasAttribute("checked")||e.getAttribute("aria-checked")==="true"?"true":"false"),Nh(e,e.getAttribute("aria-checked")==="true")}),t.querySelectorAll(dl).forEach(e=>{e.setAttribute("role",e.getAttribute("role")||"menuitem"),e.setAttribute("tabindex",e.getAttribute("tabindex")||"0"),e.setAttribute("data-slot",e.getAttribute("data-slot")||"dropdown-menu-item"),e.classList.add("dropdown-item")})}function ea(t,e,o){e.hidden=!o,t.setAttribute("data-state",o?"open":"closed"),t.setAttribute("aria-expanded",String(o))}function Oh(t){let e=t.querySelector("[b-dropdown-sub-trigger]"),o=t.querySelector("[b-dropdown-sub-content]");if(!e||!o)return()=>{};if(pl(e,"b-dropdown-menu-sub-trigger"),pl(o,"b-dropdown-menu-sub-content"),e.setAttribute("data-slot","dropdown-menu-sub-trigger"),e.setAttribute("role","menuitem"),e.setAttribute("aria-haspopup","menu"),o.setAttribute("data-slot","dropdown-menu-sub-content"),o.setAttribute("role","menu"),o.hidden=!0,!e.querySelector(".b-dropdown-menu-sub-trigger-icon")){let c=ut(document.createElement("span"),"chevron-right");c.classList.add("b-dropdown-menu-sub-trigger-icon"),e.append(c)}let r=()=>ea(e,o,!0),s=()=>ea(e,o,!1),a=c=>{c.preventDefault(),ea(e,o,o.hidden)};return t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",s),e.addEventListener("focus",r),e.addEventListener("click",a),()=>{t.removeEventListener("mouseenter",r),t.removeEventListener("mouseleave",s),e.removeEventListener("focus",r),e.removeEventListener("click",a)}}function Ih(t){let e=[...t.querySelectorAll("[b-dropdown-sub]")].map(Oh);return()=>e.forEach(o=>o())}function Rh(t){let e=t.querySelector("[b-dropdown-trigger]"),o=t.querySelector("[b-dropdown-menu]");if(!e||!o)return{destroy:()=>{}};t.classList.add("dropdown"),o.classList.add("dropdown-menu"),e.setAttribute("aria-haspopup","menu"),o.setAttribute("role","menu");let r=z().Dropdown.getOrCreateInstance(e),s=k=>{t.setAttribute("b-att-state",k?"open":"closed"),e.setAttribute("aria-expanded",String(k)),t.dispatchEvent(new CustomEvent(k?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>s(!0),c=()=>s(!1);e.addEventListener("shown.bs.dropdown",a),e.addEventListener("hidden.bs.dropdown",c);let l=()=>r.toggle();e.addEventListener("click",l);let d=k=>{k.key==="Escape"?(r.hide(),e.focus()):k.key==="ArrowDown"&&!o.classList.contains("show")&&(k.preventDefault(),r.show(),[...o.querySelectorAll("a, button, [tabindex]:not([tabindex='-1'])")][0]?.focus())};t.addEventListener("keydown",d);let f=k=>{t.contains(k.target)||r.hide()};document.addEventListener("click",f),Th(o);let v=Ih(o),O=k=>{let D=k.target.closest(dl);!D||D.closest("[b-dropdown-sub]")||r.hide()};return o.addEventListener("click",O),{destroy:()=>{v(),o.removeEventListener("click",O),document.removeEventListener("click",f),t.removeEventListener("keydown",d),e.removeEventListener("click",l),e.removeEventListener("shown.bs.dropdown",a),e.removeEventListener("hidden.bs.dropdown",c),r.dispose()}}}m.register("dropdown-menu",{type:"owl",mount:Rh});var oa={default:"b-empty-default",outline:"b-empty-outline",background:"b-empty-background"};function Bh(t){let e=t.getAttribute("b-att-variant")||"default",o=[...t.querySelectorAll("[b-empty-media]")];return t.setAttribute("role",t.getAttribute("role")||"status"),t.classList.add("b-empty",oa[e]||oa.default),t.querySelectorAll("[b-empty-header]").forEach(r=>r.classList.add("b-empty-header")),t.querySelectorAll("[b-empty-title]").forEach(r=>r.classList.add("b-empty-title")),t.querySelectorAll("[b-empty-description]").forEach(r=>r.classList.add("b-empty-description")),t.querySelectorAll("[b-empty-content]").forEach(r=>r.classList.add("b-empty-content")),o.forEach(r=>{let s=r.getAttribute("b-att-variant")==="icon"?"icon":"default";r.classList.add("b-empty-media",`b-empty-media-${s}`),r.setAttribute("data-variant",s)}),{destroy:()=>{t.classList.remove("b-empty",...Object.values(oa))}}}m.register("empty",{type:"owl",mount:Bh});function di(t,e){t?.classList.add(...e.filter(Boolean))}function Ro(t,e,o,r){t.querySelectorAll(e).forEach(s=>{s.setAttribute("data-slot",o),di(s,[r])})}function $h(t){return t.querySelector("input, textarea, select, [role='checkbox'], [role='radio'], [role='switch']")}function Mh(t,e){return e.id?e.id:`${t?.id||"b-field"}-error`}function Uh(t){let e=t.getAttribute("b-att-slot")||t.getAttribute("data-slot")||"field",o=[];if(e==="field-set")t.setAttribute("data-slot","field-set"),di(t,["b-field-set"]),o.push("b-field-set");else if(e==="field-group")t.setAttribute("data-slot","field-group"),di(t,["b-field-group"]),o.push("b-field-group");else{let a=t.getAttribute("b-att-orientation")||t.getAttribute("data-orientation")||"vertical";t.setAttribute("role",t.getAttribute("role")||"group"),t.setAttribute("data-slot","field"),t.setAttribute("data-orientation",a),di(t,["b-field",`b-field-orientation-${a}`]),o.push("b-field",`b-field-orientation-${a}`)}Ro(t,"legend[b-field-legend], [b-field-legend]","field-legend","b-field-legend"),Ro(t,"[b-field-group]","field-group","b-field-group"),Ro(t,"[b-field-content]","field-content","b-field-content"),Ro(t,"label[b-field-label], [b-field-label], [b-label]","field-label","b-field-label"),Ro(t,"[b-field-title]","field-label","b-field-title"),Ro(t,"[b-field-description]","field-description","b-field-description"),Ro(t,"[b-field-separator]","field-separator","b-field-separator"),Ro(t,"[b-field-error], [b-error]","field-error","b-field-error"),t.querySelectorAll("[b-field-separator]").forEach(a=>{if(!a.querySelector(".b-field-separator-line")){let c=document.createElement("span");c.className="b-field-separator-line",c.setAttribute("aria-hidden","true"),a.prepend(c)}a.textContent.trim()&&a.setAttribute("data-content","true")});let r=$h(t),s=t.querySelector("[b-field-error], [b-error], [data-slot='field-error']");if(r&&s){s.setAttribute("role",s.getAttribute("role")||"alert");let a=Mh(r,s);s.id=a,r.setAttribute("aria-describedby",a),r.setAttribute("aria-invalid","true"),t.setAttribute("data-invalid","true")}return{destroy:()=>t.classList.remove(...o)}}m.register("field",{type:"static",mount:Uh});function _h(t){t.classList.add("b-form"),t.setAttribute("data-slot","form"),t.setAttribute("novalidate","");let e=t.querySelector("[name='title']"),o=t.querySelector("[name='description']"),r=t.querySelector("[b-form-counter], .b-form-counter-text"),s=Number(o?.getAttribute("maxlength")||100),a=()=>{r&&o&&(r.textContent=`${o.value.length}/${s} characters`)},c=()=>{e&&(e.value=""),o&&(o.value=""),a()},l=t.querySelector("[b-form-reset]");return l?.addEventListener("click",c),o?.addEventListener("input",a),a(),{destroy(){l?.removeEventListener("click",c),o?.removeEventListener("input",a)}}}m.register("form",{type:"static",mount:_h});function Ph(t){let e=t.querySelector("[b-hover-card-trigger]"),o=t.querySelector("[b-hover-card-content]");if(!e||!o)return{};let r=()=>{o.hidden=!1,e.setAttribute("aria-expanded","true")},s=()=>{o.hidden=!0,e.setAttribute("aria-expanded","false")},a=c=>{c.key==="Escape"&&s()};return e.setAttribute("aria-haspopup","dialog"),o.setAttribute("role","dialog"),s(),t.addEventListener("mouseenter",r),t.addEventListener("mouseleave",s),t.addEventListener("focusin",r),t.addEventListener("focusout",s),t.addEventListener("keydown",a),{destroy:()=>{t.removeEventListener("mouseenter",r),t.removeEventListener("mouseleave",s),t.removeEventListener("focusin",r),t.removeEventListener("focusout",s),t.removeEventListener("keydown",a)}}}m.register("hover-card",{type:"owl",mount:Ph});function qh(t){let e=t.getAttribute("b-icon")||t.getAttribute("b-att-icon")||t.getAttribute("aria-label");return e?(ut(t,e,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url"),label:t.getAttribute("b-att-label")??t.getAttribute("aria-label")??"",size:t.getAttribute("b-icon-size")||t.getAttribute("b-att-size")}),{destroy:()=>{t.classList.remove("b-icon"),t.style.removeProperty("--b-icon-url"),t.style.removeProperty("--b-icon-size"),!t.getAttribute("b-att-label")&&!t.getAttribute("aria-label")&&t.removeAttribute("aria-hidden")}}):{}}m.register("icon",{type:"static",mount:qh});function Dh(t){let e=Dn({tag:t.tagName.toLowerCase(),type:t.getAttribute("type")});return t.classList.add(e),{destroy:()=>t.classList.remove(e)}}m.register("input",{type:"static",mount:Dh});function jh(t){let e=[...t.querySelectorAll("input")];t.classList.add("b-input-otp"),e.forEach(a=>{a.classList.add("form-control"),a.inputMode=a.inputMode||"numeric",a.maxLength=a.maxLength>0?a.maxLength:1});let o=()=>{let a=e.map(c=>c.value).join("");t.setAttribute("b-att-value",a),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:a}}))},r=a=>{let c=e.indexOf(a.target);a.target.value&&e[c+1]&&e[c+1].focus(),o()},s=a=>{let c=a.clipboardData.getData("text").trim();c&&(a.preventDefault(),e.forEach((l,d)=>{l.value=c[d]||""}),o())};return e.forEach(a=>a.addEventListener("input",r)),t.addEventListener("paste",s),{destroy:()=>{e.forEach(a=>a.removeEventListener("input",r)),t.removeEventListener("paste",s)}}}m.register("input-otp",{type:"owl",mount:jh});function Fh(t){return t.classList.add("b-item"),{destroy:()=>t.classList.remove("b-item")}}m.register("item",{type:"static",mount:Fh});function zh(t){return t.classList.add("b-kbd"),{destroy:()=>t.classList.remove("b-kbd")}}m.register("kbd",{type:"static",mount:zh});function Hh(t){return t.classList.add("form-label","b-label","b-label"),t.getAttribute("b-att-required")==="true"&&t.setAttribute("b-att-state","required"),{destroy:()=>t.classList.remove("form-label","b-label","b-label")}}m.register("label",{type:"static",mount:Hh});function Wh(t){return t.classList.add("b-marker"),{destroy:()=>t.classList.remove("b-marker")}}m.register("marker",{type:"static",mount:Wh});function hi(t){return String(t||"").split(",").map(e=>e.trim()).filter(Boolean)}async function mi(t){let e=await fetch(t);if(!e.ok)throw new Error(`${e.status} ${e.statusText}`);return e.text()}function Kh(t){let e=t.querySelector("script[type='text/markdown'], template");return e?e.tagName==="TEMPLATE"?e.content.textContent:e.textContent:t.getAttribute("b-att-content")||t.textContent||""}function Vh(t){return{src:t.getAttribute("b-att-src"),mermaid:t.getAttribute("b-att-mermaid")!=="false",nodexUi:t.getAttribute("b-att-base-ui")!=="false",editable:t.getAttribute("b-att-editable")==="true",collaborative:t.getAttribute("b-att-collaborative")==="true",room:t.getAttribute("b-att-room")||"b-markdown",password:t.getAttribute("b-att-password")||void 0,signaling:hi(t.getAttribute("b-att-signaling"))}}function ra(t,e){if(t.destroyed)return;let{element:o}=t;o.setAttribute("data-status","error"),o.textContent=`Unable to render Markdown: ${e?.message||e}`,o.dispatchEvent(new CustomEvent("nodexui:markdown-error",{bubbles:!0,detail:{error:e}}))}async function Gh(t,e){let{element:o,options:r}=t,{collaborative:s,room:a}=r;o.replaceChildren(),o.classList.add("b-markdown-editable"),o.setAttribute("data-status","ready");let c=document.createElement("div");c.className="b-markdown-editor",c.setAttribute("data-slot","markdown-editor"),c.setAttribute("role","group"),c.setAttribute("aria-label",s?"Collaborative Markdown editor":"Markdown editor"),o.append(c);try{t.editorHandle=await ti({root:c,value:e,collaborative:s,room:a,password:r.password,signaling:r.signaling,onChange:(l,d)=>{o.dispatchEvent(new CustomEvent("nodexui:markdown-change",{bubbles:!0,detail:{markdown:l,previousMarkdown:d}}))}})}catch(l){ra(t,l);return}if(t.destroyed){hl(t);return}o.dispatchEvent(new CustomEvent("nodexui:markdown-editor-ready",{bubbles:!0,detail:{collaborative:s,room:a}}))}async function Zh(t,e){let{element:o,options:r}=t,{data:s,content:a}=ei(e),c,l;try{l=r.nodexUi===!1?null:Zn(a),c=await Qn(l?.source??a)}catch(d){ra(t,d);return}t.destroyed||(o.innerHTML=c,o.setAttribute("data-status","ready"),await Xn(o,{mermaid:r.mermaid,nodexUi:r.nodexUi,mdx:l,baseUrl:Gn(r.src)}),!t.destroyed&&o.dispatchEvent(new CustomEvent("nodexui:markdown-render",{bubbles:!0,detail:{html:c,frontmatter:s}})))}async function Jh(t){let{element:e,options:o}=t;e.setAttribute("data-status","loading");let r=Kh(e);if(o.src)try{r=await mi(o.src)}catch(s){ra(t,s);return}o.editable?await Gh(t,r):await Zh(t,r)}function hl(t){t.editorHandle?.destroy?.(),t.editorHandle=null}function Yh(t){let{element:e}=t;t.destroyed=!0,hl(t),En(e),e.classList.remove("b-markdown","b-markdown-editable"),e.removeAttribute("data-status")}function Qh(t){t.classList.add("b-markdown");let e={element:t,options:Vh(t),destroyed:!1,editorHandle:null};return Jh(e),{destroy:()=>Yh(e)}}m.register("markdown",{type:"static",mount:Qh});function Xh(t){return t.classList.add("b-message"),t.setAttribute("b-att-side",t.getAttribute("b-att-side")||"incoming"),t.setAttribute("role",t.getAttribute("role")||"listitem"),{}}m.register("message",{type:"static",mount:Xh});function tm(t){t.classList.add("b-message-scroller");let e=()=>{t.getAttribute("b-att-autoscroll")!=="false"&&(t.scrollTop=t.scrollHeight)},o=new window.MutationObserver(e);return o.observe(t,{childList:!0,subtree:!0}),window.requestAnimationFrame(e),{destroy:()=>o.disconnect()}}m.register("message-scroller",{type:"owl",mount:tm});function em(t){t.setAttribute("role","menubar"),t.classList.add("b-menubar");for(let e of t.querySelectorAll("a, button"))e.setAttribute("role","menuitem");return{destroy:()=>t.classList.remove("b-menubar")}}m.register("menubar",{type:"static",mount:em});function om(t){return t.classList.add("form-select"),(t.getAttribute("b-att-size")==="sm"||t.getAttribute("b-att-size")==="lg")&&t.classList.add(`form-select-${t.getAttribute("b-att-size")}`),{destroy:()=>t.classList.remove("form-select","form-select-sm","form-select-lg")}}m.register("native-select",{type:"static",mount:om});function rm(t){t.classList.add("nav");let e=[...t.querySelectorAll("a, button")].filter(r=>!r.disabled);e.forEach(r=>r.classList.add("nav-link"));let o=r=>{let s=e.indexOf(r.target),a=r.key==="ArrowRight"?1:r.key==="ArrowLeft"?-1:0;!a||s<0||(r.preventDefault(),e[(s+a+e.length)%e.length]?.focus())};return t.setAttribute("role",t.getAttribute("role")||"menubar"),e.forEach(r=>r.setAttribute("role","menuitem")),t.addEventListener("keydown",o),{destroy:()=>t.removeEventListener("keydown",o)}}m.register("navigation-menu",{type:"owl",mount:rm});function sm(t){let e=t.querySelector("ol, ul")||t,o=[...e.children];return t.classList.add("b-pagination"),e.classList.add("pagination"),o.forEach(r=>{let s=r.querySelector("a, button");r.classList.add("page-item"),s?.classList.add("page-link"),s?.getAttribute("aria-current")==="page"&&r.classList.add("active"),(s?.hasAttribute("disabled")||s?.getAttribute("aria-disabled")==="true")&&r.classList.add("disabled")}),t.setAttribute("aria-label",t.getAttribute("aria-label")||"Pagination"),{destroy:()=>{t.classList.remove("b-pagination"),e.classList.remove("pagination")}}}m.register("pagination",{type:"owl",mount:sm});function nm(t){let e=t.querySelector("[b-popover-trigger]")||t,o=t.querySelector("[b-popover-content]"),r=o?o.innerHTML:"";o?.remove(),e.setAttribute("aria-haspopup","dialog");let s=new(z()).Popover(e,{content:r,html:!0,trigger:"click"}),a=()=>{t.setAttribute("b-att-state","open"),e.setAttribute("aria-expanded","true"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},c=()=>{t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};return e.addEventListener("shown.bs.popover",a),e.addEventListener("hidden.bs.popover",c),t.setAttribute("b-att-state","closed"),e.setAttribute("aria-expanded","false"),{destroy:()=>{e.removeEventListener("shown.bs.popover",a),e.removeEventListener("hidden.bs.popover",c),s.dispose()}}}m.register("popover",{type:"owl",mount:nm});function im(t){let e=Number(t.getAttribute("b-att-max")||t.getAttribute("aria-valuemax")||100),o=Math.min(e,Math.max(0,Number(t.getAttribute("b-att-value")||t.getAttribute("aria-valuenow")||0)));if(t.classList.add("progress","b-progress"),t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax",String(e)),t.setAttribute("aria-valuenow",String(o)),t.style.setProperty("--b-progress-value",`${o/e*100}%`),!t.querySelector("[b-progress-indicator]")){let r=document.createElement("span");r.className="progress-bar",r.setAttribute("b-progress-indicator",""),t.append(r)}return{destroy:()=>t.classList.remove("progress","b-progress")}}m.register("progress",{type:"static",mount:im});function am(t){let{open:e,close:o,destroy:r}=zn(t,{closeSelector:"[b-pwa-close]"});return t.NodexUIPwa={open:e,close:o},{destroy:()=>{r(),delete t.NodexUIPwa}}}m.register("pwa",{type:"owl",mount:am});function cm(t){return t.classList.add("card","b-card","b-qr-card"),{}}m.register("qr-card",{type:"static",mount:cm});function lm(t){let e=[...t.querySelectorAll("[b-question]")],o=t.querySelector("[b-question-prev]"),r=t.querySelector("[b-question-next]"),s=0,a=d=>{s=Math.min(e.length-1,Math.max(0,d)),e.forEach((f,v)=>{f.hidden=v!==s,f.setAttribute("b-att-state",v===s?"active":"inactive")}),o&&(o.disabled=s===0),r&&(r.disabled=s===e.length-1),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{index:s}}))},c=()=>a(s-1),l=()=>a(s+1);return o?.addEventListener("click",c),r?.addEventListener("click",l),e.length&&a(0),{destroy:()=>{o?.removeEventListener("click",c),r?.removeEventListener("click",l)}}}m.register("questionnaire",{type:"owl",mount:lm});m.register("radio-group",{type:"static",mount:t=>pi(t,"radio")});function um(t){let e=t.querySelector("[b-resizable-panel]")||t,o=t.querySelector("[b-resizable-handle]");if(!o)return{};let r=Number(t.getAttribute("b-att-min")||160),s=Number(t.getAttribute("b-att-max")||720),a=c=>{let l=c.clientX,d=e.getBoundingClientRect().width,f=O=>{e.style.width=`${Math.min(s,Math.max(r,d+O.clientX-l))}px`},v=()=>{document.removeEventListener("pointermove",f),document.removeEventListener("pointerup",v),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{width:e.style.width}}))};document.addEventListener("pointermove",f),document.addEventListener("pointerup",v)};return o.addEventListener("pointerdown",a),{destroy:()=>o.removeEventListener("pointerdown",a)}}m.register("resizable",{type:"owl",mount:um});function pm(t){return t.classList.add("b-scroll-area"),t.tabIndex=t.tabIndex>=0?t.tabIndex:0,t.setAttribute("role",t.getAttribute("role")||"region"),{}}m.register("scroll-area",{type:"static",mount:pm});function dm(t){let e=t.getAttribute("b-att-orientation")==="vertical";return t.classList.add("b-separator",e?"b-separator-vertical":"b-separator-horizontal"),t.setAttribute("role",t.getAttribute("role")||"separator"),t.setAttribute("aria-orientation",e?"vertical":"horizontal"),{destroy:()=>t.classList.remove("b-separator","b-separator-vertical","b-separator-horizontal")}}m.register("separator",{type:"static",mount:dm});function ml(t,{triggerSelector:e,panelSelector:o,ariaHaspopup:r,panelRole:s,onKeyDown:a}={}){let c=t.querySelector(e),l=t.querySelector(o),d=k=>{!l||!c||(l.hidden=!k,t.setAttribute("b-att-state",k?"open":"closed"),c.setAttribute("aria-expanded",String(k)),t.dispatchEvent(new CustomEvent(k?"nodexui:open":"nodexui:close",{bubbles:!0})))},f=()=>d(l?.hidden!==!1),v=k=>{k.key==="Escape"&&(d(!1),c?.focus()),a?.(k,{setOpen:d,panel:l,trigger:c})},O=k=>{t.contains(k.target)||d(!1)};return c?.setAttribute("aria-haspopup",r),l?.setAttribute("role",s),l&&(l.hidden=!0),c?.addEventListener("click",f),t.addEventListener("keydown",v),document.addEventListener("click",O),{trigger:c,panel:l,setOpen:d,destroy:()=>{c?.removeEventListener("click",f),t.removeEventListener("keydown",v),document.removeEventListener("click",O)}}}function hm(t){let{setOpen:e,destroy:o}=ml(t,{triggerSelector:"[b-select-trigger]",panelSelector:"[b-select-content]",ariaHaspopup:"listbox",panelRole:"listbox"}),r=t.querySelector("[b-select-trigger]"),s=t.querySelector("[b-select-value]"),a=c=>{let l=c.target.closest("[b-select-item]");if(!(!l||!t.contains(l))){for(let d of t.querySelectorAll("[b-select-item]"))d.setAttribute("aria-selected",String(d===l));s&&(s.textContent=l.textContent.trim()),t.setAttribute("b-att-value",l.getAttribute("b-att-value")||l.textContent.trim()),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.getAttribute("b-att-value")}})),e(!1),r?.focus()}};for(let c of t.querySelectorAll("[b-select-item]"))c.setAttribute("role","option");return t.addEventListener("click",a),{destroy:()=>{t.removeEventListener("click",a),o()}}}m.register("select",{type:"owl",mount:hm});function mm(t){let e=[...t.querySelectorAll("[b-shell-collapse-trigger]")],o=s=>{t.setAttribute("b-att-collapsed",s?"true":"false"),t.dispatchEvent(new CustomEvent(s?"nodexui:collapse":"nodexui:expand",{bubbles:!0}))},r=()=>o(t.getAttribute("b-att-collapsed")!=="true");return e.forEach(s=>s.addEventListener("click",r)),o(t.getAttribute("b-att-collapsed")==="true"),t.NodexUIShell={collapse:()=>o(!0),expand:()=>o(!1),toggle:r},{destroy:()=>{e.forEach(s=>s.removeEventListener("click",r)),delete t.NodexUIShell}}}m.register("shell",{type:"owl",mount:mm});function fm(t){let e=t.getAttribute("b-att-side")==="left"?"offcanvas-start":"offcanvas-end";t.classList.add("offcanvas",e,"b-sheet-overlay"),t.setAttribute("tabindex","-1"),[...t.querySelectorAll("[b-sheet-close]")].forEach(s=>s.setAttribute("data-bs-dismiss","offcanvas"));let r=z().Offcanvas.getOrCreateInstance(t,{backdrop:!0,keyboard:!0,scroll:!1});return un(t,r,"offcanvas","NodexUISheet")}m.register("sheet",{type:"owl",mount:fm});var bm={"[b-sidebar-header]":["b-sidebar-header","sidebar-header","header"],"[b-sidebar-content]":["b-sidebar-content","sidebar-content","content"],"[b-sidebar-footer]":["b-sidebar-footer","sidebar-footer","footer"],"[b-sidebar-group]":["b-sidebar-group","sidebar-group","group"],"[b-sidebar-group-label]":["b-sidebar-group-label","sidebar-group-label","group-label"],"[b-sidebar-group-action]":["b-sidebar-group-action","sidebar-group-action","group-action"],"[b-sidebar-group-content]":["b-sidebar-group-content","sidebar-group-content","group-content"],"[b-sidebar-menu]":["b-sidebar-menu","sidebar-menu","menu"],"[b-sidebar-menu-item]":["b-sidebar-menu-item","sidebar-menu-item","menu-item"],"[b-sidebar-menu-button]":["b-sidebar-menu-button","sidebar-menu-button","menu-button"],"[b-sidebar-menu-action]":["b-sidebar-menu-action","sidebar-menu-action","menu-action"],"[b-sidebar-menu-badge]":["b-sidebar-menu-badge","sidebar-menu-badge","menu-badge"],"[b-sidebar-menu-sub]":["b-sidebar-menu-sub","sidebar-menu-sub","menu-sub"],"[b-sidebar-menu-sub-item]":["b-sidebar-menu-sub-item","sidebar-menu-sub-item","menu-sub-item"],"[b-sidebar-menu-sub-button]":["b-sidebar-menu-sub-button","sidebar-menu-sub-button","menu-sub-button"],"[b-sidebar-separator]":["b-sidebar-separator","sidebar-separator","separator"]};function gm(t){let e=[];for(let[o,[r,s,a]]of Object.entries(bm))for(let c of t.querySelectorAll(o))c.classList.add(r),c.dataset.slot=s,c.dataset.sidebar=a,(c.hasAttribute("b-att-active")||c.getAttribute("aria-current")==="page")&&(c.classList.add("is-active"),c.dataset.active="true"),e.push([c,r]);return e}function vm(t){let e=t.getAttribute("b-att-trigger")?document.querySelector(t.getAttribute("b-att-trigger")):null,o=[...t.querySelectorAll("[b-sidebar-close]")],r=gm(t),s=d=>{t.setAttribute("b-att-state",d?"open":"closed"),t.classList.toggle("is-open",d),t.dataset.state=d?"expanded":"collapsed",t.dispatchEvent(new CustomEvent(d?"nodexui:open":"nodexui:close",{bubbles:!0}))},a=()=>s(!0),c=()=>s(!1),l=d=>{d.key==="Escape"&&c()};return e?.addEventListener("click",a),o.forEach(d=>d.addEventListener("click",c)),t.addEventListener("keydown",l),t.dataset.sidebar="sidebar",t.dataset.slot="sidebar",s(t.getAttribute("b-att-state")==="open"),t.NodexUISidebar={open:a,close:c},{destroy:()=>{e?.removeEventListener("click",a),o.forEach(d=>d.removeEventListener("click",c)),t.removeEventListener("keydown",l);for(let[d,f]of r)d.classList.remove(f,"is-active"),d.removeAttribute("data-slot"),d.removeAttribute("data-sidebar"),d.removeAttribute("data-active");t.removeAttribute("data-sidebar"),t.removeAttribute("data-slot"),t.removeAttribute("data-state"),delete t.NodexUISidebar}}}m.register("sidebar",{type:"owl",mount:vm});function xm(t){t.classList.add("b-slider");let e=()=>{t.style.setProperty("--b-slider-value",`${t.value}%`),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:t.value}}))};return e(),t.addEventListener("input",e),{destroy:()=>{t.removeEventListener("input",e),t.classList.remove("b-slider")}}}m.register("slider",{type:"static",mount:xm});function ym(t){let e=t.getAttribute("b-att-shape")==="circle"?"b-skeleton-circle":"b-skeleton-block";return t.classList.add("b-skeleton",e),t.setAttribute("aria-hidden",t.getAttribute("aria-hidden")||"true"),{destroy:()=>t.classList.remove("b-skeleton","b-skeleton-circle","b-skeleton-block")}}m.register("skeleton",{type:"static",mount:ym});function wm(t){let e=t.getAttribute("b-att-type")==="grow",o=t.getAttribute("b-att-label")||"Loading";if(t.classList.add(e?"spinner-grow":"spinner-border"),t.setAttribute("role",t.getAttribute("role")||"status"),!t.querySelector(".visually-hidden")){let r=document.createElement("span");r.className="visually-hidden",r.textContent=o,t.append(r)}return{destroy:()=>t.classList.remove("spinner-border","spinner-grow")}}m.register("spinner",{type:"static",mount:wm});function Sm(t){let e=t.matches("input")?t:t.querySelector("input[type='checkbox']"),o=t.matches("input")?t.closest("label, .form-check"):t;return e?.classList.add("form-check-input"),e?.setAttribute("role",e.getAttribute("role")||"switch"),o?.classList.add("form-check","form-switch","b-switch"),{destroy:()=>{e?.classList.remove("form-check-input"),o?.classList.remove("form-check","form-switch","b-switch")}}}m.register("switch",{type:"static",mount:Sm});function Am(t){if(t.classList.add("table","b-table"),t.getAttribute("b-att-striped")!=="false"&&t.classList.add("table-striped"),t.getAttribute("b-att-hover")!=="false"&&t.classList.add("table-hover"),t.getAttribute("b-att-responsive")==="true"&&!t.parentElement?.classList.contains("table-responsive")){let e=document.createElement("div");return e.className="table-responsive",t.before(e),e.append(t),{destroy:()=>{e.before(t),e.remove(),t.classList.remove("table","b-table","table-striped","table-hover")}}}return{destroy:()=>t.classList.remove("table","b-table","table-striped","table-hover")}}m.register("table",{type:"static",mount:Am});function Em(t,e,o){t.setAttribute("b-att-value",o),e.forEach(r=>{r.tabIndex=r.getAttribute("b-tab")===o?0:-1}),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:o}}))}function Cm(t,e,o){let r=jn(t.key,e,o.length);if(r===-1)return;t.preventDefault();let s=o[r];s.focus(),z().Tab.getOrCreateInstance(s).show()}function Lm(t,e,o,r,s){let a=e[o],c=a.getAttribute("b-tab"),l=r.get(c),d=c===s;if(a.setAttribute("role","tab"),a.classList.add("nav-link"),a.tabIndex=d?0:-1,d&&a.classList.add("active"),l){let D=l.id||`b-tabs-panel-${c}`;l.id=D,l.setAttribute("role","tabpanel"),l.classList.add("tab-pane","fade"),d&&l.classList.add("show","active"),a.setAttribute("data-bs-target",`#${D}`)}let f=z().Tab.getOrCreateInstance(a),v=()=>f.show(),O=()=>Em(t,e,c),k=D=>Cm(D,o,e);return a.addEventListener("click",v),a.addEventListener("shown.bs.tab",O),a.addEventListener("keydown",k),()=>{a.removeEventListener("click",v),a.removeEventListener("keydown",k),a.removeEventListener("shown.bs.tab",O),f.dispose()}}function km(t){t.classList.add("b-tabs-host");let e=[...t.querySelectorAll("[b-tab]")],o=[...t.querySelectorAll("[b-panel]")],r=new Map(o.map(l=>[l.getAttribute("b-panel"),l])),s=e[0]?.parentElement;s&&!s.hasAttribute("role")&&s.setAttribute("role","tablist"),s?.classList.add("nav");let a=t.getAttribute("b-att-value")||e[0]?.getAttribute("b-tab")||"",c=e.map((l,d)=>Lm(t,e,d,r,a));return a&&t.setAttribute("b-att-value",a),{destroy:()=>c.forEach(l=>l())}}m.register("tabs",{type:"owl",mount:km});function Nm(t){return t.classList.add("form-control"),t.getAttribute("b-att-resize")==="none"&&t.classList.add("b-textarea-no-resize"),{destroy:()=>t.classList.remove("form-control","b-textarea-no-resize")}}m.register("textarea",{type:"static",mount:Nm});function Tm(t){let e=t.querySelector("template, script[type='text/html']");return e?e.tagName==="TEMPLATE"?e.innerHTML:e.textContent:t.getAttribute("b-att-content")||t.innerHTML||""}function Om(t){let e=t.getAttribute("b-att-provider")||void 0,o=t.getAttribute("b-att-url")||void 0;return{src:t.getAttribute("b-att-src"),providerType:e,room:t.getAttribute("b-att-room")||"b-text-editor",url:o,collaborative:li({collaborative:t.getAttribute("b-att-collaborative")==="true",providerType:e,url:o}),password:t.getAttribute("b-att-password")||void 0,signaling:hi(t.getAttribute("b-att-signaling")),placeholder:t.getAttribute("b-att-placeholder")||void 0}}function fl(t,e){if(t.destroyed)return;let{element:o}=t;o.setAttribute("data-status","error"),o.textContent=`Unable to mount text editor: ${e?.message||e}`,o.dispatchEvent(new CustomEvent("nodexui:text-editor-error",{bubbles:!0,detail:{error:e}}))}function bl(t){t.editorHandle?.destroy?.(),t.editorHandle=null}async function Im(t,e){let{element:o,options:r}=t,{collaborative:s,room:a}=r;o.replaceChildren();let c=document.createElement("div");c.className="b-text-editor-shell",c.setAttribute("data-slot","text-editor-shell"),c.setAttribute("role","group"),c.setAttribute("aria-label",s?"Collaborative rich text editor":"Rich text editor"),o.append(c);try{t.editorHandle=await ci({root:c,value:e,placeholder:r.placeholder,collaborative:s,providerType:r.providerType,room:a,url:r.url,password:r.password,signaling:r.signaling,onChange:(l,d)=>{o.dispatchEvent(new CustomEvent("nodexui:text-editor-change",{bubbles:!0,detail:{html:l,previousHtml:d}}))}})}catch(l){fl(t,l);return}if(t.destroyed){bl(t);return}o.setAttribute("data-status","ready"),o.dispatchEvent(new CustomEvent("nodexui:text-editor-ready",{bubbles:!0,detail:{collaborative:s,room:a}}))}async function Rm(t){let{element:e,options:o}=t;e.setAttribute("data-status","loading");let r=Tm(e);if(o.src)try{r=await mi(o.src)}catch(s){fl(t,s);return}await Im(t,r)}function Bm(t){t.destroyed=!0,bl(t),t.element.classList.remove("b-text-editor"),t.element.removeAttribute("data-status")}function $m(t){t.classList.add("b-text-editor");let e={element:t,options:Om(t),destroyed:!1,editorHandle:null};return Rm(e),{destroy:()=>Bm(e)}}m.register("text-editor",{type:"static",mount:$m});function Mm(t,e){let o=dn(e);t.classList.remove(...ac),t.className=`${t.className} ${Vn({variant:t.getAttribute("b-att-variant")||"outline",size:t.getAttribute("b-att-size")})}`.trim(),t.type=t.getAttribute("type")||"button",t.setAttribute("aria-label",o.label),t.setAttribute("title",o.label),t.setAttribute("aria-pressed",o.pressed);let r=t.querySelector("[b-theme-button-icon]");r||(r=document.createElement("span"),r.setAttribute("b-theme-button-icon",""),t.prepend(r)),r.setAttribute("b-icon",o.icon),ut(r,o.icon,{baseUrl:t.getAttribute("b-icon-base-url")||t.getAttribute("b-att-base-url")});let s=t.querySelector("[b-theme-button-label]");s||(s=document.createElement("span"),s.className="visually-hidden",s.setAttribute("b-theme-button-label",""),t.append(s)),s.textContent=o.label}function Um(t){let e=Pe({storageKey:t.getAttribute("b-att-storage-key")||void 0,toggleSelector:"[b-theme-toggle]",labelSelector:"[b-theme-label]"}),o=(a=e.current())=>Mm(t,a),r=()=>o(e.toggle()),s=a=>o(a.detail?.theme);return o(e.set(e.current(),{skipStorage:!0})),t.addEventListener("click",r),document.addEventListener("nodexui:theme-change",s),{destroy:()=>{t.removeEventListener("click",r),document.removeEventListener("nodexui:theme-change",s)}}}m.register("theme-button",{type:"static",mount:Um});function _m(t){let e=[...t.querySelectorAll("[b-toast-close]")],o=t.getAttribute("b-att-delay"),r=o===null?3e3:Number(o),s=Hn(t.getAttribute("b-att-position"));t.className=g(t.className,"toast","fade",s),t.setAttribute("role",t.getAttribute("b-att-variant")==="danger"?"alert":"status"),e.forEach(v=>v.setAttribute("data-bs-dismiss","toast"));let a=new(z()).Toast(t,{autohide:r>0,delay:r||3e3}),c=()=>{t.setAttribute("b-att-state","open"),t.dispatchEvent(new CustomEvent("nodexui:open",{bubbles:!0}))},l=()=>{t.setAttribute("b-att-state","closed"),t.dispatchEvent(new CustomEvent("nodexui:close",{bubbles:!0}))};t.addEventListener("shown.bs.toast",c),t.addEventListener("hidden.bs.toast",l);let d=()=>a.show(),f=()=>a.hide();return t.getAttribute("b-att-state")==="open"&&d(),t.NodexUIToast={show:d,hide:f},{destroy:()=>{t.removeEventListener("shown.bs.toast",c),t.removeEventListener("hidden.bs.toast",l),a.dispose(),delete t.NodexUIToast}}}m.register("toast",{type:"owl",mount:_m});function Pm(t){let e=t.querySelector("[b-tooltip-trigger]")||t,o=t.querySelector("[b-tooltip-content]");!o&&t.getAttribute("b-att-content")&&(o=document.createElement("span"),o.setAttribute("b-tooltip-content",""),o.textContent=t.getAttribute("b-att-content"),t.appendChild(o));let r=o?o.innerHTML:"";o?.remove();let s=new(z()).Tooltip(e,{title:r,html:!0,trigger:"hover focus"}),a=()=>t.setAttribute("b-att-state","open"),c=()=>t.setAttribute("b-att-state","closed");return e.addEventListener("shown.bs.tooltip",a),e.addEventListener("hidden.bs.tooltip",c),t.setAttribute("b-att-state","closed"),{destroy:()=>{e.removeEventListener("shown.bs.tooltip",a),e.removeEventListener("hidden.bs.tooltip",c),s.dispose()}}}m.register("tooltip",{type:"owl",mount:Pm});function qm(t){t.classList.add("btn",t.getAttribute("b-att-variant")==="outline"?"btn-outline-secondary":"btn-light"),t.setAttribute("aria-pressed",t.getAttribute("aria-pressed")||"false");let e=()=>{let o=t.getAttribute("aria-pressed")!=="true";t.setAttribute("aria-pressed",String(o)),t.setAttribute("b-att-state",o?"on":"off"),t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{pressed:o}}))};return t.addEventListener("click",e),{destroy:()=>t.removeEventListener("click",e)}}m.register("toggle",{type:"owl",mount:qm});function Dm(t){let e=[...t.querySelectorAll("[b-att-value], button")],o=t.getAttribute("b-att-multiple")==="true";t.classList.add("btn-group"),t.setAttribute("role",o?"group":"radiogroup"),e.forEach(s=>{s.classList.add("btn","btn-outline-secondary"),s.setAttribute("aria-pressed",s.getAttribute("aria-pressed")||"false")});let r=s=>{let a=s.target.closest("button, [b-att-value]");if(!a||!t.contains(a))return;o||e.forEach(l=>l.setAttribute("aria-pressed","false")),a.setAttribute("aria-pressed",String(a.getAttribute("aria-pressed")!=="true"));let c=e.filter(l=>l.getAttribute("aria-pressed")==="true").map(l=>l.getAttribute("b-att-value")||l.textContent.trim());t.dispatchEvent(new CustomEvent("nodexui:change",{bubbles:!0,detail:{value:o?c:c[0]}}))};return t.addEventListener("click",r),{destroy:()=>t.removeEventListener("click",r)}}m.register("toggle-group",{type:"owl",mount:Dm});var gl={lead:"lead",muted:"text-body-secondary",code:"b-code",kbd:"b-kbd",h1:"h1",h2:"h2",h3:"h3",h4:"h4",blockquote:"blockquote",small:"small",list:"b-list"};function jm(t){let e=gl[t.getAttribute("b-att-variant")||"body"];return t.classList.add("b-typography"),e&&t.classList.add(e),{destroy:()=>t.classList.remove("b-typography",...Object.values(gl))}}m.register("typography",{type:"static",mount:jm});yi(ui);la(pa);ua();var vl=m;return Nl(Fm);})();